CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
confdb.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 
3 import sys
4 import re
5 from pipe import pipe as _pipe
6 from options import globalTag
7 
8 
10  def __init__(self, configuration):
11  self.config = configuration
12  self.data = None
13  self.source = None
14 
15  self.options = {
16  'essources' : [],
17  'esmodules' : [],
18  'modules' : [],
19  'sequences' : [],
20  'services' : [],
21  'paths' : [],
22  'psets' : [],
23  'blocks' : [],
24  }
25 
26  self.labels = {}
27  if self.config.fragment:
28  self.labels['process'] = ''
29  self.labels['dict'] = 'locals()'
30  else:
31  self.labels['process'] = 'process.'
32  self.labels['dict'] = 'process.__dict__'
33 
34  if self.config.online:
35  self.labels['connect'] = 'frontier://(proxyurl=http://localhost:3128)(serverurl=http://localhost:8000/FrontierOnProd)(serverurl=http://localhost:8000/FrontierOnProd)(retrieve-ziplevel=0)'
36  else:
37  self.labels['connect'] = 'frontier://FrontierProd'
38 
39  # get the configuration from ConfdB
40  self.buildOptions()
43  self.customize()
44 
45 
46  def _build_query(self):
47  if self.config.menu.run:
48  return '--runNumber %s' % self.config.menu.run
49  else:
50  return '--%s --configName %s' % (self.config.menu.db, self.config.menu.name)
51 
52  def _build_source(self):
53  if self.source is None:
54  return '--noedsources'
55  else:
56  return '--input ' + self.source
57 
58  def _build_options(self):
59  return ' '.join(['--%s %s' % (key, ','.join(vals)) for key, vals in self.options.iteritems() if vals])
60 
61  def _build_cmdline(self):
62  if not self.config.fragment:
63  return 'edmConfigFromDB %s %s %s' % (self._build_query(), self._build_source(), self._build_options())
64  else:
65  return 'edmConfigFromDB --cff %s %s %s' % (self._build_query(), self._build_source(), self._build_options())
66 
67 
69  cmdline = self._build_cmdline()
70  data = _pipe(cmdline)
71  if 'Exhausted Resultset' in data or 'CONFIG_NOT_FOUND' in data:
72  raise ImportError('%s is not a valid HLT menu' % self.config.menuConfig.value)
73  self.data = data
74 
75 
76  def getPathList(self):
77  cmdline = 'edmConfigFromDB --cff %s --noedsources --noes --noservices --nosequences --nomodules' % self._build_query()
78  data = _pipe(cmdline)
79  if 'Exhausted Resultset' in data or 'CONFIG_NOT_FOUND' in data:
80  raise ImportError('%s is not a valid HLT menu' % self.config.menuConfig.value)
81  filter = re.compile(r' *= *cms.(End)?Path.*')
82  paths = [ filter.sub('', line) for line in data.splitlines() if filter.search(line) ]
83  return paths
84 
85 
87  # for the time being, this is limited only to the --paths option
88  self.options['paths'] = self.expandWildcards(self.options['paths'], self.getPathList())
89 
90 
91  @staticmethod
92  def expandWildcards(globs, collection):
93  # expand a list of unix-style wildcards matching a given collection
94  # wildcards with no matches are silently discarded
95  matches = []
96  for glob in globs:
97  negate = ''
98  if glob[0] == '-':
99  negate = '-'
100  glob = glob[1:]
101  # translate a unix-style glob expression into a regular expression
102  filter = re.compile(r'^' + glob.replace('?', '.').replace('*', '.*').replace('[!', '[^') + r'$')
103  matches.extend( negate + element for element in collection if filter.match(element) )
104  return matches
105 
106 
107  # dump the final configuration
108  def dump(self):
109  return self.data % self.labels
110 
111 
112  # customize the configuration according to the options
113  def customize(self):
114  if self.config.fragment:
115  # if running on MC, adapt the configuration accordingly
116  self.fixForMC()
117 
118  # if requested, adapt the configuration for FastSim
119  self.fixForFastSim()
120 
121  # if requested, remove the HLT prescales
122  self.unprescale()
123 
124  # if requested, override all ED/HLTfilters to always pass ("open" mode)
125  self.instrumentOpenMode()
126 
127  # if requested, instrument the self with the modules and EndPath needed for timing studies
128  self.instrumentTiming()
129 
130  else:
131  # if running on MC, adapt the configuration accordingly
132  self.fixForMC()
133 
134  # override the process name and adapt the relevant filters
135  self.overrideProcessName()
136 
137  # if required, remove the HLT prescales
138  self.unprescale()
139 
140  # if requested, override all ED/HLTfilters to always pass ("open" mode)
141  self.instrumentOpenMode()
142 
143  # manual override some Heavy Ion parameters
144  if self.config.type in ('HIon', ):
145  self.data += """
146 # HIon paths in smart prescalers
147 if 'hltPreHLTDQMSmart' in %(dict)s:
148  %(process)shltPreHLTDQMSmart.throw = cms.bool( False )
149 if 'hltPreHLTMONSmart' in %(dict)s:
150  %(process)shltPreHLTMONSmart.throw = cms.bool( False )
151 if 'hltPreExpressSmart' in %(dict)s:
152  %(process)shltPreExpressSmart.throw = cms.bool( False )
153 if 'hltPreDQMSmart' in %(dict)s:
154  %(process)shltPreDQMSmart.throw = cms.bool( False )
155 """
156 
157  # override the output modules to output root files
158  self.overrideOutput()
159 
160  # add global options
161  self.addGlobalOptions()
162 
163  # if requested or necessary, override the GlobalTag and connection strings
164  self.overrideGlobalTag()
165 
166  # if requested, override the L1 self from the GlobalTag (using the same connect as the GlobalTag itself)
167  self.overrideL1Menu()
168 
169  # request summary informations from the MessageLogger
170  self.updateMessageLogger()
171 
172  # if requested, instrument the self with the modules and EndPath needed for timing studies
173  self.instrumentTiming()
174 
175 
176  def addGlobalOptions(self):
177  # add global options
178  self.data += """
179 # add global options
180 %(process)smaxEvents = cms.untracked.PSet(
181  input = cms.untracked.int32( 100 )
182 )
183 %(process)soptions = cms.untracked.PSet(
184  wantSummary = cms.untracked.bool( True )
185 )
186 """
187 
188 
189  def _fix_parameter(self, **args):
190  """arguments:
191  name: parameter name (optional)
192  type: parameter type (look for tracked and untracked variants)
193  value: original value
194  replace: replacement value
195  """
196  if 'name' in args:
197  self.data = re.sub(
198  r'%(name)s = cms(?P<tracked>(?:\.untracked)?)\.%(type)s\( (?P<quote>["\']?)%(value)s(?P=quote)' % args,
199  r'%(name)s = cms\g<tracked>.%(type)s( \g<quote>%(replace)s\g<quote>' % args,
200  self.data)
201  else:
202  self.data = re.sub(
203  r'cms(?P<tracked>(?:\.untracked)?)\.%(type)s\( (?P<quote>["\']?)%(value)s(?P=quote)' % args,
204  r'cms\g<tracked>.%(type)s( \g<quote>%(replace)s\g<quote>' % args,
205  self.data)
206 
207 
208  def fixForMC(self):
209  if not self.config.data:
210  # override the raw data collection label
211  self._fix_parameter(type = 'InputTag', value = 'source', replace = 'rawDataCollector')
212  self._fix_parameter(type = 'string', value = 'source', replace = 'rawDataCollector')
213 
214 
215  def fixForFastSim(self):
216  if self.config.fastsim:
217  # adapt the hle configuration (fragment) to run under fastsim
218  self.data = re.sub( r'import FWCore.ParameterSet.Config as cms', r'\g<0>\nfrom FastSimulation.HighLevelTrigger.HLTSetup_cff import *', self.data)
219 
220  # remove the definition of streams and datasets
221  self.data = re.compile( r'^streams.*\n(.*\n)*?^\)\s*\n', re.MULTILINE ).sub( '', self.data )
222  self.data = re.compile( r'^datasets.*\n(.*\n)*?^\)\s*\n', re.MULTILINE ).sub( '', self.data )
223 
224  # fix the definition of module
225  self._fix_parameter( type = 'InputTag', value = 'hltL1extraParticles', replace = 'l1extraParticles')
226  self._fix_parameter(name = 'GMTReadoutCollection', type = 'InputTag', value = 'hltGtDigis', replace = 'gmtDigis')
227  self._fix_parameter( type = 'InputTag', value = 'hltGtDigis', replace = 'gtDigis')
228  self._fix_parameter( type = 'InputTag', value = 'hltL1GtObjectMap', replace = 'gtDigis')
229  self._fix_parameter(name = 'initialSeeds', type = 'InputTag', value = 'noSeedsHere', replace = 'globalPixelSeeds:GlobalPixel')
230  self._fix_parameter(name = 'preFilteredSeeds', type = 'bool', value = 'True', replace = 'False')
231  self._fix_parameter( type = 'InputTag', value = 'hltOfflineBeamSpot', replace = 'offlineBeamSpot')
232  self._fix_parameter( type = 'InputTag', value = 'hltMuonCSCDigis', replace = 'simMuonCSCDigis')
233  self._fix_parameter( type = 'InputTag', value = 'hltMuonDTDigis', replace = 'simMuonDTDigis')
234  self._fix_parameter( type = 'InputTag', value = 'hltMuonRPCDigis', replace = 'simMuonRPCDigis')
235 
236  # fix the definition of sequences and paths
237  self.data = re.sub( r'hltMuonCSCDigis', r'cms.SequencePlaceholder( "simMuonCSCDigis" )', self.data )
238  self.data = re.sub( r'hltMuonDTDigis', r'cms.SequencePlaceholder( "simMuonDTDigis" )', self.data )
239  self.data = re.sub( r'hltMuonRPCDigis', r'cms.SequencePlaceholder( "simMuonRPCDigis" )', self.data )
240  self.data = re.sub( r'HLTEndSequence', r'cms.SequencePlaceholder( "HLTEndSequence" )', self.data )
241  self.data = re.sub( r'hltGtDigis', r'HLTBeginSequence', self.data )
242 
243 
244  def unprescale(self):
245  if self.config.unprescale:
246  self.data += """
247 # remove the HLT prescales
248 if 'PrescaleService' in %(dict)s:
249  %(process)sPrescaleService.lvl1DefaultLabel = cms.untracked.string( '0' )
250  %(process)sPrescaleService.lvl1Labels = cms.vstring( '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' )
251  %(process)sPrescaleService.prescaleTable = cms.VPSet( )
252 """
253 
254 
256  if self.config.open:
257  # find all EDfilters
258  filters = [ match[1] for match in re.findall(r'(process\.)?\b(\w+) = cms.EDFilter', self.data) ]
259  # wrap all EDfilters with "cms.ignore( ... )"
260  re_filters = re.compile( r'\b((process\.)?(' + r'|'.join(filters) + r'))\b' )
261  re_sequence = re.compile( r'cms\.(Path|Sequence)\((.*)\)' )
262  self.data = re_sequence.sub( lambda line: re_filters.sub( r'cms.ignore( \1 )', line.group(0) ), self.data )
263 
264 
265  def overrideGlobalTag(self):
266  # overwrite GlobalTag
267  # the logic is:
268  # - for running online, do nothing, unless a globaltag has been specified on the command line
269  # - for running offline on data, only add the pfnPrefix
270  # - for running offline on mc, take the GT from the command line of the configuration.type
271  # - if the GT is "auto:...", insert the code to read it from Configuration.PyReleaseValidation.autoCond
272  text = ''
273  if self.config.online:
274  if self.config.globaltag:
275  # override the GlobalTag
276  text += """
277 # override the GlobalTag
278 if 'GlobalTag' in %%(dict)s:
279  %%(process)sGlobalTag.globaltag = '%(globaltag)s'
280 """
281 
282  else:
283  # override the GlobalTag connection string and pfnPrefix
284  text += """
285 # override the GlobalTag, connection string and pfnPrefix
286 if 'GlobalTag' in %%(dict)s:
287  %%(process)sGlobalTag.connect = '%%(connect)s/CMS_COND_31X_GLOBALTAG'
288  %%(process)sGlobalTag.pfnPrefix = cms.untracked.string('%%(connect)s/')
289 """
290 
291  if self.config.data:
292  # do not override the GlobalTag unless one was specified on the command line
293  pass
294  else:
295  # check if a specific GlobalTag was specified on the command line, or choose one from the configuration.type
296  if not self.config.globaltag:
297  if self.config.type in globalTag:
298  self.config.globaltag = globalTag[self.config.type]
299  else:
300  self.config.globaltag = globalTag['GRun']
301 
302  # check if the GlobalTag is an autoCond or an explicit tag
303  if not self.config.globaltag:
304  # when running on data, do not override the GlobalTag unless one was specified on the command line
305  pass
306  elif self.config.globaltag.startswith('auto:'):
307  self.config.menuGlobalTagAuto = self.config.globaltag[5:]
308  text += " from Configuration.PyReleaseValidation.autoCond import autoCond\n"
309  text += " %%(process)sGlobalTag.globaltag = autoCond['%(menuGlobalTagAuto)s']\n"
310  else:
311  text += " %%(process)sGlobalTag.globaltag = '%(globaltag)s'\n"
312 
313  self.data += text % self.config.__dict__
314 
315 
316  def overrideL1Menu(self):
317  # if requested, override the L1 menu from the GlobalTag (using the same connect as the GlobalTag itself)
318  if self.config.l1.override:
319  self.config.l1.record = 'L1GtTriggerMenuRcd'
320  self.config.l1.label = ''
321  self.config.l1.tag = self.config.l1.override
322  if not self.config.l1.connect:
323  self.config.l1.connect = '%(connect)s/CMS_COND_31X_L1T'
324  self.loadAdditionalConditions( 'override the L1 menu', self.config.l1.__dict__ )
325 
326 
327  def overrideOutput(self):
328  reOutputModuleDef = re.compile(r'\b(process\.)?hltOutput(\w+) *= *cms\.OutputModule\(.*\n([^)].*\n)*\) *\n')
329  reOutputModuleRef = re.compile(r' *[+*]? *\b(process\.)?hltOutput(\w+)') # FIXME this does not cover "hltOutputX + something"
330  if self.config.output == 'none':
331  # drop all output modules
332  self.data = reOutputModuleDef.sub('', self.data)
333  self.data = reOutputModuleRef.sub('', self.data)
334 
335  elif self.config.output == 'minimal':
336  # drop all output modules except "HLTDQMResults"
337  repl = lambda match: (match.group(2) == 'HLTDQMResults') and match.group() or ''
338  self.data = reOutputModuleDef.sub(repl, self.data)
339  self.data = reOutputModuleRef.sub(repl, self.data)
340 
341  # override the "online" ShmStreamConsumer output modules with "offline" PoolOutputModule's
342  self.data = re.sub(
343  r'\b(process\.)?hltOutput(\w+) *= *cms\.OutputModule\( *"ShmStreamConsumer" *,',
344  r'%(process)shltOutput\2 = cms.OutputModule( "PoolOutputModule",\n fileName = cms.untracked.string( "output\2.root" ),\n fastCloning = cms.untracked.bool( False ),',
345  self.data
346  )
347 
348 
349  # override the process name and adapt the relevant filters
351  # the following was stolen and adapted from HLTrigger.Configuration.customL1THLT_Options
352  self.data += """
353 # override the process name
354 %%(process)ssetName_('%(name)s')
355 
356 # adapt HLT modules to the correct process name
357 if 'hltTrigReport' in %%(dict)s:
358  %%(process)shltTrigReport.HLTriggerResults = cms.InputTag( 'TriggerResults', '', '%(name)s' )
359 
360 if 'hltDQMHLTScalers' in %%(dict)s:
361  %%(process)shltDQMHLTScalers.triggerResults = cms.InputTag( 'TriggerResults', '', '%(name)s' )
362 
363 if 'hltPreExpressSmart' in %%(dict)s:
364  %%(process)shltPreExpressSmart.TriggerResultsTag = cms.InputTag( 'TriggerResults', '', '%(name)s' )
365 
366 if 'hltPreHLTMONSmart' in %%(dict)s:
367  %%(process)shltPreHLTMONSmart.TriggerResultsTag = cms.InputTag( 'TriggerResults', '', '%(name)s' )
368 
369 if 'hltPreDQMSmart' in %%(dict)s:
370  %%(process)shltPreDQMSmart.TriggerResultsTag = cms.InputTag( 'TriggerResults', '', '%(name)s' )
371 
372 if 'hltDQML1SeedLogicScalers' in %%(dict)s:
373  %%(process)shltDQML1SeedLogicScalers.processname = '%(name)s'
374 """ % self.config.__dict__
375 
376 
378  # request summary informations from the MessageLogger
379  self.data += """
380 if 'MessageLogger' in %(dict)s:
381  %(process)sMessageLogger.categories.append('TriggerSummaryProducerAOD')
382  %(process)sMessageLogger.categories.append('L1GtTrigReport')
383  %(process)sMessageLogger.categories.append('HLTrigReport')
384 """
385 
386 
387  def loadAdditionalConditions(self, comment, *conditions):
388  # load additional conditions
389  self.data += """
390 # %s
391 if 'GlobalTag' in %%(dict)s:
392 """ % comment
393  for condition in conditions:
394  self.data += """ %%(process)sGlobalTag.toGet.append(
395  cms.PSet(
396  record = cms.string( '%(record)s' ),
397  tag = cms.string( '%(tag)s' ),
398  label = cms.untracked.string( '%(label)s' ),
399  connect = cms.untracked.string( '%(connect)s' )
400  )
401  )
402 """ % condition
403 
404  def instrumentTiming(self):
405  if self.config.timing:
406  # instrument the menu with the modules and EndPath needed for timing studies
407  text = ''
408 
409  if 'HLTriggerFirstPath' in self.data:
410  # remove HLTriggerFirstPath
411  self.data = re.sub(r'.*\bHLTriggerFirstPath\s*=.*\n', '', self.data)
412 
413  if not 'hltGetRaw' in self.data:
414  # add hltGetRaw
415  text += """
416 %%(process)shltGetRaw = cms.EDAnalyzer( "HLTGetRaw",
417  RawDataCollection = cms.InputTag( "%s" )
418 )
419 """ % ( self.config.data and 'source' or 'rawDataCollector' )
420 
421  if not 'hltGetConditions' in self.data:
422  # add hltGetConditions
423  text += """
424 %(process)shltGetConditions = cms.EDAnalyzer( 'EventSetupRecordDataGetter',
425  verbose = cms.untracked.bool( False ),
426  toGet = cms.VPSet( )
427 )
428 """
429 
430  # add the definition of HLTriggerFirstPath
431  text += """
432 %(process)sHLTriggerFirstPath = cms.Path( %(process)shltGetRaw + %(process)shltGetConditions + %(process)shltBoolFalse )
433 """
434  self.data = re.sub(r'.*cms\.(End)?Path.*', text + r'\g<0>', self.data, 1)
435 
436  self.data += """
437 # instrument the menu with the modules and EndPath needed for timing studies
438 %(process)sPathTimerService = cms.Service( "PathTimerService",
439 )
440 %(process)shltTimer = cms.EDProducer( "PathTimerInserter",
441 )
442 %(process)shltOutputTiming = cms.OutputModule( "PoolOutputModule",
443  fileName = cms.untracked.string( "outputTiming.root" ),
444  fastCloning = cms.untracked.bool( False ),
445  splitLevel = cms.untracked.int32( 0 ),
446  dataset = cms.untracked.PSet(
447  dataTier = cms.untracked.string( 'RECO' ),
448  filterName = cms.untracked.string( '' )
449  ),
450  outputCommands = cms.untracked.vstring( 'drop *',
451  'keep HLTPerformanceInfo_*_*_*' )
452 )
453 
454 %(process)sTimingOutput = cms.EndPath( %(process)shltTimer + %(process)shltOutputTiming )
455 """
456  self.loadAdditionalConditions('add XML geometry to keep hltGetConditions happy',
457  {
458  'record' : 'GeometryFileRcd',
459  'tag' : 'XMLFILE_Geometry_380V3_Ideal_mc',
460  'label' : 'Ideal',
461  'connect' : '%(connect)s/CMS_COND_34X_GEOMETRY'
462  }, {
463  'record' : 'GeometryFileRcd',
464  'tag' : 'XMLFILE_Geometry_380V3_Extended_mc',
465  'label' : 'Extended',
466  'connect' : '%(connect)s/CMS_COND_34X_GEOMETRY'
467  }
468  )
469 
470 
471  def buildOptions(self):
472  # common configuration for all scenarios
473  self.options['services'].append( "-FUShmDQMOutputService" )
474  self.options['paths'].append( "-OfflineOutput" )
475 
476  # adapt source and options to the current scenario
477  if not self.config.fragment:
478  self.build_source()
479 
480  if self.config.fragment:
481  # extract a configuration file fragment
482  self.options['essources'].append( "-GlobalTag" )
483  self.options['essources'].append( "-HepPDTESSource" )
484  self.options['essources'].append( "-XMLIdealGeometryESSource" )
485  self.options['essources'].append( "-eegeom" )
486  self.options['essources'].append( "-es_hardcode" )
487  self.options['essources'].append( "-magfield" )
488 
489  self.options['esmodules'].append( "-AutoMagneticFieldESProducer" )
490  self.options['esmodules'].append( "-SlaveField0" )
491  self.options['esmodules'].append( "-SlaveField20" )
492  self.options['esmodules'].append( "-SlaveField30" )
493  self.options['esmodules'].append( "-SlaveField35" )
494  self.options['esmodules'].append( "-SlaveField38" )
495  self.options['esmodules'].append( "-SlaveField40" )
496  self.options['esmodules'].append( "-VBF0" )
497  self.options['esmodules'].append( "-VBF20" )
498  self.options['esmodules'].append( "-VBF30" )
499  self.options['esmodules'].append( "-VBF35" )
500  self.options['esmodules'].append( "-VBF38" )
501  self.options['esmodules'].append( "-VBF40" )
502  self.options['esmodules'].append( "-CSCGeometryESModule" )
503  self.options['esmodules'].append( "-CaloGeometryBuilder" )
504  self.options['esmodules'].append( "-CaloTowerHardcodeGeometryEP" )
505  self.options['esmodules'].append( "-CastorHardcodeGeometryEP" )
506  self.options['esmodules'].append( "-DTGeometryESModule" )
507  self.options['esmodules'].append( "-EcalBarrelGeometryEP" )
508  self.options['esmodules'].append( "-EcalElectronicsMappingBuilder" )
509  self.options['esmodules'].append( "-EcalEndcapGeometryEP" )
510  self.options['esmodules'].append( "-EcalLaserCorrectionService" )
511  self.options['esmodules'].append( "-EcalPreshowerGeometryEP" )
512  self.options['esmodules'].append( "-HcalHardcodeGeometryEP" )
513  self.options['esmodules'].append( "-HcalTopologyIdealEP" )
514  self.options['esmodules'].append( "-MuonNumberingInitialization" )
515  self.options['esmodules'].append( "-ParametrizedMagneticFieldProducer" )
516  self.options['esmodules'].append( "-RPCGeometryESModule" )
517  self.options['esmodules'].append( "-SiStripGainESProducer" )
518  self.options['esmodules'].append( "-SiStripRecHitMatcherESProducer" )
519  self.options['esmodules'].append( "-SiStripQualityESProducer" )
520  self.options['esmodules'].append( "-StripCPEfromTrackAngleESProducer" )
521  self.options['esmodules'].append( "-TrackerDigiGeometryESModule" )
522  self.options['esmodules'].append( "-TrackerGeometricDetESModule" )
523  self.options['esmodules'].append( "-VolumeBasedMagneticFieldESProducer" )
524  self.options['esmodules'].append( "-ZdcHardcodeGeometryEP" )
525  self.options['esmodules'].append( "-hcal_db_producer" )
526  self.options['esmodules'].append( "-L1GtTriggerMaskAlgoTrigTrivialProducer" )
527  self.options['esmodules'].append( "-L1GtTriggerMaskTechTrigTrivialProducer" )
528  self.options['esmodules'].append( "-hltESPEcalTrigTowerConstituentsMapBuilder" )
529  self.options['esmodules'].append( "-hltESPGlobalTrackingGeometryESProducer" )
530  self.options['esmodules'].append( "-hltESPMuonDetLayerGeometryESProducer" )
531  self.options['esmodules'].append( "-hltESPTrackerRecoGeometryESProducer" )
532  if not self.config.fastsim:
533  self.options['esmodules'].append( "-CaloTowerGeometryFromDBEP" )
534  self.options['esmodules'].append( "-CastorGeometryFromDBEP" )
535  self.options['esmodules'].append( "-EcalBarrelGeometryFromDBEP" )
536  self.options['esmodules'].append( "-EcalEndcapGeometryFromDBEP" )
537  self.options['esmodules'].append( "-EcalPreshowerGeometryFromDBEP" )
538  self.options['esmodules'].append( "-HcalGeometryFromDBEP" )
539  self.options['esmodules'].append( "-ZdcGeometryFromDBEP" )
540  self.options['esmodules'].append( "-XMLFromDBSource" )
541  self.options['esmodules'].append( "-sistripconn" )
542 
543  self.options['services'].append( "-PrescaleService" )
544  self.options['services'].append( "-MessageLogger" )
545  self.options['services'].append( "-DQM" )
546  self.options['services'].append( "-MicroStateService" )
547  self.options['services'].append( "-ModuleWebRegistry" )
548  self.options['services'].append( "-TimeProfilerService" )
549  if not self.config.fastsim:
550  self.options['services'].append( "-DQMStore" )
551 
552  self.options['paths'].append( "-HLTOutput" )
553  self.options['paths'].append( "-ExpressOutput" )
554  self.options['paths'].append( "-EventDisplayOutput" )
555  self.options['paths'].append( "-AlCaOutput" )
556  self.options['paths'].append( "-AlCaPPOutput" )
557  self.options['paths'].append( "-AlCaHIOutput" )
558  self.options['paths'].append( "-DQMOutput" )
559  self.options['paths'].append( "-HLTDQMOutput" )
560  self.options['paths'].append( "-HLTDQMResultsOutput" )
561  self.options['paths'].append( "-HLTMONOutput" )
562  self.options['paths'].append( "-NanoDSTOutput" )
563 
564  self.options['psets'].append( "-maxEvents" )
565  self.options['psets'].append( "-options" )
566 
567  if self.config.fastsim:
568  # remove components not supported or needed by fastsim
569  self.options['essources'].append( "-BTagRecord" )
570 
571  self.options['esmodules'].append( "-SiPixelTemplateDBObjectESProducer" )
572  self.options['esmodules'].append( "-TTRHBuilderPixelOnly" )
573  self.options['esmodules'].append( "-WithTrackAngle" )
574  self.options['esmodules'].append( "-trajectoryCleanerBySharedHits" )
575  self.options['esmodules'].append( "-trackCounting3D2nd" )
576  self.options['esmodules'].append( "-navigationSchoolESProducer" )
577  self.options['esmodules'].append( "-muonCkfTrajectoryFilter" )
578  self.options['esmodules'].append( "-ckfBaseTrajectoryFilter" )
579  self.options['esmodules'].append( "-TransientTrackBuilderESProducer" )
580  self.options['esmodules'].append( "-TrackerRecoGeometryESProducer" )
581  self.options['esmodules'].append( "-SteppingHelixPropagatorOpposite" )
582  self.options['esmodules'].append( "-SteppingHelixPropagatorAny" )
583  self.options['esmodules'].append( "-SteppingHelixPropagatorAlong" )
584  self.options['esmodules'].append( "-SmootherRK" )
585  self.options['esmodules'].append( "-SmartPropagatorRK" )
586  self.options['esmodules'].append( "-SmartPropagatorOpposite" )
587  self.options['esmodules'].append( "-SmartPropagatorAnyRK" )
588  self.options['esmodules'].append( "-SmartPropagatorAnyOpposite" )
589  self.options['esmodules'].append( "-SmartPropagatorAny" )
590  self.options['esmodules'].append( "-SmartPropagator" )
591  self.options['esmodules'].append( "-RungeKuttaTrackerPropagator" )
592  self.options['esmodules'].append( "-OppositeMaterialPropagator" )
593  self.options['esmodules'].append( "-MuonTransientTrackingRecHitBuilderESProducer" )
594  self.options['esmodules'].append( "-MuonDetLayerGeometryESProducer" )
595  self.options['esmodules'].append( "-MuonCkfTrajectoryBuilder" )
596  self.options['esmodules'].append( "-hltMeasurementTracker" )
597  self.options['esmodules'].append( "-MaterialPropagator" )
598  self.options['esmodules'].append( "-L3MuKFFitter" )
599  self.options['esmodules'].append( "-KFUpdatorESProducer" )
600  self.options['esmodules'].append( "-KFSmootherForRefitInsideOut" )
601  self.options['esmodules'].append( "-KFSmootherForMuonTrackLoader" )
602  self.options['esmodules'].append( "-KFFitterForRefitInsideOut" )
603  self.options['esmodules'].append( "-GroupedCkfTrajectoryBuilder" )
604  self.options['esmodules'].append( "-GlobalTrackingGeometryESProducer" )
605  self.options['esmodules'].append( "-FittingSmootherRK" )
606  self.options['esmodules'].append( "-FitterRK" )
607  self.options['esmodules'].append( "-hltCkfTrajectoryBuilder" )
608  self.options['esmodules'].append( "-Chi2MeasurementEstimator" )
609  self.options['esmodules'].append( "-Chi2EstimatorForRefit" )
610  self.options['esmodules'].append( "-CaloTowerConstituentsMapBuilder" )
611  self.options['esmodules'].append( "-CaloTopologyBuilder" )
612 
613  self.options['services'].append( "-UpdaterService" )
614 
615  self.options['blocks'].append( "hltL1NonIsoLargeWindowElectronPixelSeeds::SeedConfiguration" )
616  self.options['blocks'].append( "hltL1IsoLargeWindowElectronPixelSeeds::SeedConfiguration" )
617  self.options['blocks'].append( "hltL1NonIsoStartUpElectronPixelSeeds::SeedConfiguration" )
618  self.options['blocks'].append( "hltL1IsoStartUpElectronPixelSeeds::SeedConfiguration" )
619 
620  self.options['modules'].append( "hltL3MuonIsolations" )
621  self.options['modules'].append( "hltPixelVertices" )
622  self.options['modules'].append( "-hltCkfL1IsoTrackCandidates" )
623  self.options['modules'].append( "-hltCtfL1IsoWithMaterialTracks" )
624  self.options['modules'].append( "-hltCkfL1NonIsoTrackCandidates" )
625  self.options['modules'].append( "-hltCtfL1NonIsoWithMaterialTracks" )
626  self.options['modules'].append( "hltPixelMatchLargeWindowElectronsL1Iso" )
627  self.options['modules'].append( "hltPixelMatchLargeWindowElectronsL1NonIso" )
628  self.options['modules'].append( "-hltESRegionalEgammaRecHit" )
629  self.options['modules'].append( "-hltEcalRegionalJetsFEDs" )
630  self.options['modules'].append( "-hltEcalRegionalJetsRecHitTmp" )
631  self.options['modules'].append( "-hltEcalRegionalMuonsFEDs" )
632  self.options['modules'].append( "-hltEcalRegionalMuonsRecHitTmp" )
633  self.options['modules'].append( "-hltEcalRegionalEgammaFEDs" )
634  self.options['modules'].append( "-hltEcalRegionalEgammaRecHitTmp" )
635  self.options['modules'].append( "-hltFEDSelector" )
636  self.options['modules'].append( "-hltL3TrajSeedOIHit" )
637  self.options['modules'].append( "-hltL3TrajSeedIOHit" )
638  self.options['modules'].append( "-hltL3TrackCandidateFromL2OIState" )
639  self.options['modules'].append( "-hltL3TrackCandidateFromL2OIHit" )
640  self.options['modules'].append( "-hltL3TrackCandidateFromL2IOHit" )
641  self.options['modules'].append( "-hltL3TrackCandidateFromL2NoVtx" )
642  self.options['modules'].append( "-hltHcalDigis" )
643  self.options['modules'].append( "-hltHoreco" )
644  self.options['modules'].append( "-hltHfreco" )
645  self.options['modules'].append( "-hltHbhereco" )
646  self.options['modules'].append( "-hltEcalRegionalRestFEDs" )
647  self.options['modules'].append( "-hltEcalRegionalESRestFEDs" )
648  self.options['modules'].append( "-hltEcalRawToRecHitFacility" )
649  self.options['modules'].append( "-hltESRawToRecHitFacility" )
650  self.options['modules'].append( "-hltEcalRegionalJetsRecHit" )
651  self.options['modules'].append( "-hltEcalRegionalMuonsRecHit" )
652  self.options['modules'].append( "-hltEcalRegionalEgammaRecHit" )
653  self.options['modules'].append( "-hltEcalRecHitAll" )
654  self.options['modules'].append( "-hltESRecHitAll" )
655  self.options['modules'].append( "-hltL3TauPixelSeeds" )
656  self.options['modules'].append( "-hltL3TauHighPtPixelSeeds" )
657  self.options['modules'].append( "-hltL3TauCkfTrackCandidates" )
658  self.options['modules'].append( "-hltL3TauCkfHighPtTrackCandidates" )
659  self.options['modules'].append( "-hltL3TauCtfWithMaterialTracks" )
660  self.options['modules'].append( "-hltL25TauPixelSeeds" )
661  self.options['modules'].append( "-hltL25TauCkfTrackCandidates" )
662  self.options['modules'].append( "-hltL25TauCtfWithMaterialTracks" )
663  self.options['modules'].append( "-hltL3TauSingleTrack15CtfWithMaterialTracks" )
664  self.options['modules'].append( "-hltPFJetCtfWithMaterialTracks" )
665  self.options['modules'].append( "-hltBLifetimeRegionalPixelSeedGeneratorStartup" )
666  self.options['modules'].append( "-hltBLifetimeRegionalCkfTrackCandidatesStartup" )
667  self.options['modules'].append( "-hltBLifetimeRegionalCtfWithMaterialTracksStartup" )
668  self.options['modules'].append( "-hltBLifetimeRegionalPixelSeedGeneratorStartupU" )
669  self.options['modules'].append( "-hltBLifetimeRegionalCkfTrackCandidatesStartupU" )
670  self.options['modules'].append( "-hltBLifetimeRegionalCtfWithMaterialTracksStartupU" )
671  self.options['modules'].append( "-hltBLifetimeRegionalPixelSeedGenerator" )
672  self.options['modules'].append( "-hltBLifetimeRegionalCkfTrackCandidates" )
673  self.options['modules'].append( "-hltBLifetimeRegionalCtfWithMaterialTracks" )
674  self.options['modules'].append( "-hltBLifetimeRegionalPixelSeedGeneratorRelaxed" )
675  self.options['modules'].append( "-hltBLifetimeRegionalCkfTrackCandidatesRelaxed" )
676  self.options['modules'].append( "-hltBLifetimeRegionalCtfWithMaterialTracksRelaxed" )
677  self.options['modules'].append( "-hltPixelTracksForMinBias" )
678  self.options['modules'].append( "-hltPixelTracksForHighMult" )
679  self.options['modules'].append( "-hltMuonCSCDigis" )
680  self.options['modules'].append( "-hltMuonDTDigis" )
681  self.options['modules'].append( "-hltMuonRPCDigis" )
682  self.options['modules'].append( "-hltGtDigis" )
683  self.options['modules'].append( "-hltL1GtTrigReport" )
684  self.options['modules'].append( "hltCsc2DRecHits" )
685  self.options['modules'].append( "hltDt1DRecHits" )
686  self.options['modules'].append( "hltRpcRecHits" )
687 
688  self.options['sequences'].append( "-HLTL1IsoEgammaRegionalRecoTrackerSequence" )
689  self.options['sequences'].append( "-HLTL1NonIsoEgammaRegionalRecoTrackerSequence" )
690  self.options['sequences'].append( "-HLTL1IsoElectronsRegionalRecoTrackerSequence" )
691  self.options['sequences'].append( "-HLTL1NonIsoElectronsRegionalRecoTrackerSequence" )
692  self.options['sequences'].append( "-HLTPixelMatchLargeWindowElectronL1IsoTrackingSequence" )
693  self.options['sequences'].append( "-HLTPixelMatchLargeWindowElectronL1NonIsoTrackingSequence" )
694  self.options['sequences'].append( "-HLTPixelTrackingForMinBiasSequence" )
695  self.options['sequences'].append( "-HLTDoLocalStripSequence" )
696  self.options['sequences'].append( "-HLTDoLocalPixelSequence" )
697  self.options['sequences'].append( "-HLTRecopixelvertexingSequence" )
698  self.options['sequences'].append( "-HLTL3TauTrackReconstructionSequence" )
699  self.options['sequences'].append( "-HLTL3TauHighPtTrackReconstructionSequence" )
700  self.options['sequences'].append( "-HLTL25TauTrackReconstructionSequence" )
701  self.options['sequences'].append( "-HLTL3TauSingleTrack15ReconstructionSequence" )
702  self.options['sequences'].append( "-HLTTrackReconstructionForJets" )
703  self.options['sequences'].append( "-HLTEndSequence" )
704  self.options['sequences'].append( "-HLTBeginSequence" )
705  self.options['sequences'].append( "-HLTBeginSequenceNZS" )
706  self.options['sequences'].append( "-HLTBeginSequenceBPTX" )
707  self.options['sequences'].append( "-HLTBeginSequenceAntiBPTX" )
708  self.options['sequences'].append( "-HLTL2HcalIsolTrackSequence" )
709  self.options['sequences'].append( "-HLTL2HcalIsolTrackSequenceHB" )
710  self.options['sequences'].append( "-HLTL2HcalIsolTrackSequenceHE" )
711  self.options['sequences'].append( "-HLTL3HcalIsolTrackSequence" )
712 
713  # remove unsupported paths
714  self.options['paths'].append( "-AlCa_EcalEta" )
715  self.options['paths'].append( "-AlCa_EcalPhiSym" )
716  self.options['paths'].append( "-AlCa_EcalPi0" )
717  self.options['paths'].append( "-AlCa_RPCMuonNoHits" )
718  self.options['paths'].append( "-AlCa_RPCMuonNoTriggers" )
719  self.options['paths'].append( "-AlCa_RPCMuonNormalisation" )
720  self.options['paths'].append( "-DQM_FEDIntegrity" )
721  self.options['paths'].append( "-DQM_FEDIntegrity_v*" )
722  self.options['paths'].append( "-HLT_Activity_DT" )
723  self.options['paths'].append( "-HLT_Activity_DT_Tuned" )
724  self.options['paths'].append( "-HLT_Activity_Ecal" )
725  self.options['paths'].append( "-HLT_Activity_EcalREM" )
726  self.options['paths'].append( "-HLT_Activity_Ecal_SC15" )
727  self.options['paths'].append( "-HLT_Activity_Ecal_SC17" )
728  self.options['paths'].append( "-HLT_Activity_Ecal_SC7" )
729  self.options['paths'].append( "-HLT_Activity_L1A" )
730  self.options['paths'].append( "-HLT_Activity_PixelClusters" )
731  self.options['paths'].append( "-HLT_Calibration" )
732  self.options['paths'].append( "-HLT_DTErrors" )
733  self.options['paths'].append( "-HLT_DoubleEle4_SW_eeRes_L1R" )
734  self.options['paths'].append( "-HLT_DoubleEle4_SW_eeRes_L1R_v*" )
735  self.options['paths'].append( "-HLT_DoubleEle5_SW_Upsilon_L1R_v*" )
736  self.options['paths'].append( "-HLT_DoublePhoton4_Jpsi_L1R" )
737  self.options['paths'].append( "-HLT_DoublePhoton4_Upsilon_L1R" )
738  self.options['paths'].append( "-HLT_DoublePhoton4_eeRes_L1R" )
739  self.options['paths'].append( "-HLT_EcalCalibration" )
740  self.options['paths'].append( "-HLT_EgammaSuperClusterOnly_L1R" )
741  self.options['paths'].append( "-HLT_Ele15_SiStrip_L1R" )
742  self.options['paths'].append( "-HLT_Ele20_SiStrip_L1R" )
743  self.options['paths'].append( "-HLT_HFThreshold10" )
744  self.options['paths'].append( "-HLT_HFThreshold3" )
745  self.options['paths'].append( "-HLT_HcalCalibration" )
746  self.options['paths'].append( "-HLT_HcalNZS" )
747  self.options['paths'].append( "-HLT_HcalPhiSym" )
748  self.options['paths'].append( "-HLT_IsoTrackHB_v*" )
749  self.options['paths'].append( "-HLT_IsoTrackHE_v*" )
750  self.options['paths'].append( "-HLT_Jet15U_HcalNoiseFiltered" )
751  self.options['paths'].append( "-HLT_Jet15U_HcalNoiseFiltered_v*" )
752  self.options['paths'].append( "-HLT_L1DoubleMuOpen_Tight" )
753  self.options['paths'].append( "-HLT_L1MuOpen_AntiBPTX" )
754  self.options['paths'].append( "-HLT_L1MuOpen_AntiBPTX_v*" )
755  self.options['paths'].append( "-HLT_Mu0_TkMu0_OST_Jpsi" )
756  self.options['paths'].append( "-HLT_Mu0_TkMu0_OST_Jpsi_Tight_v*" )
757  self.options['paths'].append( "-HLT_Mu0_Track0_Jpsi" )
758  self.options['paths'].append( "-HLT_Mu3_TkMu0_OST_Jpsi" )
759  self.options['paths'].append( "-HLT_Mu3_TkMu0_OST_Jpsi_Tight_v*" )
760  self.options['paths'].append( "-HLT_Mu3_Track0_Jpsi" )
761  self.options['paths'].append( "-HLT_Mu3_Track3_Jpsi" )
762  self.options['paths'].append( "-HLT_Mu3_Track3_Jpsi_v*" )
763  self.options['paths'].append( "-HLT_Mu3_Track5_Jpsi_v*" )
764  self.options['paths'].append( "-HLT_Mu5_TkMu0_OST_Jpsi" )
765  self.options['paths'].append( "-HLT_Mu5_TkMu0_OST_Jpsi_Tight_v*" )
766  self.options['paths'].append( "-HLT_Mu5_Track0_Jpsi" )
767  self.options['paths'].append( "-HLT_Mu5_Track0_Jpsi_v*" )
768  self.options['paths'].append( "-HLT_Random" )
769  self.options['paths'].append( "-HLT_SelectEcalSpikesHighEt_L1R" )
770  self.options['paths'].append( "-HLT_SelectEcalSpikes_L1R" )
771 
772  # remove HLTAnalyzerEndpath from fastsim cff's
773  if self.config.fragment:
774  self.options['paths'].append( "-HLTAnalyzerEndpath" )
775 
776 
777  def build_source(self):
778  if self.config.online:
779  # online we always run on data
780  self.source = "file:/tmp/InputCollection.root"
781  elif self.config.data:
782  # offline we can run on data...
783  self.source = "/store/data/Run2010B/MinimumBias/RAW/v1/000/149/291/DC6C917A-0EE3-DF11-867B-001617C3B654.root"
784  else:
785  # ...or on mc
786  self.source = "file:RelVal_DigiL1Raw_%s.root" % self.config.type
787 
def _fix_parameter
Definition: confdb.py:189
def expandWildcardOptions
Definition: confdb.py:86
def addGlobalOptions
Definition: confdb.py:176
def _build_cmdline
Definition: confdb.py:61
def overrideOutput
Definition: confdb.py:327
def replace
Definition: linker.py:10
def overrideProcessName
Definition: confdb.py:350
def _build_source
Definition: confdb.py:52
def expandWildcards
Definition: confdb.py:92
def overrideGlobalTag
Definition: confdb.py:265
static std::string join(char **cmd)
Definition: RemoteFile.cc:18
def getRawConfigurationFromDB
Definition: confdb.py:68
list object
Definition: dbtoconf.py:77
def _build_options
Definition: confdb.py:58
def instrumentTiming
Definition: confdb.py:404
def instrumentOpenMode
Definition: confdb.py:255
def _build_query
Definition: confdb.py:46
def updateMessageLogger
Definition: confdb.py:377
def overrideL1Menu
Definition: confdb.py:316
def loadAdditionalConditions
Definition: confdb.py:387