9#include <beast/csi/modules/CsiDigitizer_v2Module.h>
10#include <beast/csi/dataobjects/CsiSimHit.h>
12#include <framework/logging/Logger.h>
13#include <framework/gearbox/GearDir.h>
14#include <framework/core/RandomNumbers.h>
53 B2INFO(
"CsiDigitizer_v2: Initializing");
70 for (
int i = 0; i < nentries; i++) {
73 int m_box = (int)m_cellID / 6;
74 int m_cry = m_cellID - m_box * 3;
81 double erecdep = m_energyDeposit;
84 CsiHits_v2.
appendNew(
CsiHit_v2(m_cellID, m_trackID, pdgCode, m_Time * m_energyDeposit / erecdep, m_energyDeposit, m_Mom,
85 m_Pos * (m_energyDeposit / erecdep), erecdep));
93 GearDir content =
GearDir(
"/Detector/DetectorComponent[@name=\"CSI\"]/Content/");
95 int iEnergyResolutionConst = 0;
96 for (
double EnergyResolutionConst : content.getArray(
"EnergyResolutionConst", {0})) {
98 iEnergyResolutionConst++;
100 int iEnergyResolutionFactor = 0;
101 for (
double EnergyResolutionFactor : content.getArray(
"EnergyResolutionFactor", {0})) {
103 iEnergyResolutionFactor++;
106 for (
double Threshold : content.getArray(
"Threshold", {0})) {
112 for (
double Range : content.getArray(
"Range", {0})) {
118 B2INFO(
"CsiDigitizer_V2: Aquired csi locations and gas parameters");
119 B2INFO(
" from CSI.xml. There are " <<
nCSI <<
" CSIs implemented");
ClassCsiHit_v2 - Geant4 simulated hits in CsI crystals in BEAST.
ClassCsiSimHit - Geant4 simulated hits in CsI crystals in BEAST.
int getPDGCode() const
Get Particle PDG (can be one of secondaries)
int getTrackId() const
Get Track ID.
int getCellId() const
Get Cell ID.
double getFlightTime() const
Get Flight time from IP.
double getEnergyDep() const
Get Deposit energy.
ROOT::Math::XYZVector getMomentum() const
Get Momentum.
ROOT::Math::XYZVector getPosition() const
Get Position.
GearDir is the basic class used for accessing the parameter store.
void setDescription(const std::string &description)
Sets the description of the module.
Represents a range of arithmetic types.
Accessor to arrays stored in the data store.
T * appendNew()
Construct a new T object at the end of the array.
int getEntries() const
Get the number of objects in the array.
double m_Range[18]
Enegy range.
virtual void initialize() override
Initialize the Module.
virtual void event() override
Event processor.
double m_EnergyResolutionConst[18]
Energy resolution constant.
Double_t GetEnergyResolutionGeV(Double_t, int)
Fold energy resolution.
virtual void endRun() override
End-of-run action.
virtual void getXMLData()
reads data from CSI.xml: threshold in MeV, range in MeV, and resolution in %
virtual void terminate() override
Termination action.
StoreArray< CsiHit_v2 > m_csiHit_v2
array for CsiHit_v2
virtual void beginRun() override
Called when entering a new run.
virtual ~CsiDigitizer_v2Module()
Destructor.
int nCSI
number of detectors.
double m_Threshold[18]
Energy threshold.
double m_EnergyResolutionFactor[18]
Energy resolution factor.
CsiDigitizer_v2Module()
Constructor: Sets the description, the properties and the parameters of the module.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Abstract base class for different kinds of events.