GRSISort "v4.0.0.5"
An extension of the ROOT analysis Framework
Loading...
Searching...
No Matches
TAnalysisOptions.h
Go to the documentation of this file.
1#ifndef TANALYSISOPTIONS_H
2#define TANALYSISOPTIONS_H
3
4/** \addtogroup Sorting
5 * @{
6 */
7
8#include "TObject.h"
9#include "TFile.h"
10
11#include "ArgParser.h"
12
13/////////////////////////////////////////////////////////////////
14///
15/// \class TAnalysisOptions
16///
17/// This class stores those command line arguments passed to GRSISort, that
18/// are pertinent to the analysis. This includes such settings as the addback
19/// window width, whether to correct cross talk, etc.
20///
21/////////////////////////////////////////////////////////////////
22
23class TAnalysisOptions : public TObject {
24 friend class TGRSIOptions;
25
26public:
27 TAnalysisOptions() = default;
28
29 void Clear(Option_t* opt = "") override;
30 void Print(Option_t* opt = "") const override;
31
32 bool WriteToFile(const std::string& file);
33 bool WriteToFile(TFile* file = nullptr);
34 void ReadFromFile(const std::string& file);
35 void ReadFromFile(TFile* file = nullptr);
36
37 // sorting options
38 inline void SetBuildWindow(const int64_t& t_bw) { fBuildWindow = t_bw; }
39 inline void SetBuildEventsByTimeStamp(bool& val) { fBuildEventsByTimeStamp = val; }
40 inline void SetAddbackWindow(const double& t_abw) { fAddbackWindow = t_abw; }
41 inline void SetSuppressionWindow(const double& t_sup) { fSuppressionWindow = t_sup; }
42 inline void SetSuppressionEnergy(const double& e_sup) { fSuppressionEnergy = e_sup; }
43
44 inline void SetWaveformFitting(const bool& flag) { fWaveformFitting = flag; }
45 inline bool IsWaveformFitting() const { return fWaveformFitting; }
46
47 void SetCorrectCrossTalk(const bool& flag, Option_t* opt = "");
48 inline bool IsCorrectingCrossTalk() const { return fIsCorrectingCrossTalk; }
49
50 inline int64_t BuildWindow() const { return fBuildWindow; }
51 inline bool BuildEventsByTimeStamp() const { return fBuildEventsByTimeStamp; }
52 inline double AddbackWindow() const
53 {
54 if(fAddbackWindow < 1) {
55 return 15.0;
56 }
57 return fAddbackWindow;
58 }
59
60 inline double SuppressionWindow() const { return fSuppressionWindow; }
61 inline double SuppressionEnergy() const { return fSuppressionEnergy; }
62
63 bool StaticWindow() const { return fStaticWindow; }
64
65private:
66 // sorting options
67 int64_t fBuildWindow{2000}; ///< if building with a window(GRIFFIN) this is the size of the window. (default = 2us (2000))
68 bool fBuildEventsByTimeStamp{false}; ///< use time stamps instead of time (including CFD) to build events
69 double fAddbackWindow{300.}; ///< Time used to build Addback-Ge-Events for TIGRESS/GRIFFIN. (default = 300 ns (300))
70 double fSuppressionWindow{300.}; ///< Time used to suppress Ge-Events. (default = 300 ns (300))
71 double fSuppressionEnergy{0.}; ///< Minimum energy used to suppress Ge-Events. (default = 0 keV)
72 bool fIsCorrectingCrossTalk{false}; ///< True if we are correcting for cross-talk in GRIFFIN at analysis-level
73 bool fWaveformFitting{false}; ///< If true, waveform fitting with SFU algorithm will be performed
74 bool fStaticWindow{true}; ///< Flag to use static window (default moving)
75
76 /// \cond CLASSIMP
77 ClassDefOverride(TAnalysisOptions, 5) // NOLINT(readability-else-after-return)
78 /// \endcond
79};
80/*! @} */
81#endif /* TANALYSISOPTIONS_H */
int64_t BuildWindow() const
bool fIsCorrectingCrossTalk
True if we are correcting for cross-talk in GRIFFIN at analysis-level.
void SetAddbackWindow(const double &t_abw)
void SetBuildWindow(const int64_t &t_bw)
void SetSuppressionWindow(const double &t_sup)
double SuppressionWindow() const
void SetCorrectCrossTalk(const bool &flag, Option_t *opt="")
void SetBuildEventsByTimeStamp(bool &val)
bool WriteToFile(const std::string &file)
double fSuppressionEnergy
Minimum energy used to suppress Ge-Events. (default = 0 keV)
bool IsCorrectingCrossTalk() const
double AddbackWindow() const
int64_t fBuildWindow
if building with a window(GRIFFIN) this is the size of the window. (default = 2us (2000))
void Print(Option_t *opt="") const override
double SuppressionEnergy() const
double fSuppressionWindow
Time used to suppress Ge-Events. (default = 300 ns (300))
bool BuildEventsByTimeStamp() const
void SetSuppressionEnergy(const double &e_sup)
void Clear(Option_t *opt="") override
bool fBuildEventsByTimeStamp
use time stamps instead of time (including CFD) to build events
double fAddbackWindow
Time used to build Addback-Ge-Events for TIGRESS/GRIFFIN. (default = 300 ns (300))
bool fWaveformFitting
If true, waveform fitting with SFU algorithm will be performed.
TAnalysisOptions()=default
void SetWaveformFitting(const bool &flag)
bool IsWaveformFitting() const
void ReadFromFile(const std::string &file)
bool StaticWindow() const
bool fStaticWindow
Flag to use static window (default moving)