ATLAS Offline Software
Loading...
Searching...
No Matches
e1hg_systematics Class Reference

#include <e1hg_systematics.h>

Collaboration diagram for e1hg_systematics:

Public Member Functions

 e1hg_systematics (const std::string &filename)
 constructor (initialization done there reading root files)
 ~e1hg_systematics ()
double getAlpha (int particle_type, double energy, double eta, bool interpolate=false) const
 particle_type = 0 (electrons), 1 (unconv photons), 2 (conv photons)

Private Attributes

TH1D * m_helec [8]
TH1D * m_hphot [8]
TH1D * m_hphot2 [8]
TFile * m_file0
const TArrayD * m_etBins

Detailed Description

Definition at line 18 of file e1hg_systematics.h.

Constructor & Destructor Documentation

◆ e1hg_systematics()

e1hg_systematics::e1hg_systematics ( const std::string & filename)

constructor (initialization done there reading root files)

Definition at line 13 of file e1hg_systematics.cxx.

13 {
14
15 m_file0 = TFile::Open(filename.c_str());
16
17 for (Int_t ieta = 0; ieta < 8; ieta++) {
18 char name[60];
19 sprintf(name, "elec_%d", ieta);
20 m_helec[ieta] = (TH1D*)m_file0->Get(name);
21 sprintf(name, "unconv_%d", ieta);
22 m_hphot[ieta] = (TH1D*)m_file0->Get(name);
23 sprintf(name, "conv_%d", ieta);
24 m_hphot2[ieta] = (TH1D*)m_file0->Get(name);
25 }
26
27 TAxis* aa = m_helec[0]->GetXaxis();
28 m_etBins = aa->GetXbins();
29}
const TArrayD * m_etBins

◆ ~e1hg_systematics()

e1hg_systematics::~e1hg_systematics ( )

Definition at line 32 of file e1hg_systematics.cxx.

32 {
33 m_file0->Close();
34}

Member Function Documentation

◆ getAlpha()

double e1hg_systematics::getAlpha ( int particle_type,
double energy,
double eta,
bool interpolate = false ) const

particle_type = 0 (electrons), 1 (unconv photons), 2 (conv photons)

energy = energy in MeV

eta

return value alpha Ebiased = E*(1 + alpha)

Definition at line 43 of file e1hg_systematics.cxx.

44 {
45
46 // cout << " in getDelta " << endl;
47 if (particle_type < 0 || particle_type > 2)
48 return 0.;
49
50 float aeta = fabs(eta);
51 int ieta = 0;
52 if (aeta < 0.4)
53 ieta = 0;
54 else if (aeta < 0.8)
55 ieta = 1;
56 else if (aeta < 1.1)
57 ieta = 2;
58 else if (aeta < 1.37)
59 ieta = 3;
60 else if (aeta < 1.52)
61 ieta = 4;
62 else if (aeta < 1.80)
63 ieta = 5;
64 else if (aeta < 2.10)
65 ieta = 6;
66 else
67 ieta = 7;
68
69 double energyGeV = energy * 0.001;
70 double et = energyGeV / std::cosh(eta);
71
72 int ibinEt = m_etBins->GetSize() - 2;
73 for (int i = 1; i < m_etBins->GetSize(); i++) {
74 if (et < m_etBins->GetAt(i)) {
75 ibinEt = i - 1;
76 break;
77 }
78 }
79
80 // cout << " energy, et , ibinEt " << energyGeV << " " << et << " " <<
81 // ibinEt << endl;
82
83 Double_t scale = 0.;
84 // HACK: some ES model dependency needs to be introduced
85 /*Default up to es2017_summer
86 if (aeta<1.80) scale=0.;
87 else if (aeta<2.3) scale = 0.050*(aeta-1.8)/0.4 /0.05;
88 else scale=0.025/0.05;
89 */
90
91 if (aeta < 1.80)
92 scale = 0.;
93 else if (aeta < 2.3)
94 scale = (0.050 * (aeta - 1.8) / 0.4 + 0.025) / 0.05;
95 else
96 scale = 0.05 / 0.05;
97
98 if (!interpolate) {
99 if (particle_type == 0)
100 return scale * m_helec[ieta]->GetBinContent(ibinEt + 1);
101 else if (particle_type == 1)
102 return scale * m_hphot[ieta]->GetBinContent(ibinEt + 1);
103 else
104 return scale * m_hphot2[ieta]->GetBinContent(
105 ibinEt + 1); // This is 2, since if particle_type is
106 // not 0,1,2 we have returned 0 above
107 } else {
108 if (particle_type == 0)
109 return scale * m_helec[ieta]->Interpolate(et);
110 else if (particle_type == 1)
111 return scale * m_hphot[ieta]->Interpolate(et);
112 else
113 return scale * m_hphot2[ieta]->Interpolate(
114 et); // This is 2, since if particle_type is not 0,1,2
115 // we have returned 0
116 }
117}
Scalar eta() const
pseudorapidity method
float et(const xAOD::jFexSRJetRoI *j)

Member Data Documentation

◆ m_etBins

const TArrayD* e1hg_systematics::m_etBins
private

Definition at line 40 of file e1hg_systematics.h.

◆ m_file0

TFile* e1hg_systematics::m_file0
private

Definition at line 39 of file e1hg_systematics.h.

◆ m_helec

TH1D* e1hg_systematics::m_helec[8]
private

Definition at line 36 of file e1hg_systematics.h.

◆ m_hphot

TH1D* e1hg_systematics::m_hphot[8]
private

Definition at line 37 of file e1hg_systematics.h.

◆ m_hphot2

TH1D* e1hg_systematics::m_hphot2[8]
private

Definition at line 38 of file e1hg_systematics.h.


The documentation for this class was generated from the following files: