REST-for-Physics  v2.3
Rare Event Searches ToolKit for Physics
TRestRawSignalRemoveChannelsProcess.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_TRestRawSignalRemoveChannelsProcess
24 #define RestCore_TRestRawSignalRemoveChannelsProcess
25 
26 #include <TRestRawSignalEvent.h>
27 
28 #include "TRestEventProcess.h"
29 
32  private:
33 #ifndef __CINT__
36 
39 #endif
40 
41  void InitFromConfigFile() override;
42 
43  void Initialize() override;
44 
45  void LoadDefaultConfig();
46 
47  protected:
48  std::vector<Int_t> fChannelIds;
49 
50  TVector2 fSignalRange = TVector2(-1, -1);
51 
52  public:
53  RESTValue GetInputEvent() const override { return fInputSignalEvent; }
54  RESTValue GetOutputEvent() const override { return fOutputSignalEvent; }
55 
56  TRestEvent* ProcessEvent(TRestEvent* inputEvent) override;
57 
58  void LoadConfig(const std::string& configFilename, const std::string& name = "");
59 
61  void PrintMetadata() override {
63 
64  for (unsigned int n = 0; n < fChannelIds.size(); n++)
65  RESTMetadata << "Channel id to remove : " << fChannelIds[n] << RESTendl;
66 
67  EndPrintProcess();
68  }
69 
72 
74  const char* GetProcessName() const override { return "removeChannels"; }
75 
76  // Constructor
78  TRestRawSignalRemoveChannelsProcess(const char* configFilename);
79 
80  // Destructor
82 
83  ClassDefOverride(TRestRawSignalRemoveChannelsProcess, 1);
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.
An event container for time rawdata signals with fixed length.
A process allowing to remove selected channels from a TRestRawSignalEvent.
const char * GetProcessName() const override
Returns the name of this process.
void InitFromConfigFile() override
Function reading input parameters from the RML TRestDetectorSignalToRawSignalProcess metadata section...
TRestRawSignalEvent * fInputSignalEvent
A pointer to the specific TRestDetectorSignalEvent input.
TRestEvent * ProcessEvent(TRestEvent *inputEvent) override
The main processing event function.
RESTValue GetInputEvent() const override
Get pointer to input event. Must be implemented in the derived class.
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.
TRestEventProcess * Maker()
Returns a new instance of this class.
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.
TRestRawSignalEvent * fOutputSignalEvent
A pointer to the specific TRestRawSignalEvent input.
void LoadConfig(const std::string &configFilename, const std::string &name="")
Function to load the configuration from an external configuration file.