REST-for-Physics  v2.3
Rare Event Searches ToolKit for Physics
TRestDetectorHitmapAnalysisProcess.h
1/*************************************************************************
2 * This file is part of the REST software framework. *
3 * *
4 * Copyright (C) 2016 GIFNA/TREX (University of Zaragoza) *
5 * For more information see http://gifna.unizar.es/trex *
6 * *
7 * REST is free software: you can redistribute it and/or modify *
8 * it under the terms of the GNU General Public License as published by *
9 * the Free Software Foundation, either version 3 of the License, or *
10 * (at your option) any later version. *
11 * *
12 * REST is distributed in the hope that it will be useful, *
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15 * GNU General Public License for more details. *
16 * *
17 * You should have a copy of the GNU General Public License along with *
18 * REST in $REST_PATH/LICENSE. *
19 * If not, see http://www.gnu.org/licenses/. *
20 * For the list of contributors see $REST_PATH/CREDITS. *
21 *************************************************************************/
22
23#ifndef RestCore_TRestDetectorHitmapAnalysisProcess
24#define RestCore_TRestDetectorHitmapAnalysisProcess
25
26#include <TRestDetectorHitsEvent.h>
27
28#include "TRestEventProcess.h"
29
33 TVector3 position = {0, 0, 0};
34
36 TVector3 vector = {0, 0, 1};
37
39 Double_t angle = 0;
40
42 std::string type = "";
43
45 std::string name = "";
46};
47
50 private:
53
54 void InitFromConfigFile() override;
55
56 void Initialize() override;
57
58 protected:
60 std::vector<HitTransformation> fTransDefinitions;
61
63 std::vector<std::string> fTransformations;
64
66 HitTransformation GetTransformation(const std::string& name);
67
68 TVector3 Specular(const TVector3& pos, const HitTransformation& tr);
69 TVector3 Rotation(const TVector3& pos, const HitTransformation& tr);
70 TVector3 Translation(const TVector3& pos, const HitTransformation& tr);
71
72 public:
73 RESTValue GetInputEvent() const override { return fHitsEvent; }
74 RESTValue GetOutputEvent() const override { return fHitsEvent; }
75
76 TRestEvent* ProcessEvent(TRestEvent* inputEvent) override;
77
78 void PrintMetadata() override;
79
80 const char* GetProcessName() const override { return "hitsTransformation"; }
81
83 TRestDetectorHitmapAnalysisProcess(const char* configFilename);
85
86 ClassDefOverride(TRestDetectorHitmapAnalysisProcess, 1);
87};
88#endif
An analysis process to apply rotation/translation/specular to mean hit positions.
std::vector< HitTransformation > fTransDefinitions
A list of transformations that can be applied to the mean positions.
TVector3 Specular(const TVector3 &pos, const HitTransformation &tr)
It performs a specular transformation of the given pos in the argument and the transformation propert...
HitTransformation GetTransformation(const std::string &name)
It returns the transformation with a given name.
RESTValue GetOutputEvent() const override
Get pointer to output event. Must be implemented in the derived class.
void Initialize() override
Function to initialize input/output event members and define the section name.
RESTValue GetInputEvent() const override
Get pointer to input event. Must be implemented in the derived class.
TRestDetectorHitsEvent * fHitsEvent
A pointer to the specific TRestDetectorHitsEvent input.
TVector3 Translation(const TVector3 &pos, const HitTransformation &tr)
It performs a translation of the given pos in the argument and the transformation properties stored i...
std::vector< std::string > fTransformations
An ordered list with the names of transformations that will be applied.
TVector3 Rotation(const TVector3 &pos, const HitTransformation &tr)
It performs a rotation of the given pos in the argument and the transformation properties stored in t...
TRestEvent * ProcessEvent(TRestEvent *inputEvent) override
The main processing event function.
void PrintMetadata() override
Prints out the metadata member values.
void InitFromConfigFile() override
A custom initalization from a config file.
A base class for any REST event process.
A base class for any REST event.
Definition: TRestEvent.h:38
A structure to define a given hit transformation.
TVector3 vector
The translation vector, the axis of rotation or the specular plane normal.
std::string name
A given name that allows to place an order to the transformations.
TVector3 position
The center of rotation or a point contained in the specular plane.
std::string type
The type of transformation (specular/rotation/translation)
Double_t angle
The angle of rotation.