1 import FWCore.ParameterSet.Config
as cms
5 produce_by_run : bool=
False,
7 save_edmnano : bool=
False,
8 save_flatnano : bool=
True):
10 Customize the process to include the entire EcalPhiSym workflow: 12 - PhiSymRecHit producer 13 - EDM output (standard, EDMNANO, FlatNANO) 20 save_edmnano=save_edmnano,
21 save_flatnano=save_flatnano)
23 process.path = cms.Path(reco*tables)
24 process.output_step = cms.EndPath()
26 process.output_step += out
27 process.schedule = cms.Schedule(process.path, process.output_step)
31 Customize process to include the EcalPhiSym standard reco sequence 34 process.load(
'RecoLuminosity.LumiProducer.bunchSpacingProducer_cfi')
35 process.load(
'RecoLocalCalo.EcalRecProducers.ecalMultiFitUncalibRecHit_cfi')
36 process.load(
'RecoLocalCalo.EcalRecProducers.ecalUncalibRecHit_cfi')
37 process.load(
'RecoLocalCalo.EcalRecProducers.ecalRecHit_cfi')
40 process.ecalMultiFitUncalibRecHit.EBdigiCollection = cms.InputTag(
"hltEcalPhiSymFilter",
"phiSymEcalDigisEB")
41 process.ecalMultiFitUncalibRecHit.EEdigiCollection = cms.InputTag(
"hltEcalPhiSymFilter",
"phiSymEcalDigisEE")
44 process.ecalRecHit.killDeadChannels = cms.bool(
False )
45 process.ecalRecHit.recoverEBVFE = cms.bool(
False )
46 process.ecalRecHit.recoverEEVFE = cms.bool(
False )
47 process.ecalRecHit.recoverEBFE = cms.bool(
False )
48 process.ecalRecHit.recoverEEFE = cms.bool(
False )
49 process.ecalRecHit.recoverEEIsolatedChannels = cms.bool(
False )
50 process.ecalRecHit.recoverEBIsolatedChannels = cms.bool(
False )
53 process.load(
'Calibration.EcalCalibAlgos.EcalPhiSymRecHitProducers_cfi')
56 reconstruction_step = cms.Sequence( process.bunchSpacingProducer * (process.ecalMultiFitUncalibRecHit + process.ecalRecHit) )
57 reconstruction_step *= process.EcalPhiSymRecHitProducerRun
if produce_by_run
else process.EcalPhiSymRecHitProducerLumi
59 return reconstruction_step
63 Add the NanoAOD flat table producers. 64 This functions adjust also the output columns. 65 Should be called once nMisCalib has been set in the EcalPhiSymRecHitProducer 68 process.load(
'Calibration.EcalCalibAlgos.EcalPhiSymFlatTableProducers_cfi')
70 nmis = process.EcalPhiSymRecHitProducerRun.nMisCalib.value()
71 for imis
in range(1, nmis+1):
74 var_name =
'sumEt_m'+
str(
abs(
int(imis-(nmis/2)-1)))
75 var =
Var(f
'sumEt({imis})', float, doc=
'ECAL PhiSym rechits: '+
str(imis-(nmis/2)-1)+
'*miscalib et', precision=23)
77 var_name =
'sumEt_p'+
str(
int(imis-(nmis/2)))
78 var =
Var(f
'sumEt({imis})', float, doc=
'ECAL PhiSym rechits: '+
str(imis-(nmis/2))+
'*miscalib et', precision=23)
81 setattr(process.ecalPhiSymRecHitRunTableEB.variables, var_name, var)
82 setattr(process.ecalPhiSymRecHitRunTableEE.variables, var_name, var)
83 flattable_sequence = cms.Sequence( process.ecalPhiSymRecHitRunTableEB +
84 process.ecalPhiSymRecHitRunTableEE +
85 process.ecalPhiSymInfoRunTable )
87 setattr(process.ecalPhiSymRecHitLumiTableEB.variables, var_name, var)
88 setattr(process.ecalPhiSymRecHitLumiTableEE.variables, var_name, var)
89 flattable_sequence = cms.Sequence( process.ecalPhiSymRecHitLumiTableEB +
90 process.ecalPhiSymRecHitLumiTableEE +
91 process.ecalPhiSymInfoLumiTable
94 return flattable_sequence
97 save_edm : bool=
False,
98 save_edmnano : bool=
False,
99 save_flatnano : bool=
True):
101 Customize EcalPhiSym output 106 if save_flatnano
or save_edmnano:
107 NanoAODEcalPhiSymEventContent = cms.PSet(
108 outputCommands = cms.untracked.vstring(
110 "keep nanoaod*_*_*_*",
111 "keep nanoaodMergeableCounterTable_*Table_*_*",
112 "keep nanoaodUniqueString_nanoMetadata_*_*",
117 process.nanoout = cms.OutputModule(
"NanoAODOutputModule",
118 fileName = cms.untracked.string(
'ecal_phisym_nano.root'),
119 outputCommands = NanoAODEcalPhiSymEventContent.outputCommands,
120 compressionLevel = cms.untracked.int32(9),
121 compressionAlgorithm = cms.untracked.string(
"LZMA"),
123 outputs.append(process.nanoout)
126 process.nanooutedm = cms.OutputModule(
"PoolOutputModule",
127 fileName = cms.untracked.string(
'ecal_phisym_edmnano.root'),
128 outputCommands = NanoAODEcalPhiSymEventContent.outputCommands,
130 outputs.append(process.nanooutedm)
133 ECALPHISYM_output_commands = cms.untracked.vstring(
135 "keep *_PhiSymProducerRun_*_*")
137 process.EcalPhiSymOutput = cms.OutputModule(
"PoolOutputModule",
138 splitLevel = cms.untracked.int32(2),
139 compressionLevel = cms.untracked.int32(5),
140 compressionAlgorithm = cms.untracked.string(
'LZMA'),
141 outputCommands = ECALPHISYM_output_commands,
142 fileName = cms.untracked.string(
'ecal_phisym_reco.root')
144 outputs.append(process.EcalPhiSymOutput)
150 Function to customize the process produced by cmsDriver. 151 The customisation works for a process that satisfies the following conditions: 152 - Run on /AlCaPhiSym/*/RAW data 153 - Run the following sequence (-s option of cmsDriver): 154 RECO:bunchSpacingProducer+ecalMultiFitUncalibRecHitTask+ecalCalibratedRecHitTask,ALCA:EcalPhiSymByRun (or EcalPhiSymByLumi) 158 process.ecalMultiFitUncalibRecHit.cpu.EBdigiCollection = cms.InputTag(
"hltEcalPhiSymFilter",
"phiSymEcalDigisEB")
159 process.ecalMultiFitUncalibRecHit.cpu.EEdigiCollection = cms.InputTag(
"hltEcalPhiSymFilter",
"phiSymEcalDigisEE")
160 process.ecalRecHit.cpu.killDeadChannels = cms.bool(
False )
161 process.ecalRecHit.cpu.recoverEBVFE = cms.bool(
False )
162 process.ecalRecHit.cpu.recoverEEVFE = cms.bool(
False )
163 process.ecalRecHit.cpu.recoverEBFE = cms.bool(
False )
164 process.ecalRecHit.cpu.recoverEEFE = cms.bool(
False )
165 process.ecalRecHit.cpu.recoverEEIsolatedChannels = cms.bool(
False )
166 process.ecalRecHit.cpu.recoverEBIsolatedChannels = cms.bool(
False )
168 if "ALCARECOStreamEcalPhiSymByRunOutPath" in process.pathNames():
169 process.schedule.remove(process.ALCARECOStreamEcalPhiSymByRunOutPath)
170 if "ALCARECOStreamEcalPhiSymByLumiOutPath" in process.pathNames():
171 process.schedule.remove(process.ALCARECOStreamEcalPhiSymByLumiOutPath)
172 process.ALCARECOStreamEcalPhiSymOutNanoPath = cms.EndPath(
ecal_phisym_output(process, save_flatnano=
True)[0])
173 process.schedule.append(process.ALCARECOStreamEcalPhiSymOutNanoPath)
def ecal_phisym_reco_sequence
def Var(expr, valtype, compression=None, doc=None, mcOnly=False, precision=-1)
Abs< T >::type abs(const T &t)
def ecal_phisym_flattables