ATLAS Offline Software
ClusMomentumPlots.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include <utility>
6 
7 #include "ClusMomentumPlots.h"
8 
9 using CLHEP::GeV;
10 
11 namespace Egamma{
12 
13 
14  ClusMomentumPlots::ClusMomentumPlots(PlotBase* pParent, const std::string& sDir, std::string sParticleType):PlotBase(pParent, sDir),
15  m_sParticleType(std::move(sParticleType)),
16  secondlambda(nullptr),
17  secondr(nullptr),
18  centerlambda(nullptr),
19  engfracmax(nullptr),
20  longitudinal(nullptr),
21  lateral(nullptr)
22  {}
23 
24 
25 
27  secondlambda = Book1D("secondlambda", "Second Lambda; #lambda_{2};" + m_sParticleType, 100, 0., 10000.);
28  secondr = Book1D("secondr", "Second R; #R_{2};" + m_sParticleType, 100, 0., 5000.);
29  centerlambda = Book1D("centerlambda", "Center Lambda; #lambda_{center};" + m_sParticleType, 100, 100., 500.);
30  engfracmax = Book1D("engfracmax", "ENG_FRAC_MAX; energy fraction max ;" + m_sParticleType, 100, 0., 1.);
31  longitudinal = Book1D("longitudinal", "LONGITUDINAL; longitudinal ;" + m_sParticleType, 100, 0., 1.);
32  lateral = Book1D("lateral", "LATERAL;lateral ;" + m_sParticleType, 100, 0., 1.);
33 
34  }
35 
37 
38  float weight = 1.;
39  weight = eventInfo.beamSpotWeight();
40 
41  const xAOD::CaloCluster* cluster=egamma.caloCluster();
42  if(cluster){
43  double eng_frac_max;
44  double lon;
45  double second_lambda;
46  double lat;
47  double second_r;
48  double center_lambda;
49  if(cluster->retrieveMoment(xAOD::CaloCluster::ENG_FRAC_MAX,eng_frac_max)){
50  engfracmax->Fill(eng_frac_max,weight);
51  }
53  longitudinal->Fill(lon,weight);
54  }
55  if(cluster->retrieveMoment(xAOD::CaloCluster::SECOND_LAMBDA,second_lambda)){
56  secondlambda->Fill(second_lambda,weight);
57  }
60  }
61  if(cluster->retrieveMoment(xAOD::CaloCluster::SECOND_R,second_r)){
62  secondr->Fill(second_r,weight);
63  }
64  if(cluster->retrieveMoment(xAOD::CaloCluster::CENTER_LAMBDA,center_lambda)){
65  centerlambda->Fill(center_lambda,weight);
66  }
67  }
68  }
69 
70 }
xAOD::CaloCluster_v1::SECOND_R
@ SECOND_R
Second Moment in .
Definition: CaloCluster_v1.h:123
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
Egamma::ClusMomentumPlots::m_sParticleType
std::string m_sParticleType
Definition: ClusMomentumPlots.h:21
Egamma
Definition: ClusMomentumPlots.cxx:11
python.copyTCTOutput.sDir
sDir
Definition: copyTCTOutput.py:60
xAOD::CaloCluster_v1::CENTER_LAMBDA
@ CENTER_LAMBDA
Shower depth at Cluster Centroid.
Definition: CaloCluster_v1.h:136
xAOD::Egamma_v1
Definition: Egamma_v1.h:56
Egamma::ClusMomentumPlots::longitudinal
TH1 * longitudinal
Definition: ClusMomentumPlots.h:27
xAOD::CaloCluster_v1::ENG_FRAC_MAX
@ ENG_FRAC_MAX
Energy fraction of hottest cell.
Definition: CaloCluster_v1.h:140
egamma
Definition: egamma.h:58
xAOD::CaloCluster_v1::SECOND_LAMBDA
@ SECOND_LAMBDA
Second Moment in .
Definition: CaloCluster_v1.h:124
dqt_zlumi_pandas.weight
int weight
Definition: dqt_zlumi_pandas.py:200
Egamma::ClusMomentumPlots::ClusMomentumPlots
ClusMomentumPlots(PlotBase *pParent, const std::string &sDir, std::string sParticleType)
Definition: ClusMomentumPlots.cxx:14
xAOD::CaloCluster_v1
Description of a calorimeter cluster.
Definition: CaloCluster_v1.h:59
Egamma::ClusMomentumPlots::fill
void fill(const xAOD::Egamma &egamma, const xAOD::EventInfo &eventInfo)
Definition: ClusMomentumPlots.cxx:36
Egamma::ClusMomentumPlots::secondr
TH1 * secondr
Definition: ClusMomentumPlots.h:24
xAOD::CaloCluster_v1::retrieveMoment
bool retrieveMoment(MomentType type, double &value) const
Retrieve individual moment.
Definition: CaloCluster_v1.cxx:738
Egamma::ClusMomentumPlots::initializePlots
virtual void initializePlots()
Definition: ClusMomentumPlots.cxx:26
TH1::Fill
int Fill(double)
Definition: rootspy.cxx:285
Egamma::ClusMomentumPlots::secondlambda
TH1 * secondlambda
Definition: ClusMomentumPlots.h:23
xAOD::EventInfo_v1
Class describing the basic event information.
Definition: EventInfo_v1.h:43
PlotCalibFromCool.lat
lat
Definition: PlotCalibFromCool.py:867
Egamma::ClusMomentumPlots::centerlambda
TH1 * centerlambda
Definition: ClusMomentumPlots.h:25
xAOD::CaloCluster_v1::LATERAL
@ LATERAL
Normalized lateral moment.
Definition: CaloCluster_v1.h:137
Egamma::ClusMomentumPlots::lateral
TH1 * lateral
Definition: ClusMomentumPlots.h:28
Egamma::ClusMomentumPlots::engfracmax
TH1 * engfracmax
Definition: ClusMomentumPlots.h:26
xAOD::CaloCluster_v1::LONGITUDINAL
@ LONGITUDINAL
Normalized longitudinal moment.
Definition: CaloCluster_v1.h:138
GeV
#define GeV
Definition: CaloTransverseBalanceVecMon.cxx:30
xAOD::EventInfo_v1::beamSpotWeight
float beamSpotWeight() const
Weight for beam spot size reweighting.
Definition: EventInfo_v1.cxx:970
ClusMomentumPlots.h