7 using std::stringstream;
33 o<<
"RunNumber : "<<
fNumber<<std::endl;
45 double samplMin = 1e15, samplMax=-1e15;
46 double ADC2mVMin = 1e15, ADC2mVMax=-1e15;
56 o<<
"Sampling frequency: ";
57 if(samplMin == samplMax) {
60 o<<
"["<<samplMin<<
","<<samplMax<<
"]";
64 if(ADC2mVMin == ADC2mVMax) {
67 o<<
"["<<ADC2mVMin<<
","<<ADC2mVMax<<
"]";
69 o<<
" mV/ADC units"<<std::endl;
77 o<<
"fNumber"<<
"\t"<<
fNumber<<std::endl;
105 o<<
"fChannelsRunData["<<i<<
"].fADC2mV"<<
"\t"<<chrundata.
fADC2mV<<std::endl;
106 o<<
"fChannelsRunData["<<i<<
"].fSamplingFrequency"<<
"\t"<<chrundata.
fSamplingFrequency<<std::endl;
107 o<<
"fChannelsRunData["<<i<<
"].fADCMax"<<
"\t"<<chrundata.
fADCMax<<std::endl;
108 o<<
"fChannelsRunData["<<i<<
"].fADCMin"<<
"\t"<<chrundata.
fADCMin<<std::endl;
109 o<<
"fChannelsRunData["<<i<<
"].fNumberOfSamples"<<
"\t"<<chrundata.
fNumberOfSamples<<std::endl;
110 o<<
"fChannelsRunData["<<i<<
"].fIsBolometer"<<
"\t"<<chrundata.
fIsBolometer<<std::endl;
111 o<<
"fChannelsRunData["<<i<<
"].fIsThermometer"<<
"\t"<<chrundata.
fIsThermometer<<std::endl;
115 o<<
"fStopDate"<<
"\t"<<
fStopDate<<std::endl;
116 o<<
"fDuration"<<
"\t"<<
fDuration<<std::endl;
125 std::string tag, det, type;
126 size_t td_size, b_size, t_size;
127 int nrun, tdc, bc, tc;
128 double adc2mv, samplf;
129 int adcmax, adcmin, nsamples;
131 time_t start, stop, duration;
135 if(tag !=
"fNumber") {
137 err.SetDescription(
"Expected tag fNumber");
144 if(tag !=
"fDetector") {
146 err.SetDescription(
"Expected tag fDetector");
155 err.SetDescription(
"Expected tag fType");
163 ob >> tag >> td_size;
165 if(tag !=
"fThermalDetectorChannels.size") {
167 err.SetDescription(
"Expected tag fThermalDetectorChannels.size()");
171 for(
size_t i =0; i < td_size; i++) {
174 tagstr<<
"fThermalDetectorChannels["<<i<<
"]";
175 if(tag != tagstr.str()) {
177 err.SetDescription(std::string(
"Expected tag ")+tagstr.str());
188 if(tag !=
"fBolometerChannels.size") {
190 err.SetDescription(
"Expected tag fBolometerChannels.size()");
194 for(
size_t i =0; i < b_size; i++) {
197 tagstr<<
"fBolometerChannels["<<i<<
"]";
198 if(tag != tagstr.str()) {
200 err.SetDescription(std::string(
"Expected tag ")+tagstr.str());
211 if(tag !=
"fThermometerChannels.size") {
213 err.SetDescription(
"Expected tag fThermometerChannels.size()");
217 for(
size_t i =0; i < t_size; i++) {
220 tagstr<<
"fThermometerChannels["<<i<<
"]";
221 if(tag != tagstr.str()) {
223 err.SetDescription(std::string(
"Expected tag ")+tagstr.str());
231 for(
size_t i =0; i < td_size; i++) {
237 tagstr<<
"fChannelsRunData["<<i<<
"].fADC2mV";
238 if(tag != tagstr.str()) {
240 err.SetDescription(std::string(
"Expected tag ")+tagstr.str());
247 tagstr<<
"fChannelsRunData["<<i<<
"].fSamplingFrequency";
248 if(tag != tagstr.str()) {
250 err.SetDescription(std::string(
"Expected tag ")+tagstr.str());
257 tagstr<<
"fChannelsRunData["<<i<<
"].fADCMax";
258 if(tag != tagstr.str()) {
260 err.SetDescription(std::string(
"Expected tag ")+tagstr.str());
267 tagstr<<
"fChannelsRunData["<<i<<
"].fADCMin";
268 if(tag != tagstr.str()) {
270 err.SetDescription(std::string(
"Expected tag ")+tagstr.str());
275 ob >> tag >> nsamples;
277 tagstr<<
"fChannelsRunData["<<i<<
"].fNumberOfSamples";
278 if(tag != tagstr.str()) {
280 err.SetDescription(std::string(
"Expected tag ")+tagstr.str());
287 tagstr<<
"fChannelsRunData["<<i<<
"].fIsBolometer";
288 if(tag != tagstr.str()) {
290 err.SetDescription(std::string(
"Expected tag ")+tagstr.str());
295 ob >> tag >> istherm;
297 tagstr<<
"fChannelsRunData["<<i<<
"].fIsThermometer";
298 if(tag != tagstr.str()) {
300 err.SetDescription(std::string(
"Expected tag ")+tagstr.str());
311 if(tag !=
"fStartDate") {
313 err.SetDescription(
"Expected tag fStartDate");
320 if(tag !=
"fStopDate") {
322 err.SetDescription(
"Expected tag fStopDate");
328 ob >> tag >> duration;
329 if(tag !=
"fDuration") {
331 err.SetDescription(
"Expected tag fDuration");
345 msg<<
"Cannot find QChannelRunData for channel "<<
channel<<
" in QRunData of run "<<
fNumber;
346 err.SetDescription(__FILE__,__LINE__,msg.str());
349 return *(iter->second);
QChannelRunData chanRunData
std::string AsString() const
convert to string
QError Set(const int run)
convert from run number
basic channel and run based info. Used in the QRunData object.
double fSamplingFrequency
sampling frequency in Hz
int fADCMin
ADC minimum in ADC units.
bool fIsThermometer
is thermometer
int fNumberOfSamples
number of samples in ADC window
int fADCMax
ADC maximum in ADC units.
double fADC2mV
conversion: mV = ADC * fADC2mV
bool fIsBolometer
is bolometer
error class with error type and description
std::map< int, QChannelRunData * > fChannelsRunData_ptr
channel based quantities
time_t fStartDate
StartTime.
RunType fSourceType
Detector name.
virtual void Clear()
Clear members.
QRunData & operator=(const QRunData &other)
virtual void Dump(std::ostream &o) const
dump object to stream
std::vector< int > fThermalDetectorChannels
Thermal detector channels: union of fBolometerChannels and fThermometerChannels.
time_t fStopDate
StopTime.
const QChannelRunData & GetChannelRunData(const int channel) const
get channel based run data quantities
time_t fDuration
Duration.
std::vector< int > fBolometerChannels
Bolometers channels (thermistors glued to a crystal)
DetectorName fDetector
Source Run Number.
virtual QError ReadFromStream(std::istream &ob)
Read object from stream.
void SetChannelRunData(const int channel, const QChannelRunData &chanRunData)
set channel based run data quantities
virtual QError WriteOnStream(std::ostream &o) const
Write object on stream.
std::vector< int > fThermometerChannels
Thermometers channels (thermistors not glued to a crystal)
std::string AsString() const
convert to string
QError Set(const std::string &)
convert from string