9#include <beast/bgo/modules/BgoStudyModule.h>
10#include <beast/bgo/dataobjects/BgoSimHit.h>
11#include <beast/bgo/dataobjects/BgoHit.h>
12#include <framework/datastore/StoreArray.h>
13#include <framework/logging/Logger.h>
14#include <framework/gearbox/Const.h>
19#include <generators/SAD/dataobjects/SADMetaHit.h>
50 for (
int i = 0; i < 2; i++) {
51 h_bgo_rate[i] =
new TH1F(TString::Format(
"bgo_rate_%d", i),
"count", 18, 0., 18.);
54 h_bgo_rs_rate[i] =
new TH2F(TString::Format(
"bgo_rs_rate_%d", i),
"count v. ring section", 18, 0., 18., 12, 0., 12.);
57 for (
int i = 0; i < 18; i++) {
58 h_bgo_Evtof[i] =
new TH2F(TString::Format(
"bgo_Evtof_%d", i),
"Energy deposited [MeV] vs TOF [ns] - all", 5000, 0., 1000.,
60 h_bgo_Evtof1[i] =
new TH2F(TString::Format(
"bgo_Evtof1_%d", i),
"Energy deposited [MeV] vs TOF [ns] - all", 5000, 0., 1000.,
62 h_bgo_Evtof2[i] =
new TH2F(TString::Format(
"bgo_Evtof2_%d", i),
"Energy deposited [MeV] vs TOF [ns] - only photons", 5000, 0.,
63 1000., 1000, 0., 400.);
64 h_bgo_Evtof3[i] =
new TH2F(TString::Format(
"bgo_Evtof3_%d", i),
"Energy deposited [MeV] vs TOF [ns] - only e+/e-", 5000, 0.,
65 1000., 1000, 0., 400.);
67 h_bgo_edep[i] =
new TH1F(TString::Format(
"bgo_edep_%d", i),
"Energy deposited [MeV]", 5000, 0., 400.);
68 h_bgo_edep1[i] =
new TH1F(TString::Format(
"bgo_edep1_%d", i),
"Energy deposited [MeV]", 5000, 0., 400.);
69 h_bgo_edep2[i] =
new TH1F(TString::Format(
"bgo_edep2_%d", i),
"Energy deposited [MeV]", 5000, 0., 400.);
70 h_bgo_edep1Weight[i] =
new TH1F(TString::Format(
"bgo_edep1Weight_%d", i),
"Energy deposited [MeV]", 5000, 0., 400.);
71 h_bgo_edep2Weight[i] =
new TH1F(TString::Format(
"bgo_edep2Weight_%d", i),
"Energy deposited [MeV]", 5000, 0., 400.);
73 h_bgo_rs_edep1[i] =
new TH2F(TString::Format(
"bgo_rs_edep1_%d", i),
"Energy deposited [MeV]", 5000, 0., 400., 12, 0., 12.);
74 h_bgo_rs_edep2[i] =
new TH2F(TString::Format(
"bgo_rs_edep2_%d", i),
"Energy deposited [MeV]", 5000, 0., 400., 12, 0., 12.);
75 h_bgo_rs_edep1Weight[i] =
new TH2F(TString::Format(
"bgo_rs_edep1Weight_%d", i),
"Energy deposited [MeV]", 5000, 0., 400., 12, 0.,
77 h_bgo_rs_edep2Weight[i] =
new TH2F(TString::Format(
"bgo_rs_edep2Weight_%d", i),
"Energy deposited [MeV]", 5000, 0., 400., 12, 0.,
96 B2INFO(
"BgoStudyModule: Initialize");
123 int ring_section = -1;
124 const int section_ordering[12] = {1, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2};
125 for (
const auto& MetaHit : MetaHits) {
126 rate = MetaHit.getrate();
127 double sad_ssraw = MetaHit.getssraw();
129 if (sad_ssraw >= 0) ssraw = sad_ssraw / 100.;
130 else ssraw = 3000. + sad_ssraw / 100.;
132 ring_section = section_ordering[(int)((ssraw) / 250.)] - 1;
136 for (
const auto& SimHit : SimHits) {
137 int detNB = SimHit.getCellId();
138 int pdg = SimHit.getPDGCode();
139 double Edep = SimHit.getEnergyDep() * 1e3;
140 double tof = SimHit.getFlightTime();
146 double RecEdep = Edep;
int getPDGCode() const
PDG code.
static const ParticleType photon
photon particle
static const ChargedStable electron
electron particle
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.
std::vector< Double_t > m_Ethres
reads data from BGO.xml: tube location, drift data filename, sigma of impulse response function
virtual ~BgoStudyModule()
Destructor.
TH1F * h_bgo_rate[2]
Rate.
TH1F * h_bgo_edep[18]
Energy deposited.
TH1F * h_bgo_edep1[18]
Energy deposited.
virtual void initialize() override
Initialize the Module.
TH2F * h_bgo_rs_edep2[18]
Energy deposited.
virtual void event() override
Event processor.
TH2F * h_bgo_rs_edep1Weight[18]
Energy deposited.
virtual void endRun() override
End-of-run action.
TH2F * h_bgo_Evtof[18]
Energy deposited vs TOF.
virtual void terminate() override
Termination action.
TH1F * h_bgo_edep2[18]
Energy deposited.
TH2F * h_bgo_rs_edep1[18]
Energy deposited.
virtual void beginRun() override
Called when entering a new run.
BgoStudyModule()
Constructor: Sets the description, the properties and the parameters of the module.
TH1F * h_bgo_edep1Weight[18]
Energy deposited.
TH2F * h_bgo_Evtof1[18]
Energy deposited vs TOF.
TH1F * h_bgo_edep2Weight[18]
Energy deposited.
TH2F * h_bgo_Evtof2[18]
Energy deposited vs TOF.
TH2F * h_bgo_Evtof3[18]
Energy deposited vs TOF.
TH2F * h_bgo_rs_rate[2]
Rate.
TH2F * h_bgo_rs_edep2Weight[18]
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.