ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Reconstruction
PFlow
PFlowValidation
PFOHistUtils
src
PFOPVMatchedPlots.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
PFOHistUtils/PFOPVMatchedPlots.h
"
6
#include "
xAODTracking/TrackParticle.h
"
7
#include "
AthenaKernel/Units.h
"
8
9
namespace
PFO
{
10
11
PFOPVMatchedPlots::PFOPVMatchedPlots
(
PlotBase
* pParent,
const
std::string & sDir,
const
std::string & sFEContainerName) :
PlotBase
(pParent, sDir),
m_sFEContainerName
(sFEContainerName){
12
13
}
14
15
void
PFOPVMatchedPlots::initializePlots
(){
16
//book Flow Element histograms
17
if
(!
m_sFEContainerName
.empty()){
18
m_FE_pt
=
Book1D
(
"_PVMatched_Pt"
,
m_sFEContainerName
+
"_Pt (Entries/1 GeV)"
,30,-10.0,20.0);
19
m_FE_eta
=
Book1D
(
"_PVMatched_Eta"
,
m_sFEContainerName
+
"_Eta (Entries/0.1)"
,100,-5.0,5.0);
20
m_FE_phi
=
Book1D
(
"_PVMatched_Phi"
,
m_sFEContainerName
+
"_Phi (Entries/0.1)"
,64,-3.2,3.2);
21
m_FE_m
=
Book1D
(
"_PVMatched_m"
,
m_sFEContainerName
+
"_m (Entries/100 MeV)"
,10,0.0,0.5);
22
m_FE_charge
=
Book1D
(
"_PVMatched_charge"
,
m_sFEContainerName
+
"_charge (Entries/unit charge)"
,5,-2,2);
23
24
m_FE_pt_etaBinA
=
Book1D
(
"_Pt_PVMatched_A"
,
m_sFEContainerName
+
"_Pt (Entries/1 GeV, |eta| < 1 )"
,30,-10.0,20.0);
25
m_FE_pt_etaBinB
=
Book1D
(
"_Pt_PVMatched_B"
,
m_sFEContainerName
+
"_Pt (Entries/1 GeV, 1 <= |eta| < 2 )"
,30,-10.0,20.0);
26
m_FE_pt_etaBinC
=
Book1D
(
"_Pt_PVMatched_C"
,
m_sFEContainerName
+
"_Pt (Entries/1 GeV, |eta| >= 2 )"
,30,-10.0,20.0);
27
}
28
}
29
30
void
PFOPVMatchedPlots::fill
(
const
xAOD::FlowElement
& FE,
const
xAOD::Vertex
& theVertex,
const
xAOD::EventInfo
& eventInfo){
31
if
(FE.
nChargedObjects
()==0)
32
return
;
33
const
xAOD::TrackParticle
* theTrack =
static_cast<
const
xAOD::TrackParticle
*
>
(FE.
chargedObjects
().at(0));
34
35
if
(theTrack){
36
//vtz.z() provides z of that vertex w.r.t the center of the beamspot (z = 0). Thus we corrext the track z0 to be w.r.t z = 0
37
float
z0 = theTrack->
z0
() + theTrack->
vz
();
38
z0 = z0 - theVertex.
z
();
39
float
theta
= theTrack->
theta
();
40
if
( std::abs(z0*sin(
theta
)) < 2.0 ){
41
m_FE_pt
->Fill(FE.
pt
()/Athena::Units::GeV,eventInfo.
beamSpotWeight
());
42
m_FE_eta
->Fill(FE.
eta
(),eventInfo.
beamSpotWeight
());
43
m_FE_phi
->Fill(FE.
phi
(),eventInfo.
beamSpotWeight
());
44
m_FE_m
->Fill(FE.
m
()/Athena::Units::GeV,eventInfo.
beamSpotWeight
());
45
m_FE_charge
->Fill(FE.
charge
(),eventInfo.
beamSpotWeight
());
46
47
if
(std::abs(FE.
eta
()) < 1)
m_FE_pt_etaBinA
->Fill(FE.
pt
()/Athena::Units::GeV,eventInfo.
beamSpotWeight
());
48
else
if
(std::abs(FE.
eta
()) < 2)
m_FE_pt_etaBinB
->Fill(FE.
pt
()/Athena::Units::GeV,eventInfo.
beamSpotWeight
());
49
else
m_FE_pt_etaBinC
->Fill(FE.
pt
()/Athena::Units::GeV,eventInfo.
beamSpotWeight
());
50
}
//fill histograms if track is matched to the PV
51
}
//if valid pointer to track
52
}
53
54
55
}
theta
Scalar theta() const
theta method
Definition
AmgMatrixBasePlugin.h:75
TrackParticle.h
PFOPVMatchedPlots.h
Units.h
Wrapper to avoid constant divisions when using units.
PFO::PFOPVMatchedPlots::initializePlots
void initializePlots()
Definition
PFOPVMatchedPlots.cxx:15
PFO::PFOPVMatchedPlots::m_sFEContainerName
std::string m_sFEContainerName
Definition
PFOPVMatchedPlots.h:36
PFO::PFOPVMatchedPlots::m_FE_pt_etaBinB
TH1 * m_FE_pt_etaBinB
Definition
PFOPVMatchedPlots.h:32
PFO::PFOPVMatchedPlots::m_FE_pt
TH1 * m_FE_pt
Definition
PFOPVMatchedPlots.h:24
PFO::PFOPVMatchedPlots::m_FE_eta
TH1 * m_FE_eta
Definition
PFOPVMatchedPlots.h:25
PFO::PFOPVMatchedPlots::m_FE_pt_etaBinC
TH1 * m_FE_pt_etaBinC
Definition
PFOPVMatchedPlots.h:33
PFO::PFOPVMatchedPlots::PFOPVMatchedPlots
PFOPVMatchedPlots(PlotBase *pParent, const std::string &sDir, const std::string &sFEContainerName)
Definition
PFOPVMatchedPlots.cxx:11
PFO::PFOPVMatchedPlots::m_FE_pt_etaBinA
TH1 * m_FE_pt_etaBinA
Pt Histogram binned in eta.
Definition
PFOPVMatchedPlots.h:31
PFO::PFOPVMatchedPlots::fill
void fill(const xAOD::FlowElement &FE, const xAOD::Vertex &theVertex, const xAOD::EventInfo &eventInfo)
Definition
PFOPVMatchedPlots.cxx:30
PFO::PFOPVMatchedPlots::m_FE_charge
TH1 * m_FE_charge
Definition
PFOPVMatchedPlots.h:28
PFO::PFOPVMatchedPlots::m_FE_m
TH1 * m_FE_m
Definition
PFOPVMatchedPlots.h:27
PFO::PFOPVMatchedPlots::m_FE_phi
TH1 * m_FE_phi
Definition
PFOPVMatchedPlots.h:26
PlotBase::Book1D
TH1D * Book1D(std::string_view name, std::string_view labels, int nBins, float start, float end, bool prependDir=true)
Book a TH1D histogram.
Definition
PlotBase.cxx:94
PlotBase::PlotBase
PlotBase(PlotBase *parent, std::string_view sDir)
Definition
PlotBase.cxx:29
xAOD::EventInfo_v1::beamSpotWeight
float beamSpotWeight() const
Weight for beam spot size reweighting.
Definition
EventInfo_v1.cxx:970
xAOD::FlowElement_v1::nChargedObjects
std::size_t nChargedObjects() const
Definition
FlowElement_v1.cxx:123
xAOD::FlowElement_v1::chargedObjects
std::vector< const xAOD::IParticle * > chargedObjects() const
Definition
FlowElement_v1.cxx:94
xAOD::FlowElement_v1::pt
virtual double pt() const override
xAOD::FlowElement_v1::m
virtual double m() const override
The invariant mass of the particle.
xAOD::FlowElement_v1::phi
virtual double phi() const override
The azimuthal angle ( ) of the particle.
xAOD::FlowElement_v1::eta
virtual double eta() const override
The pseudorapidity ( ) of the particle.
xAOD::FlowElement_v1::charge
float charge() const
xAOD::TrackParticle_v1::z0
float z0() const
Returns the parameter.
xAOD::TrackParticle_v1::theta
float theta() const
Returns the parameter, which has range 0 to .
xAOD::TrackParticle_v1::vz
float vz() const
The z origin for the parameters.
xAOD::Vertex_v1::z
float z() const
Returns the z position.
PFO
Definition
ClusterMomentPlots.h:15
xAOD::EventInfo
EventInfo_v1 EventInfo
Definition of the latest event info version.
Definition
IEventInfoCnvTool.h:16
xAOD::FlowElement
FlowElement_v1 FlowElement
Definition of the current "pfo version".
Definition
FlowElement.h:16
xAOD::TrackParticle
TrackParticle_v1 TrackParticle
Reference the current persistent version:
Definition
Event/xAOD/xAODTracking/xAODTracking/TrackParticle.h:13
xAOD::Vertex
Vertex_v1 Vertex
Define the latest version of the vertex class.
Definition
Event/xAOD/xAODTracking/xAODTracking/Vertex.h:16
Generated on
for ATLAS Offline Software by
1.17.0