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 import os
6 import urllib, urllib2
7 from pipe import pipe as _pipe
8 from options import globalTag
9 from itertools import islice
10 
11 def splitter(iterator, n):
12  i = iterator.__iter__()
13  while True:
14  l = list(islice(i, n))
15  if l:
16  yield l
17  else:
18  break
19 
20 
21 class HLTProcess(object):
22 
23  def __init__(self, configuration):
24  self.config = configuration
25  self.data = None
26  self.source = []
27  self.parent = []
28 
29  self.options = {
30  'essources' : [],
31  'esmodules' : [],
32  'modules' : [],
33  'sequences' : [],
34  'services' : [],
35  'paths' : [],
36  'psets' : [],
37  'blocks' : [],
38  }
39 
40  self.labels = {}
41  if self.config.fragment:
42  self.labels['process'] = 'fragment.'
43  self.labels['dict'] = 'fragment.__dict__'
44  else:
45  self.labels['process'] = 'process.'
46  self.labels['dict'] = 'process.__dict__'
47 
48  if self.config.online:
49  self.labels['connect'] = 'frontier://(proxyurl=http://localhost:3128)(serverurl=http://localhost:8000/FrontierOnProd)(serverurl=http://localhost:8000/FrontierOnProd)(retrieve-ziplevel=0)'
50  else:
51  self.labels['connect'] = 'frontier://FrontierProd'
52 
53  if self.config.prescale and (self.config.prescale.lower() != 'none'):
54  self.labels['prescale'] = self.config.prescale
55 
56  # get the configuration from ConfdB
57  from confdbOfflineConverter import OfflineConverter
58  self.converter = OfflineConverter(version = self.config.menu.version, database = self.config.menu.database)
59  self.buildPathList()
60  self.buildOptions()
62  self.customize()
63 
64 
66  if self.config.menu.run:
67  args = ['--runNumber', self.config.menu.run]
68  else:
69  args = ['--configName', self.config.menu.name ]
70  args.append('--noedsources')
71  for key, vals in self.options.iteritems():
72  if vals:
73  args.extend(('--'+key, ','.join(vals)))
74 
75  data, err = self.converter.query( *args )
76  if 'ERROR' in err or 'Exhausted Resultset' in err or 'CONFIG_NOT_FOUND' in err:
77  sys.stderr.write("%s: error while retrieving the HLT menu\n\n" % os.path.basename(sys.argv[0]))
78  sys.stderr.write(err + "\n\n")
79  sys.exit(1)
80  self.data = data
81 
82 
83  def getPathList(self):
84  if self.config.menu.run:
85  args = ['--runNumber', self.config.menu.run]
86  else:
87  args = ['--configName', self.config.menu.name]
88  args.extend( (
89  '--cff',
90  '--noedsources',
91  '--noes',
92  '--noservices',
93  '--nosequences',
94  '--nomodules'
95  ) )
96 
97  data, err = self.converter.query( *args )
98  if 'ERROR' in err or 'Exhausted Resultset' in err or 'CONFIG_NOT_FOUND' in err:
99  sys.stderr.write("%s: error while retrieving the list of paths from the HLT menu\n\n" % os.path.basename(sys.argv[0]))
100  sys.stderr.write(err + "\n\n")
101  sys.exit(1)
102  filter = re.compile(r' *= *cms.(End)?Path.*')
103  paths = [ filter.sub('', line) for line in data.splitlines() if filter.search(line) ]
104  return paths
105 
106 
107  @staticmethod
108  def expandWildcards(globs, collection):
109  # expand a list of unix-style wildcards matching a given collection
110  # wildcards with no matches are silently discarded
111  matches = []
112  for glob in globs:
113  negate = ''
114  if glob[0] == '-':
115  negate = '-'
116  glob = glob[1:]
117  # translate a unix-style glob expression into a regular expression
118  filter = re.compile(r'^' + glob.replace('?', '.').replace('*', '.*').replace('[!', '[^') + r'$')
119  matches.extend( negate + element for element in collection if filter.match(element) )
120  return matches
121 
122 
123  @staticmethod
124  def consolidateNegativeList(elements):
125  # consolidate a list of path exclusions and re-inclusions
126  # the result is the list of paths to be removed from the dump
127  result = set()
128  for element in elements:
129  if element[0] == '-':
130  result.add( element )
131  else:
132  result.discard( '-' + element )
133  return sorted( element for element in result )
134 
135  @staticmethod
136  def consolidatePositiveList(elements):
137  # consolidate a list of path selection and re-exclusions
138  # the result is the list of paths to be included in the dump
139  result = set()
140  for element in elements:
141  if element[0] == '-':
142  result.discard( element[1:] )
143  else:
144  result.add( element )
145  return sorted( element for element in result )
146 
147 
148  # dump the final configuration
149  def dump(self):
150  self.data = self.data % self.labels
151  if self.config.fragment:
152  self.data = re.sub( r'\bprocess\b', 'fragment', self.data )
153  self.data = re.sub( r'\bProcess\b', 'ProcessFragment', self.data )
154  return self.data
155 
156 
157  # add specific customizations
158  def specificCustomize(self):
159  # specific customizations now live in HLTrigger.Configuration.customizeHLTforALL.customizeHLTforAll(.,.)
160  if self.config.fragment:
161  self.data += """
162 # add specific customizations
163 from HLTrigger.Configuration.customizeHLTforALL import customizeHLTforAll
164 fragment = customizeHLTforAll(fragment,"%s")
165 """ % (self.config.type)
166  else:
167  if self.config.type=="Fake":
168  prefix = "run1"
169  else:
170  prefix = "run2"
171  _gtData = "auto:"+prefix+"_hlt_"+self.config.type
172  _gtMc = "auto:"+prefix+"_mc_" +self.config.type
173  self.data += """
174 # add specific customizations
175 _customInfo = {}
176 _customInfo['menuType' ]= "%s"
177 _customInfo['globalTags']= {}
178 _customInfo['globalTags'][True ] = "%s"
179 _customInfo['globalTags'][False] = "%s"
180 _customInfo['inputFiles']={}
181 _customInfo['inputFiles'][True] = "file:RelVal_Raw_%s_DATA.root"
182 _customInfo['inputFiles'][False] = "file:RelVal_Raw_%s_MC.root"
183 _customInfo['maxEvents' ]= %s
184 _customInfo['globalTag' ]= "%s"
185 _customInfo['inputFile' ]= %s
186 _customInfo['realData' ]= %s
187 from HLTrigger.Configuration.customizeHLTforALL import customizeHLTforAll
188 process = customizeHLTforAll(process,"%s",_customInfo)
189 """ % (self.config.type,_gtData,_gtMc,self.config.type,self.config.type,self.config.events,self.config.globaltag,self.source,self.config.data,self.config.type)
190 
191  self.data += """
192 from HLTrigger.Configuration.customizeHLTforCMSSW import customizeHLTforCMSSW
193 process = customizeHLTforCMSSW(process,"%s")
194 """ % (self.config.type)
195 
196  # customize the configuration according to the options
197  def customize(self):
198 
199  # adapt the source to the current scenario
200  if not self.config.fragment:
201  self.build_source()
202 
203  # manual override some parameters
204  if self.config.type in ('HIon', ):
205  if self.config.data:
206  if not self.config.fragment:
207  self._fix_parameter( type = 'InputTag', value = 'rawDataCollector', replace = 'rawDataRepacker')
208 
209 # if self.config.type in ('HIon', ):
210 # self.data += """
211 ## Disable HF Noise filters in HIon menu
212 #if 'hltHfreco' in %(dict)s:
213 # %(process)shltHfreco.setNoiseFlags = cms.bool( False )
214 #"""
215 # else:
216 # self.data += """
217 ## Enable HF Noise filters in non-HIon menu
218 #if 'hltHfreco' in %(dict)s:
219 # %(process)shltHfreco.setNoiseFlags = cms.bool( True )
220 #"""
221 
222 # self.data += """
223 ## untracked parameters with NO default in the code
224 #if 'hltHcalDataIntegrityMonitor' in %(dict)s:
225 # %(process)shltHcalDataIntegrityMonitor.RawDataLabel = cms.untracked.InputTag("rawDataCollector")
226 #if 'hltDt4DSegments' in %(dict)s:
227 # %(process)shltDt4DSegments.debug = cms.untracked.bool( False )
228 #"""
229 
230  # if requested, remove the HLT prescales
231  self.fixPrescales()
232 
233  # if requested, override all ED/HLTfilters to always pass ("open" mode)
234  self.instrumentOpenMode()
235 
236  # if requested, change all HLTTriggerTypeFilter EDFilters to accept only error events (SelectedTriggerType = 0)
237  self.instrumentErrorEventType()
238 
239  # if requested, instrument the self with the modules and EndPath needed for timing studies
240  self.instrumentTiming()
241 
242 # if self.config.type not in ('Fake','FULL') :
243 # procfrag = self.labels['process'].split('.')[0]
244 # if '50ns_5e33_v1' in self.config.type :
245 # self.data += """
246 ## load 2015 Run-2 L1 Menu for 50ns
247 #from L1Trigger.Configuration.customise_overwriteL1Menu import L1Menu_Collisions2015_50ns_v1 as loadL1Menu
248 #%s = loadL1Menu(%s)
249 #""" %(procfrag,procfrag)
250 # elif '25ns14e33_v1' in self.config.type :
251 # self.data += """
252 ## load 2015 Run-2 L1 Menu for 25ns
253 #from L1Trigger.Configuration.customise_overwriteL1Menu import L1Menu_Collisions2015_25ns_v2 as loadL1menu
254 #%s = loadL1menu(%s)
255 #""" %(procfrag,procfrag)
256 # elif '50ns' in self.config.type :
257 # self.data += """
258 ## load 2015 Run-2 L1 Menu for 50ns
259 #from L1Trigger.Configuration.customise_overwriteL1Menu import L1Menu_Collisions2015_50ns_v4 as loadL1Menu
260 #%s = loadL1Menu(%s)
261 #""" %(procfrag,procfrag)
262 # elif 'HIon' in self.config.type :
263 # self.data += """
264 ## load 2015 Run-2 L1 Menu for HIon
265 #from L1Trigger.Configuration.customise_overwriteL1Menu import L1Menu_CollisionsHeavyIons2015_v0 as loadL1Menu
266 #%s = loadL1Menu(%s)
267 #""" %(procfrag,procfrag)
268 # elif 'LowPU' in self.config.type :
269 # self.data += """
270 ## load 2015 Run-2 L1 Menu for LowPU
271 #from L1Trigger.Configuration.customise_overwriteL1Menu import L1Menu_Collisions2015_lowPU_v4 as loadL1Menu
272 #%s = loadL1Menu(%s)
273 #""" %(procfrag,procfrag)
274 # else :
275 # self.data += """
276 ## load 2015 Run-2 L1 Menu for 25ns (default for GRun, PIon)
277 #from L1Trigger.Configuration.customise_overwriteL1Menu import L1Menu_Collisions2015_25ns_v2 as loadL1menu
278 #%s = loadL1menu(%s)
279 #""" %(procfrag,procfrag)
280 
281  if self.config.fragment:
282  self.data += """
283 # dummyfy hltGetConditions in cff's
284 if 'hltGetConditions' in %(dict)s and 'HLTriggerFirstPath' in %(dict)s :
285  %(process)shltDummyConditions = cms.EDFilter( "HLTBool",
286  result = cms.bool( True )
287  )
288  %(process)sHLTriggerFirstPath.replace(%(process)shltGetConditions,%(process)shltDummyConditions)
289 """
290 
291  else:
292 
293  # override the process name and adapt the relevant filters
294  self.overrideProcessName()
295 
296  # override the output modules to output root files
297  self.overrideOutput()
298 
299  # add global options
300  self.addGlobalOptions()
301 
302  # if requested or necessary, override the GlobalTag and connection strings (incl. L1!)
303  self.overrideGlobalTag()
304 
305  # if requested, override the L1 self from the GlobalTag (Xml)
306  self.overrideL1MenuXml()
307 
308  # if requested, add snippet to run on new L1 skim
309  self.switchToNewL1Skim()
310 
311  # if requested, run (part of) the L1 emulator
312  self.runL1Emulator()
313 
314  # request summary informations from the MessageLogger
315  self.updateMessageLogger()
316 
317  # replace DQMStore and DQMRootOutputModule with a configuration suitable for running offline
318  self.instrumentDQM()
319 
320  # load 5.2.x JECs, until they are in the GlobalTag
321 # self.loadAdditionalConditions('load 5.2.x JECs',
322 # {
323 # 'record' : 'JetCorrectionsRecord',
324 # 'tag' : 'JetCorrectorParametersCollection_AK5Calo_2012_V8_hlt_mc',
325 # 'label' : 'AK5CaloHLT',
326 # 'connect' : '%(connect)s/CMS_CONDITIONS'
327 # }, {
328 # 'record' : 'JetCorrectionsRecord',
329 # 'tag' : 'JetCorrectorParametersCollection_AK5PF_2012_V8_hlt_mc',
330 # 'label' : 'AK5PFHLT',
331 # 'connect' : '%(connect)s/CMS_CONDITIONS'
332 # }, {
333 # 'record' : 'JetCorrectionsRecord',
334 # 'tag' : 'JetCorrectorParametersCollection_AK5PFchs_2012_V8_hlt_mc',
335 # 'label' : 'AK5PFchsHLT',
336 # 'connect' : '%(connect)s/CMS_CONDITIONS'
337 # }
338 # )
339 
340  # add specific customisations
341  self.specificCustomize()
342 
343 
344  def addGlobalOptions(self):
345  # add global options
346  self.data += """
347 # limit the number of events to be processed
348 %%(process)smaxEvents = cms.untracked.PSet(
349  input = cms.untracked.int32( %d )
350 )
351 """ % self.config.events
352 
353  if not self.config.profiling:
354  self.data += """
355 # enable the TrigReport and TimeReport
356 %(process)soptions = cms.untracked.PSet(
357  wantSummary = cms.untracked.bool( True )
358 )
359 """
360 
361 
362  def _fix_parameter(self, **args):
363  """arguments:
364  name: parameter name (optional)
365  type: parameter type (look for tracked and untracked variants)
366  value: original value
367  replace: replacement value
368  """
369  if 'name' in args:
370  self.data = re.sub(
371  r'%(name)s = cms(?P<tracked>(?:\.untracked)?)\.%(type)s\( (?P<quote>["\']?)%(value)s(?P=quote)' % args,
372  r'%(name)s = cms\g<tracked>.%(type)s( \g<quote>%(replace)s\g<quote>' % args,
373  self.data)
374  else:
375  self.data = re.sub(
376  r'cms(?P<tracked>(?:\.untracked)?)\.%(type)s\( (?P<quote>["\']?)%(value)s(?P=quote)' % args,
377  r'cms\g<tracked>.%(type)s( \g<quote>%(replace)s\g<quote>' % args,
378  self.data)
379 
380 
381  def fixPrescales(self):
382  # update the PrescaleService to match the new list of paths
383  if self.options['paths']:
384  if self.options['paths'][0][0] == '-':
385  # drop requested paths
386  for minuspath in self.options['paths']:
387  path = minuspath[1:]
388  self.data = re.sub(r' cms.PSet\( pathName = cms.string\( "%s" \),\n prescales = cms.vuint32\( .* \)\n \),?\n' % path, '', self.data)
389  else:
390  # keep requested paths
391  for path in self.all_paths:
392  if path not in self.options['paths']:
393  self.data = re.sub(r' cms.PSet\( pathName = cms.string\( "%s" \),\n prescales = cms.vuint32\( .* \)\n \),?\n' % path, '', self.data)
394 
395  if self.config.prescale and (self.config.prescale.lower() != 'none'):
396  # TO DO: check that the requested prescale column is valid
397  self.data += """
398 # force the use of a specific HLT prescale column
399 if 'PrescaleService' in %(dict)s:
400  %(process)sPrescaleService.forceDefault = True
401  %(process)sPrescaleService.lvl1DefaultLabel = '%(prescale)s'
402 """
403 
404 
406  if self.config.open:
407  # find all EDfilters
408  filters = [ match[1] for match in re.findall(r'(process\.)?\b(\w+) = cms.EDFilter', self.data) ]
409  re_sequence = re.compile( r'cms\.(Path|Sequence)\((.*)\)' )
410  # remove existing 'cms.ignore' and '~' modifiers
411  self.data = re_sequence.sub( lambda line: re.sub( r'cms\.ignore *\( *((process\.)?\b(\w+)) *\)', r'\1', line.group(0) ), self.data )
412  self.data = re_sequence.sub( lambda line: re.sub( r'~', '', line.group(0) ), self.data )
413  # wrap all EDfilters with "cms.ignore( ... )", 1000 at a time (python 2.6 complains for too-big regular expressions)
414  for some in splitter(filters, 1000):
415  re_filters = re.compile( r'\b((process\.)?(' + r'|'.join(some) + r'))\b' )
416  self.data = re_sequence.sub( lambda line: re_filters.sub( r'cms.ignore( \1 )', line.group(0) ), self.data )
417 
418 
420  if self.config.errortype:
421  # change all HLTTriggerTypeFilter EDFilters to accept only error events (SelectedTriggerType = 0)
422  self._fix_parameter(name = 'SelectedTriggerType', type ='int32', value = '1', replace = '0')
423  self._fix_parameter(name = 'SelectedTriggerType', type ='int32', value = '2', replace = '0')
424  self._fix_parameter(name = 'SelectedTriggerType', type ='int32', value = '3', replace = '0')
425 
426 
427  def overrideGlobalTag(self):
428  # overwrite GlobalTag
429  # the logic is:
430  # - always set the correct connection string and pfnPrefix
431  # - if a GlobalTag is specified on the command line:
432  # - override the global tag
433  # - if the GT is "auto:...", insert the code to read it from Configuration.AlCa.autoCond
434  # - if a GlobalTag is NOT specified on the command line:
435  # - when running on data, do nothing, and keep the global tag in the menu
436  # - when running on mc, take the GT from the configuration.type
437 
438  # override the GlobalTag connection string and pfnPrefix
439  text = """
440 # override the GlobalTag, connection string and pfnPrefix
441 if 'GlobalTag' in %(dict)s:
442 """
443 
444  # when running on MC, override the global tag even if not specified on the command line
445  if not self.config.data and not self.config.globaltag:
446  if self.config.type in globalTag:
447  self.config.globaltag = globalTag[self.config.type]
448  else:
449  self.config.globaltag = globalTag['GRun']
450 
451  # if requested, override the L1 menu from the GlobalTag (using the same connect as the GlobalTag itself)
452  if self.config.l1.override:
453  self.config.l1.record = 'L1GtTriggerMenuRcd'
454  self.config.l1.label = ''
455  self.config.l1.tag = self.config.l1.override
456  if not self.config.l1.connect:
457  self.config.l1.connect = '%(connect)s/CMS_CONDITIONS'
458  self.config.l1cond = '%(tag)s,%(record)s,%(connect)s' % self.config.l1.__dict__
459  else:
460  self.config.l1cond = None
461 
462  if self.config.globaltag or self.config.l1cond:
463  text += " from Configuration.AlCa.GlobalTag_condDBv2 import GlobalTag as customiseGlobalTag\n"
464  text += " %(process)sGlobalTag = customiseGlobalTag(%(process)sGlobalTag"
465  if self.config.globaltag:
466  text += ", globaltag = %s" % repr(self.config.globaltag)
467  if self.config.l1cond:
468  text += ", conditions = %s" % repr(self.config.l1cond)
469  text += ")\n"
470 
471  text += """ %(process)sGlobalTag.connect = '%(connect)s/CMS_CONDITIONS'
472  %(process)sGlobalTag.pfnPrefix = cms.untracked.string('%(connect)s/')
473  for pset in process.GlobalTag.toGet.value():
474  pset.connect = pset.connect.value().replace('frontier://FrontierProd/', '%(connect)s/')
475  # fix for multi-run processing
476  %(process)sGlobalTag.RefreshEachRun = cms.untracked.bool( False )
477  %(process)sGlobalTag.ReconnectEachRun = cms.untracked.bool( False )
478 """
479  self.data += text
480 
481  def overrideL1MenuXml(self):
482  # if requested, override the L1 menu from the GlobalTag (Xml file)
483  if self.config.l1Xml.XmlFile:
484  text = """
485 # override the L1 menu from an Xml file
486 %%(process)sl1GtTriggerMenuXml = cms.ESProducer("L1GtTriggerMenuXmlProducer",
487  TriggerMenuLuminosity = cms.string('%(LumiDir)s'),
488  DefXmlFile = cms.string('%(XmlFile)s'),
489  VmeXmlFile = cms.string('')
490 )
491 %%(process)sL1GtTriggerMenuRcdSource = cms.ESSource("EmptyESSource",
492  recordName = cms.string('L1GtTriggerMenuRcd'),
493  iovIsRunNotTime = cms.bool(True),
494  firstValid = cms.vuint32(1)
495 )
496 %%(process)ses_prefer_l1GtParameters = cms.ESPrefer('L1GtTriggerMenuXmlProducer','l1GtTriggerMenuXml')
497 """
498  self.data += text % self.config.l1Xml.__dict__
499 
500  def runL1EmulatorGT(self):
501  # if requested, run (part of) the L1 emulator, then repack the data into a new RAW collection, to be used by the HLT
502  if not self.config.emulator:
503  return
504 
505  if self.config.emulator != 'gt':
506  # only the GT emulator is currently supported
507  return
508 
509  # run the L1 GT emulator, then repack the data into a new RAW collection, to be used by the HLT
510  text = """
511 # run the L1 GT emulator, then repack the data into a new RAW collection, to be used by the HLT
512 """
513  if self.config.fragment:
514  # FIXME in a cff, should also update the HLTSchedule
515  text += "import Configuration.StandardSequences.SimL1EmulatorRepack_GT_cff\n"
516  else:
517  text += "process.load( 'Configuration.StandardSequences.SimL1EmulatorRepack_GT_cff' )\n"
518 
519  if not 'hltBoolFalse' in self.data:
520  # add hltBoolFalse
521  text += """
522 %(process)shltBoolFalse = cms.EDFilter( "HLTBool",
523  result = cms.bool( False )
524 )
525 """
526  text += "process.L1Emulator = cms.Path( process.SimL1Emulator + process.hltBoolFalse )\n\n"
527 
528  self.data = re.sub(r'.*cms\.(End)?Path.*', text + r'\g<0>', self.data, 1)
529 
530 
531  def runL1Emulator(self):
532  # if requested, run (part of) the L1 emulator
533  if self.config.emulator:
534  # FIXME this fragment used "process" explicitly
535  emulator = {
536  'RawToDigi': '',
537  'CustomL1T': '',
538  'CustomHLT': ''
539  }
540 
541  if self.config.data:
542  emulator['RawToDigi'] = 'RawToDigi_Data_cff'
543  else:
544  emulator['RawToDigi'] = 'RawToDigi_cff'
545 
546  if self.config.emulator == 'gt':
547  emulator['CustomL1T'] = 'customiseL1GtEmulatorFromRaw'
548  emulator['CustomHLT'] = 'switchToSimGtDigis'
549  elif self.config.emulator == 'gct,gt':
550  emulator['CustomL1T'] = 'customiseL1CaloAndGtEmulatorsFromRaw'
551  emulator['CustomHLT'] = 'switchToSimGctGtDigis'
552  elif self.config.emulator == 'gmt,gt':
553  # XXX currently unsupported
554  emulator['CustomL1T'] = 'customiseL1MuonAndGtEmulatorsFromRaw'
555  emulator['CustomHLT'] = 'switchToSimGmtGtDigis'
556  elif self.config.emulator in ('gmt,gct,gt', 'gct,gmt,gt', 'all'):
557  emulator['CustomL1T'] = 'customiseL1EmulatorFromRaw'
558  emulator['CustomHLT'] = 'switchToSimGmtGctGtDigis'
559  elif self.config.emulator in ('stage1,gt'):
560  emulator['CustomL1T'] = 'customiseL1EmulatorFromRaw'
561  emulator['CustomHLT'] = 'switchToSimStage1Digis'
562  else:
563  # unsupported argument, default to running the whole emulator
564  emulator['CustomL1T'] = 'customiseL1EmulatorFromRaw'
565  emulator['CustomHLT'] = 'switchToSimGmtGctGtDigis'
566 
567  self.data += """
568 # customize the L1 emulator to run %(CustomL1T)s with HLT to %(CustomHLT)s
569 process.load( 'Configuration.StandardSequences.%(RawToDigi)s' )
570 process.load( 'Configuration.StandardSequences.SimL1Emulator_cff' )
571 import L1Trigger.Configuration.L1Trigger_custom
572 #
573 """ % emulator
574 
575  if (self.config.emulator).find("stage1")>-1:
576  self.data += """
577 # 2015 Run2 emulator
578 import L1Trigger.L1TCalorimeter.L1TCaloStage1_customForHLT
579 process = L1Trigger.L1TCalorimeter.L1TCaloStage1_customForHLT.%(CustomL1T)s( process )
580 """ % emulator
581  else:
582  self.data += """
583 # Run1 Emulator
584 process = L1Trigger.Configuration.L1Trigger_custom.%(CustomL1T)s( process )
585 """ % emulator
586 
587  self.data += """
588 #
589 process = L1Trigger.Configuration.L1Trigger_custom.customiseResetPrescalesAndMasks( process )
590 # customize the HLT to use the emulated results
591 import HLTrigger.Configuration.customizeHLTforL1Emulator
592 process = HLTrigger.Configuration.customizeHLTforL1Emulator.switchToL1Emulator( process )
593 process = HLTrigger.Configuration.customizeHLTforL1Emulator.%(CustomHLT)s( process )
594 """ % emulator
595 
596  def switchToNewL1Skim(self):
597  # add snippet to switch to new L1 skim files
598  if self.config.l1skim:
599  self.data += """
600 # Customize the menu to use information from new L1 emulator in the L1 skim files
601 process.hltL2MuonSeeds.GMTReadoutCollection = cms.InputTag("simGmtDigis::L1SKIM" )
602 process.hltL1extraParticles.muonSource = cms.InputTag("simGmtDigis::L1SKIM" )
603 for module in process.__dict__.itervalues():
604  if isinstance(module, cms._Module):
605  for parameter in module.__dict__.itervalues():
606  if isinstance(parameter, cms.InputTag):
607  if parameter.moduleLabel == 'hltGtDigis':
608  parameter.moduleLabel = "gtDigisFromSkim"
609  elif parameter.moduleLabel == 'hltL1GtObjectMap':
610  parameter.moduleLabel = "gtDigisFromSkim"
611  elif parameter.moduleLabel == 'hltGctDigis':
612  parameter.moduleLabel ="simCaloStage1LegacyFormatDigis"
613 """
614 
615  def overrideOutput(self):
616  # override the "online" ShmStreamConsumer output modules with "offline" PoolOutputModule's
617  self.data = re.sub(
618  r'\b(process\.)?hltOutput(\w+) *= *cms\.OutputModule\( *"ShmStreamConsumer" *,',
619  r'%(process)shltOutput\2 = cms.OutputModule( "PoolOutputModule",\n fileName = cms.untracked.string( "output\2.root" ),\n fastCloning = cms.untracked.bool( False ),\n dataset = cms.untracked.PSet(\n filterName = cms.untracked.string( "" ),\n dataTier = cms.untracked.string( "RAW" )\n ),',
620  self.data
621  )
622 
623  if not self.config.fragment and self.config.output == 'full':
624  # add a single "keep *" output
625  self.data += """
626 # add a single "keep *" output
627 %(process)shltOutputFULL = cms.OutputModule( "PoolOutputModule",
628  fileName = cms.untracked.string( "outputFULL.root" ),
629  fastCloning = cms.untracked.bool( False ),
630  dataset = cms.untracked.PSet(
631  dataTier = cms.untracked.string( 'RECO' ),
632  filterName = cms.untracked.string( '' )
633  ),
634  outputCommands = cms.untracked.vstring( 'keep *' )
635 )
636 %(process)sFULLOutput = cms.EndPath( %(process)shltOutputFULL )
637 """
638 
639 
640  # override the process name and adapt the relevant filters
642  if self.config.name is None:
643  return
644 
645  # sanitise process name
646  self.config.name = self.config.name.replace("_","")
647  # override the process name
648  quote = '[\'\"]'
649  self.data = re.compile(r'^(process\s*=\s*cms\.Process\(\s*' + quote + r')\w+(' + quote + r'\s*\).*)$', re.MULTILINE).sub(r'\1%s\2' % self.config.name, self.data, 1)
650 
651  # the following was stolen and adapted from HLTrigger.Configuration.customL1THLT_Options
652  self.data += """
653 # adapt HLT modules to the correct process name
654 if 'hltTrigReport' in %%(dict)s:
655  %%(process)shltTrigReport.HLTriggerResults = cms.InputTag( 'TriggerResults', '', '%(name)s' )
656 
657 if 'hltPreExpressCosmicsOutputSmart' in %%(dict)s:
658  %%(process)shltPreExpressCosmicsOutputSmart.hltResults = cms.InputTag( 'TriggerResults', '', '%(name)s' )
659 
660 if 'hltPreExpressOutputSmart' in %%(dict)s:
661  %%(process)shltPreExpressOutputSmart.hltResults = cms.InputTag( 'TriggerResults', '', '%(name)s' )
662 
663 if 'hltPreDQMForHIOutputSmart' in %%(dict)s:
664  %%(process)shltPreDQMForHIOutputSmart.hltResults = cms.InputTag( 'TriggerResults', '', '%(name)s' )
665 
666 if 'hltPreDQMForPPOutputSmart' in %%(dict)s:
667  %%(process)shltPreDQMForPPOutputSmart.hltResults = cms.InputTag( 'TriggerResults', '', '%(name)s' )
668 
669 if 'hltPreHLTDQMResultsOutputSmart' in %%(dict)s:
670  %%(process)shltPreHLTDQMResultsOutputSmart.hltResults = cms.InputTag( 'TriggerResults', '', '%(name)s' )
671 
672 if 'hltPreHLTDQMOutputSmart' in %%(dict)s:
673  %%(process)shltPreHLTDQMOutputSmart.hltResults = cms.InputTag( 'TriggerResults', '', '%(name)s' )
674 
675 if 'hltPreHLTMONOutputSmart' in %%(dict)s:
676  %%(process)shltPreHLTMONOutputSmart.hltResults = cms.InputTag( 'TriggerResults', '', '%(name)s' )
677 
678 if 'hltDQMHLTScalers' in %%(dict)s:
679  %%(process)shltDQMHLTScalers.triggerResults = cms.InputTag( 'TriggerResults', '', '%(name)s' )
680  %%(process)shltDQMHLTScalers.processname = '%(name)s'
681 
682 if 'hltDQML1SeedLogicScalers' in %%(dict)s:
683  %%(process)shltDQML1SeedLogicScalers.processname = '%(name)s'
684 """ % self.config.__dict__
685 
686 
688  # request summary informations from the MessageLogger
689  self.data += """
690 if 'MessageLogger' in %(dict)s:
691  %(process)sMessageLogger.categories.append('TriggerSummaryProducerAOD')
692  %(process)sMessageLogger.categories.append('L1GtTrigReport')
693  %(process)sMessageLogger.categories.append('HLTrigReport')
694  %(process)sMessageLogger.categories.append('FastReport')
695 """
696 
697 
698  def loadAdditionalConditions(self, comment, *conditions):
699  # load additional conditions
700  self.data += """
701 # %s
702 if 'GlobalTag' in %%(dict)s:
703 """ % comment
704  for condition in conditions:
705  self.data += """ %%(process)sGlobalTag.toGet.append(
706  cms.PSet(
707  record = cms.string( '%(record)s' ),
708  tag = cms.string( '%(tag)s' ),
709  label = cms.untracked.string( '%(label)s' ),
710  connect = cms.untracked.string( '%(connect)s' )
711  )
712  )
713 """ % condition
714 
715 
716  def loadCffCommand(self, module):
717  # load a cfi or cff module
718  if self.config.fragment:
719  return 'from %s import *\n' % module
720  else:
721  return 'process.load( "%s" )\n' % module
722 
723  def loadCff(self, module):
724  self.data += self.loadCffCommand(module)
725 
726 
727  def overrideParameters(self, module, parameters):
728  # override a module's parameter if the module is present in the configuration
729  self.data += "if '%s' in %%(dict)s:\n" % module
730  for (parameter, value) in parameters:
731  self.data += " %%(process)s%s.%s = %s\n" % (module, parameter, value)
732  self.data += "\n"
733 
734 
735  def instrumentTiming(self):
736  if self.config.profiling:
737  # instrument the menu for profiling: remove the HLTAnalyzerEndpath, add/override the HLTriggerFirstPath, with hltGetRaw and hltGetConditions
738  text = ''
739 
740  if not 'hltGetRaw' in self.data:
741  # add hltGetRaw
742  text += """
743 %(process)shltGetRaw = cms.EDAnalyzer( "HLTGetRaw",
744  RawDataCollection = cms.InputTag( "rawDataCollector" )
745 )
746 """
747 
748  if not 'hltGetConditions' in self.data:
749  # add hltGetConditions
750  text += """
751 %(process)shltGetConditions = cms.EDAnalyzer( 'EventSetupRecordDataGetter',
752  verbose = cms.untracked.bool( False ),
753  toGet = cms.VPSet( )
754 )
755 """
756 
757  if not 'hltBoolFalse' in self.data:
758  # add hltBoolFalse
759  text += """
760 %(process)shltBoolFalse = cms.EDFilter( "HLTBool",
761  result = cms.bool( False )
762 )
763 """
764 
765  # add the definition of HLTriggerFirstPath
766  # FIXME in a cff, should also update the HLTSchedule
767  text += """
768 %(process)sHLTriggerFirstPath = cms.Path( %(process)shltGetRaw + %(process)shltGetConditions + %(process)shltBoolFalse )
769 """
770  self.data = re.sub(r'.*cms\.(End)?Path.*', text + r'\g<0>', self.data, 1)
771 
772 
773  # instrument the menu with the Service, EDProducer and EndPath needed for timing studies
774  # FIXME in a cff, should also update the HLTSchedule
775  if self.config.timing:
776  self.data += """
777 # instrument the menu with the modules and EndPath needed for timing studies
778 """
779 
780  if not 'FastTimerService' in self.data:
781  self.data += '\n# configure the FastTimerService\n'
782  self.loadCff('HLTrigger.Timer.FastTimerService_cfi')
783  else:
784  self.data += '\n# configure the FastTimerService\n'
785 
786  self.data += """# this is currently ignored in CMSSW 7.x, always using the real time clock
787 %(process)sFastTimerService.useRealTimeClock = True
788 # enable specific features
789 %(process)sFastTimerService.enableTimingPaths = True
790 %(process)sFastTimerService.enableTimingModules = True
791 %(process)sFastTimerService.enableTimingExclusive = True
792 # print a text summary at the end of the job
793 %(process)sFastTimerService.enableTimingSummary = True
794 # skip the first path (disregard the time spent loading event and conditions data)
795 %(process)sFastTimerService.skipFirstPath = True
796 # enable DQM plots
797 %(process)sFastTimerService.enableDQM = True
798 # enable most per-path DQM plots
799 %(process)sFastTimerService.enableDQMbyPathActive = True
800 %(process)sFastTimerService.enableDQMbyPathTotal = True
801 %(process)sFastTimerService.enableDQMbyPathOverhead = False
802 %(process)sFastTimerService.enableDQMbyPathDetails = True
803 %(process)sFastTimerService.enableDQMbyPathCounters = True
804 %(process)sFastTimerService.enableDQMbyPathExclusive = True
805 # disable per-module DQM plots
806 %(process)sFastTimerService.enableDQMbyModule = False
807 %(process)sFastTimerService.enableDQMbyModuleType = False
808 # enable per-event DQM sumary plots
809 %(process)sFastTimerService.enableDQMSummary = True
810 # enable per-event DQM plots by lumisection
811 %(process)sFastTimerService.enableDQMbyLumiSection = True
812 %(process)sFastTimerService.dqmLumiSectionsRange = 2500
813 # set the time resolution of the DQM plots
814 %(process)sFastTimerService.dqmTimeRange = 1000.
815 %(process)sFastTimerService.dqmTimeResolution = 5.
816 %(process)sFastTimerService.dqmPathTimeRange = 100.
817 %(process)sFastTimerService.dqmPathTimeResolution = 0.5
818 %(process)sFastTimerService.dqmModuleTimeRange = 40.
819 %(process)sFastTimerService.dqmModuleTimeResolution = 0.2
820 # set the base DQM folder for the plots
821 %(process)sFastTimerService.dqmPath = 'HLT/TimerService'
822 %(process)sFastTimerService.enableDQMbyProcesses = True
823 """
824 
825 
826  def instrumentDQM(self):
827  if not self.config.hilton:
828  # remove any reference to the hltDQMFileSaver
829  if 'hltDQMFileSaver' in self.data:
830  self.data = re.sub(r'\b(process\.)?hltDQMFileSaver \+ ', '', self.data)
831  self.data = re.sub(r' \+ \b(process\.)?hltDQMFileSaver', '', self.data)
832  self.data = re.sub(r'\b(process\.)?hltDQMFileSaver', '', self.data)
833 
834  # instrument the HLT menu with DQMStore and DQMRootOutputModule suitable for running offline
835  dqmstore = "\n# load the DQMStore and DQMRootOutputModule\n"
836  dqmstore += self.loadCffCommand('DQMServices.Core.DQMStore_cfi')
837  dqmstore += "%(process)sDQMStore.enableMultiThread = True\n"
838  dqmstore += """
839 %(process)sdqmOutput = cms.OutputModule("DQMRootOutputModule",
840  fileName = cms.untracked.string("DQMIO.root")
841 )
842 """
843 
844  empty_path = re.compile(r'.*\b(process\.)?DQMOutput = cms\.EndPath\( *\).*')
845  other_path = re.compile(r'(.*\b(process\.)?DQMOutput = cms\.EndPath\()(.*)')
846  if empty_path.search(self.data):
847  # replace an empty DQMOutput path
848  self.data = empty_path.sub(dqmstore + '\n%(process)sDQMOutput = cms.EndPath( %(process)sdqmOutput )\n', self.data)
849  elif other_path.search(self.data):
850  # prepend the dqmOutput to the DQMOutput path
851  self.data = other_path.sub(dqmstore + r'\g<1> %(process)sdqmOutput +\g<3>', self.data)
852  else:
853  # ceate a new DQMOutput path with the dqmOutput module
854  self.data += dqmstore
855  self.data += '\n%(process)sDQMOutput = cms.EndPath( %(process)sdqmOutput )\n'
856 
857 
858  @staticmethod
859  def dumppaths(paths):
860  sys.stderr.write('Path selection:\n')
861  for path in paths:
862  sys.stderr.write('\t%s\n' % path)
863  sys.stderr.write('\n\n')
864 
865  def buildPathList(self):
866  self.all_paths = self.getPathList()
867 
868  if self.config.paths:
869  # no path list was requested, dump the full table, minus unsupported / unwanted paths
870  paths = self.config.paths.split(',')
871  else:
872  # dump only the requested paths, plus the eventual output endpaths
873  paths = []
874 
875  if self.config.fragment or self.config.output in ('none', 'full'):
876  # 'full' removes all outputs (same as 'none') and then adds a single "keep *" output (see the overrideOutput method)
877  if self.config.paths:
878  # paths are removed by default
879  pass
880  else:
881  # drop all output endpaths
882  paths.append( "-*Output" )
883  elif self.config.output == 'minimal':
884  # drop all output endpaths but HLTDQMResultsOutput
885  if self.config.paths:
886  paths.append( "HLTDQMResultsOutput" )
887  else:
888  paths.append( "-*Output" )
889  paths.append( "HLTDQMResultsOutput" )
890  else:
891  # keep / add back all output endpaths
892  if self.config.paths:
893  paths.append( "*Output" )
894  else:
895  pass # paths are kepy by default
896 
897  # drop unwanted paths for profiling (and timing studies)
898  if self.config.profiling:
899  paths.append( "-HLTriggerFirstPath" )
900  paths.append( "-HLTAnalyzerEndpath" )
901 
902  # this should never be in any dump (nor online menu)
903  paths.append( "-OfflineOutput" )
904 
905  # expand all wildcards
906  paths = self.expandWildcards(paths, self.all_paths)
907 
908  if self.config.paths:
909  # do an "additive" consolidation
910  self.options['paths'] = self.consolidatePositiveList(paths)
911  if not self.options['paths']:
912  raise RuntimeError('Error: option "--paths %s" does not select any valid paths' % self.config.paths)
913  else:
914  # do a "subtractive" consolidation
915  self.options['paths'] = self.consolidateNegativeList(paths)
916 
917 
918  def buildOptions(self):
919  # common configuration for all scenarios
920  self.options['services'].append( "-DQM" )
921  self.options['services'].append( "-FUShmDQMOutputService" )
922  self.options['services'].append( "-MicroStateService" )
923  self.options['services'].append( "-ModuleWebRegistry" )
924  self.options['services'].append( "-TimeProfilerService" )
925 
926  # remove the DAQ modules and the online definition of the DQMStore and DQMFileSaver
927  # unless a hilton-like configuration has been requested
928  if not self.config.hilton:
929  self.options['services'].append( "-EvFDaqDirector" )
930  self.options['services'].append( "-FastMonitoringService" )
931  self.options['services'].append( "-DQMStore" )
932  self.options['modules'].append( "-hltDQMFileSaver" )
933 
934  if self.config.fragment:
935  # extract a configuration file fragment
936  self.options['essources'].append( "-GlobalTag" )
937  self.options['essources'].append( "-HepPDTESSource" )
938  self.options['essources'].append( "-XMLIdealGeometryESSource" )
939  self.options['essources'].append( "-eegeom" )
940  self.options['essources'].append( "-es_hardcode" )
941  self.options['essources'].append( "-magfield" )
942 
943  self.options['esmodules'].append( "-AutoMagneticFieldESProducer" )
944  self.options['esmodules'].append( "-SlaveField0" )
945  self.options['esmodules'].append( "-SlaveField20" )
946  self.options['esmodules'].append( "-SlaveField30" )
947  self.options['esmodules'].append( "-SlaveField35" )
948  self.options['esmodules'].append( "-SlaveField38" )
949  self.options['esmodules'].append( "-SlaveField40" )
950  self.options['esmodules'].append( "-VBF0" )
951  self.options['esmodules'].append( "-VBF20" )
952  self.options['esmodules'].append( "-VBF30" )
953  self.options['esmodules'].append( "-VBF35" )
954  self.options['esmodules'].append( "-VBF38" )
955  self.options['esmodules'].append( "-VBF40" )
956  self.options['esmodules'].append( "-CSCGeometryESModule" )
957  self.options['esmodules'].append( "-CaloGeometryBuilder" )
958  self.options['esmodules'].append( "-CaloTowerHardcodeGeometryEP" )
959  self.options['esmodules'].append( "-CastorHardcodeGeometryEP" )
960  self.options['esmodules'].append( "-DTGeometryESModule" )
961  self.options['esmodules'].append( "-EcalBarrelGeometryEP" )
962  self.options['esmodules'].append( "-EcalElectronicsMappingBuilder" )
963  self.options['esmodules'].append( "-EcalEndcapGeometryEP" )
964  self.options['esmodules'].append( "-EcalLaserCorrectionService" )
965  self.options['esmodules'].append( "-EcalPreshowerGeometryEP" )
966  self.options['esmodules'].append( "-HcalHardcodeGeometryEP" )
967  self.options['esmodules'].append( "-HcalTopologyIdealEP" )
968  self.options['esmodules'].append( "-MuonNumberingInitialization" )
969  self.options['esmodules'].append( "-ParametrizedMagneticFieldProducer" )
970  self.options['esmodules'].append( "-RPCGeometryESModule" )
971  self.options['esmodules'].append( "-SiStripGainESProducer" )
972  self.options['esmodules'].append( "-SiStripRecHitMatcherESProducer" )
973  self.options['esmodules'].append( "-SiStripQualityESProducer" )
974  self.options['esmodules'].append( "-StripCPEfromTrackAngleESProducer" )
975  self.options['esmodules'].append( "-TrackerDigiGeometryESModule" )
976  self.options['esmodules'].append( "-TrackerGeometricDetESModule" )
977  self.options['esmodules'].append( "-VolumeBasedMagneticFieldESProducer" )
978  self.options['esmodules'].append( "-ZdcHardcodeGeometryEP" )
979  self.options['esmodules'].append( "-hcal_db_producer" )
980  self.options['esmodules'].append( "-L1GtTriggerMaskAlgoTrigTrivialProducer" )
981  self.options['esmodules'].append( "-L1GtTriggerMaskTechTrigTrivialProducer" )
982  self.options['esmodules'].append( "-hltESPEcalTrigTowerConstituentsMapBuilder" )
983  self.options['esmodules'].append( "-hltESPGlobalTrackingGeometryESProducer" )
984  self.options['esmodules'].append( "-hltESPMuonDetLayerGeometryESProducer" )
985  self.options['esmodules'].append( "-hltESPTrackerRecoGeometryESProducer" )
986  self.options['esmodules'].append( "-trackerTopology" )
987 
988  self.options['esmodules'].append( "-CaloTowerGeometryFromDBEP" )
989  self.options['esmodules'].append( "-CastorGeometryFromDBEP" )
990  self.options['esmodules'].append( "-EcalBarrelGeometryFromDBEP" )
991  self.options['esmodules'].append( "-EcalEndcapGeometryFromDBEP" )
992  self.options['esmodules'].append( "-EcalPreshowerGeometryFromDBEP" )
993  self.options['esmodules'].append( "-HcalGeometryFromDBEP" )
994  self.options['esmodules'].append( "-ZdcGeometryFromDBEP" )
995  self.options['esmodules'].append( "-XMLFromDBSource" )
996  self.options['esmodules'].append( "-sistripconn" )
997 
998  self.options['services'].append( "-MessageLogger" )
999 
1000  self.options['psets'].append( "-maxEvents" )
1001  self.options['psets'].append( "-options" )
1002 
1003  if self.config.fragment or (self.config.prescale and (self.config.prescale.lower() == 'none')):
1004  self.options['services'].append( "-PrescaleService" )
1005 
1006  if self.config.fragment or self.config.timing:
1007  self.options['services'].append( "-FastTimerService" )
1008 
1009 
1010  def append_filenames(self, name, filenames):
1011  if len(filenames) > 255:
1012  token_open = "( *("
1013  token_close = ") )"
1014  else:
1015  token_open = "("
1016  token_close = ")"
1017 
1018  self.data += " %s = cms.untracked.vstring%s\n" % (name, token_open)
1019  for line in filenames:
1020  self.data += " '%s',\n" % line
1021  self.data += " %s,\n" % (token_close)
1022 
1023 
1024  def expand_filenames(self, input):
1025  # check if the input is a dataset or a list of files
1026  if input[0:8] == 'dataset:':
1027  from dasFileQuery import dasFileQuery
1028  # extract the dataset name, and use DAS to fine the list of LFNs
1029  dataset = input[8:]
1030  files = dasFileQuery(dataset)
1031  else:
1032  # assume a comma-separated list of input files
1033  files = self.config.input.split(',')
1034  return files
1035 
1036  def build_source(self):
1037  if self.config.input:
1038  # if a dataset or a list of input files was given, use it
1039  self.source = self.expand_filenames(self.config.input)
1040  elif self.config.online:
1041  # online we always run on data
1042  self.source = [ "file:/tmp/InputCollection.root" ]
1043  elif self.config.data:
1044  # offline we can run on data...
1045  self.source = [ "file:RelVal_Raw_%s_DATA.root" % self.config.type ]
1046  else:
1047  # ...or on mc
1048  self.source = [ "file:RelVal_Raw_%s_MC.root" % self.config.type ]
1049 
1050  if self.config.parent:
1051  # if a dataset or a list of input files was given for the parent data, use it
1052  self.parent = self.expand_filenames(self.config.parent)
1053 
1054  self.data += """
1055 %(process)ssource = cms.Source( "PoolSource",
1056 """
1057  self.append_filenames("fileNames", self.source)
1058  if (self.parent):
1059  self.append_filenames("secondaryFileNames", self.parent)
1060  self.data += """\
1061  inputCommands = cms.untracked.vstring(
1062  'keep *'
1063  )
1064 )
1065 """
def _fix_parameter
Definition: confdb.py:362
def build_source
Definition: confdb.py:1036
def loadAdditionalConditions
Definition: confdb.py:698
def loadCff
Definition: confdb.py:723
def buildPathList
Definition: confdb.py:865
def instrumentTiming
Definition: confdb.py:735
def runL1Emulator
Definition: confdb.py:531
boost::dynamic_bitset append(const boost::dynamic_bitset<> &bs1, const boost::dynamic_bitset<> &bs2)
this method takes two bitsets bs1 and bs2 and returns result of bs2 appended to the end of bs1 ...
def instrumentErrorEventType
Definition: confdb.py:419
def switchToNewL1Skim
Definition: confdb.py:596
def expand_filenames
Definition: confdb.py:1024
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
def instrumentDQM
Definition: confdb.py:826
def splitter
Definition: confdb.py:11
def overrideGlobalTag
Definition: confdb.py:427
def fixPrescales
Definition: confdb.py:381
def specificCustomize
Definition: confdb.py:158
def consolidateNegativeList
Definition: confdb.py:124
def dumppaths
Definition: confdb.py:859
def loadCffCommand
Definition: confdb.py:716
def runL1EmulatorGT
Definition: confdb.py:500
def consolidatePositiveList
Definition: confdb.py:136
def expandWildcards
Definition: confdb.py:108
static std::string join(char **cmd)
Definition: RemoteFile.cc:18
def getRawConfigurationFromDB
Definition: confdb.py:65
def buildOptions
Definition: confdb.py:918
def overrideProcessName
Definition: confdb.py:641
def overrideL1MenuXml
Definition: confdb.py:481
def append_filenames
Definition: confdb.py:1010
def addGlobalOptions
Disable HF Noise filters in HIon menu if &#39;hltHfreco&#39; in %(dict)s: %(process)shltHfreco.setNoiseFlags = cms.bool( False ) &quot;&quot;" else: self.data += &quot;&quot;" Enable HF Noise filters in non-HIon menu if &#39;hltHfreco&#39; in %(dict)s: %(process)shltHfreco.setNoiseFlags = cms.bool( True ) &quot;&quot;".
Definition: confdb.py:344
def instrumentOpenMode
Definition: confdb.py:405
def overrideOutput
Definition: confdb.py:615
def overrideParameters
Definition: confdb.py:727
def updateMessageLogger
Definition: confdb.py:687
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*","!HLTx*"if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL.It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of"!*"before the partial wildcard feature was incorporated).Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run