12 #ifndef RestCore_TRestDetectorSingleChannelAnalysisProcess
13 #define RestCore_TRestDetectorSingleChannelAnalysisProcess
16 #include <TRestEventProcess.h>
18 #include "TRestDetectorGainMap.h"
19 #include "TRestDetectorGas.h"
20 #include "TRestDetectorHitsEvent.h"
21 #include "TRestDetectorReadout.h"
22 #include "TRestDetectorSignalEvent.h"
34 bool fApplyGainCorrection;
36 TVector2 fThrIntegralCutRange;
37 TVector2 fNGoodSignalsCutRange;
38 TVector2 fSpecFitRange;
39 std::string fCalibSave;
42 std::map<int, TH1D*> fChannelThrIntegral;
43 std::map<int, double> fChannelFitMean;
44 std::map<int, double> fChannelGain;
45 std::map<int, double> fChannelGainError;
51 void FitChannelGain();
53 void SaveGainMetadata(std::string filename);
57 TH1D* GetChannelSpectrum(
int id);
58 void PrintChannelSpectrums(std::string filename);
63 RESTMetadata <<
"the mode is:" <<
RESTendl;
64 RESTMetadata << (fApplyGainCorrection ?
"> " :
" ")
65 <<
"Apply channel correction std::map for spectrum " <<
RESTendl;
66 RESTMetadata << (fCreateGainMap ?
"> " :
" ")
67 <<
"Create new correction std::map for each channel" <<
RESTendl;
68 RESTMetadata <<
"output mapping file: " << fCalibSave <<
RESTendl;
69 RESTMetadata <<
"Energy cut for Threshold integral: " <<
RESTValue(fThrIntegralCutRange) <<
RESTendl;
70 RESTMetadata <<
"Energy cut for NGoodSignals: " <<
RESTValue(fNGoodSignalsCutRange) <<
RESTendl;
71 RESTMetadata <<
"Fit range for the spectra: " <<
RESTValue(fSpecFitRange) <<
RESTendl;
76 const char* GetProcessName()
const override {
return "readoutAnalysis"; }
A metadata class to generate/store a readout description.
RESTValue GetInputEvent() const override
Get pointer to input event. Must be implemented in the derived class.
TRestEvent * ProcessEvent(TRestEvent *inputEvent) override
Process one event.
void Initialize() override
Making default settings.
void EndProcess() override
To be executed at the end of the run (outside event loop)
void PrintMetadata() override
Implemented it in the derived metadata class to print out specific metadata information.
RESTValue GetOutputEvent() const override
Get pointer to output event. Must be implemented in the derived class.
void InitProcess() override
To be executed at the beginning of the run (outside event loop)
void InitFromConfigFile() override
To make settings from rml file. This method must be implemented in the derived class.
A base class for any REST event process.
void BeginPrintProcess()
[name, cut range]
A base class for any REST event.