CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions
muonCustomsPreMixing 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_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 muonCustomsPreMixing.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 muonCustomsPreMixing.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 muonCustomsPreMixing.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 muonCustomsPreMixing.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 muonCustomsPreMixing.customise_csc_Digitizer (   process)
Customise CSC digitization to use unganged ME1/a channels

Definition at line 122 of file muonCustomsPreMixing.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 muonCustomsPreMixing.customise_csc_DQM (   process)
Runs after RAW2DIGI, so, should use defaults

Definition at line 222 of file muonCustomsPreMixing.py.

Referenced by customise_csc_PostLS1().

223 def customise_csc_DQM(process):
224  """Runs after RAW2DIGI, so, should use defaults
225  """
226  return process
227 
def muonCustomsPreMixing.customise_csc_Geometry (   process)
Customise digi/reco geometry to use unganged ME1/a channels

Definition at line 115 of file muonCustomsPreMixing.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 muonCustomsPreMixing.customise_csc_hlt (   process)

Definition at line 281 of file muonCustomsPreMixing.py.

References customise_csc_Indexing().

282 def customise_csc_hlt(process):
283 
284  process.CSCGeometryESModule.useGangedStripsInME1a = False
285 
286  process.hltCsc2DRecHits.readBadChannels = cms.bool(False)
287 
288  process.hltCsc2DRecHits.CSCUseGasGainCorrections = cms.bool(False)
289 
290  process = customise_csc_Indexing(process)
291 
292  # Switch input for CSCRecHitD to s i m u l a t e d (and Mixed!) digis
293 
294  process.hltCsc2DRecHits.wireDigiTag = cms.InputTag("mixData","MuonCSCWireDigisDM")
295  process.hltCsc2DRecHits.stripDigiTag = cms.InputTag("mixData","MuonCSCStripDigisDM")
296 
297  return process
def muonCustomsPreMixing.customise_csc_Indexing (   process)
Settings for the upgrade raw vs offline condition channel translation

Definition at line 61 of file muonCustomsPreMixing.py.

Referenced by customise_csc_Digitizer(), customise_csc_hlt(), customise_csc_L1Stubs_sim(), 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 muonCustomsPreMixing.customise_csc_L1Emulator_sim (   process)
Customise both stubs and TF emulators

Definition at line 157 of file muonCustomsPreMixing.py.

References customise_csc_L1Stubs_sim(), and customise_csc_L1TrackFinder_sim().

158 def customise_csc_L1Emulator_sim(process):
159  """Customise both stubs and TF emulators
160  """
161  process = customise_csc_L1Stubs_sim(process)
162  process = customise_csc_L1TrackFinder_sim(process)
163  return process
164 
def muonCustomsPreMixing.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 180 of file muonCustomsPreMixing.py.

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

References customise_csc_Indexing().

Referenced by customise_csc_L1Emulator_sim(), and customise_csc_PostLS1().

131 def customise_csc_L1Stubs_sim(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( 'mixData', 'MuonCSCComparatorDigisDM')
141  process.simCscTriggerPrimitiveDigis.CSCWireDigiProducer = cms.InputTag( 'mixData', 'MuonCSCWireDigisDM')
142 
143  return process
144 
def muonCustomsPreMixing.customise_csc_L1TrackFinder_sim (   process)
Regular CSCTF configuration adapted to deal with unganged ME1a

Definition at line 145 of file muonCustomsPreMixing.py.

Referenced by customise_csc_L1Emulator_sim(), and customise_csc_PostLS1().

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 muonCustomsPreMixing.customise_csc_LocalReco (   process)
Configure the CSC rechit producer 
to handle unganged ME1a for upgrade studies

Definition at line 204 of file muonCustomsPreMixing.py.

References customise_csc_Indexing().

Referenced by customise_csc_PostLS1().

205 def customise_csc_LocalReco(process):
206  """Configure the CSC rechit producer
207  to handle unganged ME1a for upgrade studies
208  """
209  #
210  process = customise_csc_Indexing(process)
211 
212  # Turn off some flags for CSCRecHitD that are turned ON in default config
213  process.csc2DRecHits.readBadChannels = cms.bool(False)
214  process.csc2DRecHits.CSCUseGasGainCorrections = cms.bool(False)
215 
216  # Switch input for CSCRecHitD to s i m u l a t e d (and Mixed!) digis
217  process.csc2DRecHits.wireDigiTag = cms.InputTag("mixData", "MuonCSCWireDigisDM")
218  process.csc2DRecHits.stripDigiTag = cms.InputTag("mixData", "MuonCSCStripDigisDM")
219 
220  return process
221 
def muonCustomsPreMixing.customise_csc_Packer (   process)
Use 2013 a.k.a. post-LS1 version 

Definition at line 165 of file muonCustomsPreMixing.py.

Referenced by customise_csc_PostLS1().

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

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 muonCustomsPreMixing.customise_csc_Unpacker (   process)
Do nothing at the moment

Definition at line 174 of file muonCustomsPreMixing.py.

Referenced by customise_csc_PostLS1().

175 def customise_csc_Unpacker(process):
176  """Do nothing at the moment
177  """
178  return process
179 
def muonCustomsPreMixing.customise_csc_Validation (   process)
Nothing for now

Definition at line 228 of file muonCustomsPreMixing.py.

Referenced by customise_csc_PostLS1().

229 def customise_csc_Validation(process):
230  """Nothing for now
231  """
232  return process
233 
def muonCustomsPreMixing.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 muonCustomsPreMixing.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 muonCustomsPreMixing.remove_from_all_paths (   process,
  module_name 
)
Remove process.module_name from all the paths in process:

Definition at line 69 of file muonCustomsPreMixing.py.

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 muonCustomsPreMixing.unganged_me1a_geometry (   process)
Customise digi/reco geometry to use unganged ME1/a channels

Definition at line 4 of file muonCustomsPreMixing.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