CMS 3D CMS Logo

Classes | Functions | Variables

confdb Namespace Reference

Classes

class  HLTProcess

Functions

def _fix_parameter
def addGlobalOptions
 Use L1 menu from xml file ...removed in favor of sqlite file %(process)sl1GtTriggerMenuXml = cms.ESProducer("L1GtTriggerMenuXmlProducer", TriggerMenuLuminosity = cms.string('startup'), DefXmlFile = cms.string('L1Menu_CollisionsHeavyIons2011_v0_L1T_Scales_20101224_Imp0_0x1026.xml'), VmeXmlFile = cms.string('') ) %(process)sL1GtTriggerMenuRcdSource = cms.ESSource("EmptyESSource", recordName = cms.string('L1GtTriggerMenuRcd'), iovIsRunNotTime = cms.bool(True), firstValid = cms.vuint32(1) )
def build_source
def buildOptions
def buildPathList
def dumppaths
def fixForFastSim
def fixForMC
def fixPrescales
def instrumentOpenMode
def instrumentTiming
def loadAdditionalConditions
def overrideGlobalTag
def overrideL1Menu
def overrideOutput
def overrideParameters
def overrideProcessName
def runL1Emulator
def updateMessageLogger

Variables

 all_paths
 data
 TO BE REMOVED as soon the configuration in confDB gets fixed: self._fix_parameter( type = 'InputTag', value = 'hltPFJetCtfWithMaterialTracks', replace = 'hltIter4Merged')
 source

Function Documentation

def confdb::_fix_parameter (   self,
  args 
) [private]
arguments:
    name:     parameter name (optional)
    type:     parameter type (look for tracked and untracked variants)
    value:    original value
    replace:  replacement value

Definition at line 363 of file confdb.py.

00364                                   :
00365     """arguments:
00366         name:     parameter name (optional)
00367         type:     parameter type (look for tracked and untracked variants)
00368         value:    original value
00369         replace:  replacement value
00370     """
00371     if 'name' in args:
00372       self.data = re.sub(
00373           r'%(name)s = cms(?P<tracked>(?:\.untracked)?)\.%(type)s\( (?P<quote>["\']?)%(value)s(?P=quote)' % args,
00374           r'%(name)s = cms\g<tracked>.%(type)s( \g<quote>%(replace)s\g<quote>' % args,
00375           self.data)
00376     else:
00377       self.data = re.sub(
00378           r'cms(?P<tracked>(?:\.untracked)?)\.%(type)s\( (?P<quote>["\']?)%(value)s(?P=quote)' % args,
00379           r'cms\g<tracked>.%(type)s( \g<quote>%(replace)s\g<quote>' % args,
00380           self.data)
00381 

def confdb::addGlobalOptions (   self)

Use L1 menu from xml file ...removed in favor of sqlite file %(process)sl1GtTriggerMenuXml = cms.ESProducer("L1GtTriggerMenuXmlProducer", TriggerMenuLuminosity = cms.string('startup'), DefXmlFile = cms.string('L1Menu_CollisionsHeavyIons2011_v0_L1T_Scales_20101224_Imp0_0x1026.xml'), VmeXmlFile = cms.string('') ) %(process)sL1GtTriggerMenuRcdSource = cms.ESSource("EmptyESSource", recordName = cms.string('L1GtTriggerMenuRcd'), iovIsRunNotTime = cms.bool(True), firstValid = cms.vuint32(1) )

untracked parameter with no default in the code if 'hltHcalDataIntegrityMonitor' in %(dict)s: %(process)shltHcalDataIntegrityMonitor.RawDataLabel = cms.untracked.InputTag("rawDataCollector") """

Definition at line 346 of file confdb.py.

00347                             :
00348     # add global options
00349     self.data += """
00350 # limit the number of events to be processed
00351 %(process)smaxEvents = cms.untracked.PSet(
00352     input = cms.untracked.int32( 100 )
00353 )
00354 """
00355     if not self.config.profiling:
00356       self.data += """
00357 # enable the TrigReport and TimeReport
00358 %(process)soptions = cms.untracked.PSet(
00359     wantSummary = cms.untracked.bool( True )
00360 )
00361 """
00362 

def confdb::build_source (   self)

Definition at line 1019 of file confdb.py.

01020                         :
01021     if self.config.input:
01022       # if an explicit input file was given, use it
01023       self.source = self.config.input
01024     elif self.config.online:
01025       # online we always run on data
01026       self.source = "file:/tmp/InputCollection.root"
01027     elif self.config.data:
01028       # offline we can run on data...
01029       self.source = "/store/data/Run2011A/MinimumBias/RAW/v1/000/165/205/6C8BA6D0-F680-E011-B467-003048F118AC.root"
01030     else:
01031       # ...or on mc
01032       self.source = "file:RelVal_DigiL1Raw_%s.root" % self.config.type
01033 
def confdb::buildOptions (   self)

Definition at line 809 of file confdb.py.

00810                         :
00811     # common configuration for all scenarios
00812     self.options['services'].append( "-FUShmDQMOutputService" )
00813 
00814     # adapt source and options to the current scenario
00815     if not self.config.fragment:
00816       self.build_source()
00817 
00818     if self.config.fragment:
00819       # extract a configuration file fragment
00820       self.options['essources'].append( "-GlobalTag" )
00821       self.options['essources'].append( "-HepPDTESSource" )
00822       self.options['essources'].append( "-XMLIdealGeometryESSource" )
00823       self.options['essources'].append( "-eegeom" )
00824       self.options['essources'].append( "-es_hardcode" )
00825       self.options['essources'].append( "-magfield" )
00826 
00827       self.options['esmodules'].append( "-AutoMagneticFieldESProducer" )
00828       self.options['esmodules'].append( "-SlaveField0" )
00829       self.options['esmodules'].append( "-SlaveField20" )
00830       self.options['esmodules'].append( "-SlaveField30" )
00831       self.options['esmodules'].append( "-SlaveField35" )
00832       self.options['esmodules'].append( "-SlaveField38" )
00833       self.options['esmodules'].append( "-SlaveField40" )
00834       self.options['esmodules'].append( "-VBF0" )
00835       self.options['esmodules'].append( "-VBF20" )
00836       self.options['esmodules'].append( "-VBF30" )
00837       self.options['esmodules'].append( "-VBF35" )
00838       self.options['esmodules'].append( "-VBF38" )
00839       self.options['esmodules'].append( "-VBF40" )
00840       self.options['esmodules'].append( "-CSCGeometryESModule" )
00841       self.options['esmodules'].append( "-CaloGeometryBuilder" )
00842       self.options['esmodules'].append( "-CaloTowerHardcodeGeometryEP" )
00843       self.options['esmodules'].append( "-CastorHardcodeGeometryEP" )
00844       self.options['esmodules'].append( "-DTGeometryESModule" )
00845       self.options['esmodules'].append( "-EcalBarrelGeometryEP" )
00846       self.options['esmodules'].append( "-EcalElectronicsMappingBuilder" )
00847       self.options['esmodules'].append( "-EcalEndcapGeometryEP" )
00848       self.options['esmodules'].append( "-EcalLaserCorrectionService" )
00849       self.options['esmodules'].append( "-EcalPreshowerGeometryEP" )
00850       self.options['esmodules'].append( "-HcalHardcodeGeometryEP" )
00851       self.options['esmodules'].append( "-HcalTopologyIdealEP" )
00852       self.options['esmodules'].append( "-MuonNumberingInitialization" )
00853       self.options['esmodules'].append( "-ParametrizedMagneticFieldProducer" )
00854       self.options['esmodules'].append( "-RPCGeometryESModule" )
00855       self.options['esmodules'].append( "-SiStripGainESProducer" )
00856       self.options['esmodules'].append( "-SiStripRecHitMatcherESProducer" )
00857       self.options['esmodules'].append( "-SiStripQualityESProducer" )
00858       self.options['esmodules'].append( "-StripCPEfromTrackAngleESProducer" )
00859       self.options['esmodules'].append( "-TrackerDigiGeometryESModule" )
00860       self.options['esmodules'].append( "-TrackerGeometricDetESModule" )
00861       self.options['esmodules'].append( "-VolumeBasedMagneticFieldESProducer" )
00862       self.options['esmodules'].append( "-ZdcHardcodeGeometryEP" )
00863       self.options['esmodules'].append( "-hcal_db_producer" )
00864       self.options['esmodules'].append( "-L1GtTriggerMaskAlgoTrigTrivialProducer" )
00865       self.options['esmodules'].append( "-L1GtTriggerMaskTechTrigTrivialProducer" )
00866       self.options['esmodules'].append( "-hltESPEcalTrigTowerConstituentsMapBuilder" )
00867       self.options['esmodules'].append( "-hltESPGlobalTrackingGeometryESProducer" )
00868       self.options['esmodules'].append( "-hltESPMuonDetLayerGeometryESProducer" )
00869       self.options['esmodules'].append( "-hltESPTrackerRecoGeometryESProducer" )
00870       if not self.config.fastsim:
00871         self.options['esmodules'].append( "-CaloTowerGeometryFromDBEP" )
00872         self.options['esmodules'].append( "-CastorGeometryFromDBEP" )
00873         self.options['esmodules'].append( "-EcalBarrelGeometryFromDBEP" )
00874         self.options['esmodules'].append( "-EcalEndcapGeometryFromDBEP" )
00875         self.options['esmodules'].append( "-EcalPreshowerGeometryFromDBEP" )
00876         self.options['esmodules'].append( "-HcalGeometryFromDBEP" )
00877         self.options['esmodules'].append( "-ZdcGeometryFromDBEP" )
00878         self.options['esmodules'].append( "-XMLFromDBSource" )
00879         self.options['esmodules'].append( "-sistripconn" )
00880 
00881       self.options['services'].append( "-PrescaleService" )
00882       self.options['services'].append( "-MessageLogger" )
00883       self.options['services'].append( "-DQM" )
00884       self.options['services'].append( "-MicroStateService" )
00885       self.options['services'].append( "-ModuleWebRegistry" )
00886       self.options['services'].append( "-TimeProfilerService" )
00887       if not self.config.fastsim:
00888         self.options['services'].append( "-DQMStore" )
00889 
00890       self.options['psets'].append( "-maxEvents" )
00891       self.options['psets'].append( "-options" )
00892 
00893     if self.config.fastsim:
00894       # remove components not supported or needed by fastsim
00895       self.options['esmodules'].append( "-navigationSchoolESProducer" )
00896       self.options['esmodules'].append( "-TransientTrackBuilderESProducer" )
00897       self.options['esmodules'].append( "-SteppingHelixPropagatorAny" )
00898       self.options['esmodules'].append( "-OppositeMaterialPropagator" )
00899       self.options['esmodules'].append( "-MaterialPropagator" )
00900       self.options['esmodules'].append( "-CaloTowerConstituentsMapBuilder" )
00901       self.options['esmodules'].append( "-CaloTopologyBuilder" )
00902 
00903       self.options['services'].append( "-UpdaterService" )
00904 
00905       self.options['modules'].append( "hltL3MuonIsolations" )
00906       self.options['modules'].append( "hltPixelVertices" )
00907       self.options['modules'].append( "-hltCkfL1IsoTrackCandidates" )
00908       self.options['modules'].append( "-hltCtfL1IsoWithMaterialTracks" )
00909       self.options['modules'].append( "-hltCkfL1NonIsoTrackCandidates" )
00910       self.options['modules'].append( "-hltCtfL1NonIsoWithMaterialTracks" )
00911       self.options['modules'].append( "-hltCkf3HitL1IsoTrackCandidates" )
00912       self.options['modules'].append( "-hltCtf3HitL1IsoWithMaterialTracks" )
00913       self.options['modules'].append( "-hltCkf3HitL1NonIsoTrackCandidates" )
00914       self.options['modules'].append( "-hltCtf3HitL1NonIsoWithMaterialTracks" )
00915       self.options['modules'].append( "-hltCkf3HitActivityTrackCandidates" )
00916       self.options['modules'].append( "-hltCtf3HitActivityWithMaterialTracks" )
00917       self.options['modules'].append( "-hltESRegionalEgammaRecHit" )
00918       self.options['modules'].append( "-hltEcalRegionalJetsFEDs" )
00919       self.options['modules'].append( "-hltEcalRegionalMuonsFEDs" )
00920       self.options['modules'].append( "-hltEcalRegionalEgammaFEDs" )
00921       self.options['modules'].append( "-hltFEDSelector" )
00922       self.options['modules'].append( "-hltL3TrajSeedOIHit" )
00923       self.options['modules'].append( "-hltL3TrajSeedIOHit" )
00924       self.options['modules'].append( "-hltL3TrackCandidateFromL2OIState" )
00925       self.options['modules'].append( "-hltL3TrackCandidateFromL2OIHit" )
00926       self.options['modules'].append( "-hltL3TrackCandidateFromL2IOHit" )
00927       self.options['modules'].append( "-hltL3TrackCandidateFromL2NoVtx" )
00928       self.options['modules'].append( "-hltHcalDigis" )
00929       self.options['modules'].append( "-hltHoreco" )
00930       self.options['modules'].append( "-hltHfreco" )
00931       self.options['modules'].append( "-hltHbhereco" )
00932       self.options['modules'].append( "-hltEcalRegionalRestFEDs" )
00933       self.options['modules'].append( "-hltEcalRegionalESRestFEDs" )
00934       self.options['modules'].append( "-hltEcalRawToRecHitFacility" )
00935       self.options['modules'].append( "-hltESRawToRecHitFacility" )
00936       self.options['modules'].append( "-hltEcalRegionalJetsRecHit" )
00937       self.options['modules'].append( "-hltEcalRegionalMuonsRecHit" )
00938       self.options['modules'].append( "-hltEcalRegionalEgammaRecHit" )
00939       self.options['modules'].append( "-hltEcalRecHitAll" )
00940       self.options['modules'].append( "-hltESRecHitAll" )
00941       # === hltPF
00942       self.options['modules'].append( "-hltPFJetPixelSeeds" )
00943       self.options['modules'].append( "-hltPFJetCkfTrackCandidates" )
00944       self.options['modules'].append( "-hltPFJetCtfWithMaterialTracks" )
00945       self.options['modules'].append( "-hltPFlowTrackSelectionHighPurity" )
00946       # === hltBLifetimeRegional
00947       self.options['modules'].append( "-hltBLifetimeRegionalPixelSeedGeneratorSingleTop" )
00948       self.options['modules'].append( "-hltBLifetimeRegionalCtfWithMaterialTracksSingleTop" )
00949       self.options['modules'].append( "-hltBLifetimeRegionalCkfTrackCandidatesSingleTop" )
00950       self.options['modules'].append( "-hltBLifetimeRegionalPixelSeedGeneratorEleJetSingleTop" )
00951       self.options['modules'].append( "-hltBLifetimeRegionalCkfTrackCandidatesEleJetSingleTop" )
00952       self.options['modules'].append( "-hltBLifetimeRegionalCtfWithMaterialTracksEleJetSingleTop" )
00953       self.options['modules'].append( "-hltBLifetimeRegionalPixelSeedGeneratorIsoEleJetSingleTop" )
00954       self.options['modules'].append( "-hltBLifetimeRegionalCkfTrackCandidatesIsoEleJetSingleTop" )
00955       self.options['modules'].append( "-hltBLifetimeRegionalCtfWithMaterialTracksIsoEleJetSingleTop" )
00956       self.options['modules'].append( "-hltBLifetimeRegionalPixelSeedGeneratorRA2b" )
00957       self.options['modules'].append( "-hltBLifetimeRegionalCkfTrackCandidatesRA2b" )
00958       self.options['modules'].append( "-hltBLifetimeRegionalCtfWithMaterialTracksRA2b" )
00959       self.options['modules'].append( "-hltBLifetimeRegionalPixelSeedGeneratorRAzr" )
00960       self.options['modules'].append( "-hltBLifetimeRegionalCkfTrackCandidatesRAzr" )
00961       self.options['modules'].append( "-hltBLifetimeRegionalCtfWithMaterialTracksRAzr" )
00962       self.options['modules'].append( "-hltBLifetimeRegionalPixelSeedGeneratorHbb" )
00963       self.options['modules'].append( "-hltBLifetimeRegionalCkfTrackCandidatesHbb" )
00964       self.options['modules'].append( "-hltBLifetimeRegionalCtfWithMaterialTracksHbb" )
00965       self.options['modules'].append( "-hltBLifetimeRegionalPixel3DSeedGeneratorJet30Hbb" )
00966       self.options['modules'].append( "-hltBLifetimeRegional3DCkfTrackCandidatesJet30Hbb" )
00967       self.options['modules'].append( "-hltBLifetimeRegional3DCtfWithMaterialTracksJet30Hbb" )
00968       self.options['modules'].append( "-hltBLifetimeRegionalPixelSeedGeneratorbbPhi" )
00969       self.options['modules'].append( "-hltBLifetimeRegionalCkfTrackCandidatesbbPhi" )
00970       self.options['modules'].append( "-hltBLifetimeRegionalCtfWithMaterialTracksbbPhi" )
00971       self.options['modules'].append( "-hltBLifetimeBTagIP3D1stTrkRegionalPixelSeedGeneratorJet20Hbb" )
00972       self.options['modules'].append( "-hltBLifetimeBTagIP3D1stTrkRegionalCkfTrackCandidatesJet20Hbb" )
00973       self.options['modules'].append( "-hltBLifetimeBTagIP3D1stTrkRegionalCtfWithMaterialTracksJet20Hbb" )
00974       self.options['modules'].append( "-hltBLifetimeDiBTagIP3D1stTrkRegionalPixelSeedGeneratorJet20Hbb" )
00975       self.options['modules'].append( "-hltBLifetimeDiBTagIP3D1stTrkRegionalCkfTrackCandidatesJet20Hbb" )
00976       self.options['modules'].append( "-hltBLifetimeDiBTagIP3D1stTrkRegionalCtfWithMaterialTracksJet20Hbb" )
00977       self.options['modules'].append( "-hltBLifetimeRegionalPixelSeedGeneratorGammaB" )
00978       self.options['modules'].append( "-hltBLifetimeRegionalCkfTrackCandidatesGammaB" )
00979       self.options['modules'].append( "-hltBLifetimeRegionalCtfWithMaterialTracksGammaB" )
00980 
00981       self.options['modules'].append( "-hltPixelTracksForMinBias" )
00982       self.options['modules'].append( "-hltPixelTracksForHighMult" )
00983       self.options['modules'].append( "-hltIter4Merged" )
00984       self.options['modules'].append( "-hltPFJetCtfWithMaterialTracks" )
00985       self.options['modules'].append( "hltPixelMatchElectronsActivity" )
00986 
00987       self.options['modules'].append( "-hltMuonCSCDigis" )
00988       self.options['modules'].append( "-hltMuonDTDigis" )
00989       self.options['modules'].append( "-hltMuonRPCDigis" )
00990       self.options['modules'].append( "-hltGtDigis" )
00991       self.options['modules'].append( "-hltL1GtTrigReport" )
00992       self.options['modules'].append( "hltCsc2DRecHits" )
00993       self.options['modules'].append( "hltDt1DRecHits" )
00994       self.options['modules'].append( "hltRpcRecHits" )
00995       self.options['modules'].append( "-hltScalersRawToDigi" )
00996 
00997       self.options['sequences'].append( "-HLTL1IsoEgammaRegionalRecoTrackerSequence" )
00998       self.options['sequences'].append( "-HLTL1NonIsoEgammaRegionalRecoTrackerSequence" )
00999       self.options['sequences'].append( "-HLTEcalActivityEgammaRegionalRecoTrackerSequence" )
01000       self.options['sequences'].append( "-HLTPixelMatchElectronActivityTrackingSequence" )
01001       self.options['sequences'].append( "-HLTDoLocalStripSequence" )
01002       self.options['sequences'].append( "-HLTDoLocalPixelSequence" )
01003       self.options['sequences'].append( "-hltSiPixelDigis" )
01004       self.options['sequences'].append( "-hltSiPixelClusters" )
01005       self.options['sequences'].append( "-hltSiPixelRecHits" )
01006       self.options['sequences'].append( "-HLTRecopixelvertexingSequence" )
01007       self.options['sequences'].append( "-HLTEndSequence" )
01008       self.options['sequences'].append( "-HLTBeginSequence" )
01009       self.options['sequences'].append( "-HLTBeginSequenceNZS" )
01010       self.options['sequences'].append( "-HLTBeginSequenceBPTX" )
01011       self.options['sequences'].append( "-HLTBeginSequenceAntiBPTX" )
01012       self.options['sequences'].append( "-HLTHBHENoiseSequence" )
01013       self.options['sequences'].append( "-HLTIterativeTracking" )
01014 
01015       # remove HLTAnalyzerEndpath from fastsim cff's
01016       if self.config.fragment:
01017         self.options['paths'].append( "-HLTAnalyzerEndpath" )
01018 

def confdb::buildPathList (   self)

Definition at line 752 of file confdb.py.

00753                          :
00754     self.all_paths = self.getPathList()
00755 
00756     if self.config.paths:
00757       # no path list was requested, dump the full table, minus unsupported / unwanted paths
00758       paths = self.config.paths.split(',')
00759     else:
00760       # dump only the requested paths, plus the eventual output endpaths
00761       paths = []
00762 
00763     if self.config.fragment or self.config.output in ('none', 'full'):
00764       # 'full' removes all outputs (same as 'none') and then adds a single "keep *" output (see the overrideOutput method)
00765       if self.config.paths:
00766         # paths are removed by default
00767         pass    
00768       else:
00769         # drop all output endpaths
00770         paths.append( "-*Output" )
00771     elif self.config.output == 'minimal':
00772       # drop all output endpaths but HLTDQMResultsOutput
00773       if self.config.paths:
00774         paths.append( "HLTDQMResultsOutput" )
00775       else:
00776         paths.append( "-*Output" )
00777         paths.append( "HLTDQMResultsOutput" )
00778     else:
00779       # keep / add back all output endpaths
00780       if self.config.paths:
00781         paths.append( "*Output" )
00782       else:
00783         pass    # paths are kepy by default
00784 
00785     # drop paths unsupported by fastsim
00786     if self.config.fastsim:
00787       paths.extend( "-%s" % path for path in self.fastsimUnsupportedPaths )
00788 
00789     # drop unwanted paths for profiling (and timing studies)
00790     if self.config.profiling:
00791       paths.append( "-HLTriggerFirstPath" )
00792       paths.append( "-HLTAnalyzerEndpath" )
00793 
00794     # this should never be in any dump (nor online menu)
00795     paths.append( "-OfflineOutput" )
00796 
00797     # expand all wildcards
00798     paths = self.expandWildcards(paths, self.all_paths)
00799 
00800     if self.config.paths:
00801       # do an "additive" consolidation
00802       self.options['paths'] = self.consolidatePositiveList(paths)
00803       if not self.options['paths']:
00804         raise RuntimeError('Error: option "--paths %s" does not select any valid paths' % self.config.paths)
00805     else:
00806       # do a "subtractive" consolidation
00807       self.options['paths'] = self.consolidateNegativeList(paths)
00808 

def confdb::dumppaths (   paths)

Definition at line 746 of file confdb.py.

00747                       :
00748     sys.stderr.write('Path selection:\n')
00749     for path in paths:
00750       sys.stderr.write('\t%s\n' % path)
00751     sys.stderr.write('\n\n')

def confdb::fixForFastSim (   self)

Definition at line 389 of file confdb.py.

00390                          :
00391     if self.config.fastsim:
00392       # adapt the hle configuration (fragment) to run under fastsim
00393       self.data = re.sub( r'import FWCore.ParameterSet.Config as cms', r'\g<0>\nfrom FastSimulation.HighLevelTrigger.HLTSetup_cff import *', self.data)
00394 
00395       # remove the definition of streams and datasets
00396       self.data = re.compile( r'^streams.*\n(.*\n)*?^\)\s*\n',  re.MULTILINE ).sub( '', self.data )
00397       self.data = re.compile( r'^datasets.*\n(.*\n)*?^\)\s*\n', re.MULTILINE ).sub( '', self.data )
00398 
00399       # fix the definition of module
00400       # FIXME: this should be updated to take into accout the --l1-emulator option
00401       self._fix_parameter(                               type = 'InputTag', value = 'hltL1extraParticles',  replace = 'l1extraParticles')
00402       self._fix_parameter(name = 'GMTReadoutCollection', type = 'InputTag', value = 'hltGtDigis',           replace = 'gmtDigis')
00403       self._fix_parameter(                               type = 'InputTag', value = 'hltGtDigis',           replace = 'gtDigis')
00404       self._fix_parameter(                               type = 'InputTag', value = 'hltL1GtObjectMap',     replace = 'gtDigis')
00405       self._fix_parameter(name = 'initialSeeds',         type = 'InputTag', value = 'noSeedsHere',          replace = 'globalPixelSeeds:GlobalPixel')
00406       self._fix_parameter(name = 'preFilteredSeeds',     type = 'bool',     value = 'True',                 replace = 'False')
00407       self._fix_parameter(                               type = 'InputTag', value = 'hltOfflineBeamSpot',   replace = 'offlineBeamSpot')
00408       self._fix_parameter(                               type = 'InputTag', value = 'hltOnlineBeamSpot',    replace = 'offlineBeamSpot')
00409       self._fix_parameter(                               type = 'InputTag', value = 'hltMuonCSCDigis',      replace = 'simMuonCSCDigis')
00410       self._fix_parameter(                               type = 'InputTag', value = 'hltMuonDTDigis',       replace = 'simMuonDTDigis')
00411       self._fix_parameter(                               type = 'InputTag', value = 'hltMuonRPCDigis',      replace = 'simMuonRPCDigis')
00412       ## TO BE REMOVED as soon the configuration in confDB gets fixed:
00413       #self._fix_parameter(                               type = 'InputTag', value = 'hltPFJetCtfWithMaterialTracks', replace = 'hltIter4Merged')
00414 
00415       # fix the definition of sequences and paths
00416       self.data = re.sub( r'hltMuonCSCDigis', r'cms.SequencePlaceholder( "simMuonCSCDigis" )',  self.data )
00417       self.data = re.sub( r'hltMuonDTDigis',  r'cms.SequencePlaceholder( "simMuonDTDigis" )',   self.data )
00418       self.data = re.sub( r'hltMuonRPCDigis', r'cms.SequencePlaceholder( "simMuonRPCDigis" )',  self.data )
00419       self.data = re.sub( r'HLTEndSequence',  r'cms.SequencePlaceholder( "HLTEndSequence" )',   self.data )
00420       self.data = re.sub( r'hltGtDigis',      r'HLTBeginSequence',                              self.data )
00421 

def confdb::fixForMC (   self)

Definition at line 382 of file confdb.py.

00383                     :
00384     if not self.config.data:
00385       # override the raw data collection label
00386       self._fix_parameter(type = 'InputTag', value = 'source', replace = 'rawDataCollector')
00387       self._fix_parameter(type = 'string',   value = 'source', replace = 'rawDataCollector')
00388 

def confdb::fixPrescales (   self)

Definition at line 422 of file confdb.py.

00423                         :
00424     # update the PrescaleService to match the new list of paths
00425     if self.options['paths']:
00426       if self.options['paths'][0][0] == '-':
00427         # drop requested paths
00428         for minuspath in self.options['paths']:
00429           path = minuspath[1:]
00430           self.data = re.sub(r'      cms.PSet\(  pathName = cms.string\( "%s" \),\n        prescales = cms.vuint32\( .* \)\n      \),?\n' % path, '', self.data)
00431       else:
00432         # keep requested paths
00433         for path in self.all_paths:
00434           if path not in self.options['paths']:
00435             self.data = re.sub(r'      cms.PSet\(  pathName = cms.string\( "%s" \),\n        prescales = cms.vuint32\( .* \)\n      \),?\n' % path, '', self.data)
00436 
00437     if self.config.unprescale:
00438       self.data += """
00439 # remove the HLT prescales
00440 if 'PrescaleService' in %(dict)s:
00441     %(process)sPrescaleService.lvl1DefaultLabel = cms.untracked.string( '0' )
00442     %(process)sPrescaleService.lvl1Labels       = cms.vstring( '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' )
00443     %(process)sPrescaleService.prescaleTable    = cms.VPSet( )
00444 """
00445 

def confdb::instrumentOpenMode (   self)

Definition at line 446 of file confdb.py.

00447                               :
00448     if self.config.open:
00449       # find all EDfilters
00450       filters = [ match[1] for match in re.findall(r'(process\.)?\b(\w+) = cms.EDFilter', self.data) ]
00451       # wrap all EDfilters with "cms.ignore( ... )"
00452       re_filters  = re.compile( r'\b((process\.)?(' + r'|'.join(filters) + r'))\b' )
00453       re_sequence = re.compile( r'cms\.(Path|Sequence)\((.*)\)' )
00454       self.data = re_sequence.sub( lambda line: re_filters.sub( r'cms.ignore( \1 )', line.group(0) ), self.data )
00455 

def confdb::instrumentTiming (   self)

Definition at line 669 of file confdb.py.

00670                             :
00671     if self.config.profiling:
00672       # instrument the menu for profiling: remove the HLTAnalyzerEndpath, add/override the HLTriggerFirstPath, with hltGetRaw and hltGetConditions
00673       text = ''
00674 
00675       if not 'hltGetRaw' in self.data:
00676         # add hltGetRaw
00677         text += """
00678 %%(process)shltGetRaw = cms.EDAnalyzer( "HLTGetRaw",
00679     RawDataCollection = cms.InputTag( "%s" )
00680 )
00681 """ % ( self.config.data and 'source' or 'rawDataCollector' )
00682 
00683       if not 'hltGetConditions' in self.data:
00684         # add hltGetConditions
00685         text += """
00686 %(process)shltGetConditions = cms.EDAnalyzer( 'EventSetupRecordDataGetter',
00687     verbose = cms.untracked.bool( False ),
00688     toGet = cms.VPSet( )
00689 )
00690 """
00691 
00692       if not 'hltBoolFalse' in self.data:
00693         # add hltBoolFalse
00694         text += """
00695 %(process)shltBoolFalse = cms.EDFilter( "HLTBool",
00696     result = cms.bool( False )
00697 )
00698 """
00699 
00700       # add the definition of HLTriggerFirstPath
00701       # FIXME in a cff, should also update the HLTSchedule
00702       text += """
00703 %(process)sHLTriggerFirstPath = cms.Path( %(process)shltGetRaw + %(process)shltGetConditions + %(process)shltBoolFalse )
00704 """
00705       self.data = re.sub(r'.*cms\.(End)?Path.*', text + r'\g<0>', self.data, 1)
00706 
00707       # load additional conditions needed by hltGetConditions
00708       self.loadAdditionalConditions('add XML geometry to keep hltGetConditions happy',
00709         {
00710           'record'  : 'GeometryFileRcd',
00711           'tag'     : 'XMLFILE_Geometry_311YV1_Ideal_mc',
00712           'label'   : 'Ideal',
00713           'connect' : '%(connect)s/CMS_COND_34X_GEOMETRY'
00714         }, {
00715           'record'  : 'GeometryFileRcd',
00716           'tag'     : 'XMLFILE_Geometry_311YV1_Extended_mc',
00717           'label'   : 'Extended',
00718           'connect' : '%(connect)s/CMS_COND_34X_GEOMETRY'
00719         }
00720       )
00721 
00722     # instrument the menu with the Service, EDProducer and EndPath needed for timing studies
00723     # FIXME in a cff, should also update the HLTSchedule
00724     if self.config.timing:
00725       self.data += """
00726 # instrument the menu with the modules and EndPath needed for timing studies
00727 %(process)sPathTimerService = cms.Service( "PathTimerService",
00728 )
00729 %(process)shltTimer = cms.EDProducer( "PathTimerInserter",
00730 )
00731 %(process)shltOutputTiming = cms.OutputModule( "PoolOutputModule",
00732     fileName = cms.untracked.string( "outputTiming.root" ),
00733     fastCloning = cms.untracked.bool( False ),
00734     splitLevel = cms.untracked.int32( 0 ),
00735     dataset = cms.untracked.PSet(
00736         dataTier = cms.untracked.string( 'RECO' ),
00737         filterName = cms.untracked.string( '' )
00738     ),
00739     outputCommands = cms.untracked.vstring( 'drop *',
00740       'keep HLTPerformanceInfo_*_*_*' )
00741 )
00742 
00743 %(process)sTimingOutput = cms.EndPath( %(process)shltTimer + %(process)shltOutputTiming )
00744 """

def confdb::loadAdditionalConditions (   self,
  comment,
  conditions 
)

Definition at line 643 of file confdb.py.

00644                                                           :
00645     # load additional conditions
00646     self.data += """
00647 # %s
00648 if 'GlobalTag' in %%(dict)s:
00649 """ % comment
00650     for condition in conditions:
00651       self.data += """    %%(process)sGlobalTag.toGet.append(
00652         cms.PSet(
00653             record  = cms.string( '%(record)s' ),
00654             tag     = cms.string( '%(tag)s' ),
00655             label   = cms.untracked.string( '%(label)s' ),
00656             connect = cms.untracked.string( '%(connect)s' )
00657         )
00658     )
00659 """ % condition
00660 

def confdb::overrideGlobalTag (   self)

Definition at line 456 of file confdb.py.

00457                              :
00458     # overwrite GlobalTag
00459     # the logic is:
00460     #   - for running online, do nothing, unless a globaltag has been specified on the command line
00461     #   - for running offline on data, only add the pfnPrefix
00462     #   - for running offline on mc, take the GT from the command line of the configuration.type
00463     #      - if the GT is "auto:...", insert the code to read it from Configuration.AlCa.autoCond
00464     text = ''
00465     if self.config.online:
00466       if self.config.globaltag:
00467         # override the GlobalTag connection string and pfnPrefix
00468         text += """
00469 # override the GlobalTag
00470 if 'GlobalTag' in %%(dict)s:
00471     %%(process)sGlobalTag.connect   = '%%(connect)s/CMS_COND_31X_GLOBALTAG'
00472     %%(process)sGlobalTag.pfnPrefix = cms.untracked.string('%%(connect)s/')
00473     %%(process)sGlobalTag.globaltag = '%(globaltag)s'
00474 """
00475 
00476     else:
00477       # override the GlobalTag connection string and pfnPrefix
00478       text += """
00479 # override the GlobalTag, connection string and pfnPrefix
00480 if 'GlobalTag' in %%(dict)s:
00481     %%(process)sGlobalTag.connect   = '%%(connect)s/CMS_COND_31X_GLOBALTAG'
00482     %%(process)sGlobalTag.pfnPrefix = cms.untracked.string('%%(connect)s/')
00483 """
00484 
00485       if self.config.data:
00486         # do not override the GlobalTag unless one was specified on the command line
00487         pass
00488       else:
00489         # check if a specific GlobalTag was specified on the command line, or choose one from the configuration.type
00490         if not self.config.globaltag:
00491           if self.config.type in globalTag:
00492             self.config.globaltag = globalTag[self.config.type]
00493           else:
00494             self.config.globaltag = globalTag['GRun']
00495 
00496       # check if the GlobalTag is an autoCond or an explicit tag
00497       if not self.config.globaltag:
00498         # when running on data, do not override the GlobalTag unless one was specified on the command line
00499         pass
00500       elif self.config.globaltag.startswith('auto:'):
00501         self.config.menuGlobalTagAuto = self.config.globaltag[5:]
00502         text += "    from Configuration.AlCa.autoCond import autoCond\n"
00503         text += "    %%(process)sGlobalTag.globaltag = autoCond['%(menuGlobalTagAuto)s']\n"
00504       else:
00505         text += "    %%(process)sGlobalTag.globaltag = '%(globaltag)s'\n"
00506 
00507     self.data += text % self.config.__dict__
00508 

def confdb::overrideL1Menu (   self)

Definition at line 509 of file confdb.py.

00510                           :
00511     # if requested, override the L1 menu from the GlobalTag (using the same connect as the GlobalTag itself)
00512     if self.config.l1.override:
00513       self.config.l1.record = 'L1GtTriggerMenuRcd'
00514       self.config.l1.label  = ''
00515       self.config.l1.tag    = self.config.l1.override
00516       if not self.config.l1.connect:
00517         self.config.l1.connect = '%(connect)s/CMS_COND_31X_L1T'
00518       self.loadAdditionalConditions( 'override the L1 menu', self.config.l1.__dict__ )
00519 

def confdb::overrideOutput (   self)

Definition at line 568 of file confdb.py.

00569                           :
00570     # override the "online" ShmStreamConsumer output modules with "offline" PoolOutputModule's
00571     self.data = re.sub(
00572       r'\b(process\.)?hltOutput(\w+) *= *cms\.OutputModule\( *"ShmStreamConsumer" *,',
00573       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    ),',
00574       self.data
00575     )
00576 
00577     if not self.config.fragment and self.config.output == 'full':
00578       # add a single "keep *" output
00579       self.data += """
00580 # add a single "keep *" output
00581 %(process)shltOutputFULL = cms.OutputModule( "PoolOutputModule",
00582     fileName = cms.untracked.string( "outputFULL.root" ),
00583     fastCloning = cms.untracked.bool( False ),
00584     outputCommands = cms.untracked.vstring( 'keep *' )
00585 )
00586 %(process)sFULLOutput = cms.EndPath( %(process)shltOutputFULL )
00587 """
00588 

def confdb::overrideParameters (   self,
  module,
  parameters 
)

Definition at line 661 of file confdb.py.

00662                                                   :
00663     # override a module's parameter if the module is present in the configuration
00664     self.data += "if '%s' in %%(dict)s:\n" % module
00665     for (parameter, value) in parameters:
00666       self.data += "    %%(process)s%s.%s = %s\n" % (module, parameter, value)
00667     self.data += "\n"
00668 

def confdb::overrideProcessName (   self)

Definition at line 590 of file confdb.py.

00591                                :
00592     if self.config.name is None:
00593       return
00594 
00595 # the following was stolen and adapted from HLTrigger.Configuration.customL1THLT_Options
00596     self.data += """
00597 # override the process name
00598 %%(process)ssetName_('%(name)s')
00599 
00600 # adapt HLT modules to the correct process name
00601 if 'hltTrigReport' in %%(dict)s:
00602     %%(process)shltTrigReport.HLTriggerResults                    = cms.InputTag( 'TriggerResults', '', '%(name)s' )
00603 
00604 if 'hltPreExpressCosmicsOutputSmart' in %%(dict)s:
00605     %%(process)shltPreExpressCosmicsOutputSmart.TriggerResultsTag = cms.InputTag( 'TriggerResults', '', '%(name)s' )
00606 
00607 if 'hltPreExpressOutputSmart' in %%(dict)s:
00608     %%(process)shltPreExpressOutputSmart.TriggerResultsTag        = cms.InputTag( 'TriggerResults', '', '%(name)s' )
00609 
00610 if 'hltPreDQMForHIOutputSmart' in %%(dict)s:
00611     %%(process)shltPreDQMForHIOutputSmart.TriggerResultsTag       = cms.InputTag( 'TriggerResults', '', '%(name)s' )
00612 
00613 if 'hltPreDQMForPPOutputSmart' in %%(dict)s:
00614     %%(process)shltPreDQMForPPOutputSmart.TriggerResultsTag       = cms.InputTag( 'TriggerResults', '', '%(name)s' )
00615 
00616 if 'hltPreHLTDQMResultsOutputSmart' in %%(dict)s:
00617     %%(process)shltPreHLTDQMResultsOutputSmart.TriggerResultsTag  = cms.InputTag( 'TriggerResults', '', '%(name)s' )
00618 
00619 if 'hltPreHLTDQMOutputSmart' in %%(dict)s:
00620     %%(process)shltPreHLTDQMOutputSmart.TriggerResultsTag         = cms.InputTag( 'TriggerResults', '', '%(name)s' )
00621 
00622 if 'hltPreHLTMONOutputSmart' in %%(dict)s:
00623     %%(process)shltPreHLTMONOutputSmart.TriggerResultsTag         = cms.InputTag( 'TriggerResults', '', '%(name)s' )
00624 
00625 if 'hltDQMHLTScalers' in %%(dict)s:
00626     %%(process)shltDQMHLTScalers.triggerResults                   = cms.InputTag( 'TriggerResults', '', '%(name)s' )
00627     %%(process)shltDQMHLTScalers.processname                      = '%(name)s'
00628 
00629 if 'hltDQML1SeedLogicScalers' in %%(dict)s:
00630     %%(process)shltDQML1SeedLogicScalers.processname              = '%(name)s'
00631 """ % self.config.__dict__
00632 

def confdb::runL1Emulator (   self)

Definition at line 520 of file confdb.py.

00521                          :
00522     # if requested, run (part of) the L1 emulator
00523     if self.config.emulator:
00524       # FIXME this fragment used "process" explicitly
00525       emulator = {
00526         'RawToDigi': '',
00527         'CustomL1T': '',
00528         'CustomHLT': ''
00529       }
00530 
00531       if self.config.data:
00532         emulator['RawToDigi'] = 'RawToDigi_Data_cff'
00533       else:
00534         emulator['RawToDigi'] = 'RawToDigi_cff'
00535 
00536       if self.config.emulator == 'gt':
00537         emulator['CustomL1T'] = 'customiseL1GtEmulatorFromRaw'
00538         emulator['CustomHLT'] = 'switchToSimGtDigis'
00539       elif self.config.emulator == 'gct,gt':
00540         emulator['CustomL1T'] = 'customiseL1CaloAndGtEmulatorsFromRaw'
00541         emulator['CustomHLT'] = 'switchToSimGctGtDigis'
00542       elif self.config.emulator == 'gmt,gt':
00543         # XXX currently unsupported
00544         emulator['CustomL1T'] = 'customiseL1MuonAndGtEmulatorsFromRaw'
00545         emulator['CustomHLT'] = 'switchToSimGmtGtDigis'
00546       elif self.config.emulator in ('gmt,gct,gt', 'gct,gmt,gt', 'all'):
00547         emulator['CustomL1T'] = 'customiseL1EmulatorFromRaw'
00548         emulator['CustomHLT'] = 'switchToSimGmtGctGtDigis'
00549       else:
00550         # unsupported argument, default to running the whole emulator
00551         emulator['CustomL1T'] = 'customiseL1EmulatorFromRaw'
00552         emulator['CustomHLT'] = 'switchToSimGmtGctGtDigis'
00553 
00554       self.data += """
00555 # customize the L1 emulator to run only the GT, and take the GCT and GMT from data
00556 process.load( 'Configuration.StandardSequences.%(RawToDigi)s' )
00557 process.load( 'Configuration.StandardSequences.SimL1Emulator_cff' )
00558 import L1Trigger.Configuration.L1Trigger_custom
00559 process = L1Trigger.Configuration.L1Trigger_custom.%(CustomL1T)s( process )
00560 process = L1Trigger.Configuration.L1Trigger_custom.customiseResetPrescalesAndMasks( process )
00561 
00562 # customize the HLT to use the emulated results
00563 import HLTrigger.Configuration.customizeHLTforL1Emulator
00564 process = HLTrigger.Configuration.customizeHLTforL1Emulator.switchToL1Emulator( process )
00565 process = HLTrigger.Configuration.customizeHLTforL1Emulator.%(CustomHLT)s( process )
00566 """ % emulator
00567 

def confdb::updateMessageLogger (   self)

Definition at line 633 of file confdb.py.

00634                                :
00635     # request summary informations from the MessageLogger
00636     self.data += """
00637 if 'MessageLogger' in %(dict)s:
00638     %(process)sMessageLogger.categories.append('TriggerSummaryProducerAOD')
00639     %(process)sMessageLogger.categories.append('L1GtTrigReport')
00640     %(process)sMessageLogger.categories.append('HLTrigReport')
00641 """
00642 


Variable Documentation

Definition at line 752 of file confdb.py.

TO BE REMOVED as soon the configuration in confDB gets fixed: self._fix_parameter( type = 'InputTag', value = 'hltPFJetCtfWithMaterialTracks', replace = 'hltIter4Merged')

Definition at line 368 of file confdb.py.

Definition at line 1019 of file confdb.py.