test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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_hlt
 
def customise_csc_Indexing
 
def customise_csc_L1Emulator
 
def customise_csc_L1Extra_allsim
 
def customise_csc_L1Stubs
 
def customise_csc_L1TrackFinder
 
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 86 of file muonCustoms.py.

Referenced by customise_csc_PostLS1().

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

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

Definition at line 122 of file muonCustoms.py.

References customise_csc_Indexing(), and digitizer_timing_pre3_median().

Referenced by customise_csc_PostLS1().

123 def customise_csc_Digitizer(process):
124  """Customise CSC digitization to use unganged ME1/a channels
125  """
126  process = customise_csc_Indexing(process)
127  process = digitizer_timing_pre3_median(process)
128  return process
129 
def customise_csc_Digitizer
Definition: muonCustoms.py:122
def customise_csc_Indexing
Definition: muonCustoms.py:61
def digitizer_timing_pre3_median
Definition: muonCustoms.py:12
def muonCustoms.customise_csc_DQM (   process)
At this point: get rid of process.muonAnalyzer, adjust cscMonitor's input

Definition at line 223 of file muonCustoms.py.

References remove_from_all_paths().

Referenced by customise_csc_PostLS1().

224 def customise_csc_DQM(process):
225  """At this point: get rid of process.muonAnalyzer, adjust cscMonitor's input
226  """
227  process = remove_from_all_paths(process, 'muonAnalyzer')
228 
229  process.cscMonitor.clctDigiTag = cms.InputTag("simCscTriggerPrimitiveDigis")
230  process.cscMonitor.stripDigiTag = cms.InputTag("simMuonCSCDigis", "MuonCSCStripDigi")
231  process.cscMonitor.wireDigiTag = cms.InputTag("simMuonCSCDigis", "MuonCSCWireDigi")
232  process.cscMonitor.alctDigiTag = cms.InputTag("simCscTriggerPrimitiveDigis")
233 
234  process.l1tCsctf.statusProducer=cms.InputTag("null")
235  process.l1tCsctf.lctProducer=cms.InputTag("null")
236  process.l1tCsctf.trackProducer=cms.InputTag("null")
237  process.l1tCsctf.mbProducer=cms.InputTag("null")
238 
239  return process
240 
def customise_csc_DQM
Definition: muonCustoms.py:223
def remove_from_all_paths
Definition: muonCustoms.py:69
def muonCustoms.customise_csc_Geometry (   process)
Customise digi/reco geometry to use unganged ME1/a channels

Definition at line 115 of file muonCustoms.py.

References unganged_me1a_geometry().

Referenced by customise_csc_PostLS1().

116 def customise_csc_Geometry(process):
117  """Customise digi/reco geometry to use unganged ME1/a channels
118  """
119  process = unganged_me1a_geometry(process)
120  return process
121 
def unganged_me1a_geometry
Definition: muonCustoms.py:4
def customise_csc_Geometry
Definition: muonCustoms.py:115
def muonCustoms.customise_csc_hlt (   process)

Definition at line 295 of file muonCustoms.py.

References customise_csc_Indexing().

Referenced by postLS1CustomsPreMixing.customise_HLT(), and postLS1Customs.customise_HLT().

296 def customise_csc_hlt(process):
297 
298  process.CSCGeometryESModule.useGangedStripsInME1a = False
299 
300  process.hltCsc2DRecHits.readBadChannels = cms.bool(False)
301  process.hltCsc2DRecHits.CSCUseGasGainCorrections = cms.bool(False)
302 
303  process = customise_csc_Indexing(process)
304 
305  # Switch input for CSCRecHitD to s i m u l a t e d digis
306 
307  process.hltCsc2DRecHits.wireDigiTag = cms.InputTag("simMuonCSCDigis","MuonCSCWireDigi")
308  process.hltCsc2DRecHits.stripDigiTag = cms.InputTag("simMuonCSCDigis","MuonCSCStripDigi")
309 
310  return process
def customise_csc_Indexing
Definition: muonCustoms.py:61
def customise_csc_hlt
Definition: muonCustoms.py:295
def muonCustoms.customise_csc_Indexing (   process)
Settings for the upgrade raw vs offline condition channel translation

Definition at line 61 of file muonCustoms.py.

Referenced by customise_csc_Digitizer(), customise_csc_hlt(), customise_csc_L1Stubs(), and customise_csc_LocalReco().

61 
62 def customise_csc_Indexing(process):
63  """Settings for the upgrade raw vs offline condition channel translation
64  """
65  process.CSCIndexerESProducer.AlgoName=cms.string("CSCIndexerPostls1")
66  process.CSCChannelMapperESProducer.AlgoName=cms.string("CSCChannelMapperPostls1")
67  return process
68 
def customise_csc_Indexing
Definition: muonCustoms.py:61
def muonCustoms.customise_csc_L1Emulator (   process)
Customise both stubs and TF emulators

Definition at line 157 of file muonCustoms.py.

References customise_csc_L1Stubs(), and customise_csc_L1TrackFinder().

158 def customise_csc_L1Emulator(process):
159  """Customise both stubs and TF emulators
160  """
161  process = customise_csc_L1Stubs(process)
162  process = customise_csc_L1TrackFinder(process)
163  return process
164 
def customise_csc_L1TrackFinder
Definition: muonCustoms.py:145
def customise_csc_L1Emulator
Definition: muonCustoms.py:157
def customise_csc_L1Stubs
Definition: muonCustoms.py:130
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 181 of file muonCustoms.py.

182 def customise_csc_L1Extra_allsim(process):
183  """Adjust L1Extra producer's input tags for the use case
184  when we want to run L1Extra without packing-unpacking first
185  """
186  l1ep = process.l1extraParticles
187  #l1ep.centralBxOnly = cms.bool(True)
188  #l1ep.produceMuonParticles = cms.bool(True)
189  #l1ep.produceCaloParticles = cms.bool(False)
190  #l1ep.ignoreHtMiss = cms.bool(False)
191  l1ep.muonSource = cms.InputTag('simGmtDigis')
192  l1ep.etTotalSource = cms.InputTag('simGctDigis')
193  l1ep.nonIsolatedEmSource = cms.InputTag('simGctDigis', 'nonIsoEm')
194  l1ep.etMissSource = cms.InputTag('simGctDigis')
195  l1ep.forwardJetSource = cms.InputTag('simGctDigis', 'forJets')
196  l1ep.centralJetSource = cms.InputTag('simGctDigis', 'cenJets')
197  l1ep.tauJetSource = cms.InputTag('simGctDigis', 'tauJets')
198  l1ep.isolatedEmSource = cms.InputTag('simGctDigis', 'isoEm')
199  l1ep.etHadSource = cms.InputTag('simGctDigis')
200  l1ep.htMissSource = cms.InputTag("simGctDigis")
201  l1ep.hfRingEtSumsSource = cms.InputTag("simGctDigis")
202  l1ep.hfRingBitCountsSource = cms.InputTag("simGctDigis")
203  return process
204 
def customise_csc_L1Extra_allsim
Definition: muonCustoms.py:181
def muonCustoms.customise_csc_L1Stubs (   process)
Configure the local CSC trigger stubs emulator with the upgrade 
algorithm version that efficiently uses unganged ME1a

Definition at line 130 of file muonCustoms.py.

References customise_csc_Indexing().

Referenced by customise_csc_L1Emulator(), and customise_csc_PostLS1().

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

Definition at line 145 of file muonCustoms.py.

Referenced by customise_csc_L1Emulator(), and customise_csc_PostLS1().

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

Definition at line 205 of file muonCustoms.py.

References customise_csc_Indexing().

Referenced by customise_csc_PostLS1().

206 def customise_csc_LocalReco(process):
207  """Configure the CSC rechit producer
208  to handle unganged ME1a for upgrade studies
209  """
210  #
211  process = customise_csc_Indexing(process)
212 
213  # Turn off some flags for CSCRecHitD that are turned ON in default config
214  process.csc2DRecHits.readBadChannels = cms.bool(False)
215  process.csc2DRecHits.CSCUseGasGainCorrection = cms.bool(False)
216 
217  # Switch input for CSCRecHitD to s i m u l a t e d digis
218  process.csc2DRecHits.wireDigiTag = cms.InputTag("simMuonCSCDigis", "MuonCSCWireDigi")
219  process.csc2DRecHits.stripDigiTag = cms.InputTag("simMuonCSCDigis", "MuonCSCStripDigi")
220 
221  return process
222 
def customise_csc_Indexing
Definition: muonCustoms.py:61
def customise_csc_LocalReco
Definition: muonCustoms.py:205
def muonCustoms.customise_csc_Packer (   process)
Get rid of process.cscpacker and process.csctfpacker in all the paths

Definition at line 165 of file muonCustoms.py.

References remove_from_all_paths().

Referenced by customise_csc_PostLS1().

166 def customise_csc_Packer(process):
167  """Get rid of process.cscpacker and process.csctfpacker in all the paths
168  """
169  process = remove_from_all_paths(process, 'cscpacker')
170  process = remove_from_all_paths(process, 'csctfpacker')
171  return process
172 
def remove_from_all_paths
Definition: muonCustoms.py:69
def customise_csc_Packer
Definition: muonCustoms.py:165
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 248 of file muonCustoms.py.

References csc_PathVsModule_SanityCheck(), customise_csc_Digitizer(), customise_csc_DQM(), customise_csc_Geometry(), customise_csc_L1Stubs(), customise_csc_L1TrackFinder(), customise_csc_LocalReco(), customise_csc_Packer(), customise_csc_Unpacker(), and customise_csc_Validation().

Referenced by postLS1Customs.customisePostLS1(), and postLS1CustomsPreMixing.customisePostLS1().

249 def customise_csc_PostLS1(process):
250  """Full set of the CSC PostLS1 related customizations.
251  It's tied to specific expected module names.
252  Therefore, a sanity check is done first to make sure that
253  standard cmsDriver paths have modules with such expected names.
254  """
255 
256  # a simple sanity check first
258 
259  # use unganged geometry
260  process = customise_csc_Geometry(process)
261 
262  # digitizer
263  if hasattr(process, 'simMuonCSCDigis'):
264  process = customise_csc_Digitizer(process)
265 
266  # L1 stub emulator upgrade algorithm
267  if hasattr(process, 'simCscTriggerPrimitiveDigis'):
268  process = customise_csc_L1Stubs(process)
269 
270  # CSCTF that can deal with unganged ME1a
271  if hasattr(process, 'simCsctfTrackDigis'):
272  process = customise_csc_L1TrackFinder(process)
273 
274  # packer - simply get rid of it
275  if hasattr(process, 'cscpacker') or hasattr(process, 'csctfpacker'):
276  process = customise_csc_Packer(process)
277 
278  # unpacker - simply get rid of it
279  if hasattr(process, 'muonCSCDigis') or hasattr(process, 'csctfDigis'):
280  process = customise_csc_Unpacker(process)
281 
282  # CSC RecHiti producer adjustments
283  if hasattr(process, 'csc2DRecHits'):
284  process = customise_csc_LocalReco(process)
285 
286  # DQM
287  if hasattr(process, 'cscMonitor'):
288  process = customise_csc_DQM(process)
289 
290  # Validation
291  if hasattr(process, 'relvalMuonBits'):
292  process = customise_csc_Validation(process)
293 
294  return process
def customise_csc_Unpacker
Definition: muonCustoms.py:173
def customise_csc_Digitizer
Definition: muonCustoms.py:122
def customise_csc_LocalReco
Definition: muonCustoms.py:205
def customise_csc_Geometry
Definition: muonCustoms.py:115
def customise_csc_L1TrackFinder
Definition: muonCustoms.py:145
def customise_csc_DQM
Definition: muonCustoms.py:223
def customise_csc_Validation
Definition: muonCustoms.py:241
def csc_PathVsModule_SanityCheck
Definition: muonCustoms.py:86
def customise_csc_PostLS1
Definition: muonCustoms.py:248
def customise_csc_Packer
Definition: muonCustoms.py:165
def customise_csc_L1Stubs
Definition: muonCustoms.py:130
def muonCustoms.customise_csc_Unpacker (   process)
Get rid of process.muonCSCDigis and process.csctfDigis in all the paths

Definition at line 173 of file muonCustoms.py.

References remove_from_all_paths().

Referenced by customise_csc_PostLS1().

174 def customise_csc_Unpacker(process):
175  """Get rid of process.muonCSCDigis and process.csctfDigis in all the paths
176  """
177  process = remove_from_all_paths(process, 'muonCSCDigis')
178  process = remove_from_all_paths(process, 'csctfDigis')
179  return process
180 
def customise_csc_Unpacker
Definition: muonCustoms.py:173
def remove_from_all_paths
Definition: muonCustoms.py:69
def muonCustoms.customise_csc_Validation (   process)
At this point, just get rid of process.relvalMuonBits

Definition at line 241 of file muonCustoms.py.

References remove_from_all_paths().

Referenced by customise_csc_PostLS1().

242 def customise_csc_Validation(process):
243  """At this point, just get rid of process.relvalMuonBits
244  """
245  process = remove_from_all_paths(process, 'relvalMuonBits')
246  return process
247 
def customise_csc_Validation
Definition: muonCustoms.py:241
def remove_from_all_paths
Definition: muonCustoms.py:69
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 12 of file muonCustoms.py.

Referenced by customise_csc_Digitizer().

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

Definition at line 69 of file muonCustoms.py.

Referenced by customise_csc_DQM(), customise_csc_Packer(), customise_csc_Unpacker(), and customise_csc_Validation().

69 
70 def remove_from_all_paths(process, module_name):
71  """Remove process.module_name from all the paths in process:
72  """
73 
74  # trivial case first:
75  if not hasattr(process, module_name):
76  return process
77 
78  # walk over all the paths:
79  for path_name in process._Process__paths.keys():
80  the_path = getattr(process, path_name)
81  module_names = the_path.moduleNames()
82  if module_name in module_names:
83  the_path.remove(getattr(process, module_name))
84  return process
85 
def remove_from_all_paths
Definition: muonCustoms.py:69
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().

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