Newer
Older
\brief A dummy spectrometer apparatus for testing detectors.
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
This class behaves as a spectrometer apparatus in that it holds detector
classes, but it does no reconstruction. It is intended to provide an elegant
way to setup a teststand for a detector or a set of detectors, without
requiring some "needed" detectors or parameters.
*/
/**
\fn THcDummySpectrometer::THcDummySpectrometer(const char* name, const char* description)
\brief A constructor.
\param[in] name Name of the apparatus. Is typically "H", "P" or "S" for
HMS, SHMS and SOS, respectively.
\param[in] description Description of the apparatus.
*/
/**
\fn virtual THcDummySpectrometer::~THcDummySpectrometer()
\brief A destructor.
*/
/**
\fn Int_t THcDummySpectrometer::Reconstruct()
\brief Does nothing and returns 0.
This function is usually responsible for reconstructing the event from the
detectors in the spectrometer. Since this is a dummy apparatus, we have a dummy
reconstruction.
*/
/**
\fn std::string THcDummySpectrometer::GetKwPrefix()
\brief Returns prefix used for parameters in `param` files.
All the parameters read by this apparatus are prefixed with the returned string.
*/
#include "THcDummySpectrometer.h"
#include "TDatime.h"
#include "THcGlobals.h"
#include "THcParmList.h"
THcDummySpectrometer::THcDummySpectrometer(
const char* name, const char* description
) :
THaApparatus(name, description),
fKwPrefix("")
{
// Construct the kwPrefix here. Better place would be in `Setup` method.
TString kwPrefix = name;
kwPrefix.ToUpper();
fKwPrefix = kwPrefix;
}
THcDummySpectrometer::~THcDummySpectrometer() {}
Int_t THcDummySpectrometer::Reconstruct() {
// Don't need reconstruction here.
return 0;
}
TString THcDummySpectrometer::GetKwPrefix() {
return fKwPrefix;
}
Int_t THcDummySpectrometer::ReadRunDatabase(const TDatime& date) {
return kOK;
}
Int_t THcDummySpectrometer::ReadDatabase(const TDatime& date) {
return kOK;
}
Int_t THcDummySpectrometer::DefineVariables(THaAnalysisObject::EMode mode) {
if (mode == kDefine && fIsSetup) return kOK;
fIsSetup = (mode == kDefine);
return kOK;
// std::vector<RVarDef> vars;
// RVarDef end {0};
// vars.push_back(end);
// return DefineVarsFromList(vars.data(), mode);
}
THcDummySpectrometer::THcDummySpectrometer() {}
ClassImp(THcDummySpectrometer)