CMS 3D CMS Logo

Functions
muonCustoms Namespace Reference

Functions

def csc_PathVsModule_SanityCheck (process)
 
def customise_csc_cond_ungangedME11A_mc (process)
 
def customise_csc_Digitizer (process)
 
def customise_csc_DQM (process)
 
def customise_csc_Geometry (process)
 
def customise_csc_Indexing (process)
 
def customise_csc_L1Emulator_sim (process)
 
def customise_csc_L1Extra_allsim (process)
 
def customise_csc_L1Stubs_sim (process)
 
def customise_csc_L1TrackFinder_sim (process)
 
def customise_csc_LocalReco (process)
 
def customise_csc_Packer (process)
 
def customise_csc_PostLS1 (process)
 
def customise_csc_Unpacker (process)
 
def customise_csc_Validation (process)
 
def digitizer_timing_pre3_median (process)
 
def remove_from_all_paths (process, module_name)
 
def unganged_me1a_geometry (process)
 

Function Documentation

◆ csc_PathVsModule_SanityCheck()

def muonCustoms.csc_PathVsModule_SanityCheck (   process)
A sanity check to make sure that standard cmsDriver paths 
have modules with expected names. If some paths would not have
expected modules, the procedure would only print WARNINGs.

Definition at line 91 of file muonCustoms.py.

91 def csc_PathVsModule_SanityCheck(process):
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.
95  """
96  # list of (pathName, expected moduleName) tuples:
97  paths_modules = [
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')
107  #('dqmHarvesting', ''),
108 # ('validation_step', 'relvalMuonBits')
109  ]
110  # verify:
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")
116 
117 
118 # ------------------------------------------------------------------
119 

References print().

Referenced by customise_csc_PostLS1().

◆ customise_csc_cond_ungangedME11A_mc()

def muonCustoms.customise_csc_cond_ungangedME11A_mc (   process)
Pick up upgrade condions data directly from DB tags using ESPrefer's.
Might be useful when dealing with a global tag that doesn't include 
'unganged' CSC conditions.

Definition at line 36 of file muonCustoms.py.

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.
40  """
41  myconds = [
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')
48  ]
49 
51  for (classname, tag) in myconds:
52  print(classname, tag)
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) )
58 
59  del cscConditions
60 
61  return process
62 
63 

References print().

◆ customise_csc_Digitizer()

def muonCustoms.customise_csc_Digitizer (   process)
Customise CSC digitization to use unganged ME1/a channels

Definition at line 127 of file muonCustoms.py.

127 def customise_csc_Digitizer(process):
128  """Customise CSC digitization to use unganged ME1/a channels
129  """
130  process = customise_csc_Indexing(process)
131  process = digitizer_timing_pre3_median(process)
132  return process
133 
134 

References customise_csc_Indexing(), and digitizer_timing_pre3_median().

Referenced by customise_csc_PostLS1().

◆ customise_csc_DQM()

def muonCustoms.customise_csc_DQM (   process)
Do nothing special. May need some adjustments for unganged ME11

Definition at line 222 of file muonCustoms.py.

222 def customise_csc_DQM(process):
223  """Do nothing special. May need some adjustments for unganged ME11
224  """
225  return process
226 
227 

Referenced by customise_csc_PostLS1().

◆ customise_csc_Geometry()

def muonCustoms.customise_csc_Geometry (   process)
Customise digi/reco geometry to use unganged ME1/a channels

Definition at line 120 of file muonCustoms.py.

120 def customise_csc_Geometry(process):
121  """Customise digi/reco geometry to use unganged ME1/a channels
122  """
123  process = unganged_me1a_geometry(process)
124  return process
125 
126 

References unganged_me1a_geometry().

Referenced by customise_csc_PostLS1().

◆ customise_csc_Indexing()

def muonCustoms.customise_csc_Indexing (   process)
Settings for the upgrade raw vs offline condition channel translation

Definition at line 64 of file muonCustoms.py.

64 def customise_csc_Indexing(process):
65  """Settings for the upgrade raw vs offline condition channel translation
66  """
67  if hasattr(process,"CSCIndexerESProducer"):
68  process.CSCIndexerESProducer.AlgoName=cms.string("CSCIndexerPostls1")
69  if hasattr(process,"CSCChannelMapperESProducer"):
70  process.CSCChannelMapperESProducer.AlgoName=cms.string("CSCChannelMapperPostls1")
71  return process
72 
73 

Referenced by customise_csc_Digitizer(), customise_csc_L1Stubs_sim(), and customise_csc_LocalReco().

◆ customise_csc_L1Emulator_sim()

def muonCustoms.customise_csc_L1Emulator_sim (   process)
Customise both stubs and TF emulators

Definition at line 161 of file muonCustoms.py.

161 def customise_csc_L1Emulator_sim(process):
162  """Customise both stubs and TF emulators
163  """
164  process = customise_csc_L1Stubs_sim(process)
165  process = customise_csc_L1TrackFinder_sim(process)
166  return process
167 
168 

References customise_csc_L1Stubs_sim(), and customise_csc_L1TrackFinder_sim().

Referenced by L1TCaloStage1_customForHLT.customiseL1EmulatorFromRaw().

◆ customise_csc_L1Extra_allsim()

def muonCustoms.customise_csc_L1Extra_allsim (   process)
Adjust L1Extra producer's input tags for the use case
when we want to run L1Extra without packing-unpacking first

Definition at line 184 of file muonCustoms.py.

184 def customise_csc_L1Extra_allsim(process):
185  """Adjust L1Extra producer's input tags for the use case
186  when we want to run L1Extra without packing-unpacking first
187  """
188  l1ep = process.l1extraParticles
189  #l1ep.centralBxOnly = cms.bool(True)
190  #l1ep.produceMuonParticles = cms.bool(True)
191  #l1ep.produceCaloParticles = cms.bool(False)
192  #l1ep.ignoreHtMiss = cms.bool(False)
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")
205  return process
206 
207 

◆ customise_csc_L1Stubs_sim()

def muonCustoms.customise_csc_L1Stubs_sim (   process)
Configure the local CSC trigger stubs emulator with the upgrade 
algorithm version that efficiently uses unganged ME1a

Definition at line 135 of file muonCustoms.py.

135 def customise_csc_L1Stubs_sim(process):
136  """Configure the local CSC trigger stubs emulator with the upgrade
137  algorithm version that efficiently uses unganged ME1a
138  """
139 
140  process = customise_csc_Indexing(process)
141 
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')
146 
147  return process
148 
149 

References customise_csc_Indexing().

Referenced by customise_csc_L1Emulator_sim(), and customise_csc_PostLS1().

◆ customise_csc_L1TrackFinder_sim()

def muonCustoms.customise_csc_L1TrackFinder_sim (   process)
Regular CSCTF configuration adapted to deal with unganged ME1a

Definition at line 150 of file muonCustoms.py.

151  """Regular CSCTF configuration adapted to deal with unganged ME1a
152  """
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")
157 
158  return process
159 
160 

Referenced by customise_csc_L1Emulator_sim(), and customise_csc_PostLS1().

◆ customise_csc_LocalReco()

def muonCustoms.customise_csc_LocalReco (   process)
Configure the CSC rechit producer 
to handle unganged ME1a for upgrade studies

Definition at line 208 of file muonCustoms.py.

208 def customise_csc_LocalReco(process):
209  """Configure the CSC rechit producer
210  to handle unganged ME1a for upgrade studies
211  """
212  #
213  process = customise_csc_Indexing(process)
214 
215  # Turn off some flags for CSCRecHitD that are turned ON in default config
216  process.csc2DRecHits.readBadChannels = cms.bool(False)
217  process.csc2DRecHits.CSCUseGasGainCorrections = cms.bool(False)
218 
219  return process
220 
221 

References customise_csc_Indexing().

Referenced by customise_csc_PostLS1(), and RecoTLR.customiseDataRun2Common().

◆ customise_csc_Packer()

def muonCustoms.customise_csc_Packer (   process)
Use 2013 a.k.a. post-LS1 version

Definition at line 169 of file muonCustoms.py.

169 def customise_csc_Packer(process):
170  """Use 2013 a.k.a. post-LS1 version
171  """
172  process.cscpacker.useFormatVersion = cms.uint32(2013)
173  process.cscpacker.usePreTriggers = cms.bool(False)
174  process.cscpacker.packEverything = cms.bool(True)
175  return process
176 
177 

Referenced by customise_csc_PostLS1().

◆ customise_csc_PostLS1()

def muonCustoms.customise_csc_PostLS1 (   process)
Full set of the CSC PostLS1 related customizations.
It's tied to specific expected module names.
Therefore, a sanity check is done first to make sure that 
standard cmsDriver paths have modules with such expected names.

Definition at line 234 of file muonCustoms.py.

234 def customise_csc_PostLS1(process):
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.
239  """
240 
241  # a simple sanity check first
243 
244  # use unganged geometry
245  process = customise_csc_Geometry(process)
246 
247  # digitizer
248  if hasattr(process, 'simMuonCSCDigis'):
249  process = customise_csc_Digitizer(process)
250 
251  # L1 stub emulator upgrade algorithm
252  if hasattr(process, 'simCscTriggerPrimitiveDigis'):
253  process = customise_csc_L1Stubs_sim(process)
254 
255  # CSCTF that can deal with unganged ME1a
256  if hasattr(process, 'simCsctfTrackDigis'):
257  process = customise_csc_L1TrackFinder_sim(process)
258 
259  # packer - simply get rid of it
260  if hasattr(process, 'cscpacker') or hasattr(process, 'csctfpacker'):
261  process = customise_csc_Packer(process)
262 
263  # unpacker - simply get rid of it
264  if hasattr(process, 'muonCSCDigis') or hasattr(process, 'csctfDigis'):
265  process = customise_csc_Unpacker(process)
266 
267  # CSC RecHiti producer adjustments
268  if hasattr(process, 'csc2DRecHits'):
269  process = customise_csc_LocalReco(process)
270 
271  # DQM
272  if hasattr(process, 'cscMonitor'):
273  process = customise_csc_DQM(process)
274 
275  # Validation
276  if hasattr(process, 'relvalMuonBits'):
277  process = customise_csc_Validation(process)
278 
279  return process

References csc_PathVsModule_SanityCheck(), customise_csc_Digitizer(), customise_csc_DQM(), customise_csc_Geometry(), customise_csc_L1Stubs_sim(), customise_csc_L1TrackFinder_sim(), customise_csc_LocalReco(), customise_csc_Packer(), customise_csc_Unpacker(), and customise_csc_Validation().

Referenced by muonCustomsPreMixing.customise_csc_PostLS1(), postLS1CustomsPreMixing.customisePostLS1(), postLS1CustomsPreMixing.customisePostLS1_50ns(), postLS1Customs.customisePostLS1_Common(), and postLS1CustomsPreMixing.customisePostLS1_HI().

◆ customise_csc_Unpacker()

def muonCustoms.customise_csc_Unpacker (   process)
Do nothing at the moment

Definition at line 178 of file muonCustoms.py.

178 def customise_csc_Unpacker(process):
179  """Do nothing at the moment
180  """
181  return process
182 
183 

Referenced by customise_csc_PostLS1().

◆ customise_csc_Validation()

def muonCustoms.customise_csc_Validation (   process)
Nothing for now

Definition at line 228 of file muonCustoms.py.

228 def customise_csc_Validation(process):
229  """Nothing for now
230  """
231  return process
232 
233 

Referenced by customise_csc_PostLS1().

◆ digitizer_timing_pre3_median()

def muonCustoms.digitizer_timing_pre3_median (   process)
CSC digitizer customization 
with bunchTimingOffsets tuned to center trigger stubs at bx6
when pretrigger with 3 layers and median stub timing are used

Definition at line 15 of file muonCustoms.py.

15 def digitizer_timing_pre3_median(process):
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
19  """
20 
24 
25 
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)
32 
33  return process
34 
35 

Referenced by customise_csc_Digitizer().

◆ remove_from_all_paths()

def muonCustoms.remove_from_all_paths (   process,
  module_name 
)
Remove process.module_name from all the paths in process:

Definition at line 74 of file muonCustoms.py.

74 def remove_from_all_paths(process, module_name):
75  """Remove process.module_name from all the paths in process:
76  """
77 
78  # trivial case first:
79  if not hasattr(process, module_name):
80  return process
81 
82  # walk over all the paths:
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))
88  return process
89 
90 

◆ unganged_me1a_geometry()

def muonCustoms.unganged_me1a_geometry (   process)
Customise digi/reco geometry to use unganged ME1/a channels

Definition at line 5 of file muonCustoms.py.

5 def unganged_me1a_geometry(process):
6  """Customise digi/reco geometry to use unganged ME1/a channels
7  """
8  if hasattr(process,"CSCGeometryESModule"):
9  process.CSCGeometryESModule.useGangedStripsInME1a = False
10  if hasattr(process,"idealForDigiCSCGeometry"):
11  process.idealForDigiCSCGeometry.useGangedStripsInME1a = False
12  return process
13 
14 

Referenced by customise_csc_Geometry(), and RecoTLR.customiseDataRun2Common().

muonCustoms.csc_PathVsModule_SanityCheck
def csc_PathVsModule_SanityCheck(process)
Definition: muonCustoms.py:91
muonCustoms.unganged_me1a_geometry
def unganged_me1a_geometry(process)
Definition: muonCustoms.py:5
muonCustoms.customise_csc_Validation
def customise_csc_Validation(process)
Definition: muonCustoms.py:228
muonCustoms.customise_csc_L1Emulator_sim
def customise_csc_L1Emulator_sim(process)
Definition: muonCustoms.py:161
muonCustoms.customise_csc_LocalReco
def customise_csc_LocalReco(process)
Definition: muonCustoms.py:208
muonCustoms.customise_csc_Indexing
def customise_csc_Indexing(process)
Definition: muonCustoms.py:64
muonCustoms.customise_csc_cond_ungangedME11A_mc
def customise_csc_cond_ungangedME11A_mc(process)
Definition: muonCustoms.py:36
muonCustoms.customise_csc_Unpacker
def customise_csc_Unpacker(process)
Definition: muonCustoms.py:178
muonCustoms.customise_csc_L1TrackFinder_sim
def customise_csc_L1TrackFinder_sim(process)
Definition: muonCustoms.py:150
muonCustoms.customise_csc_Packer
def customise_csc_Packer(process)
Definition: muonCustoms.py:169
muonCustoms.customise_csc_L1Stubs_sim
def customise_csc_L1Stubs_sim(process)
Definition: muonCustoms.py:135
muonCustoms.digitizer_timing_pre3_median
def digitizer_timing_pre3_median(process)
Definition: muonCustoms.py:15
muonCustoms.remove_from_all_paths
def remove_from_all_paths(process, module_name)
Definition: muonCustoms.py:74
muonCustoms.customise_csc_Digitizer
def customise_csc_Digitizer(process)
Definition: muonCustoms.py:127
muonCustoms.customise_csc_DQM
def customise_csc_DQM(process)
Definition: muonCustoms.py:222
print
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:46
muonCustoms.customise_csc_L1Extra_allsim
def customise_csc_L1Extra_allsim(process)
Definition: muonCustoms.py:184
getCSCConditions_frontier_cff
muonCustoms.customise_csc_Geometry
def customise_csc_Geometry(process)
Definition: muonCustoms.py:120
muonCustoms.customise_csc_PostLS1
def customise_csc_PostLS1(process)
Definition: muonCustoms.py:234