ATLAS Offline Software
Loading...
Searching...
No Matches
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 18 of file ActiveFraction.h.

Constructor & Destructor Documentation

◆ ActiveFraction()

TRTCond::ActiveFraction::ActiveFraction ( )
inline

Definition at line 35 of file ActiveFraction.h.

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

◆ ~ActiveFraction()

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

Definition at line 21 of file ActiveFraction.h.

21{};

Member Function Documentation

◆ findEtaBin()

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

Definition at line 60 of file ActiveFraction.h.

60 {
61 int etaBin = 0;
62 for ( ; etaBin < (int)m_etaBins.size(); ++etaBin ) {
63 std::pair<float,float> theBin = m_etaBins.at(etaBin);
64 if ( eta > theBin.first && eta <= theBin.second ) break;
65 }
66 if ( etaBin == (int)m_etaBins.size() ) return -1;
67
68 return etaBin;
69 }
Scalar eta() const
pseudorapidity method
setSAddress setEtaMS setDirPhiMS setDirZMS setBarrelRadius setEndcapAlpha setEndcapRadius setInterceptInner setEtaMap etaBin

◆ findPhiBin()

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

Definition at line 71 of file ActiveFraction.h.

71 {
72 int phiBin = 0;
73 for ( ; phiBin < (int)m_phiBins.size(); ++phiBin ) {
74 std::pair<float,float> theBin = m_phiBins.at(phiBin);
75 if ( phi > theBin.first && phi <= theBin.second ) break;
76 }
77 if ( phiBin == (int)m_phiBins.size() ) return-1;
78 return phiBin;
79 }
Scalar phi() const
phi method
setSAddress setEtaMS setDirPhiMS setDirZMS setBarrelRadius setEndcapAlpha setEndcapRadius setPhiMap phiBin

◆ getActiveFraction()

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

Definition at line 81 of file ActiveFraction.h.

81 {
82
83
84 int etaBin = findEtaBin(eta);
85 if ( etaBin < 0 ) return 1.;
86 int phiBin = findPhiBin(phi);
87 if ( phiBin < 0 ) return 1.;
89 }
int findEtaBin(float eta) const
int findPhiBin(float phi) const

◆ getEtaBins()

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

Definition at line 95 of file ActiveFraction.h.

95 {
96 return m_etaBins;
97 }

◆ getPhiBins()

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

Definition at line 99 of file ActiveFraction.h.

99 {
100 return m_phiBins;
101 }

◆ setActiveFraction()

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

Definition at line 90 of file ActiveFraction.h.

90 {
91
93 }

Member Data Documentation

◆ m_activeFracTable

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

Definition at line 33 of file ActiveFraction.h.

◆ m_etaBins

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

Definition at line 31 of file ActiveFraction.h.

◆ m_nBinsPhi

int TRTCond::ActiveFraction::m_nBinsPhi
private

Definition at line 30 of file ActiveFraction.h.

◆ m_phiBins

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

Definition at line 32 of file ActiveFraction.h.


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