ATLAS Offline Software
DetailedIDNtupleTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef INDETALIGNNTUPLETOOLS_DETAILEDIDNTUPLETOOL_H
6 #define INDETALIGNNTUPLETOOLS_DETAILEDIDNTUPLETOOL_H
7 
10 #include "GaudiKernel/ToolHandle.h"
13 //#include "TrkParameters/MeasuredPerigee.h"
15 
16 
23 class TFile;
24 class TTree;
25 
26 namespace Trk
27 {
28  class AlignTrack;
29  class ITrackSummaryTool;
30  class IAlignModuleTool;
31  class Track;
32  //class TrackParameters; <- typedef, cant fw declare
33 }
34 
35 namespace InDetDD
36 {
37  class TRT_DetectorManager;
38 }
39 
40 
41 
42 class TRT_ID;
43 
44 namespace InDet
45 {
46  class DetailedIDNtupleTool : virtual public Trk::IFillNtupleTool, public AthAlgTool
47  {
48 
49  public:
50  DetailedIDNtupleTool(const std::string & type, const std::string & name, const IInterface * parent);
51  virtual ~DetailedIDNtupleTool();
52 
55 
57  void dumpTrack(int itrk, const Trk::AlignTrack * alignTrack);
58 
59  void storeHitmap();
60  void fillHitmap();
61 
62  void fillSummary();
63  void showStatistics();
64 
65  void setNtuple(TFile* ntuple) { m_file=ntuple; }
67 
68  private:
69 
70  bool retrieveTruthInfo(const Trk::AlignTrack* trk);
72  void initializeNtuple();
73 
74  ToolHandle <Trk::ITrackSummaryTool> m_trackSumTool;
75  ToolHandle <Trk::IAlignModuleTool> m_alignModuleTool;
76  PublicToolHandle <Trk::ITruthToTrack> m_truthToTrack
77  {this,"TruthToTrack","Trk::TruthToTrack/InDetTruthToTrack",""};
78  PublicToolHandle <Trk::IExtrapolator> m_extrapolator
79  {this,"Extrapolator","Trk::Extrapolator/AtlasExtrapolator",""};
80 
83  bool m_storeTruth;
85 
86  TFile * m_file;
87  TTree * m_tree;
88 
89  std::string m_filename;
90  std::string m_filepath;
91 
92  std::string m_trackCollection;
93  std::string m_tracksTruthName;
94 
95 
96  // Reconstructed variables
97  int m_runNumber = 0;
98  int m_evtNumber = 0;
99 
100 
101  // original track information
102  double m_original_xvtx = 0.0;
103  double m_original_yvtx = 0.0;
104  double m_original_zvtx = 0.0;
105 
106  double m_original_d0 = 0.0;
107  double m_original_z0 = 0.0;
108  double m_original_phi0 = 0.0;
109  double m_original_theta = 0.0;
110  double m_original_qoverp = 0.0;
111  double m_original_pt = 0.0;
112 
113  double m_original_eta = 0.0;
114  double m_original_chi2 = 0.0;
116  double m_original_chi2prob = 0.0;
117 
118  double m_original_err_d0 = 0.0;
119  double m_original_err_z0 = 0.0;
120  double m_original_err_phi0 = 0.0;
121  double m_original_err_theta = 0.0;
122  double m_original_err_qoverp = 0.0;
123 
124  // truth informaiton
125  double m_truth_d0 = 0.0;
126  double m_truth_z0 = 0.0;
127  double m_truth_phi0 = 0.0;
128  double m_truth_theta = 0.0;
129  double m_truth_eta = 0.0;
130  double m_truth_pt = 0.0;
131  double m_truth_qoverp = 0.0;
132  double m_truth_qoverpt = 0.0;
133  double m_truth_charge = 0.0;
134  double m_truth_prod_x = 0.0;
135  double m_truth_prod_y = 0.0;
136  double m_truth_prod_z = 0.0;
137 
138  // oroginal track wrt reference points
139  double m_original_toRef_d0 = 0.0;
140  double m_original_toRef_z0 = 0.0;
141  double m_original_toRef_phi0 = 0.0;
144 
145  // refitted track wrt reference points
146  double m_toRef_d0 = 0.0;
147  double m_toRef_z0 = 0.0;
148  double m_toRef_phi0 = 0.0;
149  double m_toRef_theta = 0.0;
150  double m_toRef_qoverp = 0.0;
151 
152  // the AlignTrack information
153  double m_err_d0 = 0.0;
154  double m_err_z0 = 0.0;
155  double m_err_phi0 = 0.0;
156  double m_err_theta = 0.0;
157  double m_err_qoverp = 0.0;
158 
159  double m_xvtx = 0.0;
160  double m_yvtx = 0.0;
161  double m_zvtx = 0.0;
162  double m_d0 = 0.0;
163  double m_z0 = 0.0;
164  double m_phi0 = 0.0;
165  double m_theta = 0.0;
166  double m_qoverp = 0.0;
167  double m_pt = 0.0;
168  double m_eta = 0.0;
169  double m_chi2 = 0.0;
170  int m_ndof = 0;
171  double m_chi2prob = 0.0;
172 
173  }; // end class
174 
175 } // end namespace
176 
177 #endif // INDETALIGNNTUPLETOOLS_DETAILEDIDNTUPLETOOL_H
InDet::DetailedIDNtupleTool::m_storeConstrainedOnly
bool m_storeConstrainedOnly
onlystore the AlignTrack which is normally refitted
Definition: DetailedIDNtupleTool.h:82
InDet::DetailedIDNtupleTool::m_original_chi2prob
double m_original_chi2prob
Definition: DetailedIDNtupleTool.h:116
InDet::DetailedIDNtupleTool::m_original_err_z0
double m_original_err_z0
Definition: DetailedIDNtupleTool.h:119
InDet::DetailedIDNtupleTool::storeHitmap
void storeHitmap()
stores hitmap for writing to ntuple
Definition: DetailedIDNtupleTool.cxx:463
InDet::DetailedIDNtupleTool::fillSummary
void fillSummary()
fills ntuple with event and track summary information
Definition: DetailedIDNtupleTool.cxx:470
InDet::DetailedIDNtupleTool::m_filepath
std::string m_filepath
path to ntuple file
Definition: DetailedIDNtupleTool.h:90
InDet::DetailedIDNtupleTool::finalize
StatusCode finalize()
Definition: DetailedIDNtupleTool.cxx:101
TrackParameters.h
InDet::DetailedIDNtupleTool::initialize
StatusCode initialize()
Definition: DetailedIDNtupleTool.cxx:71
IFillNtupleTool.h
InDet::DetailedIDNtupleTool::m_theta
double m_theta
Definition: DetailedIDNtupleTool.h:165
InDet
Primary Vertex Finder.
Definition: VP1ErrorUtils.h:36
InDet::DetailedIDNtupleTool::m_chi2prob
double m_chi2prob
Definition: DetailedIDNtupleTool.h:171
InDet::DetailedIDNtupleTool::m_original_ndof
int m_original_ndof
Definition: DetailedIDNtupleTool.h:115
InDet::DetailedIDNtupleTool::m_original_pt
double m_original_pt
Definition: DetailedIDNtupleTool.h:111
InDet::DetailedIDNtupleTool::m_storeTruth
bool m_storeTruth
retrieve the truth information
Definition: DetailedIDNtupleTool.h:83
InDet::DetailedIDNtupleTool::m_original_d0
double m_original_d0
Definition: DetailedIDNtupleTool.h:106
InDet::DetailedIDNtupleTool::m_original_yvtx
double m_original_yvtx
Definition: DetailedIDNtupleTool.h:103
InDet::DetailedIDNtupleTool::m_original_err_d0
double m_original_err_d0
Definition: DetailedIDNtupleTool.h:118
InDet::DetailedIDNtupleTool::m_chi2
double m_chi2
Definition: DetailedIDNtupleTool.h:169
InDet::DetailedIDNtupleTool::m_pt
double m_pt
Definition: DetailedIDNtupleTool.h:167
InDet::DetailedIDNtupleTool::m_runNumber
int m_runNumber
Definition: DetailedIDNtupleTool.h:97
IExtrapolator.h
InDet::DetailedIDNtupleTool::m_truth_charge
double m_truth_charge
Definition: DetailedIDNtupleTool.h:133
InDet::DetailedIDNtupleTool::m_truth_prod_y
double m_truth_prod_y
Definition: DetailedIDNtupleTool.h:135
InDet::DetailedIDNtupleTool::DetailedIDNtupleTool
DetailedIDNtupleTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: DetailedIDNtupleTool.cxx:39
InDet::DetailedIDNtupleTool::m_original_qoverp
double m_original_qoverp
Definition: DetailedIDNtupleTool.h:110
InDet::DetailedIDNtupleTool
Definition: DetailedIDNtupleTool.h:47
InDet::DetailedIDNtupleTool::m_truth_z0
double m_truth_z0
Definition: DetailedIDNtupleTool.h:126
InDet::DetailedIDNtupleTool::m_truth_eta
double m_truth_eta
Definition: DetailedIDNtupleTool.h:129
InDet::DetailedIDNtupleTool::m_original_zvtx
double m_original_zvtx
Definition: DetailedIDNtupleTool.h:104
InDet::DetailedIDNtupleTool::m_err_theta
double m_err_theta
Definition: DetailedIDNtupleTool.h:156
InDet::DetailedIDNtupleTool::m_truth_pt
double m_truth_pt
Definition: DetailedIDNtupleTool.h:130
InDet::DetailedIDNtupleTool::m_filename
std::string m_filename
name of ntuple file
Definition: DetailedIDNtupleTool.h:89
InDet::DetailedIDNtupleTool::m_err_phi0
double m_err_phi0
Definition: DetailedIDNtupleTool.h:155
InDet::DetailedIDNtupleTool::m_qoverp
double m_qoverp
Definition: DetailedIDNtupleTool.h:166
InDet::DetailedIDNtupleTool::m_truth_phi0
double m_truth_phi0
Definition: DetailedIDNtupleTool.h:127
InDet::DetailedIDNtupleTool::m_original_toRef_phi0
double m_original_toRef_phi0
Definition: DetailedIDNtupleTool.h:141
InDet::DetailedIDNtupleTool::m_xvtx
double m_xvtx
Definition: DetailedIDNtupleTool.h:159
InDet::DetailedIDNtupleTool::m_original_toRef_z0
double m_original_toRef_z0
Definition: DetailedIDNtupleTool.h:140
InDet::DetailedIDNtupleTool::m_original_err_theta
double m_original_err_theta
Definition: DetailedIDNtupleTool.h:121
Trk::IFillNtupleTool
Definition: IFillNtupleTool.h:33
InDet::DetailedIDNtupleTool::m_extrapolator
PublicToolHandle< Trk::IExtrapolator > m_extrapolator
track extrapolator
Definition: DetailedIDNtupleTool.h:79
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
InDet::DetailedIDNtupleTool::m_toRef_d0
double m_toRef_d0
Definition: DetailedIDNtupleTool.h:146
InDet::DetailedIDNtupleTool::m_err_z0
double m_err_z0
Definition: DetailedIDNtupleTool.h:154
InDet::DetailedIDNtupleTool::m_file
TFile * m_file
Definition: DetailedIDNtupleTool.h:86
AthAlgTool.h
InDet::DetailedIDNtupleTool::m_err_d0
double m_err_d0
Definition: DetailedIDNtupleTool.h:153
InDet::DetailedIDNtupleTool::fillNtuple
StatusCode fillNtuple()
writes trees and histograms to ntuple
Definition: DetailedIDNtupleTool.cxx:92
test_pyathena.parent
parent
Definition: test_pyathena.py:15
InDet::DetailedIDNtupleTool::m_original_chi2
double m_original_chi2
Definition: DetailedIDNtupleTool.h:114
InDet::DetailedIDNtupleTool::m_phi0
double m_phi0
Definition: DetailedIDNtupleTool.h:164
InDet::DetailedIDNtupleTool::retrieveTruthInfo
bool retrieveTruthInfo(const Trk::AlignTrack *trk)
Definition: DetailedIDNtupleTool.cxx:351
InDet::DetailedIDNtupleTool::m_original_phi0
double m_original_phi0
Definition: DetailedIDNtupleTool.h:108
InDet::DetailedIDNtupleTool::m_storeNormalRefittedOnly
bool m_storeNormalRefittedOnly
only store the AlignTrack which is normally refitted
Definition: DetailedIDNtupleTool.h:81
Trk::ParametersBase
Definition: ParametersBase.h:55
InDet::DetailedIDNtupleTool::m_err_qoverp
double m_err_qoverp
Definition: DetailedIDNtupleTool.h:157
InDet::DetailedIDNtupleTool::dumpTrack
void dumpTrack(int itrk, const Trk::AlignTrack *alignTrack)
fills track information to ntuple
Definition: DetailedIDNtupleTool.cxx:107
InDet::DetailedIDNtupleTool::m_yvtx
double m_yvtx
Definition: DetailedIDNtupleTool.h:160
InDet::DetailedIDNtupleTool::m_original_err_phi0
double m_original_err_phi0
Definition: DetailedIDNtupleTool.h:120
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
InDet::DetailedIDNtupleTool::m_zvtx
double m_zvtx
Definition: DetailedIDNtupleTool.h:161
InDet::DetailedIDNtupleTool::m_original_toRef_d0
double m_original_toRef_d0
Definition: DetailedIDNtupleTool.h:139
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
InDet::DetailedIDNtupleTool::m_truth_qoverpt
double m_truth_qoverpt
Definition: DetailedIDNtupleTool.h:132
InDet::DetailedIDNtupleTool::m_original_toRef_theta
double m_original_toRef_theta
Definition: DetailedIDNtupleTool.h:142
InDet::DetailedIDNtupleTool::m_original_z0
double m_original_z0
Definition: DetailedIDNtupleTool.h:107
InDet::DetailedIDNtupleTool::perigeeParameter
const Trk::TrackParameters * perigeeParameter(const Trk::AlignTrack *track) const
Definition: DetailedIDNtupleTool.cxx:448
Trk::AlignTrack
Definition: AlignTrack.h:41
InDet::DetailedIDNtupleTool::m_eta
double m_eta
Definition: DetailedIDNtupleTool.h:168
InDet::DetailedIDNtupleTool::m_toRef_z0
double m_toRef_z0
Definition: DetailedIDNtupleTool.h:147
InDet::DetailedIDNtupleTool::m_truth_theta
double m_truth_theta
Definition: DetailedIDNtupleTool.h:128
InDet::DetailedIDNtupleTool::~DetailedIDNtupleTool
virtual ~DetailedIDNtupleTool()
Definition: DetailedIDNtupleTool.cxx:67
TRT_ID
Definition: TRT_ID.h:84
InDet::DetailedIDNtupleTool::m_tree
TTree * m_tree
Definition: DetailedIDNtupleTool.h:87
InDet::DetailedIDNtupleTool::showStatistics
void showStatistics()
write statistics out to log file
Definition: DetailedIDNtupleTool.cxx:474
ITruthToTrack.h
InDetDD
Message Stream Member.
Definition: FakeTrackBuilder.h:8
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
InDet::DetailedIDNtupleTool::m_alignModuleTool
ToolHandle< Trk::IAlignModuleTool > m_alignModuleTool
Pointer to AlignmModuleTool.
Definition: DetailedIDNtupleTool.h:75
InDet::DetailedIDNtupleTool::m_original_eta
double m_original_eta
Definition: DetailedIDNtupleTool.h:113
InDet::DetailedIDNtupleTool::m_truthToTrack
PublicToolHandle< Trk::ITruthToTrack > m_truthToTrack
the truth to track Tool
Definition: DetailedIDNtupleTool.h:77
InDet::DetailedIDNtupleTool::m_toRef_phi0
double m_toRef_phi0
Definition: DetailedIDNtupleTool.h:148
InDet::DetailedIDNtupleTool::m_d0
double m_d0
Definition: DetailedIDNtupleTool.h:162
InDet::DetailedIDNtupleTool::m_truth_prod_x
double m_truth_prod_x
Definition: DetailedIDNtupleTool.h:134
Track
Definition: TriggerChamberClusterOnTrackCreator.h:21
InDet::DetailedIDNtupleTool::fillHitmap
void fillHitmap()
fills ntuple with hit information
Definition: DetailedIDNtupleTool.cxx:467
InDet::DetailedIDNtupleTool::m_truth_prod_z
double m_truth_prod_z
Definition: DetailedIDNtupleTool.h:136
InDet::DetailedIDNtupleTool::m_original_xvtx
double m_original_xvtx
Definition: DetailedIDNtupleTool.h:102
InDet::DetailedIDNtupleTool::initializeNtuple
void initializeNtuple()
Definition: DetailedIDNtupleTool.cxx:478
InDet::DetailedIDNtupleTool::m_truth_qoverp
double m_truth_qoverp
Definition: DetailedIDNtupleTool.h:131
InDet::DetailedIDNtupleTool::m_evtNumber
int m_evtNumber
Definition: DetailedIDNtupleTool.h:98
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
InDet::DetailedIDNtupleTool::m_trackCollection
std::string m_trackCollection
Definition: DetailedIDNtupleTool.h:92
InDet::DetailedIDNtupleTool::m_original_theta
double m_original_theta
Definition: DetailedIDNtupleTool.h:109
AthAlgTool
Definition: AthAlgTool.h:26
InDet::DetailedIDNtupleTool::m_matchProbability
double m_matchProbability
the probabililty cut in the truth matching
Definition: DetailedIDNtupleTool.h:84
InDet::DetailedIDNtupleTool::m_trackSumTool
ToolHandle< Trk::ITrackSummaryTool > m_trackSumTool
Pointer to track summary tool.
Definition: DetailedIDNtupleTool.h:74
InDet::DetailedIDNtupleTool::m_original_toRef_qoverp
double m_original_toRef_qoverp
Definition: DetailedIDNtupleTool.h:143
InDet::DetailedIDNtupleTool::m_z0
double m_z0
Definition: DetailedIDNtupleTool.h:163
InDet::DetailedIDNtupleTool::m_tracksTruthName
std::string m_tracksTruthName
Definition: DetailedIDNtupleTool.h:93
InDet::DetailedIDNtupleTool::m_original_err_qoverp
double m_original_err_qoverp
Definition: DetailedIDNtupleTool.h:122
InDet::DetailedIDNtupleTool::m_toRef_theta
double m_toRef_theta
Definition: DetailedIDNtupleTool.h:149
InDet::DetailedIDNtupleTool::m_truth_d0
double m_truth_d0
Definition: DetailedIDNtupleTool.h:125
InDet::DetailedIDNtupleTool::m_toRef_qoverp
double m_toRef_qoverp
Definition: DetailedIDNtupleTool.h:150
AlignTrack
AlignTrack is a generalization of a Trk::Track, used as the basic object to contain track information...
InDet::DetailedIDNtupleTool::m_ndof
int m_ndof
Definition: DetailedIDNtupleTool.h:170
InDet::DetailedIDNtupleTool::setNtuple
void setNtuple(TFile *ntuple)
sets the output stream for the logfile
Definition: DetailedIDNtupleTool.h:65