ATLAS Offline Software
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
semilCorr Class Reference

#include <semilCorr.h>

Collaboration diagram for semilCorr:

Public Types

enum  Systematics {
  TAGGINGWEIGHT = 1, FRAGMENTATION = 2, DECAY = 3, MSRESO = 4,
  IDRESO = 5, DECAYREW = 6, MUONSPECTRUM = 7, ALL = 8
}
 

Public Member Functions

 semilCorr (TString fIn, std::string suffix="", bool DebugIn=false)
 
 ~semilCorr ()
 
float getSemilCorrToIncl (TLorentzVector jet, TLorentzVector mu)
 
float getBjetCorrToIncl (TLorentzVector jet, TLorentzVector mu)
 
float getSemilCorrToInclSyst (TLorentzVector jet, TLorentzVector mu, semilCorr::Systematics syst=semilCorr::ALL)
 

Private Member Functions

float getResponse (float pt, float eta, std::vector< TH1F * > h)
 
float getSemilCorrToIncl (TLorentzVector jet, TLorentzVector mu, std::vector< TH1F * > histos)
 
std::vector< int > getHistoIndeces (semilCorr::Systematics syst)
 

Private Attributes

std::vector< std::vector< TH1F * > > m_histos
 
std::vector< float > m_etas
 
TFile * m_f
 
bool m_Debug
 

Detailed Description

Definition at line 15 of file semilCorr.h.

Member Enumeration Documentation

◆ Systematics

Enumerator
TAGGINGWEIGHT 
FRAGMENTATION 
DECAY 
MSRESO 
IDRESO 
DECAYREW 
MUONSPECTRUM 
ALL 

Definition at line 18 of file semilCorr.h.

18  {
19  TAGGINGWEIGHT = 1,
20  FRAGMENTATION = 2,
21  DECAY = 3,
22  MSRESO = 4,
23  IDRESO = 5,
24  DECAYREW = 6,
25  MUONSPECTRUM = 7,
26  ALL = 8
27  };

Constructor & Destructor Documentation

◆ semilCorr()

semilCorr::semilCorr ( TString  fIn,
std::string  suffix = "",
bool  DebugIn = false 
)

Definition at line 9 of file semilCorr.cxx.

9  {
10  m_Debug = DebugIn;
11  m_f = TFile::Open(fIn);
12  m_etas.push_back(0);
13  m_etas.push_back(0.8);
14  m_etas.push_back(1.2);
15  m_etas.push_back(1.7);
16  m_etas.push_back(2.1);
17  m_etas.push_back(2.5);
18 
19  vector<string> etastr;
20  etastr.push_back("_e0");
21  etastr.push_back("_e1");
22  etastr.push_back("_e2");
23  etastr.push_back("_e3");
24  etastr.push_back("_e4");
25 
26  vector<string> prefix;
27  prefix.push_back("corr");
28  prefix.push_back("tagSyst");
29  prefix.push_back("fragSyst");
30  prefix.push_back("decaySyst");
31  prefix.push_back("msSyst");
32  prefix.push_back("idSyst");
33  prefix.push_back("decayRewSyst");
34  prefix.push_back("muRewSyst");
35  prefix.push_back("corrIncl");
36 
37  for(unsigned int j = 0; j<prefix.size(); j++){
38  vector<TH1F*> corr;
39  for(unsigned int i = 0; i<etastr.size(); i++){
40  corr.push_back((TH1F*) m_f->Get((prefix[j]+etastr[i]).c_str()));
41  }
42  m_histos.push_back(corr);
43  }
44 }

◆ ~semilCorr()

semilCorr::~semilCorr ( )

Definition at line 47 of file semilCorr.cxx.

47  {
48  for(unsigned int i = 0; i<m_histos.size();i++){
49  for(unsigned int j = 0; j<m_histos[i].size();j++){
50  delete m_histos[i][j]; // TH2F's that store response info
51  }
52  }
53  m_f->Close();
54  delete m_f;
55 }

Member Function Documentation

◆ getBjetCorrToIncl()

float semilCorr::getBjetCorrToIncl ( TLorentzVector  jet,
TLorentzVector  mu 
)

Definition at line 62 of file semilCorr.cxx.

63 {
64  return getSemilCorrToIncl(jet,mu,m_histos[8]);
65 }

◆ getHistoIndeces()

vector< int > semilCorr::getHistoIndeces ( semilCorr::Systematics  syst)
private

Definition at line 76 of file semilCorr.cxx.

77 {
78  vector<int> indices;
79  if(syst == semilCorr::ALL){
80  indices.push_back(((int)semilCorr::TAGGINGWEIGHT));
81  indices.push_back(((int)semilCorr::FRAGMENTATION));
82  indices.push_back(((int)semilCorr::DECAY));
83  indices.push_back(((int)semilCorr::MSRESO));
84  indices.push_back(((int)semilCorr::IDRESO));
85  indices.push_back(((int)semilCorr::DECAYREW));
86  indices.push_back(((int)semilCorr::MUONSPECTRUM));
87  }else
88  indices.push_back((int) syst);
89  return indices;
90 }

◆ getResponse()

float semilCorr::getResponse ( float  pt,
float  eta,
std::vector< TH1F * >  h 
)
private

Definition at line 104 of file semilCorr.cxx.

105 {
106  float usePt = pt;
107  int histbin = -1;
108  for(unsigned int i = 0; i<m_etas.size()-1; i++){
109  if(fabs(eta)>=m_etas[i] && fabs(eta)<m_etas[i+1])
110  histbin = i;
111  }
112 
113  if(histbin == -1) histbin = h.size()-1;
114  float min = h[histbin]->GetBinCenter(1);
115  float max = h[histbin]->GetBinCenter(h[histbin]->GetNbinsX());
116  if(pt>max)
117  usePt = max-0.001;
118  if(pt<min) usePt = min+0.001;
119  float result = h[histbin]->Interpolate(usePt);
120  return result;
121 }

◆ getSemilCorrToIncl() [1/2]

float semilCorr::getSemilCorrToIncl ( TLorentzVector  jet,
TLorentzVector  mu 
)

Definition at line 57 of file semilCorr.cxx.

58 {
59  return getSemilCorrToIncl(jet,mu,m_histos[0]);
60 }

◆ getSemilCorrToIncl() [2/2]

float semilCorr::getSemilCorrToIncl ( TLorentzVector  jet,
TLorentzVector  mu,
std::vector< TH1F * >  histos 
)
private

Definition at line 67 of file semilCorr.cxx.

69 {
70  TLorentzVector jetmu = jet+mu;
71  //correction to get things to 1 (or to pttruth), not to reference
72  float corr = getResponse(jetmu.Pt(), jetmu.Eta(), histos);
73  return corr;
74 }

◆ getSemilCorrToInclSyst()

float semilCorr::getSemilCorrToInclSyst ( TLorentzVector  jet,
TLorentzVector  mu,
semilCorr::Systematics  syst = semilCorr::ALL 
)

Definition at line 92 of file semilCorr.cxx.

94 {
95  //vector<int> indeces = getHistoIndeces(up,syst);
96  vector<int> indeces1 = getHistoIndeces(syst);
97  float systr = 0;
98  for(unsigned int i = 0; i<indeces1.size(); i++){
99  systr += pow(getSemilCorrToIncl(jet,mu,m_histos[indeces1[i]]),2);
100  }
101  return sqrt(systr);
102 }

Member Data Documentation

◆ m_Debug

bool semilCorr::m_Debug
private

Definition at line 35 of file semilCorr.h.

◆ m_etas

std::vector<float> semilCorr::m_etas
private

Definition at line 31 of file semilCorr.h.

◆ m_f

TFile* semilCorr::m_f
private

Definition at line 33 of file semilCorr.h.

◆ m_histos

std::vector<std::vector<TH1F*> > semilCorr::m_histos
private

Definition at line 30 of file semilCorr.h.


The documentation for this class was generated from the following files:
get_generator_info.result
result
Definition: get_generator_info.py:21
max
#define max(a, b)
Definition: cfImp.cxx:41
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
semilCorr::m_etas
std::vector< float > m_etas
Definition: semilCorr.h:31
Trk::indices
std::pair< long int, long int > indices
Definition: AlSymMatBase.h:24
conifer::pow
constexpr int pow(int x)
Definition: conifer.h:20
test_pyathena.pt
pt
Definition: test_pyathena.py:11
semilCorr::TAGGINGWEIGHT
@ TAGGINGWEIGHT
Definition: semilCorr.h:19
semilCorr::ALL
@ ALL
Definition: semilCorr.h:26
jet
Definition: JetCalibTools_PlotJESFactors.cxx:23
semilCorr::getSemilCorrToIncl
float getSemilCorrToIncl(TLorentzVector jet, TLorentzVector mu, std::vector< TH1F * > histos)
Definition: semilCorr.cxx:67
lumiFormat.i
int i
Definition: lumiFormat.py:85
h
checkCorrelInHIST.prefix
dictionary prefix
Definition: checkCorrelInHIST.py:391
semilCorr::m_f
TFile * m_f
Definition: semilCorr.h:33
min
#define min(a, b)
Definition: cfImp.cxx:40
semilCorr::IDRESO
@ IDRESO
Definition: semilCorr.h:23
semilCorr::MUONSPECTRUM
@ MUONSPECTRUM
Definition: semilCorr.h:25
semilCorr::FRAGMENTATION
@ FRAGMENTATION
Definition: semilCorr.h:20
semilCorr::getHistoIndeces
std::vector< int > getHistoIndeces(semilCorr::Systematics syst)
Definition: semilCorr.cxx:76
semilCorr::m_Debug
bool m_Debug
Definition: semilCorr.h:35
checkCorrelInHIST.histos
dictionary histos
Definition: checkCorrelInHIST.py:413
semilCorr::MSRESO
@ MSRESO
Definition: semilCorr.h:22
semilCorr::DECAY
@ DECAY
Definition: semilCorr.h:21
python.TrigEgammaMonitorHelper.TH1F
def TH1F(name, title, nxbins, bins_par2, bins_par3=None, path='', **kwargs)
Definition: TrigEgammaMonitorHelper.py:24
semilCorr::getResponse
float getResponse(float pt, float eta, std::vector< TH1F * > h)
Definition: semilCorr.cxx:104
CaloNoise_fillDB.mu
mu
Definition: CaloNoise_fillDB.py:53
MooRTT_summarizeCPU.fIn
fIn
Definition: MooRTT_summarizeCPU.py:11
semilCorr::DECAYREW
@ DECAYREW
Definition: semilCorr.h:24
semilCorr::m_histos
std::vector< std::vector< TH1F * > > m_histos
Definition: semilCorr.h:30