ATLAS Offline Software
Loading...
Searching...
No Matches
MuonCalib::MdtStationT0Container Class Reference

#include <MdtStationT0Container.h>

Collaboration diagram for MuonCalib::MdtStationT0Container:

Public Member Functions

 MdtStationT0Container ()
 Default constructor.
 MdtStationT0Container (const std::string &file_name)
 Constructor: Initialize the class with the t0s stored in the file "file_name".
double t0 (const unsigned int &ml, const unsigned int &ly, const unsigned int &tb) const
 get the t0 value of the tube tb in layer ly of multilayer ml; tb, ly, ml>0
double adc (const unsigned int &ml, const unsigned int &ly, const unsigned int &tb) const
 get the t0 value of the tube tb in layer ly of multilayer ml; tb, ly, ml>0
void readT0File (const std::string &file_name)
 read the t0s stored in the file "file_name"
bool Sett0 (const unsigned int &ml, const unsigned int &ly, const unsigned int &tb, double t0, double adc=0)
 set t0 value of the tube tb in layer ly of multilayer ml; tb, ly, ml>0
bool t0_loaded () const

Private Attributes

std::vector< std::vector< std::vector< double > > > m_t0
std::vector< std::vector< std::vector< double > > > m_adc
bool m_t0_loaded

Detailed Description

Definition at line 24 of file MdtStationT0Container.h.

Constructor & Destructor Documentation

◆ MdtStationT0Container() [1/2]

MuonCalib::MdtStationT0Container::MdtStationT0Container ( )
inline

Default constructor.

Definition at line 27 of file MdtStationT0Container.h.

◆ MdtStationT0Container() [2/2]

MuonCalib::MdtStationT0Container::MdtStationT0Container ( const std::string & file_name)
inline

Constructor: Initialize the class with the t0s stored in the file "file_name".

Definition at line 33 of file MdtStationT0Container.h.

Member Function Documentation

◆ adc()

double MdtStationT0Container::adc ( const unsigned int & ml,
const unsigned int & ly,
const unsigned int & tb ) const

get the t0 value of the tube tb in layer ly of multilayer ml; tb, ly, ml>0

Definition at line 32 of file MdtStationT0Container.cxx.

32 {
33 if (!m_t0_loaded) return 9e9;
34 return m_adc[ml - 1][ly - 1][tb - 1];
35}
std::vector< std::vector< std::vector< double > > > m_adc

◆ readT0File()

void MdtStationT0Container::readT0File ( const std::string & file_name)

read the t0s stored in the file "file_name"

Definition at line 57 of file MdtStationT0Container.cxx.

57 {
59 // VARIABLES //
61
62 std::string sdummy; // auxiliary string for file reading
63 int idummy; // auxiliary integer for file reading
64 double dummy; // auxiliary double for file reading
65 int ml, ly, tb; // multilayer, layer, tube
66 std::ifstream infile; // t0 file
67
69 // OPEN t0 file //
71
72 infile.open(file_name.c_str());
73 if (infile.fail()) {
74 throw std::runtime_error(
75 Form("File: %s, Line: %d\nMdtStationT0Container::readT0File - Could not open file %s!", __FILE__, __LINE__, file_name.c_str()));
76 }
77
79 // READ THE t0 FILE //
81
82 // ignore the first line //
83 getline(infile, sdummy);
84
85 // read the t0 look-up table //
86 while (!infile.eof()) {
87 // station name //
88 infile >> sdummy;
89 if (infile.eof()) { break; }
90
91 // eta, phi, technology index //
92 infile >> idummy >> idummy >> idummy;
93
94 // multilayer, layer, tube //
95 infile >> ml >> ly >> tb;
96
97 // t0 //
98 infile >> m_t0[ml - 1][ly - 1][tb - 1];
99 infile >> m_adc[ml - 1][ly - 1][tb - 1];
100
101 if (infile.fail()) return;
102
103 // the rest of the line //
104 for (unsigned k = 0; k < 10; k++) { infile >> dummy; }
105 }
106 m_t0_loaded = true;
107 return;
108}
std::vector< std::vector< std::vector< double > > > m_t0
str infile
Definition run.py:13

◆ Sett0()

bool MdtStationT0Container::Sett0 ( const unsigned int & ml,
const unsigned int & ly,
const unsigned int & tb,
double t0,
double adc = 0 )

set t0 value of the tube tb in layer ly of multilayer ml; tb, ly, ml>0

Definition at line 43 of file MdtStationT0Container.cxx.

43 {
44 m_t0[ml - 1][ly - 1][tb - 1] = t0;
45 m_adc[ml - 1][ly - 1][tb - 1] = adc;
46 m_t0_loaded = true;
47
48 return m_t0_loaded;
49}
double adc(const unsigned int &ml, const unsigned int &ly, const unsigned int &tb) const
get the t0 value of the tube tb in layer ly of multilayer ml; tb, ly, ml>0
double t0(const unsigned int &ml, const unsigned int &ly, const unsigned int &tb) const
get the t0 value of the tube tb in layer ly of multilayer ml; tb, ly, ml>0

◆ t0()

double MdtStationT0Container::t0 ( const unsigned int & ml,
const unsigned int & ly,
const unsigned int & tb ) const

get the t0 value of the tube tb in layer ly of multilayer ml; tb, ly, ml>0

Definition at line 21 of file MdtStationT0Container.cxx.

21 {
22 if (!m_t0_loaded) return 9e9;
23 return m_t0[ml - 1][ly - 1][tb - 1];
24}

◆ t0_loaded()

bool MuonCalib::MdtStationT0Container::t0_loaded ( ) const
inline

Definition at line 64 of file MdtStationT0Container.h.

64{ return m_t0_loaded; }

Member Data Documentation

◆ m_adc

std::vector<std::vector<std::vector<double> > > MuonCalib::MdtStationT0Container::m_adc
private

Definition at line 69 of file MdtStationT0Container.h.

◆ m_t0

std::vector<std::vector<std::vector<double> > > MuonCalib::MdtStationT0Container::m_t0
private

Definition at line 68 of file MdtStationT0Container.h.

◆ m_t0_loaded

bool MuonCalib::MdtStationT0Container::m_t0_loaded
private

Definition at line 73 of file MdtStationT0Container.h.


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