Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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), m_isITk{isITk}{
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  if(m_isITk){
41  book(m_reco_time, "reco_time");
42  book(m_reco_hasValidTime_eff_vs_eta, "reco_hasValidTime_eff_vs_eta");
43  }
44 
45  book(m_truth_d0, "truth_d0");
46  book(m_truth_z0, "truth_z0");
47  book(m_truth_z0sin, "truth_z0sin");
48  book(m_truth_phi, "truth_phi");
49  book(m_truth_theta, "truth_theta");
50  book(m_truth_eta, "truth_eta");
51  book(m_truth_qoverp, "truth_qoverp");
52  book(m_truth_pt, "truth_pt");
53  book(m_truth_lowpt, "truth_lowpt");
54  book(m_truth_prodR, "truth_prodR");
55  book(m_truth_prodZ, "truth_prodZ");
56 
57  book(m_reco_pt_vs_eta, "reco_pt_vs_eta");
58  book(m_reco_phi_vs_eta, "reco_phi_vs_eta");
59 
60  book(m_reco_d0_z0, "reco_d0_vs_z0");
61  book(m_reco_d0_z0sin, "reco_d0_vs_z0sin");
62 
63  book(m_truth_pt_vs_eta, "truth_pt_vs_eta");
64  book(m_truth_phi_vs_eta, "truth_phi_vs_eta");
65 
66  book(m_truth_hits, "truth_hits");
67  book(m_truth_hits_vs_eta, "truth_hits_vs_eta");
68 
69 }
70 
71 void
73 
74  // quantities with xAOD::TruthParticle accessors:
75  float eta = particle.eta();
76  float pt = particle.pt() / Gaudi::Units::GeV;
77  float phi = particle.phi();
78 
79  static const SG::ConstAccessor<float> d0Acc("d0");
80  static const SG::ConstAccessor<float> z0Acc("z0");
81  static const SG::ConstAccessor<float> thetaAcc("theta");
82  static const SG::ConstAccessor<float> qOverPAcc("qOverP");
83  static const SG::ConstAccessor<float> prodRAcc("prodR");
84  static const SG::ConstAccessor<float> prodZAcc("prodZ");
85  float d0 = d0Acc.isAvailable(particle) ? d0Acc(particle) : -9999.;
86  float z0 = z0Acc.isAvailable(particle) ? z0Acc(particle) : -9999.;
87  float theta = thetaAcc.isAvailable(particle) ? thetaAcc(particle) : -9999.;
88  float z0sin = (z0Acc.isAvailable(particle) && z0Acc(particle)) ? z0 * std::sin(theta) : -9999.;
89  float qOverP = qOverPAcc.isAvailable(particle) ? qOverPAcc(particle) : -9999.;
90  float prodR = prodRAcc.isAvailable(particle) ? prodRAcc(particle) : -9999.;
91  float prodZ = prodZAcc.isAvailable(particle) ? prodZAcc(particle) : -9999.;
92 
93  if(d0 > -9000.) fillHisto(m_truth_d0, d0, weight);
94  if(z0 > -9000.) fillHisto(m_truth_z0, z0, weight);
95  if(theta > -9000.) fillHisto(m_truth_theta, theta, weight);
96  if(phi > -9000.) fillHisto(m_truth_phi, phi, weight);
97  if(z0sin > -9000.) fillHisto(m_truth_z0sin, z0sin, weight);
99  if(prodR > -9000.) fillHisto(m_truth_prodR, prodR, weight);
100  if(prodZ > -9000.) fillHisto(m_truth_prodZ, prodZ, weight);
101 
105 
108 
109  static const SG::AuxElement::ConstAccessor< float > nSilHitsAcc("nSilHits");
110  if (nSilHitsAcc.isAvailable(particle)) {
111  float hits = nSilHitsAcc(particle);
114  }
115 }
116 
117 void
119 
120  float pt = particle.pt() / Gaudi::Units::GeV;
121  float eta = particle.eta();
122  float phi = particle.phi0();
123 
124  float chi2 = particle.chiSquared();
125  float ndof = particle.numberDoF();
126  float chi2Overndof = ndof > 0 ? chi2 / ndof : 0;
127 
128 
132 
139 
142 
145 
148  fillHisto(m_reco_chi2Overndof, chi2Overndof, weight);
149 
150  std::bitset<xAOD::TrackPatternRecoInfo::NumberOfTrackRecoInfo> patternInfo = particle.patternRecoInfo();
151  for(unsigned int i = 0; i < xAOD::TrackPatternRecoInfo::NumberOfTrackRecoInfo; i++){
152  if(patternInfo.test(i)) fillHisto(m_reco_author, i, weight);
153  }
154 
155  if(m_isITk){
156  static const SG::Accessor< uint8_t > accValidTime("hasValidTime");
157  static const SG::Accessor< float > accTime("time");
158  if( accValidTime.isAvailable(particle) && accTime.isAvailable(particle) ) {
159  if (particle.hasValidTime()) {
161  }
162  }
163 
164  if( accValidTime.isAvailable(particle) ) {
166  }
167  }
168 
169 }
170 
171 void
173 
174  //
175  //Pie
176  //
177 
178 }
IDPVM
Class to retrieve associated truth from a track, implementing a cached response.
Definition: InDetPhysValMonitoringTool.h:56
IDTPM::ndof
float ndof(const U &p)
Definition: TrackParametersHelper.h:134
InDetPerfPlot_TrackParameters::m_reco_chi2
TH1 * m_reco_chi2
Definition: InDetPerfPlot_TrackParameters.h:40
InDetPerfPlot_TrackParameters.h
InDetPerfPlot_TrackParameters::m_reco_d0
TH1 * m_reco_d0
Definition: InDetPerfPlot_TrackParameters.h:31
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:53
TRTCalib_Extractor.hits
hits
Definition: TRTCalib_Extractor.py:35
InDetPerfPlot_TrackParameters::m_reco_time
TH1 * m_reco_time
Definition: InDetPerfPlot_TrackParameters.h:44
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:68
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:66
InDetPerfPlot_TrackParameters::m_truth_z0sin
TH1 * m_truth_z0sin
Definition: InDetPerfPlot_TrackParameters.h:49
InDetPerfPlot_TrackParameters::m_reco_hasValidTime_eff_vs_eta
TEfficiency * m_reco_hasValidTime_eff_vs_eta
Definition: InDetPerfPlot_TrackParameters.h:45
python.copyTCTOutput.sDir
sDir
Definition: copyTCTOutput.py:60
InDetPerfPlot_TrackParameters::m_reco_d0_z0
TH2 * m_reco_d0_z0
Definition: InDetPerfPlot_TrackParameters.h:62
InDetPhysValMonitoringUtilities.h
theta
Scalar theta() const
theta method
Definition: AmgMatrixBasePlugin.h:75
InDetPerfPlot_TrackParameters::m_isITk
bool m_isITk
Definition: InDetPerfPlot_TrackParameters.h:29
test_pyathena.pt
pt
Definition: test_pyathena.py:11
InDetPerfPlot_TrackParameters::m_truth_eta
TH1 * m_truth_eta
Definition: InDetPerfPlot_TrackParameters.h:52
SG::ConstAccessor< float >
InDetAccessor::qOverP
@ qOverP
perigee
Definition: InDetAccessor.h:35
InDetPerfPlot_TrackParameters::m_truth_theta
TH1 * m_truth_theta
Definition: InDetPerfPlot_TrackParameters.h:51
InDetPerfPlot_TrackParameters::m_reco_phi
TH1 * m_reco_phi
Definition: InDetPerfPlot_TrackParameters.h:34
InDetPerfPlot_TrackParameters::m_reco_d0_z0sin
TH2 * m_reco_d0_z0sin
Definition: InDetPerfPlot_TrackParameters.h:63
IDTPM::prodR
float prodR(const U &p)
Definition: TrackParametersHelper.h:93
InDetPerfPlot_TrackParameters::m_truth_pt
TH1 * m_truth_pt
Definition: InDetPerfPlot_TrackParameters.h:54
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:48
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:33
InDetPerfPlot_TrackParameters::fill
void fill(const xAOD::TrackParticle &particle, float weight)
Definition: InDetPerfPlot_TrackParameters.cxx:118
chi2
double chi2(TH1 *h0, TH1 *h1)
Definition: comparitor.cxx:525
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:35
InDetPerfPlot_TrackParameters::initializePlots
void initializePlots()
Definition: InDetPerfPlot_TrackParameters.cxx:25
InDetPerfPlot_TrackParameters::m_truth_prodR
TH1 * m_truth_prodR
Definition: InDetPerfPlot_TrackParameters.h:56
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:36
InDetPerfPlot_TrackParameters::m_truth_d0
TH1 * m_truth_d0
Definition: InDetPerfPlot_TrackParameters.h:47
InDetPerfPlot_TrackParameters::m_reco_chi2Overndof
TH1 * m_reco_chi2Overndof
Definition: InDetPerfPlot_TrackParameters.h:42
InDetPerfPlot_TrackParameters::m_reco_pt_vs_eta
TH2 * m_reco_pt_vs_eta
Definition: InDetPerfPlot_TrackParameters.h:59
IDTPM::prodZ
float prodZ(const U &p)
Definition: TrackParametersHelper.h:102
InDetPerfPlot_TrackParameters::m_reco_z0
TH1 * m_reco_z0
Definition: InDetPerfPlot_TrackParameters.h:32
InDetPerfPlot_TrackParameters::finalizePlots
void finalizePlots()
Definition: InDetPerfPlot_TrackParameters.cxx:172
InDetPerfPlot_TrackParameters::m_truth_lowpt
TH1 * m_truth_lowpt
Definition: InDetPerfPlot_TrackParameters.h:55
InDetPerfPlot_TrackParameters::m_truth_hits
TH1 * m_truth_hits
Definition: InDetPerfPlot_TrackParameters.h:69
InDetPerfPlot_TrackParameters::m_reco_qoverp
TH1 * m_reco_qoverp
Definition: InDetPerfPlot_TrackParameters.h:37
xAOD::NumberOfTrackRecoInfo
@ NumberOfTrackRecoInfo
maximum number of enums
Definition: TrackingPrimitives.h:190
InDetPerfPlot_TrackParameters::m_reco_author
TH1 * m_reco_author
Definition: InDetPerfPlot_TrackParameters.h:43
InDetPerfPlot_TrackParameters::m_reco_pt
TH1 * m_reco_pt
Definition: InDetPerfPlot_TrackParameters.h:38
InDetPerfPlot_TrackParameters::InDetPerfPlot_TrackParameters
InDetPerfPlot_TrackParameters(InDetPlotBase *pParent, const std::string &dirName, bool isITk)
Definition: InDetPerfPlot_TrackParameters.cxx:18
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:39
InDetPerfPlot_TrackParameters::m_truth_phi
TH1 * m_truth_phi
Definition: InDetPerfPlot_TrackParameters.h:50
InDetPerfPlot_TrackParameters::m_reco_phi_vs_eta
TH2 * m_reco_phi_vs_eta
Definition: InDetPerfPlot_TrackParameters.h:60
InDetPerfPlot_TrackParameters::m_reco_ndof
TH1 * m_reco_ndof
Definition: InDetPerfPlot_TrackParameters.h:41
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:57
InDetPerfPlot_TrackParameters::m_truth_pt_vs_eta
TH2 * m_truth_pt_vs_eta
Definition: InDetPerfPlot_TrackParameters.h:65
InDetPlotBase::fillHisto
static void fillHisto(TProfile *pTprofile, const float bin, const float weight, const float weight2=1.0)
Definition: InDetPlotBase.cxx:82