ATLAS Offline Software
PFOPlots.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
7 namespace PFO {
8 
9  PFOPlots::PFOPlots(PlotBase* pParent, const std::string & sDir, const std::string & sFEContainerName) : PlotBase(pParent, sDir), m_sFEContainerName(sFEContainerName){
10 
11  }
12 
14  if(!m_sFEContainerName.empty()){
15  //book Flow Element histograms
16  m_FE_pt = Book1D("_Pt",m_sFEContainerName + "_Pt (Entries/1 GeV)",30,-10.0,20.0);
17  m_FE_eta = Book1D("_Eta",m_sFEContainerName + "_Eta (Entries/0.1)",100,-5.0,5.0);
18  m_FE_phi = Book1D("_Phi",m_sFEContainerName + "_Phi (Entries/0.1)",64,-3.2,3.2);
19  m_FE_m = Book1D("_m",m_sFEContainerName + "_m (Entries/100 MeV)",10,0.0,0.5);
20  m_FE_charge = Book1D("_charge",m_sFEContainerName + "_charge (Entries/unit charge)",5,-2,2);
21 
22  m_FE_pt_low = Book1D("_Pt_low",m_sFEContainerName + "_Pt_low (Entries/1 GeV, pT <= 5 GeV)",15,-10.0,5.0);
23  m_FE_pt_middle = Book1D("_Pt_middle",m_sFEContainerName + "_Pt_middle (Entries/1 GeV), 20 > pT > 5 GeV",45,5.0,50.0);
24  m_FE_pt_high = Book1D("_Pt_high",m_sFEContainerName + "_Pt_high (Entries/1 GeV), Pt > 20 GeV",45,5.0,50.0);
25 
26  m_FE_pt_etaBinA = Book1D("_Pt_A",m_sFEContainerName + "_Pt (Entries/1 GeV, |eta| < 1 )",30,-10.0,20.0);
27  m_FE_pt_etaBinB = Book1D("_Pt_B",m_sFEContainerName + "_Pt (Entries/1 GeV, 1 <= |eta| < 2 )",30,-10.0,20.0);
28  m_FE_pt_etaBinC = Book1D("_Pt_C",m_sFEContainerName + "_Pt (Entries/1 GeV, |eta| >= 2 )",30,-10.0,20.0);
29  m_FE_eta_posE=Book1D("_EtaPosE",m_sFEContainerName+"_Eta (E>0) (Entries/0.1)",100,-5.0,5.0);
30  }
31  }
32 
33  void PFOPlots::fill(const xAOD::FlowElement& FE, const xAOD::EventInfo& eventInfo){
34  m_FE_pt->Fill(FE.pt()/1000.0,eventInfo.beamSpotWeight());
35  m_FE_eta->Fill(FE.eta(),eventInfo.beamSpotWeight());
36  m_FE_phi->Fill(FE.phi(),eventInfo.beamSpotWeight());
37  m_FE_m->Fill(FE.m()/1000.0,eventInfo.beamSpotWeight());
38  m_FE_charge->Fill(FE.charge(),eventInfo.beamSpotWeight());
39 
40  if (FE.pt()/1000.0 <= 5) m_FE_pt_low->Fill(FE.pt()/1000.0,eventInfo.beamSpotWeight());
41  else if (20 >= FE.pt()/1000.0 && FE.pt()/1000.0 > 4) m_FE_pt_middle->Fill(FE.pt()/1000.0,eventInfo.beamSpotWeight());
42  else m_FE_pt_high->Fill(FE.pt()/1000.0,eventInfo.beamSpotWeight());
43 
44  if (fabs(FE.eta()) < 1) m_FE_pt_etaBinA->Fill(FE.pt()/1000.0,eventInfo.beamSpotWeight());
45  else if (fabs(FE.eta()) < 2) m_FE_pt_etaBinB->Fill(FE.pt()/1000.0,eventInfo.beamSpotWeight());
46  else m_FE_pt_etaBinC->Fill(FE.pt()/1000.0,eventInfo.beamSpotWeight());
47  // additional debug plot: Eta given FlowElem energy>0
48  if (FE.e()>0){
49  m_FE_eta_posE->Fill(FE.eta(),eventInfo.beamSpotWeight());
50  }
51  }
52 
53 }
PFO::PFOPlots::m_FE_pt_low
TH1 * m_FE_pt_low
Pt Hisrogram binned in pt.
Definition: PFOPlots.h:33
PlotBase
Definition: PlotBase.h:34
xAOD::FlowElement_v1::m
virtual double m() const override
The invariant mass of the particle.
PFOPlots.h
python.copyTCTOutput.sDir
sDir
Definition: copyTCTOutput.py:60
PFO::PFOPlots::m_FE_pt_high
TH1 * m_FE_pt_high
Definition: PFOPlots.h:35
PFO::PFOPlots::m_FE_pt
TH1 * m_FE_pt
Definition: PFOPlots.h:26
PFO::PFOPlots::m_FE_charge
TH1 * m_FE_charge
Definition: PFOPlots.h:30
xAOD::FlowElement_v1::phi
virtual double phi() const override
The azimuthal angle ( ) of the particle.
xAOD::FlowElement_v1::pt
virtual double pt() const override
PFO::PFOPlots::m_FE_eta
TH1 * m_FE_eta
Definition: PFOPlots.h:27
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
PFO::PFOPlots::m_FE_pt_etaBinA
TH1 * m_FE_pt_etaBinA
Pt Histogram binned in eta.
Definition: PFOPlots.h:40
PFO::PFOPlots::m_FE_phi
TH1 * m_FE_phi
Definition: PFOPlots.h:28
PFO::PFOPlots::initializePlots
void initializePlots()
Definition: PFOPlots.cxx:13
PFO::PFOPlots::m_FE_pt_middle
TH1 * m_FE_pt_middle
Definition: PFOPlots.h:34
xAOD::FlowElement_v1::charge
float charge() const
PFO::PFOPlots::m_sFEContainerName
std::string m_sFEContainerName
Definition: PFOPlots.h:45
PFO::PFOPlots::m_FE_pt_etaBinC
TH1 * m_FE_pt_etaBinC
Definition: PFOPlots.h:42
PFO
Definition: ClusterMomentPlots.h:15
xAOD::FlowElement_v1::e
virtual double e() const override
The total energy of the particle.
Definition: FlowElement_v1.cxx:25
PFO::PFOPlots::m_FE_pt_etaBinB
TH1 * m_FE_pt_etaBinB
Definition: PFOPlots.h:41
PFO::PFOPlots::PFOPlots
PFOPlots(PlotBase *pParent, const std::string &sDir, const std::string &sFEContainerName)
Definition: PFOPlots.cxx:9
xAOD::EventInfo_v1
Class describing the basic event information.
Definition: EventInfo_v1.h:43
xAOD::FlowElement_v1::eta
virtual double eta() const override
The pseudorapidity ( ) of the particle.
PFO::PFOPlots::m_FE_eta_posE
TH1 * m_FE_eta_posE
Definition: PFOPlots.h:37
PFO::PFOPlots::fill
void fill(const xAOD::FlowElement &FE, const xAOD::EventInfo &eventInfo)
Definition: PFOPlots.cxx:33
PFO::PFOPlots::m_FE_m
TH1 * m_FE_m
Definition: PFOPlots.h:29
xAOD::EventInfo_v1::beamSpotWeight
float beamSpotWeight() const
Weight for beam spot size reweighting.
Definition: EventInfo_v1.cxx:970
xAOD::FlowElement_v1
A detector object made of other lower level object(s)
Definition: FlowElement_v1.h:25