ATLAS Offline Software
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 
9 namespace Muon{
10 
11 MuonParamPlots::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 
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
PlotBase::Book1D
TH1F * 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:88
PlotBase
Definition: PlotBase.h:33
Muon::MuonParamPlots::measELoss
TH1 * measELoss
Definition: MuonParamPlots.h:26
python.copyTCTOutput.sDir
sDir
Definition: copyTCTOutput.py:60
plotmaker.hist
hist
Definition: plotmaker.py:148
Muon::MuonParamPlots::fill
void fill(const xAOD::Muon &mu, float weight=1.0)
Definition: MuonParamPlots.cxx:27
egammaParameters::ParamDef
ParamDef
Definition: egammaParamDefs.h:99
SG::ConstAccessor< float >
Muon
This class provides conversion from CSC RDO data to CSC Digits.
Definition: TrackSystemController.h:49
yodamerge_tmp.scale
scale
Definition: yodamerge_tmp.py:138
MuonParameters::CaloTag
@ CaloTag
Definition: MuonParamDefs.h:64
Muon::MuonParamPlots::paramELoss
TH1 * paramELoss
Definition: MuonParamPlots.h:25
Muon::MuonParamPlots::initializePlots
void initializePlots()
Definition: MuonParamPlots.cxx:15
xAOD::Muon_v1
Class describing a Muon.
Definition: Muon_v1.h:38
Muon::MuonParamPlots::MuonParamPlots
MuonParamPlots(PlotBase *pParent, const std::string &sDir)
Definition: MuonParamPlots.cxx:11
Muon::MuonParamPlots::msInnerMatchChi2
TH1 * msInnerMatchChi2
Definition: MuonParamPlots.h:20
dqt_zlumi_pandas.weight
int weight
Definition: dqt_zlumi_pandas.py:200
Muon::MuonParamPlots::ELossSigma
TH1 * ELossSigma
Definition: MuonParamPlots.h:24
MuonParameters::ExtrapolateMuonToIP
@ ExtrapolateMuonToIP
Definition: MuonParamDefs.h:68
Muon::MuonParamPlots::ELoss
TH1 * ELoss
Definition: MuonParamPlots.h:23
TH1
Definition: rootspy.cxx:268
SG::ConstAccessor::isAvailable
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
Muon::MuonParamPlots::FillPlot
void FillPlot(TH1 *hist, const xAOD::Muon &mu, const xAOD::Muon::ParamDef paramDef, float scale=1, float weight=1.0)
Definition: MuonParamPlots.cxx:36
ConstAccessor.h
Helper class to provide constant type-safe access to aux data.
MuonParameters::CaloLikelihood
@ CaloLikelihood
Definition: MuonParamDefs.h:65
CaloNoise_fillDB.mu
mu
Definition: CaloNoise_fillDB.py:53
TrackingPrimitives.h
MuonParamPlots.h