ATLAS Offline Software
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 
10 namespace 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 
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 
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
covarianceTool.ndf
ndf
Definition: covarianceTool.py:678
xAOD::SlowMuon_v1::caloBetaRms
float caloBetaRms() const
Returns.
xAOD::SlowMuon_v1
Class describing a SlowMuon.
Definition: SlowMuon_v1.h:26
xAOD::SlowMuon_v1::mdtBetaChi2
float mdtBetaChi2() const
Returns.
PlotBase
Definition: PlotBase.h:34
xAOD::SlowMuon_v1::mdtBetaDof
int mdtBetaDof() const
Returns.
Muon::SlowMuonParamPlots::mdtBeta
BetaPlots mdtBeta
Definition: SlowMuonParamPlots.h:41
Muon::BetaPlots::BetaPlots
BetaPlots(PlotBase *pParent, const std::string &sDir, std::string sDetType)
Definition: SlowMuonParamPlots.cxx:12
python.copyTCTOutput.sDir
sDir
Definition: copyTCTOutput.py:60
Muon::BetaPlots::avg
TH1 * avg
Definition: SlowMuonParamPlots.h:21
Muon::BetaPlots::fill
void fill(const xAOD::SlowMuon &smu, float weight=1.0)
Definition: SlowMuonParamPlots.cxx:34
Muon::SlowMuonParamPlots::initializePlots
void initializePlots()
Definition: SlowMuonParamPlots.cxx:85
Muon::BetaPlots::ndf
TH1 * ndf
Definition: SlowMuonParamPlots.h:23
Muon::BetaPlots::m_sDetType
std::string m_sDetType
Definition: SlowMuonParamPlots.h:29
xAOD::SlowMuon_v1::rpcBetaDof
int rpcBetaDof() const
Returns.
xAOD::SlowMuon_v1::rpcBetaChi2
float rpcBetaChi2() const
Returns.
Muon
This class provides conversion from CSC RDO data to CSC Digits.
Definition: TrackSystemController.h:45
Muon::SlowMuonParamPlots::caloBeta
BetaPlots caloBeta
Definition: SlowMuonParamPlots.h:43
xAOD::SlowMuon_v1::nTileCells
int nTileCells() const
Returns.
xAOD::SlowMuon_v1::rpcBetaAvg
float rpcBetaAvg() const
dqt_zlumi_pandas.weight
int weight
Definition: dqt_zlumi_pandas.py:189
PlotBase::Book1D
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
Muon::SlowMuonParamPlots::fill
void fill(const xAOD::SlowMuon &smu, float weight=1.0)
Definition: SlowMuonParamPlots.cxx:90
Muon::BetaPlots::initializePlots
void initializePlots()
Definition: SlowMuonParamPlots.cxx:23
xAOD::SlowMuon_v1::mdtBetaAvg
float mdtBetaAvg() const
Muon::BetaPlots::chi2ndf
TH1 * chi2ndf
Definition: SlowMuonParamPlots.h:24
Recovery.avg
def avg(a, b)
Definition: Recovery.py:79
Muon::BetaPlots::rms
TH1 * rms
Definition: SlowMuonParamPlots.h:26
xAOD::SlowMuon_v1::caloBetaDof
int caloBetaDof() const
Returns.
Muon::SlowMuonParamPlots::SlowMuonParamPlots
SlowMuonParamPlots(PlotBase *pParent, const std::string &sDir)
Definition: SlowMuonParamPlots.cxx:77
SlowMuonParamPlots.h
chi2
double chi2(TH1 *h0, TH1 *h1)
Definition: comparitor.cxx:522
Muon::BetaPlots::chi2prob
TH1 * chi2prob
Definition: SlowMuonParamPlots.h:25
xAOD::SlowMuon_v1::beta
float beta() const
Muon::BetaPlots::chi2
TH1 * chi2
Definition: SlowMuonParamPlots.h:22
xAOD::SlowMuon_v1::nRpcHits
int nRpcHits() const
xAOD::SlowMuon_v1::rpcBetaRms
float rpcBetaRms() const
Returns.
beamspotnt.rms
rms
Definition: bin/beamspotnt.py:1266
Muon::SlowMuonParamPlots::beta
TH1 * beta
Definition: SlowMuonParamPlots.h:40
xAOD::SlowMuon_v1::caloBetaAvg
float caloBetaAvg() const
Muon::SlowMuonParamPlots::rpcBeta
BetaPlots rpcBeta
Definition: SlowMuonParamPlots.h:42
xAOD::SlowMuon_v1::mdtBetaRms
float mdtBetaRms() const
Returns.
MuonParameters::beta
@ beta
Definition: MuonParamDefs.h:144
xAOD::SlowMuon_v1::caloBetaChi2
float caloBetaChi2() const
Returns.
Muon::BetaPlots::nHits
TH1 * nHits
Definition: SlowMuonParamPlots.h:20