ATLAS Offline Software
Loading...
Searching...
No Matches
EventToTrackLinkNtupleTool.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
6// EventToTrackLinkNtupleTool.h
7// Header file for EventToTrackLinkNtupleTool
9// (c) ATLAS Detector software
11// Wolfgang.Liebig -at- cern.ch
13
14#ifndef TRK_EVENTTRACKLINKNTUPLETOOL_H
15#define TRK_EVENTTRACKLINKNTUPLETOOL_H
16
18
19#include "GaudiKernel/ToolHandle.h"
21#include <vector>
22class TTree;
23
29
30namespace Trk {
31
33 public:
34
35 // standard AlgToolmethods
36 EventToTrackLinkNtupleTool(const std::string&,const std::string&,const IInterface*);
38
39 // standard Athena methods
40 StatusCode initialize();
41 StatusCode finalize();
42
44 virtual void registerTrackCollections( const std::vector<std::string>& collections, bool doTruth);
46 virtual void setTrackTreeIndices( unsigned int, int, int);
48 virtual void setGenParticleTreeIndices( int, int);
49
53 virtual StatusCode addNtupleItems ( TTree*, const std::string &);
54
56 virtual StatusCode fillEventData ( );
57
59 virtual StatusCode resetVariables ( );
60
62 inline virtual bool isTrackLinkTool( ) const;
64 inline virtual bool isTrkParticleLinkTool( ) const;
66 inline virtual bool isTrkParticleTrigLinkTool( ) const;
68 inline virtual bool isInDetTrackTrigLinkTool( ) const;
70 inline virtual bool isEvtPropertyTool( ) const;
71
72 private:
74 StatusCode checkCollectionType() const;
75
76 std::string m_collectionType;
78 bool m_doTruth;
79 std::vector<std::string> m_trackCollections;
80
81 // --- ntuple items ---
82 std::vector<int> m_trackIndexBegin;
83 std::vector<int> m_nTracksPerEvent;
86
87 static const std::string s_trackTypeName;
88 static const std::string s_trkParticleTypeName;
89 static const std::string s_trkParticleTrigTypeName;
90 static const std::string s_inDetTrackTrigTypeName;
91 };
92
93}
94
95
97 if( m_collectionType == s_trackTypeName) return true;
98 return false;
99 }
100
102 if( m_collectionType == s_trkParticleTypeName) return true;
103 return false;
104 }
105
108 return false;
109 }
110
112 if( m_collectionType == s_inDetTrackTrigTypeName) return true;
113 return false;
114 }
115
117 return false;
118 }
119
120
121#endif // TRK_EVENTTRACKLINKNTUPLETOOL_H
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
virtual bool isInDetTrackTrigLinkTool() const
is True if instance is Tool which links events property to InDetTrack recieved useing TrigDecTool
virtual StatusCode addNtupleItems(TTree *, const std::string &)
add branches to the tree Should be called once dunring the initialisation phase by the calling algori...
virtual void registerTrackCollections(const std::vector< std::string > &collections, bool doTruth)
see interface for documentation
virtual StatusCode fillEventData()
calculate event-wide data and copy into TTree branches, but don't write the record yet.
static const std::string s_inDetTrackTrigTypeName
denotes instance which deals with InDetTrack obtained as feature using TriDecTool
virtual bool isTrkParticleTrigLinkTool() const
is True if instance is Tool which links events property to Rec::TrkParticle recieved useing TrigDecTo...
static const std::string s_trkParticleTypeName
denotes instance which deals with Rec::TrackParticle
bool m_doTruth
Switch to turn on / off truth.
virtual bool isTrkParticleLinkTool() const
is True if instance is Tool which links events property to Rec::TrkParticle
std::vector< int > m_trackIndexBegin
index-based link from event tree to track tree entry.
TTree * m_eventLinkTree
pointer to event-wise ntuple trees (one for all input track collections + truth)
virtual bool isTrackLinkTool() const
is True if instance is Tool which links events property to Trk::Tracks
virtual StatusCode resetVariables()
reset ntuple variables (mainly for vectors which need to be cleared)
EventToTrackLinkNtupleTool(const std::string &, const std::string &, const IInterface *)
virtual void setTrackTreeIndices(unsigned int, int, int)
see interface for documentation
StatusCode checkCollectionType() const
checks if recieved string collectionType corresponds to some collection type names [Trk::Track,...
virtual bool isEvtPropertyTool() const
is True if instance is EventPropertyTool
virtual void setGenParticleTreeIndices(int, int)
see interface for documentation
int m_genParticleIndexBegin
index-based link from event tree to truth tree entry.
static const std::string s_trkParticleTrigTypeName
denotes instance which deals with Rec::TrackParticle obtained as feature using TriDecTool
static const std::string s_trackTypeName
denotes instance which deals with Trk::Track
std::vector< std::string > m_trackCollections
name of the TrackCollections to form tree branch names later
provides the interface for validation tools which write special information about the whole event int...
Ensure that the ATLAS eigen extensions are properly loaded.