9 #include <beast/claw/modules/ClawDigitizerModule.h>
10 #include <beast/claw/dataobjects/ClawSimHit.h>
11 #include <framework/logging/Logger.h>
12 #include <framework/gearbox/GearDir.h>
36 setDescription(
"Claw digitizer module");
39 addParam(
"ScintCell", m_ScintCell,
"Number of scintillator cell", 16);
40 addParam(
"TimeStep", m_TimeStep,
"Time step", 0.8);
41 addParam(
"C_keV_to_MIP", m_C_keV_to_MIP,
"C_keV_to_MIP", 805.5);
42 addParam(
"C_MIP_to_PE", m_C_MIP_to_PE,
"C_MIP_to_PE");
43 addParam(
"MinTime", m_MinTime,
"Min. time", 0.0);
44 addParam(
"MaxTime", m_MaxTime,
"Max. time", 750.0);
45 addParam(
"PEthres", m_PEthres,
"Energy threshold in keV", 1.0);
48 ClawDigitizerModule::~ClawDigitizerModule()
52 void ClawDigitizerModule::initialize()
54 B2INFO(
"ClawDigitizer: Initializing");
55 m_clawHit.registerInDataStore();
62 void ClawDigitizerModule::beginRun()
66 void ClawDigitizerModule::event()
95 for (
const auto& SimHit : SimHits) {
96 const int detNb = SimHit.getCellId();
98 const double Edep = SimHit.getEnergyDep() * 1e6;
99 const double tof = SimHit.getFlightTime();
100 int TimeBin = tof / m_TimeStep;
101 double MIP = Edep / m_C_keV_to_MIP;
102 double PE = MIP * m_C_MIP_to_PE[detNb];
103 if ((m_MinTime < tof && tof < m_MaxTime) && PE > m_PEthres)
121 void ClawDigitizerModule::getXMLData()
123 GearDir content =
GearDir(
"/Detector/DetectorComponent[@name=\"CLAW\"]/Content/");
125 m_ScintCell = content.getInt(
"ScintCell");
126 m_TimeStep = content.getDouble(
"TimeStep");
127 m_MinTime = content.getDouble(
"MinTime");
128 m_MaxTime = content.getDouble(
"MaxTime");
129 m_PEthres = content.getDouble(
"PEthres");
130 m_C_keV_to_MIP = content.getDouble(
"C_keV_to_MIP");
133 B2INFO(
"ClawDigitizer: Aquired claw locations and gas parameters");
137 void ClawDigitizerModule::endRun()
141 void ClawDigitizerModule::terminate()
ClassClawHit - digitization simulated hit for the Claw 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.