ATLAS Offline Software
Loading...
Searching...
No Matches
MuonParamPlots.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
9namespace Muon{
10
11MuonParamPlots::MuonParamPlots(PlotBase *pParent, const std::string& sDir):PlotBase(pParent, sDir)
12
13{}
14
16{
17 msInnerMatchChi2 = Book1D("msInnerMatchChi2","inner match #chi^{2};inner match #chi^{2};;Entries",100,0.,100.);
18
19 ELoss = Book1D("ELoss","ELoss;ELoss [GeV];Entries",100,0,20);
20 ELossSigma = Book1D("ELossSigma","ELossSigma;ELossSgima [GeV];Entries",50,0,5);
21
22 paramELoss = Book1D("paramELoss","paramELoss;paramELoss [GeV];Entries",50,0,10);
23 measELoss = Book1D("measELoss","measELoss;measELoss [GeV];Entries",100,0,20);
24}
25
26
27 void MuonParamPlots::fill(const xAOD::Muon& mu, float weight)
28{
29 FillPlot(msInnerMatchChi2,mu,xAOD::Muon::msInnerMatchChi2, weight);
30 FillPlot(ELoss,mu,xAOD::Muon::EnergyLoss,0.001, weight);
31 FillPlot(measELoss,mu,xAOD::Muon::MeasEnergyLoss,0.001, weight);
32 FillPlot(ELossSigma,mu,xAOD::Muon::EnergyLossSigma,0.001, weight);
33 FillPlot(paramELoss,mu,xAOD::Muon::ParamEnergyLoss,0.001, weight);
34}
35
36 void MuonParamPlots::FillPlot(TH1* hist, const xAOD::Muon& mu,const xAOD::Muon::ParamDef paramDef,float scale, float weight) {
37 if (mu.author()==xAOD::Muon::CaloTag || mu.author()==xAOD::Muon::CaloLikelihood || mu.author()==xAOD::Muon::ExtrapolateMuonToIP) return; //protection
38 float fpar = 0;
39 static const SG::ConstAccessor<float> elossAcc ("EnergyLoss");
40 if (elossAcc.isAvailable(mu)) {
41 if (mu.parameter(fpar, paramDef))
42 hist->Fill(scale*fpar, weight); //scale to GeV, if needed
43 }
44 return;
45}
46
47}//namespace Muon
Helper class to provide constant type-safe access to aux data.
MuonParamPlots(PlotBase *pParent, const std::string &sDir)
void fill(const xAOD::Muon &mu, float weight=1.0)
void FillPlot(TH1 *hist, const xAOD::Muon &mu, const xAOD::Muon::ParamDef paramDef, float scale=1, float weight=1.0)
TH1D * Book1D(const std::string &name, const std::string &labels, int nBins, float start, float end, bool prependDir=true)
Book a TH1D histogram.
Definition PlotBase.cxx:94
PlotBase(PlotBase *parent, const std::string &sDir)
Definition PlotBase.cxx:29
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.
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
Muon_v1 Muon
Reference the current persistent version: