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>
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.);
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.);
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.);
120 B2INFO(
"ClawsStudyModule: Initialize");
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();
212 GearDir content =
GearDir(
"/Detector/DetectorComponent[@name=\"CLAWS\"]/Content/");
213 m_Ethres = content.getDouble(
"Ethres");
215 B2INFO(
"ClawsStudy");
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...
void setDescription(const std::string &description)
Sets the description of the module.
Accessor to arrays stored in the data store.
TH2F * h_clawss_rs_hitrate1
Energy deposited.
TH2F * h_clawss_rs_rate1[16]
Energy deposited.
TH1F * h_clawss_hitrate2W
Energy deposited.
TH2F * h_clawss_pe1[16]
Energy deposited.
TH2F * h_clawss_rs_hitrate2W
Energy deposited.
virtual void initialize() override
Initialize the Module.
TH2F * h_clawss_rs_hitrate2
Energy deposited.
TH1F * h_clawss_hitrate1
Energy deposited.
virtual void event() override
Event processor.
TH1F * h_clawss_rate1[16]
Energy deposited vs TOF.
virtual void endRun() override
End-of-run action.
virtual void getXMLData()
reads data from CLAWS.xml
virtual void terminate() override
Termination action.
TH1F * h_clawss_hitrate1W
Energy deposited.
ClawsStudyModule()
Constructor: Sets the description, the properties and the parameters of the module.
TH2F * h_clawss_pe1W[16]
Energy deposited.
TH2F * h_clawss_pe2[16]
Energy deposited.
TH1F * h_clawss_rate2W[16]
Energy deposited.
virtual void beginRun() override
Called when entering a new run.
TH1F * h_clawss_rate1W[16]
Energy deposited.
virtual ~ClawsStudyModule()
Destructor.
TH1F * h_clawss_hitrate2
Energy deposited.
TH1F * h_clawss_rate2[16]
Energy deposited.
TH2F * h_clawss_rs_rate2[16]
Energy deposited.
double m_Ethres
Energy threshold.
TH2F * h_clawss_rs_rate2W[16]
Energy deposited.
TH2F * h_clawss_rs_hitrate1W
Energy deposited.
TH2F * h_clawss_rs_rate1W[16]
Energy deposited.
virtual void defineHisto() override
Defines the histograms.
TH2F * h_clawss_pe2W[16]
Energy deposited.
void addParam(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
#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.