ATLAS Offline Software
Loading...
Searching...
No Matches
Efficiencies.cxx
Go to the documentation of this file.
1
9
10#include "Efficiencies.h"
11
12
16IDTPM2::Efficiencies::Efficiencies( const std::string& name, ToolHandle<GenericMonitoringTool>* m )
17 : IPlotBase( name, m )
18{ }
19
24
25 // MY_MSG_DEBUG << "Booking efficiency plots in " << getDirectory() << endmsg;
26
30 // may still want these in the future ...
31 // m_eff_vs_logPt = TIDA::Histogram2D<float,bool>( monTool(), "eff_vs_logPt" );
32 // m_eff_vs_lowPt = TIDA::Histogram2D<float,bool>( monTool(), "eff_vs_lowPt" );
37
40
41
44
46 // if( m_doTruthMuPlots ) m_eff_vs_truthMu = TIDA::Histogram<float,bool>( monTool(), "eff_vs_truthMu" );
47 // }
48
53
54
55}
56
57
61void IDTPM2::Efficiencies::execute( const TrackAnalysisStore& collections ) const {
62
63 const std::vector<const TrackView*>& ref = collections.reference_tracks();
64
66 // const std::vector<const TrackView*>& test = collections.test_tracks();
67
68 double mu = collections.eventInfo()->actualInteractionsPerCrossing();
69
70 const TIDA::Associator<const TrackView>* matcher = collections.matcher();
71
72 for ( size_t i=0 ; i<ref.size(); i++ ) {
73
74 const TrackView& p = *ref[i];
75
76 bool matched = false;
77
79 if ( matcher->matched(ref[i]) ) matched = true;
80
82 float ppt = p.pt() / Gaudi::Units::GeV;
83 float peta = p.eta();
84 float pphi = p.phi();
85 float pd0 = p.d0();
86 float pz0 = p.z0();
87
88 float Et = p.ET() / Gaudi::Units::GeV;
89
90 if ( p.hasParent() ) Et = p.parent()->ET()*0.001;
91
92 float EtovPt = Et/ppt; // pt should never be 0 so don't bother to check that
93
96 m_eff_vs_inclusive.Fill( 1, matched );
97
98 m_eff_vs_ntracks.Fill( ref.size(), matched );
99
100 m_eff_vs_pt.Fill( ppt, matched );
101 // m_eff_vs_logPt.Fill( ppt, matched );
102 // m_eff_vs_lowPt.Fill( ppt, matched );
103 m_eff_vs_eta.Fill( peta, matched );
104 m_eff_vs_phi.Fill( pphi, matched );
105 m_eff_vs_d0.Fill( pd0, matched );
106 m_eff_vs_z0.Fill( pz0, matched );
107
108 m_eff_vs_Et.Fill( Et, matched );
109 m_eff_vs_EtovPt.Fill( EtovPt, matched );
110
111 m_eff_vs_actualMu.Fill( mu, matched );
112
114 // m_eff_vs_eta_vs_pt.Fill( ppt, matched, ppt );
115 // m_eff_vs_eta_vs_phi.Fill( pphi, pet, matched );
116 // m_eff_vs_z0_vs_d0.Fill( pd0, pz0, matched );
117 // float ptheta = p.theta(); /// no point setting it unless it is needed
118 // m_eff_vs_z0sin_vs_d0.Fill( pz0*std::sin(ptheta), pd0, matched );
119
121 // if( m_doTruthMuPlots ) m_eff_vs_truthMu.Fill( matched, matched );
122 }
123}
124
125
126
130void IDTPM2::Efficiencies::finalize() { MY_MSG_DEBUG << "Finalising efficiency plots" << endmsg; }
131
132
const std::regex ref(r_ef)
#define endmsg
#define MY_MSG_DEBUG
Definition MsgMacros.h:25
emacs: this is -*- c++ -*-
TIDA::Histogram2D< float, bool > m_eff_vs_inclusive
NB: the egregious root convention for a TEfficiency is Fill( ismatched, variable ),...
void finalize()
Print out final stats on histograms.
void execute(const TrackAnalysisStore &collections) const
void initialize()
Dedicated fill method (for tracks and/or truth particles).
ToolHandle< GenericMonitoringTool > * monTool()
mon tool
Definition IPlotBase.h:71
const std::string & name() const
generic utilities, just in case
Definition IPlotBase.h:68
IPlotBase(const std::string &name, ToolHandle< GenericMonitoringTool > *m=0)
built from dirName and anaTag
Definition IPlotBase.h:41
forward declaration required for function prototype
Definition TrackView.h:43