forked from GRIFFINCollaboration/NTuple
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Settings.hh
139 lines (114 loc) · 3.48 KB
/
Settings.hh
1
2
3
4
5
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
#ifndef __SETTINGS_HH
#define __SETTINGS_HH
#include <string>
#include <map>
#include <vector>
#include "TF1.h"
class Settings {
public:
Settings(std::string, int);
~Settings(){};
std::string NtupleName() {
return fNtupleName;
}
int VerbosityLevel() {
return fVerbosityLevel;
}
int BufferSize() {
return fBufferSize;
}
int SortNumberOfEvents() {
return fSortNumberOfEvents;
}
bool WriteTree() {
return fWriteTree;
}
bool Write2DHist() {
return fWrite2DHist;
}
//bool Write3DHist() {
// return fWrite3DHist;
//}
bool WriteNDHist() {
return fWriteNDHist;
}
bool Write2DSGGHist() {
return fWrite2DSGGHist;
}
bool WriteGriffinAddbackVector() {
return fWriteGriffinAddbackVector;
}
double GriffinAddbackVectorLengthmm() {
return fGriffinAddbackVectorLengthmm;
}
double GriffinAddbackVectorDepthmm() {
return fGriffinAddbackVectorDepthmm;
}
double GriffinAddbackVectorCrystalFaceDistancemm() {
return fGriffinAddbackVectorCrystalFaceDistancemm;
}
double Resolution(int systemID, int detectorID, int crystalID, double en) {
if(fResolution.find(systemID) != fResolution.end()) {
return fResolution[systemID].at(detectorID).at(crystalID).Eval(en);
}
return 0.;
}
double Threshold(int systemID, int detectorID, int crystalID) {
if(fThreshold.find(systemID) != fThreshold.end()) {
return fThreshold[systemID].at(detectorID).at(crystalID);
}
return 0.001;
}
double ThresholdWidth(int systemID, int detectorID, int crystalID) {
if(fThresholdWidth.find(systemID) != fThresholdWidth.end()) {
return fThresholdWidth[systemID].at(detectorID).at(crystalID);
}
return 0.;
}
double TimeWindow(int systemID, int detectorID, int crystalID) {
if(fTimeWindow.find(systemID) != fTimeWindow.end()) {
return fTimeWindow[systemID].at(detectorID).at(crystalID);
}
return 0.;
}
int NofBins(std::string directoryName) {
if(fNofBins.find(directoryName) != fNofBins.end()) {
return fNofBins[directoryName];
}
return 10000;
}
double RangeLow(std::string directoryName) {
if(fRangeLow.find(directoryName) != fRangeLow.end()) {
return fRangeLow[directoryName];
}
return 0.5;
}
double RangeHigh(std::string directoryName) {
if(fRangeHigh.find(directoryName) != fRangeHigh.end()) {
return fRangeHigh[directoryName];
}
return 10000.5;
}
private:
std::string fNtupleName;
int fVerbosityLevel;
int fBufferSize;
int fSortNumberOfEvents;
bool fWriteTree;
bool fWrite2DHist;
//bool fWrite3DHist;
bool fWriteNDHist;
bool fWrite2DSGGHist;
bool fWriteGriffinAddbackVector;
double fGriffinAddbackVectorLengthmm;
double fGriffinAddbackVectorDepthmm;
double fGriffinAddbackVectorCrystalFaceDistancemm;
std::map<int,std::vector<std::vector<TF1> > > fResolution;
std::map<int,std::vector<std::vector<double> > > fThreshold;
std::map<int,std::vector<std::vector<double> > > fThresholdWidth;
std::map<int,std::vector<std::vector<double> > > fTimeWindow;
std::map<std::string,int> fNofBins;
std::map<std::string,double> fRangeLow;
std::map<std::string,double> fRangeHigh;
};
#endif