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(version = self.config.menu.version, database = self.config.menu.database)
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 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")
84 if self.config.menu.run:
85 args = [
'--runNumber', self.config.menu.run]
87 args = [
'--configName', self.config.menu.name]
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")
102 filter = re.compile(
r' *= *cms.(End)?Path.*')
103 paths = [ filter.sub(
'', line)
for line
in data.splitlines()
if filter.search(line) ]
118 filter = re.compile(
r'^' + glob.replace(
'?',
'.').
replace(
'*',
'.*').
replace(
'[!',
'[^') +
r'$')
119 matches.extend( negate + element
for element
in collection
if filter.match(element) )
128 for element
in elements:
129 if element[0] ==
'-':
130 result.add( element )
132 result.discard(
'-' + element )
133 return sorted( element
for element
in result )
140 for element
in elements:
141 if element[0] ==
'-':
142 result.discard( element[1:] )
144 result.add( element )
145 return sorted( element
for element
in result )
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 )
160 if self.config.fragment:
162 # add specific customizations
163 from HLTrigger.Configuration.customizeHLTforALL import customizeHLTforAll
164 fragment = customizeHLTforAll(fragment,"%s")
165 """ % (self.config.type)
167 if self.config.type==
"Fake":
171 _gtData =
"auto:"+prefix+
"_hlt_"+self.config.type
172 _gtMc =
"auto:"+prefix+
"_mc_" +self.config.type
174 # add specific customizations
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)
192 from HLTrigger.Configuration.customizeHLTforCMSSW import customizeHLTforCMSSW
193 process = customizeHLTforCMSSW(process,"%s")
194 """ % (self.config.type)
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()
281 if self.config.fragment:
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 )
288 %(process)sHLTriggerFirstPath.replace(%(process)shltGetConditions,%(process)shltDummyConditions)
294 self.overrideProcessName()
297 self.overrideOutput()
300 self.addGlobalOptions()
303 self.overrideGlobalTag()
306 self.overrideL1MenuXml()
309 self.switchToNewL1Skim()
315 self.updateMessageLogger()
347 # limit the number of events to be processed
348 %%(process)smaxEvents = cms.untracked.PSet(
349 input = cms.untracked.int32( %d )
351 """ % self.config.events
353 if not self.config.profiling:
355 # enable the TrigReport and TimeReport
356 %(process)soptions = cms.untracked.PSet(
357 wantSummary = cms.untracked.bool( True )
364 name: parameter name (optional)
365 type: parameter type (look for tracked and untracked variants)
366 value: original value
367 replace: replacement value
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,
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,
383 if self.options[
'paths']:
384 if self.options[
'paths'][0][0] ==
'-':
386 for minuspath
in self.options[
'paths']:
388 self.data = re.sub(
r' cms.PSet\( pathName = cms.string\( "%s" \),\n prescales = cms.vuint32\( .* \)\n \),?\n' % path,
'', self.data)
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)
395 if self.config.prescale
and (self.config.prescale.lower() !=
'none'):
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'
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)\((.*)\)' )
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 )
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 )
420 if self.config.errortype:
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')
440 # override the GlobalTag, connection string and pfnPrefix
441 if 'GlobalTag' in %(dict)s:
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]
449 self.config.globaltag = globalTag[
'GRun']
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__
460 self.config.l1cond =
None
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)
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 )
483 if self.config.l1Xml.XmlFile:
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('')
491 %%(process)sL1GtTriggerMenuRcdSource = cms.ESSource("EmptyESSource",
492 recordName = cms.string('L1GtTriggerMenuRcd'),
493 iovIsRunNotTime = cms.bool(True),
494 firstValid = cms.vuint32(1)
496 %%(process)ses_prefer_l1GtParameters = cms.ESPrefer('L1GtTriggerMenuXmlProducer','l1GtTriggerMenuXml')
498 self.data += text % self.config.l1Xml.__dict__
502 if not self.config.emulator:
505 if self.config.emulator !=
'gt':
511 # run the L1 GT emulator, then repack the data into a new RAW collection, to be used by the HLT
513 if self.config.fragment:
515 text +=
"import Configuration.StandardSequences.SimL1EmulatorRepack_GT_cff\n"
517 text +=
"process.load( 'Configuration.StandardSequences.SimL1EmulatorRepack_GT_cff' )\n"
519 if not 'hltBoolFalse' in self.data:
522 %(process)shltBoolFalse = cms.EDFilter( "HLTBool",
523 result = cms.bool( False )
526 text +=
"process.L1Emulator = cms.Path( process.SimL1Emulator + process.hltBoolFalse )\n\n"
528 self.data = re.sub(
r'.*cms\.(End)?Path.*', text +
r'\g<0>', self.data, 1)
533 if self.config.emulator:
542 emulator[
'RawToDigi'] =
'RawToDigi_Data_cff'
544 emulator[
'RawToDigi'] =
'RawToDigi_cff'
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':
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'
564 emulator[
'CustomL1T'] =
'customiseL1EmulatorFromRaw'
565 emulator[
'CustomHLT'] =
'switchToSimGmtGctGtDigis'
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
575 if (self.config.emulator).
find(
"stage1")>-1:
578 import L1Trigger.L1TCalorimeter.L1TCaloStage1_customForHLT
579 process = L1Trigger.L1TCalorimeter.L1TCaloStage1_customForHLT.%(CustomL1T)s( process )
584 process = L1Trigger.Configuration.L1Trigger_custom.%(CustomL1T)s( process )
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 )
598 if self.config.l1skim:
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"
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 ),',
623 if not self.config.fragment
and self.config.output ==
'full':
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( '' )
634 outputCommands = cms.untracked.vstring( 'keep *' )
636 %(process)sFULLOutput = cms.EndPath( %(process)shltOutputFULL )
642 if self.config.name
is None:
646 self.config.name = self.config.name.replace(
"_",
"")
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)
653 # adapt HLT modules to the correct process name
654 if 'hltTrigReport' in %%(dict)s:
655 %%(process)shltTrigReport.HLTriggerResults = cms.InputTag( 'TriggerResults', '', '%(name)s' )
657 if 'hltPreExpressCosmicsOutputSmart' in %%(dict)s:
658 %%(process)shltPreExpressCosmicsOutputSmart.hltResults = cms.InputTag( 'TriggerResults', '', '%(name)s' )
660 if 'hltPreExpressOutputSmart' in %%(dict)s:
661 %%(process)shltPreExpressOutputSmart.hltResults = cms.InputTag( 'TriggerResults', '', '%(name)s' )
663 if 'hltPreDQMForHIOutputSmart' in %%(dict)s:
664 %%(process)shltPreDQMForHIOutputSmart.hltResults = cms.InputTag( 'TriggerResults', '', '%(name)s' )
666 if 'hltPreDQMForPPOutputSmart' in %%(dict)s:
667 %%(process)shltPreDQMForPPOutputSmart.hltResults = cms.InputTag( 'TriggerResults', '', '%(name)s' )
669 if 'hltPreHLTDQMResultsOutputSmart' in %%(dict)s:
670 %%(process)shltPreHLTDQMResultsOutputSmart.hltResults = cms.InputTag( 'TriggerResults', '', '%(name)s' )
672 if 'hltPreHLTDQMOutputSmart' in %%(dict)s:
673 %%(process)shltPreHLTDQMOutputSmart.hltResults = cms.InputTag( 'TriggerResults', '', '%(name)s' )
675 if 'hltPreHLTMONOutputSmart' in %%(dict)s:
676 %%(process)shltPreHLTMONOutputSmart.hltResults = cms.InputTag( 'TriggerResults', '', '%(name)s' )
678 if 'hltDQMHLTScalers' in %%(dict)s:
679 %%(process)shltDQMHLTScalers.triggerResults = cms.InputTag( 'TriggerResults', '', '%(name)s' )
680 %%(process)shltDQMHLTScalers.processname = '%(name)s'
682 if 'hltDQML1SeedLogicScalers' in %%(dict)s:
683 %%(process)shltDQML1SeedLogicScalers.processname = '%(name)s'
684 """ % self.config.__dict__
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')
702 if 'GlobalTag' in %%(dict)s:
704 for condition
in conditions:
705 self.data +=
""" %%(process)sGlobalTag.toGet.append(
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' )
718 if self.config.fragment:
719 return 'from %s import *\n' % module
721 return 'process.load( "%s" )\n' % module
724 self.data += self.loadCffCommand(module)
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)
736 if self.config.profiling:
740 if not 'hltGetRaw' in self.data:
743 %(process)shltGetRaw = cms.EDAnalyzer( "HLTGetRaw",
744 RawDataCollection = cms.InputTag( "rawDataCollector" )
748 if not 'hltGetConditions' in self.data:
751 %(process)shltGetConditions = cms.EDAnalyzer( 'EventSetupRecordDataGetter',
752 verbose = cms.untracked.bool( False ),
757 if not 'hltBoolFalse' in self.data:
760 %(process)shltBoolFalse = cms.EDFilter( "HLTBool",
761 result = cms.bool( False )
768 %(process)sHLTriggerFirstPath = cms.Path( %(process)shltGetRaw + %(process)shltGetConditions + %(process)shltBoolFalse )
770 self.data = re.sub(
r'.*cms\.(End)?Path.*', text +
r'\g<0>', self.data, 1)
775 if self.config.timing:
777 # instrument the menu with the modules and EndPath needed for timing studies
780 if not 'FastTimerService' in self.data:
781 self.data +=
'\n# configure the FastTimerService\n'
782 self.loadCff(
'HLTrigger.Timer.FastTimerService_cfi')
784 self.data +=
'\n# configure the FastTimerService\n'
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
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
827 if not self.config.hilton:
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)
835 dqmstore =
"\n# load the DQMStore and DQMRootOutputModule\n"
836 dqmstore += self.loadCffCommand(
'DQMServices.Core.DQMStore_cfi')
837 dqmstore +=
"%(process)sDQMStore.enableMultiThread = True\n"
839 %(process)sdqmOutput = cms.OutputModule("DQMRootOutputModule",
840 fileName = cms.untracked.string("DQMIO.root")
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):
848 self.data = empty_path.sub(dqmstore +
'\n%(process)sDQMOutput = cms.EndPath( %(process)sdqmOutput )\n', self.data)
849 elif other_path.search(self.data):
851 self.data = other_path.sub(dqmstore +
r'\g<1> %(process)sdqmOutput +\g<3>', self.data)
854 self.data += dqmstore
855 self.data +=
'\n%(process)sDQMOutput = cms.EndPath( %(process)sdqmOutput )\n'
860 sys.stderr.write(
'Path selection:\n')
862 sys.stderr.write(
'\t%s\n' % path)
863 sys.stderr.write(
'\n\n')
866 self.all_paths = self.getPathList()
868 if self.config.paths:
870 paths = self.config.paths.split(
',')
875 if self.config.fragment
or self.config.output
in (
'none',
'full'):
877 if self.config.paths:
882 paths.append(
"-*Output" )
883 elif self.config.output ==
'minimal':
885 if self.config.paths:
886 paths.append(
"HLTDQMResultsOutput" )
888 paths.append(
"-*Output" )
889 paths.append(
"HLTDQMResultsOutput" )
892 if self.config.paths:
893 paths.append(
"*Output" )
898 if self.config.profiling:
899 paths.append(
"-HLTriggerFirstPath" )
900 paths.append(
"-HLTAnalyzerEndpath" )
903 paths.append(
"-OfflineOutput" )
906 paths = self.expandWildcards(paths, self.all_paths)
908 if self.config.paths:
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)
915 self.options[
'paths'] = self.consolidateNegativeList(paths)
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" )
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" )
934 if self.config.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" )
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" )
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" )
998 self.options[
'services'].
append(
"-MessageLogger" )
1000 self.options[
'psets'].
append(
"-maxEvents" )
1001 self.options[
'psets'].
append(
"-options" )
1003 if self.config.fragment
or (self.config.prescale
and (self.config.prescale.lower() ==
'none')):
1004 self.options[
'services'].
append(
"-PrescaleService" )
1006 if self.config.fragment
or self.config.timing:
1007 self.options[
'services'].
append(
"-FastTimerService" )
1011 if len(filenames) > 255:
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)
1026 if input[0:8] ==
'dataset:':
1027 from dasFileQuery
import dasFileQuery
1033 files = self.config.input.split(
',')
1037 if self.config.input:
1039 self.source = self.expand_filenames(self.config.input)
1040 elif self.config.online:
1042 self.source = [
"file:/tmp/InputCollection.root" ]
1043 elif self.config.data:
1045 self.source = [
"file:RelVal_Raw_%s_DATA.root" % self.config.type ]
1048 self.source = [
"file:RelVal_Raw_%s_MC.root" % self.config.type ]
1050 if self.config.parent:
1052 self.parent = self.expand_filenames(self.config.parent)
1055 %(process)ssource = cms.Source( "PoolSource",
1057 self.append_filenames(
"fileNames", self.source)
1059 self.append_filenames(
"secondaryFileNames", self.parent)
1061 inputCommands = cms.untracked.vstring(
def loadAdditionalConditions
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
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