ATLAS Offline Software
Loading...
Searching...
No Matches
xAODMaker::TrackParticleCnvAlg Class Reference

Algorithm creating xAOD::TrackParticles from TrackParticles. More...

#include <TrackParticleCnvAlg.h>

Inheritance diagram for xAODMaker::TrackParticleCnvAlg:
Collaboration diagram for xAODMaker::TrackParticleCnvAlg:

Public Member Functions

virtual StatusCode initialize ()
 Function initialising the algorithm.
virtual StatusCode execute (const EventContext &ctx) const
 Function executing the algorithm.
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual bool isClonable () const override
 Specify if the algorithm is clonable.
virtual StatusCode sysExecute (const EventContext &ctx) override
 Execute an algorithm.
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
virtual bool filterPassed (const EventContext &ctx) const
 Get filter decision:
virtual void setFilterPassed (bool state, const EventContext &ctx) const
 Set filter decision:
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

StatusCode convert (const EventContext &ctx, const TrackCollection &trackColl, const TrackTruthCollection *assocTruthColl, xAOD::TrackParticleContainer &outTrackCont, const xAODTruthParticleLinkVector *, const xAOD::Vertex *primaryVertex, const ObservedTrackMap *obs_track_map) const
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

Gaudi::Property< bool > m_addTruthLink {this,"AddTruthLink", false }
 toggle on adding truth links
ToolHandle< Trk::ITrackParticleCreatorToolm_particleCreator {this, "TrackParticleCreator", "Trk::TrackParticleCreatorTool/TrackParticleCreatorTool" }
 The key for the input TrackParticleTruthCollection.
ToolHandle< IMCTruthClassifierm_truthClassifier
 ToolHandle to truth classifier.
ToolHandle< xAODMaker::ITrackCollectionCnvToolm_TrackCollectionCnvTool {this, "TrackCollectionCnvTool", "xAODMaker::TrackCollectionCnvTool/TrackCollectionCnvTool"}
SG::ReadHandleKey< TrackCollectionm_tracks {this, "TrackContainerName", "Tracks"}
SG::ReadHandleKey< xAOD::VertexContainerm_primaryVertexContainer { this, "PrimaryVerticesName", "", "Name of primary vertex container is case the parameters should be calculated with respect to the primary vertex"}
SG::WriteHandleKey< xAOD::TrackParticleContainerm_xaodout {this, "xAODTrackParticlesFromTracksContainerName", "InDetTrackParticles"}
SG::WriteDecorHandleKey< xAOD::TrackParticleContainerm_truthTypeKey {this, "TruthTypeKey", m_xaodout, "truthType"}
SG::WriteDecorHandleKey< xAOD::TrackParticleContainerm_truthOriginKey {this, "TruthOriginKey", m_xaodout, "truthOrigin"}
SG::WriteDecorHandleKey< xAOD::TrackParticleContainerm_truthClassKey {this, "TruthClassKey", m_xaodout, "truthClassification"}
SG::WriteDecorHandleKey< xAOD::TrackParticleContainerm_truthProbKey {this, "TruthMatchProbKey", m_xaodout, "truthMatchProbability"}
SG::WriteDecorHandleKey< xAOD::TrackParticleContainerm_trackLinkKey {this, "TrackLinkKey", m_xaodout, "trackLink"}
SG::ReadHandleKey< xAODTruthParticleLinkVectorm_truthParticleLinkVec {this, "xAODTruthLinkVector", "xAODTruthLinks"}
SG::ReadHandleKey< TrackTruthCollectionm_trackTruth {this, "TrackTruthContainerName", ""}
Gaudi::Property< bool > m_doMonitoring {this, "DoMonitoring", false}
ToolHandle< ITrackParticleMonitoringm_trackMonitoringTool { this, "TrkMonTool", "", "Tracking Monitoring tool" }
ToolHandle< GenericMonitoringToolm_monTool { this, "MonTool", "", "Monitoring tool" }
Gaudi::Property< bool > m_augmentObservedTracks {this, "AugmentObservedTracks", false, "augment observed tracks"}
SG::ReadHandleKey< ObservedTrackMapm_tracksMap {this, "TracksMapName", "" , "name of observed tracks map saved in store"}
Gaudi::Property< bool > m_convertTracks {this, "ConvertTracks", false}
 toggle on converting tracks to xAOD
DataObjIDColl m_extendedExtraObjects
 Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default).
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default).
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Algorithm creating xAOD::TrackParticles from TrackParticles.

   This algorithm can be used to translate the TrackParticles coming
   from an AOD, and create xAOD::TrackParticle objects out of them
   for an output xAOD.
Author
Edward Moyse Edwar.nosp@m.d.Mo.nosp@m.yse@c.nosp@m.ern..nosp@m.ch
Attila Krasznahorkay Attil.nosp@m.a.Kr.nosp@m.aszna.nosp@m.hork.nosp@m.ay@ce.nosp@m.rn.c.nosp@m.h

Definition at line 48 of file TrackParticleCnvAlg.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Member Function Documentation

◆ convert()

StatusCode xAODMaker::TrackParticleCnvAlg::convert ( const EventContext & ctx,
const TrackCollection & trackColl,
const TrackTruthCollection * assocTruthColl,
xAOD::TrackParticleContainer & outTrackCont,
const xAODTruthParticleLinkVector * truthLinkVec,
const xAOD::Vertex * primaryVertex,
const ObservedTrackMap * obs_track_map ) const
private

Definition at line 121 of file TrackParticleCnvAlg.cxx.

127 {
128 // Augment track particles using track map if available
129 if (obs_track_map){
130 ATH_CHECK(m_TrackCollectionCnvTool->convertAndAugment(ctx, &trackColl, &outTrackCont, obs_track_map, primaryVertex));
131 } else{
132 ATH_CHECK(m_TrackCollectionCnvTool->convert(ctx, &trackColl, &outTrackCont, primaryVertex));
133 }
134 // Create the xAOD objects:
135
136 unsigned int trackCounter{0};
137 // loop over AOD and converted xAOD for summary info and truth links
138 for (xAOD::TrackParticle* particle: outTrackCont) {
139 // protect if something went wrong and there is no converted xaod equivalent
140
141 if (!particle) {
142 ATH_MSG_ERROR("Failed to get an xAOD::TrackParticle");
143 return StatusCode::FAILURE;
144 }
145
146 trackCounter++;
147 if(msgLvl(MSG::DEBUG)){
148 int npix{-1}, nsct{-1}, ntrt{-1}, npixh{-1}, nscth{-1};
149 const Trk::Track *tr = particle->track();
150 if (tr){
151 const Trk::TrackSummary* ts = tr->trackSummary();
152 if (ts) {
153 npix = ts->get(Trk::numberOfPixelHits);
154 nsct = ts->get(Trk::numberOfSCTHits);
155 ntrt = ts->get(Trk::numberOfTRTHits);
156 nscth = ts->get(Trk::numberOfSCTHoles);
157 npixh = ts->get(Trk::numberOfPixelHoles);
158 }
159 }
160 ATH_MSG_DEBUG("REGTEST: " << std::setw(5) << trackCounter
161 << " pT: " << std::setw(10) << particle->pt()
162 << " eta: " << particle->eta() << " phi: " << particle->phi()
163 << " d0: " << particle->d0() << " z0: " << particle->z0()
164 << "\t" << npix << "/" << nsct << "/" << ntrt << "/holes/" << npixh << "/" << nscth);
165 }
166 //
167 // --------- statistics
168 //
169 if (m_addTruthLink) {
173 unsigned int classification = 0; // Better default value here?
174 float probability = -1.0;
175 ElementLink<xAOD::TruthParticleContainer> link;
176
177 ElementLink<TrackCollection> tpLink{trackColl, trackCounter -1};
178 if (!tpLink.isValid()) {
179 ATH_MSG_WARNING("Failed to create ElementLink to Track/TrackParticle");
180 } else if(assocTruthColl->empty()){
181 // This can happen if there is no HS track
182 ATH_MSG_DEBUG("No truth available");
183 } else {
184 auto result = assocTruthColl->find(tpLink);
185 if (result == assocTruthColl->end()) {
186 ATH_MSG_WARNING("Failed find truth associated with Track/TrackParticle");
187 } else {
188 // setTruthLink(link,result->second, type, origin);
189 ATH_MSG_VERBOSE("Found track Truth: uniqueID "
190 << HepMC::uniqueID(result->second.particleLink()) << " evt "
191 << result->second.particleLink().eventIndex());
192 probability = result->second.probability();
193 link = truthLinkVec->find(result->second.particleLink());
194 if (link.isValid()) {
195 ATH_MSG_DEBUG("Found matching xAOD Truth: uniqueID "
196 << HepMC::uniqueID(*link) << " pt " << (*link)->pt()
197 << " eta " << (*link)->eta() << " phi "
198 << (*link)->phi());
199 // if configured also get truth classification
200 if (result->second.particleLink().cptr() &&
201 !m_truthClassifier.empty()) {
202 auto truthClass = m_truthClassifier->particleHepMCTruthClassifier(
203 result->second.particleLink());
204 type = truthClass.first;
205 origin = truthClass.second;
206 classification = std::get<0>(MCTruthPartClassifier::defOrigOfParticle(result->second.particleLink().cptr())); // See AGENE-2351
207 ATH_MSG_VERBOSE("Got truth type " << static_cast<int>(type)
208 << " origin "
209 << static_cast<int>(origin)
210 << " classification "
211 << static_cast<unsigned int>(classification));
212 }
213 } else {
214 if (HepMC::uniqueID(result->second.particleLink()) > 0) {
215 ATH_MSG_WARNING("No associated xAOD truth for valid truth link "
216 << result->second.particleLink());
217 }
218 }
219 }
220 }
221 //This is the Algorithm creating TrackParticles
222 //
223 static const SG::AuxElement::Accessor<
224 ElementLink<xAOD::TruthParticleContainer>>
225 theLink("truthParticleLink");
226 static const SG::AuxElement::Accessor<float> theProbability(
227 "truthMatchProbability");
228 theLink(*particle) = link;
229 theProbability(*particle) = probability;
230 if (!m_truthClassifier.empty()) {
231 static const SG::AuxElement::Accessor<int> theType("truthType");
232 static const SG::AuxElement::Accessor<int> theOrigin("truthOrigin");
233 static const SG::AuxElement::Accessor<unsigned int> theClassification("truthClassification");
234 theType(*particle) = static_cast<int>(type);
235 theOrigin(*particle) = static_cast<int>(origin);
236 theClassification(*particle) = static_cast<unsigned int>(classification);
237 }
238 }
239 } // loop over aod tracks
240
241 ATH_MSG_DEBUG("Converted [" << trackColl.size() << " -> " << outTrackCont.size()
242 << "] TrackParticles");
243 if (trackColl.size() != outTrackCont.size()) {
244 ATH_MSG_ERROR("number of items in the AOD container: "
245 << trackColl.size()
246 << " is not equal to the number of items in its converted "
247 "xAOD equivalent: "
248 << outTrackCont.size());
249 return StatusCode::FAILURE;
250 }
251
252 return StatusCode::SUCCESS;
253}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
bool msgLvl(const MSG::Level lvl) const
size_type size() const noexcept
Returns the number of elements in the collection.
const Trk::TrackSummary * trackSummary() const
Returns a pointer to the const Trk::TrackSummary owned by this const track (could be nullptr).
ToolHandle< xAODMaker::ITrackCollectionCnvTool > m_TrackCollectionCnvTool
Gaudi::Property< bool > m_addTruthLink
toggle on adding truth links
ToolHandle< IMCTruthClassifier > m_truthClassifier
ToolHandle to truth classifier.
ElementLink< xAOD::TruthParticleContainer > find(const HepMcParticleLink &hepMCLink) const
int ts
Definition globals.cxx:24
int uniqueID(const T &p)
std::tuple< unsigned int, T > defOrigOfParticle(T thePart)
pointer & link(pointer p) const
Return a reference to the link for an element.
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
@ numberOfPixelHits
number of pixel layers on track with absence of hits
@ numberOfSCTHoles
number of Holes in both sides of a SCT module
@ numberOfPixelHoles
number of pixels which have a ganged ambiguity.
TrackParticle_v1 TrackParticle
Reference the current persistent version:

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ execute()

StatusCode xAODMaker::TrackParticleCnvAlg::execute ( const EventContext & ctx) const
virtual

Function executing the algorithm.

Definition at line 56 of file TrackParticleCnvAlg.cxx.

56 {
57
58 const TrackCollection* tracks{};
59 const xAODTruthParticleLinkVector* truthLinks{};
60 const TrackTruthCollection* trackTruth{};
61 const ObservedTrackMap* tracksMap{};
62 const xAOD::Vertex* primaryVertex{};
63
64 //timer object for total execution time
65 auto mnt_timer_Total = Monitored::Timer<std::chrono::milliseconds>("TIME_Total");
66
67 // Retrieve the AOD particles:
68
69 ATH_CHECK(SG::get(tracks, m_tracks, ctx));
70 ATH_CHECK(SG::get(trackTruth, m_trackTruth, ctx));
71 ATH_CHECK(SG::get(truthLinks, m_truthParticleLinkVec, ctx));
72 ATH_CHECK(SG::get(tracksMap, m_tracksMap, ctx));
73 // Retrieve the Tracks:
74
75 if(!m_primaryVertexContainer.key().empty()) {
76 const xAOD::VertexContainer* vtx_container{nullptr};
77 ATH_CHECK(SG::get(vtx_container, m_primaryVertexContainer, ctx));
78 const xAOD::Vertex* dummyVertex{};
79 for(auto vtx : *vtx_container) {
80 if(vtx->vertexType()==xAOD::VxType::PriVtx) {
81 primaryVertex = vtx;
82 break;
83 }
84 if(vtx->vertexType()==xAOD::VxType::NoVtx) {
85 // in case of no primary vertex
86 dummyVertex = vtx;
87 }
88 }
89 if(!primaryVertex) {
90 if(dummyVertex)
91 {
92 ATH_MSG_INFO("No primary vertex found, will use dummy vertex at "
93 << dummyVertex->x() << "," << dummyVertex->y() << ","
94 << dummyVertex->z());
95 primaryVertex = dummyVertex;
96 }
97 else {
98 ATH_MSG_WARNING("Neither primary nor dummy vertex found. Do Nothing.");
99 return StatusCode::SUCCESS;
100 }
101 }
102 }
103
104
105 SG::WriteHandle wh_xaodout(m_xaodout, ctx);
106 ATH_CHECK(wh_xaodout.record(std::make_unique<xAOD::TrackParticleContainer>(),
107 std::make_unique<xAOD::TrackParticleAuxContainer>()));
108 ATH_CHECK(convert(ctx, (*tracks), trackTruth, *wh_xaodout, truthLinks, primaryVertex, tracksMap));
109
110 // Monitor track parameters
111 if (m_doMonitoring)
112 m_trackMonitoringTool->monitor_tracks("Track", "Pass", *wh_xaodout);
113
114
115 //extra scope needed to trigger the monitoring
116 {auto monTime = Monitored::Group(m_monTool, mnt_timer_Total);}
117
118 return StatusCode::SUCCESS;
119}
#define ATH_MSG_INFO(x)
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
DataVector< Trk::Track > TrackCollection
This typedef represents a collection of Trk::Track objects.
SG::ReadHandleKey< xAODTruthParticleLinkVector > m_truthParticleLinkVec
ToolHandle< GenericMonitoringTool > m_monTool
StatusCode convert(const EventContext &ctx, const TrackCollection &trackColl, const TrackTruthCollection *assocTruthColl, xAOD::TrackParticleContainer &outTrackCont, const xAODTruthParticleLinkVector *, const xAOD::Vertex *primaryVertex, const ObservedTrackMap *obs_track_map) const
ToolHandle< ITrackParticleMonitoring > m_trackMonitoringTool
SG::ReadHandleKey< TrackTruthCollection > m_trackTruth
SG::ReadHandleKey< ObservedTrackMap > m_tracksMap
SG::WriteHandleKey< xAOD::TrackParticleContainer > m_xaodout
SG::ReadHandleKey< TrackCollection > m_tracks
SG::ReadHandleKey< xAOD::VertexContainer > m_primaryVertexContainer
Gaudi::Property< bool > m_doMonitoring
float z() const
Returns the z position.
float y() const
Returns the y position.
float x() const
Returns the x position.
const T * get(const ReadCondHandleKey< T > &key, const EventContext &ctx)
Convenience function to retrieve an object given a ReadCondHandleKey.
@ PriVtx
Primary vertex.
@ NoVtx
Dummy vertex. TrackParticle was not used in vertex fit.
VertexContainer_v1 VertexContainer
Definition of the current "Vertex container version".
Vertex_v1 Vertex
Define the latest version of the vertex class.

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ extraOutputDeps()

const DataObjIDColl & AthCommonAlgorithm< Gaudi::Algorithm >::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 89 of file AthCommonAlgorithm.cxx.

54{
55 // If we didn't find any symlinks to add, just return the collection
56 // from the base class. Otherwise, return the extended collection.
57 if (!m_extendedExtraObjects.empty()) {
59 }
61}
Common base class for algorithms.

◆ filterPassed()

virtual bool AthCommonAlgorithm< Gaudi::Algorithm >::filterPassed ( const EventContext & ctx) const
inlinevirtualinherited

Get filter decision:

Definition at line 93 of file AthCommonAlgorithm.h.

93 {
94 return execState( ctx ).filterPassed();
95 }
virtual bool filterPassed(const EventContext &ctx) const
Get filter decision:

◆ initialize()

StatusCode xAODMaker::TrackParticleCnvAlg::initialize ( )
virtual

Function initialising the algorithm.

Definition at line 24 of file TrackParticleCnvAlg.cxx.

25{
26
27 ATH_MSG_DEBUG("Initializing TrackParticleCnvAlg");
28 ATH_CHECK(m_particleCreator.retrieve());
29 ATH_CHECK(m_truthClassifier.retrieve(EnableTool{m_addTruthLink}));
31 // to preserve the inisialised parameters of the ParticleCreatorTool:
32 ATH_MSG_DEBUG("Overriding particle creator tool settings.");
33 ATH_CHECK(m_TrackCollectionCnvTool->setParticleCreatorTool(&m_particleCreator));
39
44 ATH_CHECK(m_trackLinkKey.initialize());
45
46 // Retrieve monitoring tools if provided
47 ATH_CHECK(m_trackMonitoringTool.retrieve(DisableTool{ !m_doMonitoring }));
48 ATH_CHECK(m_monTool.retrieve(DisableTool{ !m_doMonitoring }));
49
51
52 // Return gracefully:
53 return StatusCode::SUCCESS;
54}
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_truthOriginKey
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_truthTypeKey
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_truthProbKey
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_trackLinkKey
Gaudi::Property< bool > m_augmentObservedTracks
Gaudi::Property< bool > m_convertTracks
toggle on converting tracks to xAOD
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_truthClassKey
ToolHandle< Trk::ITrackParticleCreatorTool > m_particleCreator
The key for the input TrackParticleTruthCollection.

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ isClonable()

virtual bool AthCommonAlgorithm< Gaudi::Algorithm >::isClonable ( ) const
inlineoverridevirtualinherited

Specify if the algorithm is clonable.

Only relevant for non-reentrant algorithms. Actual number of clones needs to be set via the "Cardinality" property.

Reimplemented in AFP_DigiTop, AlgB, AlgT, BCM_Digitization, CscDigitBuilder, CscDigitToCscRDO, G4AtlasAlg, G4RunAlg, HGTD_Digitization, HiveAlgBase, InDet::GNNSeedingTrackMaker, InDet::SCT_Clusterization, InDet::SiSPGNNTrackMaker, InDet::SiSPSeededTrackFinder, InDet::SiTrackerSpacePointFinder, ISF::SimKernelMT, ITk::StripDigitization, ITkPixelCablingAlg, ITkStripCablingAlg, LArHitEMapMaker, LArTTL1Maker, LUCID_DigiTop, LVL1::L1TopoSimulation, MergeCalibHits, MergeGenericMuonSimHitColl, MergeHijingPars, MergeMcEventCollection, MergeTrackRecordCollection, MergeTruthJets, MergeTruthParticles, MuonDigitizer, PileUpMTAlg, PixelDigitization, RoIBResultToxAOD, SCT_ByteStreamErrorsTestAlg, SCT_CablingCondAlgFromCoraCool, SCT_CablingCondAlgFromText, SCT_ConditionsParameterTestAlg, SCT_ConditionsSummaryTestAlg, SCT_ConfigurationConditionsTestAlg, SCT_Digitization, SCT_FlaggedConditionTestAlg, SCT_LinkMaskingTestAlg, SCT_MajorityConditionsTestAlg, SCT_ModuleVetoTestAlg, SCT_MonitorConditionsTestAlg, SCT_PrepDataToxAOD, SCT_RawDataToxAOD, SCT_ReadCalibChipDataTestAlg, SCT_ReadCalibDataTestAlg, SCT_RODVetoTestAlg, SCT_SensorsTestAlg, SCT_SiliconConditionsTestAlg, SCT_StripVetoTestAlg, SCT_TdaqEnabledTestAlg, SCT_TestCablingAlg, SCTEventFlagWriter, SCTRawDataProvider, SCTSiLorentzAngleTestAlg, SCTSiPropertiesTestAlg, SGInputLoader, Simulation::BeamEffectsAlg, TileHitVecToCnt, TileMuonFitter, TilePulseForTileMuonReceiver, TileRawChannelMaker, TRTDigitization, and ZDC_DigiTop.

Definition at line 68 of file AthCommonAlgorithm.h.

68 {
69 return true;
70 }

◆ msg()

MsgStream & AthCommonMsg< Gaudi::Algorithm >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< Gaudi::Algorithm >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ setFilterPassed()

virtual void AthCommonAlgorithm< Gaudi::Algorithm >::setFilterPassed ( bool state,
const EventContext & ctx ) const
inlinevirtualinherited

Set filter decision:

Reimplemented in AthFilterAlgorithm.

Definition at line 99 of file AthCommonAlgorithm.h.

99 {
101 }
virtual void setFilterPassed(bool state, const EventContext &ctx) const
Set filter decision:

◆ sysExecute()

StatusCode AthCommonAlgorithm< Gaudi::Algorithm >::sysExecute ( const EventContext & ctx)
overridevirtualinherited

Execute an algorithm.

We override this in order to work around an issue with the Algorithm base class storing the event context in a member variable that can cause crashes in MT jobs.

Reimplemented in AthAnalysisAlgorithm.

Definition at line 80 of file AthCommonAlgorithm.cxx.

41{
42 return BaseAlg::sysExecute (ctx);
43}

◆ sysInitialize()

StatusCode AthCommonAlgorithm< Gaudi::Algorithm >::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >.

Reimplemented in AthAnalysisAlgorithm, AthFilterAlgorithm, AthHistogramAlgorithm, HypoBase, InputMakerBase, and PyAthena::Alg.

Definition at line 60 of file AthCommonAlgorithm.cxx.

71 {
73
74 if (sc.isFailure()) {
75 return sc;
76 }
77
78 ServiceHandle<ICondSvc> cs("CondSvc",name());
79 for (auto h : outputHandles()) {
80 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
81 // do this inside the loop so we don't create the CondSvc until needed
82 if ( cs.retrieve().isFailure() ) {
83 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
85 }
86 if (cs->regHandle(this,*h).isFailure()) {
88 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
89 << " with CondSvc");
90 }
91 }
92 }
93 return sc;
94}
virtual StatusCode sysInitialize() override
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }

Member Data Documentation

◆ m_addTruthLink

Gaudi::Property<bool> xAODMaker::TrackParticleCnvAlg::m_addTruthLink {this,"AddTruthLink", false }
private

toggle on adding truth links

Definition at line 62 of file TrackParticleCnvAlg.h.

62{this,"AddTruthLink", false };

◆ m_augmentObservedTracks

Gaudi::Property<bool> xAODMaker::TrackParticleCnvAlg::m_augmentObservedTracks {this, "AugmentObservedTracks", false, "augment observed tracks"}
private

Definition at line 99 of file TrackParticleCnvAlg.h.

99{this, "AugmentObservedTracks", false, "augment observed tracks"};

◆ m_convertTracks

Gaudi::Property<bool> xAODMaker::TrackParticleCnvAlg::m_convertTracks {this, "ConvertTracks", false}
private

toggle on converting tracks to xAOD

Definition at line 103 of file TrackParticleCnvAlg.h.

103{this, "ConvertTracks", false};

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default).

Definition at line 393 of file AthCommonDataStore.h.

◆ m_doMonitoring

Gaudi::Property<bool> xAODMaker::TrackParticleCnvAlg::m_doMonitoring {this, "DoMonitoring", false}
private

Definition at line 92 of file TrackParticleCnvAlg.h.

92{this, "DoMonitoring", false};

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default).

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthCommonAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
privateinherited

Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.

Empty if no symlinks were found.

Definition at line 108 of file AthCommonAlgorithm.h.

◆ m_monTool

ToolHandle<GenericMonitoringTool > xAODMaker::TrackParticleCnvAlg::m_monTool { this, "MonTool", "", "Monitoring tool" }
private

Definition at line 96 of file TrackParticleCnvAlg.h.

96{ this, "MonTool", "", "Monitoring tool" };

◆ m_particleCreator

ToolHandle<Trk::ITrackParticleCreatorTool> xAODMaker::TrackParticleCnvAlg::m_particleCreator {this, "TrackParticleCreator", "Trk::TrackParticleCreatorTool/TrackParticleCreatorTool" }
private

The key for the input TrackParticleTruthCollection.

ToolHandle to particle creator

Definition at line 67 of file TrackParticleCnvAlg.h.

67{this, "TrackParticleCreator", "Trk::TrackParticleCreatorTool/TrackParticleCreatorTool" };

◆ m_primaryVertexContainer

SG::ReadHandleKey<xAOD::VertexContainer> xAODMaker::TrackParticleCnvAlg::m_primaryVertexContainer { this, "PrimaryVerticesName", "", "Name of primary vertex container is case the parameters should be calculated with respect to the primary vertex"}
private

Definition at line 77 of file TrackParticleCnvAlg.h.

77{ this, "PrimaryVerticesName", "", "Name of primary vertex container is case the parameters should be calculated with respect to the primary vertex"};

◆ m_TrackCollectionCnvTool

ToolHandle<xAODMaker::ITrackCollectionCnvTool> xAODMaker::TrackParticleCnvAlg::m_TrackCollectionCnvTool {this, "TrackCollectionCnvTool", "xAODMaker::TrackCollectionCnvTool/TrackCollectionCnvTool"}
private

Definition at line 73 of file TrackParticleCnvAlg.h.

73{this, "TrackCollectionCnvTool", "xAODMaker::TrackCollectionCnvTool/TrackCollectionCnvTool"};

◆ m_trackLinkKey

SG::WriteDecorHandleKey<xAOD::TrackParticleContainer> xAODMaker::TrackParticleCnvAlg::m_trackLinkKey {this, "TrackLinkKey", m_xaodout, "trackLink"}
private

Definition at line 86 of file TrackParticleCnvAlg.h.

86{this, "TrackLinkKey", m_xaodout, "trackLink"};

◆ m_trackMonitoringTool

ToolHandle<ITrackParticleMonitoring> xAODMaker::TrackParticleCnvAlg::m_trackMonitoringTool { this, "TrkMonTool", "", "Tracking Monitoring tool" }
private

Definition at line 93 of file TrackParticleCnvAlg.h.

93{ this, "TrkMonTool", "", "Tracking Monitoring tool" };

◆ m_tracks

SG::ReadHandleKey<TrackCollection> xAODMaker::TrackParticleCnvAlg::m_tracks {this, "TrackContainerName", "Tracks"}
private

Definition at line 75 of file TrackParticleCnvAlg.h.

75{this, "TrackContainerName", "Tracks"};

◆ m_tracksMap

SG::ReadHandleKey<ObservedTrackMap> xAODMaker::TrackParticleCnvAlg::m_tracksMap {this, "TracksMapName", "" , "name of observed tracks map saved in store"}
private

Definition at line 100 of file TrackParticleCnvAlg.h.

100{this, "TracksMapName", "" , "name of observed tracks map saved in store"};

◆ m_trackTruth

SG::ReadHandleKey<TrackTruthCollection> xAODMaker::TrackParticleCnvAlg::m_trackTruth {this, "TrackTruthContainerName", ""}
private

Definition at line 89 of file TrackParticleCnvAlg.h.

89{this, "TrackTruthContainerName", ""};

◆ m_truthClassifier

ToolHandle<IMCTruthClassifier> xAODMaker::TrackParticleCnvAlg::m_truthClassifier
private
Initial value:
{this, "MCTruthClassifier", "MCTruthClassifier/MCTruthClassifier",
" MCTruthClassifier Instance to use "}

ToolHandle to truth classifier.

Definition at line 69 of file TrackParticleCnvAlg.h.

69 {this, "MCTruthClassifier", "MCTruthClassifier/MCTruthClassifier",
70 " MCTruthClassifier Instance to use "};

◆ m_truthClassKey

SG::WriteDecorHandleKey<xAOD::TrackParticleContainer> xAODMaker::TrackParticleCnvAlg::m_truthClassKey {this, "TruthClassKey", m_xaodout, "truthClassification"}
private

Definition at line 84 of file TrackParticleCnvAlg.h.

84{this, "TruthClassKey", m_xaodout, "truthClassification"};

◆ m_truthOriginKey

SG::WriteDecorHandleKey<xAOD::TrackParticleContainer> xAODMaker::TrackParticleCnvAlg::m_truthOriginKey {this, "TruthOriginKey", m_xaodout, "truthOrigin"}
private

Definition at line 83 of file TrackParticleCnvAlg.h.

83{this, "TruthOriginKey", m_xaodout, "truthOrigin"};

◆ m_truthParticleLinkVec

SG::ReadHandleKey<xAODTruthParticleLinkVector> xAODMaker::TrackParticleCnvAlg::m_truthParticleLinkVec {this, "xAODTruthLinkVector", "xAODTruthLinks"}
private

Definition at line 88 of file TrackParticleCnvAlg.h.

88{this, "xAODTruthLinkVector", "xAODTruthLinks"};

◆ m_truthProbKey

SG::WriteDecorHandleKey<xAOD::TrackParticleContainer> xAODMaker::TrackParticleCnvAlg::m_truthProbKey {this, "TruthMatchProbKey", m_xaodout, "truthMatchProbability"}
private

Definition at line 85 of file TrackParticleCnvAlg.h.

85{this, "TruthMatchProbKey", m_xaodout, "truthMatchProbability"};

◆ m_truthTypeKey

SG::WriteDecorHandleKey<xAOD::TrackParticleContainer> xAODMaker::TrackParticleCnvAlg::m_truthTypeKey {this, "TruthTypeKey", m_xaodout, "truthType"}
private

Definition at line 82 of file TrackParticleCnvAlg.h.

82{this, "TruthTypeKey", m_xaodout, "truthType"};

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.

◆ m_xaodout

SG::WriteHandleKey<xAOD::TrackParticleContainer> xAODMaker::TrackParticleCnvAlg::m_xaodout {this, "xAODTrackParticlesFromTracksContainerName", "InDetTrackParticles"}
private

Definition at line 79 of file TrackParticleCnvAlg.h.

79{this, "xAODTrackParticlesFromTracksContainerName", "InDetTrackParticles"};

The documentation for this class was generated from the following files: