ATLAS Offline Software
SimpleIDNtupleTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef INDETALIGNNTUPLETOOLS_SIMPLEIDNTUPLETOOL_H
6 #define INDETALIGNNTUPLETOOLS_SIMPLEIDNTUPLETOOL_H
7 
8 #include "GaudiKernel/ToolHandle.h"
10 
12 
23 class TFile;
24 class TTree;
25 class TRT_ID;
26 
27 namespace Trk
28 {
29  class AlignTrack;
30  class ITrackParticleCreatorTool;
31  class IAlignModuleTool;
32 }
33 
34 namespace InDet
35 {
36  class SimpleIDNtupleTool : virtual public Trk::IFillNtupleTool, public AthAlgTool
37  {
38  public:
39  SimpleIDNtupleTool(const std::string & type, const std::string & name, const IInterface * parent);
40  virtual ~SimpleIDNtupleTool();
41 
42  virtual StatusCode initialize() override;
43  virtual StatusCode finalize() override;
44 
46  virtual void dumpTrack(int itrk, const Trk::AlignTrack * alignTrack) override;
47 
49  void fillHits(const Trk::AlignTrack * alignTrack);
50 
51  virtual void storeHitmap() override;
52  virtual void fillHitmap() override;
53  virtual void fillSummary() override;
54  virtual void showStatistics() override;
55 
56  virtual void setNtuple(TFile* ntuple) override { m_file=ntuple; }
57  virtual StatusCode fillNtuple() override;
58 
59  private:
60  void initializeNtuple();
61 
62  ToolHandle <Trk::ITrackParticleCreatorTool> m_particleCreator;
63  ToolHandle <Trk::IAlignModuleTool> m_alignModuleTool;
64 
65  const TRT_ID * m_idHelper;
66 
67  TFile * m_file;
68  TTree * m_tree;
69 
70  // Reconstructed variables
73 
74  // Track information
75 
77  double m_xvtx;
78 
80  double m_yvtx;
81 
83  double m_zvtx;
84 
86  double m_d0;
87 
89  double m_z0;
90 
92  double m_phi0;
93 
95  double m_theta;
96 
98  double m_qoverp;
99 
101  double m_pt;
102 
104  double m_eta;
105 
107  double m_chi2;
108 
110  int m_ndof;
111 
113  double m_chi2prob;
114 
115  // Hit information
116 
118  int m_nhits;
119 
122 
125 
128 
131 
133  int m_nshsct;
134 
136  int m_nshpix;
137 
139  int m_nholes;
140 
142  int m_nhsct;
143 
145  int m_nhpix;
146 
148  double * m_hit_rho;
149 
151  double * m_hit_phi;
152 
154  double * m_hit_z;
155 
157  double * m_hit_cotth;
158 
160  double * m_hit_eta;
161 
163  double * m_hit_xloc;
164 
166  double * m_hit_yloc;
167 
169  double * m_hit_zloc;
170 
172  double * m_hit_drd;
173 
175  double * m_hit_sig;
176 
177  double * m_hit_resx;
178  double * m_hit_resx_err;
179  double * m_hit_resy;
180  double * m_hit_resy_err;
181 
182  double * m_hit_tpar_x;
183  double * m_hit_tpar_y;
184 
185  int * m_hit_det;
186  int * m_hit_type;
187 
191  double * m_hit_derivx_rotx;
192  double * m_hit_derivx_roty;
193  double * m_hit_derivx_rotz;
194  double * m_hit_derivx_bowx;
195  double * m_hit_derivx_bowy;
196  double * m_hit_derivx_bowz;
200  double * m_hit_derivy_rotx;
201  double * m_hit_derivy_roty;
202  double * m_hit_derivy_rotz;
203  double * m_hit_derivy_bowx;
204  double * m_hit_derivy_bowy;
205  double * m_hit_derivy_bowz;
206 
208 
210  }; // end class
211 
212 } // end namespace
213 
214 #endif // INDETALIGNNTUPLETOOLS_SIMPLEIDNTUPLETOOL_H
InDet::SimpleIDNtupleTool::m_chi2
double m_chi2
Chi2 of the track fit (chi2 in ntuple)
Definition: SimpleIDNtupleTool.h:107
InDet::SimpleIDNtupleTool::m_max_hits
int m_max_hits
max number of hits on track stored in ntuple
Definition: SimpleIDNtupleTool.h:207
InDet::SimpleIDNtupleTool::m_nshpix
int m_nshpix
number of shared Pixel hits on track (nshpix in ntuple)
Definition: SimpleIDNtupleTool.h:136
InDet::SimpleIDNtupleTool::m_hit_derivy_roty
double * m_hit_derivy_roty
derivatives of Y-residual wrt.
Definition: SimpleIDNtupleTool.h:201
InDet::SimpleIDNtupleTool::m_hit_sig
double * m_hit_sig
hit error (hit_sig in ntuple)
Definition: SimpleIDNtupleTool.h:175
InDet::SimpleIDNtupleTool::m_hit_rho
double * m_hit_rho
radius of hit (hit_rho in ntuple)
Definition: SimpleIDNtupleTool.h:148
InDet::SimpleIDNtupleTool::dumpTrack
virtual void dumpTrack(int itrk, const Trk::AlignTrack *alignTrack) override
fills track information to ntuple
Definition: SimpleIDNtupleTool.cxx:198
InDet::SimpleIDNtupleTool::m_z0
double m_z0
z0 perigee parameter of reconstructed track (z0 in ntuple)
Definition: SimpleIDNtupleTool.h:89
InDet::SimpleIDNtupleTool::m_hit_tpar_y
double * m_hit_tpar_y
track parameter locY
Definition: SimpleIDNtupleTool.h:183
InDet::SimpleIDNtupleTool::m_pt
double m_pt
pt perigee parameter of reconstructed track (pt in ntuple)
Definition: SimpleIDNtupleTool.h:101
InDet::SimpleIDNtupleTool::m_nhitssct
int m_nhitssct
number of SCT hits on track (nscthits in ntuple)
Definition: SimpleIDNtupleTool.h:124
IFillNtupleTool.h
InDet::SimpleIDNtupleTool::m_runNumber
int m_runNumber
Definition: SimpleIDNtupleTool.h:71
InDet::SimpleIDNtupleTool::m_hit_derivy_bowz
double * m_hit_derivy_bowz
derivatives of Y-residual wrt.
Definition: SimpleIDNtupleTool.h:205
InDet
Primary Vertex Finder.
Definition: VP1ErrorUtils.h:36
InDet::SimpleIDNtupleTool::m_hit_derivy_transy
double * m_hit_derivy_transy
derivatives of Y-residual wrt.
Definition: SimpleIDNtupleTool.h:198
InDet::SimpleIDNtupleTool::m_hit_derivx_transx
double * m_hit_derivx_transx
derivatives of X-residual wrt.
Definition: SimpleIDNtupleTool.h:188
InDet::SimpleIDNtupleTool::m_hit_derivx_bowy
double * m_hit_derivx_bowy
derivatives of X-residual wrt.
Definition: SimpleIDNtupleTool.h:195
InDet::SimpleIDNtupleTool::m_hit_resy
double * m_hit_resy
Y-residual of the hit.
Definition: SimpleIDNtupleTool.h:179
InDet::SimpleIDNtupleTool::m_particleCreator
ToolHandle< Trk::ITrackParticleCreatorTool > m_particleCreator
Pointer to track particle creator tool.
Definition: SimpleIDNtupleTool.h:62
InDet::SimpleIDNtupleTool::m_nhitspix
int m_nhitspix
number of Pixel hits on track (ntrthits in ntuple)
Definition: SimpleIDNtupleTool.h:127
InDet::SimpleIDNtupleTool::m_nshared
int m_nshared
number of shared hits on track (nshared in ntuple)
Definition: SimpleIDNtupleTool.h:130
InDet::SimpleIDNtupleTool::m_yvtx
double m_yvtx
y coord of track perigee (yvtx in ntuple)
Definition: SimpleIDNtupleTool.h:80
InDet::SimpleIDNtupleTool::m_hit_derivy_bowx
double * m_hit_derivy_bowx
derivatives of Y-residual wrt.
Definition: SimpleIDNtupleTool.h:203
InDet::SimpleIDNtupleTool::m_hit_cotth
double * m_hit_cotth
cot(theta) of hit (hit_cotth in ntuple)
Definition: SimpleIDNtupleTool.h:157
InDet::SimpleIDNtupleTool::m_phi0
double m_phi0
phi perigee parameter of reconstructed track (phi0 in ntuple)
Definition: SimpleIDNtupleTool.h:92
InDet::SimpleIDNtupleTool::m_zvtx
double m_zvtx
z coord of track perigee (zvtx in ntuple)
Definition: SimpleIDNtupleTool.h:83
InDet::SimpleIDNtupleTool::m_hit_tpar_x
double * m_hit_tpar_x
track parameter locX
Definition: SimpleIDNtupleTool.h:182
InDet::SimpleIDNtupleTool::SimpleIDNtupleTool
SimpleIDNtupleTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: SimpleIDNtupleTool.cxx:38
python.CaloAddPedShiftConfig.type
type
Definition: CaloAddPedShiftConfig.py:42
InDet::SimpleIDNtupleTool::m_tree
TTree * m_tree
Definition: SimpleIDNtupleTool.h:68
InDet::SimpleIDNtupleTool::m_nhitstrt
int m_nhitstrt
number of TRT hits on track (ntrthits in ntuple)
Definition: SimpleIDNtupleTool.h:121
InDet::SimpleIDNtupleTool::fillSummary
virtual void fillSummary() override
fills ntuple with event and track summary information
Definition: SimpleIDNtupleTool.cxx:594
InDet::SimpleIDNtupleTool::m_eta
double m_eta
eta of perigee of reconstructed track (eta in ntuple)
Definition: SimpleIDNtupleTool.h:104
InDet::SimpleIDNtupleTool::m_nshsct
int m_nshsct
number of shared SCT hits on track (nshsct in ntuple)
Definition: SimpleIDNtupleTool.h:133
InDet::SimpleIDNtupleTool::m_hit_zloc
double * m_hit_zloc
local z coord of hit (hit_zloc in ntuple)
Definition: SimpleIDNtupleTool.h:169
InDet::SimpleIDNtupleTool::m_qoverp
double m_qoverp
Q over p perigee parameter of reconstructed track (qoverp in ntuple)
Definition: SimpleIDNtupleTool.h:98
InDet::SimpleIDNtupleTool::m_hit_derivx_bowz
double * m_hit_derivx_bowz
derivatives of X-residual wrt.
Definition: SimpleIDNtupleTool.h:196
InDet::SimpleIDNtupleTool::m_idHelper
const TRT_ID * m_idHelper
Definition: SimpleIDNtupleTool.h:65
InDet::SimpleIDNtupleTool::m_hit_derivy_transx
double * m_hit_derivy_transx
derivatives of Y-residual wrt.
Definition: SimpleIDNtupleTool.h:197
InDet::SimpleIDNtupleTool::m_hit_type
int * m_hit_type
hit type
Definition: SimpleIDNtupleTool.h:186
InDet::SimpleIDNtupleTool::m_hit_derivx_transz
double * m_hit_derivx_transz
derivatives of X-residual wrt.
Definition: SimpleIDNtupleTool.h:190
InDet::SimpleIDNtupleTool::m_hit_det
int * m_hit_det
detector type for the hit
Definition: SimpleIDNtupleTool.h:185
InDet::SimpleIDNtupleTool::m_hit_eta
double * m_hit_eta
eta angle of hit (hit_eta in ntuple)
Definition: SimpleIDNtupleTool.h:160
InDet::SimpleIDNtupleTool::m_evtNumber
int m_evtNumber
Definition: SimpleIDNtupleTool.h:72
Trk::IFillNtupleTool
Definition: IFillNtupleTool.h:33
InDet::SimpleIDNtupleTool::m_chi2prob
double m_chi2prob
Chi2 probability of the track fit (chi2prob in ntuple)
Definition: SimpleIDNtupleTool.h:113
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
InDet::SimpleIDNtupleTool::m_alignModuleTool
ToolHandle< Trk::IAlignModuleTool > m_alignModuleTool
Pointer to AlignmModuleTool.
Definition: SimpleIDNtupleTool.h:63
AthAlgTool.h
InDet::SimpleIDNtupleTool::m_hit_z
double * m_hit_z
z coord of hit (hit_z in ntuple)
Definition: SimpleIDNtupleTool.h:154
test_pyathena.parent
parent
Definition: test_pyathena.py:15
InDet::SimpleIDNtupleTool::initializeNtuple
void initializeNtuple()
Definition: SimpleIDNtupleTool.cxx:602
InDet::SimpleIDNtupleTool::m_file
TFile * m_file
Definition: SimpleIDNtupleTool.h:67
InDet::SimpleIDNtupleTool::m_nhsct
int m_nhsct
number of SCT holes on track (nhsct in ntuple)
Definition: SimpleIDNtupleTool.h:142
InDet::SimpleIDNtupleTool::initialize
virtual StatusCode initialize() override
Definition: SimpleIDNtupleTool.cxx:161
InDet::SimpleIDNtupleTool::finalize
virtual StatusCode finalize() override
Definition: SimpleIDNtupleTool.cxx:191
InDet::SimpleIDNtupleTool::m_hit_drd
double * m_hit_drd
drift distance to wire for hit (hit_drd in ntuple)
Definition: SimpleIDNtupleTool.h:172
InDet::SimpleIDNtupleTool::m_hit_derivy_transz
double * m_hit_derivy_transz
derivatives of Y-residual wrt.
Definition: SimpleIDNtupleTool.h:199
InDet::SimpleIDNtupleTool::setNtuple
virtual void setNtuple(TFile *ntuple) override
sets the output stream for the logfile
Definition: SimpleIDNtupleTool.h:56
InDet::SimpleIDNtupleTool::m_hit_derivx_roty
double * m_hit_derivx_roty
derivatives of X-residual wrt.
Definition: SimpleIDNtupleTool.h:192
InDet::SimpleIDNtupleTool::fillHitmap
virtual void fillHitmap() override
fills ntuple with hit information
Definition: SimpleIDNtupleTool.cxx:590
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
InDet::SimpleIDNtupleTool::m_hit_derivy_rotx
double * m_hit_derivy_rotx
derivatives of Y-residual wrt.
Definition: SimpleIDNtupleTool.h:200
InDet::SimpleIDNtupleTool::m_hit_derivx_transy
double * m_hit_derivx_transy
derivatives of X-residual wrt.
Definition: SimpleIDNtupleTool.h:189
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
InDet::SimpleIDNtupleTool::m_hit_derivy_rotz
double * m_hit_derivy_rotz
derivatives of Y-residual wrt.
Definition: SimpleIDNtupleTool.h:202
InDet::SimpleIDNtupleTool::~SimpleIDNtupleTool
virtual ~SimpleIDNtupleTool()
Definition: SimpleIDNtupleTool.cxx:116
Trk::AlignTrack
Definition: AlignTrack.h:41
InDet::SimpleIDNtupleTool::m_hit_phi
double * m_hit_phi
phi angle of hit (hit_phi in ntuple)
Definition: SimpleIDNtupleTool.h:151
InDet::SimpleIDNtupleTool::storeHitmap
virtual void storeHitmap() override
stores hitmap for writing to ntuple
Definition: SimpleIDNtupleTool.cxx:586
TRT_ID
Definition: TRT_ID.h:82
InDet::SimpleIDNtupleTool::m_hit_yloc
double * m_hit_yloc
local y coord of hit (hit_yloc in ntuple)
Definition: SimpleIDNtupleTool.h:166
InDet::SimpleIDNtupleTool::m_theta
double m_theta
theta perigee parameter of reconstructed track (theta in ntuple)
Definition: SimpleIDNtupleTool.h:95
InDet::SimpleIDNtupleTool::m_hit_resy_err
double * m_hit_resy_err
Y-residual error of the hit.
Definition: SimpleIDNtupleTool.h:180
InDet::SimpleIDNtupleTool::m_storeDerivatives
bool m_storeDerivatives
Definition: SimpleIDNtupleTool.h:209
InDet::SimpleIDNtupleTool::m_d0
double m_d0
d0 perigee parameter of reconstructed track (d0 in ntuple)
Definition: SimpleIDNtupleTool.h:86
InDet::SimpleIDNtupleTool::m_nhpix
int m_nhpix
number of Pixel holes on track (nhpix in ntuple)
Definition: SimpleIDNtupleTool.h:145
InDet::SimpleIDNtupleTool::m_hit_xloc
double * m_hit_xloc
local x coord of hit (hit_xloc in ntuple)
Definition: SimpleIDNtupleTool.h:163
InDet::SimpleIDNtupleTool::fillHits
void fillHits(const Trk::AlignTrack *alignTrack)
fills hit information to ntuple
Definition: SimpleIDNtupleTool.cxx:336
InDet::SimpleIDNtupleTool::m_hit_derivx_rotz
double * m_hit_derivx_rotz
derivatives of X-residual wrt.
Definition: SimpleIDNtupleTool.h:193
InDet::SimpleIDNtupleTool::m_hit_resx_err
double * m_hit_resx_err
X-residual error of the hit.
Definition: SimpleIDNtupleTool.h:178
InDet::SimpleIDNtupleTool::m_hit_resx
double * m_hit_resx
X-residual of the hit.
Definition: SimpleIDNtupleTool.h:177
InDet::SimpleIDNtupleTool::m_hit_derivx_rotx
double * m_hit_derivx_rotx
derivatives of X-residual wrt.
Definition: SimpleIDNtupleTool.h:191
InDet::SimpleIDNtupleTool::m_nholes
int m_nholes
number of holes on track (nholes in ntuple)
Definition: SimpleIDNtupleTool.h:139
AthAlgTool
Definition: AthAlgTool.h:26
InDet::SimpleIDNtupleTool::showStatistics
virtual void showStatistics() override
write statistics out to log file
Definition: SimpleIDNtupleTool.cxx:598
InDet::SimpleIDNtupleTool::m_hit_derivy_bowy
double * m_hit_derivy_bowy
derivatives of Y-residual wrt.
Definition: SimpleIDNtupleTool.h:204
InDet::SimpleIDNtupleTool::fillNtuple
virtual StatusCode fillNtuple() override
writes trees and histograms to ntuple
Definition: SimpleIDNtupleTool.cxx:181
InDet::SimpleIDNtupleTool::m_hit_derivx_bowx
double * m_hit_derivx_bowx
derivatives of X-residual wrt.
Definition: SimpleIDNtupleTool.h:194
InDet::SimpleIDNtupleTool::m_nhits
int m_nhits
number of hits on track [including scattering centers] (nhits in ntuple)
Definition: SimpleIDNtupleTool.h:118
InDet::SimpleIDNtupleTool
Definition: SimpleIDNtupleTool.h:37
InDet::SimpleIDNtupleTool::m_ndof
int m_ndof
number of degrees of freedom of the track fit (ndof in ntuple)
Definition: SimpleIDNtupleTool.h:110
InDet::SimpleIDNtupleTool::m_xvtx
double m_xvtx
x coord of track perigee (xvtx in ntuple)
Definition: SimpleIDNtupleTool.h:77
AlignTrack
AlignTrack is a generalization of a Trk::Track, used as the basic object to contain track information...