17 #include "pugixml.hpp"
19 #include "pixie16app_defs.h"
71 std::istringstream iss(s);
73 if (!(iss >> value)) {
75 ss <<
"strings::to_double: Could not convert string '"
76 << s <<
"' to double" << std::endl;
86 std::istringstream iss(s);
88 if (!(iss >> value)) {
90 ss <<
"strings::to_int: Could not convert string '"
91 << s <<
"' to int" << std::endl;
104 std::transform(s.begin(), s.end(), s.begin(), ::tolower);
105 if (s ==
"true" || s ==
"1")
107 else if (s ==
"false" || s ==
"0")
110 std::stringstream ss;
111 ss <<
"strings::to_bool: Could not convert string '"
112 << s <<
"' to bool" << std::endl;
122 inline std::vector<std::string>
tokenize(std::string str,
123 std::string delimiter) {
125 std::vector<std::string> tokenized;
126 while (str.find(delimiter) != std::string::npos) {
127 size_t pos = str.find(delimiter);
128 temp = str.substr(0, pos);
129 str.erase(0, pos + 1);
130 tokenized.push_back(temp);
132 tokenized.push_back(str);
220 std::stringstream ss;
std::string revision_
the pixie revision
Definition: Globals.hpp:282
double sigmaBaselineThresh_
threshold on fitting for Std dev. of the baseline
Definition: Globals.hpp:265
double traceDelay_
the trace delay in ns
Definition: Globals.hpp:267
uint16_t halfword_t
a half pixie word
Definition: Globals.hpp:32
int to_int(std::string s)
Definition: Globals.hpp:85
double clockInSeconds_
the ACQ clock in seconds
Definition: Globals.hpp:251
static Globals * instance
Create the static instance of the class.
Definition: Globals.hpp:240
std::pair< unsigned int, unsigned int > siPmtWaveformRange() const
Definition: Globals.hpp:198
double qdcCompression() const
Definition: Globals.hpp:182
double bigLength() const
Definition: Globals.hpp:158
std::vector< std::pair< int, int > > reject_
rejection range in time
Definition: Globals.hpp:285
double energyContraction() const
Definition: Globals.hpp:154
double energyContraction_
energy contraction
Definition: Globals.hpp:252
double discriminationStart_
starting sample for the n-gamma discrimination
Definition: Globals.hpp:263
std::string revision() const
Definition: Globals.hpp:225
bool to_bool(std::string s)
Definition: Globals.hpp:103
uint32_t bufword_t
word in a pixie buffer
Definition: Globals.hpp:33
Pixie module related things that should not change between revisions.
Definition: Globals.hpp:30
int eventWidth() const
Definition: Globals.hpp:194
const pixie::word_t clockVsn
Definition: Globals.hpp:48
double smallLength() const
Definition: Globals.hpp:168
Some common string conversion operations.
Definition: Globals.hpp:66
Namespace defining some buffer related constants.
Definition: Globals.hpp:54
unsigned int maxWords_
maximum words in the
Definition: Globals.hpp:283
int eventWidth_
the size of the events
Definition: Globals.hpp:270
const unsigned int TOTALREAD
Definition: Globals.hpp:45
const int STATS
a stats buffer
Definition: Globals.hpp:55
std::vector< std::pair< int, int > > rejectRegions() const
Definition: Globals.hpp:234
Class to handle errors occurring during the execution of the code.
double traceDelay() const
Definition: Globals.hpp:188
double speedOfLightMedium() const
Definition: Globals.hpp:176
void WarnOfUnknownParameter(Messenger &m, pugi::xml_node_iterator &it)
Singleton class holding global parameters.
Definition: Globals.hpp:138
double traceLength() const
Definition: Globals.hpp:190
std::pair< double, double > smallVandlePars_
small VANDLE parameters for fitting
Definition: Globals.hpp:273
double siPmtSigmaBaselineThresh() const
Definition: Globals.hpp:186
double adcClockInSeconds_
adc clock in second
Definition: Globals.hpp:250
std::pair< double, double > smallVandlePars()
Definition: Globals.hpp:200
double speedOfLightBig_
speed of light in big VANDLE bars in cm/ns
Definition: Globals.hpp:260
std::pair< unsigned int, unsigned int > siPmtWaveformRange_
Range for the waveform of a Fast SiPmt.
Definition: Globals.hpp:272
bool hasReject() const
Definition: Globals.hpp:145
double to_double(std::string s)
Definition: Globals.hpp:70
unsigned short numTraces() const
Definition: Globals.hpp:230
double speedOfLight_
speed of light in cm/ns
Definition: Globals.hpp:259
std::pair< double, double > singleBetaPars_
Single Beta parameters for fitting.
Definition: Globals.hpp:276
std::pair< double, double > doubleBetaPars_
Double Beta parameters for fitting.
Definition: Globals.hpp:277
std::pair< double, double > tvandlePars_
Teeny-VANDEL parameters for fitting.
Definition: Globals.hpp:279
double neutronMass() const
Definition: Globals.hpp:166
double traceLength_
the trace length in ns
Definition: Globals.hpp:268
std::vector< std::string > tokenize(std::string str, std::string delimiter)
Definition: Globals.hpp:122
const size_t numberOfChannels
Definition: Globals.hpp:50
! Namespace defining some information for Timing related stuff
Definition: Globals.hpp:60
unsigned short numTraces_
number of traces to plot
Definition: Globals.hpp:284
unsigned int maxWords() const
Definition: Globals.hpp:227
std::pair< double, double > bigVandlePars_
big VANDLE parameters for fitting
Definition: Globals.hpp:275
double speedOfLightSmall_
speed of light in small VANDLE bars in cm/ns
Definition: Globals.hpp:262
const int ERROR
Defines an error buffer.
Definition: Globals.hpp:56
double bigLength_
length of big VANDLE bars in cm
Definition: Globals.hpp:255
double eventInSeconds() const
Definition: Globals.hpp:152
A class to handle messages and output them prettily.
double sigmaBaselineThresh() const
Definition: Globals.hpp:184
std::pair< double, double > singleBetaPars()
Definition: Globals.hpp:206
double speedOfLightSmall() const
Definition: Globals.hpp:178
double mediumLength_
length of medium VANDLE bars in cm
Definition: Globals.hpp:256
std::pair< double, double > liquidScintPars_
liquid scint pars for fitting
Definition: Globals.hpp:280
std::pair< double, double > liquidScintPars()
Definition: Globals.hpp:214
double filterClockInSeconds_
filter clock in seconds
Definition: Globals.hpp:254
double speedOfLightBig() const
Definition: Globals.hpp:174
double trapezoidalWalk() const
Definition: Globals.hpp:192
double speedOfLightMedium_
speed of light in medium VANDLE bars in cm/ns
Definition: Globals.hpp:261
std::pair< double, double > mediumVandlePars()
Definition: Globals.hpp:202
std::pair< double, double > pulserPars()
Definition: Globals.hpp:210
double bigLengthTime() const
Definition: Globals.hpp:160
double smallLengthTime() const
Definition: Globals.hpp:170
double adcClockInSeconds() const
Definition: Globals.hpp:148
std::pair< unsigned int, std::string > TimingIdentifier
Definition: Globals.hpp:62
const pixie::word_t U_DELIMITER
Definition: Globals.hpp:39
double filterClockInSeconds() const
Definition: Globals.hpp:156
This class outputs nicely formatted messages during configuration loading.
Definition: Messenger.hpp:19
double trapezoidalWalk_
the approximate walk in ns of the trap filter
Definition: Globals.hpp:269
double qdcCompression_
QDC compression factor for VANDLE related plots.
Definition: Globals.hpp:264
double clockInSeconds() const
Definition: Globals.hpp:150
bool hasReject_
Has a rejected.
Definition: Globals.hpp:249
std::pair< double, double > pulserPars_
Pulser parameters for fitting.
Definition: Globals.hpp:278
double speedOfLight() const
Definition: Globals.hpp:172
Error in conversion of string to numerical or boolean value.
Definition: Exceptions.hpp:87
std::string configPath_
configuration path
Definition: Globals.hpp:281
uint32_t word_t
a pixie word
Definition: Globals.hpp:31
void operator=(Globals const &)
copy constructor
double eventInSeconds_
event width in seconds
Definition: Globals.hpp:253
std::pair< double, double > mediumVandlePars_
medium VANDLE parameters for fitting
Definition: Globals.hpp:274
std::pair< double, double > bigVandlePars()
Definition: Globals.hpp:204
double mediumLength() const
Definition: Globals.hpp:162
std::pair< double, double > doubleBetaPars()
Definition: Globals.hpp:208
std::string configPath(std::string fileName)
Definition: Globals.hpp:219
double smallLength_
length of small VANDLE bars in cm
Definition: Globals.hpp:258
double mediumLengthTime() const
Definition: Globals.hpp:164
double neutronMass_
mass of neutrons in MeV/c/c
Definition: Globals.hpp:257
std::pair< unsigned int, unsigned int > waveformRange() const
Definition: Globals.hpp:196
std::pair< unsigned int, unsigned int > waveformRange_
Range for the waveform.
Definition: Globals.hpp:271
double siPmtSigmaBaselineThresh_
threshold on fitting for Std dev. of the baseline for SiPMTs
Definition: Globals.hpp:266
double discriminationStart() const
Definition: Globals.hpp:180
std::pair< double, double > tvandlePars()
Definition: Globals.hpp:212