示例#1
0
def fastElectronSequence(ConfigFlags):
    """ second step:  tracking....."""

    from TrigInDetConfig.InDetSetup import makeInDetAlgs
    RoIs = "EMIDRoIs"  # contract with the fastCalo
    viewAlgs, viewVerify = makeInDetAlgs(
        whichSignature="Electron",
        separateTrackParticleCreator="Electron",
        rois=RoIs)

    # A simple algorithm to confirm that data has been inherited from parent view
    # Required to satisfy data dependencies
    from TriggerMenuMT.HLTMenuConfig.CommonSequences.CaloSequenceSetup import CaloMenuDefs
    viewVerify.DataObjects += [('xAOD::TrigEMClusterContainer',
                                'StoreGateSvc+' + CaloMenuDefs.L2CaloClusters),
                               ('TrigRoiDescriptorCollection',
                                'StoreGateSvc+' + RoIs)]

    from IOVDbSvc.CondDB import conddb
    if not conddb.folderRequested("/PIXEL/DCS/FSMSTATUS"):
        viewVerify.DataObjects += [('CondAttrListCollection',
                                    'ConditionStore+/PIXEL/DCS/FSMSTATUS')]
    if not conddb.folderRequested("/PIXEL/DCS/FSMSTATE"):
        viewVerify.DataObjects += [('CondAttrListCollection',
                                    'ConditionStore+/PIXEL/DCS/FSMSTATE')]

    TrackParticlesName = ""
    for viewAlg in viewAlgs:
        if "InDetTrigTrackParticleCreatorAlg" in viewAlg.name():
            TrackParticlesName = viewAlg.TrackParticlesName

    from TrigEgammaHypo.TrigEgammaFastElectronFexMTConfig import EgammaFastElectronFex_1
    theElectronFex = EgammaFastElectronFex_1()
    theElectronFex.TrigEMClusterName = CaloMenuDefs.L2CaloClusters
    theElectronFex.TrackParticlesName = TrackParticlesName
    theElectronFex.ElectronsName = recordable("HLT_FastElectrons")

    # EVCreator:
    l2ElectronViewsMaker = EventViewCreatorAlgorithm("IMl2Electron")
    l2ElectronViewsMaker.RoIsLink = "initialRoI"
    l2ElectronViewsMaker.RoITool = ViewCreatorInitialROITool()
    l2ElectronViewsMaker.InViewRoIs = RoIs
    l2ElectronViewsMaker.Views = "EMElectronViews"
    l2ElectronViewsMaker.ViewFallThrough = True
    l2ElectronViewsMaker.RequireParentView = True

    theElectronFex.RoIs = l2ElectronViewsMaker.InViewRoIs
    # ATR-20453
    # Until such time as FS and RoI collections do not interfere, a hacky fix
    #electronInViewAlgs = parOR("electronInViewAlgs", viewAlgs + [ theElectronFex ])
    electronInViewAlgs = seqAND("electronInViewAlgs",
                                viewAlgs + [theElectronFex])
    l2ElectronViewsMaker.ViewNodeName = "electronInViewAlgs"

    electronAthSequence = seqAND("electronAthSequence",
                                 [l2ElectronViewsMaker, electronInViewAlgs])
    return (electronAthSequence, l2ElectronViewsMaker,
            theElectronFex.ElectronsName)
示例#2
0
def tauCoreTrackSequence(RoIs, name):

    tauCoreTrackSequence = seqAND(name)

    from TrigInDetConfig.InDetSetup import makeInDetAlgs
    viewAlgs, viewVerify = makeInDetAlgs(
        whichSignature='TauCore',
        separateTrackParticleCreator="TauCore",
        rois=RoIs)

    for viewAlg in viewAlgs:
        if "InDetTrigTrackParticleCreatorAlg" in viewAlg.name():
            TrackCollection = viewAlg.TrackName

    if "MVA" in name:
        viewVerify.DataObjects += [
            ('xAOD::TauJetContainer',
             'StoreGateSvc+HLT_TrigTauRecMerged_CaloOnlyMVA')
        ]
    else:
        viewVerify.DataObjects += [
            ('xAOD::TauJetContainer',
             'StoreGateSvc+HLT_TrigTauRecMerged_CaloOnly')
        ]

    viewVerify.DataObjects += [
        ('TrigRoiDescriptorCollection', 'StoreGateSvc+' + RoIs),
        ('IDCInDetBSErrContainer', 'StoreGateSvc+SCT_ByteStreamErrs')
    ]  #For some reason not picked up properly

    from IOVDbSvc.CondDB import conddb
    if not conddb.folderRequested("PixelClustering/PixelClusNNCalib"):
        viewVerify.DataObjects += [('TTrainedNetworkCollection',
                                    'ConditionStore+PixelClusterNN'),
                                   ('TTrainedNetworkCollection',
                                    'ConditionStore+PixelClusterNNWithTrack')]

    tauTrackRoiUpdaterAlg = _algoTauTrackRoiUpdater(inputRoIs=RoIs,
                                                    tracks=TrackCollection)

    viewAlgs.append(tauTrackRoiUpdaterAlg)

    tauCoreTrackSequence += viewAlgs

    sequenceOut = TrackCollection

    return tauCoreTrackSequence, sequenceOut
示例#3
0
def getSecondStageBjetTracking(inputRoI, dataObjects):
    algSequence = []

    # Second stage of Fast tracking (for precision tracking preparation)
    from TrigInDetConfig.InDetSetup import makeInDetAlgs

    viewAlgs, viewVerify = makeInDetAlgs(whichSignature='Jet',
                                         separateTrackParticleCreator="Bjet",
                                         rois=inputRoI)

    viewVerify.DataObjects += dataObjects

    # Make sure the required objects are still available at whole-event level
    from IOVDbSvc.CondDB import conddb
    from AthenaCommon.AlgSequence import AlgSequence
    topSequence = AlgSequence()
    if not conddb.folderRequested("PixelClustering/PixelClusNNCalib"):
        viewVerify.DataObjects += [('TTrainedNetworkCollection',
                                    'ConditionStore+PixelClusterNN'),
                                   ('TTrainedNetworkCollection',
                                    'ConditionStore+PixelClusterNNWithTrack')]

    from AthenaCommon.GlobalFlags import globalflags
    if not globalflags.InputFormat.is_bytestream():
        viewVerify.DataObjects += [('TRT_RDO_Container',
                                    'StoreGateSvc+TRT_RDOs')]
        topSequence.SGInputLoader.Load += [('TRT_RDO_Container',
                                            'StoreGateSvc+TRT_RDOs')]

    algSequence.append(seqAND("SecondStageFastTrackingSequence", viewAlgs))

    # Precision Tracking
    from TrigInDetConfig.InDetPT import makeInDetPrecisionTracking
    PTTracks, PTTrackParticles, PTAlgs = makeInDetPrecisionTracking(
        "bjet",
        rois=inputRoI,
        inputFTFtracks="TrigFastTrackFinder_Tracks_Bjet")
    algSequence.append(seqAND("PrecisionTrackingSequence", PTAlgs))

    return [algSequence, PTTrackParticles]
示例#4
0
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 )
示例#5
0
def tauIdTrackSequence(RoIs, name):

    tauIdTrackSequence = seqAND(name)

    signName = "Tau"

    if ("Iso" in name) or ("TrackTwo" in name) or ("EF" in name):
        signName = 'TauIso'

    from TrigInDetConfig.InDetSetup import makeInDetAlgs
    viewAlgs, viewVerify = makeInDetAlgs(whichSignature=signName,
                                         separateTrackParticleCreator=signName,
                                         rois=RoIs)

    tauViewDataVerifierName = ""
    if "FTFId" in name:
        tauViewDataVerifierName = "tauViewDataVerifierIdFTF"
    elif "FTFTrackInView" in name:
        tauViewDataVerifierName = "tauViewDataVerifierTrackFTF"
    elif "FTFTrackTwo" in name:
        tauViewDataVerifierName = "tauViewDataVerifierTrackTwoFTF"
    elif "FTFIso" in name:
        tauViewDataVerifierName = "tauViewDataVerifierIsoFTF"
    elif "EF" in name:
        tauViewDataVerifierName = "tauViewDataVerifierEF"

    from TrigInDetConfig.InDetSetup import makeInDetAlgs
    viewAlgs, viewVerify = makeInDetAlgs(whichSignature=signName,
                                         separateTrackParticleCreator=signName,
                                         rois=RoIs,
                                         viewVerifier=tauViewDataVerifierName)

    if "FTFIso" in name:
        viewVerify.DataObjects += [
            ('xAOD::TauJetContainer',
             'StoreGateSvc+HLT_TrigTauRecMerged_CaloOnlyMVA')
        ]
    else:
        viewVerify.DataObjects += [
            ('xAOD::TauJetContainer',
             'StoreGateSvc+HLT_TrigTauRecMerged_CaloOnly')
        ]

    viewVerify.DataObjects += [
        ('xAOD::TauTrackContainer', 'StoreGateSvc+HLT_tautrack_dummy'),
        ('TrigRoiDescriptorCollection', 'StoreGateSvc+' + RoIs),
        ('xAOD::EventInfo', 'StoreGateSvc+EventInfo'),
        ('SG::AuxElement', 'StoreGateSvc+EventInfo.AveIntPerXDecor'),
        ('SG::AuxElement', 'StoreGateSvc+EventInfo.ActIntPerXDecor'),
        ('TrigRoiDescriptorCollection', 'StoreGateSvc+TAUCaloRoIs')
    ]

    # Make sure the required objects are still available at whole-event level
    from AthenaCommon.AlgSequence import AlgSequence
    topSequence = AlgSequence()

    from IOVDbSvc.CondDB import conddb
    if not conddb.folderRequested("PixelClustering/PixelClusNNCalib"):
        viewVerify.DataObjects += [('TTrainedNetworkCollection',
                                    'ConditionStore+PixelClusterNN'),
                                   ('TTrainedNetworkCollection',
                                    'ConditionStore+PixelClusterNNWithTrack')]

    if globalflags.InputFormat.is_bytestream():
        viewVerify.DataObjects += [
            ('InDetBSErrContainer', 'StoreGateSvc+PixelByteStreamErrs'),
            ('IDCInDetBSErrContainer', 'StoreGateSvc+SCT_ByteStreamErrs')
        ]
    else:
        topSequence.SGInputLoader.Load += [('TRT_RDO_Container',
                                            'StoreGateSvc+TRT_RDOs')]
        viewVerify.DataObjects += [('TRT_RDO_Container',
                                    'StoreGateSvc+TRT_RDOs')]

    for viewAlg in viewAlgs:
        tauIdTrackSequence += viewAlg
        if "TrigFastTrackFinder" in viewAlg.name():
            TrackCollection = viewAlg.TracksName
        if "InDetTrigTrackParticleCreatorAlg" in viewAlg.name():
            TrackParticlesName = viewAlg.TrackParticlesName

    if "FTFTrackInView" in name:
        tauPreselectionAlg = _algoTauPreselection(inputRoIs=RoIs,
                                                  tracks=TrackParticlesName,
                                                  step="Track")
        tauIdTrackSequence += tauPreselectionAlg
    elif "TrackTwo" in name:
        tauPreselectionAlg = _algoTauPreselection(inputRoIs=RoIs,
                                                  tracks=TrackParticlesName,
                                                  step="TrackTwo")
        tauIdTrackSequence += tauPreselectionAlg

    #Precision Tracking
    PTAlgs = []  #List of precision tracking algs
    PTTracks = []  #List of TrackCollectionKeys
    PTTrackParticles = []  #List of TrackParticleKeys

    from TrigInDetConfig.InDetPT import makeInDetPrecisionTracking
    #When run in a different view than FTF some data dependencies needs to be loaded through verifier
    #Pass verifier as an argument and it will automatically append necessary DataObjects@NOTE: Don't provide any verifier if loaded in the same view as FTF

    precName = ""
    if "FTFId" in name:
        precName = 'tauId'
    elif "FTFTrackInView" in name:
        precName = 'tauTrk'
    elif "FTFTrackTwo" in name:
        precName = 'tauTrkTwo'
    elif "FTFIso" in name:
        precName = 'tau'
    elif "EF" in name:
        precName = 'tauEF'

    PTTracks, PTTrackParticles, PTAlgs = makeInDetPrecisionTracking(
        precName, verifier=False, rois=RoIs, inputFTFtracks=TrackCollection)
    PTSeq = parOR("precisionTrackingIn" + precName, PTAlgs)

    #Get last tracks from the list as input for other alg
    tauIdTrackSequence += PTSeq
    trackParticles = PTTrackParticles[-1]

    if "FTFId" in name:
        tauPrecisionAlg = _algoTauPrecision(inputRoIs=RoIs,
                                            tracks=trackParticles,
                                            step="Id")
    elif "FTFTrackInView" in name:
        tauPrecisionAlg = _algoTauPrecision(inputRoIs=RoIs,
                                            tracks=trackParticles,
                                            step="Track")
    elif "FTFTrackTwo" in name:
        tauPrecisionAlg = _algoTauPrecision(inputRoIs=RoIs,
                                            tracks=trackParticles,
                                            step="TrackTwo")
    elif "FTFIso" in name:
        tauPrecisionAlg = _algoTauPrecisionMVA(inputRoIs=RoIs,
                                               tracks=trackParticles,
                                               step="PrecisionMVA")
    elif "EF" in name:
        tauPrecisionAlg = _algoTauPrecisionMVA(inputRoIs=RoIs,
                                               tracks=trackParticles,
                                               step="EF")

    tauIdTrackSequence += tauPrecisionAlg
    sequenceOut = tauPrecisionAlg.Key_trigTauJetOutputContainer

    return tauIdTrackSequence, sequenceOut
示例#6
0
    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
示例#7
0
    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