EIC Software
Reference for
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 "
ActsExamples/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
ActsExamples::EffPlotTool::EffPlotTool
(
18
const
ActsExamples::EffPlotTool::Config
& cfg,
Acts::Logging::Level
lvl)
19
: m_cfg(cfg), m_logger(Acts::
getDefaultLogger
(
"EffPlotTool"
, lvl)) {}
20
21
void
ActsExamples::EffPlotTool::book
(
22
EffPlotTool::EffPlotCache
& effPlotCache)
const
{
23
PlotHelpers::Binning
bPhi = m_cfg.varBinning.at(
"Phi"
);
24
PlotHelpers::Binning
bEta = m_cfg.varBinning.at(
"Eta"
);
25
PlotHelpers::Binning
bPt = m_cfg.varBinning.at(
"Pt"
);
26
ACTS_DEBUG
(
"Initialize the histograms for efficiency plots"
);
27
// efficiency vs pT
28
effPlotCache.
trackEff_vs_pT
=
PlotHelpers::bookEff
(
29
"trackeff_vs_pT"
,
"Tracking efficiency;pT [GeV/c];Efficiency"
, bPt);
30
// efficiency vs eta
31
effPlotCache.
trackEff_vs_eta
=
PlotHelpers::bookEff
(
32
"trackeff_vs_eta"
,
"Tracking efficiency;#eta;Efficiency"
, bEta);
33
// efficiency vs phi
34
effPlotCache.
trackEff_vs_phi
=
PlotHelpers::bookEff
(
35
"trackeff_vs_phi"
,
"Tracking efficiency;#phi;Efficiency"
, bPhi);
36
}
37
38
void
ActsExamples::EffPlotTool::clear
(
EffPlotCache
& effPlotCache)
const
{
39
delete
effPlotCache.
trackEff_vs_pT
;
40
delete
effPlotCache.
trackEff_vs_eta
;
41
delete
effPlotCache.
trackEff_vs_phi
;
42
}
43
44
void
ActsExamples::EffPlotTool::write
(
45
const
EffPlotTool::EffPlotCache
& effPlotCache)
const
{
46
ACTS_DEBUG
(
"Write the plots to output file."
);
47
effPlotCache.
trackEff_vs_pT
->Write();
48
effPlotCache.
trackEff_vs_eta
->Write();
49
effPlotCache.
trackEff_vs_phi
->Write();
50
}
51
52
void
ActsExamples::EffPlotTool::fill
(
EffPlotTool::EffPlotCache
& effPlotCache,
53
const
ActsFatras::Particle
& truthParticle,
54
bool
status)
const
{
55
const
auto
t_phi =
phi
(truthParticle.
unitDirection
());
56
const
auto
t_eta =
eta
(truthParticle.
unitDirection
());
57
const
auto
t_pT = truthParticle.
transverseMomentum
();
58
59
PlotHelpers::fillEff
(effPlotCache.
trackEff_vs_pT
, t_pT, status);
60
PlotHelpers::fillEff
(effPlotCache.
trackEff_vs_eta
, t_eta, status);
61
PlotHelpers::fillEff
(effPlotCache.
trackEff_vs_phi
, t_phi, status);
62
}
acts
blob
sPHENIX
Examples
Framework
src
Validation
EffPlotTool.cpp
Built by
Jin Huang
. updated:
Mon Jan 22 2024 12:43:25
using
1.8.2 with
EIC GitHub integration