9 #include <beast/dosi/modules/DosiDigitizerModule.h>
10 #include <beast/dosi/dataobjects/DosiSimHit.h>
12 #include <framework/logging/Logger.h>
13 #include <framework/gearbox/GearDir.h>
14 #include <framework/core/RandomNumbers.h>
38 setDescription(
"Dosi digitizer module");
42 DosiDigitizerModule::~DosiDigitizerModule()
46 void DosiDigitizerModule::initialize()
48 B2INFO(
"DosiDigitizer: Initializing");
49 m_dosiHit.registerInDataStore();
56 void DosiDigitizerModule::beginRun()
60 void DosiDigitizerModule::event()
65 for (
int i = 0; i < nentries; i++) {
74 double erecdep = m_energyDeposit;
75 erecdep += gRandom->Gaus(0, GetEnergyResolutionGeV(m_energyDeposit, m_cellID));
76 DosiHits.
appendNew(
DosiHit(m_cellID, m_trackID, pdgCode, m_Time * m_energyDeposit / erecdep, m_energyDeposit, m_Mom,
77 m_Pos * (m_energyDeposit / erecdep), erecdep));
82 void DosiDigitizerModule::getXMLData()
86 B2INFO(
"DosiDigitizer: Aquired dosi locations and gas parameters");
87 B2INFO(
" from DOSI.xml. There are " << nDOSI <<
" DOSIs implemented");
92 Double_t DosiDigitizerModule::GetEnergyResolutionGeV(Double_t pEnergy,
int CellId)
95 return (m_EnergyResolutionFactor[CellId] * TMath::Sqrt(pEnergy) + m_EnergyResolutionConst[CellId] * pEnergy);
100 void DosiDigitizerModule::endRun()
104 void DosiDigitizerModule::terminate()
ClassDosiHit - Geant4 ulated hit for the Dosi crystal in beast.
ClassDosiSimHit - Geant4 simulated hit for the Dosi crystal in beast.
int getPDGCode() const
Get Particle PDG (can be one of secondaries)
int getTrackId() const
Get Track ID.
int getCellId() const
Get Cell ID.
double getFlightTime() const
Get Flight time from IP.
double getEnergyDep() const
Get Deposit energy.
TVector3 getMomentum() const
Get Momentum.
TVector3 getPosition() const
Get Position.
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.