Skip to content
Snippets Groups Projects
Commit 2bd13b2e authored by Matous Vozak's avatar Matous Vozak
Browse files

creating PT sequence and adding it into muon sig

parent 60d4bfad
No related branches found
No related tags found
No related merge requests found
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
#
# Setup of precision tracking
def makeInDetPrecisionTracking( whichSignature, verifier = False, inputFTFtracks='TrigFastTrackFinder_Tracks', outputTrackPrefixName = "InDetTrigPT" ):
#def makeInDetPrecisionTracking( whichSignature, inputFTFtracks='TrigFastTrackFinder_Tracks', outputTrackPrefixName = "InDetTrigPT" ):
from AthenaCommon.AppMgr import ToolSvc
#def makeInDetPrecisionTracking( whichSignature, inputFTFtracks, outputTrackPrefixName ):
#If signature specified add suffix to the algorithms
signature = "_" + whichSignature if whichSignature else ''
#Name settings
#This first part is for ambiguity solver tracks
nameAmbiTrackCollection = outputTrackPrefixName + "Tracks" + signature
nameAmbiTrackParticles = outputTrackPrefixName + "TrackParticles" + signature
#Potentialy other algs with more collections? Make a list just in case
nameTrackCollections = [ nameAmbiTrackCollection ]
nameTrackParticles = [ nameAmbiTrackParticles ]
#If run in views need to check data dependancies!
#if runInViews:
#FIXME: check whether the passed argument is a verifier?
#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+TrigPixelClusterAmbiguitiesMap' ),
( 'TrackCollection' , 'StoreGateSvc+' + inputFTFtracks ) ]
#
# --- Ambiguity solver algorithm
#
#TODO:Check whether InDet alg have to be replaced by new ones
from InDetTrigRecExample.InDetTrigConfigRecLoadTools import InDetTrigTrackSummaryTool
from InDetTrigRecExample.InDetTrigConfigRecLoadTools import InDetTrigExtrapolator
from InDetTrackScoringTools.InDetTrackScoringToolsConf import InDet__InDetAmbiScoringTool
InDetTrigMTAmbiScoringTool = InDet__InDetAmbiScoringTool( name = 'InDetTrigMTScoringTool' + signature ,
Extrapolator = InDetTrigExtrapolator,
InputEmClusterContainerName = '', #need to be reset to empty string
doEmCaloSeed = False,
SummaryTool = InDetTrigTrackSummaryTool)
ToolSvc += InDetTrigMTAmbiScoringTool
from InDetTrigRecExample.InDetTrigConfigRecLoadTools import InDetTrigAmbiTrackSelectionTool
from InDetTrigRecExample.InDetTrigConfigRecLoadTools import InDetTrigTrackFitter
from TrkAmbiguityProcessor.TrkAmbiguityProcessorConf import Trk__SimpleAmbiguityProcessorTool as ProcessorTool
InDetTrigMTAmbiguityProcessor = ProcessorTool(name = 'InDetTrigMTAmbiguityProcessor' + signature,
Fitter = InDetTrigTrackFitter,
ScoringTool = InDetTrigMTAmbiScoringTool,
SelectionTool = InDetTrigAmbiTrackSelectionTool)
ToolSvc += InDetTrigMTAmbiguityProcessor
from TrkAmbiguitySolver.TrkAmbiguitySolverConf import Trk__TrkAmbiguitySolver
InDetTrigMTAmbiguitySolver = Trk__TrkAmbiguitySolver(name = 'InDetTrigMTAmbiguitySolver' + signature,
TrackInput =[ inputFTFtracks ],
TrackOutput = nameAmbiTrackCollection,
AmbiguityProcessor = InDetTrigMTAmbiguityProcessor)
#allViewAlgorithms += InDetTrigMTAmbiguitySolver
#
# --- Track particle conversion algorithm
#
from TrkParticleCreator.TrkParticleCreatorConf import Trk__TrackParticleCreatorTool
InDetTrigMTxAODParticleCreatorTool = Trk__TrackParticleCreatorTool(name = "InDetTrigMTxAODParticleCreatorTool" + signature,
Extrapolator = InDetTrigExtrapolator,
#ForceTrackSummaryUpdate = False,
#TrackSummaryTool = InDetTrigTrackSummaryToolSharedHits)
TrackSummaryTool = InDetTrigTrackSummaryTool)
ToolSvc += InDetTrigMTxAODParticleCreatorTool
print InDetTrigMTxAODParticleCreatorTool
from xAODTrackingCnv.xAODTrackingCnvConf import xAODMaker__TrackCollectionCnvTool
InDetTrigMTxAODTrackCollectionCnvTool= xAODMaker__TrackCollectionCnvTool(name = "InDetTrigMTxAODTrackCollectionCnvTool" + signature,
TrackParticleCreator = InDetTrigMTxAODParticleCreatorTool)
ToolSvc += InDetTrigMTxAODTrackCollectionCnvTool
print InDetTrigMTxAODTrackCollectionCnvTool
#This one shouldn't be necessary
#TODO: obsolete turn off
from xAODTrackingCnv.xAODTrackingCnvConf import xAODMaker__RecTrackParticleContainerCnvTool
InDetTrigMTRecTrackParticleContainerCnvTool= xAODMaker__RecTrackParticleContainerCnvTool(name = "InDetTrigMTRecTrackContainerCnvTool" + signature,
TrackParticleCreator = InDetTrigMTxAODParticleCreatorTool)
ToolSvc += InDetTrigMTRecTrackParticleContainerCnvTool
print InDetTrigMTRecTrackParticleContainerCnvTool
from xAODTrackingCnv.xAODTrackingCnvConf import xAODMaker__TrackParticleCnvAlg
InDetTrigMTxAODTrackParticleCnvAlg = xAODMaker__TrackParticleCnvAlg(name = "InDetTrigMTxAODParticleCreatorAlg" + signature,
# Properties below are used for: TrackCollection -> xAOD::TrackParticle
ConvertTracks = True, #Turn on retrieve of TrackCollection, false by default
TrackContainerName = nameAmbiTrackCollection,
xAODTrackParticlesFromTracksContainerName = nameAmbiTrackParticles,
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,
#PrintIDSummaryInfo = True, #Just to test and have some output
TrackParticleCreator = InDetTrigMTxAODParticleCreatorTool
)
#allViewAlgorithms += InDetTrigMTxAODTrackParticleCnvAlg
print InDetTrigMTxAODTrackParticleCnvAlg
#Return list of Track keys, TrackParticle keys, and PT algs
return nameTrackCollections, nameTrackParticles, [InDetTrigMTAmbiguitySolver, InDetTrigMTxAODTrackParticleCnvAlg]
...@@ -584,8 +584,33 @@ def muEFCBRecoSequence( RoIs, OutputLevel=INFO ): ...@@ -584,8 +584,33 @@ def muEFCBRecoSequence( RoIs, OutputLevel=INFO ):
ViewVerifyTrk.DataObjects = [( 'xAOD::TrackParticleContainer' , 'StoreGateSvc+xAODTracks' ),( 'SCT_FlaggedCondData' , 'StoreGateSvc+SCT_FlaggedCondData' ), ( 'InDetBSErrContainer' , 'StoreGateSvc+SCT_ByteStreamErrs' ), ( 'xAOD::EventInfo' , 'StoreGateSvc+EventInfo' ),( 'xAOD::IParticleContainer' , 'StoreGateSvc+xAODTracks' ),( 'SCT_ByteStreamFractionContainer' , 'StoreGateSvc+SCT_ByteStreamFrac' ),( 'Muon::CscStripPrepDataContainer' , 'StoreGateSvc+CSC_Measurements' ), ( 'Muon::MdtPrepDataContainer' , 'StoreGateSvc+MDT_DriftCircles' ), ( 'xAOD::TrackParticleContainer' , 'StoreGateSvc+MuonSpectrometerTrackParticles' ) ] ViewVerifyTrk.DataObjects = [( 'xAOD::TrackParticleContainer' , 'StoreGateSvc+xAODTracks' ),( 'SCT_FlaggedCondData' , 'StoreGateSvc+SCT_FlaggedCondData' ), ( 'InDetBSErrContainer' , 'StoreGateSvc+SCT_ByteStreamErrs' ), ( 'xAOD::EventInfo' , 'StoreGateSvc+EventInfo' ),( 'xAOD::IParticleContainer' , 'StoreGateSvc+xAODTracks' ),( 'SCT_ByteStreamFractionContainer' , 'StoreGateSvc+SCT_ByteStreamFrac' ),( 'Muon::CscStripPrepDataContainer' , 'StoreGateSvc+CSC_Measurements' ), ( 'Muon::MdtPrepDataContainer' , 'StoreGateSvc+MDT_DriftCircles' ), ( 'xAOD::TrackParticleContainer' , 'StoreGateSvc+MuonSpectrometerTrackParticles' ) ]
muEFCBRecoSequence += ViewVerifyTrk muEFCBRecoSequence += ViewVerifyTrk
#Precision Tracking
PTAlgs = [] #List of precision tracking algs
PTTracks = [] #List of TrackCollectionKeys
PTTrackParticles = [] #List of TrackParticleKeys
from TrigUpgradeTest.InDetPT import makeInDetPrecisionTracking
#When run in a different view than FTF some data dependencies needs to be loaded through verifier
#Pass verifier as an argument and it will automatically append necessary DataObjects
#@NOTE: Don't provide any verifier if loaded in the same view as FTF
PTTracks, PTTrackParticles, PTAlgs = makeInDetPrecisionTracking( "muons", ViewVerifyTrk )
#Get last tracks from the list as input for other alg
##Not added to the sequence! Causing stall
PTSeq = seqAND("precisionTrackingInMuons", PTAlgs )
muEFCBRecoSequence += PTSeq
#Default from FTF
#trackParticles = "xAODTracks"
#TODO: change according to what needs to be done here
#Last key in the list is for the TrackParticles after all PT stages (so far only one :) )
trackParticles = PTTrackParticles[-1]
print 'TRACKPARTICLES %s' %trackParticles
#Make InDetCandidates #Make InDetCandidates
theIndetCandidateAlg = CfgMgr.MuonCombinedInDetCandidateAlg("TrigMuonCombinedInDetCandidateAlg",TrackSelector=getPublicTool("MuonCombinedInDetDetailedTrackSelectorTool"),TrackParticleLocation = ["xAODTracks"],ForwardParticleLocation="xAODTracks",OutputLevel=DEBUG) theIndetCandidateAlg = CfgMgr.MuonCombinedInDetCandidateAlg("TrigMuonCombinedInDetCandidateAlg",TrackSelector=getPublicTool("MuonCombinedInDetDetailedTrackSelectorTool"),TrackParticleLocation = [ trackParticles ],ForwardParticleLocation=trackParticles,OutputLevel=DEBUG)
#MuonCombinedCandidates #MuonCombinedCandidates
theCaloMeasTool = getPublicToolClone("TrigCaloMeasTool", "MuidCaloEnergyMeas", CaloNoiseTool="", UseCaloNoiseTool=False,CellContainerLocation="") theCaloMeasTool = getPublicToolClone("TrigCaloMeasTool", "MuidCaloEnergyMeas", CaloNoiseTool="", UseCaloNoiseTool=False,CellContainerLocation="")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment