diff --git a/Trigger/TrigValidation/TrigUpgradeTest/python/InDetPT.py b/Trigger/TrigValidation/TrigUpgradeTest/python/InDetPT.py new file mode 100644 index 0000000000000000000000000000000000000000..ef33054cedfb73ac5e8401213afacfef6e34fc56 --- /dev/null +++ b/Trigger/TrigValidation/TrigUpgradeTest/python/InDetPT.py @@ -0,0 +1,132 @@ +# 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 + + #ToolSvc.InDetTrigHoleSearchTool.SctSummaryTool.InDetTrigInDetSCT_FlaggedConditionTool.SCT_FlaggedCondData = "SCT_FlaggedCondData_TRIG" + + + #Return list of Track keys, TrackParticle keys, and PT algs + return nameTrackCollections, nameTrackParticles, [InDetTrigMTAmbiguitySolver, InDetTrigMTxAODTrackParticleCnvAlg] + diff --git a/Trigger/TrigValidation/TrigUpgradeTest/python/MuonSetup.py b/Trigger/TrigValidation/TrigUpgradeTest/python/MuonSetup.py index d02fdb7814448a6630c6cf5211c9009d9b84ebe1..fed58b913d3d1520ae1120316e47780411d02f28 100644 --- a/Trigger/TrigValidation/TrigUpgradeTest/python/MuonSetup.py +++ b/Trigger/TrigValidation/TrigUpgradeTest/python/MuonSetup.py @@ -584,8 +584,32 @@ 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' ) ] 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] + #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 theCaloMeasTool = getPublicToolClone("TrigCaloMeasTool", "MuidCaloEnergyMeas", CaloNoiseTool="", UseCaloNoiseTool=False,CellContainerLocation="")