17 const std::string& sDir,
26 m_sType +
" pCB-ptruthIP;#Delta p;Entries", 200, -10, 10);
29 m_sType +
" pME-ptruthIP;#Delta p;Entries", 200, -10, 10);
32 m_sType +
" (pME-ptruthIP) - (pMS-ptruthMS);#Delta p;Entries",
35 m_sType +
" dp_eloss;#Delta p;Entries", 200, -10, 10);
37 Double_t ptBins[] = {5, 10, 25, 60, 100, 200, 1000};
38 Double_t etaBins[] = {-2.7, -2.5, -1.7, -1.05, -0.1,
39 0.1, 1.05, 1.7, 2.5, 2.7};
42 const unsigned int nptBins =
sizeof(ptBins) /
sizeof(ptBins[0]) - 1;
43 const unsigned int netaBins =
sizeof(etaBins) /
sizeof(etaBins[0]) - 1;
46 m_sType +
" pCB-ptruthIP vs pt;pt;#Delta p",
47 nptBins, ptBins, 100, -10., 10.);
49 m_sType +
" pME-ptruthIP vs pt;pt;#Delta p",
50 nptBins, ptBins, 100, -10., 10.);
53 m_sType +
" (pME-ptruthIP) - (pMS-ptruthMS) vs pt;pt;#Delta p",
54 nptBins, ptBins, 200, -10., 10.);
56 m_sType +
" dp_eloss vs pt;pt [GeV]; #Delta p",
57 nptBins, ptBins, 100, -10., 10.);
60 m_sType +
" pCB-ptruthIP vs eta;eta;#Delta p",
61 netaBins, etaBins, 100, -10., 10.);
63 m_sType +
" pME-ptruthIP vs eta;eta;#Delta p",
64 netaBins, etaBins, 100, -10., 10.);
67 m_sType +
" (pME-ptruthIP) - (pMS-ptruthMS) vs eta;eta;#Delta p",
68 netaBins, etaBins, 200, -10., 10.);
70 m_sType +
" dp_eloss vs eta;eta; #Delta p",
71 netaBins, etaBins, 100, -10., 10.);
78 if (!(muon.muonType() == xAOD::Muon::MuonType::Combined ||
79 muon.muonType() == xAOD::Muon::MuonType::SegmentTagged ||
80 muon.muonType() == xAOD::Muon::MuonType::MuonStandAlone)) {
84 using enum xAOD::Muon::TrackParticleType;
87 const xAOD::TrackParticle* msExtrapTrk = muon.trackParticle(ExtrapolatedMuonSpectrometerTrackParticle);
89 msExtrapTrk = muon.trackParticle(MuonSpectrometerTrackParticle);
93 float pt = 0.001 * truthMu.
pt();
95 float pTruth = truthMu.
p4().P();
96 float pCB = muPrimaryTrk->
p4().P();
99 pME = msExtrapTrk->
p4().P();
103 pMS = msTrk->
p4().P();
107 if (muon.parameter(eloss, xAOD::Muon::ParamDef::MeasEnergyLoss)) {
116 Amg::Vector3D pvecTruthMS{entpxAcc(truthMu), entpyAcc(truthMu),
118 pTruthMS = pvecTruthMS.mag();
121 if (muon.muonType() != xAOD::Muon::MuonType::SegmentTagged) {
123 float dpCB = 0.001 * (pCB - pTruth);
128 float dpME = 0.001 * (pME - pTruth);
132 if (pMS && pTruthMS) {
133 float dpMS = 0.001 * (pME - pMS - pTruth + pTruthMS);
142 if (eloss > 2000 && pTruthMS && pTruth) {
143 float dpEloss = 0.001 * (pTruth - pTruthMS - eloss);
Scalar eta() const
pseudorapidity method
Helper class to provide constant type-safe access to aux data.
TH2 * dp_CB_truthIP_vs_pt
TH2 * dp_ME_truthIP_MS_truthMS_vs_pt
TH2 * dp_CB_truthIP_vs_eta
TH1 * dp_ME_truthIP_MS_truthMS
~MomentumTruthPullPlots()
TH2 * dp_ME_truthIP_MS_truthMS_vs_eta
MomentumTruthPullPlots(PlotBase *pParent, const std::string &sDir, std::string sType)
TH2 * dp_ME_truthIP_vs_pt
void fill(const xAOD::Muon &muon, const xAOD::TrackParticle *muontpIP, const xAOD::TruthParticle &truthprt, float weight=1.0)
TH2 * dp_ME_truthIP_vs_eta
TH1D * Book1D(std::string_view name, std::string_view labels, int nBins, float start, float end, bool prependDir=true)
Book a TH1D histogram.
PlotBase(PlotBase *parent, std::string_view sDir)
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.
Helper class to provide constant type-safe access to aux data.
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
virtual FourMom_t p4() const override final
The full 4-momentum of the particle.
virtual double pt() const override final
The transverse momentum ( ) of the particle.
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
virtual FourMom_t p4() const override final
The full 4-momentum of the particle.
Eigen::Matrix< double, 3, 1 > Vector3D
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
TrackParticle_v1 TrackParticle
Reference the current persistent version:
TruthParticle_v1 TruthParticle
Typedef to implementation.
Muon_v1 Muon
Reference the current persistent version: