Esempio n. 1
0
def selMuonPParts(name, DataType, downstreamSeq):
   """
       Make ProtoParticles out of Downstream tracks
   """
   unpacker = UnpackTrack(name+"UnpackTrack")  # do we need this or is it here for historical reason ?
   unpacker.InputName="pRec/Downstream/FittedTracks"
   unpacker.OutputName="Rec/Downstream/FittedTracks"

   idalg = MuonIDAlg(name+"IDalg")
   cm=ConfiguredMuonIDs.ConfiguredMuonIDs( DataType ) #data=DaVinci().getProp("DataType"))
   cm.configureMuonIDAlg(idalg)
   idalg.TrackLocation = "Rec/Downstream/FittedTracks"
   idalg.MuonIDLocation = "Rec/Muon/MuonPID/Downstream"
   idalg.MuonTrackLocation = "Rec/Track/MuonForDownstream" # I would call it FromDownstream …but just to be »Klugscheißer«

   downprotoseq = GaudiSequencer(name+"ProtoPSeq")
   downprotos = ChargedProtoParticleMaker(name+"ProtoPMaker")
   downprotos.Inputs = ["Rec/Downstream/FittedTracks"]
   downprotos.Output = "Rec/ProtoP/"+name+"ProtoPMaker/ProtoParticles"
   downprotos.addTool( DelegatingTrackSelector, name="TrackSelector" )
   #tracktypes = [ "Long","Upstream","Downstream","Ttrack","Velo","VeloR" ] # only downstream needed …
   tracktypes = ["Downstream"]
   #if (trackcont == "Best") :
   #	tracktypes = [ "Long" ]
   downprotos.TrackSelector.TrackTypes = tracktypes
   selector = downprotos.TrackSelector
   for tsname in tracktypes:
   	selector.addTool(TrackSelector,name=tsname)
   	ts = getattr(selector,tsname)
   	# Set Cuts
   	ts.TrackTypes = [tsname]
#	ts.MinNDoF = 1 
	ts.MaxChi2Cut = 10

   addmuonpid = ChargedProtoParticleAddMuonInfo(name+"addmuoninfo")
   addmuonpid.InputMuonPIDLocation = "Rec/Muon/MuonPID/Downstream"
   addmuonpid.ProtoParticleLocation = "Rec/ProtoP/"+name+"ProtoPMaker/ProtoParticles"
   #addmuonpid.OutputLevel = 0
   combinedll = ChargedProtoCombineDLLsAlg(name+"CombineDLL")
   combinedll.ProtoParticleLocation = "Rec/ProtoP/"+name+"ProtoPMaker/ProtoParticles"
   #combinedll.OutputLevel = 0
   # DST post treatment
   #TrackToDST(name+"TrackToDST").TracksInContainer = "Rec/Downstream/Tracks"
   #downprotoseq.Members += [ TrackToDST(name+"TrackToDST"), downprotos, addmuonpid, combinedll ]
   downprotoseq.Members += [ downprotos, addmuonpid, combinedll ]
#        
   DataOnDemandSvc().AlgMap.update( {
                "/Event/Rec/Downstream/Tracks" : unpacker.getFullName(),
                "/Event/Rec/Muon/MuonPID/Downstream" : idalg.getFullName(),
#                "/Event/Rec/ProtoP/"+name+"ProtoPMaker" : downprotoseq.getFullName()
		} )

   return GSWrapper(name="WrappedDownMuonProtoPSeqFor"+name,
                    sequencer=downprotoseq,
                    output='Rec/ProtoP/' + name +'ProtoPMaker/ProtoParticles',
                    requiredSelections = [ downstreamSeq])
Esempio n. 2
0
def selMuonPParts(name, trackingSeq):
   """
       Make ProtoParticles out of VeloMuon tracks
   """
   unpacker = UnpackTrack(name+"UnpackTrack")
   unpacker.InputName="pRec/VeloMuon/Tracks"
   unpacker.OutputName="Rec/VeloMuon/Tracks"

   veloprotos = ChargedProtoParticleMaker(name+"ProtoPMaker")
   veloprotos.Inputs = ["Rec/VeloMuon/Tracks"]
   veloprotos.Output = "Rec/ProtoP/"+name+"ProtoPMaker/ProtoParticles"
   veloprotos.addTool( DelegatingTrackSelector, name="TrackSelector" )
   tracktypes = [ "Long" ]
   #veloprotos.OutputLevel =0
   #if (trackcont == "Best") :
   #	tracktypes = [ "Long" ]
   veloprotos.TrackSelector.TrackTypes = tracktypes
   selector = veloprotos.TrackSelector
   for tsname in tracktypes:
   	selector.addTool(TrackSelector,name=tsname)
   	ts = getattr(selector,tsname)
   	# Set Cuts
   	ts.TrackTypes = [tsname]

#        
   DataOnDemandSvc().AlgMap.update( {
                "/Event/Rec/VeloMuon/Tracks" : unpacker.getFullName(),
		} )

   veloprotoseq = GaudiSequencer(name+"ProtoPSeq")
   veloprotoseq.Members += [ veloprotos ]

   return GSWrapper(name="WrappedVeloMuonProtoPSeqFor" + name,
                    sequencer=veloprotoseq,
                    output='Rec/ProtoP/' + name +'ProtoPMaker/ProtoParticles',
                    requiredSelections = [ trackingSeq])
Esempio n. 3
0
from Configurables import StrippingReport
sr = StrippingReport(Selections=sc.selections())

from Configurables import AlgorithmCorrelationsAlg
ac = AlgorithmCorrelationsAlg(Algorithms=list(set(sc.selections())))

## Configure PV refitter
from GaudiKernel.SystemOfUnits import micrometer
from Configurables import LoKi__PVReFitter
LoKi__PVReFitter("ToolSvc.LoKi::PVReFitter").CheckTracksByLHCbIDs = True
LoKi__PVReFitter("ToolSvc.LoKi::PVReFitter").DeltaChi2 = 0.01
LoKi__PVReFitter("ToolSvc.LoKi::PVReFitter").DeltaDistance = 5 * micrometer

## Configure the VeloTrack unpacker
from Configurables import UnpackTrack
unpackIt = UnpackTrack("unpackIt")
unpackIt.InputName = "pRec/Track/FittedHLT1VeloTracks"
unpackIt.OutputName = "Rec/Track/FittedHLT1VeloTracks"

DaVinci().HistogramFile = 'DV_stripping_histos.root'
DaVinci().EvtMax = 100000
DaVinci().PrintFreq = 100
DaVinci().appendToMainSequence([sc.sequence()])
DaVinci().appendToMainSequence([sr])
#DaVinci().appendToMainSequence( [ ac ] )
DaVinci().appendToMainSequence([dstWriter.sequence()])
DaVinci().ProductionType = "Stripping"
DaVinci().DataType = "2015"
DaVinci().InputType = "RDST"

# change the column size of timing table
Esempio n. 4
0
    def _doUnpack(self):
        """
        Set up DataOnDemandSvc to unpack reconstruction information
        """
        from Configurables import (
            UnpackTrack, UnpackCaloHypo, UnpackProtoParticle, UnpackRecVertex,
            UnpackTwoProngVertex, UnpackPrimaryVertices,
            DataPacking__Unpack_LHCb__WeightsVectorPacker_, RecToPVConverter,
            PVToRecConverter)

        log.debug("In DstConf._doUnpack")

        DataOnDemandSvc().AlgMap["/Event/Rec/Track/Best"] = UnpackTrack()
        DataOnDemandSvc(
        ).AlgMap["/Event/Rec/Vertex/V0"] = UnpackTwoProngVertex()

        if (self.getProp("PVPersistence") is "RecVertex"):
            DataOnDemandSvc(
            ).AlgMap["/Event/Rec/Vertex/Primary"] = UnpackRecVertex()
            pvWunpack = DataPacking__Unpack_LHCb__WeightsVectorPacker_(
                "UnpackPVWeights")
            DataOnDemandSvc().AlgMap["/Event/Rec/Vertex/Weights"] = pvWunpack
            DataOnDemandSvc(
            ).AlgMap["/Event/Rec/Vertex/PrimaryVertices"] = RecToPVConverter()
        elif (self.getProp("PVPersistence") is "PrimaryVertex"):
            DataOnDemandSvc().AlgMap[
                "/Event/Rec/Vertex/PrimaryVertices"] = UnpackPrimaryVertices()
            DataOnDemandSvc(
            ).AlgMap["/Event/Rec/Vertex/Primary"] = PVToRecConverter()
        else:
            raise RuntimeError("Unknown PVPersistence type: '%s'" %
                               self.getProp("PVPersistence"))

        if (self.getProp("DataType") in self.Run2DataTypes):
            unpackFittedVeloTracks = UnpackTrack("unpackFittedVeloTracks")
            unpackFittedVeloTracks.InputName = "pRec/Track/FittedHLT1VeloTracks"
            unpackFittedVeloTracks.OutputName = "Rec/Track/FittedHLT1VeloTracks"
            DataOnDemandSvc().AlgMap[
                "/Event/Rec/Track/FittedHLT1VeloTracks"] = unpackFittedVeloTracks

        if self.getProp("Turbo"):
            unpackers = []
            ## HLT full reco unpacking
            from Configurables import UnpackProtoParticle
            proto1 = UnpackProtoParticle(
                name="UnpackProtoParticleLong",
                InputName="/Event/Hlt2/pRec/long/Protos",
                OutputName="/Event/Hlt2/long/Protos")
            proto2 = UnpackProtoParticle(
                name="UnpackProtoParticleDown",
                InputName="/Event/Hlt2/pRec/down/Protos",
                OutputName="/Event/Hlt2/down/Protos")
            from Configurables import DataPacking__Unpack_LHCb__RichPIDPacker_ as UnpackRichPIDs
            rich1 = UnpackRichPIDs(
                name="Hlt2UnpackLongRichPIDs",
                InputName="/Event/Hlt2/pRec/long/RichPIDs",
                OutputName=
                "/Event/Hlt2/TrackFitted/Long/PID/RICH/electronmuonpionkaonprotondeuteronbelowThreshold/Rich1GasRich2GasLong"
            )
            rich2 = UnpackRichPIDs(
                name="Hlt2UnpackDownRichPIDs",
                InputName="/Event/Hlt2/pRec/down/RichPIDs",
                OutputName=
                "/Event/Hlt2/TrackFitted/Downstream/PID/RICH/electronmuonpionkaonprotondeuteronbelowThreshold/Rich1GasRich2GasDownstream"
            )
            from Configurables import DataPacking__Unpack_LHCb__MuonPIDPacker_ as UnpackMuonPIDs
            muon1 = UnpackMuonPIDs(name="Hlt2UnpackMuonPIDs",
                                   InputName="/Event/Hlt2/pRec/long/MuonIDs",
                                   OutputName="/Event/Hlt2/PID/Muon")
            from Configurables import UnpackTrack
            track1 = UnpackTrack(name="UnpackLongTracks",
                                 InputName="/Event/Hlt2/pRec/long/Tracks",
                                 OutputName="/Event/Hlt2/TrackFitted/Long")
            track2 = UnpackTrack(
                name="UnpackDownTracks",
                InputName="/Event/Hlt2/pRec/down/Tracks",
                OutputName="/Event/Hlt2/TrackFitted/Downstream")
            track3 = UnpackTrack(
                name="UnpackDownPIDMuonSegments",
                InputName="/Event/Hlt2/pRec/down/PID/MuonSegments",
                OutputName="/Event/Hlt2/TrackFitted/Downstream/PID/MuonSegments"
            )
            proto3 = UnpackProtoParticle(
                name="UnpackNeutralProtoP",
                InputName="/Event/Hlt2/pRec/neutral/Protos",
                OutputName="/Event/Hlt2/neutral/Protos")
            from Configurables import DataPacking__Unpack_LHCb__CaloClusterPacker_ as UnpackCaloClusters
            clusters1 = UnpackCaloClusters(
                name="UnpackCaloClusters",
                InputName="/Event/Hlt2/pRec/neutral/CaloClusters",
                OutputName="Hlt/Calo/EcalClusters")
            clusters2 = UnpackCaloClusters(
                name="UnpackEcalSplitClusters",
                InputName="/Event/Hlt2/pRec/neutral/EcalSplitClusters",
                OutputName="Hlt/Calo/EcalSplitClusters")
            clustersRep = UnpackCaloClusters(
                name="UnpackCaloClustersRep",
                InputName="/Event/Turbo/pRec/neutral/Clusters",
                OutputName="Turbo/CaloClusters")
            from Configurables import UnpackCaloHypo as UnpackCaloHypos
            hypos1 = UnpackCaloHypos(
                name="UnpackCaloElectronHypos",
                InputName="/Event/Hlt2/pRec/neutral/Electrons",
                OutputName="/Event/Hlt2/PID/CALO/Calo/Electrons")
            hypos2 = UnpackCaloHypos(
                name="UnpackCaloPhotonHypos",
                InputName="/Event/Hlt2/pRec/neutral/Photons",
                OutputName="/Event/Hlt2/PID/CALO/Calo/Photons")
            hypos3 = UnpackCaloHypos(
                name="UnpackCaloMergedPi0Hypos",
                InputName="/Event/Hlt2/pRec/neutral/MergedPi0s",
                OutputName="/Event/Hlt2/PID/CALO/Calo/MergedPi0s")
            hypos4 = UnpackCaloHypos(
                name="UnpackCaloSplitPhotonHypos",
                InputName="/Event/Hlt2/pRec/neutral/SplitPhotons",
                OutputName="/Event/Hlt2/PID/CALO/Calo/SplitPhotons")
            hyposRep = UnpackCaloHypos(
                name="UnpackCaloHyposRep",
                InputName="/Event/Turbo/pRec/neutral/Hypos",
                OutputName="Turbo/CaloHypos")
            unpackers += [
                proto1, proto2, proto3, rich1, rich2, muon1, track1, track2,
                track3, clusters1, clusters2, hypos1, hypos2, hypos3, hypos4,
                clustersRep, hyposRep
            ]

            recProtos = GaudiSequencer("TurboProtosAsRec")
            recNeutralProtos = GaudiSequencer("TurboNeutralProtosAsRec")
            #from Configurables import TESMergerProtoParticle
            from Configurables import TESMerger_LHCb__ProtoParticle_ as TESMergerProtoParticle
            mergedProtos = TESMergerProtoParticle("mergedProtos")
            mergedProtos.inputLocations += [
                "/Event/Hlt2/long/Protos", "/Event/Hlt2/down/Protos"
            ]
            mergedProtos.outputLocation = "/Event/Hlt2/Protos/Charged"
            from Configurables import Gaudi__DataLink
            gdl = Gaudi__DataLink('HltRecProtos',
                                  What='/Event/Hlt2/Protos/Charged',
                                  Target='/Event/Rec/ProtoP/Charged')
            gdl_neutral = Gaudi__DataLink('HltRecNeutralProtos',
                                          What='/Event/Hlt2/neutral/Protos',
                                          Target='/Event/Rec/ProtoP/Neutral')
            #recProtos.Members+=unpackers
            recProtos.Members += [mergedProtos, gdl]
            #recNeutralProtos.Members+=unpackers
            recNeutralProtos.Members += [gdl_neutral]

            DataOnDemandSvc().AlgMap["Rec/ProtoP/Charged"] = recProtos
            DataOnDemandSvc().AlgMap["Rec/ProtoP/Neutral"] = recNeutralProtos

            gdl_pv = Gaudi__DataLink('HltRec_PV',
                                     What='/Event/Turbo/Primary',
                                     Target='/Event/Rec/Vertex/Primary')
            DataOnDemandSvc().AlgMap["Rec/Vertex/Primary"] = gdl_pv

            # Update data on demand
            for alg in unpackers:
                DataOnDemandSvc().AlgMap[alg.OutputName] = alg

        if "Tracking" in self.getProp("EnableUnpack"): return  # skip the rest

        # Calo
        if "Calo" in self.getProp("Detectors"):
            caloUnpack = CaloDstUnPackConf()
            if not caloUnpack.isPropertySet('Enable'):
                log.debug("Setting caloUnpack.Enable = True")
                caloUnpack.Enable = True
            else:
                log.debug("Not setting caloUnpack.Enable. Current value = %s",
                          caloUnpack.Enable)

        # RichPIDs
        if "Rich" in self.getProp("Detectors"):
            self._unpackRichPIDs()

        # MuonPIDs
        if "Muon" in self.getProp("Detectors"):
            self._unpackMuonPIDs()

        # ProtoParticles
        self._unpackProtoParticles()

        # Muon Tracks
        if "Muon" in self.getProp("Detectors"):
            unpackMuons = UnpackTrack(name="UnpackMuonTracks",
                                      OutputName="/Event/Rec/Track/Muon",
                                      InputName="/Event/pRec/Track/Muon",
                                      AncestorFor="/Event/pRec/Track/Muon")
            DataOnDemandSvc().AlgMap["/Event/Rec/Track/Muon"] = unpackMuons
def makeMyProtoP(trackcont):
    unpacker = UnpackTrack(trackcont + "UnpackTrack")
    unpacker.InputName = "pRec/Track/" + trackcont
    unpacker.OutputName = "Rec/Track/" + trackcont
    refitter = TrackSmeared(trackcont + "TrackSmeared")
    refitter.InputLocation = "Rec/Track/" + trackcont
    refitter.OutputLocation = "Refit"
    refitter.smear = 1
    #refitter.makePlots = 1
    #refitter.OutputLevel = 2
    #idalg = MuonIDAlg("BestIDalg")
    #idalg.OutputLevel = 0
    #cm=ConfiguredMuonIDs.ConfiguredMuonIDs(data=DaVinci().getProp("DataType"))
    #cm.configureMuonIDAlg(idalg)
    #idalg.TrackLocation = "Rec/Track/Refit"
    #idalg.MuonIDLocation = "Rec/Muon/MuonPID/Refit"
    downprotoseq = GaudiSequencer(trackcont + "ProtoPSeq")
    downprotos = ChargedProtoParticleMaker(trackcont + "ProtoPMaker")
    downprotos.InputTrackLocation = ["Rec/Track/Refit"]
    downprotos.OutputProtoParticleLocation = "Rec/ProtoP/" + trackcont + "ProtoPMaker"
    downprotos.addTool(DelegatingTrackSelector, name="TrackSelector")
    #downprotos.OutputLevel = 0
    tracktypes = ["Long", "Upstream", "Downstream", "Ttrack", "Velo", "VeloR"]
    downprotos.TrackSelector.TrackTypes = tracktypes
    selector = downprotos.TrackSelector
    for tsname in tracktypes:
        selector.addTool(TrackSelector, name=tsname)
        ts = getattr(selector, tsname)
        # Set Cuts
        ts.TrackTypes = [tsname]
    #set up associators
    #addmuonpid = ChargedProtoParticleAddMuonInfo("Bestaddmuoninfo")
    #addmuonpid.InputMuonPIDLocation = "Rec/Muon/MuonPID/Refit"
    #addmuonpid.ProtoParticleLocation = "Rec/ProtoP/"+trackcont+"ProtoPMaker"
    #addmuonpid.OutputLevel = 0
    addrichpid = ChargedProtoParticleAddRichInfo("Bestaddrichinfo")
    addrichpid.InputRichPIDLocation = "Rec/Rich/Refit"
    #addrichpid.InputRichPIDLocation = "Rec/Rich/"+trackcont
    addrichpid.ProtoParticleLocation = "Rec/ProtoP/" + trackcont + "ProtoPMaker"
    #addcalopid = ChargedProtoParticleAddCaloInfo("Bestaddcaloinfo")
    #addcalopid.InputRichCALOLocation = "Rec/Rich/Refit"
    #addcalopid.ProtoParticleLocation = "Rec/ProtoP/"+trackcont+"ProtoPMaker"
    combinedll = ChargedProtoCombineDLLsAlg("BestCombineDLL")
    combinedll.ProtoParticleLocation = "Rec/ProtoP/" + trackcont + "ProtoPMaker"
    assoctr = TrackAssociator(trackcont + "AssocTr")
    #assoctr.TracksInContainer = "Rec/Track/"+trackcont
    assoctr.TracksInContainer = "Rec/Track/Refit"
    assocpp = ChargedPP2MC(trackcont + "AssocPP")
    #assocpp.TrackLocations = [ "Rec/Track/"+trackcont ]
    assocpp.TrackLocations = ["Rec/Track/Refit"]
    assocpp.InputData = ["Rec/ProtoP/" + trackcont + "ProtoPMaker"]
    #assocpp.InputData = [ "Rec/ProtoP/Refit" ]
    assocpp.OutputTable = "Relations/Rec/ProtoP/" + trackcont + "ProtoPMaker"
    # DST post treatment
    TrackToDST(trackcont +
               "TrackToDST").TracksInContainer = "Rec/Track/" + trackcont
    #downprotoseq.Members += [ TrackToDST(trackcont+"TrackToDST"), assoctr, downprotos, assocpp,addrichpid,combinedll ]

    if not DaVinci().Simulation:
        downprotoseq.Members += [
            TrackToDST(trackcont + "TrackToDST"), downprotos, addrichpid,
            combinedll
        ]
        DataOnDemandSvc().AlgMap.update({
            "/Event/Rec/Track/" + trackcont:
            unpacker.getFullName(),
            "/Event/Rec/Track/Refit":
            refitter.getFullName(),
            "/Event/Rec/Rich/Refit":
            downprotoseq.getFullName(),
            "/Event/Rec/ProtoP/" + trackcont + "ProtoPMaker":
            downprotoseq.getFullName(),
            "/Event/Relations/Rec/ProtoP/" + trackcont + "ProtoPMaker":
            downprotoseq.getFullName()
        })
    else:
        if (DaVinci().Simulation):
            downprotoseq.Members += [
                TrackToDST(trackcont + "TrackToDST"), assoctr, downprotos,
                addrichpid, combinedll, assocpp
            ]
            DataOnDemandSvc().AlgMap.update({
                "/Event/Rec/Track/" + trackcont:
                unpacker.getFullName(),
                "/Event/Rec/Track/Refit":
                refitter.getFullName(),
                "/Event/Rec/Rich/Refit":
                downprotoseq.getFullName(),
                "/Event/Rec/ProtoP/" + trackcont + "ProtoPMaker":
                downprotoseq.getFullName(),
                "/Event/Relations/Rec/ProtoP/" + trackcont + "ProtoPMaker":
                downprotoseq.getFullName()
            })
# Test of UnpackTrack on SDST contaning a track with more than 65k LHCbIDs
from PRConfig import TestFileDB
from Gaudi.Configuration import ApplicationMgr
from Configurables import DumpTracks, UnpackTrack
from GaudiConf.IOHelper import IOHelper

upkTr = UnpackTrack()
ApplicationMgr().TopAlg += [ upkTr, DumpTracks() ]

ioh = IOHelper('ROOT')
ioh.setupServices()
ioh.inputFiles(['PFN:root://eoslhcb.cern.ch//eos/lhcb/grid/prod/lhcb/swtest/lhcb/swtest/Reco10-sdst-10events/00011652_00000001_1-evt-18641to18650.sdst'])


#TestFileDB.test_file_db["Reco10-sdst-10events"].run()
Esempio n. 7
0
def makeMyProtoP(trackcont):
    unpacker = UnpackTrack(trackcont + "UnpackTrack")
    unpacker.InputName = "pRec/Track/" + trackcont
    unpacker.OutputName = "Rec/Track/" + trackcont
    smeartracks = TrackSmeared(trackcont + "TrackSmeared")
    smeartracks.InputLocation = "Rec/Track/" + trackcont
    outputLocation = "Smeared"
    smeartracks.OutputLocation = outputLocation
    smeartracks.smearCopied = True
    smeartracks.smear = 1
    #smeartracks.makePlots = 1
    #smeartracks.OutputLevel = 2
    protoseq = GaudiSequencer(trackcont + "ProtoPSeq")
    protos = ChargedProtoParticleMaker(trackcont + "ProtoPMaker")
    protos.InputTrackLocation = ["Rec/Track/" + outputLocation]
    protos.OutputProtoParticleLocation = "Rec/ProtoP/" + trackcont + "ProtoPMaker"
    protos.addTool(DelegatingTrackSelector, name="TrackSelector")
    #protos.OutputLevel = 0
    tracktypes = ["Long", "Upstream", "Downstream", "Ttrack", "Velo", "VeloR"]
    protos.TrackSelector.TrackTypes = tracktypes
    selector = protos.TrackSelector
    for tsname in tracktypes:
        selector.addTool(TrackSelector, name=tsname)
        ts = getattr(selector, tsname)
        # Set Cuts
        ts.TrackTypes = [tsname]

# Add PID information
    idalg = MuonIDAlg("BestIDalg")
    #idalg.OutputLevel = 5
    cm = ConfiguredMuonIDs.ConfiguredMuonIDs(
        data=DaVinci().getProp("DataType"))
    cm.configureMuonIDAlg(idalg)
    idalg.TrackLocation = "Rec/Track/" + outputLocation
    idalg.MuonIDLocation = "Rec/Muon/MuonPID/" + outputLocation

    from Configurables import (
        ChargedProtoParticleAddRichInfo, ChargedProtoParticleAddMuonInfo,
        ChargedProtoParticleAddEcalInfo, ChargedProtoParticleAddBremInfo,
        ChargedProtoParticleAddHcalInfo, ChargedProtoParticleAddPrsInfo,
        ChargedProtoParticleAddSpdInfo, ChargedProtoParticleAddVeloInfo,
        ChargedProtoCombineDLLsAlg)
    addmuonpid = ChargedProtoParticleAddMuonInfo("Bestaddmuoninfo")
    addmuonpid.InputMuonPIDLocation = "Rec/Muon/MuonPID/" + outputLocation
    addmuonpid.ProtoParticleLocation = "Rec/ProtoP/" + trackcont + "ProtoPMaker"
    addrichpid = ChargedProtoParticleAddRichInfo("Bestaddrichinfo")
    addrichpid.ProtoParticleLocation = "Rec/ProtoP/" + trackcont + "ProtoPMaker"
    # The rich pid is added to the track in TrackSmeared, thus only kaon pion pid is consistent
    # the others are not implemented. The modes smearBest and smearProto don't have the problems
    #addcalopid = ChargedProtoParticleAddCaloInfo("Bestaddcaloinfo")
    #addcalopid.InputRichCALOLocation = "Rec/Rich/"+outputLocation
    #addcalopid.ProtoParticleLocation = "Rec/ProtoP/"+trackcont+"ProtoPMaker"
    #ecal = ChargedProtoParticleAddEcalInfo("ChargedProtoPAddEcal")
    #ecal.ProtoParticleLocation = "Rec/ProtoP/"+trackcont+"ProtoPMaker"
    #brem = ChargedProtoParticleAddBremInfo("ChargedProtoPAddBrem")
    #brem.ProtoParticleLocation = "Rec/ProtoP/"+trackcont+"ProtoPMaker"
    #hcal = ChargedProtoParticleAddHcalInfo("ChargedProtoPAddHcal")
    #hcal.ProtoParticleLocation = "Rec/ProtoP/"+trackcont+"ProtoPMaker"
    #prs  = ChargedProtoParticleAddPrsInfo("ChargedProtoPAddPrs")
    #prs.ProtoParticleLocation = "Rec/ProtoP/"+trackcont+"ProtoPMaker"
    #spd  = ChargedProtoParticleAddSpdInfo("ChargedProtoPAddSpd")
    #spd.ProtoParticleLocation = "Rec/ProtoP/"+trackcont+"ProtoPMaker"
    #velo = ChargedProtoParticleAddVeloInfo("ChargedProtoPAddVeloDEDX")
    #velo.ProtoParticleLocation = "Rec/ProtoP/"+trackcont+"ProtoPMaker"
    combinedll = ChargedProtoCombineDLLsAlg("BestCombineDLL")
    combinedll.ProtoParticleLocation = "Rec/ProtoP/" + trackcont + "ProtoPMaker"

    #set up associators
    assoctr = TrackAssociator(trackcont + "AssocTr")
    assoctr.TracksInContainer = "Rec/Track/" + outputLocation
    assocpp = ChargedPP2MC(trackcont + "AssocPP")
    assocpp.TrackLocations = ["Rec/Track/" + outputLocation]
    assocpp.InputData = ["Rec/ProtoP/" + trackcont + "ProtoPMaker"]
    assocpp.OutputTable = "Relations/Rec/ProtoP/" + trackcont + "ProtoPMaker"
    # DST post treatment
    TrackToDST(trackcont +
               "TrackToDST").TracksInContainer = "Rec/Track/" + trackcont
    if not DaVinci().Simulation:
        protoseq.Members += [TrackToDST(trackcont + "TrackToDST"), protos]
        protoseq.Members += [
            ecal, brem, hcal, prs, spd, velo, addrichpid, addmuonpid,
            combinedll
        ]
        DataOnDemandSvc().AlgMap.update({
            "/Event/Rec/Track/" + trackcont:
            unpacker.getFullName(),
            "/Event/Rec/Track/" + outputLocation:
            smeartracks.getFullName(),
            "/Event/Rec/Rich/" + outputLocation:
            protoseq.getFullName(),
            "/Event/Rec/Muon/MuonPID/" + outputLocation:
            idalg.getFullName(),
            "/Event/Rec/ProtoP/" + trackcont + "ProtoPMaker":
            protoseq.getFullName(),
            "/Event/Relations/Rec/ProtoP/" + trackcont + "ProtoPMaker":
            protoseq.getFullName()
        })
    else:
        if (DaVinci().Simulation):
            protoseq.Members += [
                TrackToDST(trackcont + "TrackToDST"), assoctr, protos
            ]
            #protoseq.Members += [ ecal,brem,hcal,prs,spd,velo,addrichpid,addmuonpid,combinedll,assocpp ]
            protoseq.Members += [
                idalg, addmuonpid, addrichpid, combinedll, assocpp
            ]
            DataOnDemandSvc().AlgMap.update({
                "/Event/Rec/Track/" + trackcont:
                unpacker.getFullName(),
                "/Event/Rec/Track/" + outputLocation:
                smeartracks.getFullName(),
                "/Event/Rec/Rich/" + outputLocation:
                protoseq.getFullName(),
                "/Event/Rec/Muon/MuonPID/" + outputLocation:
                idalg.getFullName(),
                "/Event/Rec/ProtoP/" + trackcont + "ProtoPMaker":
                protoseq.getFullName(),
                "/Event/Relations/Rec/ProtoP/" + trackcont + "ProtoPMaker":
                protoseq.getFullName()
            })