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-2023 CERN for the benefit of the ATLAS collaboration
5*/
6
7// $Id: TrackParticleCnvAlg.h 297747 2013-10-28 15:14:24Z krasznaa $
8#ifndef XAODCREATORALGS_TRACKPARTICLECREATOR_H
9#define XAODCREATORALGS_TRACKPARTICLECREATOR_H
10
11// System include(s):
12#include <string>
13
14// Athena/Gaudi include(s):
16#include "GaudiKernel/ToolHandle.h"
30// Local include(s):
36
37
38
39namespace xAODMaker {
40
55
56 public:
58 TrackParticleCnvAlg( const std::string& name, ISvcLocator* svcLoc );
59
61 virtual StatusCode initialize();
63 virtual StatusCode execute(const EventContext& ctx) const;
64
65 private:
66
68 Gaudi::Property<bool> m_addTruthLink{this,"AddTruthLink", false };
70
71
73 ToolHandle<Trk::ITrackParticleCreatorTool> m_particleCreator{this, "TrackParticleCreator", "Trk::TrackParticleCreatorTool/TrackParticleCreatorTool" };
75 ToolHandle<IMCTruthClassifier> m_truthClassifier{
76 this,
77 "MCTruthClassifier",
78 "MCTruthClassifier/MCTruthClassifier",
79 " MCTruthClassifier Instance to use "
80 };
81
82 // handles to the converting tools
83 ToolHandle<xAODMaker::ITrackCollectionCnvTool> m_TrackCollectionCnvTool{this, "TrackCollectionCnvTool", "xAODMaker::TrackCollectionCnvTool/TrackCollectionCnvTool"};
84 ToolHandle<xAODMaker::IRecTrackParticleContainerCnvTool>
85 m_RecTrackParticleContainerCnvTool{this, "RecTrackParticleContainerCnvTool", "xAODMaker::RecTrackParticleContainerCnvTool/"
86 "RecTrackParticleContainerCnvTool" };
87
88 SG::ReadHandleKey<Rec::TrackParticleContainer> m_aod{this, "AODContainerName", "TrackParticleCandidate"};
89
90 SG::ReadHandleKey<TrackCollection> m_tracks{this, "TrackContainerName", "Tracks"};
91
92 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"};
93
94 SG::WriteHandleKey<xAOD::TrackParticleContainer> m_xaodout{this, "xAODTrackParticlesFromTracksContainerName", "InDetTrackParticles"};
95
96
97 SG::WriteHandleKey<xAOD::TrackParticleContainer> m_xaodTrackParticlesout{this, "xAODContainerName", "ConvertedTrackParticleCandidate" };
98
99
100 SG::ReadHandleKey<xAODTruthParticleLinkVector> m_truthParticleLinkVec{this, "xAODTruthLinkVector", "xAODTruthLinks"};
102 SG::ReadHandleKey<TrackTruthCollection> m_trackTruth{this, "TrackTruthContainerName", ""};
103
104 // Allow monitoring of track parameters during conversion
105 Gaudi::Property<bool> m_doMonitoring{this, "DoMonitoring", false};
106 ToolHandle<ITrackParticleMonitoring> m_trackMonitoringTool{ this, "TrkMonTool", "", "Tracking Monitoring tool" };
107
108 //for timing we need a handle to the MonTool in the alg
109 ToolHandle<GenericMonitoringTool > m_monTool { this, "MonTool", "", "Monitoring tool" };
110
111 // Augment observed tracks with information from track observer tool map
112 Gaudi::Property<bool> m_augmentObservedTracks{this, "AugmentObservedTracks", false, "augment observed tracks"};
113 SG::ReadHandleKey<ObservedTrackMap> m_tracksMap{this, "TracksMapName", "" , "name of observed tracks map saved in store"};
114
115
117 Gaudi::Property<bool> m_convertAODTrackParticles{this, "ConvertTrackParticles", true};
118
120 Gaudi::Property<bool> m_convertTracks{this, "ConvertTracks", false};
121
122 template<typename CONT, typename TRUTHCONT, typename CONVTOOL>
123 int convert(const CONT&,
124 const TRUTHCONT&,
125 CONVTOOL& tool,
128 const xAOD::Vertex* primaryVertex = nullptr,
129 const ObservedTrackMap* obs_track_map = 0) const;
130
134 const Rec::TrackParticle& tp);
138 const Trk::Track& tp,
139 const EventContext& ctx);
140
141 }; // class TrackParticleCnvAlg
142
143} // namespace xAODMaker
144
145#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.
int convert(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< TrackParticleTruthCollection > m_aodTruth
SG::ReadHandleKey< TrackTruthCollection > m_trackTruth
SG::WriteHandleKey< xAOD::TrackParticleContainer > m_xaodTrackParticlesout
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
Gaudi::Property< bool > m_convertTracks
toggle on converting tracks to xAOD
ToolHandle< IMCTruthClassifier > m_truthClassifier
ToolHandle to truth classifier.
xAOD::TrackParticle * createParticle(xAOD::TrackParticleContainer &xaod, const Rec::TrackParticleContainer &container, const Rec::TrackParticle &tp)
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".