REST-for-Physics  v2.3
Rare Event Searches ToolKit for Physics
TRestDetectorHitsToTrackFastProcess.h
1 
12 #ifndef RestCore_TRestDetectorHitsToTrackFastProcess
13 #define RestCore_TRestDetectorHitsToTrackFastProcess
14 
15 #include <TRestDetectorHitsEvent.h>
16 #include <TRestEventProcess.h>
17 #include <TRestTrackEvent.h>
18 #include <TVector3.h>
19 
21  private:
22 #ifndef __CINT__
23  TRestDetectorHitsEvent* fHitsEvent;
24  TRestTrackEvent* fTrackEvent;
25 #endif
26 
27  void InitFromConfigFile() override;
28 
29  void Initialize() override;
30  Int_t FindTracks(TRestHits* hits);
31 
32  protected:
33  // add here the members of your event process
34 
35  Double_t fCellResolution;
36  Double_t fNetSize;
37  TVector3 fNetOrigin;
38  Int_t fNodes;
39 
40  public:
41  RESTValue GetInputEvent() const override { return fHitsEvent; }
42  RESTValue GetOutputEvent() const override { return fTrackEvent; }
43 
44  void InitProcess() override;
45  TRestEvent* ProcessEvent(TRestEvent* inputEvent) override;
46  void EndProcess() override;
47  void LoadDefaultConfig();
48 
49  void LoadConfig(const std::string& configFilename, const std::string& name = "");
50 
51  void PrintMetadata() override {
53 
54  RESTMetadata << " Cell resolution : " << fCellResolution << " mm " << RESTendl;
55  RESTMetadata << " Net size : " << fNetSize << " mm " << RESTendl;
56  RESTMetadata << " Net origin : ( " << fNetOrigin.X() << " , " << fNetOrigin.Y() << " , "
57  << fNetOrigin.Z() << " ) mm " << RESTendl;
58  RESTMetadata << " Number of nodes (per axis) : " << fNodes << RESTendl;
59 
60  EndPrintProcess();
61  }
62 
63  const char* GetProcessName() const override { return "fastHitsToTrack"; }
64 
65  // Constructor
67  TRestDetectorHitsToTrackFastProcess(const char* configFilename);
68  // Destructor
70 
71  ClassDefOverride(TRestDetectorHitsToTrackFastProcess,
72  1); // Template for a REST "event process" class inherited from
73  // TRestEventProcess
74 };
75 #endif
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.
RESTValue GetInputEvent() const override
Get pointer to input event. Must be implemented in the derived class.
void InitFromConfigFile() override
To make settings from rml file. This method must be implemented in the derived class.
void EndProcess() override
To be executed at the end of the run (outside event loop)
void InitProcess() override
To be executed at the beginning of the run (outside event loop)
RESTValue GetOutputEvent() const override
Get pointer to output event. Must be implemented in the derived class.
A base class for any REST event process.
void BeginPrintProcess()
[name, cut range]
A base class for any REST event.
Definition: TRestEvent.h:38
It saves a 3-coordinate position and an energy for each punctual deposition.
Definition: TRestHits.h:39
endl_t RESTendl
Termination flag object for TRestStringOutput.