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

#include <TileCellDim.h>

Inheritance diagram for TileCellDim:
Collaboration diagram for TileCellDim:

Public Member Functions

 TileCellDim (unsigned int nRows)
 ~TileCellDim ()
unsigned int getNRows () const
double getVolume () const
double getRMin (unsigned int index) const
double getRMax (unsigned int index) const
double getZMin (unsigned int index) const
double getZMax (unsigned int index) const
void addRMin (double rMin)
void addRMax (double rMax)
void addZMin (double zMin)
void addZMax (double zMax)
void computeVolume ()
double computeRowVolume (int iRow)
void print () const
bool msgLvl (const MSG::Level lvl) const
 Test the output level.
MsgStream & msg () const
 The standard message stream.
MsgStream & msg (const MSG::Level lvl) const
 The standard message stream.
void setLevel (MSG::Level lvl)
 Change the current logging level.

Private Member Functions

void initMessaging () const
 Initialize our message level and MessageSvc.

Private Attributes

unsigned int m_nRows
std::vector< double > m_rMin
std::vector< double > m_rMax
std::vector< double > m_zMin
std::vector< double > m_zMax
double m_volume
double m_Radius2HalfLength
std::string m_nm
 Message source name.
boost::thread_specific_ptr< MsgStream > m_msg_tls
 MsgStream instance (a std::cout like with print-out levels)
std::atomic< IMessageSvc * > m_imsg { nullptr }
 MessageSvc pointer.
std::atomic< MSG::Level > m_lvl { MSG::NIL }
 Current logging level.
std::atomic_flag m_initialized ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT
 Messaging initialized (initMessaging)

Detailed Description

Definition at line 17 of file TileCellDim.h.

Constructor & Destructor Documentation

◆ TileCellDim()

TileCellDim::TileCellDim ( unsigned int nRows)

Definition at line 17 of file TileCellDim.cxx.

18 : AthMessaging ("TileDetDescrManager")
19 , m_nRows(nRows)
20 , m_volume(0)
21{
22 // convert tile radius to tile half-length
24
25}
#define M_PI
AthMessaging()
Default constructor:
unsigned int m_nRows
Definition TileCellDim.h:44
double m_Radius2HalfLength
Definition TileCellDim.h:49
double m_volume
Definition TileCellDim.h:49

◆ ~TileCellDim()

TileCellDim::~TileCellDim ( )

Definition at line 27 of file TileCellDim.cxx.

28{
29}

Member Function Documentation

◆ addRMax()

void TileCellDim::addRMax ( double rMax)

Definition at line 71 of file TileCellDim.cxx.

72{
73 if (m_rMax.size() < m_nRows)
74 m_rMax.push_back(rMax);
75 else
76 throw std::runtime_error( "Attempt to insert new RMax when vector size reached maximum!" );
77}
std::vector< double > m_rMax
Definition TileCellDim.h:46

◆ addRMin()

void TileCellDim::addRMin ( double rMin)

Definition at line 63 of file TileCellDim.cxx.

64{
65 if (m_rMin.size() < m_nRows)
66 m_rMin.push_back(rMin);
67 else
68 throw std::runtime_error( "Attempt to insert new RMin when vector size reached maximum!" );
69}
std::vector< double > m_rMin
Definition TileCellDim.h:45

◆ addZMax()

void TileCellDim::addZMax ( double zMax)

Definition at line 87 of file TileCellDim.cxx.

88{
89 if (m_zMax.size() < m_nRows)
90 m_zMax.push_back(zMax);
91 else
92 throw std::runtime_error( "Attempt to insert new ZMax when vector size reached maximum!" );
93}
std::vector< double > m_zMax
Definition TileCellDim.h:48

◆ addZMin()

void TileCellDim::addZMin ( double zMin)

Definition at line 79 of file TileCellDim.cxx.

80{
81 if (m_zMin.size() < m_nRows)
82 m_zMin.push_back(zMin);
83 else
84 throw std::runtime_error( "Attempt to insert new ZMin when vector size reached maximum!" );
85}
std::vector< double > m_zMin
Definition TileCellDim.h:47

◆ computeRowVolume()

double TileCellDim::computeRowVolume ( int iRow)

Definition at line 103 of file TileCellDim.cxx.

104{
105
106 return fabs ( m_Radius2HalfLength * (m_rMin[iRow] + m_rMax[iRow])
107 * (m_rMax[iRow] - m_rMin[iRow])
108 * (m_zMax[iRow] - m_zMin[iRow]) );
109}

◆ computeVolume()

void TileCellDim::computeVolume ( )

Definition at line 95 of file TileCellDim.cxx.

96{
97 m_volume = 0.0;
98
99 for (unsigned int i=0; i<m_nRows; ++i)
101}
double computeRowVolume(int iRow)

◆ getNRows()

unsigned int TileCellDim::getNRows ( ) const
inline

Definition at line 25 of file TileCellDim.h.

25{ return m_nRows;}

◆ getRMax()

double TileCellDim::getRMax ( unsigned int index) const

Definition at line 39 of file TileCellDim.cxx.

40{
41 if (index < m_rMax.size())
42 return m_rMax[index];
43 else
44 throw std::runtime_error( "Index out of range when retrieving RMax!" );
45}
str index
Definition DeMoScan.py:362

◆ getRMin()

double TileCellDim::getRMin ( unsigned int index) const

Definition at line 31 of file TileCellDim.cxx.

32{
33 if (index < m_rMin.size())
34 return m_rMin[index];
35 else
36 throw std::runtime_error( "Index out of range when retrieving RMin!" );
37}

◆ getVolume()

double TileCellDim::getVolume ( ) const
inline

Definition at line 26 of file TileCellDim.h.

26{ return m_volume; }

◆ getZMax()

double TileCellDim::getZMax ( unsigned int index) const

Definition at line 55 of file TileCellDim.cxx.

56{
57 if (index < m_zMax.size())
58 return m_zMax[index];
59 else
60 throw std::runtime_error( "Index out of range when retrieving ZMax!" );
61}

◆ getZMin()

double TileCellDim::getZMin ( unsigned int index) const

Definition at line 47 of file TileCellDim.cxx.

48{
49 if (index < m_zMin.size())
50 return m_zMin[index];
51 else
52 throw std::runtime_error( "Index out of range when retrieving ZMin!" );
53}

◆ initMessaging()

void AthMessaging::initMessaging ( ) const
privateinherited

Initialize our message level and MessageSvc.

This method should only be called once.

Definition at line 39 of file AthMessaging.cxx.

40{
42 // If user did not set an explicit level, set a default
43 if (m_lvl == MSG::NIL) {
44 m_lvl = m_imsg ?
45 static_cast<MSG::Level>( m_imsg.load()->outputLevel(m_nm) ) :
46 MSG::INFO;
47 }
48}
std::string m_nm
Message source name.
std::atomic< IMessageSvc * > m_imsg
MessageSvc pointer.
std::atomic< MSG::Level > m_lvl
Current logging level.
IMessageSvc * getMessageSvc(bool quiet=false)

◆ msg() [1/2]

MsgStream & AthMessaging::msg ( ) const
inlineinherited

The standard message stream.

Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.

Definition at line 163 of file AthMessaging.h.

164{
165 MsgStream* ms = m_msg_tls.get();
166 if (!ms) {
167 if (!m_initialized.test_and_set()) initMessaging();
168 ms = new MsgStream(m_imsg,m_nm);
169 m_msg_tls.reset( ms );
170 }
171
172 ms->setLevel (m_lvl);
173 return *ms;
174}
boost::thread_specific_ptr< MsgStream > m_msg_tls
MsgStream instance (a std::cout like with print-out levels)
void initMessaging() const
Initialize our message level and MessageSvc.

◆ msg() [2/2]

MsgStream & AthMessaging::msg ( const MSG::Level lvl) const
inlineinherited

The standard message stream.

Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.

Definition at line 178 of file AthMessaging.h.

179{ return msg() << lvl; }
MsgStream & msg() const
The standard message stream.

◆ msgLvl()

bool AthMessaging::msgLvl ( const MSG::Level lvl) const
inlineinherited

Test the output level.

Parameters
lvlThe message level to test against
Returns
boolean Indicating if messages at given level will be printed
Return values
trueMessages at level "lvl" will be printed

Definition at line 151 of file AthMessaging.h.

152{
153 if (m_lvl <= lvl) {
154 msg() << lvl;
155 return true;
156 } else {
157 return false;
158 }
159}

◆ print()

void TileCellDim::print ( ) const

Definition at line 112 of file TileCellDim.cxx.

113{
114 std::cout << " >> Cell contains " << m_nRows << " rows" << std::endl;
115 for (unsigned int i=0; i<m_nRows; ++i) {
116 std::cout << m_rMin[i] << " "
117 << m_rMax[i] << " "
118 << m_zMin[i] << " "
119 << m_zMax[i] << std::endl;
120 }
121 std::cout << " >> Cell Volume is " << m_volume << std::endl;
122}

◆ setLevel()

void AthMessaging::setLevel ( MSG::Level lvl)
inherited

Change the current logging level.

Use this rather than msg().setLevel() for proper operation with MT.

Definition at line 28 of file AthMessaging.cxx.

29{
30 m_lvl = lvl;
31}

Member Data Documentation

◆ ATLAS_THREAD_SAFE

std::atomic_flag m_initialized AthMessaging::ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT
mutableprivateinherited

Messaging initialized (initMessaging)

Definition at line 141 of file AthMessaging.h.

◆ m_imsg

std::atomic<IMessageSvc*> AthMessaging::m_imsg { nullptr }
mutableprivateinherited

MessageSvc pointer.

Definition at line 135 of file AthMessaging.h.

135{ nullptr };

◆ m_lvl

std::atomic<MSG::Level> AthMessaging::m_lvl { MSG::NIL }
mutableprivateinherited

Current logging level.

Definition at line 138 of file AthMessaging.h.

138{ MSG::NIL };

◆ m_msg_tls

boost::thread_specific_ptr<MsgStream> AthMessaging::m_msg_tls
mutableprivateinherited

MsgStream instance (a std::cout like with print-out levels)

Definition at line 132 of file AthMessaging.h.

◆ m_nm

std::string AthMessaging::m_nm
privateinherited

Message source name.

Definition at line 129 of file AthMessaging.h.

◆ m_nRows

unsigned int TileCellDim::m_nRows
private

Definition at line 44 of file TileCellDim.h.

◆ m_Radius2HalfLength

double TileCellDim::m_Radius2HalfLength
private

Definition at line 49 of file TileCellDim.h.

◆ m_rMax

std::vector<double> TileCellDim::m_rMax
private

Definition at line 46 of file TileCellDim.h.

◆ m_rMin

std::vector<double> TileCellDim::m_rMin
private

Definition at line 45 of file TileCellDim.h.

◆ m_volume

double TileCellDim::m_volume
private

Definition at line 49 of file TileCellDim.h.

◆ m_zMax

std::vector<double> TileCellDim::m_zMax
private

Definition at line 48 of file TileCellDim.h.

◆ m_zMin

std::vector<double> TileCellDim::m_zMin
private

Definition at line 47 of file TileCellDim.h.


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