68 #include "TRestDetectorHitsSmearingProcess.h"
91 SetSectionName(this->ClassName());
92 SetLibraryVersion(LIBRARY_VERSION);
94 fInputEvent =
nullptr;
99 if (fRandom !=
nullptr) {
102 fRandom =
new TRandom3(fSeed);
103 fSeed = fRandom->TRandom::GetSeed();
113 Double_t eDep = fInputEvent->GetTotalEnergy();
114 Double_t eRes = fResolutionAtERef * TMath::Sqrt(fEnergyRef / eDep) / 2.35 / 100.0;
116 Double_t gain = fRandom->Gaus(1.0, eRes);
117 for (
unsigned int hit = 0; hit < fInputEvent->GetNumberOfHits(); hit++)
118 fOutputEvent->AddHit(fInputEvent->GetX(hit), fInputEvent->GetY(hit), fInputEvent->GetZ(hit),
119 fInputEvent->GetEnergy(hit) * gain, fInputEvent->GetTime(hit),
120 fInputEvent->GetType(hit));
A process to include detector energy resolution in a TRestDetectorHitsEvent.
void Initialize() override
Function to initialize input/output event members and define the section name.
TRestEvent * ProcessEvent(TRestEvent *inputEvent) override
The main processing event function.
~TRestDetectorHitsSmearingProcess()
Default destructor.
TRestDetectorHitsSmearingProcess()
Default constructor.
void InitProcess() override
To be executed at the beginning of the run (outside event loop)
A base class for any REST event.
void SetEventInfo(TRestEvent *eve)