9#include <beast/qcsmonitor/modules/QcsmonitorStudyModule.h>
10#include <beast/qcsmonitor/dataobjects/QcsmonitorSimHit.h>
11#include <beast/qcsmonitor/dataobjects/QcsmonitorHit.h>
12#include <generators/SAD/dataobjects/SADMetaHit.h>
13#include <framework/datastore/StoreArray.h>
14#include <framework/gearbox/GearDir.h>
15#include <framework/logging/Logger.h>
16#include <framework/gearbox/Const.h>
31using namespace qcsmonitor;
57 for (
int i = 0; i < 40; i++) {
58 h_qcss_Evtof1[i] =
new TH2F(TString::Format(
"qcss_Evtof1_%d", i),
"Energy deposited [MeV] vs TOF [ns] - all", 500, 0., 1000.,
60 h_qcss_Evtof2[i] =
new TH2F(TString::Format(
"qcss_Evtof2_%d", i),
"Energy deposited [MeV] vs TOF [ns] - only photons", 500, 0.,
62 h_qcss_Evtof3[i] =
new TH2F(TString::Format(
"qcss_Evtof3_%d", i),
"Energy deposited [MeV] vs TOF [ns] - only e+/e-", 500, 0.,
64 h_qcss_Evtof4[i] =
new TH2F(TString::Format(
"qcss_Evtof4_%d", i),
"Energy deposited [MeV] vs TOF [ns] - only e+/e-", 500, 0.,
66 h_qcss_edep[i] =
new TH1F(TString::Format(
"qcss_edep_%d", i),
"Energy deposited [MeV]", 5000, 0., 10.);
67 h_Wqcss_edep[i] =
new TH1F(TString::Format(
"Wqcss_edep_%d", i),
"Energy deposited [MeV]", 5000, 0., 10.);
70 h_qcss_hitrate0 =
new TH1F(
"qcss_hitrate0",
"Hit distributions", 100, 0., 100.);
71 h_qcss_hitrate1 =
new TH1F(
"qcss_hitrate1",
"Hit distributions", 100, 0., 100.);
72 h_qcss_hitrate2 =
new TH1F(
"qcss_hitrate2",
"Hit distributions", 100, 0., 100.);
73 h_qcss_hitrate1W =
new TH1F(
"qcss_hitrate1W",
"Hit distributions", 100, 0., 100.);
74 h_qcss_hitrate2W =
new TH1F(
"qcss_hitrate2W",
"Hit distributions", 100, 0., 100.);
82 h_qcss_rs_hitrate1 =
new TH2F(
"qcss_rs_hitrate1",
"Hit distributions vs rs", 100, 0., 100., 12, 0., 12.);
83 h_qcss_rs_hitrate2 =
new TH2F(
"qcss_rs_hitrate2",
"Hit distributions vs rs", 100, 0., 100., 12, 0., 12.);
84 h_qcss_rs_hitrate1W =
new TH2F(
"qcss_rs_hitrate1W",
"Hit distributions vs rs", 100, 0., 100., 12, 0., 12.);
85 h_qcss_rs_hitrate2W =
new TH2F(
"qcss_rs_hitrate2W",
"Hit distributions vs rs", 100, 0., 100., 12, 0., 12.);
92 for (
int i = 0; i < 40; i++) {
93 h_qcss_rate1[i] =
new TH1F(TString::Format(
"qcss_rate1_%d", i),
"PE distributions", 500, 0., 500.);
94 h_qcss_rate2[i] =
new TH1F(TString::Format(
"qcss_rate2_%d", i),
"PE distributions", 500, 0., 500.);
95 h_qcss_rate1W[i] =
new TH1F(TString::Format(
"qcss_rate1W_%d", i),
"PE distributions", 500, 0., 500.);
96 h_qcss_rate2W[i] =
new TH1F(TString::Format(
"qcss_rate2W_%d", i),
"PE distributions", 500, 0., 500.);
97 h_qcss_pe1[i] =
new TH2F(TString::Format(
"qcss_pe1_%d", i),
"PE distributions", 500, 0., 500., 100, 0., 1000.);
98 h_qcss_pe2[i] =
new TH2F(TString::Format(
"qcss_pe2_%d", i),
"PE distributions", 500, 0., 500., 100, 0., 1000.);
99 h_qcss_pe1W[i] =
new TH2F(TString::Format(
"qcss_pe1W_%d", i),
"PE distributions", 500, 0., 500., 100, 0., 1000.);
100 h_qcss_pe2W[i] =
new TH2F(TString::Format(
"qcss_pe2W_%d", i),
"PE distributions", 500, 0., 500., 100, 0., 1000.);
102 h_qcss_rs_rate1[i] =
new TH2F(TString::Format(
"qcss_rs_rate1_%d", i),
"PE distributions", 500, 0., 500., 12, 0., 12.);
103 h_qcss_rs_rate2[i] =
new TH2F(TString::Format(
"qcss_rs_rate2_%d", i),
"PE distributions", 500, 0., 500., 12, 0., 12.);
104 h_qcss_rs_rate1W[i] =
new TH2F(TString::Format(
"qcss_rs_rate1W_%d", i),
"PE distributions", 500, 0., 500., 12, 0., 12.);
105 h_qcss_rs_rate2W[i] =
new TH2F(TString::Format(
"qcss_rs_rate2W_%d", i),
"PE distributions", 500, 0., 500., 12, 0., 12.);
125 B2INFO(
"QcsmonitorStudyModule: Initialize");
145 int ring_section = -1;
146 for (
const auto& MetaHit : MetaHits) {
147 rate = MetaHit.getrate();
148 ring_section = MetaHit.getring_section() - 1;
155 for (
int i = 0; i < nSimHits; i++) {
176 for (
const auto&
Hit : Hits) {
177 const int detNb =
Hit.getdetNb();
179 const int timebin =
Hit.gettime();
180 const float edep =
Hit.getedep();
181 const float pe =
Hit.getPE();
212 GearDir content =
GearDir(
"/Detector/DetectorComponent[@name=\"QCSMONITOR\"]/Content/");
213 m_Ethres = content.getDouble(
"Ethres");
215 B2INFO(
"QcsmonitorStudy");
static const ParticleType photon
photon particle
static const ChargedStable electron
electron particle
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.
ClassQcsmonitorSimHit - Geant4 simulated hit for the Qcsmonitor crystal in beast.
int getPDGCode() const
Get Particle PDG (can be one of secondaries)
int getCellId() const
Get Cell ID.
double getFlightTime() const
Get Flight time from IP.
double getEnergyDep() const
Get Deposit energy.
Accessor to arrays stored in the data store.
int getEntries() const
Get the number of objects in the array.
TH2F * h_qcss_pe1[48]
Energy deposited.
TH1F * h_qcss_hitrate0
Energy deposited.
TH2F * h_qcss_Evtof3[48]
Energy deposited vs TOF.
TH2F * h_qcss_rs_hitrate2W
Energy deposited.
TH2F * h_qcss_rs_rate2[48]
Energy deposited.
TH2F * h_qcss_rs_hitrate2
Energy deposited.
TH1F * h_qcss_rate2[48]
Energy deposited.
TH1F * h_qcss_edep[48]
Energy deposited.
virtual void initialize() override
Initialize the Module.
virtual void event() override
Event processor.
TH2F * h_qcss_Evtof1[48]
Energy deposited vs TOF.
virtual void endRun() override
End-of-run action.
TH2F * h_qcss_Evtof2[48]
Energy deposited vs TOF.
virtual void getXMLData()
reads data from QCSMONITOR.xml
TH1F * h_qcss_hitrate1
Energy deposited.
virtual ~QcsmonitorStudyModule()
Destructor.
virtual void terminate() override
Termination action.
TH2F * h_qcss_rs_rate2W[48]
Energy deposited.
QcsmonitorStudyModule()
Constructor: Sets the description, the properties and the parameters of the module.
TH2F * h_qcss_rs_rate1[48]
Energy deposited.
TH2F * h_qcss_pe2[48]
Energy deposited.
virtual void beginRun() override
Called when entering a new run.
TH2F * h_qcss_pe1W[48]
Energy deposited.
TH2F * h_qcss_Evtof4[48]
Energy deposited vs TOF.
TH1F * h_qcss_rate2W[48]
Energy deposited.
TH1F * h_Wqcss_edep[48]
Energy deposited.
TH1F * h_qcss_rate1W[48]
Energy deposited.
TH1F * h_qcss_hitrate1W
Energy deposited.
double m_Ethres
Energy threshold.
TH1F * h_qcss_hitrate2
Energy deposited.
TH2F * h_qcss_rs_hitrate1W
Energy deposited.
TH2F * h_qcss_rs_hitrate1
Energy deposited.
TH1F * h_qcss_hitrate2W
Energy deposited.
TH2F * h_qcss_pe2W[48]
Energy deposited.
TH2F * h_qcss_rs_rate1W[48]
Energy deposited.
TH1F * h_qcss_rate1[48]
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.
Structure to hold some of the calpulse data.