ECCE @ EIC Software
Reference for
ECCE @ EIC
simulation and reconstruction software on GitHub
Home page
Related Pages
Modules
Namespaces
Classes
Files
External Links
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
EffPlotTool.cpp
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file EffPlotTool.cpp
1
// This file is part of the Acts project.
2
//
3
// Copyright (C) 2019 CERN for the benefit of the Acts project
4
//
5
// This Source Code Form is subject to the terms of the Mozilla Public
6
// License, v. 2.0. If a copy of the MPL was not distributed with this
7
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
8
9
#include "
ACTFW/Validation/EffPlotTool.hpp
"
10
11
#include "
Acts/Utilities/Helpers.hpp
"
12
13
using
Acts::VectorHelpers::eta
;
14
using
Acts::VectorHelpers::perp
;
15
using
Acts::VectorHelpers::phi
;
16
17
FW::EffPlotTool::EffPlotTool
(
const
FW::EffPlotTool::Config
& cfg,
18
Acts::Logging::Level
lvl)
19
: m_cfg(cfg), m_logger(Acts::
getDefaultLogger
(
"EffPlotTool"
, lvl)) {}
20
21
void
FW::EffPlotTool::book
(
EffPlotTool::EffPlotCache
& effPlotCache)
const
{
22
PlotHelpers::Binning
bPhi = m_cfg.varBinning.at(
"Phi"
);
23
PlotHelpers::Binning
bEta = m_cfg.varBinning.at(
"Eta"
);
24
PlotHelpers::Binning
bPt = m_cfg.varBinning.at(
"Pt"
);
25
ACTS_DEBUG
(
"Initialize the histograms for efficiency plots"
);
26
// efficiency vs pT
27
effPlotCache.
trackeff_vs_pT
=
PlotHelpers::bookEff
(
28
"trackeff_vs_pT"
,
"Tracking efficiency;pT [GeV/c];Efficiency"
, bPt);
29
// efficiency vs eta
30
effPlotCache.
trackeff_vs_eta
=
PlotHelpers::bookEff
(
31
"trackeff_vs_eta"
,
"Tracking efficiency;#eta;Efficiency"
, bEta);
32
// efficiency vs phi
33
effPlotCache.
trackeff_vs_phi
=
PlotHelpers::bookEff
(
34
"trackeff_vs_phi"
,
"Tracking efficiency;#phi;Efficiency"
, bPhi);
35
}
36
37
void
FW::EffPlotTool::clear
(
EffPlotCache
& effPlotCache)
const
{
38
delete
effPlotCache.
trackeff_vs_pT
;
39
delete
effPlotCache.
trackeff_vs_eta
;
40
delete
effPlotCache.
trackeff_vs_phi
;
41
}
42
43
void
FW::EffPlotTool::write
(
44
const
EffPlotTool::EffPlotCache
& effPlotCache)
const
{
45
ACTS_DEBUG
(
"Write the plots to output file."
);
46
effPlotCache.
trackeff_vs_pT
->Write();
47
effPlotCache.
trackeff_vs_eta
->Write();
48
effPlotCache.
trackeff_vs_phi
->Write();
49
}
50
51
void
FW::EffPlotTool::fill
(
EffPlotTool::EffPlotCache
& effPlotCache,
52
const
ActsFatras::Particle
& truthParticle,
53
bool
status)
const
{
54
const
auto
t_phi =
phi
(truthParticle.
unitDirection
());
55
const
auto
t_eta =
eta
(truthParticle.
unitDirection
());
56
const
auto
t_pT = truthParticle.
transverseMomentum
();
57
58
PlotHelpers::fillEff
(effPlotCache.
trackeff_vs_pT
, t_pT, status);
59
PlotHelpers::fillEff
(effPlotCache.
trackeff_vs_eta
, t_eta, status);
60
PlotHelpers::fillEff
(effPlotCache.
trackeff_vs_phi
, t_phi, status);
61
}
acts
blob
master
Examples
Framework
src
Validation
EffPlotTool.cpp
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:24:24
using
1.8.2 with
ECCE GitHub integration