Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
InDetPerfPlot_Vertex.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 
10 #include "InDetPerfPlot_Vertex.h"
13 #include "xAODTracking/Vertex.h"
19 
20 
21 using namespace IDPVM;
22 
23 
24 InDetPerfPlot_Vertex::InDetPerfPlot_Vertex(InDetPlotBase* pParent, const std::string& sDir, bool isITk) :
25  InDetPlotBase(pParent, sDir), m_isITk(isITk) {
26  // nop
27 }
28 
29 void
31  book(m_vx_x,"vx_x");
32  book(m_vx_y,"vx_y");
33  book(m_vx_z,"vx_z");
34  if(m_isITk) book(m_vx_time,"vx_time");
35 
36  book(m_vx_err_x,"vx_err_x");
37  book(m_vx_err_y,"vx_err_y");
38  book(m_vx_err_z,"vx_err_z");
39  if(m_isITk) book(m_vx_err_time,"vx_err_time");
40 
41  book(m_vx_chi2_over_ndf,"vx_chi2_over_ndf");
42  book(m_vx_type,"vx_type");
43 
44  book(m_vx_nTracks,"vx_nTracks");
45  book(m_vx_track_weights,"vx_track_weights");
46 
47 
48 
49  if (m_iDetailLevel >= 100) {
50  book(m_vx_track_pt,"vx_track_pt");
51  book(m_vx_track_eta,"vx_track_eta");
52  book(m_vx_track_nSiHits,"vx_track_nSiHits");
53  book(m_vx_track_nSiHoles,"vx_track_nSiHoles");
54  book(m_vx_track_d0,"vx_track_d0");
55  book(m_vx_track_err_d0,"vx_track_err_d0");
56  book(m_vx_track_z0,"vx_track_z0");
57  book(m_vx_track_err_z0,"vx_track_err_z0");
58  }
59 }
60 
61 void
63  // fill position plots
67 
68  // fill error plots
69  const AmgSymMatrix(3)& covariance = vertex.covariancePosition();
70  fillHisto(m_vx_err_x, Amg::error(covariance, 0), weight);
71  fillHisto(m_vx_err_y, Amg::error(covariance, 1), weight);
72  fillHisto(m_vx_err_z, Amg::error(covariance, 2), weight);
73 
74  if(m_isITk){
75  static const SG::AuxElement::Accessor<uint8_t> accHasValidTime("hasValidTime");
76  static const SG::AuxElement::Accessor<float> accTime("time");
77  if (accHasValidTime.isAvailable(vertex) && accTime.isAvailable(vertex)) {
78  if (vertex.hasValidTime()) {
79  fillHisto(m_vx_time, vertex.time(), weight);
80  }
81  }
82 
83  static const SG::AuxElement::Accessor<float> accTimeResolution("timeResolution");
84  if (accHasValidTime.isAvailable(vertex) && accTimeResolution.isAvailable(vertex)) {
85  if (vertex.hasValidTime()) {
86  fillHisto(m_vx_err_time, vertex.timeResolution(), weight);
87  }
88  }
89  }
90 
91  // fill vertex quality and type
92  fillHisto(m_vx_type, vertex.vertexType(), weight);
93 
94  float ndf = vertex.numberDoF();
95  if (ndf != 0) {
96  fillHisto(m_vx_chi2_over_ndf, vertex.chiSquared() / ndf, weight);
97  } else {
99  }
100 
101  // fill vertex tracks properties
102  int nTracks = vertex.nTrackParticles();
103  fillHisto(m_vx_nTracks, nTracks, weight);
104  for (const float& trackWeight : vertex.trackWeights()) {
105  fillHisto(m_vx_track_weights, trackWeight, weight);
106  }
107 
108  // fill expert plots: tracks properties at vertex
109  if (m_iDetailLevel >= 100) {
110  // loop over tracks at vertex
111  for (const auto& elTrk : vertex.trackParticleLinks()) {
115  if (!elTrk.isValid()){
118  std::cerr << "Invalid track link on vertex. Vertex track plots will be unreliable. Please check your input format. "<<std::endl;
119  continue;
120  }
121  const xAOD::TrackParticle* trk = *elTrk;
122  fillHisto(m_vx_track_pt, trk->pt() / Gaudi::Units::GeV, weight); // MeV -> GeV
124  const xAOD::ParametersCovMatrix_t covTrk = trk->definingParametersCovMatrix();
125  fillHisto(m_vx_track_d0, trk->d0(), weight);
127  fillHisto(m_vx_track_z0, trk->z0() - vertex.z(), weight);
129  bool successfulRetrieval(false);
130  uint8_t iPixHits, iSctHits, iPixHoles, iSctHoles;
131  successfulRetrieval = trk->summaryValue(iPixHits, xAOD::numberOfPixelHits);
132  successfulRetrieval &= trk->summaryValue(iSctHits, xAOD::numberOfSCTHits);
133  if (successfulRetrieval) {
134  fillHisto(m_vx_track_nSiHits, iPixHits + iSctHits, weight);
135  }
136  successfulRetrieval = trk->summaryValue(iPixHoles, xAOD::numberOfPixelHoles);
137  successfulRetrieval &= trk->summaryValue(iSctHoles, xAOD::numberOfSCTHoles);
138  if (successfulRetrieval) {
139  fillHisto(m_vx_track_nSiHoles, iPixHoles + iSctHoles, weight);
140  }
141  }
142  }
143 }
IDPVM
Class to retrieve associated truth from a track, implementing a cached response.
Definition: InDetPhysValMonitoringTool.h:56
covarianceTool.ndf
ndf
Definition: covarianceTool.py:678
xAOD::TrackParticle_v1::pt
virtual double pt() const override final
The transverse momentum ( ) of the particle.
Definition: TrackParticle_v1.cxx:73
xAOD::numberOfPixelHoles
@ numberOfPixelHoles
number of pixel layers on track with absence of hits [unit8_t].
Definition: TrackingPrimitives.h:262
PlotBase::m_iDetailLevel
int m_iDetailLevel
Definition: PlotBase.h:101
GeV
#define GeV
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx:17
InDetPerfPlot_Vertex::m_vx_track_nSiHoles
TH1 * m_vx_track_nSiHoles
Tracks silicon holes (iDetailLevel >= 100)
Definition: InDetPerfPlot_Vertex.h:74
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.
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:557
SG::Accessor
Helper class to provide type-safe access to aux data.
Definition: Control/AthContainers/AthContainers/Accessor.h:68
python.copyTCTOutput.sDir
sDir
Definition: copyTCTOutput.py:60
xAOD::TrackParticle_v1::eta
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
Definition: TrackParticle_v1.cxx:77
InDetPerfPlot_Vertex::m_vx_track_d0
TH1 * m_vx_track_d0
Tracks d0 (iDetailLevel >= 100)
Definition: InDetPerfPlot_Vertex.h:76
xAOD::TrackParticle_v1::summaryValue
bool summaryValue(uint8_t &value, const SummaryType &information) const
Accessor for TrackSummary values.
Definition: TrackParticle_v1.cxx:736
EventPrimitivesHelpers.h
InDetPhysValMonitoringUtilities.h
InDetPerfPlot_Vertex::m_vx_track_z0
TH1 * m_vx_track_z0
Tracks z0 (iDetailLevel >= 100)
Definition: InDetPerfPlot_Vertex.h:80
InDetPerfPlot_Vertex::m_vx_type
TH1 * m_vx_type
type
Definition: InDetPerfPlot_Vertex.h:58
InDetPerfPlot_Vertex::m_vx_y
TH1 * m_vx_y
Position y.
Definition: InDetPerfPlot_Vertex.h:35
xAOD::TrackParticle_v1::z0
float z0() const
Returns the parameter.
InDetPerfPlot_Vertex::m_vx_track_err_z0
TH1 * m_vx_track_err_z0
Tracks z0 error (iDetailLevel >= 100)
Definition: InDetPerfPlot_Vertex.h:82
InDetPerfPlot_Vertex::fill
void fill(const xAOD::Vertex &vertex, float weight)
Definition: InDetPerfPlot_Vertex.cxx:62
xAOD::numberOfPixelHits
@ numberOfPixelHits
these are the pixel hits, including the b-layer [unit8_t].
Definition: TrackingPrimitives.h:260
InDetPerfPlot_Vertex::m_vx_track_pt
TH1 * m_vx_track_pt
Tracks pT (iDetailLevel >= 100)
Definition: InDetPerfPlot_Vertex.h:68
InDetPerfPlot_Vertex::InDetPerfPlot_Vertex
InDetPerfPlot_Vertex(InDetPlotBase *pParent, const std::string &dirName, bool isITk)
Definition: InDetPerfPlot_Vertex.cxx:24
AmgSymMatrix
#define AmgSymMatrix(dim)
Definition: EventPrimitives.h:50
xAOD::TrackParticle_v1::d0
float d0() const
Returns the parameter.
dqt_zlumi_pandas.weight
int weight
Definition: dqt_zlumi_pandas.py:189
InDetPlotBase
Mixin class to give extra capabilities to plots such as ATH_MSG and an easier booking interface,...
Definition: InDetPlotBase.h:33
InDetPerfPlot_Vertex::m_vx_nTracks
TH1 * m_vx_nTracks
Definition: InDetPerfPlot_Vertex.h:64
InDetPerfPlot_Vertex::m_vx_err_time
TH1 * m_vx_err_time
Error time.
Definition: InDetPerfPlot_Vertex.h:50
xAOD::numberOfSCTHoles
@ numberOfSCTHoles
number of SCT holes [unit8_t].
Definition: TrackingPrimitives.h:271
InDetPerfPlot_Vertex::m_vx_track_err_d0
TH1 * m_vx_track_err_d0
Tracks d0 error (iDetailLevel >= 100)
Definition: InDetPerfPlot_Vertex.h:78
Vertex.h
InDetPerfPlot_Vertex::m_vx_track_nSiHits
TH1 * m_vx_track_nSiHits
Tracks silicon hits (iDetailLevel >= 100)
Definition: InDetPerfPlot_Vertex.h:72
InDetPerfPlot_Vertex::m_vx_track_weights
TH1 * m_vx_track_weights
Distribution of tracks' weights.
Definition: InDetPerfPlot_Vertex.h:66
EventPrimitives.h
xAOD::TrackParticle_v1::definingParametersCovMatrix
const ParametersCovMatrix_t definingParametersCovMatrix() const
Returns the 5x5 symmetric matrix containing the defining parameters covariance matrix.
Definition: TrackParticle_v1.cxx:246
Amg::error
double error(const Amg::MatrixX &mat, int index)
return diagonal error of the matrix caller should ensure the matrix is symmetric and the index is in ...
Definition: EventPrimitivesHelpers.h:40
InDetPerfPlot_Vertex::m_vx_time
TH1 * m_vx_time
Time.
Definition: InDetPerfPlot_Vertex.h:39
EventInfo.h
InDetPerfPlot_Vertex::m_vx_err_z
TH1 * m_vx_err_z
Error z.
Definition: InDetPerfPlot_Vertex.h:48
TrackParticle.h
Trk::vertex
@ vertex
Definition: MeasurementType.h:21
VertexContainer.h
xAOD::Vertex_v1
Class describing a Vertex.
Definition: Vertex_v1.h:42
InDetPerfPlot_Vertex::m_vx_chi2_over_ndf
TH1 * m_vx_chi2_over_ndf
Definition: InDetPerfPlot_Vertex.h:56
InDetPerfPlot_Vertex::m_vx_x
TH1 * m_vx_x
Definition: InDetPerfPlot_Vertex.h:33
xAOD::numberOfSCTHits
@ numberOfSCTHits
number of hits in SCT [unit8_t].
Definition: TrackingPrimitives.h:269
SG::ConstAccessor< T, AuxAllocator_t< T > >::isAvailable
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
InDetPerfPlot_Vertex::m_vx_err_x
TH1 * m_vx_err_x
Definition: InDetPerfPlot_Vertex.h:44
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:43
InDetPerfPlot_Vertex.h
InDetPlotBase::fillHisto
static void fillHisto(TProfile *pTprofile, const float bin, const float weight, const float weight2=1.0)
Definition: InDetPlotBase.cxx:82
InDetPerfPlot_Vertex::m_vx_track_eta
TH1 * m_vx_track_eta
Tracks eta (iDetailLevel >= 100)
Definition: InDetPerfPlot_Vertex.h:70
InDetPerfPlot_Vertex::m_vx_err_y
TH1 * m_vx_err_y
Error y.
Definition: InDetPerfPlot_Vertex.h:46
TrackParticleContainer.h
InDetPerfPlot_Vertex::m_isITk
bool m_isITk
Definition: InDetPerfPlot_Vertex.h:29
InDetPerfPlot_Vertex::initializePlots
void initializePlots()
Definition: InDetPerfPlot_Vertex.cxx:30
InDetPerfPlot_Vertex::m_vx_z
TH1 * m_vx_z
Position z.
Definition: InDetPerfPlot_Vertex.h:37