59 #include "TRestDetectorHitsTranslationProcess.h"
65 TRestDetectorHitsTranslationProcess::TRestDetectorHitsTranslationProcess() { Initialize(); }
79 TRestDetectorHitsTranslationProcess::TRestDetectorHitsTranslationProcess(
const char* configFilename) {
81 LoadConfigFromFile(configFilename);
84 TRestDetectorHitsTranslationProcess::~TRestDetectorHitsTranslationProcess() {}
87 SetSectionName(this->ClassName());
88 SetLibraryVersion(LIBRARY_VERSION);
90 fInputEvent =
nullptr;
98 for (
unsigned int hit = 0; hit < fInputEvent->GetNumberOfHits(); hit++) {
99 TVector3 position(fInputEvent->GetX(hit), fInputEvent->GetY(hit), fInputEvent->GetZ(hit));
100 const auto type = fInputEvent->GetType(hit);
101 const auto energy = fInputEvent->GetEnergy(hit);
102 const auto time = fInputEvent->GetTime(hit);
105 fOutputEvent->AddHit(position, energy, time, type);
109 position += fTranslation;
110 fOutputEvent->AddHit(position, energy, time, type);
118 fTranslation = Get3DVectorParameterWithUnits(
"translation", {0, 0, 1});
124 RESTMetadata <<
" - Translation vector : ( " << fTranslation.X() <<
", " << fTranslation.Y() <<
", "
125 << fTranslation.Z() <<
") mm" << RESTendl;
A process to translate hits by a given user amount.
void InitFromConfigFile() override
To make settings from rml file. This method must be implemented in the derived class.
TRestEvent * ProcessEvent(TRestEvent *inputEvent) override
Process one event.
void PrintMetadata() override
Implemented it in the derived metadata class to print out specific metadata information.
void Initialize() override
Making default settings.
virtual void InitFromConfigFile() override
To make settings from rml file. This method must be implemented in the derived class.
A base class for any REST event.
void SetEventInfo(TRestEvent *eve)