ATLAS Offline Software
Loading...
Searching...
No Matches
TrackParticleCnvAlg.h
Go to the documentation of this file.
1// Dear emacs, this is -*- c++ -*-
2
3/*
4 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
5*/
6
7#ifndef XAODCREATORALGS_TRACKPARTICLECREATOR_H
8#define XAODCREATORALGS_TRACKPARTICLECREATOR_H
9
10// System include(s):
11#include <string>
12
13// Athena/Gaudi include(s):
15#include "GaudiKernel/ToolHandle.h"
29// Local include(s):
35
36
37
38namespace xAODMaker {
39
51
52 public:
54 TrackParticleCnvAlg( const std::string& name, ISvcLocator* svcLoc );
55
57 virtual StatusCode initialize();
59 virtual StatusCode execute(const EventContext& ctx) const;
60
61 private:
62
64 Gaudi::Property<bool> m_addTruthLink{this,"AddTruthLink", false };
66
67
69 ToolHandle<Trk::ITrackParticleCreatorTool> m_particleCreator{this, "TrackParticleCreator", "Trk::TrackParticleCreatorTool/TrackParticleCreatorTool" };
71 ToolHandle<IMCTruthClassifier> m_truthClassifier{
72 this,
73 "MCTruthClassifier",
74 "MCTruthClassifier/MCTruthClassifier",
75 " MCTruthClassifier Instance to use "
76 };
77
78 // handles to the converting tools
79 ToolHandle<xAODMaker::ITrackCollectionCnvTool> m_TrackCollectionCnvTool{this, "TrackCollectionCnvTool", "xAODMaker::TrackCollectionCnvTool/TrackCollectionCnvTool"};
80 ToolHandle<xAODMaker::IRecTrackParticleContainerCnvTool>
81 m_RecTrackParticleContainerCnvTool{this, "RecTrackParticleContainerCnvTool", "xAODMaker::RecTrackParticleContainerCnvTool/"
82 "RecTrackParticleContainerCnvTool" };
83
84 SG::ReadHandleKey<Rec::TrackParticleContainer> m_aod{this, "AODContainerName", "TrackParticleCandidate"};
85
86 SG::ReadHandleKey<TrackCollection> m_tracks{this, "TrackContainerName", "Tracks"};
87
88 SG::ReadHandleKey<xAOD::VertexContainer> m_primaryVertexContainer{ this, "PrimaryVerticesName", "", "Name of primary vertex container is case the parameters should be calculated with respect to the primary vertex"};
89
90 SG::WriteHandleKey<xAOD::TrackParticleContainer> m_xaodout{this, "xAODTrackParticlesFromTracksContainerName", "InDetTrackParticles"};
91
92
93 SG::WriteHandleKey<xAOD::TrackParticleContainer> m_xaodTrackParticlesout{this, "xAODContainerName", "ConvertedTrackParticleCandidate" };
94
95
96 SG::ReadHandleKey<xAODTruthParticleLinkVector> m_truthParticleLinkVec{this, "xAODTruthLinkVector", "xAODTruthLinks"};
98 SG::ReadHandleKey<TrackTruthCollection> m_trackTruth{this, "TrackTruthContainerName", ""};
99
100 // Allow monitoring of track parameters during conversion
101 Gaudi::Property<bool> m_doMonitoring{this, "DoMonitoring", false};
102 ToolHandle<ITrackParticleMonitoring> m_trackMonitoringTool{ this, "TrkMonTool", "", "Tracking Monitoring tool" };
103
104 //for timing we need a handle to the MonTool in the alg
105 ToolHandle<GenericMonitoringTool > m_monTool { this, "MonTool", "", "Monitoring tool" };
106
107 // Augment observed tracks with information from track observer tool map
108 Gaudi::Property<bool> m_augmentObservedTracks{this, "AugmentObservedTracks", false, "augment observed tracks"};
109 SG::ReadHandleKey<ObservedTrackMap> m_tracksMap{this, "TracksMapName", "" , "name of observed tracks map saved in store"};
110
111
113 Gaudi::Property<bool> m_convertAODTrackParticles{this, "ConvertTrackParticles", true};
114
116 Gaudi::Property<bool> m_convertTracks{this, "ConvertTracks", false};
117
118 template<typename CONT, typename TRUTHCONT, typename CONVTOOL>
119 int convert(const EventContext& ctx,
120 const CONT&,
121 const TRUTHCONT&,
122 CONVTOOL& tool,
125 const xAOD::Vertex* primaryVertex = nullptr,
126 const ObservedTrackMap* obs_track_map = 0) const;
127
130 const Rec::TrackParticleContainer& container,
131 const Rec::TrackParticle& tp,
132 const EventContext& ctx);
133
136 const TrackCollection& container,
137 const Trk::Track& tp,
138 const EventContext& ctx);
139
140 }; // class TrackParticleCnvAlg
141
142} // namespace xAODMaker
143
144#endif // XAODCREATORALGS_TRACKPARTICLECREATOR_H
Maintain a set of objects, one per slot.
std::map< int, std::tuple< Trk::Track *, double, xAOD::RejectionStep, xAOD::RejectionReason, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, float, float, int, std::vector< xAOD::RejectionStep >, std::vector< xAOD::RejectionReason > > > ObservedTrackMap
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
DataVector< Trk::Track > TrackCollection
This typedef represents a collection of Trk::Track objects.
An algorithm that can be simultaneously executed in multiple threads.
Property holding a SG store/key/clid from which a ReadHandle is made.
Property holding a SG store/key/clid from which a WriteHandle is made.
ToolHandle< xAODMaker::IRecTrackParticleContainerCnvTool > m_RecTrackParticleContainerCnvTool
Gaudi::Property< bool > m_convertAODTrackParticles
toggle on converting AOD track particles to xAOD
SG::ReadHandleKey< xAODTruthParticleLinkVector > m_truthParticleLinkVec
ToolHandle< GenericMonitoringTool > m_monTool
ToolHandle< ITrackParticleMonitoring > m_trackMonitoringTool
ToolHandle< xAODMaker::ITrackCollectionCnvTool > m_TrackCollectionCnvTool
virtual StatusCode initialize()
Function initialising the algorithm.
Gaudi::Property< bool > m_addTruthLink
toggle on adding truth links
SG::ReadHandleKey< Rec::TrackParticleContainer > m_aod
virtual StatusCode execute(const EventContext &ctx) const
Function executing the algorithm.
SG::ReadHandleKey< TrackParticleTruthCollection > m_aodTruth
SG::ReadHandleKey< TrackTruthCollection > m_trackTruth
SG::WriteHandleKey< xAOD::TrackParticleContainer > m_xaodTrackParticlesout
int convert(const EventContext &ctx, const CONT &, const TRUTHCONT &, CONVTOOL &tool, SG::WriteHandle< xAOD::TrackParticleContainer > &, const xAODTruthParticleLinkVector *, const xAOD::Vertex *primaryVertex=nullptr, const ObservedTrackMap *obs_track_map=0) const
SG::ReadHandleKey< ObservedTrackMap > m_tracksMap
TrackParticleCnvAlg(const std::string &name, ISvcLocator *svcLoc)
Regular algorithm constructor.
SG::WriteHandleKey< xAOD::TrackParticleContainer > m_xaodout
Gaudi::Property< bool > m_augmentObservedTracks
SG::ReadHandleKey< TrackCollection > m_tracks
SG::ReadHandleKey< xAOD::VertexContainer > m_primaryVertexContainer
xAOD::TrackParticle * createParticle(xAOD::TrackParticleContainer &xaod, const Rec::TrackParticleContainer &container, const Rec::TrackParticle &tp, const EventContext &ctx)
Gaudi::Property< bool > m_convertTracks
toggle on converting tracks to xAOD
ToolHandle< IMCTruthClassifier > m_truthClassifier
ToolHandle to truth classifier.
Gaudi::Property< bool > m_doMonitoring
ToolHandle< Trk::ITrackParticleCreatorTool > m_particleCreator
The key for the input TrackParticleTruthCollection.
TrackParticle_v1 TrackParticle
Reference the current persistent version:
Vertex_v1 Vertex
Define the latest version of the vertex class.
TrackParticleContainer_v1 TrackParticleContainer
Definition of the current "TrackParticle container version".