REST-for-Physics  v2.3
Rare Event Searches ToolKit for Physics
TRestAxionEvent.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 TRestSoft_TRestAxionEvent
24 #define TRestSoft_TRestAxionEvent
25 
26 #include <iostream>
27 
28 #include "TMath.h"
29 #include "TObject.h"
30 #include "TRestEvent.h"
31 #include "TRestSystemOfUnits.h"
32 #include "TVector3.h"
33 
35 class TRestAxionEvent : public TRestEvent {
36  private:
38  TVector3 fPosition; //<
39 
41  TVector3 fDirection; //<
42 
44  Double_t fEnergy = 0; //<
45 
47  Double_t fMass = 0.; //<
48 
50  // std::map<std::string, Double_t> fEfficiencies; //<
51 
52  protected:
53  public:
54  TVector3 GetPosition() { return fPosition; }
55 
56  Double_t GetPositionX() { return fPosition.X(); } // returns value in mm
57  Double_t GetPositionY() { return fPosition.Y(); } // returns value in mm
58  Double_t GetPositionZ() { return fPosition.Z(); } // returns value in mm
59 
60  TVector3 GetDirection() { return fDirection; }
61 
62  Double_t GetDirectionX() { return fDirection.X(); } // returns normalized vector x-component.
63  Double_t GetDirectionY() { return fDirection.Y(); } // returns normalized vector y-component
64  Double_t GetDirectionZ() { return fDirection.Z(); } // returns normalized vector z-component
65 
66  Double_t GetEnergy() { return fEnergy; } // returns value in keV
67  Double_t GetMass() { return fMass; } // returns value in keV
68  Double_t GetMassIneV() { return fMass * units("eV"); } // returns value in eV
69 
70  // Double_t GetEfficiency(std::string name) { return fEfficiencies[name]; }
71 
72  void SetPosition(TVector3 pos) { fPosition = pos; }
73  void SetPosition(Double_t x, Double_t y, Double_t z) { SetPosition(TVector3(x, y, z)); }
74 
75  void Translate(const TVector3& delta);
76 
77  void SetDirection(TVector3 dir) { fDirection = dir; }
78  void SetDirection(Double_t px, Double_t py, Double_t pz) { SetDirection(TVector3(px, py, pz)); }
79 
80  void RotateZX(const TVector3& center, Double_t phi, Double_t theta);
81  void RotateXZ(const TVector3& center, Double_t theta, Double_t phi);
82 
83  void RotateXY(const TVector3& center, Double_t pitch, Double_t yaw);
84  void RotateYX(const TVector3& center, Double_t yaw, Double_t pitch);
85 
86  void SetEnergy(Double_t en) { fEnergy = en; }
87  void SetMass(Double_t m) { fMass = m; }
88 
89  // void AddEfficiency(std::string name, Double_t value) { fEfficiencies[name] = value; }
90 
91  virtual void Initialize();
92 
93  virtual void PrintEvent();
94 
95  TPad* DrawEvent(TString option = "");
96 
98  ~TRestAxionEvent();
99 
100  ClassDef(TRestAxionEvent, 2);
101 };
102 #endif
An event data class to define the parameters related to an axion particle.
void RotateXY(const TVector3 &center, Double_t pitch, Double_t yaw)
This method will produce a rotation respect to a center given by argument. First we rotate the partic...
TVector3 fPosition
Particle position.
void RotateYX(const TVector3 &center, Double_t yaw, Double_t pitch)
This method will produce a rotation respect to a center given by argument. First we rotate the partic...
void RotateXZ(const TVector3 &center, Double_t theta, Double_t phi)
This method will produce a rotation respect to a center given by argument. First we rotate the partic...
virtual void Initialize()
void RotateZX(const TVector3 &center, Double_t phi, Double_t theta)
This method will produce a rotation respect to a center given by argument. First we rotate the partic...
TVector3 GetPosition()
It keeps track of efficiency introduced at different helioscope components.
Double_t fEnergy
Initial energy of the axion.
TVector3 fDirection
Particle momentum. Unitary direction.
void Translate(const TVector3 &delta)
This method will produce a tranlation of the axion position by an amount delta.
Double_t fMass
Axion mass in keV.
A base class for any REST event.
Definition: TRestEvent.h:38