ATLAS Offline Software
Loading...
Searching...
No Matches
Tracking/TrkValidation/TrkValHistUtils/Root/RecoInfoPlots.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4
6#include "TMath.h"
7
8namespace Trk {
9 void
11 trackfitchi2 = nullptr;
12 trackfitndof = nullptr;
13 trackcon = nullptr;
14 trackchi2prob = nullptr;
15 }
16
17 void
19 trackfitchi2 = Book1D("tchi2" + m_sType, m_sType + " Track fit chi2;Track Fit Chi2;Entries", 100, 0., 100.);
20 trackfitndof = Book1D("tndof" + m_sType, m_sType + " Track fit ndof;Number of degrees of freedom;Entries", 101,
21 -0.5, 100.5);
22 trackcon = Book1D("chi2ndof" + m_sType, m_sType + " Track fit chi2/ndof;Track fit chi2/ndof;Entries", 100, 0, 5);
23 trackchi2prob = Book1D("chi2prob" + m_sType, m_sType + " Track fit chi2 probability;Track fit p(#chi^2);Entries",
24 20, 0., 1.);
25 }
26
27 void
28 RecoInfoPlots::fill(const xAOD::TrackParticle &trkprt, float weight) {
29 float chi2 = trkprt.chiSquared();
30 int ndf = trkprt.numberDoF();
31
32 trackfitchi2->Fill(chi2,weight);
33 trackfitndof->Fill(ndf,weight);
34 trackcon->Fill(chi2 / ndf, weight);
35 trackchi2prob->Fill(TMath::Prob(chi2, ndf), weight);
36 }
37}
TH1D * Book1D(const std::string &name, const std::string &labels, int nBins, float start, float end, bool prependDir=true)
Book a TH1D histogram.
Definition PlotBase.cxx:94
void fill(const xAOD::TrackParticle &trkprt, float weight=1.0)
float numberDoF() const
Returns the number of degrees of freedom of the overall track or vertex fit as float.
float chiSquared() const
Returns the of the overall track fit.
double chi2(TH1 *h0, TH1 *h1)
Ensure that the ATLAS eigen extensions are properly loaded.
TrackParticle_v1 TrackParticle
Reference the current persistent version: