9 #include <beast/pindiode/modules/PinDigitizerModule.h>
10 #include <beast/pindiode/dataobjects/PindiodeSimHit.h>
12 #include <framework/logging/Logger.h>
13 #include <framework/core/RandomNumbers.h>
22 using namespace pindiode;
37 setDescription(
"Pindiode digitizer module");
40 addParam(
"CrematGain", m_CrematGain,
"Charge sensitive preamplifier gain [volts/C] ", 1.4);
41 addParam(
"WorkFunction", m_WorkFunction,
"Convert eV to e [e/eV] ", 1.12);
42 addParam(
"FanoFactor", m_FanoFactor,
"e resolution ", 0.1);
46 PinDigitizerModule::~PinDigitizerModule()
50 void PinDigitizerModule::initialize()
52 B2INFO(
"PinDigitizer: Initializing");
53 m_pindiodeHit.registerInDataStore();
57 void PinDigitizerModule::beginRun()
61 void PinDigitizerModule::event()
72 for (
int i = 0; i < nentries; i++) {
78 double meanEl = edep / m_WorkFunction * 1e9;
79 double sigma = sqrt(m_FanoFactor * meanEl);
80 int NbEle = (int)gRandom->Gaus(meanEl, sigma);
81 double fedep = ((double) NbEle) * m_WorkFunction * 1e-3;
82 double volt = NbEle * 1.602176565e-19 * m_CrematGain * 1e12;
89 void PinDigitizerModule::endRun()
93 void PinDigitizerModule::terminate()
ClassPindiodeHit - digitization simulated hit for the Pindiode detector.
ClassPindiodeSimHit - Geant4 simulated hit for the Pindiode crystal in beast.
int getPDGCode() const
Get Particle PDG (can be one of secondaries)
int getCellId() const
Get Cell ID.
double getFlightTime() const
Get Flight time from IP.
double getEnergyDep() const
Get Deposit energy.
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.