ATLAS Offline Software
MSHitDiffPlots.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
8 // #include "TrkValHistUtils/TrkValHistUtilities.h"
9 
10 namespace Trk {
11  MSHitDiffPlots::MSHitDiffPlots(PlotBase *pParent, const std::string& sDir) :
12  PlotBase(pParent, sDir),
13  nprecLayers(this, "nprecLayers", "Precision Layers", -5, 5),
14  nphiLayers(this, "nphiLayers", "Phi Layers", -5, 5),
15  ntrigEtaLayers(this, "ntrigEtaLayers", "Eta Trigger Layers", -5, 5) {
16  }
17 
18  void
19  MSHitDiffPlots::fill(const xAOD::TrackParticle &trkprt, const xAOD::TruthParticle &truthprt, float weight) {
20  fillPlot(nprecLayers, xAOD::numberOfPrecisionLayers, "nprecLayers", trkprt, truthprt, weight);
21  fillPlot(nphiLayers, xAOD::numberOfPhiLayers, "nphiLayers", trkprt, truthprt, weight);
22  fillPlot(ntrigEtaLayers, xAOD::numberOfTriggerEtaLayers, "ntrigEtaLayers", trkprt, truthprt, weight);
23  }
24 
25  void
26  MSHitDiffPlots::fillPlot(HitTypePlots &hitPlots, const xAOD::SummaryType &info, const std::string &sInfo,
27  const xAOD::TrackParticle &trkprt, const xAOD::TruthParticle &truthprt, float weight) {
28  uint8_t hitval = 0;
29 
30  if (!trkprt.summaryValue(hitval, info)) {
31  return;
32  }
33  SG::ConstAccessor<uint8_t> infoAcc (sInfo);
34  if (!infoAcc.isAvailable(truthprt)) {
35  return;
36  }
37  uint8_t truthhitval = infoAcc(truthprt);
38  hitPlots.fill(truthhitval - hitval, trkprt.eta(), trkprt.phi(), weight);
39  }
40 }
grepfile.info
info
Definition: grepfile.py:38
MSHitDiffPlots.h
PlotBase
Definition: PlotBase.h:33
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:575
python.copyTCTOutput.sDir
sDir
Definition: copyTCTOutput.py:60
xAOD::TrackParticle_v1::eta
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
Definition: TrackParticle_v1.cxx:77
xAOD::TrackParticle_v1::summaryValue
bool summaryValue(uint8_t &value, const SummaryType &information) const
Accessor for TrackSummary values.
Definition: TrackParticle_v1.cxx:736
SG::ConstAccessor
Helper class to provide constant type-safe access to aux data.
Definition: ConstAccessor.h:54
Trk::MSHitDiffPlots::nprecLayers
Trk::HitTypePlots nprecLayers
Definition: MSHitDiffPlots.h:21
dqt_zlumi_pandas.weight
int weight
Definition: dqt_zlumi_pandas.py:200
xAOD::SummaryType
SummaryType
Enumerates the different types of information stored in Summary.
Definition: TrackingPrimitives.h:228
xAOD::numberOfTriggerEtaLayers
@ numberOfTriggerEtaLayers
layers with trigger eta hits [unit8_t].
Definition: TrackingPrimitives.h:292
Trk::MSHitDiffPlots::MSHitDiffPlots
MSHitDiffPlots(PlotBase *pParent, const std::string &sDir)
Definition: MSHitDiffPlots.cxx:11
Trk::HitTypePlots::fill
void fill(int iHits, float fEta, float fPhi, float weight=1.0)
Definition: HitTypePlots.cxx:32
xAOD::TruthParticle_v1
Class describing a truth particle in the MC record.
Definition: TruthParticle_v1.h:41
Trk::HitTypePlots
Definition: HitTypePlots.h:12
Trk::MSHitDiffPlots::fillPlot
static void fillPlot(HitTypePlots &hitPlots, const xAOD::SummaryType &info, const std::string &sInfo, const xAOD::TrackParticle &trkprt, const xAOD::TruthParticle &truthprt, float weight=1.0)
Definition: MSHitDiffPlots.cxx:26
Trk::MSHitDiffPlots::ntrigEtaLayers
Trk::HitTypePlots ntrigEtaLayers
Definition: MSHitDiffPlots.h:23
Trk::MSHitDiffPlots::nphiLayers
Trk::HitTypePlots nphiLayers
Definition: MSHitDiffPlots.h:22
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
Trk::MSHitDiffPlots::fill
void fill(const xAOD::TrackParticle &trkprt, const xAOD::TruthParticle &truthprt, float weight=1.0)
Definition: MSHitDiffPlots.cxx:19
SG::ConstAccessor::isAvailable
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:43
ConstAccessor.h
Helper class to provide constant type-safe access to aux data.
xAOD::numberOfPhiLayers
@ numberOfPhiLayers
layers with a trigger phi hit [unit8_t].
Definition: TrackingPrimitives.h:290
TrackingPrimitives.h
xAOD::TrackParticle_v1::phi
virtual double phi() const override final
The azimuthal angle ( ) of the particle (has range to .)
xAOD::numberOfPrecisionLayers
@ numberOfPrecisionLayers
layers with at least 3 hits [unit8_t].
Definition: TrackingPrimitives.h:288