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>
24#include <generators/SAD/dataobjects/SADMetaHit.h>
55 for (
int i = 0; i < 2; i++) {
56 h_bgo_rate[i] =
new TH1F(TString::Format(
"bgo_rate_%d", i),
"count", 18, 0., 18.);
59 h_bgo_rs_rate[i] =
new TH2F(TString::Format(
"bgo_rs_rate_%d", i),
"count v. ring section", 18, 0., 18., 12, 0., 12.);
62 for (
int i = 0; i < 18; i++) {
63 h_bgo_Evtof[i] =
new TH2F(TString::Format(
"bgo_Evtof_%d", i),
"Energy deposited [MeV] vs TOF [ns] - all", 5000, 0., 1000.,
65 h_bgo_Evtof1[i] =
new TH2F(TString::Format(
"bgo_Evtof1_%d", i),
"Energy deposited [MeV] vs TOF [ns] - all", 5000, 0., 1000.,
67 h_bgo_Evtof2[i] =
new TH2F(TString::Format(
"bgo_Evtof2_%d", i),
"Energy deposited [MeV] vs TOF [ns] - only photons", 5000, 0.,
68 1000., 1000, 0., 400.);
69 h_bgo_Evtof3[i] =
new TH2F(TString::Format(
"bgo_Evtof3_%d", i),
"Energy deposited [MeV] vs TOF [ns] - only e+/e-", 5000, 0.,
70 1000., 1000, 0., 400.);
72 h_bgo_edep[i] =
new TH1F(TString::Format(
"bgo_edep_%d", i),
"Energy deposited [MeV]", 5000, 0., 400.);
73 h_bgo_edep1[i] =
new TH1F(TString::Format(
"bgo_edep1_%d", i),
"Energy deposited [MeV]", 5000, 0., 400.);
74 h_bgo_edep2[i] =
new TH1F(TString::Format(
"bgo_edep2_%d", i),
"Energy deposited [MeV]", 5000, 0., 400.);
75 h_bgo_edep1Weight[i] =
new TH1F(TString::Format(
"bgo_edep1Weight_%d", i),
"Energy deposited [MeV]", 5000, 0., 400.);
76 h_bgo_edep2Weight[i] =
new TH1F(TString::Format(
"bgo_edep2Weight_%d", i),
"Energy deposited [MeV]", 5000, 0., 400.);
78 h_bgo_rs_edep1[i] =
new TH2F(TString::Format(
"bgo_rs_edep1_%d", i),
"Energy deposited [MeV]", 5000, 0., 400., 12, 0., 12.);
79 h_bgo_rs_edep2[i] =
new TH2F(TString::Format(
"bgo_rs_edep2_%d", i),
"Energy deposited [MeV]", 5000, 0., 400., 12, 0., 12.);
80 h_bgo_rs_edep1Weight[i] =
new TH2F(TString::Format(
"bgo_rs_edep1Weight_%d", i),
"Energy deposited [MeV]", 5000, 0., 400., 12, 0.,
82 h_bgo_rs_edep2Weight[i] =
new TH2F(TString::Format(
"bgo_rs_edep2Weight_%d", i),
"Energy deposited [MeV]", 5000, 0., 400., 12, 0.,
101 B2INFO(
"BgoStudyModule: Initialize");
128 int ring_section = -1;
129 const int section_ordering[12] = {1, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2};
130 for (
const auto& MetaHit : MetaHits) {
131 rate = MetaHit.getrate();
132 double sad_ssraw = MetaHit.getssraw();
134 if (sad_ssraw >= 0) ssraw = sad_ssraw / 100.;
135 else ssraw = 3000. + sad_ssraw / 100.;
137 ring_section = section_ordering[(int)((ssraw) / 250.)] - 1;
141 for (
const auto& SimHit : SimHits) {
142 int detNB = SimHit.getCellId();
143 int pdg = SimHit.getPDGCode();
144 double Edep = SimHit.getEnergyDep() * 1e3;
145 double tof = SimHit.getFlightTime();
151 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.