9 #include <beast/claws/modules/ClawsStudyModule.h>
10 #include <beast/claws/dataobjects/ClawsHit.h>
11 #include <generators/SAD/dataobjects/SADMetaHit.h>
12 #include <framework/datastore/StoreArray.h>
13 #include <framework/gearbox/GearDir.h>
14 #include <framework/logging/Logger.h>
15 #include <framework/gearbox/Const.h>
27 using namespace claws;
41 setDescription(
"Study module for Clawss (BEAST)");
43 addParam(
"Ethres", m_Ethres,
"Energy threshold in MeV", 0.0);
46 ClawsStudyModule::~ClawsStudyModule()
51 void ClawsStudyModule::defineHisto()
67 h_clawss_hitrate1 =
new TH1F(
"clawss_hitrate1",
"Hit distributions", 16, 0., 16.);
68 h_clawss_hitrate2 =
new TH1F(
"clawss_hitrate2",
"Hit distributions", 16, 0., 16.);
69 h_clawss_hitrate1W =
new TH1F(
"clawss_hitrate1W",
"Hit distributions", 16, 0., 16.);
70 h_clawss_hitrate2W =
new TH1F(
"clawss_hitrate2W",
"Hit distributions", 16, 0., 16.);
72 h_clawss_hitrate1->Sumw2();
73 h_clawss_hitrate1W->Sumw2();
74 h_clawss_hitrate2->Sumw2();
75 h_clawss_hitrate2W->Sumw2();
77 h_clawss_rs_hitrate1 =
new TH2F(
"clawss_rs_hitrate1",
"Hit distributions vs rs", 16, 0., 16., 12, 0., 12.);
78 h_clawss_rs_hitrate2 =
new TH2F(
"clawss_rs_hitrate2",
"Hit distributions vs rs", 16, 0., 16., 12, 0., 12.);
79 h_clawss_rs_hitrate1W =
new TH2F(
"clawss_rs_hitrate1W",
"Hit distributions vs rs", 16, 0., 16., 12, 0., 12.);
80 h_clawss_rs_hitrate2W =
new TH2F(
"clawss_rs_hitrate2W",
"Hit distributions vs rs", 16, 0., 16., 12, 0., 12.);
82 h_clawss_rs_hitrate1->Sumw2();
83 h_clawss_rs_hitrate1W->Sumw2();
84 h_clawss_rs_hitrate2->Sumw2();
85 h_clawss_rs_hitrate2W->Sumw2();
87 for (
int i = 0; i < 16; i++) {
88 h_clawss_rate1[i] =
new TH1F(TString::Format(
"clawss_rate1_%d", i),
"PE distributions", 500, 0., 500.);
89 h_clawss_rate2[i] =
new TH1F(TString::Format(
"clawss_rate2_%d", i),
"PE distributions", 500, 0., 500.);
90 h_clawss_rate1W[i] =
new TH1F(TString::Format(
"clawss_rate1W_%d", i),
"PE distributions", 500, 0., 500.);
91 h_clawss_rate2W[i] =
new TH1F(TString::Format(
"clawss_rate2W_%d", i),
"PE distributions", 500, 0., 500.);
92 h_clawss_pe1[i] =
new TH2F(TString::Format(
"clawss_pe1_%d", i),
"PE distributions", 500, 0., 500., 100, 0., 1000.);
93 h_clawss_pe2[i] =
new TH2F(TString::Format(
"clawss_pe2_%d", i),
"PE distributions", 500, 0., 500., 100, 0., 1000.);
94 h_clawss_pe1W[i] =
new TH2F(TString::Format(
"clawss_pe1W_%d", i),
"PE distributions", 500, 0., 500., 100, 0., 1000.);
95 h_clawss_pe2W[i] =
new TH2F(TString::Format(
"clawss_pe2W_%d", i),
"PE distributions", 500, 0., 500., 100, 0., 1000.);
97 h_clawss_rs_rate1[i] =
new TH2F(TString::Format(
"clawss_rs_rate1_%d", i),
"PE distributions", 500, 0., 500., 12, 0., 12.);
98 h_clawss_rs_rate2[i] =
new TH2F(TString::Format(
"clawss_rs_rate2_%d", i),
"PE distributions", 500, 0., 500., 12, 0., 12.);
99 h_clawss_rs_rate1W[i] =
new TH2F(TString::Format(
"clawss_rs_rate1W_%d", i),
"PE distributions", 500, 0., 500., 12, 0., 12.);
100 h_clawss_rs_rate2W[i] =
new TH2F(TString::Format(
"clawss_rs_rate2W_%d", i),
"PE distributions", 500, 0., 500., 12, 0., 12.);
102 h_clawss_rate1[i]->Sumw2();
103 h_clawss_rate2[i]->Sumw2();
104 h_clawss_rate1W[i]->Sumw2();
105 h_clawss_rate2W[i]->Sumw2();
106 h_clawss_rs_rate1[i]->Sumw2();
107 h_clawss_rs_rate2[i]->Sumw2();
108 h_clawss_rs_rate1W[i]->Sumw2();
109 h_clawss_rs_rate2W[i]->Sumw2();
110 h_clawss_pe1[i]->Sumw2();
111 h_clawss_pe2[i]->Sumw2();
112 h_clawss_pe1W[i]->Sumw2();
113 h_clawss_pe2W[i]->Sumw2();
118 void ClawsStudyModule::initialize()
120 B2INFO(
"ClawsStudyModule: Initialize");
128 void ClawsStudyModule::beginRun()
132 void ClawsStudyModule::event()
139 int ring_section = -1;
140 for (
const auto& MetaHit : MetaHits) {
141 rate = MetaHit.getrate();
142 ring_section = MetaHit.getring_section() - 1;
176 for (
const auto&
Hit : Hits) {
177 const int detNb =
Hit.getdetNb();
179 const int timebin =
Hit.gettime();
180 const float edep =
Hit.getedep();
181 const float pe =
Hit.getPE();
182 h_clawss_hitrate1->Fill(detNb);
183 h_clawss_hitrate1W->Fill(detNb, rate);
184 h_clawss_rate1[detNb]->Fill(pe);
185 h_clawss_rate1W[detNb]->Fill(pe, rate);
186 h_clawss_rs_rate1[detNb]->Fill(pe, ring_section);
187 h_clawss_rs_rate1W[detNb]->Fill(pe, ring_section, rate);
188 h_clawss_rs_hitrate1->Fill(detNb, ring_section);
189 h_clawss_rs_hitrate1W->Fill(detNb, ring_section, rate);
190 h_clawss_pe1[detNb]->Fill(timebin, pe);
191 h_clawss_pe1W[detNb]->Fill(timebin, pe, rate);
192 if (edep > m_Ethres) {
193 h_clawss_hitrate2->Fill(detNb);
194 h_clawss_hitrate2W->Fill(detNb, rate);
195 h_clawss_rate2[detNb]->Fill(pe);
196 h_clawss_rate2W[detNb]->Fill(pe, rate);
197 h_clawss_rs_rate2[detNb]->Fill(pe, ring_section);
198 h_clawss_rs_rate2W[detNb]->Fill(pe, ring_section, rate);
199 h_clawss_rs_hitrate2->Fill(detNb, ring_section);
200 h_clawss_rs_hitrate2W->Fill(detNb, ring_section, rate);
201 h_clawss_pe2[detNb]->Fill(timebin, pe);
202 h_clawss_pe2W[detNb]->Fill(timebin, pe, rate);
210 void ClawsStudyModule::getXMLData()
212 GearDir content =
GearDir(
"/Detector/DetectorComponent[@name=\"CLAWS\"]/Content/");
213 m_Ethres = content.getDouble(
"Ethres");
215 B2INFO(
"ClawsStudy");
219 void ClawsStudyModule::endRun()
226 void ClawsStudyModule::terminate()
GearDir is the basic class used for accessing the parameter store.
HistoModule.h is supposed to be used instead of Module.h for the modules with histogram definitions t...
Accessor to arrays stored in the data store.
Study module for Clawss (BEAST)
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Abstract base class for different kinds of events.
Structure to hold some of the calpulse data.