GRSISort "v4.1.1.0"
An extension of the ROOT analysis Framework
Loading...
Searching...
No Matches
CrossTalkHelper.cxx
Go to the documentation of this file.
1#include "CrossTalkHelper.hh"
2
3bool pileup_reject = false;
4
5const double gg_time_low = -200.;
6const double gg_time_high = 300.;
7
8// default k-value this might have to be adjusted for each experiment!!!
9const Short_t defaultKValue = 379;
10
12{
13 return ((two->GetTime() - one->GetTime()) >= gg_time_low) && ((two->GetTime() - one->GetTime()) <= gg_time_high);
14}
15
16void CrossTalkHelper::CreateHistograms(unsigned int slot)
17{
18 for(int det_num = 1; det_num <= 16; ++det_num) {
19 for(int crys1 = 0; crys1 < 4; ++crys1) {
20 for(int crys2 = crys1 + 1; crys2 < 4; ++crys2) {
21 std::string name_str = Form("det_%d_%d_%d", det_num, crys1, crys2);
22 const char* hist_name = name_str.c_str();
23 std::cout << "Creating histogram: " << hist_name;
24 fH2[slot][name_str] = new TH2I(hist_name, Form("Detector #%d, crystal %d vs. crystal %d", det_num, crys2, crys1), 1500, 0, 1500, 1500, 0, 1500);
25 std::cout << " at address: " << fH2[slot][hist_name] << std::endl;
26 }
27 }
28 }
29
30 fH1[slot]["aMult"] = new TH1D("aMult", "addback multilpicity", 20, 0, 20);
31 fH2[slot]["gE_chan"] = new TH2D("gE_chan", "gE_chan", 65, 0, 65, 1500, 0, 1500);
32 fH1[slot]["aE"] = new TH1D("aE", "Summed Addback", 1500, 0, 1500);
33 fH1[slot]["gE"] = new TH1D("gE", "Summed Singles", 1500, 0, 1500);
34 fH1[slot]["gEnoCT"] = new TH1D("gEnoCT", "Singles, no CT correction", 1500, 0, 1500);
35}
36
37void CrossTalkHelper::Exec(unsigned int slot, TGriffin& grif, TGriffinBgo& grifBgo)
38{
39 // find the multiplicity in each clover over the entire event
40 // we do this because we want to force a multiplicity of 2
41 std::array<Int_t, 17> detMultiplicity = {0};
42 for(auto gr1 = 0; gr1 < grif.GetSuppressedMultiplicity(&grifBgo); ++gr1) {
43 ++(detMultiplicity[grif.GetSuppressedHit(gr1)->GetDetector()]);
44 }
45
46 for(auto gr1 = 0; gr1 < grif.GetSuppressedMultiplicity(&grifBgo); ++gr1) {
47 auto* grif1 = grif.GetSuppressedHit(gr1);
48 if(pileup_reject && (grif1->GetKValue() != defaultKValue)) { continue; } // This pileup number might have to change for other expmnts
49 fH2[slot].at("gE_chan")->Fill(grif1->GetArrayNumber(), grif1->GetEnergy());
50 fH1[slot].at("gE")->Fill(grif1->GetEnergy());
51 fH1[slot].at("gEnoCT")->Fill(grif1->GetNoCTEnergy());
52 for(auto gr2 = gr1 + 1; gr2 < grif.GetSuppressedMultiplicity(&grifBgo); ++gr2) {
53 auto* grif2 = grif.GetSuppressedHit(gr2);
54 if(pileup_reject && grif2->GetKValue() != defaultKValue) { continue; } // This pileup number might have to change for other expmnts
55 if((detMultiplicity[grif1->GetDetector()] == 2) && grif.AddbackCriterion(grif1, grif2)) {
56 TGriffinHit* lowCrystalHit = grif1;
57 TGriffinHit* highCrystalHit = grif2;
58 if(grif1->GetCrystal() > grif2->GetCrystal()) {
59 lowCrystalHit = grif2;
60 highCrystalHit = grif1;
61 }
62 if(lowCrystalHit->GetCrystal() != highCrystalHit->GetCrystal()) {
63 fH2[slot].at(Form("det_%d_%d_%d", lowCrystalHit->GetDetector(), lowCrystalHit->GetCrystal(), highCrystalHit->GetCrystal()))->Fill(lowCrystalHit->GetNoCTEnergy(), highCrystalHit->GetNoCTEnergy());
64 }
65 }
66 }
67 }
68
69 for(auto gr1 = 0; gr1 < grif.GetSuppressedAddbackMultiplicity(&grifBgo); ++gr1) {
70 auto* grif1 = grif.GetSuppressedAddbackHit(gr1);
71 if(pileup_reject && (grif1->GetKValue() != defaultKValue)) { continue; } // This pileup number might have to change for other expmnts
72 fH1[slot].at("aE")->Fill(grif1->GetEnergy());
73 fH1[slot].at("aMult")->Fill(grif.GetNSuppressedAddbackFrags(gr1));
74 }
75}
bool pileup_reject
const Short_t defaultKValue
const double gg_time_high
bool PromptCoincidence(TGriffinHit *one, TGriffinHit *two)
const double gg_time_low
void Exec(unsigned int slot, TGriffin &grif, TGriffinBgo &grifBgo)
void CreateHistograms(unsigned int slot) override
Virtual helper function that the user uses to create their histograms.
virtual Int_t GetCrystal() const
!
virtual Int_t GetDetector() const
!
virtual Double_t GetTime(const ETimeFlag &correct_flag=ETimeFlag::kAll, Option_t *opt="") const
Returns a time value to the nearest nanosecond!
std::vector< TGRSIMap< std::string, TH2 * > > fH2
Definition TGRSIHelper.h:49
std::vector< TGRSIMap< std::string, TH1 * > > fH1
Definition TGRSIHelper.h:48
Double_t GetNoCTEnergy(Option_t *opt="") const
UShort_t GetNSuppressedAddbackFrags(const size_t &idx)
Definition TGriffin.cxx:591
TGriffinHit * GetSuppressedAddbackHit(const int &i)
Definition TGriffin.cxx:536
Short_t GetSuppressedMultiplicity(const TBgo *bgo)
Definition TGriffin.cxx:499
Short_t GetSuppressedAddbackMultiplicity(const TBgo *bgo)
Definition TGriffin.cxx:552
TGriffinHit * GetSuppressedHit(const int &i)
!
Definition TGriffin.cxx:483
bool AddbackCriterion(const TDetectorHit *hit1, const TDetectorHit *hit2) override
Definition TGriffin.h:66