11 #include <beast/claw/modules/ClawDigitizerModule.h>
12 #include <beast/claw/dataobjects/ClawSimHit.h>
14 #include <mdst/dataobjects/MCParticle.h>
15 #include <framework/logging/Logger.h>
16 #include <framework/gearbox/GearDir.h>
40 setDescription(
"Claw digitizer module");
43 addParam(
"ScintCell", m_ScintCell,
"Number of scintillator cell", 16);
44 addParam(
"TimeStep", m_TimeStep,
"Time step", 0.8);
45 addParam(
"C_keV_to_MIP", m_C_keV_to_MIP,
"C_keV_to_MIP", 805.5);
46 addParam(
"C_MIP_to_PE", m_C_MIP_to_PE,
"C_MIP_to_PE");
47 addParam(
"MinTime", m_MinTime,
"Min. time", 0.0);
48 addParam(
"MaxTime", m_MaxTime,
"Max. time", 750.0);
49 addParam(
"PEthres", m_PEthres,
"Energy threshold in keV", 1.0);
52 ClawDigitizerModule::~ClawDigitizerModule()
56 void ClawDigitizerModule::initialize()
58 B2INFO(
"ClawDigitizer: Initializing");
59 m_clawHit.registerInDataStore();
66 void ClawDigitizerModule::beginRun()
70 void ClawDigitizerModule::event()
102 for (
const auto& SimHit : SimHits) {
103 const int detNb = SimHit.getCellId();
105 const double Edep = SimHit.getEnergyDep() * 1e6;
106 const double tof = SimHit.getFlightTime();
107 int TimeBin = tof / m_TimeStep;
108 double MIP = Edep / m_C_keV_to_MIP;
109 double PE = MIP * m_C_MIP_to_PE[detNb];
110 if ((m_MinTime < tof && tof < m_MaxTime) && PE > m_PEthres)
128 void ClawDigitizerModule::getXMLData()
130 GearDir content =
GearDir(
"/Detector/DetectorComponent[@name=\"CLAW\"]/Content/");
132 m_ScintCell = content.getInt(
"ScintCell");
133 m_TimeStep = content.getDouble(
"TimeStep");
134 m_MinTime = content.getDouble(
"MinTime");
135 m_MaxTime = content.getDouble(
"MaxTime");
136 m_PEthres = content.getDouble(
"PEthres");
137 m_C_keV_to_MIP = content.getDouble(
"C_keV_to_MIP");
140 B2INFO(
"ClawDigitizer: Aquired claw locations and gas parameters");
144 void ClawDigitizerModule::endRun()
148 void ClawDigitizerModule::terminate()