ATLAS Offline Software
Loading...
Searching...
No Matches
FakeRatePlots.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
9
11#include "FakeRatePlots.h"
13
14
19 PlotMgr* pParent, const std::string& dirName,
20 const std::string& anaTag, const std::string& trackType,
21 bool doGlobalPlots, bool doTruthMuPlots ) :
22 PlotMgr( dirName, anaTag, pParent ),
23 m_trackType( trackType ),
24 m_doGlobalPlots( doGlobalPlots ),
25 m_doTruthMuPlots( doTruthMuPlots ) { }
26
27
32{
33 StatusCode sc = bookPlots();
34 if( sc.isFailure() ) {
35 ATH_MSG_ERROR( "Failed to book fake rate plots" );
36 }
37}
38
39
41{
42 ATH_MSG_DEBUG( "Booking efficiency plots in " << getDirectory() );
43
44 ATH_CHECK( retrieveAndBook( m_fakerate_vs_incl, "fakerate_vs_"+m_trackType+"_inclusive" ) );
45 ATH_CHECK( retrieveAndBook( m_fakerate_vs_pt, "fakerate_vs_"+m_trackType+"_pt" ) );
46 ATH_CHECK( retrieveAndBook( m_fakerate_vs_logPt,"fakerate_vs_"+m_trackType+"_logPt" ) );
47 ATH_CHECK( retrieveAndBook( m_fakerate_vs_eta, "fakerate_vs_"+m_trackType+"_eta" ) );
48 ATH_CHECK( retrieveAndBook( m_fakerate_vs_phi, "fakerate_vs_"+m_trackType+"_phi" ) );
49 ATH_CHECK( retrieveAndBook( m_fakerate_vs_d0, "fakerate_vs_"+m_trackType+"_d0" ) );
50 ATH_CHECK( retrieveAndBook( m_fakerate_vs_z0, "fakerate_vs_"+m_trackType+"_z0" ) );
51 if( m_doGlobalPlots ) {
52 ATH_CHECK( retrieveAndBook( m_fakerate_vs_actualMu, "fakerate_vs_actualMu" ) );
53 if( m_doTruthMuPlots ) ATH_CHECK( retrieveAndBook( m_fakerate_vs_truthMu, "fakerate_vs_truthMu" ) );
54 }
55 return StatusCode::SUCCESS;
56}
57
58
62template< typename PARTICLE >
64 const PARTICLE& particle, bool isFake, float truthMu, float actualMu, float weight )
65{
67 float ppt = pT( particle ) / Gaudi::Units::GeV;
68 float peta = eta( particle );
69 float pphi = phi( particle );
70 float pd0 = d0( particle );
71 float pz0 = z0( particle );
72
74 ATH_CHECK( fill( m_fakerate_vs_incl, 1, isFake, weight ) );
75 ATH_CHECK( fill( m_fakerate_vs_pt, ppt, isFake, weight ) );
76 ATH_CHECK( fill( m_fakerate_vs_logPt, ppt, isFake, weight ) );
77 ATH_CHECK( fill( m_fakerate_vs_eta, peta, isFake, weight ) );
78 ATH_CHECK( fill( m_fakerate_vs_phi, pphi, isFake, weight ) );
79 ATH_CHECK( fill( m_fakerate_vs_d0, pd0, isFake, weight ) );
80 ATH_CHECK( fill( m_fakerate_vs_z0, pz0, isFake, weight ) );
81
82 if( m_doGlobalPlots ) {
83 ATH_CHECK( fill( m_fakerate_vs_actualMu, actualMu, isFake, weight ) );
84 if( m_doTruthMuPlots ) ATH_CHECK( fill( m_fakerate_vs_truthMu, truthMu, isFake, weight ) );
85 }
86
87 return StatusCode::SUCCESS;
88}
89
91 const xAOD::TrackParticle&, bool isFake, float truthMu, float actualMu, float weight );
92
94 const xAOD::TruthParticle&, bool isFake, float truthMu, float actualMu, float weight );
95
96
101{
102 ATH_MSG_DEBUG( "Finalising fake rate plots" );
104}
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_DEBUG(x)
static Double_t sc
Utility methods to access track/truth particles parmeters in a consitent way in this package.
TEfficiency * m_fakerate_vs_z0
TEfficiency * m_fakerate_vs_phi
TEfficiency * m_fakerate_vs_actualMu
TEfficiency * m_fakerate_vs_truthMu
TEfficiency * m_fakerate_vs_logPt
StatusCode fillPlots(const PARTICLE &particle, bool isFake, float truthMu, float actualMu, float weight)
Dedicated fill method (for tracks and/or truth particles)
std::string m_trackType
void initializePlots()
Book the histograms.
void finalizePlots()
Print out final stats on histograms.
TEfficiency * m_fakerate_vs_incl
FakeRatePlots(PlotMgr *pParent, const std::string &dirName, const std::string &anaTag, const std::string &trackType, bool doGlobalPlots=false, bool doTruthMuPlots=false)
Constructor.
TEfficiency * m_fakerate_vs_d0
TEfficiency * m_fakerate_vs_pt
TEfficiency * m_fakerate_vs_eta
StatusCode retrieveAndBook(P *&pHisto, const std::string &identifier, const std::string &folderOverride="", const std::string &nameOverride="")
Definition PlotMgr.h:64
PlotMgr(const std::string &dirName, const std::string &anaTag, PlotMgr *pParent=nullptr)
Constructor taking parent node and directory name for plots pParent = nullptr by default to book plot...
Definition PlotMgr.cxx:25
const std::string & getDirectory()
Definition PlotBase.h:88
float pT(const U &p)
Accessor utility function for getting the value of pT.
float z0(const U &p)
float d0(const U &p)
TrackParticle_v1 TrackParticle
Reference the current persistent version:
TruthParticle_v1 TruthParticle
Typedef to implementation.
void fill(H5::Group &out_file, size_t iterations)