9#include <beast/dosi/modules/DosiStudyModule.h>
10#include <beast/dosi/dataobjects/DosiSimHit.h>
11#include <beast/dosi/dataobjects/DosiHit.h>
13#include <mdst/dataobjects/MCParticle.h>
14#include <framework/datastore/StoreArray.h>
15#include <framework/datastore/RelationIndex.h>
16#include <framework/logging/Logger.h>
17#include <framework/gearbox/Const.h>
29#include <generators/SAD/dataobjects/SADMetaHit.h>
57 for (
int i = 0; i < 5; i++) {
75 h_dosi_edep0[i] =
new TH1F(TString::Format(
"dosi_edep0_%d", i),
"Energy deposited [MeV]", 50000, 0., 400.);
76 h_dosi_edep1[i] =
new TH1F(TString::Format(
"dosi_edep1_%d", i),
"Energy deposited [MeV]", 50000, 0., 400.);
77 h_dosi_edep2[i] =
new TH1F(TString::Format(
"dosi_edep2_%d", i),
"Energy deposited [MeV]", 50000, 0., 400.);
78 h_dosi_edep3[i] =
new TH1F(TString::Format(
"dosi_edep3_%d", i),
"Energy deposited [MeV]", 50000, 0., 400.);
79 h_dosi_edep4[i] =
new TH1F(TString::Format(
"dosi_edep4_%d", i),
"Energy deposited [MeV]", 50000, 0., 400.);
80 h_dosi_edep5[i] =
new TH1F(TString::Format(
"dosi_edep5_%d", i),
"Energy deposited [MeV]", 50000, 0., 400.);
81 h_dosi_edep6[i] =
new TH1F(TString::Format(
"dosi_edep6_%d", i),
"Energy deposited [MeV]", 50000, 0., 400.);
82 h_dosi_edep7[i] =
new TH1F(TString::Format(
"dosi_edep7_%d", i),
"Energy deposited [MeV]", 50000, 0., 400.);
83 h_dosi_edep8[i] =
new TH1F(TString::Format(
"dosi_edep8_%d", i),
"Energy deposited [MeV]", 50000, 0., 400.);
95 h_dosi_rs_edep0[i] =
new TH2F(TString::Format(
"dosi_rs_edep0_%d", i),
"Energy deposited [MeV]", 50000, 0., 400., 12, 0., 12.);
96 h_dosi_rs_edep1[i] =
new TH2F(TString::Format(
"dosi_rs_edep1_%d", i),
"Energy deposited [MeV]", 50000, 0., 400., 12, 0., 12.);
97 h_dosi_rs_edep2[i] =
new TH2F(TString::Format(
"dosi_rs_edep2_%d", i),
"Energy deposited [MeV]", 50000, 0., 400., 12, 0., 12.);
98 h_dosi_rs_edep3[i] =
new TH2F(TString::Format(
"dosi_rs_edep3_%d", i),
"Energy deposited [MeV]", 50000, 0., 400., 12, 0., 12.);
99 h_dosi_rs_edep4[i] =
new TH2F(TString::Format(
"dosi_rs_edep4_%d", i),
"Energy deposited [MeV]", 50000, 0., 400., 12, 0., 12.);
100 h_dosi_rs_edep5[i] =
new TH2F(TString::Format(
"dosi_rs_edep5_%d", i),
"Energy deposited [MeV]", 50000, 0., 400., 12, 0., 12.);
101 h_dosi_rs_edep6[i] =
new TH2F(TString::Format(
"dosi_rs_edep6_%d", i),
"Energy deposited [MeV]", 50000, 0., 400., 12, 0., 12.);
102 h_dosi_rs_edep7[i] =
new TH2F(TString::Format(
"dosi_rs_edep7_%d", i),
"Energy deposited [MeV]", 50000, 0., 400., 12, 0., 12.);
103 h_dosi_rs_edep8[i] =
new TH2F(TString::Format(
"dosi_rs_edep8_%d", i),
"Energy deposited [MeV]", 50000, 0., 400., 12, 0., 12.);
121 B2INFO(
"DosiStudyModule: Initialize");
148 int ring_section = -1;
149 const int section_ordering[12] = {1, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2};
150 for (
const auto& MetaHit : MetaHits) {
152 double sad_ssraw = MetaHit.getssraw();
154 if (sad_ssraw >= 0) ssraw = sad_ssraw / 100.;
155 else ssraw = 3000. + sad_ssraw / 100.;
157 ring_section = section_ordering[(int)((ssraw) / 250.)] - 1;
164 for (
const auto& SimHit : SimHits) {
165 const int detNB = SimHit.getCellId();
166 const double Edep = SimHit.getEnergyDep() * 1e3;
171 const float Mass = particle->getMass();
172 const float Energy = particle->getEnergy();
173 const float Kinetic = (Energy - Mass) * 1e3;
174 const int pdg = particle->getPDG();
176 if (0.005 <= Kinetic && Kinetic <= 10.0)
182 if (0.001 <= Kinetic && Kinetic <= 0.050)
186 if (pdg ==
Const::neutron.getPDGCode() && (0.001 <= Kinetic && Kinetic <= 10.0))
191 if (0.005 <= Kinetic && Kinetic <= 10.0)
197 if (0.001 <= Kinetic && Kinetic <= 0.050)
201 if (pdg ==
Const::neutron.getPDGCode() && (0.001 <= Kinetic && Kinetic <= 10.0))
int getPDGCode() const
PDG code.
static const ParticleType neutron
neutron 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...
A Class to store the Monte Carlo particle information.
void setDescription(const std::string &description)
Sets the description of the module.
Class to store a single element of a relation.
Provides access to fast ( O(log n) ) bi-directional lookups on a specified relation.
range_to getElementsTo(const TO *to) const
Return a range of all elements pointing to the given object.
Accessor to arrays stored in the data store.
TH1F * h_dosi_edep4[18]
Energy deposited.
TH1F * h_dosi_edep6[18]
Energy deposited.
TH1F * h_dosi_edep1[18]
Energy deposited.
virtual ~DosiStudyModule()
Destructor.
TH2F * h_dosi_rs_edep6[18]
Energy deposited.
TH2F * h_dosi_rs_edep3[18]
Energy deposited.
TH1F * h_dosi_edep7[18]
Energy deposited.
virtual void initialize() override
Initialize the Module.
TH1F * h_dosi_edep8[18]
Energy deposited.
virtual void event() override
Event processor.
TH2F * h_dosi_rs_edep5[18]
Energy deposited.
TH2F * h_dosi_rs_edep2[18]
Energy deposited.
TH1F * h_dosi_edep3[18]
Energy deposited.
TH2F * h_dosi_rs_edep7[18]
Energy deposited.
virtual void endRun() override
End-of-run action.
TH2F * h_dosi_rs_edep0[18]
Energy deposited.
virtual void terminate() override
Termination action.
virtual void beginRun() override
Called when entering a new run.
TH1F * h_dosi_edep2[18]
Energy deposited.
TH2F * h_dosi_rs_edep4[18]
Energy deposited.
DosiStudyModule()
Constructor: Sets the description, the properties and the parameters of the module.
TH2F * h_dosi_rs_edep1[18]
Energy deposited.
TH1F * h_dosi_edep5[18]
Energy deposited.
TH2F * h_dosi_rs_edep8[18]
Energy deposited.
TH1F * h_dosi_edep0[18]
reads data from DOSI.xml: tube location, drift data filename, sigma of impulse response function
virtual void defineHisto() override
Defines the histograms.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Abstract base class for different kinds of events.
Element type for the index.