REST-for-Physics  v2.3
Rare Event Searches ToolKit for Physics
TRestRawSignalGeneralFitProcess.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_TRestRawSignalGeneralFitProcess
24#define RestCore_TRestRawSignalGeneralFitProcess
25
26#include <TRestRawSignalEvent.h>
27
28#include "TF1.h"
29#include "TH1D.h"
30#include "TRestEventProcess.h"
31
35 private:
38
39 void Initialize() override;
40
41 void LoadDefaultConfig();
42
43 TVector2 fFunctionRange = TVector2(0, 0);
44 std::string fFunction;
45
46 TF1* fFitFunc = nullptr;
47
48 /*Double_t fShaping = 0;
49 Double_t fStartPosition = 0;
50 Double_t fBaseline = 0;
51 Double_t fAmplitude = 0;*/
52
53 protected:
54 // add here the members of your event process
55
56 public:
57 RESTValue GetInputEvent() const override { return fRawSignalEvent; }
58 RESTValue GetOutputEvent() const override { return fRawSignalEvent; }
59
60 TF1* GetFunction() { return fFitFunc; }
61
62 /*Double_t GetShaping() { return fShaping; }
63 inline Double_t GetStartPosition() const { return fStartPosition; }
64 inline Double_t GetBaseline() const { return fBaseline; }
65 inline Double_t GetAmplitude() const { return fAmplitude; }*/
66
67 void InitProcess() override;
68 TRestEvent* ProcessEvent(TRestEvent* inputEvent) override;
69 void EndProcess() override;
70
71 void LoadConfig(const std::string& configFilename, const std::string& name = "");
72
73 void PrintMetadata() override {
75
76 RESTMetadata << "Function std::string: " << fFunction << RESTendl;
77 RESTMetadata << "Range: ( " << fFunctionRange.X() << " , " << fFunctionRange.Y() << " ) " << RESTendl;
78
79 EndPrintProcess();
80 }
81
82 const char* GetProcessName() const override { return "rawSignalGeneralFit"; }
83
84 TRestRawSignalGeneralFitProcess(); // Constructor
85 TRestRawSignalGeneralFitProcess(const char* configFilename);
87
88 ClassDefOverride(TRestRawSignalGeneralFitProcess, 2);
89};
90#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.
void LoadDefaultConfig()
Function to load the default config in absence of RML input.
TRestEvent * ProcessEvent(TRestEvent *inputEvent) override
The main processing event function.
RESTValue GetOutputEvent() const override
Get pointer to output event. Must be implemented in the derived class.
void EndProcess() override
Function to include required actions after all events have been processed. This method will write the...
void Initialize() override
Function to initialize input/output event members and define the section name.
void PrintMetadata() override
Implemented it in the derived metadata class to print out specific metadata information.
RESTValue GetInputEvent() const override
Get pointer to input event. Must be implemented in the derived class.
void InitProcess() override
Process initialization.
void LoadConfig(const std::string &configFilename, const std::string &name="")
Function to load the configuration from an external configuration file.
TRestRawSignalEvent * fRawSignalEvent
A pointer to the specific TRestRawSignalEvent input.