66 #include "TRestDetectorHitsRotationProcess.h"
72 TRestDetectorHitsRotationProcess::TRestDetectorHitsRotationProcess() { Initialize(); }
86 TRestDetectorHitsRotationProcess::TRestDetectorHitsRotationProcess(
const char* configFilename) {
88 LoadConfigFromFile(configFilename);
91 TRestDetectorHitsRotationProcess::~TRestDetectorHitsRotationProcess() {}
94 SetSectionName(this->ClassName());
95 SetLibraryVersion(LIBRARY_VERSION);
97 fInputEvent =
nullptr;
105 for (
unsigned int hit = 0; hit < fInputEvent->GetNumberOfHits(); hit++) {
106 TVector3 position = {fInputEvent->GetX(hit), fInputEvent->GetY(hit), fInputEvent->GetZ(hit)};
107 const auto type = fInputEvent->GetType(hit);
108 const auto energy = fInputEvent->GetEnergy(hit);
109 const auto time = fInputEvent->GetTime(hit);
112 fOutputEvent->AddHit(position, energy, time, type);
119 position.Rotate(fAngle, fAxis);
122 fOutputEvent->AddHit(position, energy, time, type);
131 fAxis = Get3DVectorParameterWithUnits(
"axis", fAxis);
133 fCenter = Get3DVectorParameterWithUnits(
"center", fCenter);
139 RESTMetadata <<
" - Rotation center : ( " << fCenter.X() <<
", " << fCenter.Y() <<
", " << fCenter.Z()
140 <<
") mm" << RESTendl;
141 RESTMetadata <<
" - Rotation axis : ( " << fAxis.X() <<
", " << fAxis.Y() <<
", " << fAxis.Z() <<
")"
143 RESTMetadata <<
" - Rotation angle : " << fAngle *
units(
"degrees") <<
" degrees" << RESTendl;
A process to rotate hits from a given center and axis.
void InitFromConfigFile() override
To make settings from rml file. This method must be implemented in the derived class.
void Initialize() override
Making default settings.
void PrintMetadata() override
Implemented it in the derived metadata class to print out specific metadata information.
TRestEvent * ProcessEvent(TRestEvent *inputEvent) override
Process one event.
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)