ATLAS Offline Software
BasicValTrkParticleNtupleTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef Trk_BasicValTrkParticleNtupleTool_h
6 #define Trk_BasicValTrkParticleNtupleTool_h
7 
8 
10 #include "GaudiKernel/ToolHandle.h"
14 #include <vector>
15 
16 class TTree;
17 
18 namespace Trk {
19 class TrackSummary;
20 class TrackParticleBase;
21 
40 public:
41  // standard AlgToolmethods
42  BasicValTrkParticleNtupleTool(const std::string&,const std::string&,const IInterface*);
44 
45  // standard Athena methods
48 
52  virtual StatusCode addNtupleItems (
53  TTree* tree );
54 
56  virtual StatusCode writeTrackData (
57  const Trk::Track&,
58  const int iterationIndex,
59  const unsigned int fitStatCode );
60 
63  const Trk::TrackParticleBase& );
64 
67  virtual StatusCode fillTrackData (
68  const Trk::Track&,
69  const int iterationIndex,
70  const unsigned int fitStatCode );
71 
75  const Trk::TrackParticleBase&);
76 
80  const Trk::TrackParameters*,
81  const int iterationIndex );
82 
85  const Trk::MeasurementBase*,
86  const Trk::TrackParameters* );
87 
91  virtual StatusCode fillOutlierData (
92  const Trk::MeasurementBase*,
93  const Trk::TrackParameters*,
94  const Trk::FitQualityOnSurface* );
95 
97  virtual StatusCode fillHoleData (
99 
102  const TrackTruth&,
103  const int truthIndex = -1 );
104 
106  virtual StatusCode writeRecord( TTree* tree );
107 private:
111  void resetVariables();
112 
113  // jobOptions
115  std::string m_ntupleFileName;
116  std::string m_ntupleDirName;
117  std::string m_ntupleTreeName;
118 
119  TTree* m_nt;
120 
122  unsigned int m_lastEventNumber;
123 
124  // --- ntuple variables, doxygen comments are also basis for wiki texts ---
127  unsigned char m_TrackID;
128 
129  //---- extraction from Track Perigee -----
130  float m_Rec_d0;
131  float m_Rec_z0;
132  float m_Rec_phi0;
133  float m_Rec_eta;
134  float m_Rec_qOverP;
135 
136  float m_errord0;
137  float m_errorz0;
138  float m_errorphi0;
141 
142  //---- extraction from Fit Quality -----
143  float m_chi2;
144 
145  //---- extraction from TrackSummary -----
146  unsigned char m_numberOfPixelHits;
148  unsigned char m_numberOfPixelHoles;
150  unsigned char m_numberOfSCTHits;
151  unsigned char m_numberOfSCTHoles;
152  unsigned char m_numberOfSCTDeadSensors;
153  unsigned char m_numberOfTRTHits;
154  unsigned char m_numberOfTRTHoles;
155  unsigned char m_numberOfTRTDeadStraws;
157 
158  unsigned long m_idHitPattern;
159 
160  static const float s_errorEntry;
161 
162  SG::ReadHandleKey<xAOD::EventInfo> m_evt {this, "EvtInfo", "EventInfo", "EventInfo name"};
163 };
164 
165 
166 } // end of namespace Trk
167 
168 #endif // BasicsValTrkParticleNtupleTool_h
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
Trk::BasicValTrkParticleNtupleTool::m_chi2
float m_chi2
chi sqared of the track fit normalized to DOF
Definition: BasicValTrkParticleNtupleTool.h:143
Trk::BasicValTrkParticleNtupleTool::writeRecord
virtual StatusCode writeRecord(TTree *tree)
write the filled data into the ntuple
Definition: BasicValTrkParticleNtupleTool.cxx:329
Trk::BasicValTrkParticleNtupleTool::m_TrackID
unsigned char m_TrackID
number of the track within the current event
Definition: BasicValTrkParticleNtupleTool.h:127
Trk::BasicValTrkParticleNtupleTool::writeTrackParticleData
virtual StatusCode writeTrackParticleData(const Trk::TrackParticleBase &)
fill AND write ntuple data of a given track particle
Definition: BasicValTrkParticleNtupleTool.cxx:171
Trk::BasicValTrkParticleNtupleTool::m_errortheta0
float m_errortheta0
error on angle theta at perigee UNIT:rad
Definition: BasicValTrkParticleNtupleTool.h:139
Trk::BasicValTrkParticleNtupleTool::m_numberOfSCTHoles
unsigned char m_numberOfSCTHoles
number of SCT holes
Definition: BasicValTrkParticleNtupleTool.h:151
Trk::BasicValTrkParticleNtupleTool::s_errorEntry
static const float s_errorEntry
error entry costant
Definition: BasicValTrkParticleNtupleTool.h:160
Trk::BasicValTrkParticleNtupleTool::m_numberOfPixelDeadSensors
unsigned char m_numberOfPixelDeadSensors
number of dead pixel sensors crossed
Definition: BasicValTrkParticleNtupleTool.h:149
Trk::BasicValTrkParticleNtupleTool::~BasicValTrkParticleNtupleTool
~BasicValTrkParticleNtupleTool()
Trk::BasicValTrkParticleNtupleTool::fillMeasurementData
virtual StatusCode fillMeasurementData(const Trk::MeasurementBase *, const Trk::TrackParameters *)
fill ntuple data of given measurement and track parameters without writing the record
Definition: BasicValTrkParticleNtupleTool.cxx:371
Trk::BasicValTrkParticleNtupleTool::resetVariables
void resetVariables()
Definition: BasicValTrkParticleNtupleTool.cxx:337
Trk::Track
The ATLAS Track class.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:73
IValidationNtupleTool.h
Trk::BasicValTrkParticleNtupleTool::m_Rec_qOverP
float m_Rec_qOverP
reconstructed track params: curvature q/p UNIT:1/MeV
Definition: BasicValTrkParticleNtupleTool.h:134
Trk::BasicValTrkParticleNtupleTool::m_eventNumber
int m_eventNumber
event number the track belongs to
Definition: BasicValTrkParticleNtupleTool.h:126
Trk::BasicValTrkParticleNtupleTool::m_errorphi0
float m_errorphi0
error on angle phi at perigee UNIT:rad
Definition: BasicValTrkParticleNtupleTool.h:138
Trk::BasicValTrkParticleNtupleTool::fillTrackParameter
virtual StatusCode fillTrackParameter(const Trk::TrackParameters *, const int iterationIndex)
fill ntuple data of a given track without writing the record.
Definition: BasicValTrkParticleNtupleTool.cxx:366
Trk::ParametersT
Dummy class used to allow special convertors to be called for surfaces owned by a detector element.
Definition: EMErrorDetail.h:25
Trk::BasicValTrkParticleNtupleTool::m_numberOfPixelHoles
unsigned char m_numberOfPixelHoles
number of pixel layers on track with absence of hits
Definition: BasicValTrkParticleNtupleTool.h:148
tree
TChain * tree
Definition: tile_monitor.h:30
Trk::BasicValTrkParticleNtupleTool::fillTrkParticleSummary
StatusCode fillTrkParticleSummary(const Trk::TrackSummary *summary)
fill the perigee in ntuple
Definition: BasicValTrkParticleNtupleTool.cxx:274
Trk::BasicValTrkParticleNtupleTool::m_numberOfSCTHits
unsigned char m_numberOfSCTHits
number of measurements in the SCT
Definition: BasicValTrkParticleNtupleTool.h:150
Trk::BasicValTrkParticleNtupleTool::finalize
StatusCode finalize()
finalize
Definition: BasicValTrkParticleNtupleTool.cxx:112
Trk::BasicValTrkParticleNtupleTool::fillHoleData
virtual StatusCode fillHoleData(const Trk::TrackStateOnSurface &)
fill ntuple data of holes on track without writing the record
Definition: BasicValTrkParticleNtupleTool.cxx:382
Trk::BasicValTrkParticleNtupleTool::m_numberOfTRTHits
unsigned char m_numberOfTRTHits
number of TRT hits
Definition: BasicValTrkParticleNtupleTool.h:153
SG::ReadHandleKey< xAOD::EventInfo >
Trk::BasicValTrkParticleNtupleTool::m_runNumber
int m_runNumber
run number the track belongs to
Definition: BasicValTrkParticleNtupleTool.h:125
Trk::BasicValTrkParticleNtupleTool::m_errord0
float m_errord0
error on local d0 at perigee UNIT:mm
Definition: BasicValTrkParticleNtupleTool.h:136
Trk::TrackParticleBase
Definition: TrackParticleBase.h:41
Trk::FitQualityOnSurface
Definition: FitQualityOnSurface.h:19
Trk::BasicValTrkParticleNtupleTool::BasicValTrkParticleNtupleTool
BasicValTrkParticleNtupleTool(const std::string &, const std::string &, const IInterface *)
Definition: BasicValTrkParticleNtupleTool.cxx:27
Trk::BasicValTrkParticleNtupleTool::m_numberOfSCTDeadSensors
unsigned char m_numberOfSCTDeadSensors
number of dead SCT sensors crossed
Definition: BasicValTrkParticleNtupleTool.h:152
Trk::BasicValTrkParticleNtupleTool::m_numberOfTRTDeadStraws
unsigned char m_numberOfTRTDeadStraws
number of dead TRT straws crossed
Definition: BasicValTrkParticleNtupleTool.h:155
Trk::BasicValTrkParticleNtupleTool::fillTrackTruthData
virtual StatusCode fillTrackTruthData(const TrackParameters *&, const TrackTruth &, const int truthIndex=-1)
fill ntuple data of holes on track without writing the record
Definition: BasicValTrkParticleNtupleTool.cxx:386
Trk::BasicValTrkParticleNtupleTool::m_TrackIDcounter
int m_TrackIDcounter
help variable to link with event property tree
Definition: BasicValTrkParticleNtupleTool.h:121
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
Trk::BasicValTrkParticleNtupleTool::m_Rec_d0
float m_Rec_d0
reconstructed track params: local d0 at perigee UNIT:mm
Definition: BasicValTrkParticleNtupleTool.h:130
Trk::BasicValTrkParticleNtupleTool::m_ntupleDirName
std::string m_ntupleDirName
jobOption: Ntuple directory name
Definition: BasicValTrkParticleNtupleTool.h:116
Trk::BasicValTrkParticleNtupleTool::m_evt
SG::ReadHandleKey< xAOD::EventInfo > m_evt
Definition: BasicValTrkParticleNtupleTool.h:162
AthAlgTool.h
Trk::BasicValTrkParticleNtupleTool
This validation tool writes basic information about Trk::TrackParticleBase into an ntuple;.
Definition: BasicValTrkParticleNtupleTool.h:39
Trk::BasicValTrkParticleNtupleTool::m_ntupleFileName
std::string m_ntupleFileName
jobOption: Ntuple file name
Definition: BasicValTrkParticleNtupleTool.h:115
Trk::FitQuality
Class to represent and store fit qualities from track reconstruction in terms of and number of degre...
Definition: FitQuality.h:97
Trk::ParametersBase
Definition: ParametersBase.h:55
Trk::BasicValTrkParticleNtupleTool::m_numberOfPixelHits
unsigned char m_numberOfPixelHits
number of measurements in the Pixels
Definition: BasicValTrkParticleNtupleTool.h:146
Trk::BasicValTrkParticleNtupleTool::m_Rec_eta
float m_Rec_eta
reconstructed track params: pseudorapidity UNIT:1
Definition: BasicValTrkParticleNtupleTool.h:133
Trk::BasicValTrkParticleNtupleTool::m_Rec_phi0
float m_Rec_phi0
reconstructed track params: angle phi at perigee UNIT:rad
Definition: BasicValTrkParticleNtupleTool.h:132
Trk::BasicValTrkParticleNtupleTool::m_lastEventNumber
unsigned int m_lastEventNumber
help variable to link with event property tree
Definition: BasicValTrkParticleNtupleTool.h:122
Trk::BasicValTrkParticleNtupleTool::fillTrackData
virtual StatusCode fillTrackData(const Trk::Track &, const int iterationIndex, const unsigned int fitStatCode)
fill ntuple data of a given track without writing the record.
Definition: BasicValTrkParticleNtupleTool.cxx:359
Trk::MeasurementBase
Definition: MeasurementBase.h:58
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
Trk::BasicValTrkParticleNtupleTool::m_idHitPattern
unsigned long m_idHitPattern
bit word carrying information about hit layers
Definition: BasicValTrkParticleNtupleTool.h:158
Trk::BasicValTrkParticleNtupleTool::m_numberOfContribPixelLayers
unsigned char m_numberOfContribPixelLayers
number of contributing layers of the pixel detector
Definition: BasicValTrkParticleNtupleTool.h:147
Trk::BasicValTrkParticleNtupleTool::m_errorqoverp
float m_errorqoverp
error on curvature q/p UNIT:1/MeV
Definition: BasicValTrkParticleNtupleTool.h:140
Trk::TrackStateOnSurface
represents the track state (measurement, material, fit parameters and quality) at a surface.
Definition: TrackStateOnSurface.h:71
Trk::BasicValTrkParticleNtupleTool::m_numberOfTRTHighThresholdHits
unsigned char m_numberOfTRTHighThresholdHits
number of TRT hits which pass the high threshold
Definition: BasicValTrkParticleNtupleTool.h:156
Trk::TrackSummary
A summary of the information contained by a track.
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:287
EventInfo.h
Trk::IValidationNtupleTool
Definition: IValidationNtupleTool.h:41
Trk::GsfMeasurementUpdator::fitQuality
FitQualityOnSurface fitQuality(const MultiComponentState &, const MeasurementBase &)
Method for determining the chi2 of the multi-component state and the number of degrees of freedom.
Definition: GsfMeasurementUpdator.cxx:845
Trk::BasicValTrkParticleNtupleTool::fillOutlierData
virtual StatusCode fillOutlierData(const Trk::MeasurementBase *, const Trk::TrackParameters *, const Trk::FitQualityOnSurface *)
fill ntuple data of an outlier measurement (without writing the record yet).
Definition: BasicValTrkParticleNtupleTool.cxx:376
TrackTruth
MC particle associated with a reco track + the quality of match.
Definition: TrackTruth.h:14
Trk::BasicValTrkParticleNtupleTool::m_ntupleTreeName
std::string m_ntupleTreeName
jobOption: Ntuple tree name
Definition: BasicValTrkParticleNtupleTool.h:117
Trk::BasicValTrkParticleNtupleTool::addNtupleItems
virtual StatusCode addNtupleItems(TTree *tree)
add branches to the tree Should be called once (per track collection and tree) dunring the initialisa...
Definition: BasicValTrkParticleNtupleTool.cxx:123
Trk::BasicValTrkParticleNtupleTool::m_numberOfTRTHoles
unsigned char m_numberOfTRTHoles
number of TRT holes
Definition: BasicValTrkParticleNtupleTool.h:154
Trk::BasicValTrkParticleNtupleTool::m_errorz0
float m_errorz0
error on local z0 at perigee UNIT:mm
Definition: BasicValTrkParticleNtupleTool.h:137
Trk::BasicValTrkParticleNtupleTool::fillFitQualityData
StatusCode fillFitQualityData(const Trk::FitQuality *fitQuality)
Definition: BasicValTrkParticleNtupleTool.cxx:311
Trk::BasicValTrkParticleNtupleTool::m_Rec_z0
float m_Rec_z0
reconstructed track params: local z0 at perigee UNIT:mm
Definition: BasicValTrkParticleNtupleTool.h:131
Trk::BasicValTrkParticleNtupleTool::m_bookNewNtuple
bool m_bookNewNtuple
jobOption: book new ntuple?
Definition: BasicValTrkParticleNtupleTool.h:114
Trk::BasicValTrkParticleNtupleTool::fillTrkParticlePerigee
StatusCode fillTrkParticlePerigee(const Trk::Perigee *perigee)
fill the perigee in ntuple
Definition: BasicValTrkParticleNtupleTool.cxx:233
Trk::BasicValTrkParticleNtupleTool::m_nt
TTree * m_nt
Pointer to the NTuple tree.
Definition: BasicValTrkParticleNtupleTool.h:119
AthAlgTool
Definition: AthAlgTool.h:26
xAOD::TrackSummary
TrackSummary_v1 TrackSummary
Definition: Event/xAOD/xAODTracking/xAODTracking/TrackSummary.h:10
Trk::BasicValTrkParticleNtupleTool::writeTrackData
virtual StatusCode writeTrackData(const Trk::Track &, const int iterationIndex, const unsigned int fitStatCode)
fill AND write ntuple data of a given track
Definition: BasicValTrkParticleNtupleTool.cxx:352
Trk::BasicValTrkParticleNtupleTool::fillTrackParticleData
virtual StatusCode fillTrackParticleData(const Trk::TrackParticleBase &)
fill ntuple data of a given track particle without writing the record.
Definition: BasicValTrkParticleNtupleTool.cxx:190
Trk::BasicValTrkParticleNtupleTool::initialize
StatusCode initialize()
Definition: BasicValTrkParticleNtupleTool.cxx:81
SCT_Monitoring::summary
@ summary
Definition: SCT_MonitoringNumbers.h:65