ATLAS Offline Software
Loading...
Searching...
No Matches
TruthNtupleTool.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
6// TruthNtupleTool.h
7// Header file for TruthNtupleTool
9// (c) ATLAS Detector software
11// Sebastian.Fleischmann@cern.ch
13
14#ifndef TRK_TRUTHNTUPLETOOL_H
15#define TRK_TRUTHNTUPLETOOL_H
16
17
19#include "GaudiKernel/ITHistSvc.h"
20#include "GaudiKernel/ServiceHandle.h"
21#include "GaudiKernel/ToolHandle.h"
24
27#include <vector>
28
29
30class TH1D;
31class TTree;
32
33namespace Trk {
34
35
45
46class TruthNtupleTool : virtual public Trk::ITruthNtupleTool, public AthAlgTool {
47public:
48
49 // standard AlgToolmethods
50 TruthNtupleTool(const std::string&,const std::string&,const IInterface*);
52
53 // standard Athena methods
54 StatusCode initialize();
55 StatusCode finalize();
56
57 virtual StatusCode writeTruthData ( const std::vector< Trk::ValidationTrackTruthData >& truthData );
58
59 virtual unsigned int getNumberOfTreeRecords() const;
60
61 virtual StatusCode initBranches(const std::vector<const Trk::ITrackTruthClassifier*>& classifiers,
62 bool,
63 const std::vector<std::string>& trackCollectionNames);
64
65private:
66
67 // jobOptions
68 std::string m_ntupleTreeName;
69 std::string m_ntupleFileName;
70 std::vector<double> m_etaBins;
72
74 TTree* m_nt;
75
77
78 // ntuple variables
81
82 std::vector< std::vector<unsigned int>* > m_TrackLinkIndex;
83 std::vector< std::vector<float>* > m_mc_prob;
84 std::vector<unsigned int> m_classifications;
85 // Truth information
86 float m_mc_d0;
87 float m_mc_z0;
88 float m_mc_phi0;
89 float m_mc_theta;
92 float m_mc_eta;
93
98 float m_mc_prodR;
99 float m_mc_prodz;
100
101 // statistics
102 std::vector< std::vector<TH1D*> > m_recoTrackCounts;
103 std::vector< std::vector<TH1D*> > m_truthTrackCounts;
104
105 std::vector<const Trk::ITrackTruthClassifier*> m_trackTruthClassifiers;
106
107 SG::ReadHandleKey<xAOD::EventInfo> m_evt {this, "EvtInfo", "EventInfo", "EventInfo name"};
108};
109
110
111} // end of namespace
112
113#endif // TRK_TRUTHNTUPLETOOL_H
114
Property holding a SG store/key/clid from which a ReadHandle is made.
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
Property holding a SG store/key/clid from which a ReadHandle is made.
provides the interface for validation tools which write special information about truth particles int...
float m_mc_d0
d0 of MC truth particle's perigee parameters
virtual StatusCode initBranches(const std::vector< const Trk::ITrackTruthClassifier * > &classifiers, bool, const std::vector< std::string > &trackCollectionNames)
int m_eventNumber
event number to which this MC truth particle belongs
int m_mc_jetLinkIndex
link to jet this particle belongs to (if jet tree is ON)
std::vector< std::vector< TH1D * > > m_truthTrackCounts
std::vector< std::vector< TH1D * > > m_recoTrackCounts
float m_mc_prodR
Rxy of particle's production vertex.
bool m_fillJets
jO: jet filling, set from external call
std::string m_ntupleFileName
jobOption: Ntuple file and dir name
float m_mc_theta
theta of MC truth particle's perigee parameters
std::string m_ntupleTreeName
jobOption: Ntuple tree name
float m_mc_z0
z of MC truth particle's perigee parameters
TruthNtupleTool(const std::string &, const std::string &, const IInterface *)
virtual StatusCode writeTruthData(const std::vector< Trk::ValidationTrackTruthData > &truthData)
write track data to ntuple
unsigned int m_numberOfTreeEntries
float m_mc_qOverPt
q/pT of MC truth particle's perigee parameters
int m_mc_particleID
PDG ID of MC truth particle.
float m_mc_energy
MC truth particle's energy at production vertex.
virtual unsigned int getNumberOfTreeRecords() const
std::vector< double > m_etaBins
std::vector< unsigned int > m_classifications
int m_mc_uniqueID
MC truth particle's uniqueID.
std::vector< const Trk::ITrackTruthClassifier * > m_trackTruthClassifiers
the truth classifiers
std::vector< std::vector< float > * > m_mc_prob
int m_runNumber
run number to which this MC truth particle belongs
ServiceHandle< ITHistSvc > m_histSvc
StatusCode finalize()
finalize
float m_mc_eta
eta of MC truth particle's perigee parameters
TTree * m_nt
Pointer to the NTuple tree.
float m_mc_phi0
phi of MC truth particle's perigee parameters
SG::ReadHandleKey< xAOD::EventInfo > m_evt
float m_mc_prodz
z coordinate of particle's production vertex
std::vector< std::vector< unsigned int > * > m_TrackLinkIndex
float m_mc_qOverP
q/p of MC truth particle's perigee parameters
Ensure that the ATLAS eigen extensions are properly loaded.