ATLAS Offline Software
Loading...
Searching...
No Matches
InDetPerfPlot_FakeRate.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3*/
4
6// #include "TrkValHistUtils/EfficiencyPurityCalculator.h"
10#include <cmath>
11#include <regex>
12using namespace IDPVM;
13
14InDetPerfPlot_FakeRate::InDetPerfPlot_FakeRate(InDetPlotBase* pParent, const std::string& sDir, bool useUnlinked) :
15 InDetPlotBase(pParent, sDir),
23 m_useUnlinked{useUnlinked} {
24 // nop
25}
26
27void unlinked_ylabel(TEfficiency *teff)
28{
29 if (teff) {
30 std::string title = std::regex_replace(teff->GetTitle(), std::regex("linked"), "unlinked");
31 std::string xlabel = teff->GetTotalHistogram()->GetXaxis()->GetTitle();
32 std::string ylabel = std::regex_replace(teff->GetTotalHistogram()->GetYaxis()->GetTitle(), std::regex("linked"), "unlinked");
33 std::string s = title + ";" + xlabel + ";" + ylabel;
34 teff->SetTitle(s.c_str());
35 }
36}
37
38void
59
60void
61InDetPerfPlot_FakeRate::fill(const xAOD::TrackParticle& track, const bool isFake, float weight, float mu) {
62
63 double eta = track.eta();
64 double pt = track.pt() / Gaudi::Units::GeV; // convert MeV to GeV
65 double phi = track.phi();
66 double d0 = track.d0();
67 double z0 = track.z0();
68
69 fillHisto(m_fakerate_vs_eta, eta, isFake, weight);
70 fillHisto(m_fakerate_vs_pt, pt, isFake, weight);
71 fillHisto(m_fakerate_vs_lowpt, pt, isFake, weight);
72 fillHisto(m_fakerate_vs_phi, phi, isFake, weight);
73 fillHisto(m_fakerate_vs_d0, d0, isFake, weight);
74 fillHisto(m_fakerate_vs_z0, z0, isFake, weight);
75 fillHisto(m_fakerate_vs_mu, mu, isFake, weight);
76}
77
78void
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
void unlinked_ylabel(TEfficiency *teff)
void fill(const xAOD::TrackParticle &track, const bool isFake, float weight, float mu)
InDetPerfPlot_FakeRate(InDetPlotBase *pParent, const std::string &dirName, bool useUnlinked=false)
static void fillHisto(TProfile *pTprofile, const float bin, const float weight, const float weight2=1.0)
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.
InDetPlotBase(InDetPlotBase *pParent, const std::string &dirName)
Constructor taking parent node and directory name for plots.
Class to retrieve associated truth from a track, implementing a cached response.
TrackParticle_v1 TrackParticle
Reference the current persistent version: