ATLAS Offline Software
Loading...
Searching...
No Matches
ShowerShapesHistograms.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
8#include "GaudiKernel/ITHistSvc.h"
11
12#include "TH1D.h"
13#include "TH2D.h"
14
15using namespace egammaMonitoring;
16
18
19 const char* fN = m_name.c_str();
20
21 histoMap["hadleak"] = new TH1D(Form("%s_hadleak",fN), ";E_{hadleak}; Events" , 100, -0.07, 0.13 );
22 histoMap["rhad"] = new TH1D(Form("%s_rhad",fN) , ";R_{had}; Events" , 100, -0.07, 0.13 );
23 histoMap["reta"] = new TH1D(Form("%s_reta",fN) , ";R_{#eta}; Events" , 355, 0. , 1.1005);
24 histoMap["rphi"] = new TH1D(Form("%s_rphi",fN) , ";R_{#phi}; Events" , 355, 0. , 1.1005);
25 histoMap["weta2"] = new TH1D(Form("%s_weta2",fN) , ";W_{#etas2}; Events" , 100, 0. , 0.03 );
26 histoMap["eratio"] = new TH1D(Form("%s_eratio",fN) , ";E_{ratio}; Events" , 101, 0. , 1.01 );
27 histoMap["deltae"] = new TH1D(Form("%s_deltae",fN) , ";#DeltaE [MeV]; Events" , 100, 0. , 500. );
28 histoMap["f1"] = new TH1D(Form("%s_f1",fN) , ";f_{1}; Events" , 100, 0. , 1.0 );
29 histoMap["fside"] = new TH1D(Form("%s_fside",fN) , ";f_{side}; Events" , 100, 0. , 2.0 );
30 histoMap["wtots1"] = new TH1D(Form("%s_wtots1",fN) , ";w_{s, tot}; Events" , 100, 0. , 10. );
31 histoMap["ws3"] = new TH1D(Form("%s_ws3",fN) , ";w_{s, 3}; Events" , 100, 0. , 1. );
32
33 histoMap["lateral"] = new TH1D(Form("%s_lateral",fN), ";Lateral of seed; Events" , 50, 0. , 1. );
34 histoMap["second_R"] = new TH1D(Form("%s_second_R",fN), ";Second R; Events" , 150, 0. , 15000. );
35 histoMap["EMFrac"] = new TH1D(Form("%s_EMFrac",fN), ";EMFrac; Events" , 51, 0. , 1.02 );
36 histo2DMap["lateral_second_R_2D"] = new TH2D(Form("%s_lateral_second_R_2D",fN), ";Lateral of seed; Second R", 50, 0, 1, 150,0.,15000.);
37
38 ATH_CHECK(m_rootHistSvc->regHist(m_folder+"lateral", histoMap["lateral"]));
39 ATH_CHECK(m_rootHistSvc->regHist(m_folder+"second_R", histoMap["second_R"]));
40 ATH_CHECK(m_rootHistSvc->regHist(m_folder+"EMFrac", histoMap["EMFrac"]));
41 ATH_CHECK(m_rootHistSvc->regHist(m_folder+"lateral_second_R_2D", histo2DMap["lateral_second_R_2D"]));
42
43 ATH_CHECK(m_rootHistSvc->regHist(m_folder+"rhad", histoMap["rhad"]));
44 ATH_CHECK(m_rootHistSvc->regHist(m_folder+"hadleak", histoMap["hadleak"]));
45 ATH_CHECK(m_rootHistSvc->regHist(m_folder+"reta", histoMap["reta"]));
46 ATH_CHECK(m_rootHistSvc->regHist(m_folder+"rphi", histoMap["rphi"]));
47 ATH_CHECK(m_rootHistSvc->regHist(m_folder+"weta2", histoMap["weta2"]));
48 ATH_CHECK(m_rootHistSvc->regHist(m_folder+"eratio", histoMap["eratio"]));
49 ATH_CHECK(m_rootHistSvc->regHist(m_folder+"deltae", histoMap["deltae"]));
50 ATH_CHECK(m_rootHistSvc->regHist(m_folder+"f1", histoMap["f1"]));
51 ATH_CHECK(m_rootHistSvc->regHist(m_folder+"fside", histoMap["fside"]));
52 ATH_CHECK(m_rootHistSvc->regHist(m_folder+"wtots1", histoMap["wtots1"]));
53 ATH_CHECK(m_rootHistSvc->regHist(m_folder+"ws3", histoMap["ws3"]));
54
55 return StatusCode::SUCCESS;
56
57} // initializePlots
58
60
62
63 const xAOD::CaloCluster *topoClus(nullptr);
64 if (isFwd)
65 topoClus = egamma.caloCluster();
66 else
67 topoClus =
69
70 double lateral(0.);
71 double emfrac(0.);
72 double second_r(0.);
73 bool hasBoth = true;
75 histoMap["EMFrac"]->Fill(emfrac);
76
77 if (topoClus->retrieveMoment(xAOD::CaloCluster::LATERAL,lateral))
78 histoMap["lateral"]->Fill(lateral);
79 else
80 hasBoth = false;
81
82 if (topoClus->retrieveMoment(xAOD::CaloCluster::SECOND_R,second_r))
83 histoMap["second_R"]->Fill(second_r);
84 else
85 hasBoth = false;
86
87 if (hasBoth)
88 histo2DMap["lateral_second_R_2D"]->Fill(lateral,second_r);
89
90 // maybe L2, L3 shapes (e.g. Reta, Rphi, weta2) could be computed for electron in innerwheel,
91 // but certainly not L1
92 if (!isFwd) {
93
94 float eta2 = std::abs(egamma.caloCluster()->etaBE(2));
95 float rhad = -999;
96 float Reta = -999;
97 float Rphi = -999;
98 float shweta2 = -999;
99 float Eratio = -999;
100 float DeltaE = -999;
101 float frac_f1 = -999;
102 float shfside = -999;
103 float shwtots1 = -999;
104 float shws3 = -999;
105
106 if (egamma.showerShapeValue(rhad, xAOD::EgammaParameters::Rhad)) {
107 histoMap["rhad"]->Fill(rhad);
108 float rhad1 = -999;
109 if (egamma.showerShapeValue(rhad1, xAOD::EgammaParameters::Rhad1)) {
110 float hadrleak = (eta2 >= 0.8 && eta2 < 1.37) ? rhad : rhad1;
111 histoMap["hadleak"]->Fill(hadrleak);
112 }
113 }
114 if (egamma.showerShapeValue(Reta, xAOD::EgammaParameters::Reta))
115 histoMap["reta"]->Fill(Reta);
116 if (egamma.showerShapeValue(Rphi, xAOD::EgammaParameters::Rphi))
117 histoMap["rphi"]->Fill(Rphi);
118 if (egamma.showerShapeValue(shweta2, xAOD::EgammaParameters::weta2))
119 histoMap["weta2"]->Fill(shweta2);
120 if (egamma.showerShapeValue(frac_f1, xAOD::EgammaParameters::f1))
121 histoMap["f1"]->Fill(frac_f1);
122 // Only fill S1 variables if there some energy in S1 (to avoid under/overflows
123 if (frac_f1 != 0) {
124 if (egamma.showerShapeValue(Eratio, xAOD::EgammaParameters::Eratio))
125 histoMap["eratio"]->Fill(Eratio);
126 if (egamma.showerShapeValue(DeltaE, xAOD::EgammaParameters::DeltaE))
127 histoMap["deltae"]->Fill(DeltaE);
128 if (egamma.showerShapeValue(shfside, xAOD::EgammaParameters::fracs1))
129 histoMap["fside"]->Fill(shfside);
130 if (egamma.showerShapeValue(shwtots1, xAOD::EgammaParameters::wtots1))
131 histoMap["wtots1"]->Fill(shwtots1);
132 if (egamma.showerShapeValue(shws3, xAOD::EgammaParameters::weta1))
133 histoMap["ws3"]->Fill(shws3);
134 }
135 }
136}
#define ATH_CHECK
Evaluate an expression and check for errors.
std::map< std::string, TH2D * > histo2DMap
elec/gamma data class.
Definition egamma.h:58
bool retrieveMoment(MomentType type, double &value) const
Retrieve individual moment.
@ LATERAL
Normalized lateral moment.
@ ENG_FRAC_EM
Energy fraction in EM calorimeters.
@ SECOND_R
Second Moment in .
bool isFwdElectron(const xAOD::Egamma *eg)
is the object a Fwd electron
std::vector< const xAOD::CaloCluster * > getAssociatedTopoClusters(const xAOD::CaloCluster *cluster)
Return a vector of all the topo clusters associated with the egamma cluster.
@ wtots1
shower width is determined in a window detaxdphi = 0,0625 ×~0,2, corresponding typically to 20 strips...
@ f1
E1/E = fraction of energy reconstructed in the first sampling, where E1 is energy in all strips belon...
Definition EgammaEnums.h:53
@ Eratio
(emaxs1-e2tsts1)/(emaxs1+e2tsts1)
@ DeltaE
e2tsts1-emins1
@ fracs1
shower shape in the shower core : [E(+/-3)-E(+/-1)]/E(+/-1), where E(+/-n) is the energy in ± n strip...
@ weta2
the lateral width is calculated with a window of 3x5 cells using the energy weighted sum over all cel...
@ weta1
shower width using +/-3 strips around the one with the maximal energy deposit: w3 strips = sqrt{sum(E...
Definition EgammaEnums.h:98
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