Пример #1
0
    def __configure(self):
        recoSeq = GaudiSequencer("Hlt2JetRecoSequence", ModeOR = True, ShortCircuit = False)

        from HltTracking.Hlt2TrackingConfigurations import Hlt2BiKalmanFittedForwardTracking
        from HltTracking.Hlt2TrackingConfigurations import Hlt2BiKalmanFittedDownstreamTracking

        # Long charged proto particles
        longTracking = Hlt2BiKalmanFittedForwardTracking()
        longChargedProtos = longTracking.hlt2ChargedNoPIDsProtos()
        longSeq = GaudiSequencer("Hlt2JetLongRecoSequence", Members = longChargedProtos.members())

        # Downstream charged proto particles
        downTracking = Hlt2BiKalmanFittedDownstreamTracking()
        downChargedProtos = downTracking.hlt2ChargedNoPIDsProtos()
        downSeq = GaudiSequencer("Hlt2JetDownRecoSequence", Members = downChargedProtos.members())

        from Hlt2SharedParticles.TrackFittedBasicParticles import BiKalmanFittedPhotons as Photons
        from Hlt2SharedParticles.Pi0 import ResolvedPi0s
        from Hlt2SharedParticles.Pi0 import MergedPi0s
        from Hlt2SharedParticles.Ks import KsLLTF as KsLL
        from Hlt2SharedParticles.Ks import KsLLTF as KsDD
        from Hlt2SharedParticles.Lambda import LambdaLLTrackFitted as LambdaLL
        from Hlt2SharedParticles.Lambda import LambdaDDTrackFitted as LambdaDD

        self.__caloProcessor = longTracking.caloProcessor()
        ecalSeq = self.__caloProcessor.clusters()

        inputs = [
            ['Particle',       'particle', self.__sharedParticleInput(Photons, "Photons")],
            ['Particle',       'particle', self.__sharedParticleInput(ResolvedPi0s, "ResolvedPi0s")],
            ['Particle',       'particle', self.__sharedParticleInput(MergedPi0s, "MergedPi0s")],
            ['Particle',       'particle', self.__sharedParticleInput(KsLL, "KsLL")],
            ['Particle',       'particle', self.__sharedParticleInput(KsDD, "KsDD")],
            ['Particle',       'particle', self.__sharedParticleInput(LambdaLL, "LambdaLL")],
            ['Particle',       'particle', self.__sharedParticleInput(LambdaDD, "LambdaDD")],
            ['ProtoParticle',  'best',     (longSeq, longChargedProtos.outputSelection())],
            ['ProtoParticle',  'best',     (downSeq, downChargedProtos.outputSelection())],
            ['CaloCluster',    'gamma',    (None, self.__findCaloLocation(Photons.members(), CellularAutomatonAlg, "OutputData"))],
            ['CaloCluster',    'gamma',    self.__hcalClusters()],
            ['IClusTrTable2D', 'ecal',     (None, self.__findCaloLocation(Photons.members(), PhotonMatchAlg, "Output"))],
            ['IClusTrTable2D', 'hcal',     self.__hcal2Track(longTracking, Photons)]
        ]

        pfInputs = []
        for inputClass, inputType, (seq, loc) in inputs:
            if seq and seq not in recoSeq.Members:
                recoSeq.Members += [seq]
            pfInputs.append([inputClass, inputType, loc])

        from Configurables import HltParticleFlow
        particleFlow = HltParticleFlow("HltParticleFlow", **self.getProp('ParticleFlowOptions'))
        particleFlow.Inputs = pfInputs
        particleFlow.Output = "Hlt2/ParticleFlow/Particles"

        from HltLine.HltLine    import bindMembers
        self.__particleFlow = bindMembers("Hlt2Jet", [recoSeq, particleFlow])
Пример #2
0
def myActionHlt2():
    from Gaudi.Configuration import GaudiSequencer
    from Configurables import (PrTrackAssociator, TrackResChecker,
                               TrackOccupChecker, PrChecker2, TrackSelector,
                               MCReconstructible, MCParticleSelector,
                               PrLHCbID2MCParticle, UnpackMCParticle,
                               UnpackMCVertex, DebugTrackingLosses)

    from HltTracking.HltTrackNames import HltSharedTrackLoc, HltSharedTrackRoot, Hlt2TrackRoot, Hlt2TrackLoc, HltDefaultFitSuffix

    PatCheck = GaudiSequencer("CheckPatSeq")

    PrChecker2("PrCheckerHlt2").TriggerNumbers = True
    PrChecker2("PrCheckerHlt2").Eta25Cut = True
    PrChecker2("PrCheckerHlt2").WriteForwardHistos = 1

    PrChecker2("PrCheckerHlt2Forward").TriggerNumbers = True
    PrChecker2("PrCheckerHlt2Forward").Eta25Cut = True
    PrChecker2("PrCheckerHlt2Forward").WriteForwardHistos = 1
    PrChecker2("PrCheckerHlt2Forward"
               ).ForwardTracks = Hlt2TrackLoc["ComplementForward"]
    #(N.B.: container base for velo tracks was renamed to Hlt1)
    # Figure out which HLT is run from HltConf
    PrChecker2("PrCheckerHlt2").SeedTracks = Hlt2TrackLoc["Seeding"]
    PrChecker2("PrCheckerHlt2").MatchTracks = Hlt2TrackLoc["Match"]
    PrChecker2("PrCheckerHlt2").DownTracks = Hlt2TrackLoc["Downstream"]
    PrChecker2("PrCheckerHlt2").ForwardTracks = Hlt2TrackLoc["Forward"]

    from HltTracking.Hlt2TrackingConfigurations import Hlt2BiKalmanFittedForwardTracking
    from HltTracking.Hlt2TrackingConfigurations import Hlt2BiKalmanFittedDownstreamTracking
    tracks = Hlt2BiKalmanFittedForwardTracking().hlt2PrepareTracks()
    tracksDown = Hlt2BiKalmanFittedDownstreamTracking().hlt2PrepareTracks()
    PrChecker2("PrCheckerHlt2").BestTracks = tracks.outputSelection()
    PrChecker2("PrCheckerHlt2Down").BestTracks = tracksDown.outputSelection()
    #PrChecker2("PrCheckerHlt2").DownTracks = tracksDown.outputSelection()

    PrTrackAssociator("AssocAllHlt2").RootOfContainers = Hlt2TrackRoot
    PrTrackAssociator("AssocFittedHlt2"
                      ).RootOfContainers = Hlt2TrackRoot + HltDefaultFitSuffix
    print tracks.outputSelection()
    print Hlt2TrackRoot + HltDefaultFitSuffix
    print tracks.outputSelection()
    print Hlt2TrackRoot + HltDefaultFitSuffix
    print tracks.outputSelection()
    print Hlt2TrackRoot + HltDefaultFitSuffix

    PatCheck.Members += [
        PrTrackAssociator("AssocAllHlt2"),
        PrTrackAssociator("AssocFittedHlt2")
    ]
    PatCheck.Members += [PrChecker2("PrCheckerHlt2Forward")]
    PatCheck.Members += [PrChecker2("PrCheckerHlt2")]
    PatCheck.Members += [PrChecker2("PrCheckerHlt2Down")]
Пример #3
0
    def configureReconstruction(self):

        definedTrackings = [
            Hlt2BiKalmanFittedDownstreamTracking(),
            Hlt2BiKalmanFittedForwardTracking(),
            Hlt2MuonTTTracking(),
            Hlt2VeloMuonTracking(),
            Hlt2FullDownstreamTracking()
        ]

        # And now we have to, for each of the configurables we just created,
        # tell it the data type and tell it to use all the Hlt2 lines...
        from HltLine.HltLinesConfigurableUser import HltLinesConfigurableUser
        from Gaudi.Configuration import ConfigurableUser
        from HltTracking.Hlt2TrackingConfigurations import setDataTypeForTracking
        for thistracking in definedTrackings:
            setDataTypeForTracking(thistracking, self.getProp("DataType"))
            if self.getProp('Hlt2ForwardMaxVelo') and hasattr(
                    thistracking, 'Hlt2ForwardMaxVelo'):
                thistracking.Hlt2ForwardMaxVelo = self.getProp(
                    "Hlt2ForwardMaxVelo")
Пример #4
0
    def __apply_configuration__(self):
        """Apply the HLT persist reco configuration."""

        from Configurables import GaudiSequencer
        from Configurables import LoKi__HDRFilter
        from Configurables import TrackToDST

        persistRecoSeq = self.getProp("Sequence")
        if not self.getProp("Sequence"):
            return
        persistRecoSeq.IgnoreFilterPassed = False
        persistRecoSeq.Members = []

        # This sequence expects the proper line filter to be applied already

        # Cut down states in tracks first
        tracks = Hlt2BiKalmanFittedForwardTracking().hlt2PrepareTracks()
        tracksDown = Hlt2BiKalmanFittedDownstreamTracking().hlt2PrepareTracks()
        longStateCutter = TrackToDST("TrackToDSTLong")
        longStateCutter.TracksInContainer = tracks.outputSelection()
        downStateCutter = TrackToDST("TrackToDSTDown")
        downStateCutter.TracksInContainer = tracksDown.outputSelection()
        persistRecoSeq.Members += [longStateCutter]
        persistRecoSeq.Members += [downStateCutter]

        # Setup packers and add them to the sequence
        packerAlgs = self._packers()
        persistRecoSeq.Members += packerAlgs

        # Configure HltPackedDataWriter algorithm to add to the raw banks
        pdwriter = HltPackedDataWriter("Hlt2PackedDataWriter")
        pdwriter.Containers = [
            out for inp, out in self.packedObjectLocations()
        ]
        persistRecoSeq.Members += [pdwriter]

        # Register the mapping of output locations and integers
        self._registerToHltANNSvc()
Пример #5
0
from Gaudi.Configuration import *
from HltLine.HltLine import bindMembers
from Configurables import NoPIDsParticleMaker, CombinedParticleMaker, TrackSelector
from Configurables import PhotonMaker, PhotonMakerAlg
from Configurables import ProtoParticleCALOFilter, ProtoParticleMUONFilter
from GaudiKernel.SystemOfUnits import MeV
#
# Forward fitted
#
from HltTracking.Hlt2TrackingConfigurations import Hlt2BiKalmanFittedForwardTracking
Hlt2BiKalmanFittedForwardTracking = Hlt2BiKalmanFittedForwardTracking()
#
# Now the downstream tracking
#
from HltTracking.Hlt2TrackingConfigurations import Hlt2BiKalmanFittedDownstreamTracking
Hlt2BiKalmanFittedDownstreamTracking = Hlt2BiKalmanFittedDownstreamTracking()

##########################################################################
#
# Now all PID
#
##########################################################################
#
# Charged hadron protoparticles, no Rich
#
#BiKalmanFittedChargedProtoMaker                        = Hlt2BiKalmanFittedForwardTracking.hlt2ChargedNoPIDsProtos()
BiKalmanFittedChargedProtoMaker = Hlt2BiKalmanFittedForwardTracking.hlt2ChargedAllPIDsProtos(
)
#
# Downstream hadron protoparticles, no Rich
#
Пример #6
0
    def __apply_configuration__(self):
        """
        HLT Afterburner configuration
        """
        from HltTracking.Hlt2TrackingConfigurations import Hlt2BiKalmanFittedForwardTracking
        from HltTracking.Hlt2TrackingConfigurations import Hlt2BiKalmanFittedDownstreamTracking

        Afterburner = self.getProp("Sequence") if self.isPropertySet(
            "Sequence") else None
        if not Afterburner:
            return
        AfterburnerFilterSeq = Sequence("HltAfterburnerFilterSequence")
        Afterburner.Members += [AfterburnerFilterSeq]
        if self.getProp("Hlt2Filter"):
            from DAQSys.Decoders import DecoderDB
            decoder = DecoderDB["HltDecReportsDecoder/Hlt2DecReportsDecoder"]
            from Configurables import LoKi__HDRFilter as HDRFilter
            hlt2Filter = HDRFilter('HltAfterburnerHlt2Filter',
                                   Code=self.getProp("Hlt2Filter"),
                                   Location=decoder.listOutputs()[0])
            AfterburnerFilterSeq.Members += [hlt2Filter]
        AfterburnerSeq = Sequence("HltAfterburnerSequence",
                                  IgnoreFilterPassed=True)
        AfterburnerFilterSeq.Members += [AfterburnerSeq]
        if self.getProp("EnableHltRecSummary"):
            from Configurables import RecSummaryAlg
            seq = Sequence("RecSummarySequence")

            tracks = Hlt2BiKalmanFittedForwardTracking().hlt2PrepareTracks()
            tracksDown = Hlt2BiKalmanFittedDownstreamTracking(
            ).hlt2PrepareTracks()
            muonID = Hlt2BiKalmanFittedForwardTracking().hlt2MuonID()

            from HltLine.HltDecodeRaw import DecodeVELO, DecodeIT, DecodeTT, DecodeSPD, DecodeMUON
            decoders = {
                "Velo": (DecodeVELO, "VeloLiteClustersLocation"),
                "TT": (DecodeTT, "clusterLocation"),
                "IT": (DecodeIT, "clusterLocation"),
                "SPD": (DecodeSPD, "DigitsContainer"),
                'Muon': (DecodeMUON, "OutputLocation"),
                'MuonTr': (muonID, "MuonTrackLocation")
            }
            decoders = {
                k: (bm.members(), bm.members()[-1].getProp(loc))
                for (k, (bm, loc)) in decoders.iteritems()
            }

            from HltTracking.HltPVs import PV3D
            PVs = PV3D("Hlt2")
            from HltTracking.HltTrackNames import Hlt2TrackLoc
            recSeq = Sequence("RecSummaryRecoSequence",
                              IgnoreFilterPassed=True)
            from itertools import chain
            from Hlt2Lines.Utilities.Utilities import uniqueEverseen
            recSeq.Members = list(
                uniqueEverseen(
                    chain.from_iterable(
                        [dec[0] for dec in decoders.itervalues()] +
                        [tracks, tracksDown, muonID, PVs])))
            summary = RecSummaryAlg(
                'Hlt2RecSummary',
                SummaryLocation=self.getProp("RecSummaryLocation"),
                HltSplitTracks=True,
                SplitLongTracksLocation=tracks.outputSelection(),
                SplitDownTracksLocation=tracksDown.outputSelection(),
                PVsLocation=PVs.output,
                VeloClustersLocation=decoders['Velo'][1],
                ITClustersLocation=decoders['IT'][1],
                TTClustersLocation=decoders['TT'][1],
                SpdDigitsLocation=decoders['SPD'][1],
                MuonCoordsLocation=decoders['Muon'][1],
                MuonTracksLocation=decoders['MuonTr'][1])
            seq.Members = [recSeq, summary]
            AfterburnerSeq.Members += [seq]

        if self.getProp("AddAdditionalTrackInfos"):
            from GaudiKernel.SystemOfUnits import mm
            from Configurables import LoKi__VoidFilter as Filter
            trackLocations = [
                Hlt2BiKalmanFittedForwardTracking().hlt2PrepareTracks(
                ).outputSelection(),
                Hlt2BiKalmanFittedDownstreamTracking().hlt2PrepareTracks().
                outputSelection()
            ]
            infoSeq = Sequence("TrackInfoSequence", IgnoreFilterPassed=True)
            # I don't want to pull in reconstruction if not run before, then there should be also no candidates needing this information
            # This is anyhow done by the RecSummary above
            members = [
                Hlt2BiKalmanFittedForwardTracking().hlt2PrepareTracks(
                ).members() + Hlt2BiKalmanFittedDownstreamTracking().
                hlt2PrepareTracks().members()
            ]
            infoSeq.Members += list(
                uniqueEverseen(chain.from_iterable(members)))
            prefix = "Hlt2"
            trackClones = Sequence(prefix + "TrackClonesSeq")
            #checkTracks =  Filter(prefix+"CheckTrackLoc",Code = "EXISTS('%(trackLocLong)s') & EXISTS('%(trackLocDown)s')" % {"trackLocLong" : trackLocations[0], "trackLocDown" : trackLocations[1]})
            #trackClones.Members += [checkTracks]
            from Configurables import TrackBuildCloneTable, TrackCloneCleaner
            cloneTable = TrackBuildCloneTable(prefix + "FindTrackClones")
            cloneTable.maxDz = 500 * mm
            cloneTable.zStates = [0 * mm, 990 * mm, 9450 * mm]
            cloneTable.klCut = 5e3
            cloneTable.inputLocations = trackLocations
            cloneTable.outputLocation = trackLocations[
                0] + "Downstream" + "Clones"
            cloneCleaner = TrackCloneCleaner(prefix + "FlagTrackClones")
            cloneCleaner.CloneCut = 5e3
            cloneCleaner.inputLocations = trackLocations
            cloneCleaner.linkerLocation = cloneTable.outputLocation
            trackClones.Members += [cloneTable, cloneCleaner]

            infoSeq.Members += [trackClones]

            AfterburnerSeq.Members += [infoSeq]

            # Add VeloCharge to protoparticles for dedx
            veloChargeSeq = Sequence("VeloChargeSequence")
            from Configurables import ChargedProtoParticleAddVeloInfo
            protoLocation = Hlt2BiKalmanFittedForwardTracking(
            ).hlt2ChargedAllPIDsProtos().outputSelection()
            checkProto = Filter("CheckProtoParticles",
                                Code="EXISTS('%(protoLoc)s')" %
                                {"protoLoc": protoLocation})
            addVeloCharge = ChargedProtoParticleAddVeloInfo(
                "Hlt2AddVeloCharge")
            addVeloCharge.ProtoParticleLocation = protoLocation
            decodeVeloFullClusters = DecoderDB[
                "DecodeVeloRawBuffer/createVeloClusters"].setup()
            veloChargeSeq.Members += [
                checkProto, decodeVeloFullClusters, addVeloCharge
            ]
            AfterburnerSeq.Members += [veloChargeSeq]

        persistRecoLines = self._persistRecoLines()
        if self.getProp("AddPIDToDownstream") and (
                len(persistRecoLines) > 0
                or len(self.getProp("Hlt2DownstreamFilter")) > 0):
            from Configurables import LoKi__HDRFilter as HDRFilter
            if (len(persistRecoLines) > 0
                    and len(self.getProp("Hlt2DownstreamFilter")) > 0):
                code = self._persistRecoFilterCode(
                    persistRecoLines) + " | " + self._filterCode(
                        self.getProp("Hlt2DownstreamFilter"))
            elif len(persistRecoLines) > 0:
                code = self._persistRecoFilterCode(persistRecoLines)
            elif len(self.getProp("Hlt2DownstreamFilter")) > 0:
                code = self._filterCode(self.getProp("Hlt2DownstreamFilter"))
            # Activate Downstream RICH for all PersistReco lines
            from DAQSys.Decoders import DecoderDB
            decoder = DecoderDB["HltDecReportsDecoder/Hlt2DecReportsDecoder"]
            hlt2DownstreamFilter = HDRFilter('DownstreamHlt2Filter',
                                             Code=code,
                                             Location=decoder.listOutputs()[0])
            downstreamPIDSequence = Sequence("Hlt2AfterburnerDownstreamPIDSeq")
            downstreamPIDSequence.Members += [hlt2DownstreamFilter]
            downstreamTracking = Hlt2BiKalmanFittedDownstreamTracking()
            tracksDown = downstreamTracking.hlt2PrepareTracks()
            protosDown = downstreamTracking.hlt2ChargedNoPIDsProtos()
            chargedProtosOutputLocation = protosDown.outputSelection()
            richPid = downstreamTracking.hlt2RICHID()
            downstreamPIDSequence.Members += list(
                uniqueEverseen(
                    chain.from_iterable([tracksDown, protosDown, richPid])))
            from Configurables import ChargedProtoParticleAddRichInfo, ChargedProtoParticleAddMuonInfo
            downstreamRichDLL_name = "Hlt2AfterburnerDownstreamProtoPAddRich"
            downstreamRichDLL = ChargedProtoParticleAddRichInfo(
                downstreamRichDLL_name)
            downstreamRichDLL.InputRichPIDLocation = richPid.outputSelection()
            downstreamRichDLL.ProtoParticleLocation = chargedProtosOutputLocation
            # Add the muon info to the DLL
            downstreamMuon_name = "Hlt2AfterburnerDownstreamProtoPAddMuon"
            downstreamMuon = ChargedProtoParticleAddMuonInfo(
                downstreamMuon_name)
            downstreamMuon.ProtoParticleLocation = chargedProtosOutputLocation
            downstreamMuon.InputMuonPIDLocation = downstreamTracking.hlt2MuonID(
            ).outputSelection()
            # Add the Calo info to the DLL
            #
            from Configurables import (ChargedProtoParticleAddEcalInfo,
                                       ChargedProtoParticleAddBremInfo,
                                       ChargedProtoParticleAddHcalInfo,
                                       ChargedProtoParticleAddPrsInfo,
                                       ChargedProtoParticleAddSpdInfo)
            caloPidLocation = downstreamTracking.hlt2CALOID().outputSelection()
            downstreamEcal = ChargedProtoParticleAddEcalInfo(
                "HltAfterburnerDownstreamProtoPAddEcal")
            downstreamBrem = ChargedProtoParticleAddBremInfo(
                "HltAfterburnerDownstreamProtoPAddBrem")
            downstreamHcal = ChargedProtoParticleAddHcalInfo(
                "HltAfterburnerDownstreamProtoPAddHcal")
            downstreamPrs = ChargedProtoParticleAddPrsInfo(
                "HltAfterburnerDownstreamProtoPAddPrs")
            downstreamSpd = ChargedProtoParticleAddSpdInfo(
                "HltAfterburnerDownstreamProtoPAddSpd")
            for alg in (downstreamEcal, downstreamBrem, downstreamHcal,
                        downstreamPrs, downstreamSpd):
                alg.setProp("ProtoParticleLocation",
                            chargedProtosOutputLocation)
                alg.setProp("Context", caloPidLocation)
                downstreamPIDSequence.Members += [alg]

            from Configurables import ChargedProtoCombineDLLsAlg, ChargedProtoANNPIDConf
            downstreamCombine_name = "Hlt2AfterburnerDownstreamRichCombDLLs"
            downstreamCombine = ChargedProtoCombineDLLsAlg(
                downstreamCombine_name)
            downstreamCombine.ProtoParticleLocation = downstreamTracking.hlt2ChargedNoPIDsProtos(
            ).outputSelection()
            from Hlt2Lines.Utilities.Utilities import uniqueEverseen
            downstreamPIDSequence.Members += [
                downstreamMuon, downstreamRichDLL, downstreamCombine
            ]
            probNNDownSeqName = self._instanceName(ChargedProtoANNPIDConf)

            probNNDownSeq = GaudiSequencer(probNNDownSeqName + "Seq")
            annconfDown = ChargedProtoANNPIDConf(probNNDownSeqName)
            annconfDown.DataType = downstreamTracking.DataType
            annconfDown.TrackTypes = ["Downstream"]
            annconfDown.RecoSequencer = probNNDownSeq
            annconfDown.ProtoParticlesLocation = downstreamTracking.hlt2ChargedNoPIDsProtos(
            ).outputSelection()
            downstreamPIDSequence.Members += [probNNDownSeq]
            AfterburnerSeq.Members += [downstreamPIDSequence]

        # Configure and add the persist reco
        AfterburnerSeq.Members += [self._persistRecoSeq()]
Пример #7
0
    def _packers(self):
        """Return a list with the packer algorithms."""

        try:
            return self._packersCache
        except AttributeError:
            pass

        longTracking = Hlt2BiKalmanFittedForwardTracking()
        downstreamTracking = Hlt2BiKalmanFittedDownstreamTracking()
        caloHypoPrefix = self.getProp("CaloHypoPrefix")

        from Configurables import PackProtoParticle
        from Configurables import DataPacking__Pack_LHCb__RichPIDPacker_ as PackRichPIDs
        from Configurables import DataPacking__Pack_LHCb__MuonPIDPacker_ as PackMuonPIDs
        from Configurables import PackTrack
        from Configurables import PackProtoParticle
        from Configurables import DataPacking__Pack_LHCb__CaloClusterPacker_ as PackCaloClusters
        # from Configurables import DataPacking__Pack_LHCb__CaloHypoPacker_ as PackCaloHypos
        from Configurables import PackCaloHypo as PackCaloHypos

        algs = [
            # ProtoParticles
            PackProtoParticle(name="Hlt2PackChargedProtos",
                              InputName=longTracking.hlt2ChargedAllPIDsProtos(
                              ).outputSelection(),
                              OutputName="Hlt2/pRec/long/Protos"),
            PackProtoParticle(name="Hlt2PackChargedDownProtos",
                              InputName=downstreamTracking.
                              hlt2ChargedNoPIDsProtos().outputSelection(),
                              OutputName="Hlt2/pRec/down/Protos"),
            # RICH PIDs
            PackRichPIDs(name="Hlt2PackLongRichPIDs",
                         InputName=longTracking.hlt2RICHID().outputSelection(),
                         OutputName="Hlt2/pRec/long/RichPIDs"),
            PackRichPIDs(
                name="Hlt2PackDownRichPIDs",
                InputName=downstreamTracking.hlt2RICHID().outputSelection(),
                OutputName="Hlt2/pRec/down/RichPIDs"),
            # MUON PIDs
            PackMuonPIDs(name="Hlt2PackMuonPIDs",
                         InputName=longTracking.hlt2MuonID().outputSelection(),
                         OutputName="Hlt2/pRec/long/MuonIDs"),
            # Tracks
            PackTrack(
                name="Hlt2PackLongTracks",
                InputName=longTracking.hlt2PrepareTracks().outputSelection(),
                OutputName="Hlt2/pRec/long/Tracks"),
            PackTrack(name="Hlt2PackDownTracks",
                      InputName=downstreamTracking.hlt2PrepareTracks().
                      outputSelection(),
                      OutputName="Hlt2/pRec/down/Tracks"),
            PackTrack(name="Hlt2PackDownPIDMuonSegments",
                      InputName=downstreamTracking._trackifiedMuonIDLocation(),
                      OutputName="Hlt2/pRec/down/PID/MuonSegments"),

            # Neutral protoparticles are in the same place as the charged with "Neutrals" replacing "Charged"
            PackProtoParticle(
                name="Hlt2PackNeutralProtoP",
                InputName=longTracking.hlt2NeutralProtos().outputSelection(),
                OutputName="Hlt2/pRec/neutral/Protos"),
            # Neutral CaloClusters
            PackCaloClusters(name="Hlt2PackCaloClusters",
                             InputName="Hlt/Calo/EcalClusters",
                             OutputName="Hlt2/pRec/neutral/CaloClusters"),
            PackCaloClusters(name="Hlt2PackEcalSplitClusters",
                             InputName=caloHypoPrefix + "/EcalSplitClusters",
                             OutputName="Hlt2/pRec/neutral/EcalSplitClusters"),
            # Neutral Calo Hypos
            PackCaloHypos(name="Hlt2PackCaloElectronHypos",
                          InputName=caloHypoPrefix + "/Electrons",
                          OutputName="Hlt2/pRec/neutral/Electrons"),
            PackCaloHypos(name="Hlt2PackCaloPhotonsHypos",
                          InputName=caloHypoPrefix + "/Photons",
                          OutputName="Hlt2/pRec/neutral/Photons"),
            PackCaloHypos(name="Hlt2PackCaloMergedPi0Hypos",
                          InputName=caloHypoPrefix + "/MergedPi0s",
                          OutputName="Hlt2/pRec/neutral/MergedPi0s"),
            PackCaloHypos(name="Hlt2PackCaloSplitPhotonHypos",
                          InputName=caloHypoPrefix + "/SplitPhotons",
                          OutputName="Hlt2/pRec/neutral/SplitPhotons"),
        ]

        for alg in algs:
            alg.AlwaysCreateOutput = True
            alg.DeleteInput = False
            alg.OutputLevel = self.getProp("OutputLevel")
            if not alg.InputName.startswith('/Event/'):
                # This is needed to have the full locations registered in ANNSvc
                alg.InputName = '/Event/' + alg.InputName

        # Check that the output locations are consistent with the decoder
        from DAQSys.Decoders import DecoderDB
        try:
            decoder = DecoderDB["HltPackedDataDecoder/Hlt2PackedDataDecoder"]
        except KeyError:
            # TODO remove that for a release on the most recent DAQSys
            decoder = None
        if decoder:
            decoder_outputs = sorted(decoder.listOutputs())
            configured_outputs = sorted(alg.OutputName for alg in algs)
            if configured_outputs != decoder_outputs:
                log.warning('Configured output locations: {}'.format(
                    configured_outputs))
                log.warning(
                    'Configured decoder locations: {}'.format(decoder_outputs))
                raise ValueError(
                    'Configured output locations do not match the decoder!' +
                    'Please update the DecoderDB (Decoders.py)!')

        self._packersCache = algs
        return algs
Пример #8
0
##
# =============================================================================
__author__ = "V. Gligorov [email protected]"
# =============================================================================
from Gaudi.Configuration import *
from HltLine.HltLine import bindMembers, Hlt2Member
from Configurables import FilterDesktop
from Configurables import CombinedParticleMaker, BestPIDParticleMaker, NoPIDsParticleMaker, TrackSelector
from Configurables import ProtoParticleMUONFilter
#
# These are all based on fitted tracks
#
from HltTracking.Hlt2TrackingConfigurations import Hlt2BiKalmanFittedForwardTracking, Hlt2BiKalmanFittedDownstreamTracking

Hlt2BiKalmanFittedForwardTracking = Hlt2BiKalmanFittedForwardTracking()
Hlt2BiKalmanFittedDownstreamTracking = Hlt2BiKalmanFittedDownstreamTracking()

# Tag and probe tracking configurations
from HltTracking.Hlt2ProbeTrackingConfigurations import (
    Hlt2MuonTTTracking, Hlt2VeloMuonTracking, Hlt2FullDownstreamTracking)

Hlt2MuonTTTracking = Hlt2MuonTTTracking()
Hlt2VeloMuonTracking = Hlt2VeloMuonTracking()
Hlt2FullDownstreamTracking = Hlt2FullDownstreamTracking()

##########################################################################
#
# Charged protoparticles -> pulls all the pid
#
caloProtos = Hlt2BiKalmanFittedForwardTracking.hlt2ChargedCaloProtos()
muonWithCaloProtos = Hlt2BiKalmanFittedForwardTracking.hlt2ChargedMuonWithCaloProtos(