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

Correction for pileup induced energy shit as function of mu per layer for 2016 data. More...

#include <corr_pileupShift.h>

Collaboration diagram for corr_pileupShift:

Public Member Functions

 corr_pileupShift ()
 constructor (initialization done there reading a root file for the HV maps per period
 ~corr_pileupShift ()
float getCorr (int layer, int run, float mu, float eta) const
 get shift to subtract to raw layer energy : corrected layer energy = raw energy - shift

Private Attributes

int m_runMin
int m_runMax
TH1D * m_haverage [4] {}
TFile * m_file

Detailed Description

Correction for pileup induced energy shit as function of mu per layer for 2016 data.

Author
: Guillaume Unal

Definition at line 13 of file corr_pileupShift.h.

Constructor & Destructor Documentation

◆ corr_pileupShift()

corr_pileupShift::corr_pileupShift ( )

constructor (initialization done there reading a root file for the HV maps per period

Definition at line 13 of file corr_pileupShift.cxx.

13 {
14
15 std::string filename = PathResolverFindCalibFile("egammaLayerRecalibTool/v2/layer_average.root");
16
17 m_file = TFile::Open(filename.c_str());
18 if (not m_file or m_file->IsZombie()) {
19 std::cerr << "FATAL: cannot open " << filename << std::endl;
20 }
21 else {
22 for (int layer=0;layer<4;layer++) {
23 char name[12];
24 snprintf(name,sizeof(name),"average_%d",layer);
25 m_haverage[layer]=(TH1D*) (m_file->Get(name));
26 if (not m_haverage[layer]) {
27 std::cerr << "FATAL: cannot find " << name << std::endl;
28 }
29 }
30 }
31 m_runMin=296939;
32 m_runMax=311563;
33}
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
@ layer
Definition HitInfo.h:79

◆ ~corr_pileupShift()

corr_pileupShift::~corr_pileupShift ( )

Definition at line 35 of file corr_pileupShift.cxx.

36{
37 m_file->Close();
38}

Member Function Documentation

◆ getCorr()

float corr_pileupShift::getCorr ( int layer,
int run,
float mu,
float eta ) const

get shift to subtract to raw layer energy : corrected layer energy = raw energy - shift

inputs: layer (0 to 3), run (run number), mu (average number of interactions per crossing) and eta

Definition at line 41 of file corr_pileupShift.cxx.

42{
43
44 if (layer<0 || layer>3) return 0.;
45 if (run<m_runMin || run>m_runMax) return 0.;
46 double aeta=std::fabs(eta);
47 if (aeta> 2.5) return 0.;
48 if (aeta>2.37) aeta=2.37;
49
50 int ibin = std::as_const(*m_haverage[layer]).GetXaxis()->FindFixBin(aeta);
51 float corr = mu * m_haverage[layer]->GetBinContent(ibin);
52
53 return corr;
54
55}
Scalar eta() const
pseudorapidity method

Member Data Documentation

◆ m_file

TFile* corr_pileupShift::m_file
private

Definition at line 31 of file corr_pileupShift.h.

◆ m_haverage

TH1D* corr_pileupShift::m_haverage[4] {}
private

Definition at line 30 of file corr_pileupShift.h.

30{};

◆ m_runMax

int corr_pileupShift::m_runMax
private

Definition at line 27 of file corr_pileupShift.h.

◆ m_runMin

int corr_pileupShift::m_runMin
private

Definition at line 27 of file corr_pileupShift.h.


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