GRSISort "v4.0.0.5"
An extension of the ROOT analysis Framework
Loading...
Searching...
No Matches
GriffinKValueHelper.cxx
Go to the documentation of this file.
2
4{
5 // 1D spectra of energy
6 fH1[slot]["hE"] = new TH1D("hE", "Energy of all hits;energy [keV];counts/0.5 keV", 4000, 0., 2000.);
7 fH1[slot]["hE_noPU"] = new TH1D("hE_noPU", "Energy (no pileup);energy [keV];counts/0.5 keV", 4000, 0., 2000.);
8 fH1[slot]["hE_2h"] = new TH1D("hE_2h", "Energy (pileup of 2 hits);energy [keV];counts/0.5 keV", 4000, 0., 2000.);
9 fH1[slot]["hE_3h"] = new TH1D("hE_3h", "Energy (pileup of 3 hits);energy [keV];counts/0.5 keV", 4000, 0., 2000.);
10 fH1[slot]["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.);
11 // 2D spectra of energy vs. k-value
12 fH2[slot]["hKP"] = new TH2D("hKP", "K-value vs. # of pileups;# of pileups;k-value", 50, -32.5, 17.5, fMaxKValue, 0., fMaxKValue);
13 fH2[slot]["hEK_noPU"] = new TH2D("hEK_noPU", "Energy vs. k-value (no pileup);k-value;energy [keV]", fMaxKValue, 0., fMaxKValue, 2000, 0., 2000.);
14 fH2[slot]["hEK_1h2"] = new TH2D("hEK_1h2", "Energy vs. k-value (first of two piled-up hits);k-value;energy [keV]", fMaxKValue, 0., fMaxKValue, 2000, 0., 2000.);
15 fH2[slot]["hEK_2h2"] = new TH2D("hEK_2h2", "Energy vs. k-value (second of two piled-up hits);k-value;energy [keV]", fMaxKValue, 0., fMaxKValue, 2000, 0., 2000.);
16 fH2[slot]["hEK_1h3"] = new TH2D("hEK_1h3", "Energy vs. k-value (first of three piled-up hits);k-value;energy [keV]", fMaxKValue, 0., fMaxKValue, 2000, 0., 2000.);
17 fH2[slot]["hEK_2h3"] = new TH2D("hEK_2h3", "Energy vs. k-value (second of three piled-up hits);k-value;energy [keV]", fMaxKValue, 0., fMaxKValue, 2000, 0., 2000.);
18 fH2[slot]["hEK_3h3"] = new TH2D("hEK_3h3", "Energy vs. k-value (third of three piled-up hits);k-value;energy [keV]", fMaxKValue, 0., fMaxKValue, 2000, 0., 2000.);
19 fH2[slot]["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]", fMaxKValue, 0., fMaxKValue, 2000, 0., 2000.);
20 fH2[slot]["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]", fMaxKValue, 0., fMaxKValue, 2000, 0., 2000.);
21}
22
23void GriffinKValueHelper::Exec(unsigned int slot, TFragment& frag)
24{
25 if(frag.GetDetectorType() == 0) { // GRIFFIN detector
26 fH1[slot].at("hE")->Fill(frag.GetEnergy());
27 fH2[slot].at("hKP")->Fill(frag.GetNumberOfPileups(), frag.GetKValue());
28 if(frag.GetNumberOfPileups() > 0) {
29 fH1[slot].at("hE_noPU")->Fill(frag.GetEnergy());
30 fH2[slot].at("hEK_noPU")->Fill(frag.GetKValue(), frag.GetEnergy());
31 } else if(frag.GetNumberOfPileups() == -20) {
32 fH1[slot].at("hE_2h")->Fill(frag.GetEnergy());
33 fH2[slot].at("hEK_1h2")->Fill(frag.GetKValue(), frag.GetEnergy());
34 } else if(frag.GetNumberOfPileups() == -21) {
35 fH1[slot].at("hE_2h")->Fill(frag.GetEnergy());
36 fH2[slot].at("hEK_2h2")->Fill(frag.GetKValue(), frag.GetEnergy());
37 } else if(frag.GetNumberOfPileups() == -30) {
38 fH1[slot].at("hE_3h")->Fill(frag.GetEnergy());
39 fH2[slot].at("hEK_1h3")->Fill(frag.GetKValue(), frag.GetEnergy());
40 } else if(frag.GetNumberOfPileups() == -31) {
41 fH1[slot].at("hE_3h")->Fill(frag.GetEnergy());
42 fH2[slot].at("hEK_2h3")->Fill(frag.GetKValue(), frag.GetEnergy());
43 } else if(frag.GetNumberOfPileups() == -32) {
44 fH1[slot].at("hE_3h")->Fill(frag.GetEnergy());
45 fH2[slot].at("hEK_3h3")->Fill(frag.GetKValue(), frag.GetEnergy());
46 } else if(frag.GetNumberOfPileups() == -200) {
47 fH1[slot].at("hE_2hc")->Fill(frag.GetEnergy());
48 fH2[slot].at("hEK_1h2c")->Fill(frag.GetKValue(), frag.GetEnergy());
49 } else if(frag.GetNumberOfPileups() == -201) {
50 fH1[slot].at("hE_2hc")->Fill(frag.GetEnergy());
51 fH2[slot].at("hEK_2h2c")->Fill(frag.GetKValue(), frag.GetEnergy());
52 }
53 }
54}
void Exec(unsigned int sloti, TFragment &frag)
void CreateHistograms(unsigned int slot) override
Virtual helper function that the user uses to create their histograms.
virtual double GetEnergy(Option_t *opt="") const
virtual Short_t GetKValue() const
!
Short_t GetNumberOfPileups() const
Definition TFragment.h:77
UShort_t GetDetectorType() const
Definition TFragment.h:71
std::vector< TGRSIMap< std::string, TH2 * > > fH2
Definition TGRSIHelper.h:45
std::vector< TGRSIMap< std::string, TH1 * > > fH1
Definition TGRSIHelper.h:44