ATLAS Offline Software
Loading...
Searching...
No Matches
Tracking
TrkValidation
TrkValTools
TrkValTools
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
17
#include "
AthenaBaseComps/AthAlgTool.h
"
18
19
#include "GaudiKernel/ToolHandle.h"
20
#include "
TrkValInterfaces/IEventPropertyNtupleTool.h
"
21
#include <vector>
22
class
TTree;
23
29
30
namespace
Trk
{
31
32
class
EventToTrackLinkNtupleTool
:
virtual
public
IEventPropertyNtupleTool
,
public
AthAlgTool
{
33
public
:
34
35
// standard AlgToolmethods
36
EventToTrackLinkNtupleTool
(
const
std::string&,
const
std::string&,
const
IInterface*);
37
~EventToTrackLinkNtupleTool
();
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
;
77
TTree*
m_eventLinkTree
;
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
;
84
int
m_genParticleIndexBegin
;
85
int
m_nGenParticlesPerEvent
;
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
96
inline
bool
Trk::EventToTrackLinkNtupleTool::isTrackLinkTool
( )
const
{
97
if
(
m_collectionType
==
s_trackTypeName
)
return
true
;
98
return
false
;
99
}
100
101
inline
bool
Trk::EventToTrackLinkNtupleTool::isTrkParticleLinkTool
( )
const
{
102
if
(
m_collectionType
==
s_trkParticleTypeName
)
return
true
;
103
return
false
;
104
}
105
106
inline
bool
Trk::EventToTrackLinkNtupleTool::isTrkParticleTrigLinkTool
( )
const
{
107
if
(
m_collectionType
==
s_trkParticleTrigTypeName
)
return
true
;
108
return
false
;
109
}
110
111
inline
bool
Trk::EventToTrackLinkNtupleTool::isInDetTrackTrigLinkTool
( )
const
{
112
if
(
m_collectionType
==
s_inDetTrackTrigTypeName
)
return
true
;
113
return
false
;
114
}
115
116
inline
bool
Trk::EventToTrackLinkNtupleTool::isEvtPropertyTool
( )
const
{
117
return
false
;
118
}
119
120
121
#endif
// TRK_EVENTTRACKLINKNTUPLETOOL_H
AthAlgTool.h
IEventPropertyNtupleTool.h
AthAlgTool::AthAlgTool
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
Definition
AthAlgTool.cxx:16
Trk::EventToTrackLinkNtupleTool::finalize
StatusCode finalize()
Definition
EventToTrackLinkNtupleTool.cxx:53
Trk::EventToTrackLinkNtupleTool::isInDetTrackTrigLinkTool
virtual bool isInDetTrackTrigLinkTool() const
is True if instance is Tool which links events property to InDetTrack recieved useing TrigDecTool
Definition
EventToTrackLinkNtupleTool.h:111
Trk::EventToTrackLinkNtupleTool::m_nGenParticlesPerEvent
int m_nGenParticlesPerEvent
Definition
EventToTrackLinkNtupleTool.h:85
Trk::EventToTrackLinkNtupleTool::addNtupleItems
virtual StatusCode addNtupleItems(TTree *, const std::string &)
add branches to the tree Should be called once dunring the initialisation phase by the calling algori...
Definition
EventToTrackLinkNtupleTool.cxx:65
Trk::EventToTrackLinkNtupleTool::registerTrackCollections
virtual void registerTrackCollections(const std::vector< std::string > &collections, bool doTruth)
see interface for documentation
Definition
EventToTrackLinkNtupleTool.cxx:58
Trk::EventToTrackLinkNtupleTool::fillEventData
virtual StatusCode fillEventData()
calculate event-wide data and copy into TTree branches, but don't write the record yet.
Definition
EventToTrackLinkNtupleTool.cxx:101
Trk::EventToTrackLinkNtupleTool::s_inDetTrackTrigTypeName
static const std::string s_inDetTrackTrigTypeName
denotes instance which deals with InDetTrack obtained as feature using TriDecTool
Definition
EventToTrackLinkNtupleTool.h:90
Trk::EventToTrackLinkNtupleTool::isTrkParticleTrigLinkTool
virtual bool isTrkParticleTrigLinkTool() const
is True if instance is Tool which links events property to Rec::TrkParticle recieved useing TrigDecTo...
Definition
EventToTrackLinkNtupleTool.h:106
Trk::EventToTrackLinkNtupleTool::s_trkParticleTypeName
static const std::string s_trkParticleTypeName
denotes instance which deals with Rec::TrackParticle
Definition
EventToTrackLinkNtupleTool.h:88
Trk::EventToTrackLinkNtupleTool::m_nTracksPerEvent
std::vector< int > m_nTracksPerEvent
Definition
EventToTrackLinkNtupleTool.h:83
Trk::EventToTrackLinkNtupleTool::m_doTruth
bool m_doTruth
Switch to turn on / off truth.
Definition
EventToTrackLinkNtupleTool.h:78
Trk::EventToTrackLinkNtupleTool::~EventToTrackLinkNtupleTool
~EventToTrackLinkNtupleTool()
Trk::EventToTrackLinkNtupleTool::isTrkParticleLinkTool
virtual bool isTrkParticleLinkTool() const
is True if instance is Tool which links events property to Rec::TrkParticle
Definition
EventToTrackLinkNtupleTool.h:101
Trk::EventToTrackLinkNtupleTool::m_trackIndexBegin
std::vector< int > m_trackIndexBegin
index-based link from event tree to track tree entry.
Definition
EventToTrackLinkNtupleTool.h:82
Trk::EventToTrackLinkNtupleTool::m_eventLinkTree
TTree * m_eventLinkTree
pointer to event-wise ntuple trees (one for all input track collections + truth)
Definition
EventToTrackLinkNtupleTool.h:77
Trk::EventToTrackLinkNtupleTool::m_collectionType
std::string m_collectionType
Definition
EventToTrackLinkNtupleTool.h:76
Trk::EventToTrackLinkNtupleTool::isTrackLinkTool
virtual bool isTrackLinkTool() const
is True if instance is Tool which links events property to Trk::Tracks
Definition
EventToTrackLinkNtupleTool.h:96
Trk::EventToTrackLinkNtupleTool::resetVariables
virtual StatusCode resetVariables()
reset ntuple variables (mainly for vectors which need to be cleared)
Definition
EventToTrackLinkNtupleTool.cxx:105
Trk::EventToTrackLinkNtupleTool::EventToTrackLinkNtupleTool
EventToTrackLinkNtupleTool(const std::string &, const std::string &, const IInterface *)
Definition
EventToTrackLinkNtupleTool.cxx:25
Trk::EventToTrackLinkNtupleTool::setTrackTreeIndices
virtual void setTrackTreeIndices(unsigned int, int, int)
see interface for documentation
Definition
EventToTrackLinkNtupleTool.cxx:84
Trk::EventToTrackLinkNtupleTool::checkCollectionType
StatusCode checkCollectionType() const
checks if recieved string collectionType corresponds to some collection type names [Trk::Track,...
Definition
EventToTrackLinkNtupleTool.cxx:109
Trk::EventToTrackLinkNtupleTool::isEvtPropertyTool
virtual bool isEvtPropertyTool() const
is True if instance is EventPropertyTool
Definition
EventToTrackLinkNtupleTool.h:116
Trk::EventToTrackLinkNtupleTool::initialize
StatusCode initialize()
Definition
EventToTrackLinkNtupleTool.cxx:47
Trk::EventToTrackLinkNtupleTool::setGenParticleTreeIndices
virtual void setGenParticleTreeIndices(int, int)
see interface for documentation
Definition
EventToTrackLinkNtupleTool.cxx:95
Trk::EventToTrackLinkNtupleTool::m_genParticleIndexBegin
int m_genParticleIndexBegin
index-based link from event tree to truth tree entry.
Definition
EventToTrackLinkNtupleTool.h:84
Trk::EventToTrackLinkNtupleTool::s_trkParticleTrigTypeName
static const std::string s_trkParticleTrigTypeName
denotes instance which deals with Rec::TrackParticle obtained as feature using TriDecTool
Definition
EventToTrackLinkNtupleTool.h:89
Trk::EventToTrackLinkNtupleTool::s_trackTypeName
static const std::string s_trackTypeName
denotes instance which deals with Trk::Track
Definition
EventToTrackLinkNtupleTool.h:87
Trk::EventToTrackLinkNtupleTool::m_trackCollections
std::vector< std::string > m_trackCollections
name of the TrackCollections to form tree branch names later
Definition
EventToTrackLinkNtupleTool.h:79
Trk::IEventPropertyNtupleTool
provides the interface for validation tools which write special information about the whole event int...
Definition
IEventPropertyNtupleTool.h:34
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition
FakeTrackBuilder.h:9
Generated on
for ATLAS Offline Software by
1.14.0