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

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 90 of file muonCustoms.py.

References EnableFloatingPointExceptions_cfi.moduleNames.

Referenced by customise_csc_PostLS1().

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

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

Definition at line 126 of file muonCustoms.py.

References customise_csc_Indexing(), and digitizer_timing_pre3_median().

Referenced by customise_csc_PostLS1().

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

Definition at line 221 of file muonCustoms.py.

Referenced by customise_csc_PostLS1().

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

Definition at line 119 of file muonCustoms.py.

References unganged_me1a_geometry().

Referenced by customise_csc_PostLS1().

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

Definition at line 63 of file muonCustoms.py.

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

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

Definition at line 160 of file muonCustoms.py.

References customise_csc_L1Stubs_sim(), and customise_csc_L1TrackFinder_sim().

Referenced by L1TCaloStage1_customForHLT.customiseL1EmulatorFromRaw().

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

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

References customise_csc_Indexing().

Referenced by customise_csc_L1Emulator_sim(), and customise_csc_PostLS1().

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

Definition at line 149 of file muonCustoms.py.

Referenced by customise_csc_L1Emulator_sim(), and customise_csc_PostLS1().

150  """Regular CSCTF configuration adapted to deal with unganged ME1a
151  """
152  from L1Trigger.CSCTrackFinder.csctfTrackDigisUngangedME1a_cfi import csctfTrackDigisUngangedME1a
153  process.simCsctfTrackDigis = csctfTrackDigisUngangedME1a
154  process.simCsctfTrackDigis.DTproducer = cms.untracked.InputTag("simDtTriggerPrimitiveDigis")
155  process.simCsctfTrackDigis.SectorReceiverInput = cms.untracked.InputTag("simCscTriggerPrimitiveDigis", "MPCSORTED")
156 
157  return process
158 
159 
def customise_csc_L1TrackFinder_sim(process)
Definition: muonCustoms.py:149
def muonCustoms.customise_csc_LocalReco (   process)
Configure the CSC rechit producer 
to handle unganged ME1a for upgrade studies

Definition at line 207 of file muonCustoms.py.

References customise_csc_Indexing().

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

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

Definition at line 168 of file muonCustoms.py.

Referenced by customise_csc_PostLS1().

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

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

Definition at line 177 of file muonCustoms.py.

Referenced by customise_csc_PostLS1().

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

Definition at line 227 of file muonCustoms.py.

Referenced by customise_csc_PostLS1().

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

Referenced by customise_csc_Digitizer().

15  """CSC digitizer customization
16  with bunchTimingOffsets tuned to center trigger stubs at bx6
17  when pretrigger with 3 layers and median stub timing are used
18  """
19  ## Make sure there's no bad chambers/channels
20  #process.simMuonCSCDigis.strips.readBadChambers = True
21  #process.simMuonCSCDigis.wires.readBadChannels = True
22  #process.simMuonCSCDigis.digitizeBadChambers = True
23 
24  ## Customised timing offsets so that ALCTs and CLCTs times are centered in signal BX.
25  ## These offsets below were tuned for the case of 3 layer pretriggering
26  ## and median stub timing algorithm.
27  process.simMuonCSCDigis.strips.bunchTimingOffsets = cms.vdouble(0.0,
28  37.53, 37.66, 55.4, 48.2, 54.45, 53.78, 53.38, 54.12, 51.98, 51.28)
29  process.simMuonCSCDigis.wires.bunchTimingOffsets = cms.vdouble(0.0,
30  22.88, 22.55, 29.28, 30.0, 30.0, 30.5, 31.0, 29.5, 29.1, 29.88)
31 
32  return process
33 
34 
def digitizer_timing_pre3_median(process)
Definition: muonCustoms.py:14
def muonCustoms.remove_from_all_paths (   process,
  module_name 
)
Remove process.module_name from all the paths in process:

Definition at line 73 of file muonCustoms.py.

73 def remove_from_all_paths(process, module_name):
74  """Remove process.module_name from all the paths in process:
75  """
76 
77  # trivial case first:
78  if not hasattr(process, module_name):
79  return process
80 
81  # walk over all the paths:
82  for path_name in process._Process__paths.keys():
83  the_path = getattr(process, path_name)
84  module_names = the_path.moduleNames()
85  if module_name in module_names:
86  the_path.remove(getattr(process, module_name))
87  return process
88 
89 
def remove_from_all_paths(process, module_name)
Definition: muonCustoms.py:73
def muonCustoms.unganged_me1a_geometry (   process)
Customise digi/reco geometry to use unganged ME1/a channels

Definition at line 4 of file muonCustoms.py.

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

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