ATLAS Offline Software
InDetPerfPlot_TrackParameters.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
12 
15 #include <cmath>
16 using namespace IDPVM;
17 
19  InDetPlotBase(pParent, sDir){
20  //nop
21  //variable initialised at declaration
22 }
23 
24 void
26 
27  book(m_reco_d0, "reco_d0");
28  book(m_reco_z0, "reco_z0");
29  book(m_reco_z0sin, "reco_z0sin");
30  book(m_reco_phi, "reco_phi");
31  book(m_reco_theta, "reco_theta");
32  book(m_reco_eta, "reco_eta");
33  book(m_reco_qoverp, "reco_qoverp");
34  book(m_reco_pt, "reco_pt");
35  book(m_reco_lowpt, "reco_lowpt");
36  book(m_reco_chi2, "reco_chi2");
37  book(m_reco_ndof, "reco_ndof");
38  book(m_reco_chi2Overndof, "reco_chi2Overndof");
39  book(m_reco_author, "reco_author");
40  book(m_reco_time, "reco_time");
41  book(m_reco_hasValidTime_eff_vs_eta, "reco_hasValidTime_eff_vs_eta");
42 
43  book(m_truth_d0, "truth_d0");
44  book(m_truth_z0, "truth_z0");
45  book(m_truth_z0sin, "truth_z0sin");
46  book(m_truth_phi, "truth_phi");
47  book(m_truth_theta, "truth_theta");
48  book(m_truth_eta, "truth_eta");
49  book(m_truth_qoverp, "truth_qoverp");
50  book(m_truth_pt, "truth_pt");
51  book(m_truth_lowpt, "truth_lowpt");
52  book(m_truth_prodR, "truth_prodR");
53  book(m_truth_prodZ, "truth_prodZ");
54 
55  book(m_reco_pt_vs_eta, "reco_pt_vs_eta");
56  book(m_reco_phi_vs_eta, "reco_phi_vs_eta");
57 
58  book(m_reco_d0_z0, "reco_d0_vs_z0");
59  book(m_reco_d0_z0sin, "reco_d0_vs_z0sin");
60 
61  book(m_truth_pt_vs_eta, "truth_pt_vs_eta");
62  book(m_truth_phi_vs_eta, "truth_phi_vs_eta");
63 
64  book(m_truth_hits, "truth_hits");
65  book(m_truth_hits_vs_eta, "truth_hits_vs_eta");
66 
67 }
68 
69 void
71 
72  // quantities with xAOD::TruthParticle accessors:
73  float eta = particle.eta();
74  float pt = particle.pt() / Gaudi::Units::GeV;
75  float phi = particle.phi();
76 
77  static const SG::ConstAccessor<float> d0Acc("d0");
78  static const SG::ConstAccessor<float> z0Acc("z0");
79  static const SG::ConstAccessor<float> thetaAcc("theta");
80  static const SG::ConstAccessor<float> qOverPAcc("qOverP");
81  static const SG::ConstAccessor<float> prodRAcc("prodR");
82  static const SG::ConstAccessor<float> prodZAcc("prodZ");
83  float d0 = d0Acc.isAvailable(particle) ? d0Acc(particle) : -9999.;
84  float z0 = z0Acc.isAvailable(particle) ? z0Acc(particle) : -9999.;
85  float theta = thetaAcc.isAvailable(particle) ? thetaAcc(particle) : -9999.;
86  float z0sin = (z0Acc.isAvailable(particle) && z0Acc(particle)) ? z0 * std::sin(theta) : -9999.;
87  float qOverP = qOverPAcc.isAvailable(particle) ? qOverPAcc(particle) : -9999.;
88  float prodR = prodRAcc.isAvailable(particle) ? prodRAcc(particle) : -9999.;
89  float prodZ = prodZAcc.isAvailable(particle) ? prodZAcc(particle) : -9999.;
90 
91  if(d0 > -9000.) fillHisto(m_truth_d0, d0, weight);
92  if(z0 > -9000.) fillHisto(m_truth_z0, z0, weight);
93  if(theta > -9000.) fillHisto(m_truth_theta, theta, weight);
94  if(phi > -9000.) fillHisto(m_truth_phi, phi, weight);
95  if(z0sin > -9000.) fillHisto(m_truth_z0sin, z0sin, weight);
97  if(prodR > -9000.) fillHisto(m_truth_prodR, prodR, weight);
98  if(prodZ > -9000.) fillHisto(m_truth_prodZ, prodZ, weight);
99 
103 
106 
107  static const SG::AuxElement::ConstAccessor< float > nSilHitsAcc("nSilHits");
108  if (nSilHitsAcc.isAvailable(particle)) {
109  float hits = nSilHitsAcc(particle);
112  }
113 }
114 
115 void
117 
118  float pt = particle.pt() / Gaudi::Units::GeV;
119  float eta = particle.eta();
120  float phi = particle.phi0();
121 
122  float chi2 = particle.chiSquared();
123  float ndof = particle.numberDoF();
124  float chi2Overndof = ndof > 0 ? chi2 / ndof : 0;
125 
126 
130 
137 
140 
143 
146  fillHisto(m_reco_chi2Overndof, chi2Overndof, weight);
147 
148  std::bitset<xAOD::TrackPatternRecoInfo::NumberOfTrackRecoInfo> patternInfo = particle.patternRecoInfo();
149  for(unsigned int i = 0; i < xAOD::TrackPatternRecoInfo::NumberOfTrackRecoInfo; i++){
150  if(patternInfo.test(i)) fillHisto(m_reco_author, i, weight);
151  }
152 
153  static const SG::Accessor< uint8_t > accValidTime("hasValidTime");
154  static const SG::Accessor< float > accTime("time");
155  if( accValidTime.isAvailable(particle) && accTime.isAvailable(particle) ) {
156  if (particle.hasValidTime()) {
158  }
159  }
160 
161  if( accValidTime.isAvailable(particle) ) {
163  }
164 
165 }
166 
167 void
169 
170  //
171  //Pie
172  //
173 
174 }
IDPVM
Class to retrieve associated truth from a track, implementing a cached response.
Definition: InDetPhysValMonitoringTool.h:55
IDTPM::ndof
float ndof(const U &p)
Definition: TrackParametersHelper.h:132
InDetPerfPlot_TrackParameters::m_reco_chi2
TH1 * m_reco_chi2
Definition: InDetPerfPlot_TrackParameters.h:39
InDetPerfPlot_TrackParameters.h
InDetPerfPlot_TrackParameters::m_reco_d0
TH1 * m_reco_d0
Definition: InDetPerfPlot_TrackParameters.h:30
GeV
#define GeV
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx:17
Trk::ParticleSwitcher::particle
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
Definition: ParticleHypothesis.h:76
InDetPerfPlot_TrackParameters::m_truth_qoverp
TH1 * m_truth_qoverp
Definition: InDetPerfPlot_TrackParameters.h:52
TRTCalib_Extractor.hits
hits
Definition: TRTCalib_Extractor.py:35
InDetPerfPlot_TrackParameters::m_reco_time
TH1 * m_reco_time
Definition: InDetPerfPlot_TrackParameters.h:43
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
InDetPerfPlot_TrackParameters::m_truth_hits_vs_eta
TH2 * m_truth_hits_vs_eta
Definition: InDetPerfPlot_TrackParameters.h:67
InDetPlotBase::book
void book(Htype *&pHisto, const std::string &histoIdentifier, const std::string &nameOverride="", const std::string &folder="default")
Helper method to book histograms using an identifier string.
SG::Accessor< uint8_t >
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
InDetPerfPlot_TrackParameters::m_truth_phi_vs_eta
TH2 * m_truth_phi_vs_eta
Definition: InDetPerfPlot_TrackParameters.h:65
InDetPerfPlot_TrackParameters::m_truth_z0sin
TH1 * m_truth_z0sin
Definition: InDetPerfPlot_TrackParameters.h:48
InDetPerfPlot_TrackParameters::m_reco_hasValidTime_eff_vs_eta
TEfficiency * m_reco_hasValidTime_eff_vs_eta
Definition: InDetPerfPlot_TrackParameters.h:44
python.copyTCTOutput.sDir
sDir
Definition: copyTCTOutput.py:60
InDetPerfPlot_TrackParameters::m_reco_d0_z0
TH2 * m_reco_d0_z0
Definition: InDetPerfPlot_TrackParameters.h:61
InDetPhysValMonitoringUtilities.h
theta
Scalar theta() const
theta method
Definition: AmgMatrixBasePlugin.h:75
InDetPerfPlot_TrackParameters::InDetPerfPlot_TrackParameters
InDetPerfPlot_TrackParameters(InDetPlotBase *pParent, const std::string &dirName)
Definition: InDetPerfPlot_TrackParameters.cxx:18
test_pyathena.pt
pt
Definition: test_pyathena.py:11
InDetPerfPlot_TrackParameters::m_truth_eta
TH1 * m_truth_eta
Definition: InDetPerfPlot_TrackParameters.h:51
SG::ConstAccessor< float >
InDetAccessor::qOverP
@ qOverP
perigee
Definition: InDetAccessor.h:35
InDetPerfPlot_TrackParameters::m_truth_theta
TH1 * m_truth_theta
Definition: InDetPerfPlot_TrackParameters.h:50
InDetPerfPlot_TrackParameters::m_reco_phi
TH1 * m_reco_phi
Definition: InDetPerfPlot_TrackParameters.h:33
InDetPerfPlot_TrackParameters::m_reco_d0_z0sin
TH2 * m_reco_d0_z0sin
Definition: InDetPerfPlot_TrackParameters.h:62
IDTPM::prodR
float prodR(const U &p)
Definition: TrackParametersHelper.h:91
InDetPerfPlot_TrackParameters::m_truth_pt
TH1 * m_truth_pt
Definition: InDetPerfPlot_TrackParameters.h:53
dqt_zlumi_pandas.weight
int weight
Definition: dqt_zlumi_pandas.py:189
InDetPerfPlot_TrackParameters::m_truth_z0
TH1 * m_truth_z0
Definition: InDetPerfPlot_TrackParameters.h:47
InDetPlotBase
Mixin class to give extra capabilities to plots such as ATH_MSG and an easier booking interface,...
Definition: InDetPlotBase.h:33
lumiFormat.i
int i
Definition: lumiFormat.py:85
xAOD::TruthParticle_v1
Class describing a truth particle in the MC record.
Definition: TruthParticle_v1.h:37
InDetPerfPlot_TrackParameters::m_reco_z0sin
TH1 * m_reco_z0sin
Definition: InDetPerfPlot_TrackParameters.h:32
InDetPerfPlot_TrackParameters::fill
void fill(const xAOD::TrackParticle &particle, float weight)
Definition: InDetPerfPlot_TrackParameters.cxx:116
chi2
double chi2(TH1 *h0, TH1 *h1)
Definition: comparitor.cxx:522
TRT::Track::d0
@ d0
Definition: InnerDetector/InDetCalibEvent/TRT_CalibData/TRT_CalibData/TrackInfo.h:62
InDetPerfPlot_TrackParameters::m_reco_theta
TH1 * m_reco_theta
Definition: InDetPerfPlot_TrackParameters.h:34
InDetPerfPlot_TrackParameters::initializePlots
void initializePlots()
Definition: InDetPerfPlot_TrackParameters.cxx:25
InDetPerfPlot_TrackParameters::m_truth_prodR
TH1 * m_truth_prodR
Definition: InDetPerfPlot_TrackParameters.h:55
TRT::Track::z0
@ z0
Definition: InnerDetector/InDetCalibEvent/TRT_CalibData/TRT_CalibData/TrackInfo.h:63
InDetPerfPlot_TrackParameters::m_reco_eta
TH1 * m_reco_eta
Definition: InDetPerfPlot_TrackParameters.h:35
InDetPerfPlot_TrackParameters::m_truth_d0
TH1 * m_truth_d0
Definition: InDetPerfPlot_TrackParameters.h:46
InDetPerfPlot_TrackParameters::m_reco_chi2Overndof
TH1 * m_reco_chi2Overndof
Definition: InDetPerfPlot_TrackParameters.h:41
InDetPerfPlot_TrackParameters::m_reco_pt_vs_eta
TH2 * m_reco_pt_vs_eta
Definition: InDetPerfPlot_TrackParameters.h:58
IDTPM::prodZ
float prodZ(const U &p)
Definition: TrackParametersHelper.h:100
InDetPerfPlot_TrackParameters::m_reco_z0
TH1 * m_reco_z0
Definition: InDetPerfPlot_TrackParameters.h:31
InDetPerfPlot_TrackParameters::finalizePlots
void finalizePlots()
Definition: InDetPerfPlot_TrackParameters.cxx:168
InDetPerfPlot_TrackParameters::m_truth_lowpt
TH1 * m_truth_lowpt
Definition: InDetPerfPlot_TrackParameters.h:54
InDetPerfPlot_TrackParameters::m_truth_hits
TH1 * m_truth_hits
Definition: InDetPerfPlot_TrackParameters.h:68
InDetPerfPlot_TrackParameters::m_reco_qoverp
TH1 * m_reco_qoverp
Definition: InDetPerfPlot_TrackParameters.h:36
xAOD::NumberOfTrackRecoInfo
@ NumberOfTrackRecoInfo
maximum number of enums
Definition: TrackingPrimitives.h:189
InDetPerfPlot_TrackParameters::m_reco_author
TH1 * m_reco_author
Definition: InDetPerfPlot_TrackParameters.h:42
InDetPerfPlot_TrackParameters::m_reco_pt
TH1 * m_reco_pt
Definition: InDetPerfPlot_TrackParameters.h:37
SG::ConstAccessor::isAvailable
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
InDetPerfPlot_TrackParameters::m_reco_lowpt
TH1 * m_reco_lowpt
Definition: InDetPerfPlot_TrackParameters.h:38
InDetPerfPlot_TrackParameters::m_truth_phi
TH1 * m_truth_phi
Definition: InDetPerfPlot_TrackParameters.h:49
InDetPerfPlot_TrackParameters::m_reco_phi_vs_eta
TH2 * m_reco_phi_vs_eta
Definition: InDetPerfPlot_TrackParameters.h:59
InDetPerfPlot_TrackParameters::m_reco_ndof
TH1 * m_reco_ndof
Definition: InDetPerfPlot_TrackParameters.h:40
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:43
ConstAccessor.h
Helper class to provide constant type-safe access to aux data.
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
InDetPerfPlot_TrackParameters::m_truth_prodZ
TH1 * m_truth_prodZ
Definition: InDetPerfPlot_TrackParameters.h:56
InDetPerfPlot_TrackParameters::m_truth_pt_vs_eta
TH2 * m_truth_pt_vs_eta
Definition: InDetPerfPlot_TrackParameters.h:64
InDetPlotBase::fillHisto
static void fillHisto(TProfile *pTprofile, const float bin, const float weight, const float weight2=1.0)
Definition: InDetPlotBase.cxx:82