ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
TRTCond::ActiveFraction Class Reference

#include <ActiveFraction.h>

Collaboration diagram for TRTCond::ActiveFraction:

Public Member Functions

 ActiveFraction ()
 
virtual ~ActiveFraction ()
 
int findEtaBin (float eta) const
 
int findPhiBin (float phi) const
 
float getActiveFraction (float eta, float phi) const
 
const std::vector< std::pair< float, float > > & getEtaBins () const
 
const std::vector< std::pair< float, float > > & getPhiBins () const
 
void setActiveFraction (unsigned int etaBin, unsigned int phiBin, float value)
 

Private Attributes

int m_nBinsPhi
 
std::vector< std::pair< float, float > > m_etaBins
 
std::vector< std::pair< float, float > > m_phiBins
 
std::vector< std::vector< float > > m_activeFracTable
 

Detailed Description

Definition at line 15 of file ActiveFraction.h.

Constructor & Destructor Documentation

◆ ActiveFraction()

TRTCond::ActiveFraction::ActiveFraction ( )
inline

Definition at line 32 of file ActiveFraction.h.

32  {
33  m_nBinsPhi=96;
34  m_etaBins.push_back( std::make_pair(-2.1,-1.75) );
35  m_etaBins.push_back( std::make_pair(-1.75,-1.3) );
36  m_etaBins.push_back( std::make_pair(-1.3,-1.07) );
37  m_etaBins.push_back( std::make_pair(-1.07,-0.65) );
38  m_etaBins.push_back( std::make_pair(-0.65,-0.1) );
39  m_etaBins.push_back( std::make_pair(-0.1,0.) );
40  m_etaBins.push_back( std::make_pair(0.,0.1) );
41  m_etaBins.push_back( std::make_pair(0.1,0.65) );
42  m_etaBins.push_back( std::make_pair(0.65,1.07) );
43  m_etaBins.push_back( std::make_pair(1.07,1.3) );
44  m_etaBins.push_back( std::make_pair(1.3,1.75) );
45  m_etaBins.push_back( std::make_pair(1.75,2.1) );
46  float phiEdgeLow = -1. * M_PI;
47  float deltaPhi = 2. * M_PI / (1. * m_nBinsPhi) ;
48  for ( int i = 0; i < m_nBinsPhi; ++i ) {
49  m_phiBins.push_back( std::make_pair( phiEdgeLow + i*deltaPhi, phiEdgeLow + (i+1)*deltaPhi ) );
50  }
51  // Initialize the table with 1.'s
52  std::vector<float> dummyPhiVec( m_phiBins.size(), 1. );
53  std::vector<std::vector<float> > dummyTable( m_etaBins.size(), dummyPhiVec );
54  m_activeFracTable = dummyTable;
55  }

◆ ~ActiveFraction()

virtual TRTCond::ActiveFraction::~ActiveFraction ( )
inlinevirtual

Definition at line 18 of file ActiveFraction.h.

18 {};

Member Function Documentation

◆ findEtaBin()

int TRTCond::ActiveFraction::findEtaBin ( float  eta) const
inline

Definition at line 57 of file ActiveFraction.h.

57  {
58  int etaBin = 0;
59  for ( ; etaBin < (int)m_etaBins.size(); ++etaBin ) {
60  std::pair<float,float> theBin = m_etaBins.at(etaBin);
61  if ( eta > theBin.first && eta <= theBin.second ) break;
62  }
63  if ( etaBin == (int)m_etaBins.size() ) return -1;
64 
65  return etaBin;
66  }

◆ findPhiBin()

int TRTCond::ActiveFraction::findPhiBin ( float  phi) const
inline

Definition at line 68 of file ActiveFraction.h.

68  {
69  int phiBin = 0;
70  for ( ; phiBin < (int)m_phiBins.size(); ++phiBin ) {
71  std::pair<float,float> theBin = m_phiBins.at(phiBin);
72  if ( phi > theBin.first && phi <= theBin.second ) break;
73  }
74  if ( phiBin == (int)m_phiBins.size() ) return-1;
75  return phiBin;
76  }

◆ getActiveFraction()

float TRTCond::ActiveFraction::getActiveFraction ( float  eta,
float  phi 
) const
inline

Definition at line 78 of file ActiveFraction.h.

78  {
79 
80 
81  int etaBin = findEtaBin(eta);
82  if ( etaBin < 0 ) return 1.;
83  int phiBin = findPhiBin(phi);
84  if ( phiBin < 0 ) return 1.;
86  }

◆ getEtaBins()

const std::vector< std::pair< float, float > > & TRTCond::ActiveFraction::getEtaBins ( ) const
inline

Definition at line 92 of file ActiveFraction.h.

92  {
93  return m_etaBins;
94  }

◆ getPhiBins()

const std::vector< std::pair< float, float > > & TRTCond::ActiveFraction::getPhiBins ( ) const
inline

Definition at line 96 of file ActiveFraction.h.

96  {
97  return m_phiBins;
98  }

◆ setActiveFraction()

void TRTCond::ActiveFraction::setActiveFraction ( unsigned int  etaBin,
unsigned int  phiBin,
float  value 
)
inline

Definition at line 87 of file ActiveFraction.h.

87  {
88 
90  }

Member Data Documentation

◆ m_activeFracTable

std::vector<std::vector<float> > TRTCond::ActiveFraction::m_activeFracTable
private

Definition at line 30 of file ActiveFraction.h.

◆ m_etaBins

std::vector<std::pair<float,float> > TRTCond::ActiveFraction::m_etaBins
private

Definition at line 28 of file ActiveFraction.h.

◆ m_nBinsPhi

int TRTCond::ActiveFraction::m_nBinsPhi
private

Definition at line 27 of file ActiveFraction.h.

◆ m_phiBins

std::vector<std::pair<float,float> > TRTCond::ActiveFraction::m_phiBins
private

Definition at line 29 of file ActiveFraction.h.


The documentation for this class was generated from the following file:
TRTCond::ActiveFraction::findPhiBin
int findPhiBin(float phi) const
Definition: ActiveFraction.h:68
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
xAOD::deltaPhi
setSAddress setEtaMS setDirPhiMS setDirZMS setBarrelRadius setEndcapAlpha setEndcapRadius setInterceptInner setEtaMap setEtaBin setIsTgcFailure setDeltaPt deltaPhi
Definition: L2StandAloneMuon_v1.cxx:160
M_PI
#define M_PI
Definition: ActiveFraction.h:11
athena.value
value
Definition: athena.py:124
TRTCond::ActiveFraction::m_etaBins
std::vector< std::pair< float, float > > m_etaBins
Definition: ActiveFraction.h:28
xAOD::etaBin
setSAddress setEtaMS setDirPhiMS setDirZMS setBarrelRadius setEndcapAlpha setEndcapRadius setInterceptInner setEtaMap etaBin
Definition: L2StandAloneMuon_v1.cxx:148
lumiFormat.i
int i
Definition: lumiFormat.py:85
TRTCond::ActiveFraction::m_phiBins
std::vector< std::pair< float, float > > m_phiBins
Definition: ActiveFraction.h:29
xAOD::phiBin
setSAddress setEtaMS setDirPhiMS setDirZMS setBarrelRadius setEndcapAlpha setEndcapRadius setPhiMap phiBin
Definition: L2StandAloneMuon_v2.cxx:144
TRTCond::ActiveFraction::m_nBinsPhi
int m_nBinsPhi
Definition: ActiveFraction.h:27
TRTCond::ActiveFraction::m_activeFracTable
std::vector< std::vector< float > > m_activeFracTable
Definition: ActiveFraction.h:30
TRTCond::ActiveFraction::findEtaBin
int findEtaBin(float eta) const
Definition: ActiveFraction.h:57