11 #include <beast/pindiode/modules/PinDigitizerModule.h>
12 #include <beast/pindiode/dataobjects/PindiodeSimHit.h>
14 #include <framework/logging/Logger.h>
15 #include <framework/core/RandomNumbers.h>
24 using namespace pindiode;
39 setDescription(
"Pindiode digitizer module");
42 addParam(
"CrematGain", m_CrematGain,
"Charge sensitive preamplifier gain [volts/C] ", 1.4);
43 addParam(
"WorkFunction", m_WorkFunction,
"Convert eV to e [e/eV] ", 1.12);
44 addParam(
"FanoFactor", m_FanoFactor,
"e resolution ", 0.1);
48 PinDigitizerModule::~PinDigitizerModule()
52 void PinDigitizerModule::initialize()
54 B2INFO(
"PinDigitizer: Initializing");
55 m_pindiodeHit.registerInDataStore();
59 void PinDigitizerModule::beginRun()
63 void PinDigitizerModule::event()
74 for (
int i = 0; i < nentries; i++) {
80 double meanEl = edep / m_WorkFunction * 1e9;
81 double sigma = sqrt(m_FanoFactor * meanEl);
82 int NbEle = (int)gRandom->Gaus(meanEl, sigma);
83 double fedep = ((double) NbEle) * m_WorkFunction * 1e-3;
84 double volt = NbEle * 1.602176565e-19 * m_CrematGain * 1e12;
91 void PinDigitizerModule::endRun()
95 void PinDigitizerModule::terminate()