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

#include <LUCID_DigiSettings.h>

Collaboration diagram for LUCID_DigiSettings:

Classes

struct  parDouble
struct  parInt

Public Member Functions

 LUCID_DigiSettings ()
void Initialize (IMessageSvc *msgSvc)
void SetDigiParDouble (const std::string &, double)
void SetDigiParInt (const std::string &, int)
double GetDigiParDouble (const std::string &)
int GetDigiParInt (const std::string &)
void OverwriteDigiParProperties (Gaudi::Algorithm *)
void OverwriteDigiParValues ()
void Print () const

Private Member Functions

void SetDefaultValues ()
void DefNewParameterDouble (std::string, const std::string &, double *, double, double)
void DefNewParameterInt (std::string, const std::string &, int *, int, int)

Private Attributes

IMessageSvc * m_msgSvc
int m_numTubes {}
int m_qdcChannelsPerPE {}
double m_qdcFedNoiseFactor {}
double m_tdcPmtNoiseFactor {}
double m_tdcFedNoiseFactor {}
double m_parValueNotSetByUserDouble
int m_parValueNotSetByUserInt
std::map< std::string, parDoublem_doubleMap
std::map< std::string, parIntm_intMap

Detailed Description

Definition at line 17 of file LUCID_DigiSettings.h.

Constructor & Destructor Documentation

◆ LUCID_DigiSettings()

LUCID_DigiSettings::LUCID_DigiSettings ( )

Definition at line 12 of file LUCID_DigiSettings.cxx.

12 :
13 m_msgSvc(nullptr),
16
18}

Member Function Documentation

◆ DefNewParameterDouble()

void LUCID_DigiSettings::DefNewParameterDouble ( std::string parDescription,
const std::string & parname,
double * par,
double low,
double high )
private

Definition at line 167 of file LUCID_DigiSettings.cxx.

171 {
172
173 if (low > high) {
174 MsgStream log(m_msgSvc, "LUCID_DigiSettings::DefNewParameterDouble");
175 log << MSG::FATAL << " Swap the boundaries on the range " << parname << endmsg;
176 std::abort();
177 }
178 if (m_doubleMap.count(parname)) {
179 MsgStream log(m_msgSvc, "LUCID_DigiSettings::DefNewParameterDouble");
180 log << MSG::FATAL << " More than one parameter with that name " << parname << endmsg;
181 std::abort();
182 }
183 if (m_intMap.count (parname)) {
184 MsgStream log(m_msgSvc, "LUCID_DigiSettings::DefNewParameterDouble");
185 log << MSG::FATAL << " More than one parameter with that name " << parname << endmsg;
186 std::abort();
187 }
188
189 parDouble parD;
190
191 parD.parDescription = std::move(parDescription);
192 parD.par = par;
193 parD.low = low;
194 parD.high = high;
195 parD.overwriteVal = m_parValueNotSetByUserDouble;
196
197 m_doubleMap[parname] = std::move(parD);
198}
#define endmsg
std::map< std::string, parInt > m_intMap
std::map< std::string, parDouble > m_doubleMap

◆ DefNewParameterInt()

void LUCID_DigiSettings::DefNewParameterInt ( std::string parDescription,
const std::string & parname,
int * par,
int low,
int high )
private

Definition at line 200 of file LUCID_DigiSettings.cxx.

204 {
205
206 if (low > high) {
207 MsgStream log(m_msgSvc, "LUCID_DigiSettings::DefNewParameterInt");
208 log << MSG::FATAL << " Swap the boundaries on the range " << parname << endmsg;
209 std::abort();
210 }
211 if (m_doubleMap.count(parname)) {
212 MsgStream log(m_msgSvc, "LUCID_DigiSettings::DefNewParameterInt");
213 log << MSG::FATAL << " More than one parameter with that name " << parname << endmsg;
214 std::abort();
215 }
216 if (m_intMap.count (parname)) {
217 MsgStream log(m_msgSvc, "LUCID_DigiSettings::DefNewParameterInt");
218 log << MSG::FATAL << " More than one parameter with that name " << parname << endmsg;
219 std::abort();
220 }
221
222 parInt parI;
223
224 parI.parDescription = std::move(parDescription);
225 parI.par = par;
226 parI.low = low;
227 parI.high = high;
228 parI.overwriteVal = m_parValueNotSetByUserInt;
229
230 m_intMap[parname] = std::move(parI);
231}

◆ GetDigiParDouble()

double LUCID_DigiSettings::GetDigiParDouble ( const std::string & parname)

Definition at line 143 of file LUCID_DigiSettings.cxx.

143 {
144
145 if (!m_doubleMap.count(parname))
146 if (!m_intMap.count(parname)) {
147 MsgStream log(m_msgSvc, "LUCID_DigiSettings::GetDigiParDouble");
148 log << MSG::FATAL << " LUCID_DigiSettings: parameter does not exist: " << parname << endmsg;
149 std::abort();
150 }
151
152 return *m_doubleMap[parname].par;
153}

◆ GetDigiParInt()

int LUCID_DigiSettings::GetDigiParInt ( const std::string & parname)

Definition at line 155 of file LUCID_DigiSettings.cxx.

155 {
156
157 if (!m_doubleMap.count(parname))
158 if (!m_intMap.count(parname)) {
159 MsgStream log(m_msgSvc, "LUCID_DigiSettings::GetDigiParInt");
160 log << MSG::FATAL << " LUCID_DigiSettings: parameter does not exist: " << parname << endmsg;
161 std::abort();
162 }
163
164 return *m_intMap[parname].par;
165}

◆ Initialize()

void LUCID_DigiSettings::Initialize ( IMessageSvc * msgSvc)

Definition at line 20 of file LUCID_DigiSettings.cxx.

20 {
21
23
24 MsgStream log(m_msgSvc, "LUCID_DigiSettings::initialize");
25
26 log << MSG::INFO << "Initializing" << endmsg;
27
29}
msgSvc
Provide convenience handles for various services.
Definition StdJOSetup.py:36

◆ OverwriteDigiParProperties()

void LUCID_DigiSettings::OverwriteDigiParProperties ( Gaudi::Algorithm * alg)

Definition at line 48 of file LUCID_DigiSettings.cxx.

48 {
49
50 std::map <std::string, parDouble>::iterator doubleMapIt = m_doubleMap.begin();
51 std::map <std::string, parInt>::iterator intMapIt = m_intMap.begin();
52
53 for (; doubleMapIt != m_doubleMap.end(); ++doubleMapIt) alg->declareProperty(std::string("Overwrite_") + doubleMapIt->first, doubleMapIt->second.overwriteVal);
54 for (; intMapIt != m_intMap.end() ; ++intMapIt ) alg->declareProperty(std::string("Overwrite_") + intMapIt->first , intMapIt->second.overwriteVal);
55}

◆ OverwriteDigiParValues()

void LUCID_DigiSettings::OverwriteDigiParValues ( )

Definition at line 57 of file LUCID_DigiSettings.cxx.

57 {
58
59 MsgStream log(m_msgSvc, "LUCID_DigiSettings");
60
61 log << MSG::INFO << " OverwriteDigiParValues " << endmsg;
62
63 std::map <std::string, parDouble>::iterator doubleMapIt = m_doubleMap.begin();
64 std::map <std::string, parInt>::iterator intMapIt = m_intMap.begin();
65
66 if (doubleMapIt->second.overwriteVal != m_parValueNotSetByUserDouble) {
67
68 for (; doubleMapIt != m_doubleMap.end(); ++doubleMapIt) {
69
70 if (doubleMapIt->second.overwriteVal > doubleMapIt->second.low &&
71 doubleMapIt->second.overwriteVal < doubleMapIt->second.high) {
72
73 *(doubleMapIt->second.par) = doubleMapIt->second.overwriteVal;
74
75 log << MSG::INFO << " Overwriting: "
76 << doubleMapIt->second.parDescription << " to : "
77 << doubleMapIt->second.overwriteVal << endmsg;
78 }
79 }
80 }
81
82 if (intMapIt->second.overwriteVal != m_parValueNotSetByUserInt) {
83
84 for (; intMapIt != m_intMap.end(); ++intMapIt) {
85
86 if (intMapIt->second.overwriteVal > intMapIt->second.low &&
87 intMapIt->second.overwriteVal < intMapIt->second.high) {
88
89 *(intMapIt->second.par) = intMapIt->second.overwriteVal;
90
91 log << MSG::INFO << " Overwriting: "
92 << intMapIt->second.parDescription << " to : "
93 << intMapIt->second.overwriteVal << endmsg;
94 }
95 }
96 }
97}

◆ Print()

void LUCID_DigiSettings::Print ( ) const

Definition at line 99 of file LUCID_DigiSettings.cxx.

99 {
100
101 MsgStream log(m_msgSvc, "LUCID_DigiSettings::Print");
102
103 std::map <std::string, parDouble>::const_iterator doubleMapIt = m_doubleMap.begin();
104 std::map <std::string, parInt>::const_iterator intMapIt = m_intMap.begin();
105
106 log << MSG::INFO << "===================== Doubles ======================" << endmsg;
107
108 for (; doubleMapIt != m_doubleMap.end(); ++doubleMapIt)
109 log << MSG::INFO << doubleMapIt->second.parDescription << ": " << *(doubleMapIt->second.par) <<endmsg;
110
111 log << MSG::INFO << "===================== Integers ======================" << endmsg;
112
113 for (; intMapIt != m_intMap.end(); ++intMapIt)
114 log << MSG::INFO << intMapIt->second.parDescription << ": " << *(intMapIt->second.par) << endmsg;
115
116 log << MSG::INFO << "=====================================================" << endmsg;
117}

◆ SetDefaultValues()

void LUCID_DigiSettings::SetDefaultValues ( )
private

Definition at line 31 of file LUCID_DigiSettings.cxx.

31 {
32
33 MsgStream log(m_msgSvc, "LUCID_DigiSettings::SetDefaultValues");
34
35 DefNewParameterInt ("Number of LUCID tubes" , "numTubes" , &m_numTubes , 1, 100);
36 DefNewParameterInt ("QDC channels per photo-electron", "qdcChannelsPerPE" , &m_qdcChannelsPerPE , 1 , 100);
37 DefNewParameterDouble("QDC FED NoiseFactor" , "qdcFedNoiseFactor", &m_qdcFedNoiseFactor, 1., 50.);
38 DefNewParameterDouble("TDC PMT NoiseFactor" , "tdcPmtNoiseFactor", &m_tdcPmtNoiseFactor, 1., 50.);
39 DefNewParameterDouble("TDC FED NoiseFactor" , "tdcFedNoiseFactor", &m_tdcFedNoiseFactor, 1., 50.);
40
41 m_numTubes = 40;
46}
void DefNewParameterDouble(std::string, const std::string &, double *, double, double)
void DefNewParameterInt(std::string, const std::string &, int *, int, int)

◆ SetDigiParDouble()

void LUCID_DigiSettings::SetDigiParDouble ( const std::string & parname,
double parval )

Definition at line 119 of file LUCID_DigiSettings.cxx.

119 {
120
121 if (!m_doubleMap.count(parname))
122 if (!m_intMap.count(parname)) {
123 MsgStream log(m_msgSvc, "LUCID_DigiSettings::SetDigiParDouble");
124 log << MSG::FATAL << " LUCID_DigiSettings: parameter does not exist: " << parname << endmsg;
125 std::abort();
126 }
127
128 m_doubleMap[parname].par = &parval;
129}

◆ SetDigiParInt()

void LUCID_DigiSettings::SetDigiParInt ( const std::string & parname,
int parval )

Definition at line 131 of file LUCID_DigiSettings.cxx.

131 {
132
133 if (!m_doubleMap.count(parname))
134 if (!m_intMap.count(parname)) {
135 MsgStream log(m_msgSvc, "LUCID_DigiSettings::SetDigiParInt");
136 log << MSG::FATAL << " LUCID_DigiSettings: parameter does not exist: " << parname << endmsg;
137 std::abort();
138 }
139
140 m_intMap[parname].par = &parval;
141}

Member Data Documentation

◆ m_doubleMap

std::map<std::string, parDouble> LUCID_DigiSettings::m_doubleMap
private

Definition at line 71 of file LUCID_DigiSettings.h.

◆ m_intMap

std::map<std::string, parInt> LUCID_DigiSettings::m_intMap
private

Definition at line 72 of file LUCID_DigiSettings.h.

◆ m_msgSvc

IMessageSvc* LUCID_DigiSettings::m_msgSvc
private

Definition at line 39 of file LUCID_DigiSettings.h.

◆ m_numTubes

int LUCID_DigiSettings::m_numTubes {}
private

Definition at line 41 of file LUCID_DigiSettings.h.

41{};

◆ m_parValueNotSetByUserDouble

double LUCID_DigiSettings::m_parValueNotSetByUserDouble
private

Definition at line 47 of file LUCID_DigiSettings.h.

◆ m_parValueNotSetByUserInt

int LUCID_DigiSettings::m_parValueNotSetByUserInt
private

Definition at line 48 of file LUCID_DigiSettings.h.

◆ m_qdcChannelsPerPE

int LUCID_DigiSettings::m_qdcChannelsPerPE {}
private

Definition at line 42 of file LUCID_DigiSettings.h.

42{};

◆ m_qdcFedNoiseFactor

double LUCID_DigiSettings::m_qdcFedNoiseFactor {}
private

Definition at line 43 of file LUCID_DigiSettings.h.

43{};

◆ m_tdcFedNoiseFactor

double LUCID_DigiSettings::m_tdcFedNoiseFactor {}
private

Definition at line 45 of file LUCID_DigiSettings.h.

45{};

◆ m_tdcPmtNoiseFactor

double LUCID_DigiSettings::m_tdcPmtNoiseFactor {}
private

Definition at line 44 of file LUCID_DigiSettings.h.

44{};

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