ATLAS Offline Software
Loading...
Searching...
No Matches
SlowMuonParamPlots.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3*/
4
5#include <utility>
6
8#include "TMath.h" // for TMath::Prob()
9
10namespace Muon{
11
12 BetaPlots::BetaPlots(PlotBase *pParent, const std::string& sDir, std::string sDetType)
13 :PlotBase(pParent, sDir)
14 , nHits(nullptr)
15 , avg(nullptr)
16 , chi2(nullptr)
17 , ndf(nullptr)
18 , chi2ndf(nullptr)
19 , chi2prob(nullptr)
20 , rms(nullptr)
21 , m_sDetType(std::move(sDetType))
22{}
24{
25 nHits = Book1D( m_sDetType+"nHits", "; hits;Entries",20,0,20);
26 avg = Book1D( m_sDetType+"avg", "; avg;Entries",20,0,20);
27 chi2 = Book1D( m_sDetType+"chi2", "; chi2;Entries",20,0,20);
28 ndf = Book1D( m_sDetType+"ndf", "; ndf;Entries",20,0,20);
29 chi2ndf = Book1D( m_sDetType+"chi2ndf", "; chi2/ndf;Entries",20,0,5);
30 chi2prob = Book1D( m_sDetType+"chi2prob", "; chi2 prob;Entries",20,0,1);
31 rms = Book1D( m_sDetType+"rms", "; rms;Entries",20,0,20);
32}
33
34 void BetaPlots::fill(const xAOD::SlowMuon& smu, float weight)
35{
36 if (m_sDetType=="rpc" || m_sDetType=="Rpc" || m_sDetType=="RPC") {
37 nHits->Fill( smu.nRpcHits(), weight );
38 ndf->Fill( smu.rpcBetaDof(), weight );
39 if (smu.rpcBetaDof()>0) {
40 avg->Fill( smu.rpcBetaAvg(), weight );
41 rms->Fill( smu.rpcBetaRms(), weight );
42 chi2->Fill( smu.rpcBetaChi2(), weight );
43 ndf->Fill( smu.rpcBetaDof(), weight );
44 chi2ndf->Fill( smu.rpcBetaChi2()/smu.rpcBetaDof(), weight );
45 chi2prob->Fill( TMath::Prob(smu.rpcBetaChi2(), smu.rpcBetaDof()), weight );
46 }
47 }
48 else if (m_sDetType=="mdt" || m_sDetType=="Mdt" || m_sDetType=="MDT") {
49 //nHits->Fill( smu.nMdtHits() );
50 ndf->Fill( smu.mdtBetaDof(), weight );
51 if (smu.mdtBetaDof()>0) {
52 avg->Fill( smu.mdtBetaAvg(), weight );
53 rms->Fill( smu.mdtBetaRms(), weight );
54 chi2->Fill( smu.mdtBetaChi2(), weight );
55 ndf->Fill( smu.mdtBetaDof(), weight );
56 chi2ndf->Fill( smu.mdtBetaChi2()/smu.mdtBetaDof(), weight );
57 chi2prob->Fill( TMath::Prob(smu.mdtBetaChi2(), smu.mdtBetaDof()), weight );
58 }
59 }
60 else if (m_sDetType=="calo" || m_sDetType=="Calo" || m_sDetType=="CALO") {
61 nHits->Fill( smu.nTileCells(), weight );
62 ndf->Fill( smu.caloBetaDof(), weight );
63 if (smu.caloBetaDof()>0) {
64 avg->Fill( smu.caloBetaAvg(), weight );
65 rms->Fill( smu.caloBetaRms(), weight );
66 chi2->Fill( smu.caloBetaChi2(), weight );
67 ndf->Fill( smu.caloBetaDof(), weight );
68 chi2ndf->Fill( smu.caloBetaChi2()/smu.caloBetaDof(),weight );
69 chi2prob->Fill( TMath::Prob(smu.caloBetaChi2(), smu.caloBetaDof()), weight );
70 }
71 }
72
73}
74
76
77SlowMuonParamPlots::SlowMuonParamPlots(PlotBase *pParent, const std::string& sDir)
78 :PlotBase(pParent, sDir)
79 , beta(nullptr)
80 , mdtBeta(this,"","MDT")
81 , rpcBeta(this,"","RPC")
82 , caloBeta(this,"","CALO")
83{}
84
86{
87 beta = Book1D("beta", "beta;beta;Entries",150,0,1.5);
88}
89
90 void SlowMuonParamPlots::fill(const xAOD::SlowMuon& smu, float weight)
91{
92 beta->Fill( smu.beta(), weight );
93 mdtBeta.fill( smu , weight);
94 rpcBeta.fill( smu, weight );
95 caloBeta.fill( smu, weight );
96
97}
98
99} //close namespace Muon
BetaPlots(PlotBase *pParent, const std::string &sDir, std::string sDetType)
void fill(const xAOD::SlowMuon &smu, float weight=1.0)
SlowMuonParamPlots(PlotBase *pParent, const std::string &sDir)
void fill(const xAOD::SlowMuon &smu, 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
float mdtBetaChi2() const
Returns.
int caloBetaDof() const
Returns.
int nRpcHits() const
int mdtBetaDof() const
Returns.
float rpcBetaRms() const
Returns.
float caloBetaAvg() const
float beta() const
float rpcBetaChi2() const
Returns.
float rpcBetaAvg() const
float caloBetaChi2() const
Returns.
float caloBetaRms() const
Returns.
float mdtBetaRms() const
Returns.
float mdtBetaAvg() const
int nTileCells() const
Returns.
int rpcBetaDof() const
Returns.
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
STL namespace.
SlowMuon_v1 SlowMuon
Reference the current persistent version:
Definition SlowMuon.h:13