11#include "TRestTrackToDetectorHitsProcess.h"
17TRestTrackToDetectorHitsProcess::TRestTrackToDetectorHitsProcess() {
Initialize(); }
19TRestTrackToDetectorHitsProcess::TRestTrackToDetectorHitsProcess(
const char* configFilename) {
25TRestTrackToDetectorHitsProcess::~TRestTrackToDetectorHitsProcess() {
delete fOutputHitsEvent; }
27void TRestTrackToDetectorHitsProcess::LoadDefaultConfig() {
28 SetName(
"trackToDetectorHitsProcess");
29 SetTitle(
"Default config");
38 fInputTrackEvent =
nullptr;
42void TRestTrackToDetectorHitsProcess::LoadConfig(
const string& configFilename,
const string& name) {
52 fInputTrackEvent->PrintOnlyTracks();
54 for (
int n = 0; n < fInputTrackEvent->GetNumberOfTracks(); n++)
55 if (fInputTrackEvent->GetLevel(n) == fTrackLevel) {
56 TRestHits* hits = fInputTrackEvent->GetTrack(n)->GetHits();
58 for (
unsigned int h = 0; h < hits->GetNumberOfHits(); h++)
59 fOutputHitsEvent->
AddHit(hits->GetX(h), hits->GetY(h), hits->GetZ(h), hits->GetEnergy(h),
60 hits->GetTime(h), hits->GetType(h));
63 return fOutputHitsEvent;
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 base class for any REST event.
It saves a 3-coordinate position and an energy for each punctual deposition.
@ REST_Debug
+show the defined debug messages
void InitProcess() override
To be executed at the beginning of the run (outside event loop)
TRestEvent * ProcessEvent(TRestEvent *inputEvent) override
Process one event.
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 EndProcess() override
To be executed at the end of the run (outside event loop)
Int_t StringToInteger(std::string in)
Gets an integer from a string.