CMS 3D CMS Logo

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

Functions

def Base
 
def customiseGlobalTagForOnlineBeamSpot
 
def HLTDropPrevious
 
def HLTRECO
 
def L1REPACK
 
def L1T
 
def L1THLT
 
def L1XML
 
def ProcessName
 

Variables

tuple process = ProcessName(process)
 override the GlobalTag, connection string and pfnPrefix if 'GlobalTag' in process.__dict__: process.GlobalTag.connect = 'frontier://FrontierProd/CMS_CONDITIONS' process.GlobalTag.pfnPrefix = cms.untracked.string('frontier://Frontie#rProd/') More...
 

Function Documentation

def CustomConfigs.Base (   process)

Definition at line 17 of file CustomConfigs.py.

Referenced by gen::DataCardFileWriter.DataCardFileWriter(), models.generate(), HLTDropPrevious(), L1T(), and L1THLT().

17 
18 def Base(process):
19 # default modifications
20 
21  process.options.wantSummary = cms.untracked.bool(True)
22  process.options.numberOfThreads = cms.untracked.uint32( 4 )
23  process.options.numberOfStreams = cms.untracked.uint32( 0 )
24  process.options.sizeOfStackForThreadsInKB = cms.untracked.uint32( 10*1024 )
25 
26  process.MessageLogger.TriggerSummaryProducerAOD=cms.untracked.PSet()
27  process.MessageLogger.L1GtTrigReport=cms.untracked.PSet()
28  process.MessageLogger.L1TGlobalSummary=cms.untracked.PSet()
29  process.MessageLogger.HLTrigReport=cms.untracked.PSet()
30 
# No longer override - instead use GT config as provided via cmsDriver
def CustomConfigs.customiseGlobalTagForOnlineBeamSpot (   process)
Customisation of GlobalTag for Online BeamSpot
   - edits the GlobalTag ESSource to load the tags used to produce the HLT beamspot
   - these tags are not available in the Offline GT, which is the GT presently used in HLT+RECO tests
   - not loading these tags (i.e. not using this customisation) does not result in a runtime error,
     but it leads to an HLT beamspot different to the one obtained when running HLT alone

Definition at line 136 of file CustomConfigs.py.

138  """Customisation of GlobalTag for Online BeamSpot
139  - edits the GlobalTag ESSource to load the tags used to produce the HLT beamspot
140  - these tags are not available in the Offline GT, which is the GT presently used in HLT+RECO tests
141  - not loading these tags (i.e. not using this customisation) does not result in a runtime error,
142  but it leads to an HLT beamspot different to the one obtained when running HLT alone
143  """
144  if hasattr(process, 'GlobalTag'):
145  if not hasattr(process.GlobalTag, 'toGet'):
146  process.GlobalTag.toGet = cms.VPSet()
147  process.GlobalTag.toGet += [
148  cms.PSet(
149  record = cms.string('BeamSpotOnlineLegacyObjectsRcd'),
150  tag = cms.string('BeamSpotOnlineLegacy')
151  ),
152  cms.PSet(
153  record = cms.string('BeamSpotOnlineHLTObjectsRcd'),
154  tag = cms.string('BeamSpotOnlineHLT')
155  )
156  ]
157 
158  return process
159 
def customiseGlobalTagForOnlineBeamSpot
def CustomConfigs.HLTDropPrevious (   process)

Definition at line 160 of file CustomConfigs.py.

References Base(), and gpuVertexFinder.return.

161 def HLTDropPrevious(process):
162 # drop on input the previous HLT results
163  process.source.inputCommands = cms.untracked.vstring (
164  'keep *',
165  'drop *_hltL1GtObjectMap_*_*',
166  'drop *_TriggerResults_*_*',
167  'drop *_hltTriggerSummaryAOD_*_*',
168  )
169 
170  process=Base(process)
171 
172  return(process)
173 
def CustomConfigs.HLTRECO (   process)
Customisations for running HLT+RECO in the same job
   - remove ESSources and ESProducers from Tasks (needed to run HLT+RECO tests on GPU)
     - when Reconstruction_cff is loaded, it brings in Tasks that include
       GPU-related ES modules with the same names as they have in HLT configs
     - in TSG tests, these GPU-related RECO Tasks are not included in the Schedule
       (because the "gpu" process-modifier is not used);
       this causes the ES modules not to be executed, thus making them unavailable to HLT producers
     - this workaround removes ES modules from Tasks, making their execution independent of the content of the Schedule;
       with reference to https://twiki.cern.ch/twiki/bin/view/CMSPublic/SWGuideAboutPythonConfigFile?rev=92#Behavior_when_an_ESProducer_ESSo,
       this workaround avoids "Case 3" by reverting to "Case 2"
     - this workaround only affects Tasks of non-HLT steps, as the addition of ES modules to Tasks is not supported in ConfDB
       (none of the Tasks used in the HLT step can contain ES modules in the first place, modulo customisations outside ConfDB)

Definition at line 109 of file CustomConfigs.py.

110 def HLTRECO(process):
111  """Customisations for running HLT+RECO in the same job
112  - remove ESSources and ESProducers from Tasks (needed to run HLT+RECO tests on GPU)
113  - when Reconstruction_cff is loaded, it brings in Tasks that include
114  GPU-related ES modules with the same names as they have in HLT configs
115  - in TSG tests, these GPU-related RECO Tasks are not included in the Schedule
116  (because the "gpu" process-modifier is not used);
117  this causes the ES modules not to be executed, thus making them unavailable to HLT producers
118  - this workaround removes ES modules from Tasks, making their execution independent of the content of the Schedule;
119  with reference to https://twiki.cern.ch/twiki/bin/view/CMSPublic/SWGuideAboutPythonConfigFile?rev=92#Behavior_when_an_ESProducer_ESSo,
120  this workaround avoids "Case 3" by reverting to "Case 2"
121  - this workaround only affects Tasks of non-HLT steps, as the addition of ES modules to Tasks is not supported in ConfDB
122  (none of the Tasks used in the HLT step can contain ES modules in the first place, modulo customisations outside ConfDB)
123  """
124  for taskName in process.tasks_():
125  task = process.tasks_()[taskName]
126  esModulesToRemove = set()
127  for modName in task.moduleNames():
128  module = getattr(process, modName)
129  if isinstance(module, cms.ESSource) or isinstance(module, cms.ESProducer):
130  esModulesToRemove.add(module)
131  for esModule in esModulesToRemove:
132  task.remove(esModule)
133 
134  return process
135 
def CustomConfigs.L1REPACK (   process,
  sequence = "Full" 
)

Definition at line 174 of file CustomConfigs.py.

References edm::eventsetup::heterocontainer.insert(), and mps_monitormerge.items.

175 def L1REPACK(process, sequence="Full"):
176 
177  from Configuration.Eras.Era_Run3_cff import Run3
178  l1repack = cms.Process('L1REPACK', Run3)
179  l1repack.load('Configuration.StandardSequences.SimL1EmulatorRepack_'+sequence+'_cff')
180 
181  for module in l1repack.es_sources_():
182  if not hasattr(process, module):
183  setattr(process, module, getattr(l1repack, module))
184  for module in l1repack.es_producers_():
185  if not hasattr(process, module):
186  setattr(process, module, getattr(l1repack, module))
187 
188  for module in l1repack.SimL1Emulator.expandAndClone().moduleNames():
189  setattr(process, module, getattr(l1repack, module))
190  for taskName, task in l1repack.tasks_().items():
191  if l1repack.SimL1Emulator.contains(task):
192  setattr(process, taskName, task)
193  for sequenceName, sequence in l1repack.sequences_().items():
194  if l1repack.SimL1Emulator.contains(sequence):
195  setattr(process, sequenceName, sequence)
196 
197  process.SimL1Emulator = l1repack.SimL1Emulator
198 
199  for path in process.paths_():
200  getattr(process,path).insert(0,process.SimL1Emulator)
201  for path in process.endpaths_():
202  getattr(process,path).insert(0,process.SimL1Emulator)
203 
204  # special L1T cleanup
205  for obj in [
206  'hgcalTriggerGeometryESProducer',
207  ]:
208  if hasattr(process, obj):
209  delattr(process, obj)
210 
211  return process
212 
bool insert(Storage &iStorage, ItemType *iItem, const IdTag &iIdTag)
Definition: HCMethods.h:50
def CustomConfigs.L1T (   process)

Definition at line 43 of file CustomConfigs.py.

References Base(), and gpuVertexFinder.return.

43 
44 def L1T(process):
45 # modifications when running L1T only
46 
47  def _legacyStage1(process):
48  labels = ['gtDigis','simGtDigis','newGtDigis','hltGtDigis']
49  for label in labels:
50  if label in process.__dict__:
51  process.load('L1Trigger.GlobalTriggerAnalyzer.l1GtTrigReport_cfi')
52  process.l1GtTrigReport.L1GtRecordInputTag = cms.InputTag( label )
53  process.L1AnalyzerEndpath = cms.EndPath( process.l1GtTrigReport )
54  process.schedule.append(process.L1AnalyzerEndpath)
55 
56  def _stage2(process):
57  labels = ['gtStage2Digis','simGtStage2Digis','newGtStage2Digis','hltGtStage2Digis']
58  for label in labels:
59  if label in process.__dict__:
60  process.load('L1Trigger.L1TGlobal.L1TGlobalSummary_cfi')
61  process.L1TGlobalSummary.AlgInputTag = cms.InputTag( label )
62  process.L1TGlobalSummary.ExtInputTag = cms.InputTag( label )
63  process.L1TAnalyzerEndpath = cms.EndPath(process.L1TGlobalSummary )
64  process.schedule.append(process.L1TAnalyzerEndpath)
65 
66  from Configuration.Eras.Modifier_stage2L1Trigger_cff import stage2L1Trigger
67  (~stage2L1Trigger).toModify(process, _legacyStage1)
68  stage2L1Trigger.toModify(process, _stage2)
69 
70  if hasattr(process,'TriggerMenu'):
71  delattr(process,'TriggerMenu')
72 
73  process=Base(process)
74 
75  return(process)
76 
def CustomConfigs.L1THLT (   process)

Definition at line 77 of file CustomConfigs.py.

References Base(), and gpuVertexFinder.return.

77 
78 def L1THLT(process):
79 # modifications when running L1T+HLT
80 
81  if not ('HLTAnalyzerEndpath' in process.__dict__) :
82  def _legacyStage1(process):
83  if 'hltGtDigis' in process.__dict__:
84  from HLTrigger.Configuration.HLT_Fake_cff import fragment
85  process.hltL1GtTrigReport = fragment.hltL1GtTrigReport
86  process.hltTrigReport = fragment.hltTrigReport
87  process.HLTAnalyzerEndpath = cms.EndPath(process.hltGtDigis + process.hltL1GtTrigReport + process.hltTrigReport)
88  process.schedule.append(process.HLTAnalyzerEndpath)
89 
90  def _stage2(process):
91  if 'hltGtStage2ObjectMap' in process.__dict__:
92  from HLTrigger.Configuration.HLT_FULL_cff import fragment
93  process.hltL1TGlobalSummary = fragment.hltL1TGlobalSummary
94  process.hltTrigReport = fragment.hltTrigReport
95  process.HLTAnalyzerEndpath = cms.EndPath(process.hltGtStage2Digis + process.hltL1TGlobalSummary + process.hltTrigReport)
96  process.schedule.append(process.HLTAnalyzerEndpath)
97 
98  from Configuration.Eras.Modifier_stage2L1Trigger_cff import stage2L1Trigger
99  (~stage2L1Trigger).toModify(process, _legacyStage1)
100  stage2L1Trigger.toModify(process, _stage2)
101 
102  if hasattr(process,'TriggerMenu'):
103  delattr(process,'TriggerMenu')
104 
105  process=Base(process)
106 
107  return(process)
108 
def CustomConfigs.L1XML (   process,
  xmlFile = None 
)

Definition at line 213 of file CustomConfigs.py.

214 def L1XML(process,xmlFile=None):
215 
216 # xmlFile="L1Menu_Collisions2016_dev_v3.xml"
217 
218  if ((xmlFile is None) or (xmlFile=="")):
219  return process
220 
221  process.L1TriggerMenu= cms.ESProducer("L1TUtmTriggerMenuESProducer",
222  L1TriggerMenuFile= cms.string(xmlFile)
223  )
224  process.ESPreferL1TXML = cms.ESPrefer("L1TUtmTriggerMenuESProducer","L1TriggerMenu")
225 
226  return process
def CustomConfigs.ProcessName (   process)

Definition at line 8 of file CustomConfigs.py.

References gpuVertexFinder.return.

Referenced by ConfigBuilder.ConfigBuilder.prepare_HLT().

8 
9 def ProcessName(process):
10 # processname modifications
11 
12  if 'hltTrigReport' in process.__dict__:
13  process.hltTrigReport.HLTriggerResults = cms.InputTag( 'TriggerResults','',process.name_() )
14 
15  return(process)
16 

Variable Documentation

tuple CustomConfigs.process = ProcessName(process)

override the GlobalTag, connection string and pfnPrefix if 'GlobalTag' in process.__dict__: process.GlobalTag.connect = 'frontier://FrontierProd/CMS_CONDITIONS' process.GlobalTag.pfnPrefix = cms.untracked.string('frontier://Frontie#rProd/')

process.GlobalTag.snapshotTime = cms.string("9999-12-31 23:59:59.000")

Definition at line 38 of file CustomConfigs.py.