def retrieveAODList(): from JetRec.JetRecFlags import jetFlags, JetContentDetail from RecExConfig.RecFlags import rec if rec.doWriteESD(): return jetFlags.jetAODList() # then we are merging or doing a AOD ? # We can not simply copy what we have from input since some # jobs starts from empty files. See ATEAM-191. # We hard code the list here while waiting for a more robust solution l = [ # event shape objects 'xAOD::EventShape#Kt4EMPFlowEventShape', 'xAOD::EventShapeAuxInfo#Kt4EMPFlowEventShapeAux.', 'xAOD::EventShape#Kt4EMTopoOriginEventShape', 'xAOD::EventShapeAuxInfo#Kt4EMTopoOriginEventShapeAux.', 'xAOD::EventShape#Kt4LCTopoOriginEventShape', 'xAOD::EventShapeAuxInfo#Kt4LCTopoOriginEventShapeAux.', 'xAOD::EventShape#Kt4EMTopoEventShape', 'xAOD::EventShapeAuxInfo#Kt4EMTopoEventShapeAux.', 'xAOD::EventShape#Kt4LCTopoEventShape', 'xAOD::EventShapeAuxInfo#Kt4LCTopoEventShapeAux.', 'xAOD::EventShape#NeutralParticleFlowIsoCentralEventShape', 'xAOD::EventShapeAuxInfo#NeutralParticleFlowIsoCentralEventShapeAux.', 'xAOD::EventShape#NeutralParticleFlowIsoForwardEventShape', 'xAOD::EventShapeAuxInfo#NeutralParticleFlowIsoForwardEventShapeAux.', 'xAOD::EventShape#ParticleFlowIsoCentralEventShape', 'xAOD::EventShapeAuxInfo#ParticleFlowIsoCentralEventShapeAux.', 'xAOD::EventShape#ParticleFlowIsoForwardEventShape', 'xAOD::EventShapeAuxInfo#ParticleFlowIsoForwardEventShapeAux.', 'xAOD::EventShape#TopoClusterIsoCentralEventShape', 'xAOD::EventShapeAuxInfo#TopoClusterIsoCentralEventShapeAux.', 'xAOD::EventShape#TopoClusterIsoForwardEventShape', 'xAOD::EventShapeAuxInfo#TopoClusterIsoForwardEventShapeAux.', 'xAOD::PFOContainer#CHSChargedParticleFlowObjects', 'xAOD::ShallowAuxContainer#CHSChargedParticleFlowObjectsAux.', 'xAOD::PFOContainer#CHSNeutralParticleFlowObjects', 'xAOD::ShallowAuxContainer#CHSNeutralParticleFlowObjectsAux.', 'xAOD::JetContainer#AntiKt4EMPFlowJets', 'xAOD::JetAuxContainer#AntiKt4EMPFlowJetsAux.', 'xAOD::JetContainer#AntiKt4EMTopoJets', 'xAOD::JetAuxContainer#AntiKt4EMTopoJetsAux.', 'xAOD::JetContainer#AntiKt4LCTopoJets', 'xAOD::JetAuxContainer#AntiKt4LCTopoJetsAux.', ] if jetFlags.detailLevel()>=JetContentDetail.Full: l += [ 'xAOD::JetContainer#AntiKt10LCTopoJets', 'xAOD::JetAuxContainer#AntiKt10LCTopoJetsAux.', 'xAOD::JetContainer#AntiKt2PV0TrackJets', 'xAOD::JetAuxContainer#AntiKt2PV0TrackJetsAux.', 'xAOD::JetContainer#AntiKt4PV0TrackJets', 'xAOD::JetAuxContainer#AntiKt4PV0TrackJetsAux.', # 'xAOD::CaloClusterContainer#EMOriginTopoClusters', 'xAOD::ShallowAuxContainer#EMOriginTopoClustersAux.', 'xAOD::CaloClusterContainer#LCOriginTopoClusters' , 'xAOD::ShallowAuxContainer#LCOriginTopoClustersAux.', ] if rec.doTruth(): l += [ 'xAOD::JetContainer#AntiKt10TruthJets', 'xAOD::JetAuxContainer#AntiKt10TruthJetsAux.', 'xAOD::JetContainer#AntiKt10TruthWZJets', 'xAOD::JetAuxContainer#AntiKt10TruthWZJetsAux.', 'xAOD::JetContainer#AntiKt4TruthJets', 'xAOD::JetAuxContainer#AntiKt4TruthJetsAux.', 'xAOD::JetContainer#AntiKt4TruthWZJets', 'xAOD::JetAuxContainer#AntiKt4TruthWZJetsAux.', 'xAOD::JetContainer#CamKt12TruthJets', 'xAOD::JetAuxContainer#CamKt12TruthJetsAux.', 'xAOD::JetContainer#CamKt12TruthWZJets', 'xAOD::JetAuxContainer#CamKt12TruthWZJetsAux.', ] if jetFlags.detailLevel()>=JetContentDetail.Validation: l += [ 'xAOD::JetContainer#AntiKt10LCTopoTrimmedPtFrac5SmallR20Jets', 'xAOD::JetAuxContainer#AntiKt10LCTopoTrimmedPtFrac5SmallR20JetsAux.', ] return l
def checkInput(self): self.checkFileMetaData() log = logging.getLogger( "TriggerConfigGetter.py" ) if "ReadPool" in self._environment or "WritePool" in self._environment: log.info("Flags are ignored, since 'ReadPool' or 'WritePool' is specified") return True if rec.readESD() or rec.readAOD(): # and globalflags.DataSource()=='data': # need this for MC as well protectedInclude("TriggerJobOpts/TriggerConfigCheckMetadata.py") if rec.readRDO() and globalflags.InputFormat()=='bytestream' and globalflags.DataSource()=='data' and TriggerFlags.configForStartup()!='HLToffline': protectedInclude("TriggerJobOpts/TriggerConfigCheckHLTpsk.py") log.info("The following flags are set:") log.info("globalflags.InputFormat : %s", globalflags.InputFormat()) log.info("rec.read.* : RDO: %s, ESD: %s, AOD: %s, TAG: %s", rec.readRDO(), rec.readESD(), rec.readAOD(), rec.readTAG()) log.info("rec.doWrite.* : ESD: %s, AOD: %s, TAG: %s", rec.doWriteESD(), rec.doWriteAOD(), rec.doWriteTAG()) log.info("globalflags.DataSource : %s", globalflags.DataSource()) log.info("TriggerFlags.configForStartup : %s", TriggerFlags.configForStartup()) log.info("TriggerFlags.dataTakingConditions : %s", TriggerFlags.dataTakingConditions()) log.info("TriggerFlags.configurationSourceList: %s", TriggerFlags.configurationSourceList()) count = len([1 for x in [rec.readRDO(),rec.readESD(),rec.readAOD()] if x ]) #readTAG is only set with another input if count == 0: log.warning("Don't know what the input format is.") return False if count >= 2: log.warning("More than one input format specified, please set only the appropriate one.") return False return True
def TriggerOutputItemListESD(): from RecExConfig.RecFlags import rec from AthenaCommon.Logging import logging log = logging.getLogger('TriggerOutputItemList_joboptions') log.error( "this file is deprecated by the Object Key Store and should no longer be used" ) if rec.doWriteESD(): print "TriggerESDList: " print TriggerESDList
def configure(self): log = logging.getLogger("TrigDecisionGetterRun2") from AthenaCommon.AlgSequence import AlgSequence topSequence = AlgSequence() #if hasOnlyLVL1: #from RecExConfig.ObjKeyStore import objKeyStore #objKeyStore.addStreamESD('TrigDec::TrigDecision','TrigDecision') #objKeyStore.addStreamAOD('TrigDec::TrigDecision','TrigDecision') from RecExConfig.RecFlags import rec if ( rec.doWriteESD() or rec.doWriteAOD() or rec.doESD() or rec.doAOD() ) and \ ( not ( rec.readAOD() or rec.readESD() or rec.doWriteBS()) ): log.info("Will write TrigDecision object to storegate") from TrigDecisionMaker.TrigDecisionMakerConfig import WriteTrigDecision trigDecWriter = WriteTrigDecision() # noqa: F841 # WritexAODTrigDecision() is called within WriteTrigDecision() # inform TD maker that some parts may be missing if TriggerFlags.dataTakingConditions() == 'Lvl1Only': topSequence.TrigDecMaker.doL2 = False topSequence.TrigDecMaker.doEF = False topSequence.TrigDecMaker.doHLT = False topSequence.TrigNavigationCnvAlg.doL2 = False topSequence.TrigNavigationCnvAlg.doEF = False topSequence.TrigNavigationCnvAlg.doHLT = False elif TriggerFlags.dataTakingConditions() == 'HltOnly': from AthenaCommon.AlgSequence import AlgSequence topSequence.TrigDecMaker.doL1 = False # Decide based on the doMergedHLTResult to assume a merged, or a # split HLT: if not TriggerFlags.doMergedHLTResult(): topSequence.TrigDecMaker.doHLT = False topSequence.TrigNavigationCnvAlg.doL2 = False topSequence.TrigNavigationCnvAlg.doHLT = False else: topSequence.TrigDecMaker.doL2 = False topSequence.TrigDecMaker.doEF = False topSequence.TrigNavigationCnvAlg.doL2 = False topSequence.TrigNavigationCnvAlg.doEF = False pass else: log.info("Will not write TrigDecision object to storegate") return True
from AthenaCommon.AthenaCommonFlags import athenaCommonFlags if not athenaCommonFlags.PoolRDOInput.isDefault(): athenaCommonFlags.FilesInput = athenaCommonFlags.PoolRDOInput() elif not athenaCommonFlags.PoolESDInput.isDefault(): athenaCommonFlags.FilesInput = athenaCommonFlags.PoolESDInput() from RecExConfig.RecFlags import rec # --- Set output level threshold (2=DEBUG, 3=INFO, 4=WARNING, 5=ERROR, 6=FATAL ) OutputLevel = INFO # --- produce an atlantis data file doJiveXML = False # --- run the Virtual Point 1 event visualisation doVP1 = False # --- controls what is written out. ESD includes AOD, so it's normally enough doWriteESD = rec.doWriteESD() doWriteAOD = rec.doWriteAOD() # --- read BS - please look at the default input file(s) to know the det descr and cond tag doReadBS = False # --- do auditors ? doAuditors = True if os.environ['CMTCONFIG'].endswith('-dbg'): # --- do EDM monitor (debug mode only) doEdmMonitor = True # --- write out a short message upon entering or leaving each algorithm doNameAuditor = True else: doEdmMonitor = False doNameAuditor = False
# # --- Only do for RAW-ESD stage # from RecExConfig.RecFlags import rec if rec.doWriteESD() or rec.doWriteAOD() or ( 'doWriteESD' in dir() and doWriteESD ) or ('doWriteAOD' in dir() and doWriteAOD) or InDetFlags.doTrkNtuple() or InDetFlags.doTrkD3PD(): # --- fix primary vertex finder bug printfunc('===> OVERWRITTEN TOOL SETTINGS ................') InDetPriVxFinderTool.maxVertices = 200 printfunc(InDetPriVxFinderTool) printfunc('===> OVERWRITTEN TOOL SETTINGS ................') # --- fix vertexing setup for selection printfunc('===> OVERWRITTEN TOOL SETTINGS ................') from TrkVertexWeightCalculators.TrkVertexWeightCalculatorsConf import Trk__TrueVertexDistanceWeightCalculator VertexWeightCalculator = Trk__TrueVertexDistanceWeightCalculator( name="InDetTrueVertexDistanceWeightCalculator", McTruthCollection=InDetKeys.McEventCollection()) ToolSvc += VertexWeightCalculator printfunc(VertexWeightCalculator) printfunc('===> OVERWRITTEN TOOL SETTINGS ................') printfunc('===> OVERWRITTEN TOOL SETTINGS ................') VertexCollectionSortingTool.VertexWeightCalculator = VertexWeightCalculator printfunc(VertexCollectionSortingTool) printfunc('===> OVERWRITTEN TOOL SETTINGS ................') # --- fix vertexing smoother setup
#FIXME: Subsequent algorithms may alter the event info object (setting Error bits) if not objKeyStore.isInInput( "xAOD::EventInfo"): from xAODEventInfoCnv.xAODEventInfoCreator import xAODMaker__EventInfoCnvAlg topSequence+=xAODMaker__EventInfoCnvAlg() pass ################################################################### # # functionality : monitor memory and cpu time # # #now write out Transient Event Store content in POOL if rec.doWriteESD() or rec.doWriteAOD() or rec.doWriteRDO() or rec.doWriteTAG(): import AthenaPoolCnvSvc.WriteAthenaPool # Must make sure that no OutStream's have been declared #FIXME theApp.OutStream = [] MetaDataStore=svcMgr.MetaDataStore #Lumiblocks and EventBookkeepers if rec.doFileMetaData():
def configure(self): log = logging.getLogger("HLTTriggerResultGetter.py") from RecExConfig.ObjKeyStore import objKeyStore # set EDMDecodingVersion EDMDecodingVersion() # Set AODFULL for data unless it was set explicitly already if TriggerFlags.AODEDMSet.isDefault() and globalflags.DataSource( ) == 'data': TriggerFlags.AODEDMSet = 'AODFULL' from AthenaCommon.AlgSequence import AlgSequence topSequence = AlgSequence() log.info("BS unpacking (TF.readBS): %d", TriggerFlags.readBS()) if TriggerFlags.readBS(): if TriggerFlags.EDMDecodingVersion() <= 2: bs = ByteStreamUnpackGetterRun2() # noqa: F841 else: bs = ByteStreamUnpackGetter() # noqa: F841 xAODContainers = {} # if not recAlgs.doTrigger(): #only convert when running on old data if TriggerFlags.EDMDecodingVersion() == 1: xaodcnvrt = xAODConversionGetter() xAODContainers = xaodcnvrt.xaodlist if recAlgs.doTrigger() or TriggerFlags.doTriggerConfigOnly(): if TriggerFlags.EDMDecodingVersion() <= 2: tdt = TrigDecisionGetterRun2() # noqa: F841 else: tdt = TrigDecisionGetter() # noqa: F841 # Temporary hack to add Run-3 navigation to ESD and AOD if (rec.doESD() or rec.doAOD()) and TriggerFlags.EDMDecodingVersion() == 3: # The hack with wildcards is needed for BS->ESD because we don't know the exact keys # of HLT navigation containers before unpacking them from the BS event. objKeyStore._store['streamESD'].allowWildCard(True) objKeyStore._store['streamAOD'].allowWildCard(True) objKeyStore.addManyTypesStreamESD([ 'xAOD::TrigCompositeContainer#HLTNav*', 'xAOD::TrigCompositeAuxContainer#HLTNav*' ]) objKeyStore.addManyTypesStreamAOD([ 'xAOD::TrigCompositeContainer#HLTNav*', 'xAOD::TrigCompositeAuxContainer#HLTNav*' ]) # TrigJetRec additions if rec.doWriteESD(): objKeyStore.addStreamESD("JetKeyDescriptor", "JetKeyMap") objKeyStore.addStreamESD("JetMomentMap", "TrigJetRecMomentMap") if rec.doWriteAOD(): objKeyStore.addStreamAOD("JetKeyDescriptor", "JetKeyMap") objKeyStore.addStreamAOD("JetMomentMap", "TrigJetRecMomentMap") # ID truth if not rec.readESD() and (not rec.readAOD()) and TriggerFlags.doID() \ and rec.doTruth(): try: from TrigInDetTruthAlgs.TrigInDetTruthAlgsConfig import \ TrigIDTruthMaker topSequence += TrigIDTruthMaker() except Exception: log.warning("Couldn't set up the trigger ID truth maker") pass if rec.doESD() or rec.doAOD(): from TrigEDMConfig.TriggerEDM import getTrigIDTruthList objKeyStore.addManyTypesStreamESD( getTrigIDTruthList(TriggerFlags.ESDEDMSet())) objKeyStore.addManyTypesStreamAOD( getTrigIDTruthList(TriggerFlags.AODEDMSet())) if (rec.doESD() or rec.doAOD()) and TriggerFlags.writeL1TopoValData(): objKeyStore.addManyTypesStreamESD([ 'xAOD::TrigCompositeContainer#HLT_xAOD__TrigCompositeContainer_L1TopoValData', 'xAOD::TrigCompositeAuxContainer#HLT_xAOD__TrigCompositeContainer_L1TopoValDataAux.' ]) objKeyStore.addManyTypesStreamAOD([ 'xAOD::TrigCompositeContainer#HLT_xAOD__TrigCompositeContainer_L1TopoValData', 'xAOD::TrigCompositeAuxContainer#HLT_xAOD__TrigCompositeContainer_L1TopoValDataAux.' ]) log.debug( "HLT_xAOD__TrigCompositeContainer_L1TopoValData(Aux.) for L1Topo validation added to the data." ) if rec.doAOD() or rec.doWriteAOD(): # schedule the RoiDescriptorStore conversion # log.warning( "HLTTriggerResultGetter - setting up RoiWriter" ) roiWriter = RoiWriter() # Add fictional input to ensure data dependency in AthenaMT roiWriter.ExtraInputs += [("TrigBSExtractionOutput", "StoreGateSvc+TrigBSExtractionOutput")] topSequence += roiWriter # write out the RoiDescriptorStores from TrigEDMConfig.TriggerEDMRun2 import TriggerRoiList objKeyStore.addManyTypesStreamAOD(TriggerRoiList) #Are we adding operational info objects in ESD? added = self._AddOPIToESD() if added: log.debug( "Operational Info object HLT_EXPRESS_OPI_HLT with extra information about express stream prescaling added to the data." ) # ESD objects definitions _TriggerESDList = {} from TrigEDMConfig.TriggerEDM import getTriggerEDMList # we have to store xAOD containers in the root file, NOT AOD, # if the xAOD container list is not empty if (xAODContainers): _TriggerESDList.update(xAODContainers) else: _TriggerESDList.update( getTriggerEDMList(TriggerFlags.ESDEDMSet(), TriggerFlags.EDMDecodingVersion())) log.info( "ESD content set according to the ESDEDMSet flag: %s and EDM version %d", TriggerFlags.ESDEDMSet(), TriggerFlags.EDMDecodingVersion()) # AOD objects choice _TriggerAODList = {} #from TrigEDMConfig.TriggerEDM import getAODList _TriggerAODList.update( getTriggerEDMList(TriggerFlags.AODEDMSet(), TriggerFlags.EDMDecodingVersion())) log.info( "AOD content set according to the AODEDMSet flag: %s and EDM version %d", TriggerFlags.AODEDMSet(), TriggerFlags.EDMDecodingVersion()) log.debug("ESD EDM list: %s", _TriggerESDList) log.debug("AOD EDM list: %s", _TriggerAODList) # Highlight what is in AOD list but not in ESD list, as this can cause # the "different number of entries in branch" problem, when it is in the # AOD list but the empty container per event is not created # Just compares keys of dicts, which are the class names, not their string keys in StoreGate not_in = [ element for element in _TriggerAODList if element not in _TriggerESDList ] if (len(not_in) > 0): log.warning("In AOD list but not in ESD list: ") log.warning(not_in) else: log.info("AOD list is subset of ESD list - good.") def _addSlimming(stream, edm): from TrigNavTools.TrigNavToolsConfig import navigationThinningSvc edmlist = list(y.split('-')[0] for x in edm.values() for y in x) #flatten names svc = navigationThinningSvc({ 'name': 'HLTNav_%s' % stream, 'mode': 'cleanup', 'result': 'HLTResult_HLT', 'features': edmlist }) from OutputStreamAthenaPool.CreateOutputStreams import registerTrigNavThinningSvc registerTrigNavThinningSvc(stream, svc) log.info("Configured slimming of HLT for %s", stream) print(svc) # noqa: ATL901 del edmlist if TriggerFlags.doNavigationSlimming() and rec.readRDO( ) and rec.doWriteAOD(): _addSlimming('StreamAOD', _TriggerESDList) #Use ESD item list also for AOD! log.info("configured navigation slimming for AOD output") if TriggerFlags.doNavigationSlimming() and rec.readRDO( ) and rec.doWriteESD(): _addSlimming('StreamESD', _TriggerESDList) log.info("configured navigation slimming for ESD output") objKeyStore.addManyTypesStreamESD(_TriggerESDList) objKeyStore.addManyTypesStreamAOD(_TriggerAODList) return True
FTK_RDO_Reader.GetRefitTrackParticles=True if (jobproperties.Beam.beamType() == 'cosmics'): FTK_RDO_Reader.GetVertex=False FTK_RDO_Reader.GetRefitVertex=False else: FTK_RDO_Reader.GetVertex=True FTK_RDO_Reader.GetRefitVertex=True FTK_RDO_Reader.GetTruthVertex=False from AthenaCommon.AlgSequence import AlgSequence alg = AlgSequence() alg += FTK_RDO_Reader if rec.doTruth() and (rec.doWriteAOD() or rec.doWriteESD()): include ('FTK_RecExample/ConfiguredFTK_TrackTruth.py') FTK_TracksTruth = ConfiguredFTK_TrackTruth(Tracks="FTK_TrackCollection", TracksTruth = "FTK_Tracks_TruthCollection", DetailedTruth = "FTK_Tracks_DetailedTruthCollection") FTK_RefitTracksTruth = ConfiguredFTK_TrackTruth(Tracks="FTK_TrackCollectionRefit", TracksTruth = "FTK_RefitTracks_TruthCollection", DetailedTruth = "FTK_RefitTracks_DetailedTruthCollection") from xAODTrackingCnv.xAODTrackingCnvConf import xAODMaker__TrackParticleCnvAlg FTKTrackParticleCnvAlg = xAODMaker__TrackParticleCnvAlg("FTKTrackParticleCnvAlg") FTKTrackParticleCnvAlg.xAODTrackParticlesFromTracksContainerName = "Converted_FTKTrackParticleContainer" FTKTrackParticleCnvAlg.TrackContainerName = "FTK_TrackCollection" FTKTrackParticleCnvAlg.ConvertTrackParticles = False FTKTrackParticleCnvAlg.ConvertTracks = True FTKTrackParticleCnvAlg.AddTruthLink = True
from AthenaCommon.DetFlags import DetFlags from RecExConfig.RecFlags import rec from MuonRecExample.MuonRecFlags import muonRecFlags from AthenaCommon.BeamFlags import jobproperties from AtlasGeoModel.MuonGMJobProperties import MuonGeometryFlags #AOD list, also added to the ESD MuonAODList = [] if DetFlags.detdescr.Muon_on() and (rec.doWriteAOD() or rec.doWriteESD()): # Segments MuonAODList += ["xAOD::MuonSegmentContainer#MuonSegments"] MuonAODList += ["xAOD::MuonSegmentAuxContainer#MuonSegmentsAux."] MuonAODList += ["xAOD::MuonSegmentContainer#NCB_MuonSegments"] MuonAODList += ["xAOD::MuonSegmentAuxContainer#NCB_MuonSegmentsAux."] # TrackParticles MuonAODList += [ "xAOD::TrackParticleContainer#MuonSpectrometerTrackParticles" ] MuonAODList += [ "xAOD::TrackParticleAuxContainer#MuonSpectrometerTrackParticlesAux." ] MuonAODList += [ "xAOD::TrackParticleContainer#MuonSpectrometerOnlyTrackParticles" ] MuonAODList += [ "xAOD::TrackParticleAuxContainer#MuonSpectrometerOnlyTrackParticlesAux."
# NOTE: Old way to retrieve configuration: #addRingerInputMetaToList( l, outputRingSetConfType() ) #addRingerInputMetaToList( l, outputRingSetConfAuxType() ) # NOTE: New way from PyUtils.MetaReaderPeeker import convert_metadata_items, metadata metaItemDict = convert_metadata_items(layout='dict') if any(['RingSetConf' in key for key in metaItemDict]): l.append('%s#*' % outputRingSetConfType()) l.append('%s#*' % outputRingSetConfAuxType()) # Add itens into lists if (rec.doWriteAOD() or rec.doWriteESD()) and caloRingerFlags.doWriteRingsToFile(): # Get instance to the builder: CRBuilder = CaloRingerAlgorithmBuilder() # Get instance to the metadata builder: CRMetaBuilder = CaloRingerMetaDataBuilder(disable=True) if CRBuilder.usable(): for cType, cKeys in CRBuilder.output().items(): for cKey in cKeys: for dictKey, value in CaloRingerKeysDict.outputs.items(): if value[0] == cType: auxOption = CaloRingerKeysDict.outputs[dictKey][2] addOutputToList(caloRingerAODList, cType, cKey, auxOption) mlog.debug( "Added container with type/key %s/%s to StoreGateSvc",
def sync_DetFlags(self,technologies="MDT,RPC,CSC,TGC,sTGC,Micromegas"): self.setDefaults() global rec from AthenaCommon.DetFlags import DetFlags # if Muons off, then do nothing if not DetFlags.Muon_on() or not rec.doMuon(): return flagsOn = [] flagsOff = [ 'readRIOBS' ] # we don't store RIO (=PRD) on bytestream ??? # Reading RDO if rec.readRDO(): if muonRecFlags.makePRDs(): flagsOn.append( 'makeRIO' ) else: flagsOff.append( 'makeRIO' ) if globalflags.InputFormat == 'pool' : flagsOn.append( 'readRDOPool' ) flagsOff.append( 'readRDOBS' ) elif globalflags.InputFormat == 'bytestream': flagsOn.append( 'readRDOBS' ) flagsOff.append( 'readRDOPool' ) else: # not reading RDO flagsOff.append( 'makeRIO' ) # Reading ESD if rec.readESD(): flagsOn.append( 'readRIOPool' ) else: flagsOff.append( 'readRIOPool' ) # Writing RDO Pool if rec.doWriteRDO(): flagsOn.append( 'writeRDOPool' ) else: flagsOff.append( 'writeRDOPool' ) # Writing RDO bystream if rec.doWriteBS() : flagsOn.append( 'writeBS' ) else: flagsOff.append( 'writeBS' ) # Writing ESD if rec.doWriteESD(): flagsOn.append( 'writeRIOPool' ) else: flagsOff.append( 'writeRIOPool' ) # Digitization on-the-fly if self.doDigitization(): flagsOn.append( 'digitize' ) try: flagsOn.remove( 'readRDOPool' ) except ValueError: # not in list pass try: flagsOn.remove( 'readRDOBS' ) except ValueError: # not in list pass flagsOff.append( 'readRDOPool' ) flagsOff.append( 'readRDOBS' ) # very special case for normal Rome production (inspired by RecExCommon_DetFlags.py) if 'readRIOPool' not in flagsOn: flagsOn.append( 'readRIOPool' ) try: flagsOff.remove( 'readRIOPool' ) except ValueError: # not in list pass if not rec.doWriteRDO() and 'makeRIO' not in flagsOn: flagsOn.append( 'makeRIO' ) try: flagsOff.remove( 'makeRIO' ) except ValueError: #not in list pass else: flagsOff.append( 'digitize') # do sync per technology for selected flags MDT_on = self.doMDTs() RPC_on = self.doRPCs() CSC_on = self.doCSCs() TGC_on = self.doTGCs() sTGC_on = self.dosTGCs() Micromegas_on = self.doMicromegas() techList = technologies.split(',') for f in flagsOn: for tech in techList: setOn = eval(tech+'_on') isOn = eval("DetFlags.%s.%s_on()" % (f,tech)) if setOn: if not isOn: cmd = "DetFlags.%s.%s_setOn()" % (f,tech) logMuon.info(cmd) exec(cmd) else: # set off if isOn: cmd = "DetFlags.%s.%s_setOff()" % (f,tech) logMuon.info(cmd) exec(cmd) # Turn off Muon flags (row in DetFlags printout) for f in flagsOff: isOn = eval("DetFlags.%s.Muon_on()" % f) if isOn: cmd = "DetFlags.%s.Muon_setOff()" % f logMuon.info(cmd) exec(cmd)
def setDefaults(self): global globalflags from MuonRecExample.MuonRecUtils import setJobPropertyDefault as setDefault # as long as rec.Commissioning is alive, sync the default to it # in case of BS->RDO, RDO->RDO, RDO->BS, BS->BS: don't run RIO (i.e RDO->PRD) setDefault(self.makePRDs, rec.readRDO() and not rec.doWriteRDO() and not rec.doWriteBS()) setDefault(self.doStandalone,True) setDefault(self.doDigitization,False) setDefault(self.doCalib,False) setDefault(self.applyResilience,athenaCommonFlags.AllowIgnoreConfigError()) setDefault(self.doSegmentsOnly,False) setDefault(self.doMDTs,True) setDefault(self.doRPCs,True) setDefault(self.doTGCs,True) setDefault(self.doCSCs,True) setDefault(self.dosTGCs,True) setDefault(self.doMicromegas,True) setDefault(self.doMSVertex,True) setDefault(self.useWireSagCorrections,False) setDefault(self.enableErrorTuning,True) setDefault(self.useLooseErrorTuning,False) setDefault(self.useAlignmentCorrections,DetFlags.detdescr.Muon_on() and rec.doMuon()) setDefault(self.writeSDOs, rec.doWriteESD() and globalflags.DataSource != 'data') setDefault(self.useTGCPriorNextBC,True) setDefault(self.doMuonIso,True) if beamFlags.beamType == 'cosmics' or beamFlags.beamType == 'singlebeam': setDefault(self.doSegmentT0Fit,True) else: setDefault(self.doSegmentT0Fit,False) setDefault(self.doPrdSelect,False) # Default for MuonCalibration ntuple setDefault(self.calibMuonStandalone, muonRecFlags.doStandalone() or rec.readESD() ) try: from MuonCnvExample.MuonCalibFlags import muonCalibFlags except ImportError: from AthenaCommon.Resilience import treatException treatException("Could not load MuonCalibFlags. Switching off calibration ntuple") self.doCalib = False self.doCalibNtuple = False else: doTracks = self.calibMuonStandalone() # chose a default if not muonCalibFlags.Mode.statusOn: if doTracks: muonCalibFlags.Mode = 'trackNtuple' else: muonCalibFlags.Mode = 'ntuple' if muonCalibFlags.Mode == 'trackNtuple' and doTracks: setDefault(self.doCalibNtuple,self.doCalib()) setDefault(self.calibNtupleSegments,True) setDefault(self.calibNtupleTracks,True) if rec.doTrigger: setDefault(self.calibNtupleTrigger,True) else: setDefault(self.calibNtupleTrigger,False) elif muonCalibFlags.Mode == 'ntuple' or (muonCalibFlags.Mode == 'trackNtuple' and not doTracks): setDefault(self.doCalibNtuple,self.doCalib()) setDefault(self.calibNtupleSegments,True) setDefault(self.calibNtupleTracks,False) if rec.doTrigger: setDefault(self.calibNtupleTrigger,True) else: setDefault(self.calibNtupleTrigger,False) else: setDefault(self.doCalibNtuple,False) setDefault(self.calibNtupleSegments,False) setDefault(self.calibNtupleTracks,False) setDefault(self.calibNtupleTrigger,False)
def configure(self): log = logging.getLogger("HLTTriggerResultGetter.py") from RecExConfig.ObjKeyStore import objKeyStore # set EDMDecodingVersion EDMDecodingVersion() # Set AODFULL for data unless it was set explicitly already if TriggerFlags.AODEDMSet.isDefault() and globalflags.DataSource()=='data': TriggerFlags.AODEDMSet = 'AODFULL' from AthenaCommon.AlgSequence import AlgSequence topSequence = AlgSequence() log.info("BS unpacking (TF.readBS): %d" % TriggerFlags.readBS() ) if TriggerFlags.readBS(): bs = ByteStreamUnpackGetter() xAODContainers = {} # if not recAlgs.doTrigger(): #only convert when running on old data if TriggerFlags.EDMDecodingVersion()==1: xaodcnvrt = xAODConversionGetter() xAODContainers = xaodcnvrt.xaodlist if recAlgs.doTrigger() or TriggerFlags.doTriggerConfigOnly(): tdt = TrigDecisionGetter() # TrigJetRec additions if rec.doWriteESD(): objKeyStore.addStreamESD("JetKeyDescriptor","JetKeyMap") objKeyStore.addStreamESD("JetMomentMap","TrigJetRecMomentMap") if rec.doWriteAOD(): objKeyStore.addStreamAOD("JetKeyDescriptor","JetKeyMap") objKeyStore.addStreamAOD("JetMomentMap","TrigJetRecMomentMap") # ID truth if not rec.readESD() and (not rec.readAOD()) and TriggerFlags.doID() \ and rec.doTruth(): try: from TrigInDetTruthAlgs.TrigInDetTruthAlgsConfig import \ TrigIDTruthMaker topSequence += TrigIDTruthMaker() except Exception: log.warning( "Couldn't set up the trigger ID truth maker" ) pass if rec.doESD() or rec.doAOD(): from TrigEDMConfig.TriggerEDM import getTrigIDTruthList objKeyStore.addManyTypesStreamESD(getTrigIDTruthList(TriggerFlags.ESDEDMSet())) objKeyStore.addManyTypesStreamAOD(getTrigIDTruthList(TriggerFlags.AODEDMSet())) if (rec.doESD() or rec.doAOD()) and TriggerFlags.writeL1TopoValData(): objKeyStore.addManyTypesStreamESD(['xAOD::TrigCompositeContainer#HLT_xAOD__TrigCompositeContainer_L1TopoValData', 'xAOD::TrigCompositeAuxContainer#HLT_xAOD__TrigCompositeContainer_L1TopoValDataAux.']) objKeyStore.addManyTypesStreamAOD(['xAOD::TrigCompositeContainer#HLT_xAOD__TrigCompositeContainer_L1TopoValData', 'xAOD::TrigCompositeAuxContainer#HLT_xAOD__TrigCompositeContainer_L1TopoValDataAux.']) log.debug("HLT_xAOD__TrigCompositeContainer_L1TopoValData(Aux.) for L1Topo validation added to the data.") if rec.doAOD() or rec.doWriteAOD(): # schedule the RoiDescriptorStore conversion # log.warning( "HLTTriggerResultGetter - setting up RoiWriter" ) topSequence += RoiWriter() # write out the RoiDescriptorStores from TrigEDMConfig.TriggerEDM import TriggerRoiList objKeyStore.addManyTypesStreamAOD( TriggerRoiList ) #Are we adding operational info objects in ESD? added=self._AddOPIToESD() if added: log.debug("Operational Info object HLT_EXPRESS_OPI_HLT with extra information about express stream prescaling added to the data.") # ESD objects definitions _TriggerESDList = {} from TrigEDMConfig.TriggerEDM import getTriggerEDMList # we have to store xAOD containers in the root file, NOT AOD, # if the xAOD container list is not empty if(xAODContainers): _TriggerESDList.update( xAODContainers ) else: _TriggerESDList.update( getTriggerEDMList(TriggerFlags.ESDEDMSet(), TriggerFlags.EDMDecodingVersion()) ) log.info("ESD content set according to the ESDEDMSet flag: %s and EDM version %d" % (TriggerFlags.ESDEDMSet() ,TriggerFlags.EDMDecodingVersion()) ) # AOD objects choice _TriggerAODList = {} #from TrigEDMConfig.TriggerEDM import getAODList _TriggerAODList.update( getTriggerEDMList(TriggerFlags.AODEDMSet(), TriggerFlags.EDMDecodingVersion()) ) log.info("AOD content set according to the AODEDMSet flag: %s and EDM version %d" % (TriggerFlags.AODEDMSet(),TriggerFlags.EDMDecodingVersion()) ) log.debug("ESD EDM list: %s", _TriggerESDList) log.debug("AOD EDM list: %s", _TriggerAODList) # Highlight what is in AOD list but not in ESD list, as this can cause # the "different number of entries in branch" problem, when it is in the # AOD list but the empty container per event is not created # Just compares keys of dicts, which are the class names, not their string keys in StoreGate not_in = [ element for element in _TriggerAODList if element not in _TriggerESDList ] if (len(not_in)>0): log.warning("In AOD list but not in ESD list: ") log.warning(not_in) else: log.info("AOD list is subset of ESD list - good.") def _addSlimming(stream, thinningSvc, edm): from AthenaCommon.AlgSequence import AlgSequence topSequence = AlgSequence() from TrigNavTools.TrigNavToolsConf import HLT__StreamTrigNavSlimming, HLT__TrigNavigationSlimming from TrigNavTools.TrigNavToolsConfig import navigationSlimming edmlist = list(y.split('-')[0] for x in edm.values() for y in x) #flatten names # from HLT result drop unrecorded features # slimmerHLT = HLT__StreamTrigNavSlimming('HLTNavSlimmer_%s'%stream) slimmerHLT = HLT__TrigNavigationSlimming('TrigNavigationSlimmer_%s'%stream) tHLT = navigationSlimming({'name':'HLTNav_%s'%stream, 'mode':'cleanup', 'ThinningSvc':thinningSvc, 'result':'HLTResult_HLT', 'features':edmlist}) #tHLT.SlimmingTool.OutputLevel=DEBUG tHLT.ActInPlace=True slimmerHLT.ThinningTool = tHLT print slimmerHLT.ThinningTool topSequence += slimmerHLT log.info("Configured slimming of HLT") del edmlist from AthenaCommon.AppMgr import ServiceMgr as svcMgr from AthenaServices.Configurables import ThinningSvc, createThinningSvc _doSlimming = True if _doSlimming and rec.readRDO() and rec.doWriteAOD(): if not hasattr(svcMgr, 'ThinningSvc'): # if the default is there it is configured for AODs svcMgr += ThinningSvc(name='ThinningSvc', Streams=['StreamAOD']) _addSlimming('StreamAOD', svcMgr.ThinningSvc, _TriggerESDList ) #Use ESD item list also for AOD! log.info("configured navigation slimming for AOD output") if _doSlimming and rec.readRDO() and rec.doWriteESD(): #rec.doWriteESD() and not rec.readESD(): if not hasattr(svcMgr, 'ESDThinningSvc'): svcMgr += ThinningSvc(name='ESDThinningSvc', Streams=['StreamESD']) # the default is configured for AODs _addSlimming('StreamESD', svcMgr.ESDThinningSvc, _TriggerESDList ) log.info("configured navigation slimming for ESD output") objKeyStore.addManyTypesStreamESD( _TriggerESDList ) objKeyStore.addManyTypesStreamAOD( _TriggerAODList ) return True
def configure(self): log = logging.getLogger("TriggerConfigGetter.py") # first check the input if "HIT2RDO" in self._environment: TriggerFlags.doLVL2 = False TriggerFlags.doEF = False log.info("For simulation jobs the following flags are set:") log.info("globalflags.InputFormat : %s" % globalflags.InputFormat()) log.info("globalflags.DataSource : %s" % globalflags.DataSource()) log.info("TriggerFlags.configForStartup : %s" % TriggerFlags.configForStartup()) log.info("TriggerFlags.dataTakingConditions : %s" % TriggerFlags.dataTakingConditions()) log.info("TriggerFlags.doLVL2 : %s" % TriggerFlags.doLVL2()) log.info("TriggerFlags.doEF : %s" % TriggerFlags.doEF()) else: if not self.checkInput(): log.error( "Could not determine job input. Can't setup trigger configuration and will return!" ) return self.readPool = globalflags.InputFormat() == 'pool' self.readRDO = rec.readRDO() self.writeESDAOD = rec.doWriteESD() or rec.doWriteAOD( ) or rec.doWriteDPD() self.ConfigSrcList = TriggerFlags.configurationSourceList() self.readMC = globalflags.DataSource( ) == 'geant3' or globalflags.DataSource() == 'geant4' self.readTriggerDB = TriggerFlags.readMenuFromTriggerDb( ) and self.readRDO self.isCommisioning = globalflags.DataSource( ) == 'data' and globalflags.DetGeo() == 'commis' self.l1Folders = TriggerFlags.dataTakingConditions( ) == 'FullTrigger' or TriggerFlags.dataTakingConditions() == 'Lvl1Only' self.hltFolders = TriggerFlags.dataTakingConditions( ) == 'FullTrigger' or TriggerFlags.dataTakingConditions() == 'HltOnly' self.isRun1Data = False if globalflags.DataSource() == 'data': from RecExConfig.AutoConfiguration import GetRunNumber runNumber = GetRunNumber() if runNumber > 0 and runNumber < 230000: self.isRun1Data = True self.isTriggerReprocessing = False # the TriggerFlags.readMenuFromTriggerDb() tells us that we read the trigger menu from the database # the connection itself is defined in TriggerFlags.triggerDbConnection() # reading from the TriggerDB can mean different things: # a) TriggerFlags doLVL2() and doEF() are both False: # - create a tmp sqlite file with the conditions (menu) # - use DSConfigSvc # b) TriggerFlags doLVL2() or doEF() is True: # - use HLTConfigSvc if self.readTriggerDB and (TriggerFlags.doLVL2() or TriggerFlags.doEF() or TriggerFlags.doHLT()): self.ConfigSrcList = [ 'xml' ] # to use L1/HLTConfigSvc and not DSConfigSvc, but only if we are running the HLT if self._environment: # I don't think anyone calls TriggerConfigGetter with an argument self.readPool = False self.writeESDAOD = False self.readHits = False if "ReadPoolRDO" in self._environment: self.readPool = True self.readRDO = True elif "ReadPool" in self._environment: self.readPool = True self.readRDO = False if "WritePool" in self._environment: self.writeESDAOD = True if "HIT2RDO" in self._environment: self.readRDO = False self.readHits = True # define ConfigSvc if not self.ConfigSrcList: if (self.readPool and not self.readRDO) or ( self.readRDO and not self.readPool): # (ESD, AOD, DPD) or (RDO-BS) self.ConfigSrcList = ['ds'] elif (self.readRDO and self.readPool ) or rec.readTAG() or self.readHits: # (RDO-MC) or TAG self.ConfigSrcList = ['xml'] else: # should not get here: should be found by checkInput log.fatal('no reading of BS, RDO, AOD, ESD, or TAG specified') # we need the temporary COOL database, if we read the configuration from XML and write ESD/AOD (or have 'ds' set for some reason) self.makeTempCool = self.readRDO and \ ( self.writeESDAOD or 'ds' in self.ConfigSrcList ) and \ ( self.readMC \ or (self.isCommisioning and (TriggerFlags.readLVL1configFromXML() and TriggerFlags.readHLTconfigFromXML())) \ or TriggerFlags.readMenuFromTriggerDb() ) log.info("Need to create temporary cool file? : %r" % self.makeTempCool) log.info('Creating the Trigger Configuration Services') self.svc = SetupTrigConfigSvc() #set the merged system #self.svc.doMergedHLT = TriggerFlags.doHLT() if 'xml' in self.ConfigSrcList or self.makeTempCool: # sets them if plain XML reading is to be used self.svc.l1topoXmlFile = TriggerFlags.outputL1TopoConfigFile( ) # generated in python self.svc.l1XmlFile = TriggerFlags.outputLVL1configFile( ) # generated in python self.svc.hltXmlFile = TriggerFlags.outputHLTconfigFile( ) # generated in python if TriggerFlags.readL1TopoConfigFromXML(): self.svc.l1topoXmlFile = TriggerFlags.inputL1TopoConfigFile( ) # given XML if TriggerFlags.readLVL1configFromXML(): self.svc.l1XmlFile = TriggerFlags.inputLVL1configFile( ) # given XML if TriggerFlags.readHLTconfigFromXML(): self.svc.hltXmlFile = TriggerFlags.inputHLTconfigFile( ) # given XML ### preparations are done! try: self.svc.SetStates(self.ConfigSrcList) except: log.error('Failed to set state of TrigConfigSvc to %r' % self.ConfigSrcList) else: log.info('The following configuration services will be tried: %r' % self.ConfigSrcList) try: self.svc.InitialiseSvc() except Exception, ex: log.error('Failed to activate TrigConfigSvc: %r' % ex)
def configure(self): log = logging.getLogger( "TriggerConfigGetter.py" ) from PyUtils.MetaReaderPeekerFull import metadata # first check the input if "HIT2RDO" in self._environment: TriggerFlags.doLVL2 = False TriggerFlags.doEF = False log.info("For simulation jobs the following flags are set:") log.info("globalflags.InputFormat : %s", globalflags.InputFormat()) log.info("globalflags.DataSource : %s", globalflags.DataSource()) log.info("TriggerFlags.configForStartup : %s", TriggerFlags.configForStartup()) log.info("TriggerFlags.dataTakingConditions : %s", TriggerFlags.dataTakingConditions()) log.info("TriggerFlags.doLVL2 : %s", TriggerFlags.doLVL2()) log.info("TriggerFlags.doEF : %s", TriggerFlags.doEF()) else: if not self.checkInput(): log.error("Could not determine job input. Can't setup trigger configuration and will return!") return # self.checkInput() may call TriggerConfigCheckMetadata, this can in turn set "rec.doTrigger.set_Value_and_Lock(False)" # but TriggerConfigGetter might have only been called in the first place due to this flag having been true, # so re-check that we're still OK to be executing here if not (recAlgs.doTrigger() or rec.doTrigger() or TriggerFlags.doTriggerConfigOnly()): log.info("Aborting TriggerConfigGetter as the trigger flags were switched to false in checkInput()") return True self.readPool = globalflags.InputFormat() == 'pool' self.readRDO = rec.readRDO() self.writeESDAOD = rec.doWriteESD() or rec.doWriteAOD() or rec.doWriteDPD() self.writeAOD = rec.doWriteAOD() or rec.doWriteDPD() self.ConfigSrcList = TriggerFlags.configurationSourceList() self.readMC = globalflags.DataSource()=='geant3' or globalflags.DataSource()=='geant4' self.readTriggerDB = TriggerFlags.readMenuFromTriggerDb() and self.readRDO self.isCommisioning = globalflags.DataSource()=='data' and globalflags.DetGeo()=='commis' self.l1Folders = TriggerFlags.dataTakingConditions()=='FullTrigger' or TriggerFlags.dataTakingConditions()=='Lvl1Only' self.hltFolders = TriggerFlags.dataTakingConditions()=='FullTrigger' or TriggerFlags.dataTakingConditions()=='HltOnly' self.isRun1Data = False self.hasxAODMeta = ("metadata_items" in metadata and any(('TriggerMenu' in key) for key in metadata["metadata_items"].keys())) if globalflags.DataSource()=='data': from RecExConfig.AutoConfiguration import GetRunNumber runNumber = GetRunNumber() if runNumber is not None and runNumber > 0 and runNumber < 230000 : self.isRun1Data = True self.isTriggerReprocessing = False # the TriggerFlags.readMenuFromTriggerDb() tells us that we read the trigger menu from the database # the connection itself is defined in TriggerFlags.triggerDbConnection() # reading from the TriggerDB can mean different things: # a) TriggerFlags doLVL2() and doEF() are both False: # - create a tmp sqlite file with the conditions (menu) # - use DSConfigSvc # b) TriggerFlags doLVL2() or doEF() is True: # - use HLTConfigSvc if self.readTriggerDB and (TriggerFlags.doLVL2() or TriggerFlags.doEF() or TriggerFlags.doHLT()): self.ConfigSrcList = ['xml'] # to use L1/HLTConfigSvc and not DSConfigSvc, but only if we are running the HLT if self._environment: # I don't think anyone calls TriggerConfigGetter with an argument self.readPool = False self.writeESDAOD = False self.readHits = False if "ReadPoolRDO" in self._environment: self.readPool = True self.readRDO = True elif "ReadPool" in self._environment: self.readPool = True self.readRDO = False if "WritePool" in self._environment: self.writeESDAOD = True if "HIT2RDO" in self._environment: self.readRDO = False self.readHits = True # define ConfigSvc if not self.ConfigSrcList: if (self.readPool and not self.readRDO) or (self.readRDO and not self.readPool): # (ESD, AOD, DPD) or (RDO-BS) self.ConfigSrcList = ['ds'] elif (self.readRDO and self.readPool) or rec.readTAG() or self.readHits: # (RDO-MC) or TAG self.ConfigSrcList = ['xml'] else: # should not get here: should be found by checkInput log.fatal('no reading of BS, RDO, AOD, ESD, or TAG specified') # we need the temporary COOL database, if we read the configuration from XML and write ESD/AOD (or have 'ds' set for some reason) self.makeTempCool = self.readRDO and \ ( self.writeESDAOD or 'ds' in self.ConfigSrcList ) and \ ( self.readMC \ or (self.isCommisioning and (TriggerFlags.readLVL1configFromXML() and TriggerFlags.readHLTconfigFromXML())) \ or TriggerFlags.readMenuFromTriggerDb() ) log.info("Need to create temporary cool file? : %r", self.makeTempCool) log.info('Creating the Trigger Configuration Services') from AthenaCommon.AppMgr import ServiceMgr as svcMgr ######################################################################## # START OF TEMPORARY SOLUTION FOR RUN-3 TRIGGER DEVELOPMENT ######################################################################## from TriggerJobOpts.HLTTriggerResultGetter import EDMDecodingVersion EDMDecodingVersion() # In most use cases this needs to be called much earlier than in HLTTriggerResultGetter if TriggerFlags.EDMDecodingVersion() >= 3: if self.hasxAODMeta: if not hasattr(svcMgr, 'xAODConfigSvc'): from TrigConfxAOD.TrigConfxAODConf import TrigConf__xAODConfigSvc svcMgr += TrigConf__xAODConfigSvc('xAODConfigSvc') else: # Does not have xAODMeta # Run-3 Trigger Configuration Services from TrigConfigSvc.TrigConfigSvcCfg import getL1ConfigSvc, getHLTConfigSvc from AthenaConfiguration.AllConfigFlags import ConfigFlags svcMgr += getL1ConfigSvc(ConfigFlags) svcMgr += getHLTConfigSvc(ConfigFlags) # Needed for TrigConf::xAODMenuWriterMT from TrigConfigSvc.TrigConfigSvcConfig import TrigConfigSvc svcMgr += TrigConfigSvc("TrigConfigSvc") svcMgr.TrigConfigSvc.PriorityList = ["none", "ds", "xml"] else: # non-MT (Run-2) Trigger Configuration self.svc = SetupTrigConfigSvc() if 'xml' in self.ConfigSrcList or self.makeTempCool: # sets them if plain XML reading is to be used self.svc.l1topoXmlFile = TriggerFlags.outputL1TopoConfigFile() # generated in python self.svc.l1XmlFile = TriggerFlags.outputLVL1configFile() # generated in python self.svc.hltXmlFile = TriggerFlags.outputHLTconfigFile() # generated in python if TriggerFlags.readL1TopoConfigFromXML(): self.svc.l1topoXmlFile = TriggerFlags.inputL1TopoConfigFile() # given XML if TriggerFlags.readLVL1configFromXML(): self.svc.l1XmlFile = TriggerFlags.inputLVL1configFile() # given XML if TriggerFlags.readHLTconfigFromXML(): self.svc.hltXmlFile = TriggerFlags.inputHLTconfigFile() # given XML try: self.svc.SetStates( self.ConfigSrcList ) except Exception: log.error( 'Failed to set state of TrigConfigSvc to %r', self.ConfigSrcList ) else: log.info('The following configuration services will be tried: %r', self.ConfigSrcList ) try: self.svc.InitialiseSvc() except Exception as ex: log.error( 'Failed to activate TrigConfigSvc: %r', ex ) ######################################################################## # END OF TEMPORARY SOLUTION FOR RUN-3 TRIGGER DEVELOPMENT ######################################################################## if self.readTriggerDB: log.info( "Using TriggerDB connection '%s'", TriggerFlags.triggerDbConnection() ) self.trigDbConnectionParameters = interpretConnection(TriggerFlags.triggerDbConnection(), resolveAlias=False) self.setConfigSvcConnParams(self.trigDbConnectionParameters) log.info("TriggerFlags.triggerCoolDbConnection is '%s' [default: '']", TriggerFlags.triggerCoolDbConnection()) TrigCoolDbConnection = TriggerFlags.triggerCoolDbConnection() if self.makeTempCool: TrigCoolDbConnection = self.setupTempCOOLWriting(TrigCoolDbConnection) if ('ds' in self.ConfigSrcList) and not self.hasxAODMeta: self.setupCOOLReading(TrigCoolDbConnection) if hasattr(svcMgr, 'DSConfigSvc'): db = 'TRIGGERDB' if self.isRun1Data: db = 'TRIGGERDB_RUN1' elif self.readMC: db = 'TRIGGERDBMC' elif self.isTriggerReprocessing: db = 'TRIGGERDBREPR' svcMgr.DSConfigSvc.ConfigSource = 'dblookup' svcMgr.DSConfigSvc.DBServer = db log.info("DSConfigSvc trigger database is '%s'", db) if not self.hasxAODMeta: self.setupxAODWriting() # all went fine we are configured return True