ATLAS Offline Software
Loading...
Searching...
No Matches
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
6
10
11using namespace xAOD::P4Helpers;
12namespace Muon {
13
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
46void 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
Scalar deltaPhi(const MatrixBase< Derived > &vec) const
void fill(const xAOD::Muon &mu, float weight=1.0)
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
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
virtual double phi() const override final
The azimuthal angle ( ) of the particle (has range to .).
virtual double pt() const override final
The transverse momentum ( ) of the particle.
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
TrackParticle_v1 TrackParticle
Reference the current persistent version:
Muon_v1 Muon
Reference the current persistent version: