forked from GRIFFINCollaboration/NTuple
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Converter.hh
174 lines (140 loc) · 5.15 KB
/
Converter.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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
#ifndef __CONVERTER_HH
#define __CONVERTER_HH
#include <vector>
#include "TChain.h"
#include "TFile.h"
#include "TTree.h"
#include "TRandom3.h"
#include "TH1F.h"
#include "TH2F.h"
#include "TH3F.h"
//#include "TH3I.h"
#include "THnSparse.h"
#include "TVector3.h"
#include "Settings.hh"
#include "Griffin.hh"
class Converter {
public:
Converter(std::vector<std::string>&, const std::string&, Settings*);
~Converter();
bool Run();
private:
bool AboveThreshold(double, int);
bool InsideTimeWindow();
bool DescantNeutronDiscrimination();
// GRIFFIN
void CheckGriffinCrystalAddback();
void SupressGriffin();
void SupressGriffinByNeighbouringAncillaryBgos();
void SupressGriffinBySceptar();
void AddbackGriffin();
void AddbackGriffinNeighbour();
void AddbackGriffinNeighbourVector();
// LaBr
void CheckLaBrDetectorAddback();
void SupressLaBr();
void SupressLaBrByNeighbouringGriffinShields();
void AddbackLaBr();
// EightPi
void CheckEightPiDetectorAddback();
void SupressEightPi();
void AddbackEightPi();
// Ancillary BGO
void CheckAncillaryBgoCrystalAddback();
void AddbackAncillaryBgo();
// SCEPTAR
void CheckSceptarDetectorAddback();
void AddbackSceptar();
// DESCANT
void CheckDescantDetectorAddback();
void AddbackDescant();
// Paces
void CheckPacesDetectorAddback();
void AddbackPaces();
void PrintStatistics();
TH1F* Get1DHistogram(std::string, std::string);
TH2F* Get2DHistogram(std::string, std::string);
//TH3I* Get3DHistogram(std::string, std::string);
THnSparseF* GetNDHistogram(std::string, std::string);
void FillHistDetector1DGamma(TH1F* hist1D, std::vector<Detector>* detector, std::string hist_name, std::string hist_dir);
void FillHistDetector2DGammaGamma(TH2F* hist2D, std::vector<Detector>* detector, std::string hist_name, std::string hist_dir);
void FillHistDetector1DGammaNR(TH1F* hist1D, std::vector<Detector>* detector, std::string hist_name, std::string hist_dir);
void FillHistDetector2DGammaGammaNR(TH2F* hist2D, std::vector<Detector>* detector, std::string hist_name, std::string hist_dir);
void FillHist2DGriffinSceptarHitPattern(TH2F* hist2D, std::vector<Detector>* detector1, std::vector<Detector>* detector2, std::string hist_name, std::string hist_dir);
void FillHist2DGriffinHitPattern(TH2F* hist2D, std::vector<Detector>* detector, std::string hist_name, std::string hist_dir);
TVector3 GriffinCrystalCenterPosition(int cry, int det);
bool AreGriffinCrystalCenterPositionsWithinVectorLength(int cry1, int det1, int cry2, int det2);
double transX(double x, double y, double z, double theta, double phi);
double transY(double x, double y, double z, double theta, double phi);
double transZ(double x, double y, double z, double theta, double phi);
Settings* fSettings;
TChain fChain;
TFile* fOutput;
TTree fTree;
TRandom3 fRandom;
Int_t LaBrGriffinNeighbours_det[8][3];
Int_t LaBrGriffinNeighbours_cry[8][3];
Int_t GriffinAncillaryBgoNeighbours_det[16][2];
Int_t GriffinAncillaryBgoNeighbours_cry[16][2];
Int_t GriffinSceptarSuppressors_det[16][4];
Int_t GriffinNeighbours_counted[16];
Int_t GriffinNeighbours_det[16][4];
double GriffinDetCoords[16][5];
double GriffinCryMap[64][64];
double GriffinCryMapCombos[52][2];
double GriffinDetMap[16][16];
double GriffinDetMapCombos[7][2];
TVector3 GriffinCrystalCenterVectors[64];
//branches of input tree/chain
Int_t fEventNumber;
Int_t fTrackID;
Int_t fParentID;
Int_t fStepNumber;
Int_t fParticleType;
Int_t fProcessType;
Int_t fSystemID;
Int_t fCryNumber;
Int_t fDetNumber;
Double_t fDepEnergy;
Double_t fPosx;
Double_t fPosy;
Double_t fPosz;
Double_t fTime;
bool fSceptarHit;
//branches of output tree
// GRIFFIN
std::vector<Detector>* fGriffinCrystal;
std::vector<Detector>* fGriffinDetector;
std::vector<Detector>* fGriffinNeighbour;
std::vector<Detector>* fGriffinNeighbourVector;
std::vector<Detector>* fGriffinArray;
std::vector<Detector>* fGriffinBgo;
std::vector<Detector>* fGriffinBgoBack;
// LaBr
std::vector<Detector>* fLaBrArray;
std::vector<Detector>* fLaBrDetector;
// EightPi
std::vector<Detector>* fEightPiArray;
std::vector<Detector>* fEightPiDetector;
std::vector<Detector>* fEightPiBgoDetector;
// Ancillary BGO
std::vector<Detector>* fAncillaryBgoArray;
std::vector<Detector>* fAncillaryBgoCrystal;
std::vector<Detector>* fAncillaryBgoDetector;
// Sceptar
std::vector<Detector>* fSceptarArray;
std::vector<Detector>* fSceptarDetector;
// Descant
std::vector<Detector>* fDescantArray;
std::vector<Detector>* fDescantBlueDetector;
std::vector<Detector>* fDescantGreenDetector;
std::vector<Detector>* fDescantRedDetector;
std::vector<Detector>* fDescantWhiteDetector;
std::vector<Detector>* fDescantYellowDetector;
// Paces
std::vector<Detector>* fPacesArray;
std::vector<Detector>* fPacesDetector;
//histograms
std::map<std::string,TList*> fHistograms;
};
#endif