7 from pipe
import pipe
as _pipe
8 from options
import globalTag
9 from itertools
import islice
12 i = iterator.__iter__()
14 l =
list(islice(i, n))
41 if self.config.fragment:
42 self.
labels[
'process'] =
'fragment.'
43 self.
labels[
'dict'] =
'fragment.__dict__'
45 self.
labels[
'process'] =
'process.'
46 self.
labels[
'dict'] =
'process.__dict__'
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)'
51 self.
labels[
'connect'] =
'frontier://FrontierProd'
53 if self.config.prescale
and (self.config.prescale.lower() !=
'none'):
54 self.
labels[
'prescale'] = self.config.prescale
57 from confdbOfflineConverter
import OfflineConverter
58 self.
converter = OfflineConverter(database = self.config.menu.db)
66 if self.config.menu.run:
67 args = [
'--runNumber', self.config.menu.run]
69 args = [
'--configName', self.config.menu.name ]
70 args.append(
'--noedsources')
71 for key, vals
in self.options.iteritems():
73 args.extend((
'--'+key,
','.
join(vals)))
75 data, err = self.converter.query( *args )
76 if 'ERROR' in err
or 'Exhausted Resultset' in err
or 'CONFIG_NOT_FOUND' in err:
77 print "%s: error while retriving the HLT menu" % os.path.basename(sys.argv[0])
86 if self.config.menu.run:
87 args = [
'--runNumber', self.config.menu.run]
89 args = [
'--configName', self.config.menu.name]
99 data, err = self.converter.query( *args )
100 if 'ERROR' in err
or 'Exhausted Resultset' in err
or 'CONFIG_NOT_FOUND' in err:
101 print "%s: error while retriving the list of paths from the HLT menu" % os.path.basename(sys.argv[0])
106 filter = re.compile(
r' *= *cms.(End)?Path.*')
107 paths = [ filter.sub(
'', line)
for line
in data.splitlines()
if filter.search(line) ]
122 filter = re.compile(
r'^' + glob.replace(
'?',
'.').
replace(
'*',
'.*').
replace(
'[!',
'[^') +
r'$')
123 matches.extend( negate + element
for element
in collection
if filter.match(element) )
132 for element
in elements:
133 if element[0] ==
'-':
134 result.add( element )
136 result.discard(
'-' + element )
137 return sorted( element
for element
in result )
144 for element
in elements:
145 if element[0] ==
'-':
146 result.discard( element[1:] )
148 result.add( element )
149 return sorted( element
for element
in result )
155 if self.config.fragment:
156 self.
data = re.sub(
r'\bprocess\b',
'fragment', self.
data )
157 self.
data = re.sub(
r'\bProcess\b',
'ProcessFragment', self.
data )
164 if self.config.fragment:
166 # add specific customizations
167 from HLTrigger.Configuration.customizeHLTforALL import customizeHLTforAll
168 fragment = customizeHLTforAll(fragment)
171 if self.config.type==
"Fake":
175 _gtData =
"auto:"+prefix+
"_hlt_"+self.config.type
176 _gtMc =
"auto:"+prefix+
"_mc_" +self.config.type
178 # add specific customizations
180 _customInfo['menuType' ]= "%s"
181 _customInfo['globalTags']= {}
182 _customInfo['globalTags'][True ] = "%s"
183 _customInfo['globalTags'][False] = "%s"
184 _customInfo['inputFiles']={}
185 _customInfo['inputFiles'][True] = "file:RelVal_Raw_%s_DATA.root"
186 _customInfo['inputFiles'][False] = "file:RelVal_Raw_%s_MC.root"
187 _customInfo['maxEvents' ]= %s
188 _customInfo['globalTag' ]= "%s"
189 _customInfo['inputFile' ]= %s
190 _customInfo['realData' ]= %s
191 from HLTrigger.Configuration.customizeHLTforALL import customizeHLTforAll
192 process = customizeHLTforAll(process,_customInfo)
193 """ % (self.config.type,_gtData,_gtMc,self.config.type,self.config.type,self.config.events,self.config.globaltag,self.
source,self.config.data)
200 if not self.config.fragment:
204 if self.config.type
in (
'HIon', ):
206 if not self.config.fragment:
207 self._fix_parameter( type =
'InputTag', value =
'rawDataCollector', replace =
'rawDataRepacker')
234 self.instrumentOpenMode()
237 self.instrumentErrorEventType()
240 self.instrumentTiming()
242 if self.config.fragment:
244 # dummyfy hltGetConditions in cff's
245 if 'hltGetConditions' in %(dict)s and 'HLTriggerFirstPath' in %(dict)s :
246 %(process)shltDummyConditions = cms.EDFilter( "HLTBool",
247 result = cms.bool( True )
249 %(process)sHLTriggerFirstPath.replace(%(process)shltGetConditions,%(process)shltDummyConditions)
254 if self.config.type
not in (
'Fake',) :
255 if '50ns' in self.config.type :
257 # load 2015 Run-2 L1 Menu for 50ns
258 from L1Trigger.Configuration.customise_overwriteL1Menu import L1Menu_Collisions2015_50ns_v1 as loadL1Menu
259 process = loadL1Menu(process)
261 elif 'HIon' in self.config.type :
263 # load 2015 Run-2 L1 Menu for HIon
264 from L1Trigger.Configuration.customise_overwriteL1Menu import L1Menu_CollisionsHeavyIons2015_v0 as loadL1Menu
265 process = loadL1Menu(process)
269 # load 2015 Run-2 L1 Menu for 25ns (default for GRun, PIon)
270 from L1Trigger.Configuration.customise_overwriteL1Menu import L1Menu_Collisions2015_25ns_v2 as loadL1menu
271 process = loadL1menu(process)
275 self.overrideProcessName()
278 self.overrideOutput()
281 self.addGlobalOptions()
284 self.overrideGlobalTag()
287 self.overrideL1MenuXml()
290 self.switchToNewL1Skim()
296 self.updateMessageLogger()
328 # limit the number of events to be processed
329 %%(process)smaxEvents = cms.untracked.PSet(
330 input = cms.untracked.int32( %d )
332 """ % self.config.events
334 if not self.config.profiling:
336 # enable the TrigReport and TimeReport
337 %(process)soptions = cms.untracked.PSet(
338 wantSummary = cms.untracked.bool( True )
345 name: parameter name (optional)
346 type: parameter type (look for tracked and untracked variants)
347 value: original value
348 replace: replacement value
352 r'%(name)s = cms(?P<tracked>(?:\.untracked)?)\.%(type)s\( (?P<quote>["\']?)%(value)s(?P=quote)' % args,
353 r'%(name)s = cms\g<tracked>.%(type)s( \g<quote>%(replace)s\g<quote>' % args,
357 r'cms(?P<tracked>(?:\.untracked)?)\.%(type)s\( (?P<quote>["\']?)%(value)s(?P=quote)' % args,
358 r'cms\g<tracked>.%(type)s( \g<quote>%(replace)s\g<quote>' % args,
364 if self.options[
'paths']:
365 if self.options[
'paths'][0][0] ==
'-':
367 for minuspath
in self.options[
'paths']:
369 self.data = re.sub(
r' cms.PSet\( pathName = cms.string\( "%s" \),\n prescales = cms.vuint32\( .* \)\n \),?\n' % path,
'', self.data)
372 for path
in self.all_paths:
373 if path
not in self.options[
'paths']:
374 self.data = re.sub(
r' cms.PSet\( pathName = cms.string\( "%s" \),\n prescales = cms.vuint32\( .* \)\n \),?\n' % path,
'', self.data)
376 if self.config.prescale
and (self.config.prescale.lower() !=
'none'):
379 # force the use of a specific HLT prescale column
380 if 'PrescaleService' in %(dict)s:
381 %(process)sPrescaleService.forceDefault = True
382 %(process)sPrescaleService.lvl1DefaultLabel = '%(prescale)s'
389 filters = [ match[1]
for match
in re.findall(
r'(process\.)?\b(\w+) = cms.EDFilter', self.data) ]
390 re_sequence = re.compile(
r'cms\.(Path|Sequence)\((.*)\)' )
392 self.data = re_sequence.sub(
lambda line: re.sub(
r'cms\.ignore *\( *((process\.)?\b(\w+)) *\)',
r'\1', line.group(0) ), self.data )
393 self.data = re_sequence.sub(
lambda line: re.sub(
r'~',
'', line.group(0) ), self.data )
395 for some
in splitter(filters, 1000):
396 re_filters = re.compile(
r'\b((process\.)?(' +
r'|'.
join(some) +
r'))\b' )
397 self.data = re_sequence.sub(
lambda line: re_filters.sub(
r'cms.ignore( \1 )', line.group(0) ), self.data )
401 if self.config.errortype:
403 self._fix_parameter(name =
'SelectedTriggerType', type =
'int32', value =
'1', replace =
'0')
404 self._fix_parameter(name =
'SelectedTriggerType', type =
'int32', value =
'2', replace =
'0')
405 self._fix_parameter(name =
'SelectedTriggerType', type =
'int32', value =
'3', replace =
'0')
421 # override the GlobalTag, connection string and pfnPrefix
422 if 'GlobalTag' in %(dict)s:
426 if not self.config.data
and not self.config.globaltag:
427 if self.config.type
in globalTag:
428 self.config.globaltag = globalTag[self.config.type]
430 self.config.globaltag = globalTag[
'GRun']
433 if self.config.l1.override:
434 self.config.l1.record =
'L1GtTriggerMenuRcd'
435 self.config.l1.label =
''
436 self.config.l1.tag = self.config.l1.override
437 if not self.config.l1.connect:
438 self.config.l1.connect =
'%(connect)s/CMS_CONDITIONS'
439 self.config.l1cond =
'%(tag)s,%(record)s,%(connect)s' % self.config.l1.__dict__
441 self.config.l1cond =
None
443 if self.config.globaltag
or self.config.l1cond:
444 text +=
" from Configuration.AlCa.GlobalTag_condDBv2 import GlobalTag as customiseGlobalTag\n"
445 text +=
" %(process)sGlobalTag = customiseGlobalTag(%(process)sGlobalTag"
446 if self.config.globaltag:
447 text +=
", globaltag = %s" % repr(self.config.globaltag)
448 if self.config.l1cond:
449 text +=
", conditions = %s" % repr(self.config.l1cond)
452 text +=
""" %(process)sGlobalTag.connect = '%(connect)s/CMS_CONDITIONS'
453 %(process)sGlobalTag.pfnPrefix = cms.untracked.string('%(connect)s/')
454 for pset in process.GlobalTag.toGet.value():
455 pset.connect = pset.connect.value().replace('frontier://FrontierProd/', '%(connect)s/')
456 # fix for multi-run processing
457 %(process)sGlobalTag.RefreshEachRun = cms.untracked.bool( False )
458 %(process)sGlobalTag.ReconnectEachRun = cms.untracked.bool( False )
464 if self.config.l1Xml.XmlFile:
466 # override the L1 menu from an Xml file
467 %%(process)sl1GtTriggerMenuXml = cms.ESProducer("L1GtTriggerMenuXmlProducer",
468 TriggerMenuLuminosity = cms.string('%(LumiDir)s'),
469 DefXmlFile = cms.string('%(XmlFile)s'),
470 VmeXmlFile = cms.string('')
472 %%(process)sL1GtTriggerMenuRcdSource = cms.ESSource("EmptyESSource",
473 recordName = cms.string('L1GtTriggerMenuRcd'),
474 iovIsRunNotTime = cms.bool(True),
475 firstValid = cms.vuint32(1)
477 %%(process)ses_prefer_l1GtParameters = cms.ESPrefer('L1GtTriggerMenuXmlProducer','l1GtTriggerMenuXml')
479 self.data += text % self.config.l1Xml.__dict__
483 if not self.config.emulator:
486 if self.config.emulator !=
'gt':
492 # run the L1 GT emulator, then repack the data into a new RAW collection, to be used by the HLT
494 if self.config.fragment:
496 text +=
"import Configuration.StandardSequences.SimL1EmulatorRepack_GT_cff\n"
498 text +=
"process.load( 'Configuration.StandardSequences.SimL1EmulatorRepack_GT_cff' )\n"
500 if not 'hltBoolFalse' in self.data:
503 %(process)shltBoolFalse = cms.EDFilter( "HLTBool",
504 result = cms.bool( False )
507 text +=
"process.L1Emulator = cms.Path( process.SimL1Emulator + process.hltBoolFalse )\n\n"
509 self.data = re.sub(
r'.*cms\.(End)?Path.*', text +
r'\g<0>', self.data, 1)
514 if self.config.emulator:
523 emulator[
'RawToDigi'] =
'RawToDigi_Data_cff'
525 emulator[
'RawToDigi'] =
'RawToDigi_cff'
527 if self.config.emulator ==
'gt':
528 emulator[
'CustomL1T'] =
'customiseL1GtEmulatorFromRaw'
529 emulator[
'CustomHLT'] =
'switchToSimGtDigis'
530 elif self.config.emulator ==
'gct,gt':
531 emulator[
'CustomL1T'] =
'customiseL1CaloAndGtEmulatorsFromRaw'
532 emulator[
'CustomHLT'] =
'switchToSimGctGtDigis'
533 elif self.config.emulator ==
'gmt,gt':
535 emulator[
'CustomL1T'] =
'customiseL1MuonAndGtEmulatorsFromRaw'
536 emulator[
'CustomHLT'] =
'switchToSimGmtGtDigis'
537 elif self.config.emulator
in (
'gmt,gct,gt',
'gct,gmt,gt',
'all'):
538 emulator[
'CustomL1T'] =
'customiseL1EmulatorFromRaw'
539 emulator[
'CustomHLT'] =
'switchToSimGmtGctGtDigis'
540 elif self.config.emulator
in (
'stage1,gt'):
541 emulator[
'CustomL1T'] =
'customiseL1EmulatorFromRaw'
542 emulator[
'CustomHLT'] =
'switchToSimStage1Digis'
545 emulator[
'CustomL1T'] =
'customiseL1EmulatorFromRaw'
546 emulator[
'CustomHLT'] =
'switchToSimGmtGctGtDigis'
549 # customize the L1 emulator to run %(CustomL1T)s with HLT to %(CustomHLT)s
550 process.load( 'Configuration.StandardSequences.%(RawToDigi)s' )
551 process.load( 'Configuration.StandardSequences.SimL1Emulator_cff' )
552 import L1Trigger.Configuration.L1Trigger_custom
556 if (self.config.emulator).
find(
"stage1")>-1:
559 import L1Trigger.L1TCalorimeter.L1TCaloStage1_customForHLT
560 process = L1Trigger.L1TCalorimeter.L1TCaloStage1_customForHLT.%(CustomL1T)s( process )
565 process = L1Trigger.Configuration.L1Trigger_custom.%(CustomL1T)s( process )
570 process = L1Trigger.Configuration.L1Trigger_custom.customiseResetPrescalesAndMasks( process )
571 # customize the HLT to use the emulated results
572 import HLTrigger.Configuration.customizeHLTforL1Emulator
573 process = HLTrigger.Configuration.customizeHLTforL1Emulator.switchToL1Emulator( process )
574 process = HLTrigger.Configuration.customizeHLTforL1Emulator.%(CustomHLT)s( process )
579 if self.config.l1skim:
581 # Customize the menu to use information from new L1 emulator in the L1 skim files
582 process.hltL2MuonSeeds.GMTReadoutCollection = cms.InputTag("simGmtDigis::L1SKIM" )
583 process.hltL1extraParticles.muonSource = cms.InputTag("simGmtDigis::L1SKIM" )
584 for module in process.__dict__.itervalues():
585 if isinstance(module, cms._Module):
586 for parameter in module.__dict__.itervalues():
587 if isinstance(parameter, cms.InputTag):
588 if parameter.moduleLabel == 'hltGtDigis':
589 parameter.moduleLabel = "gtDigisFromSkim"
590 elif parameter.moduleLabel == 'hltL1GtObjectMap':
591 parameter.moduleLabel = "gtDigisFromSkim"
592 elif parameter.moduleLabel == 'hltGctDigis':
593 parameter.moduleLabel ="simCaloStage1LegacyFormatDigis"
599 r'\b(process\.)?hltOutput(\w+) *= *cms\.OutputModule\( *"ShmStreamConsumer" *,',
600 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 ),',
604 if not self.config.fragment
and self.config.output ==
'full':
607 # add a single "keep *" output
608 %(process)shltOutputFULL = cms.OutputModule( "PoolOutputModule",
609 fileName = cms.untracked.string( "outputFULL.root" ),
610 fastCloning = cms.untracked.bool( False ),
611 dataset = cms.untracked.PSet(
612 dataTier = cms.untracked.string( 'RECO' ),
613 filterName = cms.untracked.string( '' )
615 outputCommands = cms.untracked.vstring( 'keep *' )
617 %(process)sFULLOutput = cms.EndPath( %(process)shltOutputFULL )
623 if self.config.name
is None:
627 self.config.name = self.config.name.replace(
"_",
"")
630 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)
634 # adapt HLT modules to the correct process name
635 if 'hltTrigReport' in %%(dict)s:
636 %%(process)shltTrigReport.HLTriggerResults = cms.InputTag( 'TriggerResults', '', '%(name)s' )
638 if 'hltPreExpressCosmicsOutputSmart' in %%(dict)s:
639 %%(process)shltPreExpressCosmicsOutputSmart.hltResults = cms.InputTag( 'TriggerResults', '', '%(name)s' )
641 if 'hltPreExpressOutputSmart' in %%(dict)s:
642 %%(process)shltPreExpressOutputSmart.hltResults = cms.InputTag( 'TriggerResults', '', '%(name)s' )
644 if 'hltPreDQMForHIOutputSmart' in %%(dict)s:
645 %%(process)shltPreDQMForHIOutputSmart.hltResults = cms.InputTag( 'TriggerResults', '', '%(name)s' )
647 if 'hltPreDQMForPPOutputSmart' in %%(dict)s:
648 %%(process)shltPreDQMForPPOutputSmart.hltResults = cms.InputTag( 'TriggerResults', '', '%(name)s' )
650 if 'hltPreHLTDQMResultsOutputSmart' in %%(dict)s:
651 %%(process)shltPreHLTDQMResultsOutputSmart.hltResults = cms.InputTag( 'TriggerResults', '', '%(name)s' )
653 if 'hltPreHLTDQMOutputSmart' in %%(dict)s:
654 %%(process)shltPreHLTDQMOutputSmart.hltResults = cms.InputTag( 'TriggerResults', '', '%(name)s' )
656 if 'hltPreHLTMONOutputSmart' in %%(dict)s:
657 %%(process)shltPreHLTMONOutputSmart.hltResults = cms.InputTag( 'TriggerResults', '', '%(name)s' )
659 if 'hltDQMHLTScalers' in %%(dict)s:
660 %%(process)shltDQMHLTScalers.triggerResults = cms.InputTag( 'TriggerResults', '', '%(name)s' )
661 %%(process)shltDQMHLTScalers.processname = '%(name)s'
663 if 'hltDQML1SeedLogicScalers' in %%(dict)s:
664 %%(process)shltDQML1SeedLogicScalers.processname = '%(name)s'
665 """ % self.config.__dict__
671 if 'MessageLogger' in %(dict)s:
672 %(process)sMessageLogger.categories.append('TriggerSummaryProducerAOD')
673 %(process)sMessageLogger.categories.append('L1GtTrigReport')
674 %(process)sMessageLogger.categories.append('HLTrigReport')
675 %(process)sMessageLogger.categories.append('FastReport')
683 if 'GlobalTag' in %%(dict)s:
685 for condition
in conditions:
686 self.data +=
""" %%(process)sGlobalTag.toGet.append(
688 record = cms.string( '%(record)s' ),
689 tag = cms.string( '%(tag)s' ),
690 label = cms.untracked.string( '%(label)s' ),
691 connect = cms.untracked.string( '%(connect)s' )
699 if self.config.fragment:
700 return 'from %s import *\n' % module
702 return 'process.load( "%s" )\n' % module
705 self.data += self.loadCffCommand(module)
710 self.data +=
"if '%s' in %%(dict)s:\n" % module
711 for (parameter, value)
in parameters:
712 self.data +=
" %%(process)s%s.%s = %s\n" % (module, parameter, value)
717 if self.config.profiling:
721 if not 'hltGetRaw' in self.data:
724 %(process)shltGetRaw = cms.EDAnalyzer( "HLTGetRaw",
725 RawDataCollection = cms.InputTag( "rawDataCollector" )
729 if not 'hltGetConditions' in self.data:
732 %(process)shltGetConditions = cms.EDAnalyzer( 'EventSetupRecordDataGetter',
733 verbose = cms.untracked.bool( False ),
738 if not 'hltBoolFalse' in self.data:
741 %(process)shltBoolFalse = cms.EDFilter( "HLTBool",
742 result = cms.bool( False )
749 %(process)sHLTriggerFirstPath = cms.Path( %(process)shltGetRaw + %(process)shltGetConditions + %(process)shltBoolFalse )
751 self.data = re.sub(
r'.*cms\.(End)?Path.*', text +
r'\g<0>', self.data, 1)
756 if self.config.timing:
758 # instrument the menu with the modules and EndPath needed for timing studies
761 if not 'FastTimerService' in self.data:
762 self.data +=
'\n# configure the FastTimerService\n'
763 self.loadCff(
'HLTrigger.Timer.FastTimerService_cfi')
765 self.data +=
'\n# configure the FastTimerService\n'
767 self.data +=
"""# this is currently ignored in CMSSW 7.x, always using the real time clock
768 %(process)sFastTimerService.useRealTimeClock = True
769 # enable specific features
770 %(process)sFastTimerService.enableTimingPaths = True
771 %(process)sFastTimerService.enableTimingModules = True
772 %(process)sFastTimerService.enableTimingExclusive = True
773 # print a text summary at the end of the job
774 %(process)sFastTimerService.enableTimingSummary = True
775 # skip the first path (disregard the time spent loading event and conditions data)
776 %(process)sFastTimerService.skipFirstPath = True
778 %(process)sFastTimerService.enableDQM = True
779 # enable most per-path DQM plots
780 %(process)sFastTimerService.enableDQMbyPathActive = True
781 %(process)sFastTimerService.enableDQMbyPathTotal = True
782 %(process)sFastTimerService.enableDQMbyPathOverhead = False
783 %(process)sFastTimerService.enableDQMbyPathDetails = True
784 %(process)sFastTimerService.enableDQMbyPathCounters = True
785 %(process)sFastTimerService.enableDQMbyPathExclusive = True
786 # disable per-module DQM plots
787 %(process)sFastTimerService.enableDQMbyModule = False
788 %(process)sFastTimerService.enableDQMbyModuleType = False
789 # enable per-event DQM sumary plots
790 %(process)sFastTimerService.enableDQMSummary = True
791 # enable per-event DQM plots by lumisection
792 %(process)sFastTimerService.enableDQMbyLumiSection = True
793 %(process)sFastTimerService.dqmLumiSectionsRange = 2500
794 # set the time resolution of the DQM plots
795 %(process)sFastTimerService.dqmTimeRange = 1000.
796 %(process)sFastTimerService.dqmTimeResolution = 5.
797 %(process)sFastTimerService.dqmPathTimeRange = 100.
798 %(process)sFastTimerService.dqmPathTimeResolution = 0.5
799 %(process)sFastTimerService.dqmModuleTimeRange = 40.
800 %(process)sFastTimerService.dqmModuleTimeResolution = 0.2
801 # set the base DQM folder for the plots
802 %(process)sFastTimerService.dqmPath = 'HLT/TimerService'
803 %(process)sFastTimerService.enableDQMbyProcesses = True
808 if not self.config.hilton:
810 if 'hltDQMFileSaver' in self.data:
811 self.data = re.sub(
r'\b(process\.)?hltDQMFileSaver \+ ',
'', self.data)
812 self.data = re.sub(
r' \+ \b(process\.)?hltDQMFileSaver',
'', self.data)
813 self.data = re.sub(
r'\b(process\.)?hltDQMFileSaver',
'', self.data)
816 dqmstore =
"\n# load the DQMStore and DQMRootOutputModule\n"
817 dqmstore += self.loadCffCommand(
'DQMServices.Core.DQMStore_cfi')
818 dqmstore +=
"%(process)sDQMStore.enableMultiThread = True\n"
820 %(process)sdqmOutput = cms.OutputModule("DQMRootOutputModule",
821 fileName = cms.untracked.string("DQMIO.root")
825 empty_path = re.compile(
r'.*\b(process\.)?DQMOutput = cms\.EndPath\( *\).*')
826 other_path = re.compile(
r'(.*\b(process\.)?DQMOutput = cms\.EndPath\()(.*)')
827 if empty_path.search(self.data):
829 self.data = empty_path.sub(dqmstore +
'\n%(process)sDQMOutput = cms.EndPath( %(process)sdqmOutput )\n', self.data)
830 elif other_path.search(self.data):
832 self.data = other_path.sub(dqmstore +
r'\g<1> %(process)sdqmOutput +\g<3>', self.data)
835 self.data += dqmstore
836 self.data +=
'\n%(process)sDQMOutput = cms.EndPath( %(process)sdqmOutput )\n'
841 sys.stderr.write(
'Path selection:\n')
843 sys.stderr.write(
'\t%s\n' % path)
844 sys.stderr.write(
'\n\n')
847 self.all_paths = self.getPathList()
849 if self.config.paths:
851 paths = self.config.paths.split(
',')
856 if self.config.fragment
or self.config.output
in (
'none',
'full'):
858 if self.config.paths:
863 paths.append(
"-*Output" )
864 elif self.config.output ==
'minimal':
866 if self.config.paths:
867 paths.append(
"HLTDQMResultsOutput" )
869 paths.append(
"-*Output" )
870 paths.append(
"HLTDQMResultsOutput" )
873 if self.config.paths:
874 paths.append(
"*Output" )
879 if self.config.profiling:
880 paths.append(
"-HLTriggerFirstPath" )
881 paths.append(
"-HLTAnalyzerEndpath" )
884 paths.append(
"-OfflineOutput" )
887 paths = self.expandWildcards(paths, self.all_paths)
889 if self.config.paths:
891 self.options[
'paths'] = self.consolidatePositiveList(paths)
892 if not self.options[
'paths']:
893 raise RuntimeError(
'Error: option "--paths %s" does not select any valid paths' % self.config.paths)
896 self.options[
'paths'] = self.consolidateNegativeList(paths)
901 self.options[
'services'].
append(
"-DQM" )
902 self.options[
'services'].
append(
"-FUShmDQMOutputService" )
903 self.options[
'services'].
append(
"-MicroStateService" )
904 self.options[
'services'].
append(
"-ModuleWebRegistry" )
905 self.options[
'services'].
append(
"-TimeProfilerService" )
909 if not self.config.hilton:
910 self.options[
'services'].
append(
"-EvFDaqDirector" )
911 self.options[
'services'].
append(
"-FastMonitoringService" )
912 self.options[
'services'].
append(
"-DQMStore" )
913 self.options[
'modules'].
append(
"-hltDQMFileSaver" )
915 if self.config.fragment:
917 self.options[
'essources'].
append(
"-GlobalTag" )
918 self.options[
'essources'].
append(
"-HepPDTESSource" )
919 self.options[
'essources'].
append(
"-XMLIdealGeometryESSource" )
920 self.options[
'essources'].
append(
"-eegeom" )
921 self.options[
'essources'].
append(
"-es_hardcode" )
922 self.options[
'essources'].
append(
"-magfield" )
924 self.options[
'esmodules'].
append(
"-AutoMagneticFieldESProducer" )
925 self.options[
'esmodules'].
append(
"-SlaveField0" )
926 self.options[
'esmodules'].
append(
"-SlaveField20" )
927 self.options[
'esmodules'].
append(
"-SlaveField30" )
928 self.options[
'esmodules'].
append(
"-SlaveField35" )
929 self.options[
'esmodules'].
append(
"-SlaveField38" )
930 self.options[
'esmodules'].
append(
"-SlaveField40" )
931 self.options[
'esmodules'].
append(
"-VBF0" )
932 self.options[
'esmodules'].
append(
"-VBF20" )
933 self.options[
'esmodules'].
append(
"-VBF30" )
934 self.options[
'esmodules'].
append(
"-VBF35" )
935 self.options[
'esmodules'].
append(
"-VBF38" )
936 self.options[
'esmodules'].
append(
"-VBF40" )
937 self.options[
'esmodules'].
append(
"-CSCGeometryESModule" )
938 self.options[
'esmodules'].
append(
"-CaloGeometryBuilder" )
939 self.options[
'esmodules'].
append(
"-CaloTowerHardcodeGeometryEP" )
940 self.options[
'esmodules'].
append(
"-CastorHardcodeGeometryEP" )
941 self.options[
'esmodules'].
append(
"-DTGeometryESModule" )
942 self.options[
'esmodules'].
append(
"-EcalBarrelGeometryEP" )
943 self.options[
'esmodules'].
append(
"-EcalElectronicsMappingBuilder" )
944 self.options[
'esmodules'].
append(
"-EcalEndcapGeometryEP" )
945 self.options[
'esmodules'].
append(
"-EcalLaserCorrectionService" )
946 self.options[
'esmodules'].
append(
"-EcalPreshowerGeometryEP" )
947 self.options[
'esmodules'].
append(
"-HcalHardcodeGeometryEP" )
948 self.options[
'esmodules'].
append(
"-HcalTopologyIdealEP" )
949 self.options[
'esmodules'].
append(
"-MuonNumberingInitialization" )
950 self.options[
'esmodules'].
append(
"-ParametrizedMagneticFieldProducer" )
951 self.options[
'esmodules'].
append(
"-RPCGeometryESModule" )
952 self.options[
'esmodules'].
append(
"-SiStripGainESProducer" )
953 self.options[
'esmodules'].
append(
"-SiStripRecHitMatcherESProducer" )
954 self.options[
'esmodules'].
append(
"-SiStripQualityESProducer" )
955 self.options[
'esmodules'].
append(
"-StripCPEfromTrackAngleESProducer" )
956 self.options[
'esmodules'].
append(
"-TrackerDigiGeometryESModule" )
957 self.options[
'esmodules'].
append(
"-TrackerGeometricDetESModule" )
958 self.options[
'esmodules'].
append(
"-VolumeBasedMagneticFieldESProducer" )
959 self.options[
'esmodules'].
append(
"-ZdcHardcodeGeometryEP" )
960 self.options[
'esmodules'].
append(
"-hcal_db_producer" )
961 self.options[
'esmodules'].
append(
"-L1GtTriggerMaskAlgoTrigTrivialProducer" )
962 self.options[
'esmodules'].
append(
"-L1GtTriggerMaskTechTrigTrivialProducer" )
963 self.options[
'esmodules'].
append(
"-hltESPEcalTrigTowerConstituentsMapBuilder" )
964 self.options[
'esmodules'].
append(
"-hltESPGlobalTrackingGeometryESProducer" )
965 self.options[
'esmodules'].
append(
"-hltESPMuonDetLayerGeometryESProducer" )
966 self.options[
'esmodules'].
append(
"-hltESPTrackerRecoGeometryESProducer" )
967 self.options[
'esmodules'].
append(
"-trackerTopology" )
969 self.options[
'esmodules'].
append(
"-CaloTowerGeometryFromDBEP" )
970 self.options[
'esmodules'].
append(
"-CastorGeometryFromDBEP" )
971 self.options[
'esmodules'].
append(
"-EcalBarrelGeometryFromDBEP" )
972 self.options[
'esmodules'].
append(
"-EcalEndcapGeometryFromDBEP" )
973 self.options[
'esmodules'].
append(
"-EcalPreshowerGeometryFromDBEP" )
974 self.options[
'esmodules'].
append(
"-HcalGeometryFromDBEP" )
975 self.options[
'esmodules'].
append(
"-ZdcGeometryFromDBEP" )
976 self.options[
'esmodules'].
append(
"-XMLFromDBSource" )
977 self.options[
'esmodules'].
append(
"-sistripconn" )
979 self.options[
'services'].
append(
"-MessageLogger" )
981 self.options[
'psets'].
append(
"-maxEvents" )
982 self.options[
'psets'].
append(
"-options" )
984 if self.config.fragment
or (self.config.prescale
and (self.config.prescale.lower() ==
'none')):
985 self.options[
'services'].
append(
"-PrescaleService" )
987 if self.config.fragment
or self.config.timing:
988 self.options[
'services'].
append(
"-FastTimerService" )
992 if len(filenames) > 255:
999 self.data +=
" %s = cms.untracked.vstring%s\n" % (name, token_open)
1000 for line
in filenames:
1001 self.data +=
" '%s',\n" % line
1002 self.data +=
" %s,\n" % (token_close)
1007 if input[0:8] ==
'dataset:':
1008 from dasFileQuery
import dasFileQuery
1014 files = self.config.input.split(
',')
1018 if self.config.input:
1020 self.source = self.expand_filenames(self.config.input)
1021 elif self.config.online:
1023 self.source = [
"file:/tmp/InputCollection.root" ]
1024 elif self.config.data:
1026 self.source = [
"file:RelVal_Raw_%s_DATA.root" % self.config.type ]
1029 self.source = [
"file:RelVal_Raw_%s_MC.root" % self.config.type ]
1031 if self.config.parent:
1033 self.parent = self.expand_filenames(self.config.parent)
1036 %(process)ssource = cms.Source( "PoolSource",
1038 self.append_filenames(
"fileNames", self.source)
1040 self.append_filenames(
"secondaryFileNames", self.parent)
1042 inputCommands = cms.untracked.vstring(
def loadAdditionalConditions
def instrumentErrorEventType
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
def consolidateNegativeList
def consolidatePositiveList
static std::string join(char **cmd)
def getRawConfigurationFromDB
def addGlobalOptions
Disable HF Noise filters in HIon menu if 'hltHfreco' in %(dict)s: %(process)shltHfreco.setNoiseFlags = cms.bool( False ) """ else: self.data += """ Enable HF Noise filters in non-HIon menu if 'hltHfreco' in %(dict)s: %(process)shltHfreco.setNoiseFlags = cms.bool( True ) """.
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