69#include "TRestDetectorHitsSmearingProcess.h"
103 if (!fReadout && !fChannelType.empty()) {
105 "TRestDetectorHitsSmearingProcess::InitProcess() : "
106 "TRestDetectorReadout not found and channel type is requested");
109 transform(fChannelType.begin(), fChannelType.end(), fChannelType.begin(), ::tolower);
110 const auto validChannelTypes = {
"veto",
"tpc"};
111 if (find(validChannelTypes.begin(), validChannelTypes.end(), fChannelType) == validChannelTypes.end()) {
113 "TRestDetectorHitsSmearingProcess::InitProcess() : Channel type not valid: valid types are: "
128 Double_t gain =
fRandom->Gaus(1.0, eRes);
129 for (
int hit = 0; hit < static_cast<int>(
fInputEvent->GetNumberOfHits()); hit++) {
135 if (fChannelType ==
"veto") {
136 if (hitType == REST_HitType::VETO) {
146 }
else if (fChannelType ==
"tpc") {
147 if (hitType == REST_HitType::VETO) {
160 "TRestDetectorHitsSmearingProcess::ProcessEvent() : "
161 "Channel type not valid: valid types are: "
Double_t GetX(int n) const
Returns the X-coordinate of hit entry n in mm.
Double_t GetY(int n) const
Returns the Y-coordinate of hit entry n in mm.
Double_t GetZ(int n) const
Returns the Z-coordinate of hit entry n in mm.
void AddHit(Double_t x, Double_t y, Double_t z, Double_t en, Double_t t=0, REST_HitType type=XYZ)
Adds a new hit to this event.
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.
Double_t fEnergyRef
Reference energy for the FWHM.
Double_t fResolutionAtERef
FWHM at Energy of reference.
TRestDetectorHitsEvent * fOutputEvent
A pointer to the process output event.
TRestEvent * ProcessEvent(TRestEvent *inputEvent) override
The main processing event function.
TRestDetectorHitsEvent * fInputEvent
A pointer to the process input event.
~TRestDetectorHitsSmearingProcess()
Default destructor.
TRestDetectorHitsSmearingProcess()
Default constructor.
void InitProcess() override
To be executed at the beginning of the run (outside event loop)
TRandom3 * fRandom
A pointer to the random generator initializes with fSeed.
ULong_t fSeed
The seed to be used for the random generator.
A metadata class to generate/store a readout description.
TRestRun * fRunInfo
< Pointer to TRestRun object where to find metadata.
A base class for any REST event.
void SetEventInfo(TRestEvent *eve)