9 #include <beast/beamabort/modules/BeamDigitizerModule.h>
10 #include <beast/beamabort/dataobjects/BeamabortSimHit.h>
12 #include <framework/logging/Logger.h>
13 #include <framework/core/RandomNumbers.h>
22 using namespace beamabort;
37 setDescription(
"Beamabort digitizer module");
40 addParam(
"WorkFunction", m_WorkFunction,
"Convert eV to e [e/eV] ", 1.12);
41 addParam(
"FanoFactor", m_FanoFactor,
"e resolution ", 0.1);
45 BeamDigitizerModule::~BeamDigitizerModule()
49 void BeamDigitizerModule::initialize()
51 B2INFO(
"BeamDigitizer: Initializing");
52 m_beamabortHit.registerInDataStore();
56 void BeamDigitizerModule::beginRun()
60 void BeamDigitizerModule::event()
71 for (
int i = 0; i < nentries; i++) {
77 double meanEl = edep / m_WorkFunction * 1e9;
78 double sigma = sqrt(m_FanoFactor * meanEl);
79 int NbEle = (int)gRandom->Gaus(meanEl, sigma);
80 double fedep = ((double) NbEle) * m_WorkFunction * 1e-3;
81 double Amp = NbEle / (6.25 * 1e18);
88 void BeamDigitizerModule::endRun()
92 void BeamDigitizerModule::terminate()
ClassBeamabortHit - digitization simulated hit for the Beamabort detector.
ClassBeamabortSimHit - Geant4 simulated hit for the Beamabort 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.