REST-for-Physics  v2.3
Rare Event Searches ToolKit for Physics
TRestRawFemDAQToSignalProcess.h
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
23#ifndef RestCore_TRestRawFemDAQToSignalProcess
24#define RestCore_TRestRawFemDAQToSignalProcess
25
26#include <TRestEventProcess.h>
27
28#include "TRestRawSignalEvent.h"
29#include "TRestRawToSignalProcess.h"
30
35
37 private:
38 TRestRawSignalEvent* fSignalEvent = nullptr;
39 Long64_t fInputTreeEntry = 0;
40
41 TFile* fInputFile = nullptr;
42 TTree* fInputTree = nullptr;
43
44 Double_t fTimestamp = 0;
45 Int_t fEventID = 0;
46 std::vector<int>* fSignalIds = nullptr;
47 std::vector<short>* fSignalValues = nullptr;
48 Double_t fStartTimestamp = std::numeric_limits<double>::max();
49 Double_t fEndTimestamp = 0;
50 Bool_t fUseFeminosDaqRunInfo = true; //<
51 Bool_t fSetRunStartEndFromEvents = false; //<
52
53 public:
54 RESTValue GetInputEvent() const override { return RESTValue((TRestEvent*)nullptr); }
55 RESTValue GetOutputEvent() const override { return fSignalEvent; }
56
57 void InitProcess() override;
58 void Initialize() override;
59 void EndProcess() override;
60
61 TRestEvent* ProcessEvent(TRestEvent* inputEvent) override;
62 const char* GetProcessName() const override { return "FeminosRootToSignal"; }
63
65 inline void PrintMetadata() override {
67 std::string useFemDaqRunInfoStr = fUseFeminosDaqRunInfo ? "true" : "false";
68 std::string setRunStartEndFromEventsStr = fSetRunStartEndFromEvents ? "true" : "false";
69 RESTMetadata << "Use fem-daq run information: " << useFemDaqRunInfoStr << RESTendl;
70 RESTMetadata << "Set run start/end times from events: " << setRunStartEndFromEventsStr << RESTendl;
71
72 EndPrintProcess();
73 }
74 // Constructor
76 TRestRawFemDAQToSignalProcess(const char* configFilename);
77
78 // Destructor
80
81 ClassDefOverride(TRestRawFemDAQToSignalProcess,
82 1); // Template for a REST "event process" class inherited from
83 // TRestEventProcess
84};
85#endif
A base class for any REST event process.
void BeginPrintProcess()
[name, cut range]
A base class for any REST event.
Definition: TRestEvent.h:38
endl_t RESTendl
Termination flag object for TRestStringOutput.
void InitProcess() override
To be executed at the beginning of the run (outside event loop)
TRestEvent * ProcessEvent(TRestEvent *inputEvent) override
Process one event.
RESTValue GetInputEvent() const override
Get pointer to input event. Must be implemented in the derived class.
void EndProcess() override
To be executed at the end of the run (outside event loop)
RESTValue GetOutputEvent() const override
Get pointer to output event. Must be implemented in the derived class.
void Initialize() override
Making default settings.
void PrintMetadata() override
It prints out the process parameters stored in the metadata structure.
An event container for time rawdata signals with fixed length.