REST-for-Physics  v2.3
Rare Event Searches ToolKit for Physics
TRestDetectorSignalRecoveryProcess.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_TRestDetectorSignalRecoveryProcess
24#define RestCore_TRestDetectorSignalRecoveryProcess
25
26#include <TRestDetectorReadout.h>
27#include <TRestEventProcess.h>
28
29#include "TRestDetectorSignalEvent.h"
30
33 private:
34 std::vector<Int_t> fChannelIds; //<
35
38
41
44
45 void Initialize() override;
46
47 void LoadDefaultConfig();
48
49 int GetAdjacentSignalIds(Int_t signalId, Int_t& idLeft, Int_t& idRight);
50
51 public:
52 RESTValue GetInputEvent() const override { return fInputSignalEvent; }
53 RESTValue GetOutputEvent() const override { return fOutputSignalEvent; }
54
55 void InitProcess() override;
56 TRestEvent* ProcessEvent(TRestEvent* eventInput) override;
57
58 void LoadConfig(const std::string& configFilename, const std::string& name = "");
59
61 void PrintMetadata() override {
63 for (const auto& channelId : fChannelIds) {
64 RESTMetadata << "Channel id to recover: " << channelId << RESTendl;
65 }
66 EndPrintProcess();
67 }
68
71
73 const char* GetProcessName() const override { return "signalRecovery"; }
74
75 // Constructor
77 TRestDetectorSignalRecoveryProcess(const char* configFilename);
78
79 // Destructor
81
82 ClassDefOverride(TRestDetectorSignalRecoveryProcess, 1);
83};
84#endif
A metadata class to generate/store a readout description.
A process allowing to recover selected channels from a TRestRawSignalEvent.
void InitProcess() override
Function to initialize the process. TRestDetectorSignalRecoveryProcess requires to get a pointer to T...
void LoadDefaultConfig()
Function to load the default config in absence of RML input.
RESTValue GetOutputEvent() const override
Get pointer to output event. Must be implemented in the derived class.
RESTValue GetInputEvent() const override
Get pointer to input event. Must be implemented in the derived class.
int GetAdjacentSignalIds(Int_t signalId, Int_t &idLeft, Int_t &idRight)
It returns the channel daq id of the adjacent readout channels. It will properly identify that we got...
TRestDetectorSignalEvent * fOutputSignalEvent
A pointer to the specific TRestDetectorSignalEvent input.
void Initialize() override
Function to initialize input/output event members and define the section name.
void PrintMetadata() override
It prints out the process parameters stored in the metadata structure.
TRestDetectorSignalEvent * fInputSignalEvent
A pointer to the specific TRestDetectorSignalEvent input.
TRestEvent * ProcessEvent(TRestEvent *eventInput) override
The main processing event function.
const char * GetProcessName() const override
Returns the name of this process.
void LoadConfig(const std::string &configFilename, const std::string &name="")
Function to load the configuration from an external configuration file.
TRestDetectorReadout * fReadout
A pointer to the readout that will be extracted from TRestRun.
TRestEventProcess * Maker()
Returns a new instance of this class.
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.