ATLAS Offline Software
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
CaloHadWeight Class Reference

#include <CaloHadWeight.h>

Collaboration diagram for CaloHadWeight:

Classes

struct  HadData
 

Public Member Functions

 CaloHadWeight ()
 
 CaloHadWeight (const int &nBinEta, const float &MinEta, const float &MaxEta, const int &nBinSampling, const int &MinSampling, const int &MaxSampling, const int &nBinLogEClus, const float &MinLogEClus, const float &MaxLogEClus, const int &nBinLogEDensCell, const float &MinLogEDensCell, const float &MaxLogEDensCell)
 
const int & getNbinsEta () const
 
const float & getEtaMin () const
 
const float & getEtaMax () const
 
const int & getNbinsSampling () const
 
const int & getSamplingMin () const
 
const int & getSamplingMax () const
 
const int & getNbinsLogEClus () const
 
const float & getLogEClusMin () const
 
const float & getLogEClusMax () const
 
const int & getNbinsLogEDensCell () const
 
const float & getLogEDensCellMin () const
 
const float & getLogEDensCellMax () const
 
const struct HadDatagetHadData (const float &eta, const int &sampling, const float &logEClus, const float &logEDensCell) const
 
void setHadData (const float &eta, const int &sampling, const float &logEClus, const float &logEDensCell, const struct HadData &theData)
 

Private Member Functions

int getEtaSamplingBin (const float &eta, const int &sampling) const
 
int getBin (const float &eta, const int &sampling, const float &logEClus, const float &logEDensCell) const
 

Private Attributes

int m_nBinEta
 
int m_nBinSampling
 
int m_nBinLogEClus
 
int m_nBinLogEDensCell
 
float m_MinEta
 
int m_MinSampling
 
float m_MinLogEClus
 
float m_MinLogEDensCell
 
float m_MaxEta
 
int m_MaxSampling
 
float m_MaxLogEClus
 
float m_MaxLogEDensCell
 
std::vector< int > m_indexEtaSampling
 
std::vector< struct HadDatam_data
 

Detailed Description

Definition at line 19 of file CaloHadWeight.h.

Constructor & Destructor Documentation

◆ CaloHadWeight() [1/2]

CaloHadWeight::CaloHadWeight ( )

Definition at line 9 of file CaloHadWeight.cxx.

10  : m_nBinEta(0),
11  m_nBinSampling(0),
12  m_nBinLogEClus(0),
14  m_MinEta(0),
15  m_MinSampling(0),
16  m_MinLogEClus(0),
18  m_MaxEta(0),
19  m_MaxSampling(0),
20  m_MaxLogEClus(0),
22 {
23 }

◆ CaloHadWeight() [2/2]

CaloHadWeight::CaloHadWeight ( const int &  nBinEta,
const float &  MinEta,
const float &  MaxEta,
const int &  nBinSampling,
const int &  MinSampling,
const int &  MaxSampling,
const int &  nBinLogEClus,
const float &  MinLogEClus,
const float &  MaxLogEClus,
const int &  nBinLogEDensCell,
const float &  MinLogEDensCell,
const float &  MaxLogEDensCell 
)

Definition at line 26 of file CaloHadWeight.cxx.

39  : m_nBinEta (nBinEta),
40  m_nBinSampling (nBinSampling),
41  m_nBinLogEClus (nBinLogEClus),
42  m_nBinLogEDensCell (nBinLogEDensCell),
43  m_MinEta (MinEta),
44  m_MinSampling (MinSampling),
45  m_MinLogEClus (MinLogEClus),
46  m_MinLogEDensCell (MinLogEDensCell),
47  m_MaxEta (MaxEta),
48  m_MaxSampling (MaxSampling),
49  m_MaxLogEClus (MaxLogEClus),
50  m_MaxLogEDensCell (MaxLogEDensCell)
51 {
53 }

Member Function Documentation

◆ getBin()

int CaloHadWeight::getBin ( const float &  eta,
const int &  sampling,
const float &  logEClus,
const float &  logEDensCell 
) const
private

Definition at line 98 of file CaloHadWeight.cxx.

99 {
100  int iLogEClus,iLogEDensCell;
101 
102  const int iEtaSampling = getEtaSamplingBin(eta, sampling);
103  if ( iEtaSampling > -1 && m_indexEtaSampling[iEtaSampling] > -1 ) {
104  iLogEClus = (int)((logEClus-m_MinLogEClus)/(m_MaxLogEClus-m_MinLogEClus)*m_nBinLogEClus);
105  if ( iLogEClus >= 0 && iLogEClus < m_nBinLogEClus ) {
106  iLogEDensCell = (int)((logEDensCell-m_MinLogEDensCell)/(m_MaxLogEDensCell-m_MinLogEDensCell)*m_nBinLogEDensCell);
107  if ( iLogEDensCell >= 0 && iLogEDensCell < m_nBinLogEDensCell ) {
108  return (iLogEDensCell + m_nBinLogEDensCell *
109  (iLogEClus + m_nBinLogEClus *
110  m_indexEtaSampling[iEtaSampling]));
111  }
112  }
113  }
114  return -1;
115 }

◆ getEtaMax()

const float& CaloHadWeight::getEtaMax ( ) const
inline

Definition at line 51 of file CaloHadWeight.h.

51 {return m_MaxEta;}

◆ getEtaMin()

const float& CaloHadWeight::getEtaMin ( ) const
inline

Definition at line 50 of file CaloHadWeight.h.

50 {return m_MinEta;}

◆ getEtaSamplingBin()

int CaloHadWeight::getEtaSamplingBin ( const float &  eta,
const int &  sampling 
) const
private

Definition at line 84 of file CaloHadWeight.cxx.

85 {
86  int iEta,iSampling;
87 
89  if ( iEta >= 0 && iEta < m_nBinEta ) {
90  iSampling = sampling-m_MinSampling;
91  if ( iSampling >= 0 && iSampling < m_nBinSampling ) {
92  return (iEta*m_nBinSampling+iSampling);
93  }
94  }
95  return (-1);
96 }

◆ getHadData()

const struct CaloHadWeight::HadData * CaloHadWeight::getHadData ( const float &  eta,
const int &  sampling,
const float &  logEClus,
const float &  logEDensCell 
) const

Definition at line 55 of file CaloHadWeight.cxx.

56 {
57  int iBin = getBin(eta,sampling,logEClus,logEDensCell);
58  if ( iBin > -1 && iBin < (int)m_data.size() )
59  return (& m_data[iBin]);
60  else
61  return nullptr;
62 }

◆ getLogEClusMax()

const float& CaloHadWeight::getLogEClusMax ( ) const
inline

Definition at line 59 of file CaloHadWeight.h.

59 {return m_MaxLogEClus;}

◆ getLogEClusMin()

const float& CaloHadWeight::getLogEClusMin ( ) const
inline

Definition at line 58 of file CaloHadWeight.h.

58 {return m_MinLogEClus;}

◆ getLogEDensCellMax()

const float& CaloHadWeight::getLogEDensCellMax ( ) const
inline

Definition at line 63 of file CaloHadWeight.h.

63 {return m_MaxLogEDensCell;}

◆ getLogEDensCellMin()

const float& CaloHadWeight::getLogEDensCellMin ( ) const
inline

Definition at line 62 of file CaloHadWeight.h.

62 {return m_MinLogEDensCell;}

◆ getNbinsEta()

const int& CaloHadWeight::getNbinsEta ( ) const
inline

Definition at line 49 of file CaloHadWeight.h.

49 {return m_nBinEta;}

◆ getNbinsLogEClus()

const int& CaloHadWeight::getNbinsLogEClus ( ) const
inline

Definition at line 57 of file CaloHadWeight.h.

57 {return m_nBinLogEClus;}

◆ getNbinsLogEDensCell()

const int& CaloHadWeight::getNbinsLogEDensCell ( ) const
inline

Definition at line 61 of file CaloHadWeight.h.

61 {return m_nBinLogEDensCell;}

◆ getNbinsSampling()

const int& CaloHadWeight::getNbinsSampling ( ) const
inline

Definition at line 53 of file CaloHadWeight.h.

53 {return m_nBinSampling;}

◆ getSamplingMax()

const int& CaloHadWeight::getSamplingMax ( ) const
inline

Definition at line 55 of file CaloHadWeight.h.

55 {return m_MaxSampling;}

◆ getSamplingMin()

const int& CaloHadWeight::getSamplingMin ( ) const
inline

Definition at line 54 of file CaloHadWeight.h.

54 {return m_MinSampling;}

◆ setHadData()

void CaloHadWeight::setHadData ( const float &  eta,
const int &  sampling,
const float &  logEClus,
const float &  logEDensCell,
const struct HadData theData 
)

Definition at line 67 of file CaloHadWeight.cxx.

67  {
68 
69  const int iEtaSampling = getEtaSamplingBin(eta, sampling);
70  if ( iEtaSampling > -1 ) {
71  if ( m_indexEtaSampling[iEtaSampling] == -1 ) {
72  const int iFilledSamplings = m_data.size()/(m_nBinLogEClus*m_nBinLogEDensCell);
73  m_indexEtaSampling[iEtaSampling] = iFilledSamplings;
74  m_data.resize((iFilledSamplings+1)*(m_nBinLogEClus*m_nBinLogEDensCell));
75  }
76  const int iBin = getBin(eta,sampling,logEClus,logEDensCell);
77  if ( iBin > -1 ) {
78  m_data[iBin] = theData;
79  }
80  }
81 }

Member Data Documentation

◆ m_data

std::vector<struct HadData> CaloHadWeight::m_data
private

Definition at line 90 of file CaloHadWeight.h.

◆ m_indexEtaSampling

std::vector<int> CaloHadWeight::m_indexEtaSampling
private

Definition at line 89 of file CaloHadWeight.h.

◆ m_MaxEta

float CaloHadWeight::m_MaxEta
private

Definition at line 84 of file CaloHadWeight.h.

◆ m_MaxLogEClus

float CaloHadWeight::m_MaxLogEClus
private

Definition at line 86 of file CaloHadWeight.h.

◆ m_MaxLogEDensCell

float CaloHadWeight::m_MaxLogEDensCell
private

Definition at line 87 of file CaloHadWeight.h.

◆ m_MaxSampling

int CaloHadWeight::m_MaxSampling
private

Definition at line 85 of file CaloHadWeight.h.

◆ m_MinEta

float CaloHadWeight::m_MinEta
private

Definition at line 79 of file CaloHadWeight.h.

◆ m_MinLogEClus

float CaloHadWeight::m_MinLogEClus
private

Definition at line 81 of file CaloHadWeight.h.

◆ m_MinLogEDensCell

float CaloHadWeight::m_MinLogEDensCell
private

Definition at line 82 of file CaloHadWeight.h.

◆ m_MinSampling

int CaloHadWeight::m_MinSampling
private

Definition at line 80 of file CaloHadWeight.h.

◆ m_nBinEta

int CaloHadWeight::m_nBinEta
private

Definition at line 74 of file CaloHadWeight.h.

◆ m_nBinLogEClus

int CaloHadWeight::m_nBinLogEClus
private

Definition at line 76 of file CaloHadWeight.h.

◆ m_nBinLogEDensCell

int CaloHadWeight::m_nBinLogEDensCell
private

Definition at line 77 of file CaloHadWeight.h.

◆ m_nBinSampling

int CaloHadWeight::m_nBinSampling
private

Definition at line 75 of file CaloHadWeight.h.


The documentation for this class was generated from the following files:
CaloHadWeight::getBin
int getBin(const float &eta, const int &sampling, const float &logEClus, const float &logEDensCell) const
Definition: CaloHadWeight.cxx:98
CaloHadWeight::m_nBinSampling
int m_nBinSampling
Definition: CaloHadWeight.h:75
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
CaloHadWeight::m_MaxLogEDensCell
float m_MaxLogEDensCell
Definition: CaloHadWeight.h:87
CaloHadWeight::m_MinLogEClus
float m_MinLogEClus
Definition: CaloHadWeight.h:81
CaloHadWeight::getEtaSamplingBin
int getEtaSamplingBin(const float &eta, const int &sampling) const
Definition: CaloHadWeight.cxx:84
CaloHadWeight::m_MaxEta
float m_MaxEta
Definition: CaloHadWeight.h:84
CaloHadWeight::m_MinLogEDensCell
float m_MinLogEDensCell
Definition: CaloHadWeight.h:82
CaloHadWeight::m_MinSampling
int m_MinSampling
Definition: CaloHadWeight.h:80
CaloHadWeight::m_indexEtaSampling
std::vector< int > m_indexEtaSampling
Definition: CaloHadWeight.h:89
CaloHadWeight::m_MinEta
float m_MinEta
Definition: CaloHadWeight.h:79
CaloHadWeight::m_data
std::vector< struct HadData > m_data
Definition: CaloHadWeight.h:90
CaloHadWeight::m_MaxLogEClus
float m_MaxLogEClus
Definition: CaloHadWeight.h:86
CaloHadWeight::m_nBinEta
int m_nBinEta
Definition: CaloHadWeight.h:74
xAOD::iEta
setScale setgFexType iEta
Definition: gFexJetRoI_v1.cxx:74
CaloHadWeight::m_nBinLogEClus
int m_nBinLogEClus
Definition: CaloHadWeight.h:76
CaloHadWeight::m_nBinLogEDensCell
int m_nBinLogEDensCell
Definition: CaloHadWeight.h:77
CaloHadWeight::m_MaxSampling
int m_MaxSampling
Definition: CaloHadWeight.h:85