11 #include <beast/claws/modules/ClawsStudyModule.h>
12 #include <beast/claws/dataobjects/CLAWSSimHit.h>
13 #include <beast/claws/dataobjects/ClawsHit.h>
14 #include <generators/SAD/dataobjects/SADMetaHit.h>
15 #include <framework/datastore/StoreArray.h>
16 #include <framework/gearbox/GearDir.h>
17 #include <framework/logging/Logger.h>
29 using namespace claws;
43 setDescription(
"Study module for Clawss (BEAST)");
45 addParam(
"Ethres", m_Ethres,
"Energy threshold in MeV", 0.0);
48 ClawsStudyModule::~ClawsStudyModule()
53 void ClawsStudyModule::defineHisto()
69 h_clawss_hitrate1 =
new TH1F(
"clawss_hitrate1",
"Hit distributions", 16, 0., 16.);
70 h_clawss_hitrate2 =
new TH1F(
"clawss_hitrate2",
"Hit distributions", 16, 0., 16.);
71 h_clawss_hitrate1W =
new TH1F(
"clawss_hitrate1W",
"Hit distributions", 16, 0., 16.);
72 h_clawss_hitrate2W =
new TH1F(
"clawss_hitrate2W",
"Hit distributions", 16, 0., 16.);
74 h_clawss_hitrate1->Sumw2();
75 h_clawss_hitrate1W->Sumw2();
76 h_clawss_hitrate2->Sumw2();
77 h_clawss_hitrate2W->Sumw2();
79 h_clawss_rs_hitrate1 =
new TH2F(
"clawss_rs_hitrate1",
"Hit distributions vs rs", 16, 0., 16., 12, 0., 12.);
80 h_clawss_rs_hitrate2 =
new TH2F(
"clawss_rs_hitrate2",
"Hit distributions vs rs", 16, 0., 16., 12, 0., 12.);
81 h_clawss_rs_hitrate1W =
new TH2F(
"clawss_rs_hitrate1W",
"Hit distributions vs rs", 16, 0., 16., 12, 0., 12.);
82 h_clawss_rs_hitrate2W =
new TH2F(
"clawss_rs_hitrate2W",
"Hit distributions vs rs", 16, 0., 16., 12, 0., 12.);
84 h_clawss_rs_hitrate1->Sumw2();
85 h_clawss_rs_hitrate1W->Sumw2();
86 h_clawss_rs_hitrate2->Sumw2();
87 h_clawss_rs_hitrate2W->Sumw2();
89 for (
int i = 0; i < 16; i++) {
90 h_clawss_rate1[i] =
new TH1F(TString::Format(
"clawss_rate1_%d", i),
"PE distributions", 500, 0., 500.);
91 h_clawss_rate2[i] =
new TH1F(TString::Format(
"clawss_rate2_%d", i),
"PE distributions", 500, 0., 500.);
92 h_clawss_rate1W[i] =
new TH1F(TString::Format(
"clawss_rate1W_%d", i),
"PE distributions", 500, 0., 500.);
93 h_clawss_rate2W[i] =
new TH1F(TString::Format(
"clawss_rate2W_%d", i),
"PE distributions", 500, 0., 500.);
94 h_clawss_pe1[i] =
new TH2F(TString::Format(
"clawss_pe1_%d", i),
"PE distributions", 500, 0., 500., 100, 0., 1000.);
95 h_clawss_pe2[i] =
new TH2F(TString::Format(
"clawss_pe2_%d", i),
"PE distributions", 500, 0., 500., 100, 0., 1000.);
96 h_clawss_pe1W[i] =
new TH2F(TString::Format(
"clawss_pe1W_%d", i),
"PE distributions", 500, 0., 500., 100, 0., 1000.);
97 h_clawss_pe2W[i] =
new TH2F(TString::Format(
"clawss_pe2W_%d", i),
"PE distributions", 500, 0., 500., 100, 0., 1000.);
99 h_clawss_rs_rate1[i] =
new TH2F(TString::Format(
"clawss_rs_rate1_%d", i),
"PE distributions", 500, 0., 500., 12, 0., 12.);
100 h_clawss_rs_rate2[i] =
new TH2F(TString::Format(
"clawss_rs_rate2_%d", i),
"PE distributions", 500, 0., 500., 12, 0., 12.);
101 h_clawss_rs_rate1W[i] =
new TH2F(TString::Format(
"clawss_rs_rate1W_%d", i),
"PE distributions", 500, 0., 500., 12, 0., 12.);
102 h_clawss_rs_rate2W[i] =
new TH2F(TString::Format(
"clawss_rs_rate2W_%d", i),
"PE distributions", 500, 0., 500., 12, 0., 12.);
104 h_clawss_rate1[i]->Sumw2();
105 h_clawss_rate2[i]->Sumw2();
106 h_clawss_rate1W[i]->Sumw2();
107 h_clawss_rate2W[i]->Sumw2();
108 h_clawss_rs_rate1[i]->Sumw2();
109 h_clawss_rs_rate2[i]->Sumw2();
110 h_clawss_rs_rate1W[i]->Sumw2();
111 h_clawss_rs_rate2W[i]->Sumw2();
112 h_clawss_pe1[i]->Sumw2();
113 h_clawss_pe2[i]->Sumw2();
114 h_clawss_pe1W[i]->Sumw2();
115 h_clawss_pe2W[i]->Sumw2();
120 void ClawsStudyModule::initialize()
122 B2INFO(
"ClawsStudyModule: Initialize");
130 void ClawsStudyModule::beginRun()
134 void ClawsStudyModule::event()
142 int ring_section = -1;
143 for (
const auto& MetaHit : MetaHits) {
144 rate = MetaHit.getrate();
145 ring_section = MetaHit.getring_section() - 1;
179 for (
const auto&
Hit : Hits) {
180 const int detNb =
Hit.getdetNb();
182 const int timebin =
Hit.gettime();
183 const float edep =
Hit.getedep();
184 const float pe =
Hit.getPE();
185 h_clawss_hitrate1->Fill(detNb);
186 h_clawss_hitrate1W->Fill(detNb, rate);
187 h_clawss_rate1[detNb]->Fill(pe);
188 h_clawss_rate1W[detNb]->Fill(pe, rate);
189 h_clawss_rs_rate1[detNb]->Fill(pe, ring_section);
190 h_clawss_rs_rate1W[detNb]->Fill(pe, ring_section, rate);
191 h_clawss_rs_hitrate1->Fill(detNb, ring_section);
192 h_clawss_rs_hitrate1W->Fill(detNb, ring_section, rate);
193 h_clawss_pe1[detNb]->Fill(timebin, pe);
194 h_clawss_pe1W[detNb]->Fill(timebin, pe, rate);
195 if (edep > m_Ethres) {
196 h_clawss_hitrate2->Fill(detNb);
197 h_clawss_hitrate2W->Fill(detNb, rate);
198 h_clawss_rate2[detNb]->Fill(pe);
199 h_clawss_rate2W[detNb]->Fill(pe, rate);
200 h_clawss_rs_rate2[detNb]->Fill(pe, ring_section);
201 h_clawss_rs_rate2W[detNb]->Fill(pe, ring_section, rate);
202 h_clawss_rs_hitrate2->Fill(detNb, ring_section);
203 h_clawss_rs_hitrate2W->Fill(detNb, ring_section, rate);
204 h_clawss_pe2[detNb]->Fill(timebin, pe);
205 h_clawss_pe2W[detNb]->Fill(timebin, pe, rate);
213 void ClawsStudyModule::getXMLData()
215 GearDir content =
GearDir(
"/Detector/DetectorComponent[@name=\"CLAWS\"]/Content/");
216 m_Ethres = content.getDouble(
"Ethres");
218 B2INFO(
"ClawsStudy");
222 void ClawsStudyModule::endRun()
229 void ClawsStudyModule::terminate()