CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Functions
muonCustoms Namespace Reference

Functions

def csc_PathVsModule_SanityCheck
 
def customise_csc_cond_ungangedME11A_mc
 
def customise_csc_Digitizer
 
def customise_csc_DQM
 
def customise_csc_Geometry
 
def customise_csc_Indexing
 
def customise_csc_L1Emulator_sim
 
def customise_csc_L1Extra_allsim
 
def customise_csc_L1Stubs_sim
 
def customise_csc_L1TrackFinder_sim
 
def customise_csc_LocalReco
 
def customise_csc_Packer
 
def customise_csc_PostLS1
 
def customise_csc_Unpacker
 
def customise_csc_Validation
 
def digitizer_timing_pre3_median
 
def remove_from_all_paths
 
def unganged_me1a_geometry
 

Function Documentation

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.

References print().

Referenced by customise_csc_PostLS1().

91 
92 def csc_PathVsModule_SanityCheck(process):
93  """A sanity check to make sure that standard cmsDriver paths
94  have modules with expected names. If some paths would not have
95  expected modules, the procedure would only print WARNINGs.
96  """
97  # list of (pathName, expected moduleName) tuples:
98  paths_modules = [
99  ('digitisation_step', 'simMuonCSCDigis'),
100  ('L1simulation_step', 'simCscTriggerPrimitiveDigis'),
101  ('L1simulation_step', 'simCsctfTrackDigis'),
102  ('raw2digi_step', 'muonCSCDigis'),
103  ('raw2digi_step', 'csctfDigis'),
104  ('digi2raw_step', 'cscpacker'),
105  ('digi2raw_step', 'csctfpacker'),
106  ('reconstruction', 'csc2DRecHits'),
107  ('dqmoffline_step', 'muonAnalyzer')
108  #('dqmHarvesting', ''),
109 # ('validation_step', 'relvalMuonBits')
110  ]
111  # verify:
112  for path_name, module_name in paths_modules:
113  if hasattr(process, path_name) and not hasattr(process, module_name):
114  print("WARNING: module %s is not in %s path!!!" % (module_name, path_name))
115  print(" This path has the following modules:")
116  print(" ", getattr(process, path_name).moduleNames(),"\n")
117 
118 
119 # ------------------------------------------------------------------
def csc_PathVsModule_SanityCheck
Definition: muonCustoms.py:91
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
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.

References print().

36 
38  """ Pick up upgrade condions data directly from DB tags using ESPrefer's.
39  Might be useful when dealing with a global tag that doesn't include
40  'unganged' CSC conditions.
41  """
42  myconds = [
43  ('CSCDBGainsRcd', 'CSCDBGains_ungangedME11A_mc'),
44  ('CSCDBNoiseMatrixRcd', 'CSCDBNoiseMatrix_ungangedME11A_mc'),
45  ('CSCDBCrosstalkRcd', 'CSCDBCrosstalk_ungangedME11A_mc'),
46  ('CSCDBPedestalsRcd', 'CSCDBPedestals_ungangedME11A_mc'),
47  ('CSCDBGasGainCorrectionRcd', 'CSCDBGasGainCorrection_ungangedME11A_mc'),
48  ('CSCDBChipSpeedCorrectionRcd', 'CSCDBChipSpeedCorrection_ungangedME11A_mc')
49  ]
50 
52  for (classname, tag) in myconds:
53  print(classname, tag)
54  sourcename = 'unganged_' + classname
55  process.__setattr__(sourcename, cscConditions.clone())
56  process.__getattribute__(sourcename).toGet = cms.VPSet( cms.PSet( record = cms.string(classname), tag = cms.string(tag)) )
57  process.__getattribute__(sourcename).connect = cms.string('frontier://FrontierProd/CMS_CONDITIONS')
58  process.__setattr__('esp_' + classname, cms.ESPrefer("PoolDBESSource", sourcename) )
59 
60  del cscConditions
61 
62  return process
63 
def customise_csc_cond_ungangedME11A_mc
Definition: muonCustoms.py:36
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
def muonCustoms.customise_csc_Digitizer (   process)
Customise CSC digitization to use unganged ME1/a channels

Definition at line 127 of file muonCustoms.py.

References customise_csc_Indexing(), and digitizer_timing_pre3_median().

Referenced by customise_csc_PostLS1().

128 def customise_csc_Digitizer(process):
129  """Customise CSC digitization to use unganged ME1/a channels
130  """
131  process = customise_csc_Indexing(process)
132  process = digitizer_timing_pre3_median(process)
133  return process
134 
def customise_csc_Digitizer
Definition: muonCustoms.py:127
def customise_csc_Indexing
Definition: muonCustoms.py:64
def digitizer_timing_pre3_median
Definition: muonCustoms.py:15
def muonCustoms.customise_csc_DQM (   process)
Do nothing special. May need some adjustments for unganged ME11

Definition at line 222 of file muonCustoms.py.

Referenced by customise_csc_PostLS1().

223 def customise_csc_DQM(process):
224  """Do nothing special. May need some adjustments for unganged ME11
225  """
226  return process
227 
def customise_csc_DQM
Definition: muonCustoms.py:222
def muonCustoms.customise_csc_Geometry (   process)
Customise digi/reco geometry to use unganged ME1/a channels

Definition at line 120 of file muonCustoms.py.

References unganged_me1a_geometry().

Referenced by customise_csc_PostLS1().

121 def customise_csc_Geometry(process):
122  """Customise digi/reco geometry to use unganged ME1/a channels
123  """
124  process = unganged_me1a_geometry(process)
125  return process
126 
def unganged_me1a_geometry
Definition: muonCustoms.py:5
def customise_csc_Geometry
Definition: muonCustoms.py:120
def muonCustoms.customise_csc_Indexing (   process)
Settings for the upgrade raw vs offline condition channel translation

Definition at line 64 of file muonCustoms.py.

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

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

Definition at line 161 of file muonCustoms.py.

References customise_csc_L1Stubs_sim(), and customise_csc_L1TrackFinder_sim().

Referenced by L1TCaloStage1_customForHLT.customiseL1EmulatorFromRaw().

162 def customise_csc_L1Emulator_sim(process):
163  """Customise both stubs and TF emulators
164  """
165  process = customise_csc_L1Stubs_sim(process)
166  process = customise_csc_L1TrackFinder_sim(process)
167  return process
168 
def customise_csc_L1Stubs_sim
Definition: muonCustoms.py:135
def customise_csc_L1TrackFinder_sim
Definition: muonCustoms.py:150
def customise_csc_L1Emulator_sim
Definition: muonCustoms.py:161
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.

185 def customise_csc_L1Extra_allsim(process):
186  """Adjust L1Extra producer's input tags for the use case
187  when we want to run L1Extra without packing-unpacking first
188  """
189  l1ep = process.l1extraParticles
190  #l1ep.centralBxOnly = cms.bool(True)
191  #l1ep.produceMuonParticles = cms.bool(True)
192  #l1ep.produceCaloParticles = cms.bool(False)
193  #l1ep.ignoreHtMiss = cms.bool(False)
194  l1ep.muonSource = cms.InputTag('simGmtDigis')
195  l1ep.etTotalSource = cms.InputTag('simGctDigis')
196  l1ep.nonIsolatedEmSource = cms.InputTag('simGctDigis', 'nonIsoEm')
197  l1ep.etMissSource = cms.InputTag('simGctDigis')
198  l1ep.forwardJetSource = cms.InputTag('simGctDigis', 'forJets')
199  l1ep.centralJetSource = cms.InputTag('simGctDigis', 'cenJets')
200  l1ep.tauJetSource = cms.InputTag('simGctDigis', 'tauJets')
201  l1ep.isolatedEmSource = cms.InputTag('simGctDigis', 'isoEm')
202  l1ep.etHadSource = cms.InputTag('simGctDigis')
203  l1ep.htMissSource = cms.InputTag("simGctDigis")
204  l1ep.hfRingEtSumsSource = cms.InputTag("simGctDigis")
205  l1ep.hfRingBitCountsSource = cms.InputTag("simGctDigis")
206  return process
207 
def customise_csc_L1Extra_allsim
Definition: muonCustoms.py:184
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.

References customise_csc_Indexing().

Referenced by customise_csc_L1Emulator_sim(), and customise_csc_PostLS1().

136 def customise_csc_L1Stubs_sim(process):
137  """Configure the local CSC trigger stubs emulator with the upgrade
138  algorithm version that efficiently uses unganged ME1a
139  """
140 
141  process = customise_csc_Indexing(process)
142 
143  from L1Trigger.CSCTriggerPrimitives.cscTriggerPrimitiveDigisPostLS1_cfi import cscTriggerPrimitiveDigisPostLS1
144  process.simCscTriggerPrimitiveDigis = cscTriggerPrimitiveDigisPostLS1
145  process.simCscTriggerPrimitiveDigis.CSCComparatorDigiProducer = cms.InputTag( 'simMuonCSCDigis', 'MuonCSCComparatorDigi')
146  process.simCscTriggerPrimitiveDigis.CSCWireDigiProducer = cms.InputTag( 'simMuonCSCDigis', 'MuonCSCWireDigi')
147 
148  return process
149 
def customise_csc_L1Stubs_sim
Definition: muonCustoms.py:135
def customise_csc_Indexing
Definition: muonCustoms.py:64
def muonCustoms.customise_csc_L1TrackFinder_sim (   process)
Regular CSCTF configuration adapted to deal with unganged ME1a

Definition at line 150 of file muonCustoms.py.

Referenced by customise_csc_L1Emulator_sim(), and customise_csc_PostLS1().

152  """Regular CSCTF configuration adapted to deal with unganged ME1a
153  """
154  from L1Trigger.CSCTrackFinder.csctfTrackDigisUngangedME1a_cfi import csctfTrackDigisUngangedME1a
155  process.simCsctfTrackDigis = csctfTrackDigisUngangedME1a
156  process.simCsctfTrackDigis.DTproducer = cms.untracked.InputTag("simDtTriggerPrimitiveDigis")
157  process.simCsctfTrackDigis.SectorReceiverInput = cms.untracked.InputTag("simCscTriggerPrimitiveDigis", "MPCSORTED")
158 
159  return process
160 
def customise_csc_L1TrackFinder_sim
Definition: muonCustoms.py:150
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.

References customise_csc_Indexing().

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

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

Definition at line 169 of file muonCustoms.py.

Referenced by customise_csc_PostLS1().

170 def customise_csc_Packer(process):
171  """Use 2013 a.k.a. post-LS1 version
172  """
173  process.cscpacker.formatVersion = cms.uint32(2013)
174  process.cscpacker.usePreTriggers = cms.bool(False)
175  process.cscpacker.packEverything = cms.bool(True)
176  return process
177 
def customise_csc_Packer
Definition: muonCustoms.py:169
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.

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().

235 def customise_csc_PostLS1(process):
236  """Full set of the CSC PostLS1 related customizations.
237  It's tied to specific expected module names.
238  Therefore, a sanity check is done first to make sure that
239  standard cmsDriver paths have modules with such expected names.
240  """
241 
242  # a simple sanity check first
244 
245  # use unganged geometry
246  process = customise_csc_Geometry(process)
247 
248  # digitizer
249  if hasattr(process, 'simMuonCSCDigis'):
250  process = customise_csc_Digitizer(process)
251 
252  # L1 stub emulator upgrade algorithm
253  if hasattr(process, 'simCscTriggerPrimitiveDigis'):
254  process = customise_csc_L1Stubs_sim(process)
255 
256  # CSCTF that can deal with unganged ME1a
257  if hasattr(process, 'simCsctfTrackDigis'):
258  process = customise_csc_L1TrackFinder_sim(process)
259 
260  # packer - simply get rid of it
261  if hasattr(process, 'cscpacker') or hasattr(process, 'csctfpacker'):
262  process = customise_csc_Packer(process)
263 
264  # unpacker - simply get rid of it
265  if hasattr(process, 'muonCSCDigis') or hasattr(process, 'csctfDigis'):
266  process = customise_csc_Unpacker(process)
267 
268  # CSC RecHiti producer adjustments
269  if hasattr(process, 'csc2DRecHits'):
270  process = customise_csc_LocalReco(process)
271 
272  # DQM
273  if hasattr(process, 'cscMonitor'):
274  process = customise_csc_DQM(process)
275 
276  # Validation
277  if hasattr(process, 'relvalMuonBits'):
278  process = customise_csc_Validation(process)
279 
280  return process
def customise_csc_Unpacker
Definition: muonCustoms.py:178
def customise_csc_Digitizer
Definition: muonCustoms.py:127
def customise_csc_L1Stubs_sim
Definition: muonCustoms.py:135
def customise_csc_LocalReco
Definition: muonCustoms.py:208
def customise_csc_Geometry
Definition: muonCustoms.py:120
def customise_csc_DQM
Definition: muonCustoms.py:222
def customise_csc_L1TrackFinder_sim
Definition: muonCustoms.py:150
def customise_csc_Validation
Definition: muonCustoms.py:228
def csc_PathVsModule_SanityCheck
Definition: muonCustoms.py:91
def customise_csc_PostLS1
Definition: muonCustoms.py:234
def customise_csc_Packer
Definition: muonCustoms.py:169
def muonCustoms.customise_csc_Unpacker (   process)
Do nothing at the moment

Definition at line 178 of file muonCustoms.py.

Referenced by customise_csc_PostLS1().

179 def customise_csc_Unpacker(process):
180  """Do nothing at the moment
181  """
182  return process
183 
def customise_csc_Unpacker
Definition: muonCustoms.py:178
def muonCustoms.customise_csc_Validation (   process)
Nothing for now

Definition at line 228 of file muonCustoms.py.

Referenced by customise_csc_PostLS1().

229 def customise_csc_Validation(process):
230  """Nothing for now
231  """
232  return process
233 
def customise_csc_Validation
Definition: muonCustoms.py:228
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.

Referenced by customise_csc_Digitizer().

15 
16 def digitizer_timing_pre3_median(process):
17  """CSC digitizer customization
18  with bunchTimingOffsets tuned to center trigger stubs at bx6
19  when pretrigger with 3 layers and median stub timing are used
20  """
21  ## Make sure there's no bad chambers/channels
22  #process.simMuonCSCDigis.strips.readBadChambers = True
23  #process.simMuonCSCDigis.wires.readBadChannels = True
24  #process.simMuonCSCDigis.digitizeBadChambers = True
25 
26  ## Customised timing offsets so that ALCTs and CLCTs times are centered in signal BX.
27  ## These offsets below were tuned for the case of 3 layer pretriggering
28  ## and median stub timing algorithm.
29  process.simMuonCSCDigis.strips.bunchTimingOffsets = cms.vdouble(0.0,
30  37.53, 37.66, 55.4, 48.2, 54.45, 53.78, 53.38, 54.12, 51.98, 51.28)
31  process.simMuonCSCDigis.wires.bunchTimingOffsets = cms.vdouble(0.0,
32  22.88, 22.55, 29.28, 30.0, 30.0, 30.5, 31.0, 29.5, 29.1, 29.88)
33 
34  return process
35 
def digitizer_timing_pre3_median
Definition: muonCustoms.py:15
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 
75 def remove_from_all_paths(process, module_name):
76  """Remove process.module_name from all the paths in process:
77  """
78 
79  # trivial case first:
80  if not hasattr(process, module_name):
81  return process
82 
83  # walk over all the paths:
84  for path_name in process._Process__paths.keys():
85  the_path = getattr(process, path_name)
86  module_names = the_path.moduleNames()
87  if module_name in module_names:
88  the_path.remove(getattr(process, module_name))
89  return process
90 
def remove_from_all_paths
Definition: muonCustoms.py:74
def muonCustoms.unganged_me1a_geometry (   process)
Customise digi/reco geometry to use unganged ME1/a channels

Definition at line 5 of file muonCustoms.py.

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

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