Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Public Member Functions | Private Attributes | List of all members
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) More...
 
 ~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) More...
 

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 14 of file e1hg_systematics.cxx.

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

◆ ~e1hg_systematics()

e1hg_systematics::~e1hg_systematics ( )

Definition at line 33 of file e1hg_systematics.cxx.

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

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 44 of file e1hg_systematics.cxx.

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

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:
et
Extra patterns decribing particle interation process.
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
EgammaARTmonitoring_plotsMaker.particle_type
particle_type
Definition: EgammaARTmonitoring_plotsMaker.py:633
e1hg_systematics::m_etBins
const TArrayD * m_etBins
Definition: e1hg_systematics.h:40
yodamerge_tmp.scale
scale
Definition: yodamerge_tmp.py:138
e1hg_systematics::m_file0
TFile * m_file0
Definition: e1hg_systematics.h:39
ParticleGun_FastCalo_ChargeFlip_Config.energy
energy
Definition: ParticleGun_FastCalo_ChargeFlip_Config.py:78
lumiFormat.i
int i
Definition: lumiFormat.py:85
e1hg_systematics::m_hphot2
TH1D * m_hphot2[8]
Definition: e1hg_systematics.h:38
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
e1hg_systematics::m_hphot
TH1D * m_hphot[8]
Definition: e1hg_systematics.h:37
e1hg_systematics::m_helec
TH1D * m_helec[8]
Definition: e1hg_systematics.h:36
CaloClusterCorr::interpolate
float interpolate(const CaloRec::Array< 2 > &a, float x, unsigned int degree, unsigned int ycol=1, const CaloRec::Array< 1 > &regions=CaloRec::Array< 1 >(), int n_points=-1, bool fixZero=false)
Polynomial interpolation in a table.
Definition: interpolate.cxx:75
CaloCellTimeCorrFiller.filename
filename
Definition: CaloCellTimeCorrFiller.py:24
test_AnalysisBaseEventLoopJob.aa
aa
Definition: test_AnalysisBaseEventLoopJob.py:37