11 #include <beast/claws/modules/ClawsDigitizerModule.h>
12 #include <beast/claws/dataobjects/CLAWSSimHit.h>
14 #include <mdst/dataobjects/MCParticle.h>
15 #include <framework/logging/Logger.h>
16 #include <framework/gearbox/GearDir.h>
17 #include <framework/gearbox/Unit.h>
26 using namespace claws;
41 setDescription(
"Claws digitizer module");
44 addParam(
"ScintCell", m_ScintCell,
"Number of scintillator cell", 16);
45 addParam(
"TimeStep", m_TimeStep,
"Time step", 0.8);
46 addParam(
"C_keV_to_MIP", m_C_keV_to_MIP,
"C_keV_to_MIP", 805.5);
47 addParam(
"C_MIP_to_PE", m_C_MIP_to_PE,
"C_MIP_to_PE");
48 addParam(
"MinTime", m_MinTime,
"Min. time", 0.0);
49 addParam(
"MaxTime", m_MaxTime,
"Max. time", 750.0);
50 addParam(
"PEthres", m_PEthres,
"Energy threshold in keV", 1.0);
53 ClawsDigitizerModule::~ClawsDigitizerModule()
57 void ClawsDigitizerModule::initialize()
59 B2INFO(
"ClawsDigitizer: Initializing");
60 m_clawsHit.registerInDataStore();
67 void ClawsDigitizerModule::beginRun()
71 void ClawsDigitizerModule::event()
103 for (
const auto& SimHit : SimHits) {
104 int lad = SimHit.getLadder();
105 int sen = SimHit.getSensor();
108 int detNb = (lad - 1) * 8 + sen - 1;
109 const double Edep = SimHit.getEnergyVisible() * 1e6;
110 const double tof = SimHit.getTime();
111 int TimeBin = tof / m_TimeStep;
112 double MIP = Edep / m_C_keV_to_MIP;
113 double PE = MIP * m_C_MIP_to_PE[detNb];
114 if ((m_MinTime < tof && tof < m_MaxTime) && PE > m_PEthres)
132 void ClawsDigitizerModule::getXMLData()
134 GearDir content =
GearDir(
"/Detector/DetectorComponent[@name=\"CLAWS\"]/Content/");
136 m_ScintCell = content.getInt(
"ScintCell");
137 m_TimeStep = content.getTime(
"TimeStep") / Unit::ns;
138 m_MinTime = content.getTime(
"MinTime") / Unit::ns;
139 m_MaxTime = content.getTime(
"MaxTime") / Unit::ns;
140 m_PEthres = content.getDouble(
"PEthres");
141 m_C_keV_to_MIP = content.getDouble(
"C_keV_to_MIP");
143 B2INFO(
"ClawsDigitizer: Aquired claws locations and gas parameters");
147 void ClawsDigitizerModule::endRun()
151 void ClawsDigitizerModule::terminate()