ATLAS Offline Software
Loading...
Searching...
No Matches
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
9using CLHEP::GeV;
10
11namespace 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 }
59 lateral->Fill(lat,weight);
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}
ClusMomentumPlots(PlotBase *pParent, const std::string &sDir, std::string sParticleType)
void fill(const xAOD::Egamma &egamma, const xAOD::EventInfo &eventInfo)
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
elec/gamma data class.
Definition egamma.h:58
bool retrieveMoment(MomentType type, double &value) const
Retrieve individual moment.
@ SECOND_LAMBDA
Second Moment in .
@ LATERAL
Normalized lateral moment.
@ LONGITUDINAL
Normalized longitudinal moment.
@ ENG_FRAC_MAX
Energy fraction of hottest cell.
@ SECOND_R
Second Moment in .
@ CENTER_LAMBDA
Shower depth at Cluster Centroid.
float beamSpotWeight() const
Weight for beam spot size reweighting.
STL namespace.
EventInfo_v1 EventInfo
Definition of the latest event info version.
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
Egamma_v1 Egamma
Definition of the current "egamma version".
Definition Egamma.h:17