ATLAS Offline Software
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
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 19 of file LUCID_DigiSettings.h.

Constructor & Destructor Documentation

◆ LUCID_DigiSettings()

LUCID_DigiSettings::LUCID_DigiSettings ( )

Definition at line 14 of file LUCID_DigiSettings.cxx.

14  :
15  m_msgSvc(nullptr),
18 
20 }

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 169 of file LUCID_DigiSettings.cxx.

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

◆ DefNewParameterInt()

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

Definition at line 202 of file LUCID_DigiSettings.cxx.

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

◆ GetDigiParDouble()

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

Definition at line 145 of file LUCID_DigiSettings.cxx.

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

◆ GetDigiParInt()

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

Definition at line 157 of file LUCID_DigiSettings.cxx.

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

◆ Initialize()

void LUCID_DigiSettings::Initialize ( IMessageSvc *  msgSvc)

Definition at line 22 of file LUCID_DigiSettings.cxx.

22  {
23 
24  m_msgSvc = msgSvc;
25 
26  MsgStream log(m_msgSvc, "LUCID_DigiSettings::initialize");
27 
28  log << MSG::INFO << "Initializing" << endmsg;
29 
31 }

◆ OverwriteDigiParProperties()

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

Definition at line 50 of file LUCID_DigiSettings.cxx.

50  {
51 
54 
55  for (; doubleMapIt != m_doubleMap.end(); ++doubleMapIt) alg->declareProperty(std::string("Overwrite_") + doubleMapIt->first, doubleMapIt->second.overwriteVal);
56  for (; intMapIt != m_intMap.end() ; ++intMapIt ) alg->declareProperty(std::string("Overwrite_") + intMapIt->first , intMapIt->second.overwriteVal);
57 }

◆ OverwriteDigiParValues()

void LUCID_DigiSettings::OverwriteDigiParValues ( )

Definition at line 59 of file LUCID_DigiSettings.cxx.

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

◆ Print()

void LUCID_DigiSettings::Print ( ) const

Definition at line 101 of file LUCID_DigiSettings.cxx.

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

◆ SetDefaultValues()

void LUCID_DigiSettings::SetDefaultValues ( )
private

Definition at line 33 of file LUCID_DigiSettings.cxx.

33  {
34 
35  MsgStream log(m_msgSvc, "LUCID_DigiSettings::SetDefaultValues");
36 
37  DefNewParameterInt ("Number of LUCID tubes" , "numTubes" , &m_numTubes , 1, 100);
38  DefNewParameterInt ("QDC channels per photo-electron", "qdcChannelsPerPE" , &m_qdcChannelsPerPE , 1 , 100);
39  DefNewParameterDouble("QDC FED NoiseFactor" , "qdcFedNoiseFactor", &m_qdcFedNoiseFactor, 1., 50.);
40  DefNewParameterDouble("TDC PMT NoiseFactor" , "tdcPmtNoiseFactor", &m_tdcPmtNoiseFactor, 1., 50.);
41  DefNewParameterDouble("TDC FED NoiseFactor" , "tdcFedNoiseFactor", &m_tdcFedNoiseFactor, 1., 50.);
42 
43  m_numTubes = 40;
44  m_qdcChannelsPerPE = 10;
45  m_qdcFedNoiseFactor = 3.0;
46  m_tdcPmtNoiseFactor = 2.8;
47  m_tdcFedNoiseFactor = 0.8;
48 }

◆ SetDigiParDouble()

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

Definition at line 121 of file LUCID_DigiSettings.cxx.

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

◆ SetDigiParInt()

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

Definition at line 133 of file LUCID_DigiSettings.cxx.

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

Member Data Documentation

◆ m_doubleMap

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

Definition at line 73 of file LUCID_DigiSettings.h.

◆ m_intMap

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

Definition at line 74 of file LUCID_DigiSettings.h.

◆ m_msgSvc

IMessageSvc* LUCID_DigiSettings::m_msgSvc
private

Definition at line 41 of file LUCID_DigiSettings.h.

◆ m_numTubes

int LUCID_DigiSettings::m_numTubes {}
private

Definition at line 43 of file LUCID_DigiSettings.h.

◆ m_parValueNotSetByUserDouble

double LUCID_DigiSettings::m_parValueNotSetByUserDouble
private

Definition at line 49 of file LUCID_DigiSettings.h.

◆ m_parValueNotSetByUserInt

int LUCID_DigiSettings::m_parValueNotSetByUserInt
private

Definition at line 50 of file LUCID_DigiSettings.h.

◆ m_qdcChannelsPerPE

int LUCID_DigiSettings::m_qdcChannelsPerPE {}
private

Definition at line 44 of file LUCID_DigiSettings.h.

◆ m_qdcFedNoiseFactor

double LUCID_DigiSettings::m_qdcFedNoiseFactor {}
private

Definition at line 45 of file LUCID_DigiSettings.h.

◆ m_tdcFedNoiseFactor

double LUCID_DigiSettings::m_tdcFedNoiseFactor {}
private

Definition at line 47 of file LUCID_DigiSettings.h.

◆ m_tdcPmtNoiseFactor

double LUCID_DigiSettings::m_tdcPmtNoiseFactor {}
private

Definition at line 46 of file LUCID_DigiSettings.h.


The documentation for this class was generated from the following files:
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
LUCID_DigiSettings::OverwriteDigiParValues
void OverwriteDigiParValues()
Definition: LUCID_DigiSettings.cxx:59
LUCID_DigiSettings::DefNewParameterInt
void DefNewParameterInt(std::string, const std::string &, int *, int, int)
Definition: LUCID_DigiSettings.cxx:202
SGout2dot.alg
alg
Definition: SGout2dot.py:243
python.Constants.FATAL
int FATAL
Definition: Control/AthenaCommon/python/Constants.py:19
LUCID_DigiSettings::m_tdcPmtNoiseFactor
double m_tdcPmtNoiseFactor
Definition: LUCID_DigiSettings.h:46
python.CreateTierZeroArgdict.parname
parname
Definition: CreateTierZeroArgdict.py:194
LUCID_DigiSettings::SetDefaultValues
void SetDefaultValues()
Definition: LUCID_DigiSettings.cxx:33
LUCID_DigiSettings::DefNewParameterDouble
void DefNewParameterDouble(std::string, const std::string &, double *, double, double)
Definition: LUCID_DigiSettings.cxx:169
LUCID_DigiSettings::m_msgSvc
IMessageSvc * m_msgSvc
Definition: LUCID_DigiSettings.h:41
LUCID_DigiSettings::m_parValueNotSetByUserDouble
double m_parValueNotSetByUserDouble
Definition: LUCID_DigiSettings.h:49
LUCID_DigiSettings::m_parValueNotSetByUserInt
int m_parValueNotSetByUserInt
Definition: LUCID_DigiSettings.h:50
LUCID_DigiSettings::m_qdcFedNoiseFactor
double m_qdcFedNoiseFactor
Definition: LUCID_DigiSettings.h:45
StdJOSetup.msgSvc
msgSvc
Provide convenience handles for various services.
Definition: StdJOSetup.py:36
LUCID_DigiSettings::m_numTubes
int m_numTubes
Definition: LUCID_DigiSettings.h:43
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
LUCID_DigiSettings::m_doubleMap
std::map< std::string, parDouble > m_doubleMap
Definition: LUCID_DigiSettings.h:73
createCoolChannelIdFile.par
par
Definition: createCoolChannelIdFile.py:29
LUCID_DigiSettings::m_tdcFedNoiseFactor
double m_tdcFedNoiseFactor
Definition: LUCID_DigiSettings.h:47
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
LUCID_DigiSettings::m_qdcChannelsPerPE
int m_qdcChannelsPerPE
Definition: LUCID_DigiSettings.h:44
LUCID_DigiSettings::m_intMap
std::map< std::string, parInt > m_intMap
Definition: LUCID_DigiSettings.h:74