File indexing completed on 2024-04-06 12:25:50
0001 from __future__ import print_function
0002 import FWCore.ParameterSet.Config as cms
0003
0004 maxevents=10
0005 isMC=False
0006
0007
0008
0009 process = cms.Process('TEST')
0010
0011
0012
0013 process.load('Configuration.StandardSequences.Services_cff')
0014 process.load('Configuration/StandardSequences/GeometryExtended_cff')
0015 process.load('Configuration/StandardSequences/Reconstruction_cff')
0016 process.load("Configuration/StandardSequences/FrontierConditions_GlobalTag_cff")
0017
0018
0019
0020
0021 if (isMC):
0022 process.GlobalTag.globaltag ='START3X_V16D::All'
0023
0024
0025 else:
0026 process.GlobalTag.globaltag ='GR09_R_34X_V5::All'
0027
0028
0029
0030
0031
0032
0033 process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(maxevents) )
0034 process.source = cms.Source (
0035 "PoolSource",
0036 fileNames = cms.untracked.vstring(
0037 '/store/data/BeamCommissioning09/ZeroBias/RECO/Feb9ReReco_v2/0027/F08E9178-7016-DF11-82B4-00163E0101D2.root',
0038 ),
0039 duplicateCheckMode = cms.untracked.string("noDuplicateCheck"),
0040 secondaryFileNames = cms.untracked.vstring()
0041 )
0042
0043 process.load("FWCore.MessageLogger.MessageLogger_cfi")
0044 process.MessageLogger.cerr.FwkReport.reportEvery = 1
0045 process.MessageLogger.cerr.default.limit = 100
0046
0047
0048 process.options = cms.untracked.PSet( wantSummary = cms.untracked.bool(True) )
0049 process.load("hcalrechitreflagger_cfi")
0050
0051
0052 process.towerMakerPET = process.towerMaker.clone()
0053 process.towerMakerPET.hfInput = cms.InputTag("hcalrechitReflagger")
0054 process.metPET = process.met.clone()
0055 process.metPET.src = cms.InputTag("towerMakerPET")
0056 process.ak5CaloJetsPET = process.ak5CaloJets.clone()
0057 process.ak5CaloJetsPET.src = cms.InputTag("towerMakerPET")
0058
0059
0060 process.output = cms.OutputModule("PoolOutputModule",
0061 splitLevel = cms.untracked.int32(0),
0062
0063 fileName = cms.untracked.string('output_file.root')
0064 )
0065
0066
0067
0068
0069
0070
0071
0072
0073 print("STARTING SL:")
0074 for i in process.hcalRecAlgos.SeverityLevels:
0075 print(i)
0076
0077
0078
0079 severitylevels=[]
0080 AddedFlag=False
0081 NewSevLevel=10
0082 for i in range(len(process.hcalRecAlgos.SeverityLevels)):
0083 severitylevels.append(process.hcalRecAlgos.SeverityLevels[i].Level.value())
0084 flagvec=process.hcalRecAlgos.SeverityLevels[i].RecHitFlags.value()
0085 flaglevel=process.hcalRecAlgos.SeverityLevels[i].Level.value()
0086 if "UserDefinedBit0" in flagvec and flaglevel!=10:
0087 flagvec.remove("UserDefinedBit0")
0088 process.hcalRecAlgos.SeverityLevels[i].RecHitFlags=flagvec
0089 print("Removed 'UserDefinedBit0' from severity level %i"%(process.hcalRecAlgos.SeverityLevels[i].Level.value()))
0090 if (flaglevel==NewSevLevel):
0091 print("FOUND LEVEL %i!"%NewSevLevel)
0092 if "UserDefinedBit0" not in flagvec:
0093 if (flagvec!=['']):
0094 flagvec.append("UserDefinedBit0")
0095 else:
0096 flagvec=["UserDefinedBit0"]
0097 process.hcalRecAlgos.SeverityLevels[i].RecHitFlags=flagvec
0098 AddedFlag=True
0099 if (AddedFlag==False):
0100 print("Found no Severity Level = %i; Adding it now"%NewSevLevel)
0101 process.hcalRecAlgos.SeverityLevels.append(cms.PSet(Level=cms.int32(NewSevLevel),
0102 RecHitFlags=cms.vstring("UserDefinedBit0"),
0103 ChannelStatus=cms.vstring("")))
0104
0105 print("New Severity Levels:")
0106 for i in process.hcalRecAlgos.SeverityLevels:
0107 print(i)
0108
0109
0110
0111 process.reflagging_step = cms.Path(process.hcalrechitReflagger)
0112 process.reconstruction_step = cms.Path(process.towerMakerPET*(process.metPET+process.ak5CaloJetsPET))
0113 process.out_step = cms.EndPath(process.output)
0114
0115 process.schedule = cms.Schedule(process.reflagging_step,process.reconstruction_step,process.out_step)
0116