9#include <beast/csi/modules/CsiStudy_v2Module.h>
10#include <framework/logging/Logger.h>
11#include <framework/gearbox/GearDir.h>
45 for (
int i = 0; i < 153; i++) {
46 h_csi_drate[i] =
new TH1F(TString::Format(
"csi_rate_%d", i),
"count", 18, 0., 18.);
49 h_csi_rs_drate[i] =
new TH2F(TString::Format(
"csi_rs_drate_%d", i),
"count v. ring section", 18, 0., 18., 12, 0., 12.);
52 for (
int j = 0; j < 18; j++) {
54 h_csi_dedep[j][i] =
new TH1F(TString::Format(
"csi_dedep_%d_%d", j, i),
"Energy deposited [MeV]", 5000, 0., 400.);
55 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.);
57 h_csi_denergy[j][i] =
new TH1F(TString::Format(
"csi_denergy_%d_%d", j, i),
"Energy deposited [MeV]", 200, 0.1, 3.);
58 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.,
152 B2INFO(
"CsiStudy_v2Module: Initialize");
173 if (
SimHits.getEntries() == 0) {
179 int ring_section = -1;
180 const int section_ordering[12] = {1, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2};
181 for (
const auto& MetaHit :
MetaHits) {
183 double sad_ssraw = MetaHit.getssraw();
185 if (sad_ssraw >= 0) ssraw = sad_ssraw / 100.;
186 else ssraw = 3000. + sad_ssraw / 100.;
188 ring_section = section_ordering[(int)((ssraw) / 250.)] - 1;
211 int detNB =
Hit.getCellId();
212 double Edep =
Hit.getEnergyDep() * 1e3;
213 double RecEdep = Edep;
238 for (
int i = 0; i < 153; i ++) {
259 GearDir content =
GearDir(
"/Detector/DetectorComponent[@name=\"CSI\"]/Content/");
260 m_Ethres = content.getDouble(
"Ethres");
263 for (
int i = 0; i < 18; i ++) {
264 int iThres_hitRate = 0;
265 for (
double Thres : content.getArray(TString::Format(
"thres_hitRate_det%d", i).Data(), {0})) {
270 for (
double Thres : content.getArray(TString::Format(
"thres_sumE_det%d", i).Data(), {0})) {
276 B2INFO(
"CsiStudy_v2");
GearDir is the basic class used for accessing the parameter store.
HistoModule()
Constructor.
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.
Namespace to encapsulate code needed for the CSI detector.
Abstract base class for different kinds of events.
Structure to hold some of the calpulse data.