GRSISort "v4.0.0.5"
An extension of the ROOT analysis Framework
Loading...
Searching...
No Matches
FastTimingHistSelector.C
Go to the documentation of this file.
1#define FastTimingHistSelector_cxx
2// The class definition in FastTimingHistSelector.h has been generated automatically
4
6{
7 // get settings from GValues
8 fDrainingEnergy = GValue::Value("GRSISort.FastTiming.DrainingEnergy");
9 fDrainingLow = GValue::Value("GRSISort.FastTiming.DrainingLow");
10 fDrainingHigh = GValue::Value("GRSISort.FastTiming.DrainingHigh");
11 fFeedingEnergy = GValue::Value("GRSISort.FastTiming.FeedingEnergy");
12 fFeedingLow = GValue::Value("GRSISort.FastTiming.FeedingLow");
13 fFeedingHigh = GValue::Value("GRSISort.FastTiming.FeedingHigh");
14 fGeEnergy = GValue::Value("GRSISort.FastTiming.GeEnergy");
15 fGeLow = GValue::Value("GRSISort.FastTiming.GeLow");
16 fGeHigh = GValue::Value("GRSISort.FastTiming.GeHigh");
17
18 // set new output prefix - doesn't work because this is a worker function and the master is the one writing the file
19 SetOutputPrefix(Form("histoPRD_with_%.0f-%.0f_drain_%.0f-%.0f_feed_%.0f-%.0f_Ge_%s.root", fDrainingLow, fDrainingHigh, fFeedingLow, fFeedingHigh, fGeLow, fGeHigh, (fGeEnergy != 0) ? "true" : "false"));
20
21 int bins = 5000;
22 double low = -2500.;
23 double high = 2500.;
24 // Define Histograms
25 fH1["laBrLaBrGate"] = new TH1D("LaBrLaBrGate", Form("LaBr_3 E w/ %.1f as gate (Draining)", fDrainingEnergy), bins, low, high);
26 fH1["laBrLaBrGate2"] = new TH1D("LaBrLaBrGate2", Form("LaBr_3 E w/ %.1f as gate (Feeding)", fFeedingEnergy), bins, low, high);
27 fH1["laBrLaBrGeGate"] = new TH1D("LaBrLaBrGeGate", Form("LaBr_3 E w/ %.1f as gate (Draining), and %.1f as hpge gate", fDrainingEnergy, fGeEnergy), bins, low, high);
28 fH1["laBrLaBrGeGate2"] = new TH1D("LaBrLaBrGeGate2", Form("LaBr_3 E w/ %.1f as gate (Feeding), and %.1f as hpge gate", fFeedingEnergy, fGeEnergy), bins, low, high);
29
30 fH1["laBrFull"] = new TH1D("LaBrFull", "LaBr_3 singles", bins, low, high);
31 fH1["geFull"] = new TH1D("GeFull", "Ge singles", bins, low, high);
32 fH1["laBrGeGate"] = new TH1D("LaBrGeGate", Form("LaBr_3 E w %.1f as HPGe gate", fGeEnergy), bins, low, high);
33 fH1["geLaBrGate"] = new TH1D("GeLaBrGate", Form("HPGe E w %.1f as gate (Draining)", fDrainingEnergy), bins, low, high);
34 fH1["geLaBrGate2"] = new TH1D("GeLaBrGate2", Form("HPGe E w %.1f as gate (Feeding)", fFeedingEnergy), bins, low, high);
35 fH1["ge2LaBrGate"] = new TH1D("Ge2LaBrGate", Form("HPGe E w %.1f as gate (Draining) and %.1f as gate (Feeding)", fDrainingEnergy, fFeedingEnergy), bins, low, high);
36 fH1["geGeLaBrGate"] = new TH1D("GeGeLaBrGate", Form("HPGe E w %.1f as gate (Draining) and %.1f as HPGe gate widened +/-5 but on LaBr_3", fDrainingEnergy, fGeEnergy), bins, low, high);
37 fH1["geGeLaBr2Gate"] = new TH1D("GeGeLaBr2Gate", Form("HPGe E w %.1f as gate (Draining) and %.1f as HPGe gate widened +/-5 but on LaBr_3", fFeedingEnergy, fGeEnergy), bins, low, high);
38 fH1["delayed"] = new TH1D("delayed", Form("delayed w %.1f as Draining, %.1f as Feeding, %s", fDrainingEnergy, fFeedingEnergy, ((fGeEnergy != 0.) ? Form("%.1f as HPGe gate", fGeEnergy) : "no HPGe gate")), 10 * bins, 10 * low, 10 * high);
39 fH1["antidelayed"] = new TH1D("antidelayed", Form("antidelayed w %.1f as Draining, %.1f as Feeding, %s", fDrainingEnergy, fFeedingEnergy, ((fGeEnergy != 0.) ? Form("%.1f as HPGe gate", fGeEnergy) : "no HPGe gate")), 10 * bins, 10 * low, 10 * high);
40
41 // Send histograms to Output list to be added and written.
42 for(auto it : fH1) {
43 GetOutputList()->Add(it.second);
44 }
45 for(auto it : fH2) {
46 GetOutputList()->Add(it.second);
47 }
48 for(auto it : fHSparse) {
49 GetOutputList()->Add(it.second);
50 }
51}
52
54{
55 // singles spectra
56 fH1.at("laBrFull")->Fill(fLaBrEnergy[0]);
57 for(auto g : *fGeEnergies) {
58 fH1.at("geFull")->Fill(g);
59 }
60
61 // loop over the starting and stopping LaBr for the gates and use the other one to fill histograms
62 // i = 0 => (i+1)%2 = 1%2 = 1, i = 1 => (i+1)%2 = 2%2 = 0
63 for(int i = 0; i < 2; ++i) {
64 // draining gate
66 fH1.at("laBrLaBrGate")->Fill(fLaBrEnergy[(i + 1) % 2]);
67 }
68
69 // feeding gate
71 fH1.at("laBrLaBrGate2")->Fill(fLaBrEnergy[(i + 1) % 2]);
72 }
73
74 // germanium spectra
75 for(auto g : *fGeEnergies) {
76 // draining gate
78 fH1.at("geLaBrGate")->Fill(g);
79 // draining & feeding gate
80 if(fFeedingLow < fLaBrEnergy[(i + 1) % 2] && fLaBrEnergy[(i + 1) % 2] < fFeedingHigh) {
81 fH1.at("ge2LaBrGate")->Fill(g);
82 }
83 // draining & HPGe gate imposed on first LaBr
84 if(fGeLow - 5. < fLaBrEnergy[(i + 1) % 2] && fLaBrEnergy[(i + 1) % 2] < fGeHigh + 5.) {
85 fH1.at("geGeLaBrGate")->Fill(g);
86 }
87 }
88 // feeding gate
90 fH1.at("geLaBrGate2")->Fill(g);
91 // feeding & HPGe gate imposed on first LaBr
92 if(fGeLow - 5. < fLaBrEnergy[(i + 1) % 2] && fLaBrEnergy[(i + 1) % 2] < fGeHigh + 5.) {
93 fH1.at("geGeLaBr2Gate")->Fill(g);
94 }
95 }
96 }
97
98 // germanium gated spectra
99 if(fGeEnergy != 0.) {
100 for(auto g : *fGeEnergies) {
101 if(fGeLow < g && g < fGeHigh) {
102 fH1.at("laBrGeGate")->Fill(fLaBrEnergy[(i + 1) % 2]);
103 fH1.at("laBrGeGate")->Fill(fLaBrEnergy[i]);
104 // draining gate
106 fH1.at("laBrLaBrGeGate")->Fill(fLaBrEnergy[(i + 1) % 2]);
107 }
108 // feeding gate
110 fH1.at("laBrLaBrGeGate2")->Fill(fLaBrEnergy[(i + 1) % 2]);
111 }
112 break; // we found a matching germanium energy, so we stop here
113 }
114 }
115 }
116 } // loop over LaBr
117 // delayed and anti-delayed spectra
118 // with germanium gate
119 if(fGeEnergy != 0.) {
120 for(auto g : *fGeEnergies) {
121 if(fGeLow < g && g < fGeHigh) {
122 // if the start feeds and the stop drains we have the delayed situation
124 fH1.at("delayed")->Fill(fTac);
125 }
126 // if the start drains and the stop feeds we have the anti-delayed situation
128 fH1.at("antidelayed")->Fill(fTac);
129 }
130 break; // we found a matching germanium energy, so we stop here
131 }
132 }
133 } else if(fGeLow == fGeHigh || (fGeEnergies->size() == 1 && fGeEnergies->at(0) == -2000.)) {
134 // if the start feeds and the stop drains we have the delayed situation
136 fH1.at("delayed")->Fill(fTac);
137 }
138 // if the start drains and the stop feeds we have the anti-delayed situation
140 fH1.at("antidelayed")->Fill(fTac);
141 }
142 }
143}
std::vector< double > * fGeEnergies
static double Value(const std::string &)
Definition GValue.cxx:39
TGRSIMap< std::string, TH1 * > fH1
TGRSIMap< std::string, TH2 * > fH2
TGRSIMap< std::string, THnSparseF * > fHSparse
void SetOutputPrefix(const char *prefix)
TList * GetOutputList() const override
this does the same as TSelector::GetOutputList()