9#include <beast/csi/modules/CsiStudy_v2Module.h>
10#include <framework/logging/Logger.h>
11#include <framework/gearbox/GearDir.h>
12#include <framework/gearbox/Const.h>
51 for (
int i = 0; i < 153; i++) {
52 h_csi_drate[i] =
new TH1F(TString::Format(
"csi_rate_%d", i),
"count", 18, 0., 18.);
55 h_csi_rs_drate[i] =
new TH2F(TString::Format(
"csi_rs_drate_%d", i),
"count v. ring section", 18, 0., 18., 12, 0., 12.);
58 for (
int j = 0; j < 18; j++) {
60 h_csi_dedep[j][i] =
new TH1F(TString::Format(
"csi_dedep_%d_%d", j, i),
"Energy deposited [MeV]", 5000, 0., 400.);
61 h_csi_rs_dedep[j][i] =
new TH2F(TString::Format(
"csi_rs_dedep_%d_%d", j, i),
"Energy deposited [MeV]", 5000, 0., 400., 12, 0., 12.);
63 h_csi_denergy[j][i] =
new TH1F(TString::Format(
"csi_denergy_%d_%d", j, i),
"Energy deposited [MeV]", 200, 0.1, 3.);
64 h_csi_rs_denergy[j][i] =
new TH2F(TString::Format(
"csi_rs_denergy_%d_%d", j, i),
"Energy deposited [MeV] per section", 200, 0.1, 3.,
158 B2INFO(
"CsiStudy_v2Module: Initialize");
179 if (
SimHits.getEntries() == 0) {
185 int ring_section = -1;
186 const int section_ordering[12] = {1, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2};
187 for (
const auto& MetaHit :
MetaHits) {
189 double sad_ssraw = MetaHit.getssraw();
191 if (sad_ssraw >= 0) ssraw = sad_ssraw / 100.;
192 else ssraw = 3000. + sad_ssraw / 100.;
194 ring_section = section_ordering[(int)((ssraw) / 250.)] - 1;
217 int detNB =
Hit.getCellId();
218 double Edep =
Hit.getEnergyDep() * 1e3;
219 double RecEdep = Edep;
244 for (
int i = 0; i < 153; i ++) {
265 GearDir content =
GearDir(
"/Detector/DetectorComponent[@name=\"CSI\"]/Content/");
266 m_Ethres = content.getDouble(
"Ethres");
269 for (
int i = 0; i < 18; i ++) {
270 int iThres_hitRate = 0;
271 for (
double Thres : content.getArray(TString::Format(
"thres_hitRate_det%d", i).Data(), {0})) {
276 for (
double Thres : content.getArray(TString::Format(
"thres_sumE_det%d", i).Data(), {0})) {
282 B2INFO(
"CsiStudy_v2");
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.
TH1F * h_csi_dedep[18][153]
Energy.
CsiStudy_v2Module()
Constructor: Sets the description, the properties and the parameters of the module.
double m_Thres_hitRate[18][200]
Rate.
StoreArray< CsiSimHit > SimHits
Array of sim hits.
virtual void initialize() override
Initialize the Module.
virtual void event() override
Event processor.
TH2F * h_csi_rs_drate[153]
Rate.
virtual void endRun() override
End-of-run action.
TH1F * h_csi_denergy[18][153]
Energy.
virtual void getXMLData()
reads data from CSI.xml: tube location, drift data filename, sigma of impulse response function
virtual void terminate() override
Termination action.
virtual ~CsiStudy_v2Module()
Destructor.
StoreArray< CsiHit_v2 > Hits
Array of digi hits.
TH2F * h_csi_rs_denergy[18][153]
Energy.
virtual void beginRun() override
Called when entering a new run.
StoreArray< SADMetaHit > MetaHits
Array of SAD particle.
TH1F * h_csi_drate[153]
Rate.
double m_Thres_sumE[18][200]
Energy threshold.
double m_Ethres
Energy threshold.
TH2F * h_csi_rs_dedep[18][153]
Energy.
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.