GRSISort "v4.0.0.5"
An extension of the ROOT analysis Framework
Loading...
Searching...
No Matches
GriffinKValueSelector.C
Go to the documentation of this file.
1#define GriffinKValueSelector_cxx
2// The class definition in GriffinKValueSelector.h has been generated automatically
4
5int maxKValue = 720;
6
8{
9 // 1D spectra of energy
10 fH1["hE"] = new TH1D("hE", "Energy of all hits;energy [keV];counts/0.5 keV", 4000, 0., 2000.);
11 fH1["hE_noPU"] = new TH1D("hE_noPU", "Energy (no pileup);energy [keV];counts/0.5 keV", 4000, 0., 2000.);
12 fH1["hE_2h"] = new TH1D("hE_2h", "Energy (pileup of 2 hits);energy [keV];counts/0.5 keV", 4000, 0., 2000.);
13 fH1["hE_3h"] = new TH1D("hE_3h", "Energy (pileup of 3 hits);energy [keV];counts/0.5 keV", 4000, 0., 2000.);
14 fH1["hE_2hc"] = new TH1D("hE_2hc", "Energy (pileup of 2 hits with only 2 integration windows);energy [keV];counts/0.5 keV", 4000, 0., 2000.);
15 // 2D spectra of energy vs. k-value
16 fH2["hKP"] = new TH2D("hKP", "K-value vs. # of pileups;# of pileups;k-value", 50, -32.5, 17.5, maxKValue, 0., maxKValue);
17 fH2["hEK_noPU"] = new TH2D("hEK_noPU", "Energy vs. k-value (no pileup);k-value;energy [keV]", maxKValue, 0., maxKValue, 2000, 0., 2000.);
18 fH2["hEK_1h2"] = new TH2D("hEK_1h2", "Energy vs. k-value (first of two piled-up hits);k-value;energy [keV]", maxKValue, 0., maxKValue, 2000, 0., 2000.);
19 fH2["hEK_2h2"] = new TH2D("hEK_2h2", "Energy vs. k-value (second of two piled-up hits);k-value;energy [keV]", maxKValue, 0., maxKValue, 2000, 0., 2000.);
20 fH2["hEK_1h3"] = new TH2D("hEK_1h3", "Energy vs. k-value (first of three piled-up hits);k-value;energy [keV]", maxKValue, 0., maxKValue, 2000, 0., 2000.);
21 fH2["hEK_2h3"] = new TH2D("hEK_2h3", "Energy vs. k-value (second of three piled-up hits);k-value;energy [keV]", maxKValue, 0., maxKValue, 2000, 0., 2000.);
22 fH2["hEK_3h3"] = new TH2D("hEK_3h3", "Energy vs. k-value (third of three piled-up hits);k-value;energy [keV]", maxKValue, 0., maxKValue, 2000, 0., 2000.);
23 fH2["hEK_1h2c"] = new TH2D("hEK_1h2c", "Energy vs. k-value (first of two piled-up hits with only 2 integration windows);k-value;energy [keV]", maxKValue, 0., maxKValue, 2000, 0., 2000.);
24 fH2["hEK_2h2c"] = new TH2D("hEK_2h2c", "Energy vs. k-value (second of two piled-up hits with only 2 integration windows);k-value;energy [keV]", maxKValue, 0., maxKValue, 2000, 0., 2000.);
25
26 for(auto it : fH1) {
27 GetOutputList()->Add(it.second);
28 }
29 for(auto it : fH2) {
30 GetOutputList()->Add(it.second);
31 }
32 for(auto it : fHSparse) {
33 GetOutputList()->Add(it.second);
34 }
35}
36
38{
39 if(fFragment->GetDetectorType() == 0) { // GRIFFIN detector
40 fH1.at("hE")->Fill(fFragment->GetEnergy());
41 fH2.at("hKP")->Fill(fFragment->GetNumberOfPileups(), fFragment->GetKValue());
42 if(fFragment->GetNumberOfPileups() > 0) {
43 fH1.at("hE_noPU")->Fill(fFragment->GetEnergy());
44 fH2.at("hEK_noPU")->Fill(fFragment->GetKValue(), fFragment->GetEnergy());
45 } else if(fFragment->GetNumberOfPileups() == -20) {
46 fH1.at("hE_2h")->Fill(fFragment->GetEnergy());
47 fH2.at("hEK_1h2")->Fill(fFragment->GetKValue(), fFragment->GetEnergy());
48 } else if(fFragment->GetNumberOfPileups() == -21) {
49 fH1.at("hE_2h")->Fill(fFragment->GetEnergy());
50 fH2.at("hEK_2h2")->Fill(fFragment->GetKValue(), fFragment->GetEnergy());
51 } else if(fFragment->GetNumberOfPileups() == -30) {
52 fH1.at("hE_3h")->Fill(fFragment->GetEnergy());
53 fH2.at("hEK_1h3")->Fill(fFragment->GetKValue(), fFragment->GetEnergy());
54 } else if(fFragment->GetNumberOfPileups() == -31) {
55 fH1.at("hE_3h")->Fill(fFragment->GetEnergy());
56 fH2.at("hEK_2h3")->Fill(fFragment->GetKValue(), fFragment->GetEnergy());
57 } else if(fFragment->GetNumberOfPileups() == -32) {
58 fH1.at("hE_3h")->Fill(fFragment->GetEnergy());
59 fH2.at("hEK_3h3")->Fill(fFragment->GetKValue(), fFragment->GetEnergy());
60 } else if(fFragment->GetNumberOfPileups() == -200) {
61 fH1.at("hE_2hc")->Fill(fFragment->GetEnergy());
62 fH2.at("hEK_1h2c")->Fill(fFragment->GetKValue(), fFragment->GetEnergy());
63 } else if(fFragment->GetNumberOfPileups() == -201) {
64 fH1.at("hE_2hc")->Fill(fFragment->GetEnergy());
65 fH2.at("hEK_2h2c")->Fill(fFragment->GetKValue(), fFragment->GetEnergy());
66 }
67 }
68}
int maxKValue
int maxKValue
virtual double GetEnergy(Option_t *opt="") const
virtual Short_t GetKValue() const
!
Short_t GetNumberOfPileups() const
Definition TFragment.h:78
UShort_t GetDetectorType() const
Definition TFragment.h:72
TGRSIMap< std::string, TH1 * > fH1
TGRSIMap< std::string, TH2 * > fH2
TGRSIMap< std::string, THnSparseF * > fHSparse
TList * GetOutputList() const override
this does the same as TSelector::GetOutputList()