CMS 3D CMS Logo

Public Member Functions | Public Attributes | Private Member Functions

confdb::HLTProcess Class Reference

List of all members.

Public Member Functions

def __init__
def addGlobalOptions
def build_source
def buildOptions
def customize
def dump
def expandWildcardOptions
def expandWildcards
def fixForFastSim
def fixForMC
def getPathList
def getRawConfigurationFromDB
def instrumentOpenMode
def instrumentTiming
def loadAdditionalConditions
def overrideGlobalTag
def overrideL1Menu
def overrideOutput
def overrideProcessName
def unprescale
def updateMessageLogger

Public Attributes

 config
 data
 labels
 options
 source

Private Member Functions

def _build_cmdline
def _build_options
def _build_query
def _build_source
def _fix_parameter

Detailed Description

Definition at line 9 of file confdb.py.


Constructor & Destructor Documentation

def confdb::HLTProcess::__init__ (   self,
  configuration 
)

Definition at line 10 of file confdb.py.

00011                                    :
00012     self.config = configuration
00013     self.data   = None
00014     self.source = None
00015 
00016     self.options = {
00017       'essources' : [],
00018       'esmodules' : [],
00019       'modules'   : [],
00020       'sequences' : [],
00021       'services'  : [],
00022       'paths'     : [],
00023       'psets'     : [],
00024       'blocks'    : [],
00025     }
00026 
00027     self.labels = {}
00028     if self.config.fragment:
00029       self.labels['process'] = ''
00030       self.labels['dict']    = 'locals()'
00031     else:
00032       self.labels['process'] = 'process.'
00033       self.labels['dict']    = 'process.__dict__'
00034 
00035     if self.config.online:
00036       self.labels['connect'] = 'frontier://(proxyurl=https://localhost:3128)(serverurl=https://localhost:8000/FrontierOnProd)(serverurl=https://localhost:8000/FrontierOnProd)(retrieve-ziplevel=0)'
00037     else:
00038       self.labels['connect'] = 'frontier://FrontierProd'
00039 
00040     # get the configuration from ConfdB
00041     self.buildOptions()
00042     self.expandWildcardOptions()
00043     self.getRawConfigurationFromDB()
00044     self.customize()
00045 


Member Function Documentation

def confdb::HLTProcess::_build_cmdline (   self) [private]

Definition at line 61 of file confdb.py.

00062                           :
00063     if not self.config.fragment:
00064       return 'edmConfigFromDB %s %s %s'       % (self._build_query(), self._build_source(), self._build_options())
00065     else:
00066       return 'edmConfigFromDB --cff %s %s %s' % (self._build_query(), self._build_source(), self._build_options())
00067 

def confdb::HLTProcess::_build_options (   self) [private]

Definition at line 58 of file confdb.py.

00059                           :
00060     return ' '.join(['--%s %s' % (key, ','.join(vals)) for key, vals in self.options.iteritems() if vals])

def confdb::HLTProcess::_build_query (   self) [private]

Definition at line 46 of file confdb.py.

00047                         :
00048     if self.config.menu.run:
00049       return '--runNumber %s' % self.config.menu.run
00050     else:
00051       return '--%s --configName %s' % (self.config.menu.db, self.config.menu.name)

def confdb::HLTProcess::_build_source (   self) [private]

Definition at line 52 of file confdb.py.

00053                          :
00054     if self.source is None:
00055       return '--noedsources'
00056     else:
00057       return '--input ' + self.source

def confdb::HLTProcess::_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 189 of file confdb.py.

00190                                   :
00191     """arguments:
00192         name:     parameter name (optional)
00193         type:     parameter type (look for tracked and untracked variants)
00194         value:    original value
00195         replace:  replacement value
00196     """
00197     if 'name' in args:
00198       self.data = re.sub(
00199           r'%(name)s = cms(?P<tracked>(?:\.untracked)?)\.%(type)s\( (?P<quote>["\']?)%(value)s(?P=quote)' % args,
00200           r'%(name)s = cms\g<tracked>.%(type)s( \g<quote>%(replace)s\g<quote>' % args,
00201           self.data)
00202     else:
00203       self.data = re.sub(
00204           r'cms(?P<tracked>(?:\.untracked)?)\.%(type)s\( (?P<quote>["\']?)%(value)s(?P=quote)' % args,
00205           r'cms\g<tracked>.%(type)s( \g<quote>%(replace)s\g<quote>' % args,
00206           self.data)
00207 

def confdb::HLTProcess::addGlobalOptions (   self)

Definition at line 176 of file confdb.py.

00177                             :
00178     # add global options
00179     self.data += """
00180 # add global options
00181 %(process)smaxEvents = cms.untracked.PSet(
00182     input = cms.untracked.int32( 100 )
00183 )
00184 %(process)soptions = cms.untracked.PSet(
00185     wantSummary = cms.untracked.bool( True )
00186 )
00187 """
00188 

def confdb::HLTProcess::build_source (   self)

Definition at line 777 of file confdb.py.

00778                         :
00779     if self.config.online:
00780       # online we always run on data
00781       self.source = "file:/tmp/InputCollection.root"
00782     elif self.config.data:
00783       # offline we can run on data...
00784       self.source = "/store/data/Run2010B/MinimumBias/RAW/v1/000/149/291/DC6C917A-0EE3-DF11-867B-001617C3B654.root"
00785     else:
00786       # ...or on mc
00787       self.source = "file:RelVal_DigiL1Raw_%s.root" % self.config.type
00788 
def confdb::HLTProcess::buildOptions (   self)

Definition at line 471 of file confdb.py.

00472                         :
00473     # common configuration for all scenarios
00474     self.options['services'].append( "-FUShmDQMOutputService" )
00475     self.options['paths'].append( "-OfflineOutput" )
00476 
00477     # adapt source and options to the current scenario
00478     if not self.config.fragment:
00479       self.build_source()
00480 
00481     if self.config.fragment:
00482       # extract a configuration file fragment
00483       self.options['essources'].append( "-GlobalTag" )
00484       self.options['essources'].append( "-HepPDTESSource" )
00485       self.options['essources'].append( "-XMLIdealGeometryESSource" )
00486       self.options['essources'].append( "-eegeom" )
00487       self.options['essources'].append( "-es_hardcode" )
00488       self.options['essources'].append( "-magfield" )
00489 
00490       self.options['esmodules'].append( "-AutoMagneticFieldESProducer" )
00491       self.options['esmodules'].append( "-SlaveField0" )
00492       self.options['esmodules'].append( "-SlaveField20" )
00493       self.options['esmodules'].append( "-SlaveField30" )
00494       self.options['esmodules'].append( "-SlaveField35" )
00495       self.options['esmodules'].append( "-SlaveField38" )
00496       self.options['esmodules'].append( "-SlaveField40" )
00497       self.options['esmodules'].append( "-VBF0" )
00498       self.options['esmodules'].append( "-VBF20" )
00499       self.options['esmodules'].append( "-VBF30" )
00500       self.options['esmodules'].append( "-VBF35" )
00501       self.options['esmodules'].append( "-VBF38" )
00502       self.options['esmodules'].append( "-VBF40" )
00503       self.options['esmodules'].append( "-CSCGeometryESModule" )
00504       self.options['esmodules'].append( "-CaloGeometryBuilder" )
00505       self.options['esmodules'].append( "-CaloTowerHardcodeGeometryEP" )
00506       self.options['esmodules'].append( "-CastorHardcodeGeometryEP" )
00507       self.options['esmodules'].append( "-DTGeometryESModule" )
00508       self.options['esmodules'].append( "-EcalBarrelGeometryEP" )
00509       self.options['esmodules'].append( "-EcalElectronicsMappingBuilder" )
00510       self.options['esmodules'].append( "-EcalEndcapGeometryEP" )
00511       self.options['esmodules'].append( "-EcalLaserCorrectionService" )
00512       self.options['esmodules'].append( "-EcalPreshowerGeometryEP" )
00513       self.options['esmodules'].append( "-HcalHardcodeGeometryEP" )
00514       self.options['esmodules'].append( "-HcalTopologyIdealEP" )
00515       self.options['esmodules'].append( "-MuonNumberingInitialization" )
00516       self.options['esmodules'].append( "-ParametrizedMagneticFieldProducer" )
00517       self.options['esmodules'].append( "-RPCGeometryESModule" )
00518       self.options['esmodules'].append( "-SiStripGainESProducer" )
00519       self.options['esmodules'].append( "-SiStripRecHitMatcherESProducer" )
00520       self.options['esmodules'].append( "-SiStripQualityESProducer" )
00521       self.options['esmodules'].append( "-StripCPEfromTrackAngleESProducer" )
00522       self.options['esmodules'].append( "-TrackerDigiGeometryESModule" )
00523       self.options['esmodules'].append( "-TrackerGeometricDetESModule" )
00524       self.options['esmodules'].append( "-VolumeBasedMagneticFieldESProducer" )
00525       self.options['esmodules'].append( "-ZdcHardcodeGeometryEP" )
00526       self.options['esmodules'].append( "-hcal_db_producer" )
00527       self.options['esmodules'].append( "-L1GtTriggerMaskAlgoTrigTrivialProducer" )
00528       self.options['esmodules'].append( "-L1GtTriggerMaskTechTrigTrivialProducer" )
00529       self.options['esmodules'].append( "-hltESPEcalTrigTowerConstituentsMapBuilder" )
00530       self.options['esmodules'].append( "-hltESPGlobalTrackingGeometryESProducer" )
00531       self.options['esmodules'].append( "-hltESPMuonDetLayerGeometryESProducer" )
00532       self.options['esmodules'].append( "-hltESPTrackerRecoGeometryESProducer" )
00533       if not self.config.fastsim:
00534         self.options['esmodules'].append( "-CaloTowerGeometryFromDBEP" )
00535         self.options['esmodules'].append( "-CastorGeometryFromDBEP" )
00536         self.options['esmodules'].append( "-EcalBarrelGeometryFromDBEP" )
00537         self.options['esmodules'].append( "-EcalEndcapGeometryFromDBEP" )
00538         self.options['esmodules'].append( "-EcalPreshowerGeometryFromDBEP" )
00539         self.options['esmodules'].append( "-HcalGeometryFromDBEP" )
00540         self.options['esmodules'].append( "-ZdcGeometryFromDBEP" )
00541         self.options['esmodules'].append( "-XMLFromDBSource" )
00542         self.options['esmodules'].append( "-sistripconn" )
00543 
00544       self.options['services'].append( "-PrescaleService" )
00545       self.options['services'].append( "-MessageLogger" )
00546       self.options['services'].append( "-DQM" )
00547       self.options['services'].append( "-MicroStateService" )
00548       self.options['services'].append( "-ModuleWebRegistry" )
00549       self.options['services'].append( "-TimeProfilerService" )
00550       if not self.config.fastsim:
00551         self.options['services'].append( "-DQMStore" )
00552 
00553       self.options['paths'].append( "-HLTOutput" )
00554       self.options['paths'].append( "-ExpressOutput" )
00555       self.options['paths'].append( "-EventDisplayOutput" )
00556       self.options['paths'].append( "-AlCaOutput" )
00557       self.options['paths'].append( "-AlCaPPOutput" )
00558       self.options['paths'].append( "-AlCaHIOutput" )
00559       self.options['paths'].append( "-DQMOutput" )
00560       self.options['paths'].append( "-HLTDQMOutput" )
00561       self.options['paths'].append( "-HLTDQMResultsOutput" )
00562       self.options['paths'].append( "-HLTMONOutput" )
00563       self.options['paths'].append( "-NanoDSTOutput" )
00564 
00565       self.options['psets'].append( "-maxEvents" )
00566       self.options['psets'].append( "-options" )
00567 
00568     if self.config.fastsim:
00569       # remove components not supported or needed by fastsim
00570       self.options['essources'].append( "-BTagRecord" )
00571 
00572       self.options['esmodules'].append( "-SiPixelTemplateDBObjectESProducer" )
00573       self.options['esmodules'].append( "-TTRHBuilderPixelOnly" )
00574       self.options['esmodules'].append( "-WithTrackAngle" )
00575       self.options['esmodules'].append( "-trajectoryCleanerBySharedHits" )
00576       self.options['esmodules'].append( "-trackCounting3D2nd" )
00577       self.options['esmodules'].append( "-navigationSchoolESProducer" )
00578       self.options['esmodules'].append( "-muonCkfTrajectoryFilter" )
00579       self.options['esmodules'].append( "-ckfBaseTrajectoryFilter" )
00580       self.options['esmodules'].append( "-TransientTrackBuilderESProducer" )
00581       self.options['esmodules'].append( "-TrackerRecoGeometryESProducer" )
00582       self.options['esmodules'].append( "-SteppingHelixPropagatorOpposite" )
00583       self.options['esmodules'].append( "-SteppingHelixPropagatorAny" )
00584       self.options['esmodules'].append( "-SteppingHelixPropagatorAlong" )
00585       self.options['esmodules'].append( "-SmootherRK" )
00586       self.options['esmodules'].append( "-SmartPropagatorRK" )
00587       self.options['esmodules'].append( "-SmartPropagatorOpposite" )
00588       self.options['esmodules'].append( "-SmartPropagatorAnyRK" )
00589       self.options['esmodules'].append( "-SmartPropagatorAnyOpposite" )
00590       self.options['esmodules'].append( "-SmartPropagatorAny" )
00591       self.options['esmodules'].append( "-SmartPropagator" )
00592       self.options['esmodules'].append( "-RungeKuttaTrackerPropagator" )
00593       self.options['esmodules'].append( "-OppositeMaterialPropagator" )
00594       self.options['esmodules'].append( "-MuonTransientTrackingRecHitBuilderESProducer" )
00595       self.options['esmodules'].append( "-MuonDetLayerGeometryESProducer" )
00596       self.options['esmodules'].append( "-MuonCkfTrajectoryBuilder" )
00597       self.options['esmodules'].append( "-hltMeasurementTracker" )
00598       self.options['esmodules'].append( "-MaterialPropagator" )
00599       self.options['esmodules'].append( "-L3MuKFFitter" )
00600       self.options['esmodules'].append( "-KFUpdatorESProducer" )
00601       self.options['esmodules'].append( "-KFSmootherForRefitInsideOut" )
00602       self.options['esmodules'].append( "-KFSmootherForMuonTrackLoader" )
00603       self.options['esmodules'].append( "-KFFitterForRefitInsideOut" )
00604       self.options['esmodules'].append( "-GroupedCkfTrajectoryBuilder" )
00605       self.options['esmodules'].append( "-GlobalTrackingGeometryESProducer" )
00606       self.options['esmodules'].append( "-FittingSmootherRK" )
00607       self.options['esmodules'].append( "-FitterRK" )
00608       self.options['esmodules'].append( "-hltCkfTrajectoryBuilder" )
00609       self.options['esmodules'].append( "-Chi2MeasurementEstimator" )
00610       self.options['esmodules'].append( "-Chi2EstimatorForRefit" )
00611       self.options['esmodules'].append( "-CaloTowerConstituentsMapBuilder" )
00612       self.options['esmodules'].append( "-CaloTopologyBuilder" )
00613 
00614       self.options['services'].append( "-UpdaterService" )
00615 
00616       self.options['blocks'].append( "hltL1NonIsoLargeWindowElectronPixelSeeds::SeedConfiguration" )
00617       self.options['blocks'].append( "hltL1IsoLargeWindowElectronPixelSeeds::SeedConfiguration" )
00618       self.options['blocks'].append( "hltL1NonIsoStartUpElectronPixelSeeds::SeedConfiguration" )
00619       self.options['blocks'].append( "hltL1IsoStartUpElectronPixelSeeds::SeedConfiguration" )
00620 
00621       self.options['modules'].append( "hltL3MuonIsolations" )
00622       self.options['modules'].append( "hltPixelVertices" )
00623       self.options['modules'].append( "-hltCkfL1IsoTrackCandidates" )
00624       self.options['modules'].append( "-hltCtfL1IsoWithMaterialTracks" )
00625       self.options['modules'].append( "-hltCkfL1NonIsoTrackCandidates" )
00626       self.options['modules'].append( "-hltCtfL1NonIsoWithMaterialTracks" )
00627       self.options['modules'].append( "hltPixelMatchLargeWindowElectronsL1Iso" )
00628       self.options['modules'].append( "hltPixelMatchLargeWindowElectronsL1NonIso" )
00629       self.options['modules'].append( "-hltESRegionalEgammaRecHit" )
00630       self.options['modules'].append( "-hltEcalRegionalJetsFEDs" )
00631       self.options['modules'].append( "-hltEcalRegionalJetsRecHitTmp" )
00632       self.options['modules'].append( "-hltEcalRegionalMuonsFEDs" )
00633       self.options['modules'].append( "-hltEcalRegionalMuonsRecHitTmp" )
00634       self.options['modules'].append( "-hltEcalRegionalEgammaFEDs" )
00635       self.options['modules'].append( "-hltEcalRegionalEgammaRecHitTmp" )
00636       self.options['modules'].append( "-hltFEDSelector" )
00637       self.options['modules'].append( "-hltL3TrajSeedOIHit" )
00638       self.options['modules'].append( "-hltL3TrajSeedIOHit" )
00639       self.options['modules'].append( "-hltL3TrackCandidateFromL2OIState" )
00640       self.options['modules'].append( "-hltL3TrackCandidateFromL2OIHit" )
00641       self.options['modules'].append( "-hltL3TrackCandidateFromL2IOHit" )
00642       self.options['modules'].append( "-hltL3TrackCandidateFromL2NoVtx" )
00643       self.options['modules'].append( "-hltHcalDigis" )
00644       self.options['modules'].append( "-hltHoreco" )
00645       self.options['modules'].append( "-hltHfreco" )
00646       self.options['modules'].append( "-hltHbhereco" )
00647       self.options['modules'].append( "-hltEcalRegionalRestFEDs" )
00648       self.options['modules'].append( "-hltEcalRegionalESRestFEDs" )
00649       self.options['modules'].append( "-hltEcalRawToRecHitFacility" )
00650       self.options['modules'].append( "-hltESRawToRecHitFacility" )
00651       self.options['modules'].append( "-hltEcalRegionalJetsRecHit" )
00652       self.options['modules'].append( "-hltEcalRegionalMuonsRecHit" )
00653       self.options['modules'].append( "-hltEcalRegionalEgammaRecHit" )
00654       self.options['modules'].append( "-hltEcalRecHitAll" )
00655       self.options['modules'].append( "-hltESRecHitAll" )
00656       self.options['modules'].append( "-hltL3TauPixelSeeds" )
00657       self.options['modules'].append( "-hltL3TauHighPtPixelSeeds" )
00658       self.options['modules'].append( "-hltL3TauCkfTrackCandidates" )
00659       self.options['modules'].append( "-hltL3TauCkfHighPtTrackCandidates" )
00660       self.options['modules'].append( "-hltL3TauCtfWithMaterialTracks" )
00661       self.options['modules'].append( "-hltL25TauPixelSeeds" )
00662       self.options['modules'].append( "-hltL25TauCkfTrackCandidates" )
00663       self.options['modules'].append( "-hltL25TauCtfWithMaterialTracks" )
00664       self.options['modules'].append( "-hltL3TauSingleTrack15CtfWithMaterialTracks" )
00665       self.options['modules'].append( "-hltPFJetCtfWithMaterialTracks" )
00666       self.options['modules'].append( "-hltBLifetimeRegionalPixelSeedGeneratorStartup" )
00667       self.options['modules'].append( "-hltBLifetimeRegionalCkfTrackCandidatesStartup" )
00668       self.options['modules'].append( "-hltBLifetimeRegionalCtfWithMaterialTracksStartup" )
00669       self.options['modules'].append( "-hltBLifetimeRegionalPixelSeedGeneratorStartupU" )
00670       self.options['modules'].append( "-hltBLifetimeRegionalCkfTrackCandidatesStartupU" )
00671       self.options['modules'].append( "-hltBLifetimeRegionalCtfWithMaterialTracksStartupU" )
00672       self.options['modules'].append( "-hltBLifetimeRegionalPixelSeedGenerator" )
00673       self.options['modules'].append( "-hltBLifetimeRegionalCkfTrackCandidates" )
00674       self.options['modules'].append( "-hltBLifetimeRegionalCtfWithMaterialTracks" )
00675       self.options['modules'].append( "-hltBLifetimeRegionalPixelSeedGeneratorRelaxed" )
00676       self.options['modules'].append( "-hltBLifetimeRegionalCkfTrackCandidatesRelaxed" )
00677       self.options['modules'].append( "-hltBLifetimeRegionalCtfWithMaterialTracksRelaxed" )
00678       self.options['modules'].append( "-hltPixelTracksForMinBias" )
00679       self.options['modules'].append( "-hltPixelTracksForHighMult" )
00680       self.options['modules'].append( "-hltMuonCSCDigis" )
00681       self.options['modules'].append( "-hltMuonDTDigis" )
00682       self.options['modules'].append( "-hltMuonRPCDigis" )
00683       self.options['modules'].append( "-hltGtDigis" )
00684       self.options['modules'].append( "-hltL1GtTrigReport" )
00685       self.options['modules'].append( "hltCsc2DRecHits" )
00686       self.options['modules'].append( "hltDt1DRecHits" )
00687       self.options['modules'].append( "hltRpcRecHits" )
00688 
00689       self.options['sequences'].append( "-HLTL1IsoEgammaRegionalRecoTrackerSequence" )
00690       self.options['sequences'].append( "-HLTL1NonIsoEgammaRegionalRecoTrackerSequence" )
00691       self.options['sequences'].append( "-HLTL1IsoElectronsRegionalRecoTrackerSequence" )
00692       self.options['sequences'].append( "-HLTL1NonIsoElectronsRegionalRecoTrackerSequence" )
00693       self.options['sequences'].append( "-HLTPixelMatchLargeWindowElectronL1IsoTrackingSequence" )
00694       self.options['sequences'].append( "-HLTPixelMatchLargeWindowElectronL1NonIsoTrackingSequence" )
00695       self.options['sequences'].append( "-HLTPixelTrackingForMinBiasSequence" )
00696       self.options['sequences'].append( "-HLTDoLocalStripSequence" )
00697       self.options['sequences'].append( "-HLTDoLocalPixelSequence" )
00698       self.options['sequences'].append( "-HLTRecopixelvertexingSequence" )
00699       self.options['sequences'].append( "-HLTL3TauTrackReconstructionSequence" )
00700       self.options['sequences'].append( "-HLTL3TauHighPtTrackReconstructionSequence" )
00701       self.options['sequences'].append( "-HLTL25TauTrackReconstructionSequence" )
00702       self.options['sequences'].append( "-HLTL3TauSingleTrack15ReconstructionSequence" )
00703       self.options['sequences'].append( "-HLTTrackReconstructionForJets" )
00704       self.options['sequences'].append( "-HLTEndSequence" )
00705       self.options['sequences'].append( "-HLTBeginSequence" )
00706       self.options['sequences'].append( "-HLTBeginSequenceNZS" )
00707       self.options['sequences'].append( "-HLTBeginSequenceBPTX" )
00708       self.options['sequences'].append( "-HLTBeginSequenceAntiBPTX" )
00709       self.options['sequences'].append( "-HLTL2HcalIsolTrackSequence" )
00710       self.options['sequences'].append( "-HLTL2HcalIsolTrackSequenceHB" )
00711       self.options['sequences'].append( "-HLTL2HcalIsolTrackSequenceHE" )
00712       self.options['sequences'].append( "-HLTL3HcalIsolTrackSequence" )
00713 
00714       # remove unsupported paths
00715       self.options['paths'].append( "-AlCa_EcalEta" )
00716       self.options['paths'].append( "-AlCa_EcalPhiSym" )
00717       self.options['paths'].append( "-AlCa_EcalPi0" )
00718       self.options['paths'].append( "-AlCa_RPCMuonNoHits" )
00719       self.options['paths'].append( "-AlCa_RPCMuonNoTriggers" )
00720       self.options['paths'].append( "-AlCa_RPCMuonNormalisation" )
00721       self.options['paths'].append( "-DQM_FEDIntegrity" )
00722       self.options['paths'].append( "-DQM_FEDIntegrity_v*" )
00723       self.options['paths'].append( "-HLT_Activity_DT" )
00724       self.options['paths'].append( "-HLT_Activity_DT_Tuned" )
00725       self.options['paths'].append( "-HLT_Activity_Ecal" )
00726       self.options['paths'].append( "-HLT_Activity_EcalREM" )
00727       self.options['paths'].append( "-HLT_Activity_Ecal_SC15" )
00728       self.options['paths'].append( "-HLT_Activity_Ecal_SC17" )
00729       self.options['paths'].append( "-HLT_Activity_Ecal_SC7" )
00730       self.options['paths'].append( "-HLT_Activity_L1A" )
00731       self.options['paths'].append( "-HLT_Activity_PixelClusters" )
00732       self.options['paths'].append( "-HLT_Calibration" )
00733       self.options['paths'].append( "-HLT_DTErrors" )
00734       self.options['paths'].append( "-HLT_DoubleEle4_SW_eeRes_L1R" )
00735       self.options['paths'].append( "-HLT_DoubleEle4_SW_eeRes_L1R_v*" )
00736       self.options['paths'].append( "-HLT_DoubleEle5_SW_Upsilon_L1R_v*" )
00737       self.options['paths'].append( "-HLT_DoublePhoton4_Jpsi_L1R" )
00738       self.options['paths'].append( "-HLT_DoublePhoton4_Upsilon_L1R" )
00739       self.options['paths'].append( "-HLT_DoublePhoton4_eeRes_L1R" )
00740       self.options['paths'].append( "-HLT_EcalCalibration" )
00741       self.options['paths'].append( "-HLT_EgammaSuperClusterOnly_L1R" )
00742       self.options['paths'].append( "-HLT_Ele15_SiStrip_L1R" )
00743       self.options['paths'].append( "-HLT_Ele20_SiStrip_L1R" )
00744       self.options['paths'].append( "-HLT_HFThreshold10" )
00745       self.options['paths'].append( "-HLT_HFThreshold3" )
00746       self.options['paths'].append( "-HLT_HcalCalibration" )
00747       self.options['paths'].append( "-HLT_HcalNZS" )
00748       self.options['paths'].append( "-HLT_HcalPhiSym" )
00749       self.options['paths'].append( "-HLT_IsoTrackHB_v*" )
00750       self.options['paths'].append( "-HLT_IsoTrackHE_v*" )
00751       self.options['paths'].append( "-HLT_Jet15U_HcalNoiseFiltered" )
00752       self.options['paths'].append( "-HLT_Jet15U_HcalNoiseFiltered_v*" )
00753       self.options['paths'].append( "-HLT_L1DoubleMuOpen_Tight" )
00754       self.options['paths'].append( "-HLT_L1MuOpen_AntiBPTX" )
00755       self.options['paths'].append( "-HLT_L1MuOpen_AntiBPTX_v*" )
00756       self.options['paths'].append( "-HLT_Mu0_TkMu0_OST_Jpsi" )
00757       self.options['paths'].append( "-HLT_Mu0_TkMu0_OST_Jpsi_Tight_v*" )
00758       self.options['paths'].append( "-HLT_Mu0_Track0_Jpsi" )
00759       self.options['paths'].append( "-HLT_Mu3_TkMu0_OST_Jpsi" )
00760       self.options['paths'].append( "-HLT_Mu3_TkMu0_OST_Jpsi_Tight_v*" )
00761       self.options['paths'].append( "-HLT_Mu3_Track0_Jpsi" )
00762       self.options['paths'].append( "-HLT_Mu3_Track3_Jpsi" )
00763       self.options['paths'].append( "-HLT_Mu3_Track3_Jpsi_v*" )
00764       self.options['paths'].append( "-HLT_Mu3_Track5_Jpsi_v*" )
00765       self.options['paths'].append( "-HLT_Mu5_TkMu0_OST_Jpsi" )
00766       self.options['paths'].append( "-HLT_Mu5_TkMu0_OST_Jpsi_Tight_v*" )
00767       self.options['paths'].append( "-HLT_Mu5_Track0_Jpsi" )
00768       self.options['paths'].append( "-HLT_Mu5_Track0_Jpsi_v*" )
00769       self.options['paths'].append( "-HLT_Random" )
00770       self.options['paths'].append( "-HLT_SelectEcalSpikesHighEt_L1R" )
00771       self.options['paths'].append( "-HLT_SelectEcalSpikes_L1R" )
00772 
00773       # remove HLTAnalyzerEndpath from fastsim cff's
00774       if self.config.fragment:
00775         self.options['paths'].append( "-HLTAnalyzerEndpath" )
00776 

def confdb::HLTProcess::customize (   self)

Definition at line 113 of file confdb.py.

00114                      :
00115     if self.config.fragment:
00116       # if running on MC, adapt the configuration accordingly
00117       self.fixForMC()
00118 
00119       # if requested, adapt the configuration for FastSim
00120       self.fixForFastSim()
00121 
00122       # if requested, remove the HLT prescales
00123       self.unprescale()
00124 
00125       # if requested, override all ED/HLTfilters to always pass ("open" mode)
00126       self.instrumentOpenMode()
00127 
00128       # if requested, instrument the self with the modules and EndPath needed for timing studies
00129       self.instrumentTiming()
00130 
00131     else:
00132       # if running on MC, adapt the configuration accordingly
00133       self.fixForMC()
00134 
00135       # override the process name and adapt the relevant filters
00136       self.overrideProcessName()
00137 
00138       # if required, remove the HLT prescales
00139       self.unprescale()
00140 
00141       # if requested, override all ED/HLTfilters to always pass ("open" mode)
00142       self.instrumentOpenMode()
00143 
00144       # manual override some Heavy Ion parameters
00145       if self.config.type in ('HIon', ):
00146         self.data += """
00147 # HIon paths in smart prescalers
00148 if 'hltPreHLTDQMSmart' in %(dict)s:
00149     %(process)shltPreHLTDQMSmart.throw  = cms.bool( False )
00150 if 'hltPreHLTMONSmart' in %(dict)s:
00151     %(process)shltPreHLTMONSmart.throw  = cms.bool( False )
00152 if 'hltPreExpressSmart' in %(dict)s:
00153     %(process)shltPreExpressSmart.throw = cms.bool( False )
00154 if 'hltPreDQMSmart' in %(dict)s:
00155     %(process)shltPreDQMSmart.throw     = cms.bool( False )
00156 """
00157 
00158       # override the output modules to output root files
00159       self.overrideOutput()
00160 
00161       # add global options
00162       self.addGlobalOptions()
00163 
00164       # if requested or necessary, override the GlobalTag and connection strings
00165       self.overrideGlobalTag()
00166 
00167       # if requested, override the L1 self from the GlobalTag (using the same connect as the GlobalTag itself)
00168       self.overrideL1Menu()
00169 
00170       # request summary informations from the MessageLogger
00171       self.updateMessageLogger()
00172 
00173       # if requested, instrument the self with the modules and EndPath needed for timing studies
00174       self.instrumentTiming()
00175 

def confdb::HLTProcess::dump (   self)

Definition at line 108 of file confdb.py.

00109                 :
00110     return self.data % self.labels
00111 

def confdb::HLTProcess::expandWildcardOptions (   self)

Definition at line 86 of file confdb.py.

00087                                  :
00088     # for the time being, this is limited only to the --paths option
00089     self.options['paths'] = self.expandWildcards(self.options['paths'], self.getPathList())
00090 

def confdb::HLTProcess::expandWildcards (   globs,
  collection 
)

Definition at line 92 of file confdb.py.

00093                                         :
00094     # expand a list of unix-style wildcards matching a given collection
00095     # wildcards with no matches are silently discarded
00096     matches = []
00097     for glob in globs:
00098       negate = ''
00099       if glob[0] == '-':
00100         negate = '-'
00101         glob   = glob[1:]
00102       # translate a unix-style glob expression into a regular expression
00103       filter = re.compile(r'^' + glob.replace('?', '.').replace('*', '.*').replace('[!', '[^') + r'$')
00104       matches.extend( negate + element for element in collection if filter.match(element) )
00105     return matches
00106 

def confdb::HLTProcess::fixForFastSim (   self)

Definition at line 215 of file confdb.py.

00216                          :
00217     if self.config.fastsim:
00218       # adapt the hle configuration (fragment) to run under fastsim
00219       self.data = re.sub( r'import FWCore.ParameterSet.Config as cms', r'\g<0>\nfrom FastSimulation.HighLevelTrigger.HLTSetup_cff import *', self.data)
00220 
00221       # remove the definition of streams and datasets
00222       self.data = re.compile( r'^streams.*\n(.*\n)*?^\)\s*\n',  re.MULTILINE ).sub( '', self.data )
00223       self.data = re.compile( r'^datasets.*\n(.*\n)*?^\)\s*\n', re.MULTILINE ).sub( '', self.data )
00224 
00225       # fix the definition of module
00226       self._fix_parameter(                               type = 'InputTag', value = 'hltL1extraParticles',  replace = 'l1extraParticles')
00227       self._fix_parameter(name = 'GMTReadoutCollection', type = 'InputTag', value = 'hltGtDigis',           replace = 'gmtDigis')
00228       self._fix_parameter(                               type = 'InputTag', value = 'hltGtDigis',           replace = 'gtDigis')
00229       self._fix_parameter(                               type = 'InputTag', value = 'hltL1GtObjectMap',     replace = 'gtDigis')
00230       self._fix_parameter(name = 'initialSeeds',         type = 'InputTag', value = 'noSeedsHere',          replace = 'globalPixelSeeds:GlobalPixel')
00231       self._fix_parameter(name = 'preFilteredSeeds',     type = 'bool',     value = 'True',                 replace = 'False')
00232       self._fix_parameter(                               type = 'InputTag', value = 'hltOfflineBeamSpot',   replace = 'offlineBeamSpot')
00233       self._fix_parameter(                               type = 'InputTag', value = 'hltMuonCSCDigis',      replace = 'simMuonCSCDigis')
00234       self._fix_parameter(                               type = 'InputTag', value = 'hltMuonDTDigis',       replace = 'simMuonDTDigis')
00235       self._fix_parameter(                               type = 'InputTag', value = 'hltMuonRPCDigis',      replace = 'simMuonRPCDigis')
00236 
00237       # fix the definition of sequences and paths
00238       self.data = re.sub( r'hltMuonCSCDigis', r'cms.SequencePlaceholder( "simMuonCSCDigis" )',  self.data )
00239       self.data = re.sub( r'hltMuonDTDigis',  r'cms.SequencePlaceholder( "simMuonDTDigis" )',   self.data )
00240       self.data = re.sub( r'hltMuonRPCDigis', r'cms.SequencePlaceholder( "simMuonRPCDigis" )',  self.data )
00241       self.data = re.sub( r'HLTEndSequence',  r'cms.SequencePlaceholder( "HLTEndSequence" )',   self.data )
00242       self.data = re.sub( r'hltGtDigis',      r'HLTBeginSequence',                              self.data )
00243 

def confdb::HLTProcess::fixForMC (   self)

Definition at line 208 of file confdb.py.

00209                     :
00210     if not self.config.data:
00211       # override the raw data collection label
00212       self._fix_parameter(type = 'InputTag', value = 'source', replace = 'rawDataCollector')
00213       self._fix_parameter(type = 'string',   value = 'source', replace = 'rawDataCollector')
00214 

def confdb::HLTProcess::getPathList (   self)

Definition at line 76 of file confdb.py.

00077                        :
00078     cmdline = 'edmConfigFromDB --cff %s --noedsources --noes --noservices --nosequences --nomodules' % self._build_query()
00079     data = _pipe(cmdline)
00080     if 'Exhausted Resultset' in data or 'CONFIG_NOT_FOUND' in data:
00081       raise ImportError('%s is not a valid HLT menu' % self.config.menuConfig.value)
00082     filter = re.compile(r' *= *cms.(End)?Path.*')
00083     paths  = [ filter.sub('', line) for line in data.splitlines() if filter.search(line) ]
00084     return paths
00085 

def confdb::HLTProcess::getRawConfigurationFromDB (   self)

Definition at line 68 of file confdb.py.

00069                                      :
00070     cmdline = self._build_cmdline()
00071     data = _pipe(cmdline)
00072     if 'Exhausted Resultset' in data or 'CONFIG_NOT_FOUND' in data:
00073       raise ImportError('%s is not a valid HLT menu' % self.config.menuConfig.value)
00074     self.data = data
00075 

def confdb::HLTProcess::instrumentOpenMode (   self)

Definition at line 255 of file confdb.py.

00256                               :
00257     if self.config.open:
00258       # find all EDfilters
00259       filters = [ match[1] for match in re.findall(r'(process\.)?\b(\w+) = cms.EDFilter', self.data) ]
00260       # wrap all EDfilters with "cms.ignore( ... )"
00261       re_filters  = re.compile( r'\b((process\.)?(' + r'|'.join(filters) + r'))\b' )
00262       re_sequence = re.compile( r'cms\.(Path|Sequence)\((.*)\)' )
00263       self.data = re_sequence.sub( lambda line: re_filters.sub( r'cms.ignore( \1 )', line.group(0) ), self.data )
00264 

def confdb::HLTProcess::instrumentTiming (   self)

Definition at line 404 of file confdb.py.

00405                             :
00406     if self.config.timing:
00407       # instrument the menu with the modules and EndPath needed for timing studies
00408       text = ''
00409 
00410       if 'HLTriggerFirstPath' in self.data:
00411         # remove HLTriggerFirstPath
00412         self.data = re.sub(r'.*\bHLTriggerFirstPath\s*=.*\n', '', self.data)
00413 
00414       if not 'hltGetRaw' in self.data:
00415         # add hltGetRaw
00416         text += """
00417 %%(process)shltGetRaw = cms.EDAnalyzer( "HLTGetRaw",
00418     RawDataCollection = cms.InputTag( "%s" )
00419 )
00420 """ % ( self.config.data and 'source' or 'rawDataCollector' )
00421 
00422       if not 'hltGetConditions' in self.data:
00423         # add hltGetConditions
00424         text += """
00425 %(process)shltGetConditions = cms.EDAnalyzer( 'EventSetupRecordDataGetter',
00426     verbose = cms.untracked.bool( False ),
00427     toGet = cms.VPSet( )
00428 )
00429 """
00430 
00431       # add the definition of HLTriggerFirstPath
00432       text += """
00433 %(process)sHLTriggerFirstPath = cms.Path( %(process)shltGetRaw + %(process)shltGetConditions + %(process)shltBoolFalse )
00434 """
00435       self.data = re.sub(r'.*cms\.(End)?Path.*', text + r'\g<0>', self.data, 1)
00436 
00437       self.data += """
00438 # instrument the menu with the modules and EndPath needed for timing studies
00439 %(process)sPathTimerService = cms.Service( "PathTimerService",
00440 )
00441 %(process)shltTimer = cms.EDProducer( "PathTimerInserter",
00442 )
00443 %(process)shltOutputTiming = cms.OutputModule( "PoolOutputModule",
00444     fileName = cms.untracked.string( "outputTiming.root" ),
00445     fastCloning = cms.untracked.bool( False ),
00446     splitLevel = cms.untracked.int32( 0 ),
00447     dataset = cms.untracked.PSet(
00448         dataTier = cms.untracked.string( 'RECO' ),
00449         filterName = cms.untracked.string( '' )
00450     ),
00451     outputCommands = cms.untracked.vstring( 'drop *',
00452       'keep HLTPerformanceInfo_*_*_*' )
00453 )
00454 
00455 %(process)sTimingOutput = cms.EndPath( %(process)shltTimer + %(process)shltOutputTiming )
00456 """
00457       self.loadAdditionalConditions('add XML geometry to keep hltGetConditions happy',
00458         {
00459           'record'  : 'GeometryFileRcd',
00460           'tag'     : 'XMLFILE_Geometry_380V3_Ideal_mc',
00461           'label'   : 'Ideal',
00462           'connect' : '%(connect)s/CMS_COND_34X_GEOMETRY'
00463         }, {
00464           'record'  : 'GeometryFileRcd',
00465           'tag'     : 'XMLFILE_Geometry_380V3_Extended_mc',
00466           'label'   : 'Extended',
00467           'connect' : '%(connect)s/CMS_COND_34X_GEOMETRY'
00468         }
00469       )
00470 

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

Definition at line 387 of file confdb.py.

00388                                                           :
00389     # load additional conditions
00390     self.data += """
00391 # %s
00392 if 'GlobalTag' in %%(dict)s:
00393 """ % comment
00394     for condition in conditions:
00395       self.data += """    %%(process)sGlobalTag.toGet.append(
00396         cms.PSet(
00397             record  = cms.string( '%(record)s' ),
00398             tag     = cms.string( '%(tag)s' ),
00399             label   = cms.untracked.string( '%(label)s' ),
00400             connect = cms.untracked.string( '%(connect)s' )
00401         )
00402     )
00403 """ % condition

def confdb::HLTProcess::overrideGlobalTag (   self)

Definition at line 265 of file confdb.py.

00266                              :
00267     # overwrite GlobalTag
00268     # the logic is:
00269     #   - for running online, do nothing, unless a globaltag has been specified on the command line
00270     #   - for running offline on data, only add the pfnPrefix
00271     #   - for running offline on mc, take the GT from the command line of the configuration.type
00272     #      - if the GT is "auto:...", insert the code to read it from Configuration.PyReleaseValidation.autoCond
00273     text = ''
00274     if self.config.online:
00275       if self.config.globaltag:
00276         # override the GlobalTag
00277         text += """
00278 # override the GlobalTag
00279 if 'GlobalTag' in %%(dict)s:
00280     %%(process)sGlobalTag.globaltag = '%(globaltag)s'
00281 """
00282 
00283     else:
00284       # override the GlobalTag connection string and pfnPrefix
00285       text += """
00286 # override the GlobalTag, connection string and pfnPrefix
00287 if 'GlobalTag' in %%(dict)s:
00288     %%(process)sGlobalTag.connect   = '%%(connect)s/CMS_COND_31X_GLOBALTAG'
00289     %%(process)sGlobalTag.pfnPrefix = cms.untracked.string('%%(connect)s/')
00290 """
00291 
00292       if self.config.data:
00293         # do not override the GlobalTag unless one was specified on the command line
00294         pass
00295       else:
00296         # check if a specific GlobalTag was specified on the command line, or choose one from the configuration.type
00297         if not self.config.globaltag:
00298           if self.config.type in globalTag:
00299             self.config.globaltag = globalTag[self.config.type]
00300           else:
00301             self.config.globaltag = globalTag['GRun']
00302 
00303       # check if the GlobalTag is an autoCond or an explicit tag
00304       if not self.config.globaltag:
00305         # when running on data, do not override the GlobalTag unless one was specified on the command line
00306         pass
00307       elif self.config.globaltag.startswith('auto:'):
00308         self.config.menuGlobalTagAuto = self.config.globaltag[5:]
00309         text += "    from Configuration.PyReleaseValidation.autoCond import autoCond\n"
00310         text += "    %%(process)sGlobalTag.globaltag = autoCond['%(menuGlobalTagAuto)s']\n"
00311       else:
00312         text += "    %%(process)sGlobalTag.globaltag = '%(globaltag)s'\n"
00313 
00314     self.data += text % self.config.__dict__
00315 

def confdb::HLTProcess::overrideL1Menu (   self)

Definition at line 316 of file confdb.py.

00317                           :
00318     # if requested, override the L1 menu from the GlobalTag (using the same connect as the GlobalTag itself)
00319     if self.config.l1.override:
00320       self.config.l1.record = 'L1GtTriggerMenuRcd'
00321       self.config.l1.label  = ''
00322       self.config.l1.tag    = self.config.l1.override
00323       if not self.config.l1.connect:
00324         self.config.l1.connect = '%(connect)s/CMS_COND_31X_L1T'
00325       self.loadAdditionalConditions( 'override the L1 menu', self.config.l1.__dict__ )
00326 

def confdb::HLTProcess::overrideOutput (   self)

Definition at line 327 of file confdb.py.

00328                           :
00329     reOutputModuleDef = re.compile(r'\b(process\.)?hltOutput(\w+) *= *cms\.OutputModule\(.*\n([^)].*\n)*\) *\n')
00330     reOutputModuleRef = re.compile(r' *[+*]? *\b(process\.)?hltOutput(\w+)')    # FIXME this does not cover "hltOutputX + something"
00331     if self.config.output == 'none':
00332       # drop all output modules
00333       self.data = reOutputModuleDef.sub('', self.data)
00334       self.data = reOutputModuleRef.sub('', self.data)
00335 
00336     elif self.config.output == 'minimal':
00337       # drop all output modules except "HLTDQMResults"
00338       repl = lambda match: (match.group(2) == 'HLTDQMResults') and match.group() or ''
00339       self.data = reOutputModuleDef.sub(repl, self.data)
00340       self.data = reOutputModuleRef.sub(repl, self.data)
00341 
00342     # override the "online" ShmStreamConsumer output modules with "offline" PoolOutputModule's
00343     self.data = re.sub(
00344       r'\b(process\.)?hltOutput(\w+) *= *cms\.OutputModule\( *"ShmStreamConsumer" *,',
00345       r'%(process)shltOutput\2 = cms.OutputModule( "PoolOutputModule",\n    fileName = cms.untracked.string( "output\2.root" ),\n    fastCloning = cms.untracked.bool( False ),',
00346       self.data
00347     )
00348 

def confdb::HLTProcess::overrideProcessName (   self)

Definition at line 350 of file confdb.py.

00351                                :
00352     # the following was stolen and adapted from HLTrigger.Configuration.customL1THLT_Options
00353     self.data += """
00354 # override the process name
00355 %%(process)ssetName_('%(name)s')
00356 
00357 # adapt HLT modules to the correct process name
00358 if 'hltTrigReport' in %%(dict)s:
00359     %%(process)shltTrigReport.HLTriggerResults       = cms.InputTag( 'TriggerResults', '', '%(name)s' )
00360 
00361 if 'hltDQMHLTScalers' in %%(dict)s:
00362     %%(process)shltDQMHLTScalers.triggerResults      = cms.InputTag( 'TriggerResults', '', '%(name)s' )
00363 
00364 if 'hltPreExpressSmart' in %%(dict)s:
00365     %%(process)shltPreExpressSmart.TriggerResultsTag = cms.InputTag( 'TriggerResults', '', '%(name)s' )
00366 
00367 if 'hltPreHLTMONSmart' in %%(dict)s:
00368     %%(process)shltPreHLTMONSmart.TriggerResultsTag  = cms.InputTag( 'TriggerResults', '', '%(name)s' )
00369 
00370 if 'hltPreDQMSmart' in %%(dict)s:
00371     %%(process)shltPreDQMSmart.TriggerResultsTag     = cms.InputTag( 'TriggerResults', '', '%(name)s' )
00372 
00373 if 'hltDQML1SeedLogicScalers' in %%(dict)s:
00374     %%(process)shltDQML1SeedLogicScalers.processname = '%(name)s'
00375 """ % self.config.__dict__
00376 

def confdb::HLTProcess::unprescale (   self)

Definition at line 244 of file confdb.py.

00245                       :
00246     if self.config.unprescale:
00247       self.data += """
00248 # remove the HLT prescales
00249 if 'PrescaleService' in %(dict)s:
00250     %(process)sPrescaleService.lvl1DefaultLabel = cms.untracked.string( '0' )
00251     %(process)sPrescaleService.lvl1Labels = cms.vstring( '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' )
00252     %(process)sPrescaleService.prescaleTable = cms.VPSet( )
00253 """
00254 

def confdb::HLTProcess::updateMessageLogger (   self)

Definition at line 377 of file confdb.py.

00378                                :
00379     # request summary informations from the MessageLogger
00380     self.data += """
00381 if 'MessageLogger' in %(dict)s:
00382     %(process)sMessageLogger.categories.append('TriggerSummaryProducerAOD')
00383     %(process)sMessageLogger.categories.append('L1GtTrigReport')
00384     %(process)sMessageLogger.categories.append('HLTrigReport')
00385 """
00386 


Member Data Documentation

Definition at line 10 of file confdb.py.

Definition at line 10 of file confdb.py.

Definition at line 10 of file confdb.py.

Definition at line 10 of file confdb.py.

Definition at line 10 of file confdb.py.