ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MuonSpectrometer
MuonValidation
MuonHistogramming
MuonHistUtils
Root
MomentumPullPlots.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
MuonHistUtils/MomentumPullPlots.h
"
6
7
#include "
FourMomUtils/xAODP4Helpers.h
"
8
#include "
xAODTracking/TrackParticle.h
"
9
#include "
xAODTracking/TrackParticleContainer.h
"
10
11
using namespace
xAOD::P4Helpers
;
12
namespace
Muon
{
13
14
void
MomentumPullPlots::initializePlots
() {
15
16
dpt_idme
=
17
Book1D
(
"dpt_idme"
,
"idme_dpt;pt_{id} - pt_{me} [GeV];Entries / 0.2 GeV"
,
18
100, -100., 100);
19
ddpt_idme
=
20
Book1D
(
"ddpt_idme"
,
"idme_ddpt;(pt_{id} - pt_{me})/pt_{id};Entries"
,
21
300, -0.5, 0.5);
22
dphi_idme
=
Book1D
(
"dphi_idme"
,
"idme_dphi;#phi_{id} - #phi_{me};Entries"
,
23
100, -0.1, 0.1);
24
deta_idme
=
Book1D
(
"deta_idme"
,
"idme_deta;#eta_{id} - #eta_{me};Entries"
,
25
100, -0.1, 0.1);
26
27
dpt_cbme
=
28
Book1D
(
"dpt_cbme"
,
"cbme_dpt;pt_{cb} - pt_{me} [GeV];Entries / 0.2 GeV"
,
29
100, -100., 100);
30
ddpt_cbme
=
31
Book1D
(
"ddpt_cbme"
,
"cbme_ddpt;(pt_{cb} - pt_{me})/pt_{cb};Entries"
,
32
300, -0.5, 0.5);
33
dphi_cbme
=
Book1D
(
"dphi_cbme"
,
"cbme_dphi;#phi_{cb} - #phi_{me};Entries"
,
34
100, -0.1, 0.1);
35
deta_cbme
=
Book1D
(
"deta_cbme"
,
"cbme_deta;#eta_{cb} - #eta_{me};Entries"
,
36
100, -0.1, 0.1);
37
38
pt_cbme
=
Book2D
(
"pt_cbme"
,
"pt_cbme; pt_{cb} [GeV]; pt_{me} [GeV]"
, 100,
39
0.0, 100.0, 100, 0.0, 100.0);
40
pt_cbid
=
Book2D
(
"pt_cbid"
,
"pt_cbid; pt_{cb} [GeV]; pt_{id} [GeV]"
, 100,
41
0.0, 100.0, 100, 0.0, 100.0);
42
pt_meid
=
Book2D
(
"pt_meid"
,
"pt_meid; pt_{me} [GeV]; pt_{id} [GeV]"
, 100,
43
0.0, 100.0, 100, 0.0, 100.0);
44
}
45
46
void
MomentumPullPlots::fill
(
const
xAOD::Muon
& mu,
float
weight) {
47
const
xAOD::TrackParticle
* cb =
48
mu.trackParticle(xAOD::Muon::CombinedTrackParticle);
49
const
xAOD::TrackParticle
*
id
=
50
mu.trackParticle(xAOD::Muon::InnerDetectorTrackParticle);
51
54
55
// check correct numbering in Muon.h -> OK!
56
const
xAOD::TrackParticle
* me =
57
mu.trackParticle(xAOD::Muon::TrackParticleType::
58
ExtrapolatedMuonSpectrometerTrackParticle);
59
if
(!me) {
60
me = mu.trackParticle(xAOD::Muon::MuonSpectrometerTrackParticle);
61
}
62
63
if
(cb && me) {
64
dpt_cbme
->Fill((cb->
pt
() - me->
pt
()) * 0.001, weight);
65
ddpt_cbme
->Fill((cb->
pt
() - me->
pt
()) / cb->
pt
(), weight);
66
dphi_cbme
->Fill(
deltaPhi
(cb->
phi
(), me->
phi
()), weight);
67
deta_cbme
->Fill(cb->
eta
() - me->
eta
(), weight);
68
pt_cbme
->Fill(cb->
pt
() * 0.001, me->
pt
() * 0.001, weight);
69
}
70
71
if
(
id
&& me) {
72
dpt_idme
->Fill((id->pt() - me->
pt
()) * 0.001, weight);
73
ddpt_idme
->Fill((id->pt() - me->
pt
()) / id->pt(), weight);
74
dphi_idme
->Fill(
deltaPhi
(id->phi(), me->
phi
()), weight);
75
deta_idme
->Fill(id->eta() - me->
eta
(), weight);
76
pt_meid
->Fill(me->
pt
() * 0.001, id->pt() * 0.001, weight);
77
}
78
79
if
(
id
&& cb) {
80
pt_cbid
->Fill(cb->
pt
() * 0.001, id->pt() * 0.001, weight);
81
}
82
}
83
84
}
// namespace Muon
deltaPhi
Scalar deltaPhi(const MatrixBase< Derived > &vec) const
Definition
AmgMatrixBasePlugin.h:112
TrackParticleContainer.h
TrackParticle.h
MomentumPullPlots.h
Muon::MomentumPullPlots::fill
void fill(const xAOD::Muon &mu, float weight=1.0)
Definition
MomentumPullPlots.cxx:46
Muon::MomentumPullPlots::initializePlots
void initializePlots()
Definition
MomentumPullPlots.cxx:14
Muon::MomentumPullPlots::pt_meid
TH2 * pt_meid
Definition
MomentumPullPlots.h:31
Muon::MomentumPullPlots::dpt_cbme
TH1 * dpt_cbme
Definition
MomentumPullPlots.h:24
Muon::MomentumPullPlots::pt_cbme
TH2 * pt_cbme
Definition
MomentumPullPlots.h:29
Muon::MomentumPullPlots::deta_cbme
TH1 * deta_cbme
Definition
MomentumPullPlots.h:27
Muon::MomentumPullPlots::dphi_idme
TH1 * dphi_idme
Definition
MomentumPullPlots.h:21
Muon::MomentumPullPlots::ddpt_cbme
TH1 * ddpt_cbme
Definition
MomentumPullPlots.h:25
Muon::MomentumPullPlots::dpt_idme
TH1 * dpt_idme
Definition
MomentumPullPlots.h:19
Muon::MomentumPullPlots::pt_cbid
TH2 * pt_cbid
Definition
MomentumPullPlots.h:30
Muon::MomentumPullPlots::ddpt_idme
TH1 * ddpt_idme
Definition
MomentumPullPlots.h:20
Muon::MomentumPullPlots::dphi_cbme
TH1 * dphi_cbme
Definition
MomentumPullPlots.h:26
Muon::MomentumPullPlots::deta_idme
TH1 * deta_idme
Definition
MomentumPullPlots.h:22
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::Book2D
TH2F * Book2D(std::string_view name, std::string_view labels, int nBinsX, float startX, float endX, int nBinsY, float startY, float endY, bool prependDir=true)
Book a TH2F histogram.
Definition
PlotBase.cxx:123
xAOD::TrackParticle_v1::phi
virtual double phi() const override final
The azimuthal angle ( ) of the particle (has range to .).
xAOD::TrackParticle_v1::pt
virtual double pt() const override final
The transverse momentum ( ) of the particle.
Definition
TrackParticle_v1.cxx:75
xAOD::TrackParticle_v1::eta
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
Definition
TrackParticle_v1.cxx:79
Muon
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
Definition
TrackSystemController.h:46
xAOD::P4Helpers
Definition
xAODP4Helpers.h:36
xAOD::TrackParticle
TrackParticle_v1 TrackParticle
Reference the current persistent version:
Definition
Event/xAOD/xAODTracking/xAODTracking/TrackParticle.h:13
xAOD::Muon
Muon_v1 Muon
Reference the current persistent version:
Definition
Event/xAOD/xAODMuon/xAODMuon/Muon.h:13
xAODP4Helpers.h
Generated on
for ATLAS Offline Software by
1.17.0