9 #include <beast/claws/modules/ClawsDigitizerModule.h>
10 #include <beast/claws/dataobjects/CLAWSSimHit.h>
11 #include <framework/logging/Logger.h>
12 #include <framework/gearbox/GearDir.h>
13 #include <framework/gearbox/Unit.h>
22 using namespace claws;
37 setDescription(
"Claws digitizer module");
40 addParam(
"ScintCell", m_ScintCell,
"Number of scintillator cell", 16);
41 addParam(
"TimeStep", m_TimeStep,
"Time step", 0.8);
42 addParam(
"C_keV_to_MIP", m_C_keV_to_MIP,
"C_keV_to_MIP", 805.5);
43 addParam(
"C_MIP_to_PE", m_C_MIP_to_PE,
"C_MIP_to_PE");
44 addParam(
"MinTime", m_MinTime,
"Min. time", 0.0);
45 addParam(
"MaxTime", m_MaxTime,
"Max. time", 750.0);
46 addParam(
"PEthres", m_PEthres,
"Energy threshold in keV", 1.0);
49 ClawsDigitizerModule::~ClawsDigitizerModule()
53 void ClawsDigitizerModule::initialize()
55 B2INFO(
"ClawsDigitizer: Initializing");
56 m_clawsHit.registerInDataStore();
63 void ClawsDigitizerModule::beginRun()
67 void ClawsDigitizerModule::event()
97 for (
const auto& SimHit : SimHits) {
98 int lad = SimHit.getLadder();
99 int sen = SimHit.getSensor();
102 int detNb = (lad - 1) * 8 + sen - 1;
103 const double Edep = SimHit.getEnergyVisible() * 1e6;
104 const double tof = SimHit.getTime();
105 int TimeBin = tof / m_TimeStep;
106 double MIP = Edep / m_C_keV_to_MIP;
107 double PE = MIP * m_C_MIP_to_PE[detNb];
108 if ((m_MinTime < tof && tof < m_MaxTime) && PE > m_PEthres)
126 void ClawsDigitizerModule::getXMLData()
128 GearDir content =
GearDir(
"/Detector/DetectorComponent[@name=\"CLAWS\"]/Content/");
130 m_ScintCell = content.getInt(
"ScintCell");
131 m_TimeStep = content.getTime(
"TimeStep") / Unit::ns;
132 m_MinTime = content.getTime(
"MinTime") / Unit::ns;
133 m_MaxTime = content.getTime(
"MaxTime") / Unit::ns;
134 m_PEthres = content.getDouble(
"PEthres");
135 m_C_keV_to_MIP = content.getDouble(
"C_keV_to_MIP");
137 B2INFO(
"ClawsDigitizer: Aquired claws locations and gas parameters");
141 void ClawsDigitizerModule::endRun()
145 void ClawsDigitizerModule::terminate()
ClassClawsHit - digitization simulated hit for the Claws detector.
GearDir is the basic class used for accessing the parameter store.
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.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Abstract base class for different kinds of events.