ATLAS Offline Software
PhysicsAnalysis/PhysicsValidation/PhysValMonitoring/src/KinematicsPlots.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include <utility>
6 
7 
8 
9 #include "KinematicsPlots.h"
10 
11 using CLHEP::GeV;
12 
13 namespace PhysVal{
14 
15 KinematicsPlots::KinematicsPlots(PlotBase* pParent, const std::string& sDir, std::string sParticleType):PlotBase(pParent, sDir),
16 m_sParticleType(std::move(sParticleType))
17 {}
18 
20  m_lead = nullptr;
21  m_npart = 0;
22 
23  n = Book1D("n", "Number of "+ m_sParticleType +"; n ;Events", 50, 0., 50);
24 
25  et = Book1D("et", "E_{T} of "+ m_sParticleType +"; E_{T} (GeV) ;Events", 200, 0., 200);
26  eta = Book1D("eta", "#eta of " + m_sParticleType +";#eta; Events ", 200,-5,5.);
27  phi = Book1D("phi", "#varphi of " + m_sParticleType +";#varphi;Events ",128 ,-3.2,3.2);
28 
29  lead_et = Book1D("lead_et", "E_{T} of lead "+ m_sParticleType +"; E_{T} (GeV) ;Events", 200, 0., 200);
30  lead_eta = Book1D("lead_eta", "#eta of lead " + m_sParticleType +";#eta; Events ", 200,-5,5.);
31  lead_phi = Book1D("lead_phi", "#varphi of lead " + m_sParticleType +";#varphi;Events ",128 ,-3.2,3.2);
32 }
33 
35 
36  et->Fill(part->pt()/GeV,evt->beamSpotWeight());
37  eta->Fill(part->eta(),evt->beamSpotWeight());
38  phi->Fill(part->phi(),evt->beamSpotWeight());
39 
40  if (m_lead == nullptr) m_lead = part;
41 
42  if (part->pt() > m_lead->pt()) {
43  m_lead = part;
44  }
45 
46  ++m_npart;
47 }
48 
50  n->Fill(m_npart,evt->beamSpotWeight());
51 
52  if (m_lead != nullptr) {
53  lead_et->Fill(m_lead->pt()/GeV,evt->beamSpotWeight());
54  lead_eta->Fill(m_lead->eta(),evt->beamSpotWeight());
55  lead_phi->Fill(m_lead->phi(),evt->beamSpotWeight());
56  }
57 
58  m_lead = nullptr;
59 
60 }
61 
63  m_lead = nullptr;
64  m_npart = 0;
65 
66 }
67 
68 }
69 
LArG4FSStartPointFilter.part
part
Definition: LArG4FSStartPointFilter.py:21
PhysVal::KinematicsPlots::m_lead
const xAOD::IParticle * m_lead
Definition: PhysicsAnalysis/PhysicsValidation/PhysValMonitoring/src/KinematicsPlots.h:38
et
Extra patterns decribing particle interation process.
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
PhysVal::KinematicsPlots::KinematicsPlots
KinematicsPlots(PlotBase *pParent, const std::string &sDir, std::string sParticleType)
Definition: PhysicsAnalysis/PhysicsValidation/PhysValMonitoring/src/KinematicsPlots.cxx:15
KinematicsPlots.h
PlotBase
Definition: PlotBase.h:33
python.copyTCTOutput.sDir
sDir
Definition: copyTCTOutput.py:60
PhysVal::KinematicsPlots::fill
void fill(const xAOD::IParticle *part, const xAOD::EventInfo *evt)
Definition: PhysicsAnalysis/PhysicsValidation/PhysValMonitoring/src/KinematicsPlots.cxx:34
LArG4FSStartPointFilter.evt
evt
Definition: LArG4FSStartPointFilter.py:42
xAOD::IParticle
Class providing the definition of the 4-vector interface.
Definition: Event/xAOD/xAODBase/xAODBase/IParticle.h:40
PhysVal::KinematicsPlots::n
TH1 * n
Definition: PhysicsAnalysis/PhysicsValidation/PhysValMonitoring/src/KinematicsPlots.h:26
PhysVal::KinematicsPlots::phi
TH1 * phi
Definition: PhysicsAnalysis/PhysicsValidation/PhysValMonitoring/src/KinematicsPlots.h:30
PhysVal::KinematicsPlots::m_sParticleType
std::string m_sParticleType
Definition: PhysicsAnalysis/PhysicsValidation/PhysValMonitoring/src/KinematicsPlots.h:24
TH1::Fill
int Fill(double)
Definition: rootspy.cxx:285
PhysVal::KinematicsPlots::lead_phi
TH1 * lead_phi
Definition: PhysicsAnalysis/PhysicsValidation/PhysValMonitoring/src/KinematicsPlots.h:34
xAOD::IParticle::pt
virtual double pt() const =0
The transverse momentum ( ) of the particle.
PhysVal
Definition: BTagPlots.cxx:13
PhysVal::KinematicsPlots::eta
TH1 * eta
Definition: PhysicsAnalysis/PhysicsValidation/PhysValMonitoring/src/KinematicsPlots.h:29
xAOD::EventInfo_v1
Class describing the basic event information.
Definition: EventInfo_v1.h:43
PhysVal::KinematicsPlots::initializePlots
virtual void initializePlots()
Definition: PhysicsAnalysis/PhysicsValidation/PhysValMonitoring/src/KinematicsPlots.cxx:19
xAOD::IParticle::eta
virtual double eta() const =0
The pseudorapidity ( ) of the particle.
PhysVal::KinematicsPlots::lead_eta
TH1 * lead_eta
Definition: PhysicsAnalysis/PhysicsValidation/PhysValMonitoring/src/KinematicsPlots.h:33
PhysVal::KinematicsPlots::initializeEvent
void initializeEvent()
Definition: PhysicsAnalysis/PhysicsValidation/PhysValMonitoring/src/KinematicsPlots.cxx:62
xAOD::IParticle::phi
virtual double phi() const =0
The azimuthal angle ( ) of the particle.
PhysVal::KinematicsPlots::lead_et
TH1 * lead_et
Definition: PhysicsAnalysis/PhysicsValidation/PhysValMonitoring/src/KinematicsPlots.h:32
PhysVal::KinematicsPlots::m_npart
unsigned int m_npart
Definition: PhysicsAnalysis/PhysicsValidation/PhysValMonitoring/src/KinematicsPlots.h:39
GeV
#define GeV
Definition: CaloTransverseBalanceVecMon.cxx:30