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
3int maxKValue = 720;
4
6{
7 // 1D spectra of energy
8 fH1[slot]["hE"] = new TH1D("hE", "Energy of all hits;energy [keV];counts/0.5 keV", 4000, 0., 2000.);
9 fH1[slot]["hE_noPU"] = new TH1D("hE_noPU", "Energy (no pileup);energy [keV];counts/0.5 keV", 4000, 0., 2000.);
10 fH1[slot]["hE_2h"] = new TH1D("hE_2h", "Energy (pileup of 2 hits);energy [keV];counts/0.5 keV", 4000, 0., 2000.);
11 fH1[slot]["hE_3h"] = new TH1D("hE_3h", "Energy (pileup of 3 hits);energy [keV];counts/0.5 keV", 4000, 0., 2000.);
12 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.);
13 // 2D spectra of energy vs. k-value
14 fH2[slot]["hKP"] = new TH2D("hKP", "K-value vs. # of pileups;# of pileups;k-value", 50, -32.5, 17.5, maxKValue, 0., maxKValue);
15 fH2[slot]["hEK_noPU"] = new TH2D("hEK_noPU", "Energy vs. k-value (no pileup);k-value;energy [keV]", maxKValue, 0., maxKValue, 2000, 0., 2000.);
16 fH2[slot]["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.);
17 fH2[slot]["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.);
18 fH2[slot]["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.);
19 fH2[slot]["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.);
20 fH2[slot]["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.);
21 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]", maxKValue, 0., maxKValue, 2000, 0., 2000.);
22 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]", maxKValue, 0., maxKValue, 2000, 0., 2000.);
23}
24
25void GriffinKValueHelper::Exec(unsigned int slot, TFragment& frag)
26{
27 if(frag.GetDetectorType() == 0) { // GRIFFIN detector
28 fH1[slot].at("hE")->Fill(frag.GetEnergy());
29 fH2[slot].at("hKP")->Fill(frag.GetNumberOfPileups(), frag.GetKValue());
30 if(frag.GetNumberOfPileups() > 0) {
31 fH1[slot].at("hE_noPU")->Fill(frag.GetEnergy());
32 fH2[slot].at("hEK_noPU")->Fill(frag.GetKValue(), frag.GetEnergy());
33 } else if(frag.GetNumberOfPileups() == -20) {
34 fH1[slot].at("hE_2h")->Fill(frag.GetEnergy());
35 fH2[slot].at("hEK_1h2")->Fill(frag.GetKValue(), frag.GetEnergy());
36 } else if(frag.GetNumberOfPileups() == -21) {
37 fH1[slot].at("hE_2h")->Fill(frag.GetEnergy());
38 fH2[slot].at("hEK_2h2")->Fill(frag.GetKValue(), frag.GetEnergy());
39 } else if(frag.GetNumberOfPileups() == -30) {
40 fH1[slot].at("hE_3h")->Fill(frag.GetEnergy());
41 fH2[slot].at("hEK_1h3")->Fill(frag.GetKValue(), frag.GetEnergy());
42 } else if(frag.GetNumberOfPileups() == -31) {
43 fH1[slot].at("hE_3h")->Fill(frag.GetEnergy());
44 fH2[slot].at("hEK_2h3")->Fill(frag.GetKValue(), frag.GetEnergy());
45 } else if(frag.GetNumberOfPileups() == -32) {
46 fH1[slot].at("hE_3h")->Fill(frag.GetEnergy());
47 fH2[slot].at("hEK_3h3")->Fill(frag.GetKValue(), frag.GetEnergy());
48 } else if(frag.GetNumberOfPileups() == -200) {
49 fH1[slot].at("hE_2hc")->Fill(frag.GetEnergy());
50 fH2[slot].at("hEK_1h2c")->Fill(frag.GetKValue(), frag.GetEnergy());
51 } else if(frag.GetNumberOfPileups() == -201) {
52 fH1[slot].at("hE_2hc")->Fill(frag.GetEnergy());
53 fH2[slot].at("hEK_2h2c")->Fill(frag.GetKValue(), frag.GetEnergy());
54 }
55 }
56}
int maxKValue
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:78
UShort_t GetDetectorType() const
Definition TFragment.h:72
std::vector< TGRSIMap< std::string, TH2 * > > fH2
Definition TGRSIHelper.h:49
std::vector< TGRSIMap< std::string, TH1 * > > fH1
Definition TGRSIHelper.h:48