REST-for-Physics  v2.3
Rare Event Searches ToolKit for Physics
TRestDetectorSignalToRawSignalProcess.cxx
1/*************************************************************************
2 * This file is part of the REST software framework. *
3 * *
4 * Copyright (C) 2016 GIFNA/TREX (University of Zaragoza) *
5 * For more information see http://gifna.unizar.es/trex *
6 * *
7 * REST is free software: you can redistribute it and/or modify *
8 * it under the terms of the GNU General Public License as published by *
9 * the Free Software Foundation, either version 3 of the License, or *
10 * (at your option) any later version. *
11 * *
12 * REST is distributed in the hope that it will be useful, *
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15 * GNU General Public License for more details. *
16 * *
17 * You should have a copy of the GNU General Public License along with *
18 * REST in $REST_PATH/LICENSE. *
19 * If not, see http://www.gnu.org/licenses/. *
20 * For the list of contributors see $REST_PATH/CREDITS. *
21 *************************************************************************/
22
135
136#include "TRestDetectorSignalToRawSignalProcess.h"
137
138#include <TObjString.h>
139#include <TRestRawReadoutMetadata.h>
140
141#include <limits>
142
143using namespace std;
144
146
151
165 Initialize();
166 LoadConfig(configFilename);
167}
168
174}
175
188void TRestDetectorSignalToRawSignalProcess::LoadConfig(const string& configFilename, const string& name) {
189 LoadConfigFromFile(configFilename, name);
190}
191
197 SetSectionName(this->ClassName());
198 SetLibraryVersion(LIBRARY_VERSION);
199
200 fInputSignalEvent = nullptr;
202}
203
209
210 if (fInputSignalEvent->GetNumberOfSignals() <= 0) {
211 return nullptr;
212 }
213
215 fOutputRawSignalEvent->PrintEvent();
216 }
217
219 fOutputRawSignalEvent->SetSubID(fInputSignalEvent->GetSubID());
220 fOutputRawSignalEvent->SetTimeStamp(fInputSignalEvent->GetTimeStamp());
221 fOutputRawSignalEvent->SetSubEventTag(fInputSignalEvent->GetSubEventTag());
222
223 double triggerTime = 0;
224 double startTimeNoOffset = 0;
225
226 if (fTriggerMode == "firstDeposit") {
227 startTimeNoOffset = fInputSignalEvent->GetMinTime();
228 } else if (fTriggerMode == "integralThreshold") {
229 bool thresholdReached = false;
230 for (Double_t t = fInputSignalEvent->GetMinTime() - fNPoints * fSampling;
231 t <= fInputSignalEvent->GetMaxTime() + fNPoints * fSampling; t = t + 0.5) {
232 Double_t energy = fInputSignalEvent->GetIntegralWithTime(t, t + (fSampling * fNPoints) / 2.);
233
234 if (energy > fIntegralThreshold) {
235 startTimeNoOffset = t;
236 thresholdReached = true;
237 }
238 }
239 if (!thresholdReached) {
240 RESTWarning << "Integral threshold for trigger not reached" << RESTendl;
241 startTimeNoOffset = 0;
242 }
243 } else if (fTriggerMode == "observable") {
244 const auto obs = GetObservableValue<double>(fTriggerModeObservableName);
245 startTimeNoOffset = obs;
246
247 } else if (fTriggerMode == "firstDepositTPC" || fTriggerMode == "integralThresholdTPC") {
248 fReadout = GetMetadata<TRestDetectorReadout>();
249
250 if (fReadout == nullptr) {
251 RESTError << "TRestDetectorSignalToRawSignalProcess::ProcessEvent: "
252 << "TRestDetectorReadout metadata not found" << RESTendl;
253 exit(1);
254 }
255
256 set<const TRestDetectorSignal*> tpcSignals;
257
258 for (int n = 0; n < fInputSignalEvent->GetNumberOfSignals(); n++) {
259 TRestDetectorSignal* signal = fInputSignalEvent->GetSignal(n);
260 if (signal->GetSignalType() == "tpc") {
261 tpcSignals.insert(signal);
262 }
263 /*
264 const auto allDaqIds = fReadout->GetAllDaqIds();
265 for (const auto& daqId : allDaqIds) {
266 const auto& channel = fReadout->GetReadoutChannelWithDaqID(daqId);
267 // TODO: sometimes channel type does not match signal type, why?
268 }
269 */
270 }
271
272 if (tpcSignals.empty()) {
273 return nullptr;
274 }
275
276 if (fTriggerMode == "firstDepositTPC") {
277 double startTime = std::numeric_limits<float>::max();
278 for (const auto& signal : tpcSignals) {
279 const auto minTime = signal->GetMinTime();
280 if (minTime < startTime) {
281 startTime = minTime;
282 }
283 }
284
285 if (startTime >= std::numeric_limits<float>::max()) {
286 return nullptr;
287 }
288 startTimeNoOffset = startTime;
289
290 } else if (fTriggerMode == "integralThresholdTPC") {
291 RESTDebug << "TRestDetectorSignalToRawSignalProcess::ProcessEvent: "
292 << "Trigger mode integralThresholdTPC" << RESTendl;
293
294 if (fIntegralThresholdTPCkeV <= 0) {
295 RESTError << "TRestDetectorSignalToRawSignalProcess::ProcessEvent: "
296 << "integralThresholdTPCkeV must be greater than 0: " << fIntegralThresholdTPCkeV
297 << RESTendl;
298 exit(1);
299 }
300
301 double totalEnergy = 0;
302 for (const auto& signal : tpcSignals) {
303 totalEnergy += signal->GetIntegral();
304 }
305 if (totalEnergy < fIntegralThresholdTPCkeV) {
306 return nullptr;
307 }
308
309 Double_t maxTime = std::numeric_limits<Double_t>::min();
310 Double_t minTime = std::numeric_limits<Double_t>::max();
311 for (const auto& signal : tpcSignals) {
312 const auto maxSignalTime = signal->GetMaxTime();
313 if (maxSignalTime > maxTime) {
314 maxTime = maxSignalTime;
315 }
316 const auto minSignalTime = signal->GetMinTime();
317 if (minSignalTime < minTime) {
318 minTime = minSignalTime;
319 }
320
321 if (minSignalTime < 0) {
322 RESTWarning << "TRestDetectorSignalToRawSignalProcess::ProcessEvent: EventID: "
323 << fInputSignalEvent->GetID() << " signal ID: " << signal->GetSignalID()
324 << " minSignalTime < 0. MinSignalTime: " << minSignalTime << RESTendl;
325 signal->Print();
326 return nullptr;
327 }
328 }
329
330 if (minTime > maxTime || minTime < 0) {
331 RESTWarning << "TRestDetectorSignalToRawSignalProcess::ProcessEvent: EventID: "
332 << fInputSignalEvent->GetID()
333 << " minTime > maxTime or minTime < 0. MinTime: " << minTime
334 << " MaxTime: " << maxTime << RESTendl;
335 return nullptr;
336 }
337
338 triggerTime = minTime;
339 bool thresholdReached = false;
340 double maxEnergy = 0;
341 while (triggerTime <= maxTime + fSampling) {
342 // iterate over number of signals
343 double energy = 0;
344 const double startTime = triggerTime - fSampling * fNPoints;
345 for (const auto& signal : tpcSignals) {
346 energy += signal->GetIntegralWithTime(startTime, triggerTime);
347 }
348 if (energy > maxEnergy) {
349 maxEnergy = energy;
350 }
351 if (maxEnergy >= fIntegralThresholdTPCkeV) {
352 thresholdReached = true;
353 break;
354 }
355 triggerTime += fSampling;
356 }
357
358 if (!thresholdReached) {
359 return nullptr;
360 }
361
362 startTimeNoOffset = triggerTime;
363 }
364
365 } else if (fTriggerMode == "fixed") {
366 startTimeNoOffset = fTriggerFixedStartTime;
367 } else {
368 cerr << "TRestDetectorSignalToRawSignalProcess::ProcessEvent: "
369 << "Trigger mode not recognized" << RESTendl;
370 exit(1);
371 }
372
373 for (int n = 0; n < fInputSignalEvent->GetNumberOfSignals(); n++) {
374 TRestDetectorSignal* signal = fInputSignalEvent->GetSignal(n);
375 Int_t signalID = signal->GetSignalID();
376 string type = signal->GetSignalType();
377 // Check type is in the map
378 if (fParametersMap.find(type) == fParametersMap.end()) {
379 RESTWarning << "TRestDetectorSignalToRawSignalProcess::ProcessEvent: "
380 << "type " << type << " not found in parameters map" << RESTendl;
381 type = "";
382 }
383
384 double noiseLevel = fParametersMap.at(type).noiseLevel;
385 double sampling = fParametersMap.at(type).sampling;
386 double shapingTime = fParametersMap.at(type).shapingTime;
387 double calibrationGain = fParametersMap.at(type).calibrationGain;
388 double calibrationOffset = fParametersMap.at(type).calibrationOffset;
389
390 double timeStart = startTimeNoOffset - fTriggerDelay * sampling;
391 double timeEnd = timeStart + fNPoints * sampling;
392 RESTDebug << "fTimeStart: " << timeStart << " us " << RESTendl;
393 RESTDebug << "fTimeEnd: " << timeEnd << " us " << RESTendl;
394
395 if (timeStart + fTriggerDelay * sampling < 0) {
396 // This means something is wrong (negative times somewhere). This should never happen
397 cerr << "TRestDetectorSignalToRawSignalProcess::ProcessEvent: "
398 << "fTimeStart < - fTriggerDelay * fSampling" << endl;
399 exit(1);
400 }
401
402 // TODO: time offset may not be working correctly
403 // TODO: event drawing not working correctly (some signals are clipped)
404
405 if (timeStart + fTriggerDelay * fSampling < 0) {
406 // This means something is wrong (negative times somewhere). This should never happen
407 RESTError << "TRestDetectorSignalToRawSignalProcess::ProcessEvent: "
408 << "fTimeStart < - fTriggerDelay * fSampling" << RESTendl;
409 exit(1);
410 }
411
412 vector<Double_t> data(fNPoints, calibrationOffset);
413
414 for (int m = 0; m < signal->GetNumberOfPoints(); m++) {
415 Double_t t = signal->GetTime(m);
416 Double_t d = signal->GetData(m);
417
419 cout << "Signal: " << n << " Sample: " << m << " T: " << t << " Data: " << d << endl;
420 }
421
422 if (t > timeStart && t < timeEnd) {
423 // convert physical time (in us) to timeBin
424 auto timeBin = (Int_t)round((t - timeStart) / sampling);
425
426 if (GetVerboseLevel() >= TRestStringOutput::REST_Verbose_Level::REST_Warning) {
427 if (timeBin < 0 || timeBin > fNPoints) {
428 cout << "Time bin out of range!!! bin value: " << timeBin << endl;
429 timeBin = 0;
430 }
431 }
432
433 RESTDebug << "Adding data: " << signal->GetData(m) << " to Time Bin: " << timeBin << RESTendl;
434 data[timeBin] += calibrationGain * signal->GetData(m);
435 }
436 }
437
438 // Noise before shaping
439 if (noiseLevel > 0) {
440 for (int i = 0; i < fNPoints; i++) {
441 data[i] += gRandom->Gaus(0, noiseLevel);
442 }
443 }
444
445 if (shapingTime > 0) {
446 const auto sinShaper = [](Double_t t) -> Double_t {
447 if (t <= 0) {
448 return 0;
449 }
450 // function is normalized such that its absolute maximum is 1.0
451 // max is at x = 1.1664004483744728
452 return TMath::Exp(-3.0 * t) * TMath::Power(t, 3.0) * TMath::Sin(t) * 22.68112123672292;
453 };
454
455 const auto shapingFunction = [&sinShaper](Double_t t) -> Double_t {
456 if (t <= 0) {
457 return 0;
458 }
459 // function is normalized such that its absolute maximum is 1.0
460 // max is at x = 1.1664004483744728
461 // return sinShaper(t) - 1.0 * sinShaper(t - 1); // to add undershoot
462 return sinShaper(t);
463 };
464
465 vector<Double_t> dataAfterShaping(fNPoints, calibrationOffset);
466 for (int i = 0; i < fNPoints; i++) {
467 const Double_t value = data[i] - calibrationOffset;
468 if (value <= 0) {
469 // Only positive values are possible, 0 means no signal in this bin
470 continue;
471 }
472 for (int j = 0; j < fNPoints; j++) {
473 dataAfterShaping[j] += value * shapingFunction(((j - i) * sampling) / shapingTime);
474 }
475 }
476 data = dataAfterShaping;
477
478 // Noise after shaping
479 if (noiseLevel > 0) {
480 for (int i = 0; i < fNPoints; i++) {
481 data[i] += gRandom->Gaus(0, noiseLevel);
482 }
483 }
484 }
485
486 TRestRawSignal rawSignal;
487 rawSignal.SetSignalID(signalID);
488 for (int x = 0; x < fNPoints; x++) {
489 double value = round(data[x]);
490 if (GetVerboseLevel() >= TRestStringOutput::REST_Verbose_Level::REST_Warning) {
491 if (value < numeric_limits<Short_t>::min() || value > numeric_limits<Short_t>::max()) {
492 RESTDebug << "value (" << value << ") is outside short range ("
493 << numeric_limits<Short_t>::min() << ", " << numeric_limits<Short_t>::max()
494 << ")" << RESTendl;
495 }
496 }
497
498 if (value < numeric_limits<Short_t>::min()) {
499 value = numeric_limits<Short_t>::min();
500 fOutputRawSignalEvent->SetOK(false);
501 } else if (value > numeric_limits<Short_t>::max()) {
502 value = numeric_limits<Short_t>::max();
503 fOutputRawSignalEvent->SetOK(false);
504 }
505 rawSignal.AddPoint((Short_t)value);
506 }
507
509 rawSignal.Print();
510 }
511 RESTDebug << "Adding signal to raw signal event" << RESTendl;
512
513 fOutputRawSignalEvent->AddSignal(rawSignal);
514 }
515
516 SetObservableValue("triggerTimeTPC", triggerTime);
517
518 RESTDebug << "TRestDetectorSignalToRawSignalProcess. Returning event with N signals "
519 << fOutputRawSignalEvent->GetNumberOfSignals() << RESTendl;
520
522}
523
529 TString readoutTypesString = GetParameter("readoutTypes", "");
530 // split it by ","
531 TObjArray* readoutTypesArray = readoutTypesString.Tokenize(",");
532 for (int i = 0; i < readoutTypesArray->GetEntries(); i++) {
533 fReadoutTypes.insert(((TObjString*)readoutTypesArray->At(i))->GetString().Data());
534 }
535 cout << "readout types: ";
536 for (const auto& type : fReadoutTypes) {
537 cout << type << " ";
538 }
539 cout << endl;
540
541 // add default type ""
542 const string defaultType;
543 fReadoutTypes.insert(defaultType);
544 fParametersMap[defaultType] = {};
545
546 for (const auto& type : fReadoutTypes) {
547 fReadoutTypes.insert(type);
548 fParametersMap[type] = {};
549
550 string typeCamelCase = type;
551 typeCamelCase[0] = toupper(typeCamelCase[0]);
552
553 Parameters parameters;
554 parameters.sampling = GetDblParameterWithUnits("sampling" + typeCamelCase, parameters.sampling);
555 parameters.shapingTime =
556 GetDblParameterWithUnits("shapingTime" + typeCamelCase, parameters.shapingTime);
557 parameters.calibrationGain =
558 GetDblParameterWithUnits("gain" + typeCamelCase, parameters.calibrationGain);
559 parameters.calibrationOffset =
560 GetDblParameterWithUnits("offset" + typeCamelCase, parameters.calibrationOffset);
561 parameters.calibrationEnergy =
562 Get2DVectorParameterWithUnits("calibrationEnergy" + typeCamelCase, parameters.calibrationEnergy);
563 parameters.calibrationRange =
564 Get2DVectorParameterWithUnits("calibrationRange" + typeCamelCase, parameters.calibrationRange);
565 parameters.noiseLevel = GetDblParameterWithUnits("noiseLevel" + typeCamelCase, parameters.noiseLevel);
566
567 const bool isLinearCalibration =
568 (parameters.calibrationEnergy.Mod() != 0 && parameters.calibrationRange.Mod() != 0);
569 ;
570 if (isLinearCalibration) {
571 const auto range = numeric_limits<Short_t>::max() - numeric_limits<Short_t>::min();
572 parameters.calibrationGain =
573 range * (parameters.calibrationRange.Y() - parameters.calibrationRange.X()) /
574 (parameters.calibrationEnergy.Y() - parameters.calibrationEnergy.X());
575 parameters.calibrationOffset =
576 range * (parameters.calibrationRange.X() -
577 parameters.calibrationGain * parameters.calibrationEnergy.X()) +
578 numeric_limits<Short_t>::min();
579 }
580 fParametersMap[type] = parameters;
581 }
582
583 auto nPoints = GetParameter("nPoints");
584 if (nPoints == PARAMETER_NOT_FOUND_STR) {
585 nPoints = GetParameter("Npoints", fNPoints);
586 }
587 fNPoints = StringToInteger(nPoints);
588
589 fTriggerMode = GetParameter("triggerMode", fTriggerMode);
590 const set<string> validTriggerModes = {"firstDeposit", "integralThreshold", "fixed",
591 "observable", "firstDepositTPC", "integralThresholdTPC"};
592 if (validTriggerModes.count(fTriggerMode) == 0) {
593 RESTError << "Trigger mode set to: '" << fTriggerMode
594 << "' which is not a valid trigger mode. Please use one of the following trigger modes: ";
595 for (const auto& triggerMode : validTriggerModes) {
596 RESTError << triggerMode << " ";
597 }
598 RESTError << RESTendl;
599 exit(1);
600 }
601
604 fIntegralThresholdTPCkeV =
605 StringToDouble(GetParameter("integralThresholdTPCkeV", fIntegralThresholdTPCkeV));
606 if (fIntegralThresholdTPCkeV <= 0) {
607 RESTWarning << "integralThresholdTPCkeV must be greater than 0: " << fIntegralThresholdTPCkeV
608 << RESTendl;
609 // This should always be an error but breaks the CI...
610 // exit(1);
611 }
612
613 fTriggerFixedStartTime = GetDblParameterWithUnits("triggerFixedStartTime", fTriggerFixedStartTime);
614
615 // load default parameters (for backward compatibility)
616 fSampling = fParametersMap.at(defaultType).sampling;
617 fShapingTime = fParametersMap.at(defaultType).shapingTime;
618 fNoiseLevel = fParametersMap.at(defaultType).noiseLevel;
619 fCalibrationGain = fParametersMap.at(defaultType).calibrationGain;
620 fCalibrationOffset = fParametersMap.at(defaultType).calibrationOffset;
621 fCalibrationEnergy = fParametersMap.at(defaultType).calibrationEnergy;
622 fCalibrationRange = fParametersMap.at(defaultType).calibrationRange;
623
624 if (fTriggerMode == "observable") {
625 fTriggerModeObservableName = GetParameter("triggerModeObservableName", "");
626 if (fTriggerModeObservableName.empty()) {
627 RESTError << "You need to set 'triggerModeObservableName' to a valid analysis tree observable"
628 << RESTendl;
629 exit(1);
630 }
631 }
632}
633
635
636Double_t TRestDetectorSignalToRawSignalProcess::GetEnergyFromADC(Double_t adc, const string& type) const {
637 if (fParametersMap.find(type) == fParametersMap.end()) {
638 RESTWarning << "TRestDetectorSignalToRawSignalProcess::GetEnergyFromADC: "
639 << "type " << type << " not found in parameters map" << RESTendl;
640 return 0;
641 }
642 const auto gain = fParametersMap.at(type).calibrationGain;
643 const auto offset = fParametersMap.at(type).calibrationOffset;
644 return (adc - offset) / gain;
645}
646
647Double_t TRestDetectorSignalToRawSignalProcess::GetADCFromEnergy(Double_t energy, const string& type) const {
648 if (fParametersMap.find(type) == fParametersMap.end()) {
649 RESTWarning << "TRestDetectorSignalToRawSignalProcess::GetEnergyFromADC: "
650 << "type " << type << " not found in parameters map" << RESTendl;
651 return 0;
652 }
653 const auto gain = fParametersMap.at(type).calibrationGain;
654 const auto offset = fParametersMap.at(type).calibrationOffset;
655 return energy * gain + offset;
656}
657
658Double_t TRestDetectorSignalToRawSignalProcess::GetTimeFromBin(Double_t bin, const string& type) const {
659 if (fParametersMap.find(type) == fParametersMap.end()) {
660 RESTWarning << "TRestDetectorSignalToRawSignalProcess::GetEnergyFromADC: "
661 << "type " << type << " not found in parameters map" << RESTendl;
662 return 0;
663 }
664 const auto sampling = fParametersMap.at(type).sampling;
665 return (bin - fTriggerDelay) * sampling;
666}
667
668Double_t TRestDetectorSignalToRawSignalProcess::GetBinFromTime(Double_t time, const string& type) const {
669 if (fParametersMap.find(type) == fParametersMap.end()) {
670 RESTWarning << "TRestDetectorSignalToRawSignalProcess::GetEnergyFromADC: "
671 << "type " << type << " not found in parameters map" << RESTendl;
672 return 0;
673 }
674 const auto sampling = fParametersMap.at(type).sampling;
675 return (UShort_t)((time + fTriggerDelay * sampling) / sampling);
676}
677
680
681 RESTMetadata << "Points per channel: " << fNPoints << RESTendl;
682 RESTMetadata << "Trigger mode: " << fTriggerMode << RESTendl;
683 RESTMetadata << "Trigger delay: " << fTriggerDelay << " units" << RESTendl;
684
685 for (const auto& readoutType : fReadoutTypes) {
686 RESTMetadata << RESTendl;
687 string type = readoutType;
688 if (type.empty()) {
689 type = "default";
690 }
691 RESTMetadata << "Readout type: " << type << RESTendl;
692 RESTMetadata << "Sampling time: " << fParametersMap.at(readoutType).sampling * 1000 << " ns"
693 << RESTendl;
694 const double shapingTime = fParametersMap.at(readoutType).shapingTime;
695 if (shapingTime > 0) {
696 RESTMetadata << "Shaping time: " << shapingTime * 1000 << " ns" << RESTendl;
697 }
698 const double noiseLevel = fParametersMap.at(readoutType).noiseLevel;
699 if (noiseLevel > 0) {
700 RESTMetadata << "Noise Level: " << noiseLevel << RESTendl;
701 }
702
703 if (IsLinearCalibration()) {
704 RESTMetadata << "Calibration energies: (" << fParametersMap.at(readoutType).calibrationEnergy.X()
705 << ", " << fParametersMap.at(readoutType).calibrationEnergy.Y() << ") keV"
706 << RESTendl;
707 RESTMetadata << "Calibration range: (" << fParametersMap.at(readoutType).calibrationRange.X()
708 << ", " << fParametersMap.at(readoutType).calibrationRange.Y() << ")" << RESTendl;
709 }
710 RESTMetadata << "ADC Gain: " << fParametersMap.at(readoutType).calibrationGain << RESTendl;
711 RESTMetadata << "ADC Offset: " << fParametersMap.at(readoutType).calibrationOffset << RESTendl;
712 }
713 EndPrintProcess();
714}
A process to convert a TRestDetectorSignalEvent into a TRestRawSignalEvent.
TVector2 fCalibrationEnergy
two distinct energy values used for calibration
TRestDetectorSignalEvent * fInputSignalEvent
A pointer to the specific TRestDetectorSignalEvent input.
TRestEvent * ProcessEvent(TRestEvent *inputEvent) override
The main processing event function.
Double_t fSampling
The sampling time from the binned raw output signal.
void Initialize() override
Function to initialize input/output event members and define the section name.
void InitProcess() override
To be executed at the beginning of the run (outside event loop)
TRestRawSignalEvent * fOutputRawSignalEvent
A pointer to the specific TRestRawSignalEvent input.
std::string fTriggerMode
It is used to define the way the time start will be fixed.
void PrintMetadata() override
It prints out the process parameters stored in the metadata structure.
TVector2 fCalibrationRange
position in the range corresponding to the energy in 'fCalibrationEnergy'. Values between 0 and 1
Double_t fIntegralThreshold
This parameter is used by integralWindow trigger mode to define the acquisition window.
Int_t fNPoints
The number of points of the resulting output signal.
std::string fTriggerModeObservableName
The name of the observable used to define the trigger mode (i.e. g4Ana_sensitiveVolumeFirstHitTime)
Int_t fTriggerFixedStartTime
The starting time for the "fixed" trigger mode (can be offset by the trigger delay)
Int_t fTriggerDelay
The number of time bins the time start is delayed in the resulting output signal.
void LoadConfig(const std::string &configFilename, const std::string &name="")
Function to load the configuration from an external configuration file.
void InitFromConfigFile() override
Function reading input parameters from the RML TRestDetectorSignalToRawSignalProcess metadata section...
void BeginPrintProcess()
[name, cut range]
void SetObservableValue(const std::string &name, const T &value)
Set observable value for AnalysisTree.
A base class for any REST event.
Definition: TRestEvent.h:38
endl_t RESTendl
Termination flag object for TRestStringOutput.
Int_t LoadConfigFromFile(const std::string &configFilename, const std::string &sectionName="")
Give the file name, find out the corresponding section. Then call the main starter.
void SetLibraryVersion(TString version)
Set the library version of this metadata class.
TRestStringOutput::REST_Verbose_Level GetVerboseLevel()
returns the verboselevel in type of REST_Verbose_Level enumerator
void SetSectionName(std::string sName)
set the section name, clear the section content
std::string GetParameter(std::string parName, TiXmlElement *e, TString defaultValue=PARAMETER_NOT_FOUND_STR)
Returns the value for the parameter named parName in the given section.
An event container for time rawdata signals with fixed length.
It defines a Short_t array with a physical parameter that evolves in time using a fixed time bin.
void Print() const
It prints the signal data on screen.
void SetSignalID(Int_t sID)
It sets the id number of the signal.
void AddPoint(Short_t)
Adds a new point to the end of the signal data array.
@ REST_Debug
+show the defined debug messages
Double_t StringToDouble(std::string in)
Gets a double from a string.
Int_t StringToInteger(std::string in)
Gets an integer from a string.