9#include <beast/claw/modules/ClawStudyModule.h>
10#include <beast/claw/dataobjects/ClawSimHit.h>
11#include <beast/claw/dataobjects/ClawHit.h>
12#include <generators/SAD/dataobjects/SADMetaHit.h>
13#include <framework/datastore/StoreArray.h>
14#include <framework/gearbox/GearDir.h>
15#include <framework/gearbox/Const.h>
16#include <framework/logging/Logger.h>
57 for (
int i = 0; i < 8; i++) {
58 h_claws_Evtof1[i] =
new TH2F(TString::Format(
"claws_Evtof1_%d", i),
"Energy deposited [MeV] vs TOF [ns] - all", 5000, 0., 1000.,
60 h_claws_Evtof2[i] =
new TH2F(TString::Format(
"claws_Evtof2_%d", i),
"Energy deposited [MeV] vs TOF [ns] - only photons", 5000, 0.,
61 1000., 1000, 0., 10.);
62 h_claws_Evtof3[i] =
new TH2F(TString::Format(
"claws_Evtof3_%d", i),
"Energy deposited [MeV] vs TOF [ns] - only e+/e-", 5000, 0.,
63 1000., 1000, 0., 10.);
64 h_claws_Evtof4[i] =
new TH2F(TString::Format(
"claws_Evtof4_%d", i),
"Energy deposited [MeV] vs TOF [ns] - only e+/e-", 5000, 0.,
65 1000., 1000, 0., 10.);
66 h_claws_edep[i] =
new TH1F(TString::Format(
"claws_edep_%d", i),
"Energy deposited [MeV]", 5000, 0., 10.);
67 h_Wclaws_edep[i] =
new TH1F(TString::Format(
"Wclaws_edep_%d", i),
"Energy deposited [MeV]", 5000, 0., 10.);
70 h_claws_hitrate1 =
new TH1F(
"claws_hitrate1",
"Hit distributions", 8, 0., 8.);
71 h_claws_hitrate2 =
new TH1F(
"claws_hitrate2",
"Hit distributions", 8, 0., 8.);
80 h_claws_rs_hitrate1 =
new TH2F(
"claws_rs_hitrate1",
"Hit distributions vs rs", 8, 0., 8., 12, 0., 12.);
81 h_claws_rs_hitrate2 =
new TH2F(
"claws_rs_hitrate2",
"Hit distributions vs rs", 8, 0., 8., 12, 0., 12.);
82 h_claws_rs_hitrate1W =
new TH2F(
"claws_rs_hitrate1W",
"Hit distributions vs rs", 8, 0., 8., 12, 0., 12.);
83 h_claws_rs_hitrate2W =
new TH2F(
"claws_rs_hitrate2W",
"Hit distributions vs rs", 8, 0., 8., 12, 0., 12.);
90 for (
int i = 0; i < 8; i++) {
91 h_claws_rate1[i] =
new TH1F(TString::Format(
"claws_rate1_%d", i),
"PE distributions", 5000, 0., 5000.);
92 h_claws_rate2[i] =
new TH1F(TString::Format(
"claws_rate2_%d", i),
"PE distributions", 5000, 0., 5000.);
93 h_claws_rate1W[i] =
new TH1F(TString::Format(
"claws_rate1W_%d", i),
"PE distributions", 5000, 0., 5000.);
94 h_claws_rate2W[i] =
new TH1F(TString::Format(
"claws_rate2W_%d", i),
"PE distributions", 5000, 0., 5000.);
95 h_claws_pe1[i] =
new TH2F(TString::Format(
"claws_pe1_%d", i),
"PE distributions", 5000, 0., 5000., 1000, 0., 1000.);
96 h_claws_pe2[i] =
new TH2F(TString::Format(
"claws_pe2_%d", i),
"PE distributions", 5000, 0., 5000., 1000, 0., 1000.);
97 h_claws_pe1W[i] =
new TH2F(TString::Format(
"claws_pe1W_%d", i),
"PE distributions", 5000, 0., 5000., 1000, 0., 1000.);
98 h_claws_pe2W[i] =
new TH2F(TString::Format(
"claws_pe2W_%d", i),
"PE distributions", 5000, 0., 5000., 1000, 0., 1000.);
100 h_claws_rs_rate1[i] =
new TH2F(TString::Format(
"claws_rs_rate1_%d", i),
"PE distributions", 5000, 0., 5000., 12, 0., 12.);
101 h_claws_rs_rate2[i] =
new TH2F(TString::Format(
"claws_rs_rate2_%d", i),
"PE distributions", 5000, 0., 5000., 12, 0., 12.);
102 h_claws_rs_rate1W[i] =
new TH2F(TString::Format(
"claws_rs_rate1W_%d", i),
"PE distributions", 5000, 0., 5000., 12, 0., 12.);
103 h_claws_rs_rate2W[i] =
new TH2F(TString::Format(
"claws_rs_rate2W_%d", i),
"PE distributions", 5000, 0., 5000., 12, 0., 12.);
123 B2INFO(
"ClawStudyModule: Initialize");
143 int ring_section = -1;
144 for (
const auto& MetaHit : MetaHits) {
145 rate = MetaHit.getrate();
146 ring_section = MetaHit.getring_section() - 1;
153 for (
int i = 0; i < (int) SimHits.
getEntries(); i++) {
173 for (
const auto&
Hit : Hits) {
174 const int detNb =
Hit.getdetNb();
176 const int timebin =
Hit.gettime();
177 const float edep =
Hit.getedep();
178 const float pe =
Hit.getPE();
209 GearDir content =
GearDir(
"/Detector/DetectorComponent[@name=\"CLAW\"]/Content/");
210 m_Ethres = content.getDouble(
"Ethres");
ClassClawSimHit - Geant4 simulated hit for the Claw crystal in beast.
int getPDGCode() const
Get Particle PDG (can be one of secondaries)
int getCellId() const
Get Cell ID.
double getFlightTime() const
Get Flight time from IP.
double getEnergyDep() const
Get Deposit energy.
int getPDGCode() const
PDG code.
static const ParticleType photon
photon particle
static const ChargedStable electron
electron particle
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.
int getEntries() const
Get the number of objects in the array.
TH2F * h_claws_pe2[8]
Energy deposited.
virtual ~ClawStudyModule()
Destructor.
TH2F * h_claws_rs_hitrate1
Energy deposited.
TH2F * h_claws_rs_hitrate2
Energy deposited.
ClawStudyModule()
Constructor: Sets the description, the properties and the parameters of the module.
TH2F * h_claws_rs_rate2W[8]
Energy deposited.
TH1F * h_claws_rate1[8]
Energy deposited.
virtual void initialize() override
Initialize the Module.
TH2F * h_claws_pe1W[8]
Energy deposited.
TH1F * h_claws_hitrate1
Energy deposited.
TH2F * h_claws_rs_hitrate1W
Energy deposited.
virtual void event() override
Event processor.
TH2F * h_claws_rs_hitrate2W
Energy deposited.
TH1F * h_claws_hitrate2
Energy deposited.
TH2F * h_claws_rs_rate1W[8]
Energy deposited.
TH1F * h_claws_edep[8]
Energy deposited.
virtual void endRun() override
End-of-run action.
TH1F * h_claws_hitrate2W
Energy deposited.
virtual void getXMLData()
reads data from CLAW.xml
TH2F * h_claws_rs_rate2[8]
Energy deposited.
TH2F * h_claws_Evtof4[8]
Energy deposited vs TOF.
virtual void terminate() override
Termination action.
virtual void beginRun() override
Called when entering a new run.
TH1F * h_claws_rate2[8]
Energy deposited.
TH2F * h_claws_Evtof3[8]
Energy deposited vs TOF.
TH2F * h_claws_pe2W[8]
Energy deposited.
TH2F * h_claws_rs_rate1[8]
Energy deposited.
TH1F * h_Wclaws_edep[8]
Energy deposited.
TH2F * h_claws_Evtof2[8]
Energy deposited vs TOF.
TH1F * h_claws_hitrate1W
Energy deposited.
TH1F * h_claws_rate2W[8]
Energy deposited.
TH2F * h_claws_Evtof1[8]
Energy deposited vs TOF.
double m_Ethres
Energy threshold.
TH1F * h_claws_rate1W[8]
Energy deposited.
TH2F * h_claws_pe1[8]
Energy deposited.
virtual void defineHisto() override
Defines the histograms.
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.