ATLAS Offline Software
Public Member Functions | Private Member Functions | Private Attributes | List of all members
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. More...
 
MsgStream & msg () const
 The standard message stream. More...
 
MsgStream & msg (const MSG::Level lvl) const
 The standard message stream. More...
 
void setLevel (MSG::Level lvl)
 Change the current logging level. More...
 

Private Member Functions

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

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. More...
 
boost::thread_specific_ptr< MsgStream > m_msg_tls
 MsgStream instance (a std::cout like with print-out levels) More...
 
std::atomic< IMessageSvc * > m_imsg { nullptr }
 MessageSvc pointer. More...
 
std::atomic< MSG::Level > m_lvl { MSG::NIL }
 Current logging level. More...
 
std::atomic_flag m_initialized ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT
 Messaging initialized (initMessaging) More...
 

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
23  m_Radius2HalfLength = tan ( M_PI / 64);
24 
25 }

◆ ~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 }

◆ 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 }

◆ 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 }

◆ 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 }

◆ 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 }

◆ 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 }

◆ 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  m_lvl = m_imsg ?
43  static_cast<MSG::Level>( m_imsg.load()->outputLevel(m_nm) ) :
44  MSG::INFO;
45 }

◆ 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 164 of file AthMessaging.h.

165 {
166  MsgStream* ms = m_msg_tls.get();
167  if (!ms) {
168  if (!m_initialized.test_and_set()) initMessaging();
169  ms = new MsgStream(m_imsg,m_nm);
170  m_msg_tls.reset( ms );
171  }
172 
173  ms->setLevel (m_lvl);
174  return *ms;
175 }

◆ 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 179 of file AthMessaging.h.

180 { return msg() << lvl; }

◆ 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_initialized.test_and_set()) initMessaging();
154  if (m_lvl <= lvl) {
155  msg() << lvl;
156  return true;
157  } else {
158  return false;
159  }
160 }

◆ 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.

◆ m_lvl

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

Current logging level.

Definition at line 138 of file AthMessaging.h.

◆ 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:
AthMessaging::m_lvl
std::atomic< MSG::Level > m_lvl
Current logging level.
Definition: AthMessaging.h:138
TileCellDim::m_rMin
std::vector< double > m_rMin
Definition: TileCellDim.h:45
TileCellDim::m_volume
double m_volume
Definition: TileCellDim.h:49
TileCellDim::computeRowVolume
double computeRowVolume(int iRow)
Definition: TileCellDim.cxx:103
TileCellDim::m_zMax
std::vector< double > m_zMax
Definition: TileCellDim.h:48
index
Definition: index.py:1
M_PI
#define M_PI
Definition: ActiveFraction.h:11
TileCellDim::m_rMax
std::vector< double > m_rMax
Definition: TileCellDim.h:46
AthMessaging::m_imsg
std::atomic< IMessageSvc * > m_imsg
MessageSvc pointer.
Definition: AthMessaging.h:135
TileCellDim::m_zMin
std::vector< double > m_zMin
Definition: TileCellDim.h:47
python.SystemOfUnits.ms
int ms
Definition: SystemOfUnits.py:132
Athena::getMessageSvc
IMessageSvc * getMessageSvc(bool quiet=false)
Definition: getMessageSvc.cxx:20
AthMessaging::AthMessaging
AthMessaging()
Default constructor:
TrigConf::MSGTC::Level
Level
Definition: Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:21
lumiFormat.i
int i
Definition: lumiFormat.py:85
TileCellDim::m_Radius2HalfLength
double m_Radius2HalfLength
Definition: TileCellDim.h:49
drawFromPickle.tan
tan
Definition: drawFromPickle.py:36
AthMessaging::msg
MsgStream & msg() const
The standard message stream.
Definition: AthMessaging.h:164
TileCellDim::m_nRows
unsigned int m_nRows
Definition: TileCellDim.h:44
DeMoScan.index
string index
Definition: DeMoScan.py:364
AthMessaging::m_nm
std::string m_nm
Message source name.
Definition: AthMessaging.h:129
RPDUtils::nRows
unsigned constexpr int nRows
Definition: RPDUtils.h:24
AthMessaging::initMessaging
void initMessaging() const
Initialize our message level and MessageSvc.
Definition: AthMessaging.cxx:39
AthMessaging::m_msg_tls
boost::thread_specific_ptr< MsgStream > m_msg_tls
MsgStream instance (a std::cout like with print-out levels)
Definition: AthMessaging.h:132