Ejemplo n.º 1
0
def convertTrackParticles(aod_track_particles_in, track_particle_truth_in,
                          track_particle_out, topSequence):
    if isValid(aod_track_particles_in) and isValid(track_particle_out):
        from xAODTrackingCnv.xAODTrackingCnvConf import xAODMaker__TrackParticleCnvAlg
        xAODTrackParticleCnvAlg = xAODMaker__TrackParticleCnvAlg(
            track_particle_out)
        xAODTrackParticleCnvAlg.xAODContainerName = track_particle_out
        xAODTrackParticleCnvAlg.xAODTrackParticlesFromTracksContainerName = ""
        xAODTrackParticleCnvAlg.TrackContainerName = ""
        xAODTrackParticleCnvAlg.TrackParticleCreator = getInDetxAODParticleCreatorTool(
        )
        xAODTrackParticleCnvAlg.AODContainerName = aod_track_particles_in
        xAODTrackParticleCnvAlg.AODTruthContainerName = passCollectionName(
            track_particle_truth_in, (is_mc and InDetFlags.doTruth()))
        xAODTrackParticleCnvAlg.ConvertTrackParticles = True
        xAODTrackParticleCnvAlg.ConvertTracks = False
        xAODTrackParticleCnvAlg.AddTruthLink = InDetFlags.doTruth(
        ) and is_mc and isValid(track_particle_truth_in)
        xAODTrackParticleCnvAlg.xAODTruthLinkVector = passCollectionName(
            'xAODTruthLinks',
            InDetFlags.doTruth() and is_mc
            and isValid(track_particle_truth_in))
        xAODTrackParticleCnvAlg.TrackTruthContainerName = ""
        from MCTruthClassifier.MCTruthClassifierBase import MCTruthClassifier
        xAODTrackParticleCnvAlg.MCTruthClassifier = MCTruthClassifier
        topSequence += xAODTrackParticleCnvAlg
Ejemplo n.º 2
0
     def __init__(self, InputTrackCollection = None, InputTrackTruthCollection = None, OutputTrackParticleContainer = None):


         from InDetRecExample.InDetJobProperties import InDetFlags
         from InDetRecExample.InDetKeys import InDetKeys
         #
         # --- get ToolSvc and topSequence
         #
         from AthenaCommon.AppMgr                import ToolSvc
         from AthenaCommon.AlgSequence           import AlgSequence
         topSequence = AlgSequence()

         _perigee_expression=InDetFlags.perigeeExpression()
         # need to treat Vertex specifically because at the time of
         # the track particle creation the primary vertex does not yet exist.
         # The problem is solved by first creating track particles wrt. the beam line
         # and correcting the parameters after the vertex finding.
         if _perigee_expression == 'Vertex' :
              _perigee_expression = 'BeamLine'

         #Always the same (so far) so can in principle go in InDetRecLoadTools
         from TrkParticleCreator.TrkParticleCreatorConf import Trk__TrackParticleCreatorTool
         InDetxAODParticleCreatorTool = Trk__TrackParticleCreatorTool(name = "InDetxAODParticleCreatorTool"+InputTrackCollection, 
                                                                      Extrapolator            = InDetExtrapolator,
                                                                      TrackSummaryTool        = InDetTrackSummaryToolSharedHits,
                                                                      BadClusterID            = InDetFlags.pixelClusterBadClusterID(),
                                                                      KeepParameters          = True,
                                                                      KeepFirstParameters     = InDetFlags.KeepFirstParameters(),
                                                                      PerigeeExpression       = _perigee_expression)

         ToolSvc += InDetxAODParticleCreatorTool
         if (InDetFlags.doPrintConfigurables()):
            printfunc (InDetxAODParticleCreatorTool)

         from xAODTrackingCnv.xAODTrackingCnvConf import xAODMaker__TrackParticleCnvAlg
         xAODTrackParticleCnvAlg = xAODMaker__TrackParticleCnvAlg(name = "InDetxAODParticleCreatorAlg"+InputTrackCollection,
                                                                  ConvertTracks = True,
                                                                  ConvertTrackParticles = False,
                                                                  TrackContainerName = InputTrackCollection,
                                                                  xAODContainerName = OutputTrackParticleContainer,
                                                                  xAODTrackParticlesFromTracksContainerName = OutputTrackParticleContainer,
                                                                  TrackParticleCreator = InDetxAODParticleCreatorTool)

         if (InDetFlags.doTruth() and not InputTrackTruthCollection == ''):
             xAODTrackParticleCnvAlg.AddTruthLink = True
             xAODTrackParticleCnvAlg.TrackTruthContainerName = InputTrackTruthCollection

             from MCTruthClassifier.MCTruthClassifierBase import MCTruthClassifier
             xAODTrackParticleCnvAlg.MCTruthClassifier = MCTruthClassifier

         elif (InDetFlags.doTruth() and InputTrackTruthCollection == ''):
             printfunc ("WARNING: ConfiguredxAODTrackParticleCreation - doTruth = True, but no input Truth collection specified!")
         else:
            xAODTrackParticleCnvAlg.AddTruthLink = False

         topSequence += xAODTrackParticleCnvAlg
         if (InDetFlags.doPrintConfigurables()):
            printfunc (xAODTrackParticleCnvAlg)
     def __init__(self, InputTrackCollection = None, InputTrackTruthCollection = None, OutputTrackParticleContainer = None):


         from InDetRecExample.InDetJobProperties import InDetFlags
         from InDetRecExample.InDetKeys import InDetKeys
         #
         # --- get ToolSvc and topSequence
         #
         from AthenaCommon.AppMgr                import ToolSvc
         from AthenaCommon.AlgSequence           import AlgSequence
         topSequence = AlgSequence()

         #Always the same (so far) so can in principle go in InDetRecLoadTools
         from TrkParticleCreator.TrkParticleCreatorConf import Trk__TrackParticleCreatorTool
         InDetxAODParticleCreatorTool = Trk__TrackParticleCreatorTool(name = "InDetxAODParticleCreatorTool"+InputTrackCollection, 
                                                                      Extrapolator            = InDetExtrapolator,
                                                                      TrackSummaryTool        = InDetTrackSummaryToolSharedHits,
                                                                      BadClusterID            = InDetFlags.pixelClusterBadClusterID(),
                                                                      ForceTrackSummaryUpdate = False,
                                                                      KeepParameters          = True)

         ToolSvc += InDetxAODParticleCreatorTool
         if (InDetFlags.doPrintConfigurables()):
            print InDetxAODParticleCreatorTool

         from xAODTrackingCnv.xAODTrackingCnvConf import xAODMaker__TrackParticleCnvAlg
         xAODTrackParticleCnvAlg = xAODMaker__TrackParticleCnvAlg(name = "InDetxAODParticleCreatorAlg"+InputTrackCollection,
                                                                  ConvertTracks = True,
                                                                  ConvertTrackParticles = False,
                                                                  TrackContainerName = InputTrackCollection,
                                                                  xAODContainerName = OutputTrackParticleContainer,
                                                                  xAODTrackParticlesFromTracksContainerName = OutputTrackParticleContainer,
                                                                  TrackParticleCreator = InDetxAODParticleCreatorTool,
                                                                  PrintIDSummaryInfo = True)

         if (InDetFlags.doTruth() and not InputTrackTruthCollection == ''):
             xAODTrackParticleCnvAlg.AddTruthLink = True
             xAODTrackParticleCnvAlg.TrackTruthContainerName = InputTrackTruthCollection
         elif (InDetFlags.doTruth() and InputTrackTruthCollection == ''):
             print "WARNING: ConfiguredxAODTrackParticleCreation - doTruth = True, but no input Truth collection specified!"
         else:
            xAODTrackParticleCnvAlg.AddTruthLink = False

         topSequence += xAODTrackParticleCnvAlg
         if (InDetFlags.doPrintConfigurables()):
            print xAODTrackParticleCnvAlg
Ejemplo n.º 4
0
def createTrackParticles(track_in,
                         track_particle_truth_in,
                         track_particle_out,
                         topSequence,
                         prd_to_track_map=None,
                         suffix=""):
    '''
    create algorithm to convert the input tracks into track xAOD track particles.
    @param track_in the name of the input TrackCollection
    @param track_particle_truth_in optional truth track collection to link to
    @param track_particle_out the name of the output xAOD track particle collection
    @param topSequence the sequence to which the algorithm is added
    @param prd_to_track_map None or if shared hits are to be recomputed a PRDtoTrackMap filled by a preceding
           algorithms e.g. a TrackCollectionMerger.
    @param suffix which makes the names of the particle creator tool and sub-tools unique in case a prd_to_track_map
           is provided.
    '''
    if isValid(track_in) and isValid(track_particle_out):
        from xAODTrackingCnv.xAODTrackingCnvConf import xAODMaker__TrackParticleCnvAlg
        xAODTrackParticleCnvAlg = xAODMaker__TrackParticleCnvAlg(
            track_particle_out)
        xAODTrackParticleCnvAlg.xAODContainerName = ""
        xAODTrackParticleCnvAlg.xAODTrackParticlesFromTracksContainerName = track_particle_out
        xAODTrackParticleCnvAlg.TrackContainerName = track_in
        xAODTrackParticleCnvAlg.TrackParticleCreator = getInDetxAODParticleCreatorTool(
            prd_to_track_map, suffix)
        xAODTrackParticleCnvAlg.AODContainerName = ""
        xAODTrackParticleCnvAlg.AODTruthContainerName = ""
        xAODTrackParticleCnvAlg.ConvertTrackParticles = False
        xAODTrackParticleCnvAlg.ConvertTracks = True
        xAODTrackParticleCnvAlg.AddTruthLink = InDetFlags.doTruth(
        ) and is_mc and isValid(track_particle_truth_in)
        xAODTrackParticleCnvAlg.xAODTruthLinkVector = passCollectionName(
            'xAODTruthLinks',
            InDetFlags.doTruth() and is_mc
            and isValid(track_particle_truth_in))
        xAODTrackParticleCnvAlg.TrackTruthContainerName = passCollectionName(
            track_particle_truth_in, (is_mc and InDetFlags.doTruth()))
        from MCTruthClassifier.MCTruthClassifierBase import MCTruthClassifier
        xAODTrackParticleCnvAlg.MCTruthClassifier = MCTruthClassifier
        topSequence += xAODTrackParticleCnvAlg
Ejemplo n.º 5
0
def MuonStandaloneTrackParticleCnvAlg( name="MuonStandaloneTrackParticleCnvAlg",**kwargs):
    from AthenaCommon.Include import include
    include("InDetBeamSpotService/BeamCondSvc.py" )        
    from xAODTrackingCnv.xAODTrackingCnvConf import xAODMaker__TrackParticleCnvAlg, xAODMaker__TrackCollectionCnvTool, xAODMaker__RecTrackParticleContainerCnvTool

    muonParticleCreatorTool = getPublicTool("MuonParticleCreatorTool")
    muonTrackCollectionCnvTool = xAODMaker__TrackCollectionCnvTool( name = "MuonTrackCollectionCnvTool", TrackParticleCreator = muonParticleCreatorTool )
    muonRecTrackParticleContainerCnvTool = xAODMaker__RecTrackParticleContainerCnvTool(name = "MuonRecTrackParticleContainerCnvTool", TrackParticleCreator = muonParticleCreatorTool )

    kwargs.setdefault("TrackParticleCreator", muonParticleCreatorTool)
    kwargs.setdefault("RecTrackParticleContainerCnvTool", muonRecTrackParticleContainerCnvTool)
    kwargs.setdefault("TrackCollectionCnvTool", muonTrackCollectionCnvTool)
    kwargs.setdefault("RecTrackParticleContainerCnvTool", muonRecTrackParticleContainerCnvTool)
    kwargs.setdefault("TrackContainerName", "MuonSpectrometerTracks")
    kwargs.setdefault("xAODTrackParticlesFromTracksContainerName", "MuonSpectrometerTrackParticles")
    kwargs.setdefault("AODContainerName", "")
    kwargs.setdefault("AODTruthContainerName", "")
    kwargs.setdefault("xAODTruthLinkVector",  "")
    kwargs.setdefault("ConvertTrackParticles", False)
    kwargs.setdefault("ConvertTracks", True)

    return xAODMaker__TrackParticleCnvAlg( name = "MuonStandaloneTrackParticleCnvAlg",**kwargs)
Ejemplo n.º 6
0
    if (objKeyStore.isInInput("EventInfo")
            and not objKeyStore.isInInput("xAOD::EventInfo")):
        from xAODEventInfoCnv.xAODEventInfoCreator import xAODMaker__EventInfoCnvAlg
        topSequence += xAODMaker__EventInfoCnvAlg()
#CaloClusters:
if (objKeyStore.isInInput("CaloClusterContainer")):
    from xAODCaloEventCnv.xAODCaloEventCnvConf import ClusterCreator
    topSequence += ClusterCreator(
    )  #Converts all CaloClusterContainers it finds in SG to xAOD
    pass

#SA
if objKeyStore.isInInput("Rec::TrackParticleContainer",
                         MuonCbKeys.ExtrapolatedMSParticles()):
    from xAODTrackingCnv.xAODTrackingCnvConf import xAODMaker__TrackParticleCnvAlg
    alg1 = xAODMaker__TrackParticleCnvAlg("TrackParticleCnvAlg_ExtrapolatedMS")
    alg1.AODContainerName = MuonCbKeys.ExtrapolatedMSParticles(
    )  #ExtrapolatedMuonSpectrometerParticles
    alg1.xAODContainerName = MuonCbKeys.ExtrapolatedMSParticles()
    #alg1.OutputLevel = VERBOSE
    topSequence += alg1
    pass

# StatCombined
if objKeyStore.isInInput("Rec::TrackParticleContainer",
                         MuonCbKeys.StatCombinedParticles()):
    from xAODTrackingCnv.xAODTrackingCnvConf import xAODMaker__TrackParticleCnvAlg
    alg3 = xAODMaker__TrackParticleCnvAlg("TrackParticleCnvAlg_StatCombined")
    alg3.AODContainerName = MuonCbKeys.StatCombinedParticles(
    )  #xStatCombinedMuonParticles
    alg3.xAODContainerName = MuonCbKeys.StatCombinedParticles()
Ejemplo n.º 7
0
    from TrkParticleCreator.TrkParticleCreatorConf import Trk__TrackParticleCreatorTool
    InDetParticleCreatorTool_split = Trk__TrackParticleCreatorTool(
        name="InDetParticleCreatorTool_split",
        KeepParameters=True,
        Extrapolator=InDetExtrapolator,
        TrackSummaryTool=InDetTrackSummaryTool,
        PerigeeExpression="Origin")
    ToolSvc += InDetParticleCreatorTool_split

    output_track_particle_name = InDetKeys.TrackParticles() + "_split"
    from xAODTrackingCnv.xAODTrackingCnvConf import xAODMaker__TrackParticleCnvAlg
    xAODTrackParticleCnvAlg = xAODMaker__TrackParticleCnvAlg(
        name="InDetxAODParticleCreatorAlg" + InputTrackCollection + "_split",
        ConvertTracks=True,
        ConvertTrackParticles=False,
        TrackContainerName=InDetKeys.Tracks() + "_split",
        xAODContainerName=output_track_particle_name,
        xAODTrackParticlesFromTracksContainerName=output_track_particle_name,
        TrackParticleCreator=InDetParticleCreatorTool_split)

    if (InDetFlags.doTruth() and not InputTrackTruthCollection == ''):
        xAODTrackParticleCnvAlg.AddTruthLink = True
        xAODTrackParticleCnvAlg.TrackTruthContainerName = InputTrackTruthCollection
    elif (InDetFlags.doTruth() and InputTrackTruthCollection == ''):
        printfunc(
            "WARNING: ConfiguredxAODTrackParticleCreation - doTruth = True, but no input Truth collection specified!"
        )
    else:
        xAODTrackParticleCnvAlg.AddTruthLink = False

    topSequence += xAODTrackParticleCnvAlg
Ejemplo n.º 8
0
def getTrackParticleCnv(prefix, suffix, outPTTracks, outPTTrackParticles):
    """ Use the  track collection and convert it to container of xAOD Track Particles  """
    #suffix = '_%s'suff if suff else '' #Suffix should be based on the signature and type of tracking, e.g for cosmics and PT  -> Cosmics_PT ( for FTF or EFID, Cosmics_FTF, Cosmics_EFID )
    from AthenaCommon.AppMgr import ToolSvc
    keepParameter = False
    if 'Electron' in suffix:
        keepParameter = True

    from InDetTrigRecExample.InDetTrigConfigRecLoadTools import InDetTrigTrackSummaryTool, InDetTrigExtrapolator
    from TrkParticleCreator.TrkParticleCreatorConf import Trk__TrackParticleCreatorTool
    InDetTrigMTxAODParticleCreatorTool = Trk__TrackParticleCreatorTool(
        name="%sxAODParticleCreatorTool%s" % (prefix, suffix),
        Extrapolator=InDetTrigExtrapolator,
        KeepParameters=keepParameter,
        #TrackSummaryTool = InDetTrigTrackSummaryToolSharedHits)
        TrackSummaryTool=InDetTrigTrackSummaryTool)

    ToolSvc += InDetTrigMTxAODParticleCreatorTool
    #log.info(InDetTrigMTxAODParticleCreatorTool)

    from xAODTrackingCnv.xAODTrackingCnvConf import xAODMaker__TrackCollectionCnvTool
    InDetTrigMTxAODTrackCollectionCnvTool = xAODMaker__TrackCollectionCnvTool(
        name="%sxAODTrackCollectionCnvTool%s" % (prefix, suffix),
        TrackParticleCreator=InDetTrigMTxAODParticleCreatorTool)

    ToolSvc += InDetTrigMTxAODTrackCollectionCnvTool
    #log.info(InDetTrigMTxAODTrackCollectionCnvTool)

    #This one shouldn't be necessary
    #TODO: obsolete, try to turn off
    from xAODTrackingCnv.xAODTrackingCnvConf import xAODMaker__RecTrackParticleContainerCnvTool
    InDetTrigMTRecTrackParticleContainerCnvTool = xAODMaker__RecTrackParticleContainerCnvTool(
        name="%sRecTrackContainerCnvTool%s" % (prefix, suffix),
        TrackParticleCreator=InDetTrigMTxAODParticleCreatorTool)

    ToolSvc += InDetTrigMTRecTrackParticleContainerCnvTool

    #Adding new monitoring tool
    #First load the generic monitoring tool with set of histograms for Particle Cnv
    from TrigInDetMonitoringTools.TrigInDetTrackingMonitoring import TrigInDetTrackCnvMonitoring
    #TODO need to add extra property for prefix and suffix of the track collections to be monitored
    #Or maybe no need the name itself should be obvious from the particle cnv alg
    monTool = TrigInDetTrackCnvMonitoring(name='%sParticleCreatorCnv%s' %
                                          (prefix, suffix))

    #Now pass this tool to the Track Monitoring tool
    from TrigInDetMonitoringTools.TrigInDetTrackMonitoringToolConf import TrigInDetTrackMonitoringTool
    monTrackCnv = TrigInDetTrackMonitoringTool(name='%sParticleCreatorCnv%s' %
                                               (prefix, suffix),
                                               MonitoringTool=monTool)

    ToolSvc += monTrackCnv

    from xAODTrackingCnv.xAODTrackingCnvConf import xAODMaker__TrackParticleCnvAlg
    InDetTrigMTxAODTrackParticleCnvAlg = xAODMaker__TrackParticleCnvAlg(
        name="%sxAODParticleCreatorAlg%s" % (prefix, suffix),
        # Properties below are used for:  TrackCollection -> xAOD::TrackParticle
        ConvertTracks=
        True,  #Turn on  retrieve of TrackCollection, false by default
        TrackContainerName=outPTTracks,
        xAODTrackParticlesFromTracksContainerName=outPTTrackParticles,
        TrackCollectionCnvTool=InDetTrigMTxAODTrackCollectionCnvTool,
        ## Properties below are used for: Rec:TrackParticle, aod -> xAOD::TrackParticle (Turn off)
        ConvertTrackParticles=
        False,  # Retrieve of Rec:TrackParticle, don't need this atm
        xAODContainerName='',
        RecTrackParticleContainerCnvTool=
        InDetTrigMTRecTrackParticleContainerCnvTool,
        TrackParticleCreator=InDetTrigMTxAODParticleCreatorTool,
        #Add online track monitoring
        DoMonitoring=True,
        TrackMonTool=monTrackCnv)

    return InDetTrigMTxAODTrackParticleCnvAlg
Ejemplo n.º 9
0
ToolSvc += InDetxAODParticleCreatorTool 
if InDetFlags.doPrintConfigurables(): 
    print InDetxAODParticleCreatorTool 

if (doCreation or doConversion):# or InDetFlags.useExistingTracksAsInput()) : <---- [XXX JDC Should we included this?
                                #                                                    problems appear when nothing should
                                #                                                    be done but
                                #                                                    useExistinTracksAsInput...
    # [XXX JDC: to deal with the MergedTracks case, the truth collections are
    #           defined in the InputTrackCollectionTruth variable. To be deprecated
    #           if finally there is no need of the special "MergedTrack" name
    if 'InputTrackCollectionTruth' not in dir():
        InputTrackCollectionTruth = InDetKeys.TracksTruth()
    from xAODTrackingCnv.xAODTrackingCnvConf import xAODMaker__TrackParticleCnvAlg 
    if not InDetFlags.doDBMstandalone(): 
        xAODTrackParticleCnvAlg = xAODMaker__TrackParticleCnvAlg(InDetKeys.xAODTrackParticleContainer()) 
        xAODTrackParticleCnvAlg.xAODContainerName = InDetKeys.xAODTrackParticleContainer() 
        xAODTrackParticleCnvAlg.xAODTrackParticlesFromTracksContainerName = InDetKeys.xAODTrackParticleContainer() 
        xAODTrackParticleCnvAlg.TrackContainerName = InputTrackCollection 
        xAODTrackParticleCnvAlg.TrackParticleCreator = InDetxAODParticleCreatorTool 
        xAODTrackParticleCnvAlg.AODContainerName = InDetKeys.TrackParticles() 
        xAODTrackParticleCnvAlg.AODTruthContainerName = InDetKeys.TrackParticlesTruth() 
        xAODTrackParticleCnvAlg.ConvertTrackParticles = doConversion 
        xAODTrackParticleCnvAlg.ConvertTracks = doCreation 
        xAODTrackParticleCnvAlg.AddTruthLink = InDetFlags.doTruth() 
        xAODTrackParticleCnvAlg.TrackTruthContainerName = InputTrackCollectionTruth
        xAODTrackParticleCnvAlg.PrintIDSummaryInfo = True 
        topSequence += xAODTrackParticleCnvAlg 
    if InDetFlags.doDBMstandalone() or InDetFlags.doDBM(): 
        xAODDBMTrackParticleCnvAlg = xAODMaker__TrackParticleCnvAlg(InDetKeys.xAODDBMTrackParticleContainer()) 
        xAODDBMTrackParticleCnvAlg.xAODContainerName = InDetKeys.xAODDBMTrackParticleContainer() 
Ejemplo n.º 10
0
    def configure(self,keys=None):
        super(MuonStandalone,self).configure(keys)
        if not self.isEnabled(): return

        print " configuring MuonStandalone: flags ", muonStandaloneFlags

        from AthenaCommon.BeamFlags import jobproperties
        beamFlags = jobproperties.Beam 
        SegmentLocation = "MuonSegments"
        if muonStandaloneFlags.segmentOrigin == 'TruthTracking':
            SegmentLocation = "ThirdChainSegments"

        if muonRecFlags.doNSWNewThirdChain():
            getPublicTool("MuonLayerHoughTool")
            self.addAlg( CfgMgr.MuonLayerHoughAlg( "MuonLayerHoughAlg", PrintSummary = muonStandaloneFlags.printSummary()  ) )
            if not muonStandaloneFlags.patternsOnly():
                SegmentFinder = getPublicTool("MuonClusterSegmentFinderTool")
                Cleaner = getPublicToolClone("MuonTrackCleaner_seg","MuonTrackCleaner")
                Cleaner.PullCut = 3
                Cleaner.PullCutPhi = 3
                SegmentFinder.TrackCleaner = Cleaner
            # for test purposes allow parallel running of truth segment finding and new segment finder
                MuonSegmentFinderAlg = CfgMgr.MuonSegmentFinderAlg( "MuonSegmentMaker",SegmentCollectionName=SegmentLocation, 
                                                                    MuonPatternCalibration = getPublicTool("MuonPatternCalibration"),
                                                                    MuonPatternSegmentMaker = getPublicTool("MuonPatternSegmentMaker"),
                                                                    MuonTruthSummaryTool = None,
                                                                    PrintSummary = muonStandaloneFlags.printSummary() )
                if( muonRecFlags.doCSCs() ):
                    getPublicTool("CscSegmentUtilTool")
                    getPublicTool("Csc2dSegmentMaker")
                    getPublicTool("Csc4dSegmentMaker")
                else:
                    MuonSegmentFinderAlg.Csc2dSegmentMaker = None
                    MuonSegmentFinderAlg.Csc4dSegmentMaker = None
                self.addAlg( MuonSegmentFinderAlg )
        else:
            getPublicTool("MuonLayerHoughTool")
            self.addAlg( CfgMgr.MooSegmentFinderAlg( "MuonSegmentMaker",
                                                     SegmentFinder = getPublicToolClone("MuonSegmentFinder","MooSegmentFinder",
                                                                                        DoSummary=muonStandaloneFlags.printSummary()),
                                                     MuonSegmentOutputLocation = SegmentLocation,
                                                     UseCSC = muonRecFlags.doCSCs(),
                                                     UseMDT = muonRecFlags.doMDTs(),
                                                     UseRPC = muonRecFlags.doRPCs(),
                                                     UseTGC = muonRecFlags.doTGCs(),
                                                     UseTGCPriorBC = muonRecFlags.doTGCs() and muonRecFlags.useTGCPriorNextBC(),
                                                     UseTGCNextBC  = muonRecFlags.doTGCs() and muonRecFlags.useTGCPriorNextBC(),
                                                     doTGCClust = muonRecFlags.doTGCClusterSegmentFinding(),
                                                     doRPCClust = muonRecFlags.doRPCClusterSegmentFinding() ))



            self.addAlg( CfgMgr.MooSegmentFinderAlg( "MuonSegmentMaker_NCB",
                                                     SegmentFinder = getPublicToolClone("MooSegmentFinder_NCB","MuonSegmentFinder",
                                                                                        DoSummary=False,
                                                                                        Csc2dSegmentMaker = getPublicToolClone("Csc2dSegmentMaker_NCB","Csc2dSegmentMaker",
                                                                                                                               segmentTool = getPublicToolClone("CscSegmentUtilTool_NCB",
                                                                                                                                                                "CscSegmentUtilTool",
                                                                                                                                                                TightenChi2 = False, 
                                                                                                                                                                IPconstraint=False)),
                                                                                        Csc4dSegmentMaker = getPublicToolClone("Csc4dSegmentMaker_NCB","Csc4dSegmentMaker",
                                                                                                                               segmentTool = getPublicTool("CscSegmentUtilTool_NCB")),
                                                                                        DoMdtSegments=False,DoSegmentCombinations=False,DoSegmentCombinationCleaning=False),
                                                     MuonPatternCombinationLocation = "NCB_MuonHoughPatternCombinations", 
                                                     MuonSegmentOutputLocation = "NCB_MuonSegments", 
                                                     MuonSegmentCombinationOutputLocation = "NCB_MooreSegmentCombinations",
                                                     UseCSC = muonRecFlags.doCSCs(),
                                                     UseMDT = False,
                                                     UseRPC = False,
                                                     UseTGC = False,
                                                     UseTGCPriorBC = False,
                                                     UseTGCNextBC  = False,
                                                     doTGCClust = False,
                                                     doRPCClust = False) )

        self.addAlg( CfgMgr.xAODMaker__MuonSegmentCnvAlg("MuonSegmentCnvAlg") )
        self.addAlg( CfgMgr.xAODMaker__MuonSegmentCnvAlg("MuonSegmentCnvAlg_NCB",SegmentContainerName="NCB_MuonSegments",xAODContainerName="NCB_MuonSegments") )
        
        if muonStandaloneFlags.doSegmentsOnly():
            return	                    
        # Tracks builder
        #
        # add the algorithm (which uses the MuonTrackSteering)
        # 
        TrackBuilder = CfgMgr.MuPatTrackBuilder("MuPatTrackBuilder", TrackSteering = getPublicTool("MuonTrackSteering") )
        self.addAlg( TrackBuilder )
        
        self.registerOutputKey("MuonSpectrometerTracks",   self.MuPatTrackBuilder, "SpectrometerTrackOutputLocation")
        self.registerInputKey ("MuonSegments", self.MuPatTrackBuilder, "MuonSegmentCollection"   )

        
        if muonStandaloneFlags.createTrackParticles() and DetFlags.ID_on():
            from xAODTrackingCnv.xAODTrackingCnvConf import xAODMaker__TrackParticleCnvAlg
            xAODTrackParticleCnvAlg = xAODMaker__TrackParticleCnvAlg( name = "MuonStandaloneTrackParticleCnvAlg", 
                                                                      TrackParticleCreator = getPublicTool("MuonParticleCreatorTool"),
                                                                      TrackContainerName = "MuonSpectrometerTracks",
                                                                      xAODTrackParticlesFromTracksContainerName = "MuonSpectrometerTrackParticles",
                                                                      ConvertTrackParticles = False,
                                                                      ConvertTracks = True )
            self.addAlg( xAODTrackParticleCnvAlg )
Ejemplo n.º 11
0
    alg = AlgSequence() 
    alg += FTK_RDO_Reader 
    

    if rec.doTruth() and (rec.doWriteAOD() or rec.doWriteESD()):
        include ('FTK_RecExample/ConfiguredFTK_TrackTruth.py')
        FTK_TracksTruth = ConfiguredFTK_TrackTruth(Tracks="FTK_TrackCollection",
                                                TracksTruth = "FTK_Tracks_TruthCollection",
                                                DetailedTruth = "FTK_Tracks_DetailedTruthCollection")
        FTK_RefitTracksTruth = ConfiguredFTK_TrackTruth(Tracks="FTK_TrackCollectionRefit", 
                                                     TracksTruth = "FTK_RefitTracks_TruthCollection",
                                                     DetailedTruth = "FTK_RefitTracks_DetailedTruthCollection")
        from xAODTrackingCnv.xAODTrackingCnvConf import xAODMaker__TrackParticleCnvAlg

        FTKTrackParticleCnvAlg = xAODMaker__TrackParticleCnvAlg("FTKTrackParticleCnvAlg")
        FTKTrackParticleCnvAlg.xAODTrackParticlesFromTracksContainerName = "Converted_FTKTrackParticleContainer"
        FTKTrackParticleCnvAlg.TrackContainerName = "FTK_TrackCollection"
        FTKTrackParticleCnvAlg.ConvertTrackParticles = False
        FTKTrackParticleCnvAlg.ConvertTracks = True
        FTKTrackParticleCnvAlg.AddTruthLink = True
        FTKTrackParticleCnvAlg.TrackTruthContainerName = "FTK_Tracks_TruthCollection"
        FTKTrackParticleCnvAlg.PrintIDSummaryInfo = True
        topSequence += FTKTrackParticleCnvAlg

        FTKRefitTrackParticleCnvAlg = xAODMaker__TrackParticleCnvAlg("FTKRefitTrackParticleCnvAlg")
        FTKRefitTrackParticleCnvAlg.xAODTrackParticlesFromTracksContainerName = "Converted_FTKTrackParticleContainerRefit" 
        FTKRefitTrackParticleCnvAlg.TrackContainerName = "FTK_TrackCollectionRefit"
        FTKRefitTrackParticleCnvAlg.ConvertTrackParticles = False
        FTKRefitTrackParticleCnvAlg.ConvertTracks = True
        FTKRefitTrackParticleCnvAlg.AddTruthLink = True
Ejemplo n.º 12
0
    print InDetxAODParticleCreatorTool

if (
        doCreation or doConversion
):  # or InDetFlags.useExistingTracksAsInput()) : <---- [XXX JDC Should we included this?
    #                                                    problems appear when nothing should
    #                                                    be done but
    #                                                    useExistinTracksAsInput...
    # [XXX JDC: to deal with the MergedTracks case, the truth collections are
    #           defined in the InputTrackCollectionTruth variable. To be deprecated
    #           if finally there is no need of the special "MergedTrack" name
    if 'InputTrackCollectionTruth' not in dir():
        InputTrackCollectionTruth = InDetKeys.TracksTruth()
    from xAODTrackingCnv.xAODTrackingCnvConf import xAODMaker__TrackParticleCnvAlg
    if not InDetFlags.doDBMstandalone():
        xAODTrackParticleCnvAlg = xAODMaker__TrackParticleCnvAlg(
            InDetKeys.xAODTrackParticleContainer())
        xAODTrackParticleCnvAlg.xAODContainerName = InDetKeys.xAODTrackParticleContainer(
        )
        xAODTrackParticleCnvAlg.xAODTrackParticlesFromTracksContainerName = InDetKeys.xAODTrackParticleContainer(
        )
        xAODTrackParticleCnvAlg.TrackContainerName = InputTrackCollection
        xAODTrackParticleCnvAlg.TrackParticleCreator = InDetxAODParticleCreatorTool
        xAODTrackParticleCnvAlg.AODContainerName = InDetKeys.TrackParticles()
        xAODTrackParticleCnvAlg.AODTruthContainerName = InDetKeys.TrackParticlesTruth(
        )
        xAODTrackParticleCnvAlg.ConvertTrackParticles = doConversion
        xAODTrackParticleCnvAlg.ConvertTracks = doCreation
        xAODTrackParticleCnvAlg.AddTruthLink = InDetFlags.doTruth()
        xAODTrackParticleCnvAlg.TrackTruthContainerName = InputTrackCollectionTruth
        xAODTrackParticleCnvAlg.PrintIDSummaryInfo = True
        topSequence += xAODTrackParticleCnvAlg
Ejemplo n.º 13
0
def makeInDetPrecisionTracking(whichSignature,
                               verifier=False,
                               inputFTFtracks='TrigFastTrackFinder_Tracks',
                               outputTrackPrefixName="HLT_ID",
                               rois='EMViewRoIs',
                               doTRTextension=True):

    ptAlgs = [
    ]  #List containing all the precision tracking algorithms hence every new added alg has to be appended to the list

    #-----------------------------------------------------------------------------
    #                        Naming conventions

    algNamePrefix = "InDetTrigMT"
    #If signature specified add suffix to the algorithms
    signature = "_" + whichSignature if whichSignature else ''

    #Name settings for output Tracks/TrackParticles
    #This first part is for ambiguity solver tracks
    nameAmbiTrackCollection = "%s%sTrkTrack%s" % (outputTrackPrefixName,
                                                  'AmbSol', signature)

    #Tracks from TRT extension
    nameExtTrackCollection = "%s%sTrkTrack%s" % (outputTrackPrefixName,
                                                 'TRText', signature)

    #Note IDTrig suffix as a key to specify that this collection comes from precision tracking rather than fast tracking (FTF)
    outPTTracks = "%sTrkTrack_%s_%s" % (outputTrackPrefixName,
                                        remapSuffix(whichSignature), 'IDTrig')
    outPTTrackParticles = "%sTrack_%s_%s" % (
        outputTrackPrefixName, remapSuffix(whichSignature), 'IDTrig')

    #Atm there are mainly two output track collections one from ambiguity solver stage and one from trt,
    #we want to have the output name of the track collection the same whether TRT was run or not,
    #e.g InDetTrigPT_Tracks_electron
    if doTRTextension is True:
        nameExtTrackCollection = outPTTracks
    else:
        nameAmbiTrackCollection = outPTTracks

    #-----------------------------------------------------------------------------
    #                        Verifying input data for the algorithms

    #If run in views need to check data dependancies!
    #NOTE: this seems necessary only when PT is called from a different view than FTF otherwise causes stalls
    if verifier:
        verifier.DataObjects += [
            ('InDet::PixelGangedClusterAmbiguities',
             'StoreGateSvc+' + TrigPixelKeys.PixelClusterAmbiguitiesMap),
            ('TrackCollection', 'StoreGateSvc+' + inputFTFtracks)
        ]

    from AthenaCommon.AppMgr import ToolSvc
    #-----------------------------------------------------------------------------
    #                        Choose track summary tool
    from InDetTrigRecExample.InDetTrigConfigRecLoadTools import InDetTrigTrackSummaryTool
    from TrkTrackSummaryTool.TrkTrackSummaryToolConf import Trk__TrackSummaryTool
    from InDetTrigRecExample.InDetTrigConfigRecLoadTools import InDetTrigTrackSummaryHelperToolSharedHits, InDetTrigTRT_ElectronPidTool

    trigTrackSummaryTool = Trk__TrackSummaryTool(
        name="%sTrackSummaryToolSharedHitsWithTRT%s" %
        (algNamePrefix, signature),
        InDetSummaryHelperTool=InDetTrigTrackSummaryHelperToolSharedHits,
        doSharedHits=True,
        doHolesInDet=True)

    if doTRTextension:
        if "electron" in whichSignature or "tau" in whichSignature:
            trigTrackSummaryTool.TRT_ElectronPidTool = InDetTrigTRT_ElectronPidTool

        Parameter_config = True
        SummaryTool_config = trigTrackSummaryTool
    else:
        SummaryTool_config = InDetTrigTrackSummaryTool
        Parameter_config = False

    ToolSvc += SummaryTool_config

    #-----------------------------------------------------------------------------
    #                        Ambiguity solving stage

    from InDetTrigRecExample.InDetTrigConfigRecLoadTools import InDetTrigExtrapolator
    from InDetTrackScoringTools.InDetTrackScoringToolsConf import InDet__InDetAmbiScoringTool
    InDetTrigAmbiScoringTool = InDet__InDetAmbiScoringTool(
        name='%sScoringTool%s' % (algNamePrefix, signature),
        Extrapolator=InDetTrigExtrapolator,
        doEmCaloSeed=False,
        SummaryTool=SummaryTool_config)

    ToolSvc += InDetTrigAmbiScoringTool

    #TODO: Need option to change scoring tool based on the slice (beamgas)

    from InDetTrigRecExample.InDetTrigConfigRecLoadTools import InDetTrigAmbiTrackSelectionTool

    from InDetRecExample import TrackingCommon as TrackingCommon
    from TrkAmbiguityProcessor.TrkAmbiguityProcessorConf import Trk__DenseEnvironmentsAmbiguityScoreProcessorTool as ScoreProcessorTool
    InDetTrigAmbiguityScoreProcessor = ScoreProcessorTool(
        name='%sAmbiguityScoreProcessor%s' % (algNamePrefix, signature),
        ScoringTool=InDetTrigAmbiScoringTool,
        AssociationTool=TrackingCommon.
        getInDetTrigPRDtoTrackMapToolGangedPixels(),
        SelectionTool=InDetTrigAmbiTrackSelectionTool)

    from TrkAmbiguitySolver.TrkAmbiguitySolverConf import Trk__TrkAmbiguityScore
    InDetTrigAmbiguityScore = Trk__TrkAmbiguityScore(
        name='%sAmbiguityScore%s' % (algNamePrefix, signature),
        TrackInput=[inputFTFtracks],
        TrackOutput='ScoredMap' + signature,
        AmbiguityScoreProcessor=InDetTrigAmbiguityScoreProcessor)

    from InDetTrigRecExample.InDetTrigConfigRecLoadTools import InDetTrigTrackFitter
    from TrkAmbiguityProcessor.TrkAmbiguityProcessorConf import Trk__SimpleAmbiguityProcessorTool as ProcessorTool
    InDetTrigMTAmbiguityProcessor = ProcessorTool(
        name='%sAmbiguityProcessor%s' % (algNamePrefix, signature),
        Fitter=InDetTrigTrackFitter,
        ScoringTool=InDetTrigAmbiScoringTool,
        AssociationTool=TrackingCommon.
        getInDetTrigPRDtoTrackMapToolGangedPixels(),
        TrackSummaryTool=SummaryTool_config,
        SelectionTool=InDetTrigAmbiTrackSelectionTool)

    ToolSvc += InDetTrigMTAmbiguityProcessor

    from TrkAmbiguitySolver.TrkAmbiguitySolverConf import Trk__TrkAmbiguitySolver
    InDetTrigMTAmbiguitySolver = Trk__TrkAmbiguitySolver(
        name='%sAmbiguitySolver%s' % (algNamePrefix, signature),
        TrackInput='ScoredMap' + signature,
        TrackOutput=nameAmbiTrackCollection,
        AmbiguityProcessor=InDetTrigMTAmbiguityProcessor)

    ptAlgs.extend([InDetTrigAmbiguityScore, InDetTrigMTAmbiguitySolver])
    if doTRTextension:

        proxySignature = whichSignature
        if "tau" in whichSignature:
            proxySignature = "tau"

        #-----------------------------------------------------------------------------
        #                        TRT data preparation
        from AthenaCommon.GlobalFlags import globalflags
        #Only add raw data decoders if we're running over raw data
        TRT_RDO_Key = "TRT_RDOs"
        if globalflags.InputFormat.is_bytestream():
            TRT_RDO_Key = TrigTRTKeys.RDOs
            from TRT_RawDataByteStreamCnv.TRT_RawDataByteStreamCnvConf import TRT_RodDecoder
            InDetTRTRodDecoder = TRT_RodDecoder(
                name="%sTRTRodDecoder%s" % (algNamePrefix, signature),
                LoadCompressTableDB=True
            )  #(globalflags.DataSource() != 'geant4'))
            ToolSvc += InDetTRTRodDecoder

            from TRT_RawDataByteStreamCnv.TRT_RawDataByteStreamCnvConf import TRTRawDataProviderTool
            InDetTRTRawDataProviderTool = TRTRawDataProviderTool(
                name="%sTRTRawDataProviderTool%s" % (algNamePrefix, signature),
                Decoder=InDetTRTRodDecoder)
            ToolSvc += InDetTRTRawDataProviderTool

            # load the TRTRawDataProvider
            from TRT_RawDataByteStreamCnv.TRT_RawDataByteStreamCnvConf import TRTRawDataProvider
            InDetTRTRawDataProvider = TRTRawDataProvider(
                name="%sTRTRawDataProvider%s" % (algNamePrefix, signature),
                RDOKey=TrigTRTKeys.RDOs,
                ProviderTool=InDetTRTRawDataProviderTool)
            InDetTRTRawDataProvider.isRoI_Seeded = True
            InDetTRTRawDataProvider.RoIs = rois

            ptAlgs.append(InDetTRTRawDataProvider)

        #-----------------------------------------------------------------------------
        #                        TRT extension
        # Keep track that this needs to have a switch between DAF and XK
        # trkExtensionType = 'XK'
        # if InDetTrigFlags.trtExtensionType() is 'DAF' :

        from InDetTrigRecExample.InDetTrigCommonTools import InDetTrigTRT_DriftCircleTool

        from InDetTrigRecExample.InDetTrigSliceSettings import InDetTrigSliceSettings
        from InDetPrepRawDataFormation.InDetPrepRawDataFormationConf import InDet__TRT_RIO_Maker
        InDetTrigTRTRIOMaker = InDet__TRT_RIO_Maker(
            name="%sTRTDriftCircleMaker%s" % (algNamePrefix, signature),
            TRTRIOLocation=TrigTRTKeys.DriftCircles,
            TRTRDOLocation=TRT_RDO_Key,
            #EtaHalfWidth = InDetTrigSliceSettings[('etaHalfWidth',signature)],
            #PhiHalfWidth = InDetTrigSliceSettings[('phiHalfWidth',signature)],
            #doFullScan =   InDetTrigSliceSettings[('doFullScan',signature)],
            TRT_DriftCircleTool=InDetTrigTRT_DriftCircleTool)
        InDetTrigTRTRIOMaker.isRoI_Seeded = True
        InDetTrigTRTRIOMaker.RoIs = rois

        from InDetTrigRecExample.InDetTrigConfigRecLoadTools import InDetTrigPatternPropagator, InDetTrigPatternUpdator
        from InDetTrigRecExample.ConfiguredNewTrackingTrigCuts import EFIDTrackingCuts
        InDetTrigCutValues = EFIDTrackingCuts

        #from InDetTrigRecExample.InDetTrigConfigRecLoadTools import InDetTrigSiDetElementsRoadMaker, InDetTrigSiComTrackFinder

        # Condition algorithm for InDet__TRT_DetElementsRoadMaker_xk
        from AthenaCommon.AlgSequence import AthSequencer
        condSeq = AthSequencer("AthCondSeq")

        InDetTRTRoadAlgName = "%sTRT_DetElementsRoadCondAlg_xk" % (
            algNamePrefix)

        if not hasattr(condSeq, InDetTRTRoadAlgName):
            from TRT_DetElementsRoadTool_xk.TRT_DetElementsRoadTool_xkConf import InDet__TRT_DetElementsRoadCondAlg_xk

            # condSeq += InDet__TRT_DetElementsRoadCondAlg_xk(name = "%sTRT_DetElementsRoadCondAlg_xk%s"%(algNamePrefix, signature) )
            condSeq += InDet__TRT_DetElementsRoadCondAlg_xk(
                name=InDetTRTRoadAlgName)

        from TRT_DetElementsRoadTool_xk.TRT_DetElementsRoadTool_xkConf import InDet__TRT_DetElementsRoadMaker_xk
        InDetTrigTRTDetElementsRoadMaker = InDet__TRT_DetElementsRoadMaker_xk(
            name='%sTRTRoadMaker%s' % (algNamePrefix, signature),
            #DetectorStoreLocation = 'DetectorStore',
            #TRTManagerLocation    = 'TRT',
            MagneticFieldMode='MapSolenoid',
            PropagatorTool=InDetTrigPatternPropagator)

        ToolSvc += InDetTrigTRTDetElementsRoadMaker

        #TODO implement new configuration of circle cut
        from InDetTrigRecExample.InDetTrigConfigRecLoadTools import InDetTrigTRTDriftCircleCut
        from TRT_TrackExtensionTool_xk.TRT_TrackExtensionTool_xkConf import InDet__TRT_TrackExtensionTool_xk
        InDetTrigTRTExtensionTool = InDet__TRT_TrackExtensionTool_xk(
            name="%sTrackExtensionTool%s" % (algNamePrefix, signature),
            MagneticFieldMode='MapSolenoid',  # default
            TRT_ClustersContainer=TrigTRTKeys.DriftCircles,  # default
            TrtManagerLocation='TRT',  # default
            PropagatorTool=InDetTrigPatternPropagator,
            UpdatorTool=InDetTrigPatternUpdator,
            #RIOonTrackToolYesDr = # default for now
            #RIOonTrackToolNoDr  = # default for now
            RoadTool=InDetTrigTRTDetElementsRoadMaker,
            DriftCircleCutTool=InDetTrigTRTDriftCircleCut,
            MinNumberDriftCircles=EFIDTrackingCuts.minTRTonTrk(),
            ScaleHitUncertainty=2.,
            RoadWidth=20.,
            UseParameterization=EFIDTrackingCuts.useParameterizedTRTCuts())

        ToolSvc += InDetTrigTRTExtensionTool

        #          TODO add second option of track extension
        #                   elif InDetTrigFlags.trtExtensionType() is 'DAF' :

        from TRT_TrackExtensionAlg.TRT_TrackExtensionAlgConf import InDet__TRT_TrackExtensionAlg
        InDetTrigTRTextensionAlg = InDet__TRT_TrackExtensionAlg(
            name="%sTrackExtensionAlg%s" % (algNamePrefix, signature),
            InputTracksLocation=nameAmbiTrackCollection,
            TrackExtensionTool=InDetTrigTRTExtensionTool,
            ExtendedTracksLocation='ExtendedTrackMap')
        #-----------------------------------------------------------------------------
        #                        TRT processor

        #TODO: do I need a new fitter for this? Or can I use the same one?
        #TODO In Run2 option for cosmic
        #InDetTrigExtensionFitter = InDetTrigTrackFitter
        #from InDetTrackScoringTools.InDetTrackScoringToolsConf import InDet__InDetAmbiScoringTool
        InDetTrigExtScoringTool = InDet__InDetAmbiScoringTool(
            name='%sExtScoringTool%s' % (algNamePrefix, signature),
            Extrapolator=InDetTrigExtrapolator,
            SummaryTool=SummaryTool_config,
            useAmbigFcn=True,  # this is NewTracking  
            maxRPhiImp=InDetTrigCutValues.maxPrimaryImpact(),
            maxZImp=InDetTrigCutValues.maxZImpact(),
            maxEta=InDetTrigCutValues.maxEta(),
            minSiClusters=InDetTrigCutValues.minClusters(),
            maxSiHoles=InDetTrigCutValues.maxHoles(),
            maxDoubleHoles=InDetTrigCutValues.maxDoubleHoles(),
            usePixel=InDetTrigCutValues.usePixel(),
            useSCT=InDetTrigCutValues.useSCT(),
            doEmCaloSeed=False,
            minTRTonTrk=InDetTrigCutValues.minTRTonTrk(),
            #useSigmaChi2   = False # tuning from Thijs
            DriftCircleCutTool=InDetTrigTRTDriftCircleCut,
        )

        InDetTrigExtScoringTool.minPt = InDetTrigSliceSettings[(
            'pTmin', proxySignature)]

        ToolSvc += InDetTrigExtScoringTool

        from InDetExtensionProcessor.InDetExtensionProcessorConf import InDet__InDetExtensionProcessor
        InDetTrigExtensionProcessor = InDet__InDetExtensionProcessor(
            name="%sExtensionProcessor%s" % (algNamePrefix, signature),
            TrackName=nameAmbiTrackCollection,
            #Cosmics           = InDetFlags.doCosmics(),
            ExtensionMap='ExtendedTrackMap',
            NewTrackName=nameExtTrackCollection,
            TrackFitter=InDetTrigTrackFitter,
            TrackSummaryTool=SummaryTool_config,
            ScoringTool=
            InDetTrigExtScoringTool,  #TODO do I provide the same tool as for ambiguity solver?
            suppressHoleSearch=False)  # does not work properly
        #Check these option after DAF is implemented
        #tryBremFit         = InDetFlags.doBremRecovery(),
        #caloSeededBrem     = InDetFlags.doCaloSeededBrem(),
        #pTminBrem          = NewTrackingCuts.minPTBrem() )
        #RefitPrds          = not (InDetFlags.refitROT() or (InDetFlags.trtExtensionType() is 'DAF')))

        #InDetTRTExtension.OutputLevel = VERBOSE
        ptAlgs.extend([
            InDetTrigTRTRIOMaker, InDetTrigTRTextensionAlg,
            InDetTrigExtensionProcessor
        ])

    #-----------------------------------------------------------------------------
    #                      Track particle conversion algorithm
    #
    #
    """ Use the finalised track collection and convert it to container of xAOD Track Particles  """

    from TrkParticleCreator.TrkParticleCreatorConf import Trk__TrackParticleCreatorTool
    InDetTrigMTxAODParticleCreatorTool = Trk__TrackParticleCreatorTool(
        name="%sxAODParticleCreatorTool%s" % (algNamePrefix, signature),
        Extrapolator=InDetTrigExtrapolator,
        KeepParameters=Parameter_config,
        #TrackSummaryTool = InDetTrigTrackSummaryToolSharedHits)
        TrackSummaryTool=SummaryTool_config)

    ToolSvc += InDetTrigMTxAODParticleCreatorTool
    log.debug(InDetTrigMTxAODParticleCreatorTool)

    from xAODTrackingCnv.xAODTrackingCnvConf import xAODMaker__TrackCollectionCnvTool
    InDetTrigMTxAODTrackCollectionCnvTool = xAODMaker__TrackCollectionCnvTool(
        name="%sxAODTrackCollectionCnvTool%s" % (algNamePrefix, signature),
        TrackParticleCreator=InDetTrigMTxAODParticleCreatorTool)

    ToolSvc += InDetTrigMTxAODTrackCollectionCnvTool
    log.debug(InDetTrigMTxAODTrackCollectionCnvTool)

    #This one shouldn't be necessary
    #TODO: obsolete turn off
    from xAODTrackingCnv.xAODTrackingCnvConf import xAODMaker__RecTrackParticleContainerCnvTool
    InDetTrigMTRecTrackParticleContainerCnvTool = xAODMaker__RecTrackParticleContainerCnvTool(
        name="%sRecTrackContainerCnvTool%s" % (algNamePrefix, signature),
        TrackParticleCreator=InDetTrigMTxAODParticleCreatorTool)

    ToolSvc += InDetTrigMTRecTrackParticleContainerCnvTool
    #print (InDetTrigMTRecTrackParticleContainerCnvTool)

    from TrigEDMConfig.TriggerEDMRun3 import recordable
    from xAODTrackingCnv.xAODTrackingCnvConf import xAODMaker__TrackParticleCnvAlg
    InDetTrigMTxAODTrackParticleCnvAlg = xAODMaker__TrackParticleCnvAlg(
        name="%sxAODParticleCreatorAlg%s" % (algNamePrefix, signature),
        # Properties below are used for:  TrackCollection -> xAOD::TrackParticle
        ConvertTracks=
        True,  #Turn on  retrieve of TrackCollection, false by default
        TrackContainerName=outPTTracks,
        xAODTrackParticlesFromTracksContainerName=recordable(
            outPTTrackParticles),
        TrackCollectionCnvTool=InDetTrigMTxAODTrackCollectionCnvTool,
        ## Properties below are used for: Rec:TrackParticle, aod -> xAOD::TrackParticle (Turn off)
        ConvertTrackParticles=
        False,  # Retrieve of Rec:TrackParticle, don't need this atm
        xAODContainerName='',
        RecTrackParticleContainerCnvTool=
        InDetTrigMTRecTrackParticleContainerCnvTool,
        TrackParticleCreator=InDetTrigMTxAODParticleCreatorTool)

    #allViewAlgorithms += InDetTrigMTxAODTrackParticleCnvAlg
    log.debug(InDetTrigMTxAODTrackParticleCnvAlg)
    ptAlgs.append(InDetTrigMTxAODTrackParticleCnvAlg)

    #ToolSvc.InDetTrigHoleSearchTool.SctSummaryTool.InDetTrigInDetSCT_FlaggedConditionTool.SCT_FlaggedCondData = "SCT_FlaggedCondData_TRIG"

    #Potentialy other algs with more collections?
    #Might Drop the list in the end and keep just one output key
    nameTrackCollections = [outPTTracks]
    nameTrackParticles = [outPTTrackParticles]

    #Return list of Track keys, TrackParticle keys, and PT algs
    return nameTrackCollections, nameTrackParticles, ptAlgs