def generatePhotonsCfg(flags): acc = ComponentAccumulator() from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import MenuSequence, ChainStep, Chain, RecoFragmentsPool from TrigEgammaHypo.TrigEgammaFastCaloHypoTool import TrigEgammaFastCaloHypoToolFromDict from TrigEgammaHypo.TrigEgammaHypoConf import TrigEgammaFastCaloHypoAlgMT l2CaloHypo = TrigEgammaFastCaloHypoAlgMT("EgammaFastPhotonCaloHypo") l2CaloHypo.CaloClusters = 'L2CaloEMClusters' from TriggerMenuMT.HLTMenuConfig.Electron.ElectronRecoSequences import l2CaloRecoCfg l2CaloReco = RecoFragmentsPool.retrieve(l2CaloRecoCfg, flags) acc.merge(l2CaloReco) fastCaloSequence = MenuSequence( Sequence=l2CaloReco.sequence(), Maker=l2CaloReco.inputMaker(), Hypo=l2CaloHypo, HypoToolGen=TrigEgammaFastCaloHypoToolFromDict) fastCaloStep = ChainStep("Photon_step1", [fastCaloSequence]) l2PhotonReco = RecoFragmentsPool.retrieve(l2PhotonRecoCfg, flags) acc.merge(l2PhotonReco) from TrigEgammaHypo.TrigEgammaHypoConf import TrigEgammaFastPhotonHypoAlgMT l2PhotonHypo = TrigEgammaFastPhotonHypoAlgMT() l2PhotonHypo.Photons = "L2Photons" l2PhotonHypo.RunInView = True from TrigEgammaHypo.TrigEgammaFastPhotonHypoTool import TrigEgammaFastPhotonHypoToolFromDict l2PhotonSequence = MenuSequence( Sequence=l2PhotonReco.sequence(), Maker=l2PhotonReco.inputMaker(), Hypo=l2PhotonHypo, HypoToolGen=TrigEgammaFastPhotonHypoToolFromDict) l2PhotonStep = ChainStep("Photon_step2", [l2PhotonSequence]) chains = [ Chain(c.split()[0], c.split()[1], [fastCaloStep, l2PhotonStep]) for c in flags.Trigger.menu.photons ] return acc, chains
def jetMenuSequence(dummyFlags,**recoDict): (JetAthSequence, InputMakerAlg, sequenceOut)= jetCFSequence(dummyFlags,**recoDict) #hypo from TrigHLTJetHypo.TrigHLTJetHypoConf import TrigJetHypoAlgMT from TrigHLTJetHypo.TrigJetHypoToolConfig import trigJetHypoToolFromDict hypo = TrigJetHypoAlgMT("TrigJetHypoAlgMT_"+jetRecoDictToString(recoDict)) hypo.Jets = sequenceOut return MenuSequence( Sequence = JetAthSequence, Maker = InputMakerAlg, Hypo = hypo, HypoToolGen = trigJetHypoToolFromDict )
def tauCaloMVAMenuSequence(name): (sequence, tauCaloMVAViewsMaker, sequenceOut) = RecoFragmentsPool.retrieve(tauCaloMVASequence, ConfigFlags) # hypo from TrigTauHypo.TrigTauHypoConf import TrigTauCaloHypoAlgMT theTauCaloMVAHypo = TrigTauCaloHypoAlgMT(name + "L2CaloMVAHypo") theTauCaloMVAHypo.taujets = sequenceOut from TrigTauHypo.TrigTauHypoTool import TrigL2TauHypoToolFromDict return MenuSequence(Sequence=sequence, Maker=tauCaloMVAViewsMaker, Hypo=theTauCaloMVAHypo, HypoToolGen=TrigL2TauHypoToolFromDict)
def tauTrackTwoEFSeq(): (sequence, efViewsMaker, sequenceOut) = RecoFragmentsPool.retrieve(tauEFSequence, ConfigFlags) from TrigTauHypo.TrigTauHypoConf import TrigEFTauMVHypoAlgMT precisionHypo = TrigEFTauMVHypoAlgMT("EFTauMVHypoAlg") precisionHypo.taujetcontainer = sequenceOut from TrigTauHypo.TrigTauHypoTool import TrigEFTauMVHypoToolFromDict return MenuSequence(Sequence=sequence, Maker=efViewsMaker, Hypo=precisionHypo, HypoToolGen=TrigEFTauMVHypoToolFromDict)
def tauTwoStepTrackSeqIso(): (sequence, ftfIsoViewsMaker, sequenceOut) = RecoFragmentsPool.retrieve(tauFTFIsoSequence, ConfigFlags) from TrigTauHypo.TrigTauHypoConf import TrigEFTauMVHypoAlgMT precisionHypo = TrigEFTauMVHypoAlgMT("EFTauMVHypoAlgFinal") precisionHypo.taujetcontainer = sequenceOut from TrigTauHypo.TrigTauHypoTool import TrigEFTauMVHypoToolFromDict return MenuSequence(Sequence=sequence, Maker=ftfIsoViewsMaker, Hypo=precisionHypo, HypoToolGen=TrigEFTauMVHypoToolFromDict)
def tauTwoStepTrackSeqCore(): (sequence, ftfCoreViewsMaker, sequenceOut) = RecoFragmentsPool.retrieve(tauFTFCoreSequence, ConfigFlags) from TrigTauHypo.TrigTauHypoConf import TrigTrackPreSelHypoAlgMT fastTrkHypo = TrigTrackPreSelHypoAlgMT("TrackPreSelHypoAlg_RejectEmpty") fastTrkHypo.trackcollection = sequenceOut from TrigTauHypo.TrigTauHypoTool import TrigTauTrackHypoToolFromDict return MenuSequence(Sequence=sequence, Maker=ftfCoreViewsMaker, Hypo=fastTrkHypo, HypoToolGen=TrigTauTrackHypoToolFromDict)
def fastPhotonMenuSequence(): """Creates secpond step photon sequence""" from TriggerMenuMT.HLTMenuConfig.CommonSequences.CaloSequenceSetup import CaloMenuDefs ViewVerify = CfgMgr.AthViews__ViewDataVerifier( "FastPhotonViewDataVerifier") ViewVerify.DataObjects = [('xAOD::TrigEMClusterContainer', 'StoreGateSvc+' + CaloMenuDefs.L2CaloClusters), ('TrigRoiDescriptorCollection', 'StoreGateSvc+EMIDRoIs')] from TrigEgammaHypo.TrigEgammaFastPhotonFexMTConfig import EgammaFastPhotonFex_1 thePhotonFex = EgammaFastPhotonFex_1() thePhotonFex.TrigEMClusterName = CaloMenuDefs.L2CaloClusters thePhotonFex.PhotonsName = recordable("HLT_FastPhotons") #thePhotonFex.RoIs="EMIDRoIs" l2PhotonViewsMaker = EventViewCreatorAlgorithm("IMl2Photon") l2PhotonViewsMaker.RoIsLink = "initialRoI" l2PhotonViewsMaker.InViewRoIs = "EMIDRoIs" #l2PhotonViewsMaker.InViewRoIs = "EMCaloRoIs" l2PhotonViewsMaker.RoITool = ViewCreatorInitialROITool() l2PhotonViewsMaker.Views = "EMPhotonViews" l2PhotonViewsMaker.ViewFallThrough = True l2PhotonViewsMaker.RequireParentView = True thePhotonFex.RoIs = l2PhotonViewsMaker.InViewRoIs photonInViewAlgs = parOR("photonInViewAlgs", [ViewVerify, thePhotonFex]) l2PhotonViewsMaker.ViewNodeName = "photonInViewAlgs" from TrigEgammaHypo.TrigEgammaHypoConf import TrigEgammaFastPhotonHypoAlgMT thePhotonHypo = TrigEgammaFastPhotonHypoAlgMT() thePhotonHypo.Photons = thePhotonFex.PhotonsName thePhotonHypo.RunInView = True # this needs to be added: #electronDecisionsDumper = DumpDecisions("electronDecisionsDumper", Decisions = theElectronHypo.Output ) photonAthSequence = seqAND("photonAthSequence", [l2PhotonViewsMaker, photonInViewAlgs]) from TrigEgammaHypo.TrigEgammaFastPhotonHypoTool import TrigEgammaFastPhotonHypoToolFromDict return MenuSequence(Maker=l2PhotonViewsMaker, Sequence=photonAthSequence, Hypo=thePhotonHypo, HypoToolGen=TrigEgammaFastPhotonHypoToolFromDict)
def minbiasTrackMenuSequence(): # menu components # retrieve the reco seuqnece from TriggerMenuMT.HLTMenuConfig.MinBias.MinBiasTrkRecoSequences import minbiasTrackAthSequence (minbiasTrackSequence, InputMakerAlg, sequenceOut) = RecoFragmentsPool.retrieve(minbiasTrackAthSequence, ConfigFlags) #hypo mbHypoAlg = MbCountHypoAlgMT("MinBiasHypoAlg_trk") mbHypoAlg.MinBiasContainerKey = sequenceOut return MenuSequence(Sequence=minbiasTrackSequence, Maker=InputMakerAlg, Hypo=mbHypoAlg, HypoToolGen=TrigMinBiasHypoToolFromDict)
def StreamingMenuSequence(): inputMakerAlg = InputMakerForRoI("IM_streamerInputMaker") inputMakerAlg.RoITool = ViewCreatorInitialROITool() inputMakerAlg.RoIs = "streamerInputRoIs" streamingSequence = seqAND("streamerSequence", [inputMakerAlg]) #hypo streamerHypoAlg = TrigStreamerHypoAlgMT("StreamerHypoAlg") streamerHypoAlg.RuntimeValidation = False #Needed to avoid the ERROR ! Decision has no 'feature' ElementLink streamerHypoToolGen = StreamerHypoToolMTgenerator return MenuSequence(Sequence=streamingSequence, Maker=inputMakerAlg, Hypo=streamerHypoAlg, HypoToolGen=streamerHypoToolGen)
def muCombOvlpRmSequence(): (l2muCombSequence, l2muCombViewsMaker, sequenceOut) = RecoFragmentsPool.retrieve(muCombAlgSequence, ConfigFlags) ### set up muCombHypo algorithm ### from TrigMuonHypoMT.TrigMuonHypoMTConfig import TrigmuCombHypoAlg trigmuCombHypo = TrigmuCombHypoAlg("TrigL2MuCBHypoAlg") trigmuCombHypo.MuonL2CBInfoFromMuCombAlg = sequenceOut from TrigMuonHypoMT.TrigMuonHypoMTConfig import TrigmuCombHypoToolwORFromDict return MenuSequence(Sequence=l2muCombSequence, Maker=l2muCombViewsMaker, Hypo=trigmuCombHypo, HypoToolGen=TrigmuCombHypoToolwORFromDict)
def muEFIsoSequence(): (efmuIsoSequence, efmuIsoViewsMaker, sequenceOut) = RecoFragmentsPool.retrieve(muEFIsoAlgSequence, ConfigFlags) # set up hypo from TrigMuonHypoMT.TrigMuonHypoMTConfig import TrigMuonEFTrackIsolationHypoAlg trigmuefIsoHypo = TrigMuonEFTrackIsolationHypoAlg("EFMuisoHypoAlg") trigmuefIsoHypo.EFMuonsName = sequenceOut from TrigMuonHypoMT.TrigMuonHypoMTConfig import TrigMuonEFTrackIsolationHypoToolFromDict return MenuSequence(Sequence=efmuIsoSequence, Maker=efmuIsoViewsMaker, Hypo=trigmuefIsoHypo, HypoToolGen=TrigMuonEFTrackIsolationHypoToolFromDict)
def muIsoSequence(): (l2muIsoSequence, l2muIsoViewsMaker, sequenceOut) = RecoFragmentsPool.retrieve(muIsoAlgSequence, ConfigFlags) # set up hypo from TrigMuonHypoMT.TrigMuonHypoMTConfig import TrigMuisoHypoAlg trigmuIsoHypo = TrigMuisoHypoAlg("L2MuisoHypoAlg") trigmuIsoHypo.MuonL2ISInfoName = sequenceOut from TrigMuonHypoMT.TrigMuonHypoMTConfig import TrigMuisoHypoToolFromDict return MenuSequence(Sequence=l2muIsoSequence, Maker=l2muIsoViewsMaker, Hypo=trigmuIsoHypo, HypoToolGen=TrigMuisoHypoToolFromDict)
def muFastOvlpRmSequence(): (l2muFastSequence, l2MuViewsMaker, sequenceOut) = RecoFragmentsPool.retrieve(muFastAlgSequence, ConfigFlags) ### set up MuFastHypo ### from TrigMuonHypoMT.TrigMuonHypoMTConfig import TrigMufastHypoAlg trigMufastHypo = TrigMufastHypoAlg("TrigL2MufastHypoAlg") trigMufastHypo.MuonL2SAInfoFromMuFastAlg = sequenceOut from TrigMuonHypoMT.TrigMuonHypoMTConfig import TrigMufastHypoToolwORFromDict return MenuSequence(Sequence=l2muFastSequence, Maker=l2MuViewsMaker, Hypo=trigMufastHypo, HypoToolGen=TrigMufastHypoToolwORFromDict)
def muEFSASequence(): (muonEFSAonlySequence, efsaViewsMaker, sequenceOut) = RecoFragmentsPool.retrieve(muEFSAAlgSequence, ConfigFlags) # setup EFSA hypo from TrigMuonHypoMT.TrigMuonHypoMTConfig import TrigMuonEFHypoAlg trigMuonEFSAHypo = TrigMuonEFHypoAlg("TrigMuonEFSAHypoAlg") trigMuonEFSAHypo.MuonDecisions = sequenceOut from TrigMuonHypoMT.TrigMuonHypoMTConfig import TrigMuonEFMSonlyHypoToolFromDict return MenuSequence(Sequence=muonEFSAonlySequence, Maker=efsaViewsMaker, Hypo=trigMuonEFSAHypo, HypoToolGen=TrigMuonEFMSonlyHypoToolFromDict)
def muEFCBFSSequence(): (muonEFCBFSSequence, efcbfsInputMaker, sequenceOut) = RecoFragmentsPool.retrieve(muEFCBFSAlgSequence, ConfigFlags) # setup EFCB hypo from TrigMuonHypoMT.TrigMuonHypoMTConfig import TrigMuonEFHypoAlg trigMuonEFCBFSHypo = TrigMuonEFHypoAlg("TrigMuonEFFSCombinerHypoAlg") trigMuonEFCBFSHypo.MuonDecisions = sequenceOut from TrigMuonHypoMT.TrigMuonHypoMTConfig import TrigMuonEFCombinerHypoToolFromName return MenuSequence(Sequence=muonEFCBFSSequence, Maker=efcbfsInputMaker, Hypo=trigMuonEFCBFSHypo, HypoToolGen=TrigMuonEFCombinerHypoToolFromName)
def muCombSequence(): (l2muCombSequence, l2muCombViewsMaker, sequenceOut) = RecoFragmentsPool.retrieve(muCombAlgSequence, ConfigFlags) ### set up muCombHypo algorithm ### from TrigMuonHypoMT.TrigMuonHypoMTConfig import TrigmuCombHypoAlg #trigmuCombHypo = TrigmuCombHypoAlg("L2muCombHypoAlg") # avoid to have "Comb" string in the name due to HLTCFConfig.py. trigmuCombHypo = TrigmuCombHypoAlg("TrigL2MuCBHypoAlg") trigmuCombHypo.MuonL2CBInfoFromMuCombAlg = sequenceOut from TrigMuonHypoMT.TrigMuonHypoMTConfig import TrigmuCombHypoToolFromDict return MenuSequence(Sequence=l2muCombSequence, Maker=l2muCombViewsMaker, Hypo=trigmuCombHypo, HypoToolGen=TrigmuCombHypoToolFromDict)
def efLateMuSequence(): (muonEFLateSequence, eflateViewsMaker, sequenceOut) = RecoFragmentsPool.retrieve(efLateMuAlgSequence, ConfigFlags) # setup EFCB hypo from TrigMuonHypoMT.TrigMuonHypoMTConfig import TrigMuonEFHypoAlg trigMuonEFLateHypo = TrigMuonEFHypoAlg("TrigMuonEFCombinerLateMuHypoAlg") trigMuonEFLateHypo.MuonDecisions = sequenceOut from TrigMuonHypoMT.TrigMuonHypoMTConfig import TrigMuonEFCombinerHypoToolFromDict return MenuSequence(Sequence=muonEFLateSequence, Maker=eflateViewsMaker, Hypo=trigMuonEFLateHypo, HypoToolGen=TrigMuonEFCombinerHypoToolFromDict)
def getTimeBurnerStep(self): # Input maker - required by the framework, but inputs don't matter for TimeBurner inputMaker = InputMakerForRoI("IM_TimeBurner") inputMaker.RoITool = ViewCreatorInitialROITool() inputMaker.RoIs = "TimeBurnerInputRoIs" inputMakerSeq = seqAND("TimeBurnerSequence", [inputMaker]) # TimeBurner alg works as a reject-all hypo hypoAlg = conf2toConfigurable(TimeBurnerCfg()) hypoAlg.SleepTimeMillisec = 200 seq = MenuSequence(Sequence=inputMakerSeq, Maker=inputMaker, Hypo=hypoAlg, HypoToolGen=TimeBurnerHypoToolGen) return ChainStep(name='Step1_TimeBurner', Sequences=[seq])
def muEFCBSequence(): (muonEFCBSequence, efcbViewsMaker, sequenceOut) = RecoFragmentsPool.retrieve(muEFCBAlgSequence, ConfigFlags) # setup EFCB hypo from TrigMuonHypoMT.TrigMuonHypoMTConfig import TrigMuonEFHypoAlg trigMuonEFCBHypo = TrigMuonEFHypoAlg("TrigMuonEFCombinerHypoAlg") trigMuonEFCBHypo.MuonDecisions = sequenceOut trigMuonEFCBHypo.MapToPreviousDecisions = True from TrigMuonHypoMT.TrigMuonHypoMTConfig import TrigMuonEFCombinerHypoToolFromDict return MenuSequence(Sequence=muonEFCBSequence, Maker=efcbViewsMaker, Hypo=trigMuonEFCBHypo, HypoToolGen=TrigMuonEFCombinerHypoToolFromDict)
def fastCaloMenuSequence(name, doRinger): """ Creates Egamma Fast Calo MENU sequence The Hypo name changes depending on name, so for different implementations (Electron, Gamma,....) The doRinger flag is to use or not the Ringer hypo """ (sequence, fastCaloViewsMaker, sequenceOut) = RecoFragmentsPool.retrieve(fastCaloSequence, {'doRinger' : doRinger}) # check if use Ringer and are electron because there aren't ringer for photons yet: # hypo from TrigEgammaHypo.TrigEgammaHypoConf import TrigEgammaFastCaloHypoAlgMT theFastCaloHypo = TrigEgammaFastCaloHypoAlgMT(name+"EgammaFastCaloHypo") theFastCaloHypo.CaloClusters = sequenceOut CaloMenuDefs.L2CaloClusters = sequenceOut from TrigEgammaHypo.TrigEgammaFastCaloHypoTool import TrigEgammaFastCaloHypoToolFromDict return MenuSequence( Sequence = sequence, Maker = fastCaloViewsMaker, Hypo = theFastCaloHypo, HypoToolGen = TrigEgammaFastCaloHypoToolFromDict )
def precisionCaloMenuSequence(name): """ Creates precisionCalo MENU sequence """ (sequence, precisionCaloViewsMaker, sequenceOut) = RecoFragmentsPool.retrieve(precisionCaloSequence, ConfigFlags) #Hypo from TrigEgammaHypo.TrigEgammaHypoConf import TrigEgammaPrecisionCaloHypoAlgMT from TrigEgammaHypo.TrigEgammaPrecisionCaloHypoTool import TrigEgammaPrecisionCaloHypoToolFromDict thePrecisionCaloHypo = TrigEgammaPrecisionCaloHypoAlgMT( name + "precisionCaloHypo") thePrecisionCaloHypo.CaloClusters = sequenceOut return MenuSequence(Sequence=sequence, Maker=precisionCaloViewsMaker, Hypo=thePrecisionCaloHypo, HypoToolGen=TrigEgammaPrecisionCaloHypoToolFromDict)
def precisionElectronMenuSequence(): # retrieve the reco seuqence+EVC (electronPrecisionAthSequence, precisionElectronViewsMaker, sequenceOut) = RecoFragmentsPool.retrieve(precisionElectronSequence, ConfigFlags) # make the Hypo from TrigEgammaHypo.TrigEgammaHypoConf import TrigEgammaPrecisionElectronHypoAlgMT thePrecisionElectronHypo = TrigEgammaPrecisionElectronHypoAlgMT( "TrigEgammaPrecisionElectronHypoAlgMT") thePrecisionElectronHypo.Electrons = sequenceOut thePrecisionElectronHypo.RunInView = True from TrigEgammaHypo.TrigEgammaPrecisionElectronHypoTool import TrigEgammaPrecisionElectronHypoToolFromDict return MenuSequence( Maker=precisionElectronViewsMaker, Sequence=electronPrecisionAthSequence, Hypo=thePrecisionElectronHypo, HypoToolGen=TrigEgammaPrecisionElectronHypoToolFromDict)
def fastElectronMenuSequence(): """ Creates 2nd step Electron MENU sequence""" # retrievee the reco seuqence+IM (electronAthSequence, l2ElectronViewsMaker, sequenceOut) = RecoFragmentsPool.retrieve(fastElectronSequence, ConfigFlags) # make the Hypo from TrigEgammaHypo.TrigEgammaHypoConf import TrigEgammaFastElectronHypoAlgMT theElectronHypo = TrigEgammaFastElectronHypoAlgMT() theElectronHypo.Electrons = sequenceOut theElectronHypo.RunInView = True from TrigEgammaHypo.TrigEgammaFastElectronHypoTool import TrigEgammaFastElectronHypoToolFromDict return MenuSequence(Maker=l2ElectronViewsMaker, Sequence=electronAthSequence, Hypo=theElectronHypo, HypoToolGen=TrigEgammaFastElectronHypoToolFromDict)
def allTE_trkfast( signature="FS" ): inputMakerAlg = EventViewCreatorAlgorithm("IM_beamspot_"+signature) inputMakerAlg.ViewFallThrough = True inputMakerAlg.RoIsLink = "initialRoI" inputMakerAlg.RoITool = ViewCreatorInitialROITool() inputMakerAlg.InViewRoIs = "beamspotViewRoI_"+signature inputMakerAlg.Views = "beamspotViewRoI_"+signature from TrigInDetConfig.InDetSetup import makeInDetAlgs from TrigT2BeamSpot.T2VertexBeamSpotConfig import T2VertexBeamSpot_activeAllTE viewAlgs, viewVerify = makeInDetAlgs( whichSignature=signature, rois=inputMakerAlg.InViewRoIs ) vertexAlg = T2VertexBeamSpot_activeAllTE( "vertex_"+signature ) vertexAlg.TrackCollection = "TrigFastTrackFinder_Tracks_"+signature viewVerify.DataObjects += [( 'TrigRoiDescriptorCollection' , 'StoreGateSvc+beamspotViewRoI_'+signature ), ( 'xAOD::EventInfo' , 'StoreGateSvc+EventInfo' ), ( 'TagInfo' , 'DetectorStore+ProcessingTags' )] # Make sure this is still available at whole-event level from AthenaCommon.AlgSequence import AlgSequence topSequence = AlgSequence() topSequence.SGInputLoader.Load += [( 'TagInfo' , 'DetectorStore+ProcessingTags' )] beamspotSequence = seqAND( "beamspotSequence_"+signature, viewAlgs+[vertexAlg] ) inputMakerAlg.ViewNodeName = beamspotSequence.name() beamspotViewsSequence = seqAND( "beamspotViewsSequence"+signature, [ inputMakerAlg, beamspotSequence ]) #hypo beamspotHypoAlg = TrigStreamerHypoAlgMT("BeamspotHypoAlg_"+signature) beamspotHypoAlg.RuntimeValidation = False #Needed to avoid the ERROR ! Decision has no 'feature' ElementLink beamspotHypoToolGen= StreamerHypoToolMTgenerator return MenuSequence( Sequence = beamspotViewsSequence, Maker = inputMakerAlg, Hypo = beamspotHypoAlg, HypoToolGen = beamspotHypoToolGen )
def precisionPhotonMenuSequence(name): # This will be executed after pricisionCalo, so we need to pickup indeed the topoClusters by precisionCalo and add them here as requirements from AthenaConfiguration.AllConfigFlags import ConfigFlags """Creates precisionPhoton sequence""" (sequence, precisionPhotonViewsMaker, sequenceOut) = RecoFragmentsPool.retrieve(precisionPhotonSequence, ConfigFlags) # Hypo from TrigEgammaHypo.TrigEgammaHypoConf import TrigEgammaPrecisionPhotonHypoAlgMT from TrigEgammaHypo.TrigEgammaPrecisionPhotonHypoTool import TrigEgammaPrecisionPhotonHypoToolFromDict thePrecisionPhotonHypo = TrigEgammaPrecisionPhotonHypoAlgMT( name + "precisionPhotonHypo") thePrecisionPhotonHypo.Photons = sequenceOut return MenuSequence(Sequence=sequence, Maker=precisionPhotonViewsMaker, Hypo=thePrecisionPhotonHypo, HypoToolGen=TrigEgammaPrecisionPhotonHypoToolFromDict)
def getMinBiasSpStep(self): """ Use the reco-dict to construct a single MinBias step """ def generateSPCountHypo(chainDict): hypo = SPCountHypoTool(chainDict["chainName"]) if "hmt" in chainDict["chainName"]: hypo.totNumSctSP = int( chainDict["chainParts"][0]["hypoL2Info"].strip("sp")) if "mb_sptrk" in chainDict["chainName"]: hypo.totNumPixSP = 2 hypo.totNumSctSP = 3 # will set here thresholds return hypo SpList = [] from TrigT2MinBias.TrigT2MinBiasConf import TrigCountSpacePointsMT, SPCountHypoAlgMT, SPCountHypoTool SPInputMakerAlg = EventViewCreatorAlgorithm("IM_SPEventViewCreator") SPInputMakerAlg.ViewFallThrough = True SPInputMakerAlg.RoITool = ViewCreatorInitialROITool() SPInputMakerAlg.InViewRoIs = "InputRoI" SPInputMakerAlg.Views = "SPView" idAlgs, verifier = makeInDetAlgs(whichSignature='MinBias', separateTrackParticleCreator='', rois=SPInputMakerAlg.InViewRoIs, viewVerifier='SPViewDataVerifier') verifier.DataObjects += [('TrigRoiDescriptorCollection', 'StoreGateSvc+InputRoI'), ('SCT_ID', 'DetectorStore+SCT_ID'), ('PixelID', 'DetectorStore+PixelID'), ('TagInfo', 'DetectorStore+ProcessingTags')] # Make sure required objects are still available at whole-event level from AthenaCommon.AlgSequence import AlgSequence topSequence = AlgSequence() topSequence.SGInputLoader.Load += [ ('SCT_ID', 'DetectorStore+SCT_ID'), ('PixelID', 'DetectorStore+PixelID'), ('TagInfo', 'DetectorStore+ProcessingTags') ] from IOVDbSvc.CondDB import conddb if not conddb.folderRequested('/PIXEL/DCS/FSMSTATE'): verifier.DataObjects += [('CondAttrListCollection', 'ConditionStore+/PIXEL/DCS/FSMSTATE')] if not conddb.folderRequested('/PIXEL/DCS/FSMSTATUS'): verifier.DataObjects += [('CondAttrListCollection', 'ConditionStore+/PIXEL/DCS/FSMSTATUS')] SpList = idAlgs[:-2] SpCount = TrigCountSpacePointsMT() SpCount.SpacePointsKey = recordable("HLT_SpacePointCounts") from TrigT2MinBias.TrigT2MinBiasMonitoringMT import SpCountMonitoring SpCount.MonTool = SpCountMonitoring() SPrecoSeq = parOR("SPrecoSeq", SpList + [SpCount]) SPSequence = seqAND("SPSequence", [SPInputMakerAlg, SPrecoSeq]) SPInputMakerAlg.ViewNodeName = SPrecoSeq.name() SpCountHypo = SPCountHypoAlgMT() SpCountHypo.SpacePointsKey = recordable("HLT_SpacePointCounts") Step1_SPCount = ChainStep("Step1_SPCount", [ MenuSequence(Sequence=SPSequence, Maker=SPInputMakerAlg, Hypo=SpCountHypo, HypoToolGen=generateSPCountHypo) ]) return Step1_SPCount
def gamMenuSequence(step, reconame, hyponame): (Sequence, IM, seqOut) = RecoFragmentsPool.retrieve(makeElSequence,ConfigFlags,name=reconame, step=step) elHypo = ElGamHypo(hyponame+"Step"+step+"GamHypo") elHypo.Input = seqOut return MenuSequence( Maker=IM, Sequence=Sequence, Hypo=elHypo, HypoToolGen=ElTestHypoTool)
def muMenuSequence(step, reconame, hyponame): (Sequence, IM, seqOut) = RecoFragmentsPool.retrieve(makeMuSequence,ConfigFlags,name=reconame, step=step) muHypo = MuHypo(hyponame+"Step"+step+"MuHypo") muHypo.Input = seqOut return MenuSequence( Maker=IM, Sequence=Sequence, Hypo=muHypo, HypoToolGen=MuTestHypoTool)
def getMinBiasTrkStep(self): """ Use the reco-dict to construct a single MinBias step """ def generateTrackCountHypo(chainDict): hypo = TrackCountHypoTool(chainDict["chainName"]) if "hmt" in chainDict["chainName"]: hypo.required_ntrks = int( chainDict["chainParts"][0]["hypoEFInfo"].strip("trk")) if "mb_sptrk" in chainDict["chainName"]: hypo.min_pt = 0.2 hypo.max_z0 = 401 # will set here cuts return hypo from TrigMinBias.TrigMinBiasConf import TrackCountHypoAlgMT, TrackCountHypoTool TrkInputMakerAlg = EventViewCreatorAlgorithm("IM_TrkEventViewCreator") TrkInputMakerAlg.ViewFallThrough = True TrkInputMakerAlg.RoITool = ViewCreatorInitialROITool() TrkInputMakerAlg.InViewRoIs = "InputRoI" # contract with the consumer TrkInputMakerAlg.Views = "TrkView" TrkInputMakerAlg.RequireParentView = True TrkInputMakerAlg.ViewNodeName = "TrkCountHypoAlgMTNode" # prepare algorithms to run in views, first, inform scheduler that input data is available in parent view (has to be done by hand) idAlgs, verifier = makeInDetAlgs(whichSignature='MinBias', separateTrackParticleCreator='', rois=TrkInputMakerAlg.InViewRoIs, viewVerifier='TrkrecoSeqDataVerifier') verifier.DataObjects += [ ('TrigRoiDescriptorCollection', 'StoreGateSvc+InputRoI'), ('IDCInDetBSErrContainer', 'StoreGateSvc+SCT_FlaggedCondData_TRIG'), ('InDet::SCT_ClusterContainer', 'StoreGateSvc+SCT_TrigClusters'), ('SpacePointContainer', 'StoreGateSvc+SCT_TrigSpacePoints'), ('InDet::PixelClusterContainer', 'StoreGateSvc+PixelTrigClusters'), ('SpacePointContainer', 'StoreGateSvc+PixelTrigSpacePoints') ] if globalflags.InputFormat.is_bytestream(): verifier.DataObjects += [ ('InDetBSErrContainer', 'StoreGateSvc+PixelByteStreamErrs'), ('IDCInDetBSErrContainer', 'StoreGateSvc+SCT_ByteStreamErrs') ] TrkList = idAlgs[ -2:] # FTF and Track to xAOD::TrackParticle conversion alg TrackCountHypo = TrackCountHypoAlgMT() TrackCountHypo.trackCountKey = recordable("HLT_TrackCount") TrackCountHypo.tracksKey = recordable("HLT_IDTrack_MinBias_FTF") from TrigMinBias.TrackCountMonitoringMT import TrackCountMonitoring TrackCountHypo.MonTool = TrackCountMonitoring() TrkrecoSeq = parOR("TrkrecoSeq", [verifier] + TrkList) TrkSequence = seqAND("TrkSequence", [TrkInputMakerAlg, TrkrecoSeq]) TrkInputMakerAlg.ViewNodeName = TrkrecoSeq.name() Step2_TrkCount = ChainStep("Step2_TrkCount", [ MenuSequence(Sequence=TrkSequence, Maker=TrkInputMakerAlg, Hypo=TrackCountHypo, HypoToolGen=generateTrackCountHypo) ]) return Step2_TrkCount
def bJetStep2Sequence(): prmVtxKey = "HLT_IDVertex_FS" outputRoIName = "HLT_Roi_Bjet" from ViewAlgs.ViewAlgsConf import EventViewCreatorAlgorithm from DecisionHandling.DecisionHandlingConf import ViewCreatorCentredOnJetWithPVConstraintROITool InputMakerAlg = EventViewCreatorAlgorithm("IMBJet_step2") # newRoITool = ViewCreatorCentredOnJetWithPVConstraintROITool() newRoITool.RoisWriteHandleKey = recordable(outputRoIName) newRoITool.VertexReadHandleKey = prmVtxKey newRoITool.PrmVtxLink = prmVtxKey.replace("HLT_", "") # InputMakerAlg.mergeUsingFeature = True InputMakerAlg.RoITool = newRoITool # InputMakerAlg.Views = "BTagViews" InputMakerAlg.InViewRoIs = "InViewRoIs" # InputMakerAlg.RequireParentView = False InputMakerAlg.ViewFallThrough = True # BJet specific InputMakerAlg.PlaceJetInView = True InputMakerAlg.InViewJets = recordable("HLT_bJets") # Prepare data objects for view verifier viewDataObjects = [('TrigRoiDescriptorCollection', 'StoreGateSvc+' + InputMakerAlg.InViewRoIs), ('xAOD::VertexContainer', 'StoreGateSvc+' + prmVtxKey), ('xAOD::JetContainer', 'StoreGateSvc+' + InputMakerAlg.InViewJets)] # Second stage of Fast Tracking and Precision Tracking from TriggerMenuMT.HLTMenuConfig.Bjet.BjetTrackingConfiguration import getSecondStageBjetTracking secondStageAlgs, PTTrackParticles = getSecondStageBjetTracking( inputRoI=InputMakerAlg.InViewRoIs, dataObjects=viewDataObjects) from AthenaCommon.Configurable import Configurable Configurable.configurableRun3Behavior = 1 # Flavour Tagging from TriggerMenuMT.HLTMenuConfig.Bjet.BjetFlavourTaggingConfiguration import getFlavourTagging acc_flavourTaggingAlgs, bTaggingContainerName = getFlavourTagging( inputJets=InputMakerAlg.InViewJets, inputVertex=prmVtxKey, inputTracks=PTTrackParticles[0]) Configurable.configurableRun3Behavior = 0 #Conversion of flavour-tagging algorithms from new to old-style from AthenaCommon.CFElements import findAllAlgorithms from AthenaConfiguration.ComponentAccumulator import conf2toConfigurable AllFlavourTaggingAlgs = [] for alg in findAllAlgorithms( acc_flavourTaggingAlgs.getSequence("AthAlgSeq")): AllFlavourTaggingAlgs.append(conf2toConfigurable(alg)) acc_flavourTaggingAlgs.wasMerged( ) #Needed to remove error message; Next we add all algorithms to sequence so this is kind of an old-style merge bJetBtagSequence = seqAND("bJetBtagSequence", secondStageAlgs + AllFlavourTaggingAlgs) InputMakerAlg.ViewNodeName = "bJetBtagSequence" # Sequence BjetAthSequence = seqAND("BjetAthSequence_step2", [InputMakerAlg, bJetBtagSequence]) from TrigBjetHypo.TrigBjetHypoConf import TrigBjetBtagHypoAlgMT hypo = TrigBjetBtagHypoAlgMT("TrigBjetBtagHypoAlg") # keys hypo.BTaggedJetKey = InputMakerAlg.InViewJets hypo.BTaggingKey = bTaggingContainerName hypo.TracksKey = PTTrackParticles[0] hypo.PrmVtxKey = newRoITool.VertexReadHandleKey # links for navigation hypo.BTaggingLink = bTaggingContainerName.replace("HLT_", "") hypo.PrmVtxLink = newRoITool.PrmVtxLink from TrigBjetHypo.TrigBjetOnlineMonitoringMTConfig import TrigBjetOnlineMonitoring hypo.MonTool = TrigBjetOnlineMonitoring() from TrigBjetHypo.TrigBjetBtagHypoTool import TrigBjetBtagHypoToolFromDict return MenuSequence(Sequence=BjetAthSequence, Maker=InputMakerAlg, Hypo=hypo, HypoToolGen=TrigBjetBtagHypoToolFromDict)