1 from __future__
import print_function
2 import FWCore.ParameterSet.Config
as cms
6 """Customise digi/reco geometry to use unganged ME1/a channels
8 if hasattr(process,
"CSCGeometryESModule"):
9 process.CSCGeometryESModule.useGangedStripsInME1a =
False
10 if hasattr(process,
"idealForDigiCSCGeometry"):
11 process.idealForDigiCSCGeometry.useGangedStripsInME1a =
False
16 """CSC digitizer customization
17 with bunchTimingOffsets tuned to center trigger stubs at bx6
18 when pretrigger with 3 layers and median stub timing are used
28 process.simMuonCSCDigis.strips.bunchTimingOffsets = cms.vdouble(0.0,
29 37.53, 37.66, 55.4, 48.2, 54.45, 53.78, 53.38, 54.12, 51.98, 51.28)
30 process.simMuonCSCDigis.wires.bunchTimingOffsets = cms.vdouble(0.0,
31 22.88, 22.55, 29.28, 30.0, 30.0, 30.5, 31.0, 29.5, 29.1, 29.88)
37 """ Pick up upgrade condions data directly from DB tags using ESPrefer's.
38 Might be useful when dealing with a global tag that doesn't include
39 'unganged' CSC conditions.
42 (
'CSCDBGainsRcd',
'CSCDBGains_ungangedME11A_mc'),
43 (
'CSCDBNoiseMatrixRcd',
'CSCDBNoiseMatrix_ungangedME11A_mc'),
44 (
'CSCDBCrosstalkRcd',
'CSCDBCrosstalk_ungangedME11A_mc'),
45 (
'CSCDBPedestalsRcd',
'CSCDBPedestals_ungangedME11A_mc'),
46 (
'CSCDBGasGainCorrectionRcd',
'CSCDBGasGainCorrection_ungangedME11A_mc'),
47 (
'CSCDBChipSpeedCorrectionRcd',
'CSCDBChipSpeedCorrection_ungangedME11A_mc')
51 for (classname, tag)
in myconds:
53 sourcename =
'unganged_' + classname
54 process.__setattr__(sourcename, cscConditions.clone())
55 process.__getattribute__(sourcename).toGet = cms.VPSet( cms.PSet( record = cms.string(classname), tag = cms.string(tag)) )
56 process.__getattribute__(sourcename).connect = cms.string(
'frontier://FrontierProd/CMS_CONDITIONS')
57 process.__setattr__(
'esp_' + classname, cms.ESPrefer(
"PoolDBESSource", sourcename) )
65 """Settings for the upgrade raw vs offline condition channel translation
67 if hasattr(process,
"CSCIndexerESProducer"):
68 process.CSCIndexerESProducer.AlgoName=cms.string(
"CSCIndexerPostls1")
69 if hasattr(process,
"CSCChannelMapperESProducer"):
70 process.CSCChannelMapperESProducer.AlgoName=cms.string(
"CSCChannelMapperPostls1")
75 """Remove process.module_name from all the paths in process:
79 if not hasattr(process, module_name):
83 for path_name
in process._Process__paths.keys():
84 the_path = getattr(process, path_name)
85 module_names = the_path.moduleNames()
86 if module_name
in module_names:
87 the_path.remove(getattr(process, module_name))
92 """A sanity check to make sure that standard cmsDriver paths
93 have modules with expected names. If some paths would not have
94 expected modules, the procedure would only print WARNINGs.
98 (
'digitisation_step',
'simMuonCSCDigis'),
99 (
'L1simulation_step',
'simCscTriggerPrimitiveDigis'),
100 (
'L1simulation_step',
'simCsctfTrackDigis'),
101 (
'raw2digi_step',
'muonCSCDigis'),
102 (
'raw2digi_step',
'csctfDigis'),
103 (
'digi2raw_step',
'cscpacker'),
104 (
'digi2raw_step',
'csctfpacker'),
105 (
'reconstruction',
'csc2DRecHits'),
106 (
'dqmoffline_step',
'muonAnalyzer')
111 for path_name, module_name
in paths_modules:
112 if hasattr(process, path_name)
and not hasattr(process, module_name):
113 print(
"WARNING: module %s is not in %s path!!!" % (module_name, path_name))
114 print(
" This path has the following modules:")
115 print(
" ", getattr(process, path_name).moduleNames(),
"\n")
121 """Customise digi/reco geometry to use unganged ME1/a channels
128 """Customise CSC digitization to use unganged ME1/a channels
136 """Configure the local CSC trigger stubs emulator with the upgrade
137 algorithm version that efficiently uses unganged ME1a
142 from L1Trigger.CSCTriggerPrimitives.cscTriggerPrimitiveDigisPostLS1_cfi
import cscTriggerPrimitiveDigisPostLS1
143 process.simCscTriggerPrimitiveDigis = cscTriggerPrimitiveDigisPostLS1
144 process.simCscTriggerPrimitiveDigis.CSCComparatorDigiProducer = cms.InputTag(
'simMuonCSCDigis',
'MuonCSCComparatorDigi')
145 process.simCscTriggerPrimitiveDigis.CSCWireDigiProducer = cms.InputTag(
'simMuonCSCDigis',
'MuonCSCWireDigi')
151 """Regular CSCTF configuration adapted to deal with unganged ME1a
153 from L1Trigger.CSCTrackFinder.csctfTrackDigisUngangedME1a_cfi
import csctfTrackDigisUngangedME1a
154 process.simCsctfTrackDigis = csctfTrackDigisUngangedME1a
155 process.simCsctfTrackDigis.DTproducer = cms.untracked.InputTag(
"simDtTriggerPrimitiveDigis")
156 process.simCsctfTrackDigis.SectorReceiverInput = cms.untracked.InputTag(
"simCscTriggerPrimitiveDigis",
"MPCSORTED")
162 """Customise both stubs and TF emulators
170 """Use 2013 a.k.a. post-LS1 version
172 process.cscpacker.useFormatVersion = cms.uint32(2013)
173 process.cscpacker.usePreTriggers = cms.bool(
False)
174 process.cscpacker.packEverything = cms.bool(
True)
179 """Do nothing at the moment
185 """Adjust L1Extra producer's input tags for the use case
186 when we want to run L1Extra without packing-unpacking first
188 l1ep = process.l1extraParticles
193 l1ep.muonSource = cms.InputTag(
'simGmtDigis')
194 l1ep.etTotalSource = cms.InputTag(
'simGctDigis')
195 l1ep.nonIsolatedEmSource = cms.InputTag(
'simGctDigis',
'nonIsoEm')
196 l1ep.etMissSource = cms.InputTag(
'simGctDigis')
197 l1ep.forwardJetSource = cms.InputTag(
'simGctDigis',
'forJets')
198 l1ep.centralJetSource = cms.InputTag(
'simGctDigis',
'cenJets')
199 l1ep.tauJetSource = cms.InputTag(
'simGctDigis',
'tauJets')
200 l1ep.isolatedEmSource = cms.InputTag(
'simGctDigis',
'isoEm')
201 l1ep.etHadSource = cms.InputTag(
'simGctDigis')
202 l1ep.htMissSource = cms.InputTag(
"simGctDigis")
203 l1ep.hfRingEtSumsSource = cms.InputTag(
"simGctDigis")
204 l1ep.hfRingBitCountsSource = cms.InputTag(
"simGctDigis")
209 """Configure the CSC rechit producer
210 to handle unganged ME1a for upgrade studies
216 process.csc2DRecHits.readBadChannels = cms.bool(
False)
217 process.csc2DRecHits.CSCUseGasGainCorrections = cms.bool(
False)
223 """Do nothing special. May need some adjustments for unganged ME11
235 """Full set of the CSC PostLS1 related customizations.
236 It's tied to specific expected module names.
237 Therefore, a sanity check is done first to make sure that
238 standard cmsDriver paths have modules with such expected names.
248 if hasattr(process,
'simMuonCSCDigis'):
252 if hasattr(process,
'simCscTriggerPrimitiveDigis'):
256 if hasattr(process,
'simCsctfTrackDigis'):
260 if hasattr(process,
'cscpacker')
or hasattr(process,
'csctfpacker'):
264 if hasattr(process,
'muonCSCDigis')
or hasattr(process,
'csctfDigis'):
268 if hasattr(process,
'csc2DRecHits'):
272 if hasattr(process,
'cscMonitor'):
276 if hasattr(process,
'relvalMuonBits'):