REST-for-Physics  v2.3
Rare Event Searches ToolKit for Physics
TRestAxionEventProcess.cxx
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 
40 
41 #include "TRestAxionEventProcess.h"
42 
43 using namespace std;
44 
45 ClassImp(TRestAxionEventProcess);
46 
50 TRestAxionEventProcess::TRestAxionEventProcess() { fSingleThreadOnly = false; }
51 
56 
66 
67  fAxionEvent = (TRestAxionEvent*)inEv;
68  RESTDebug << "BoEP: Initial Position. X: " << fAxionEvent->GetPosition().X()
69  << " Y: " << fAxionEvent->GetPosition().Y() << " Z: " << fAxionEvent->GetPosition().Z()
70  << RESTendl;
71  RESTDebug << "BoEP: Initial Direction. X: " << fAxionEvent->GetDirection().X()
72  << " Y: " << fAxionEvent->GetDirection().Y() << " Z: " << fAxionEvent->GetDirection().Z()
73  << RESTendl;
74  fAxionEvent->RotateYX(fPosition, fInternalYaw, fInternalPitch);
75  fAxionEvent->RotateYX(fExternalRotationCenter, fExternalYaw, fExternalPitch);
76  fAxionEvent->Translate(TVector3(-fPosition.X(), -fPosition.Y(), -fPosition.Z()));
77  RESTDebug << " ---- " << RESTendl;
78  RESTDebug << "BoEP: Final Position. X: " << fAxionEvent->GetPosition().X()
79  << " Y: " << fAxionEvent->GetPosition().Y() << " Z: " << fAxionEvent->GetPosition().Z()
80  << RESTendl;
81  RESTDebug << "BoEP: Final Direction. X: " << fAxionEvent->GetDirection().X()
82  << " Y: " << fAxionEvent->GetDirection().Y() << " Z: " << fAxionEvent->GetDirection().Z()
83  << RESTendl;
84  RESTDebug << " ++++ " << RESTendl;
85 }
86 
93 
94  RESTDebug << "EoEP: Initial Position. X: " << fAxionEvent->GetPosition().X()
95  << " Y: " << fAxionEvent->GetPosition().Y() << " Z: " << fAxionEvent->GetPosition().Z()
96  << RESTendl;
97  RESTDebug << "EoEP: Initial Direction. X: " << fAxionEvent->GetDirection().X()
98  << " Y: " << fAxionEvent->GetDirection().Y() << " Z: " << fAxionEvent->GetDirection().Z()
99  << RESTendl;
100  RESTDebug << " ---- " << RESTendl;
101  fAxionEvent->Translate(TVector3(fPosition.X(), fPosition.Y(), fPosition.Z()));
102  if (fLocalAxis) {
103  fAxionEvent->RotateXY(fExternalRotationCenter, -fExternalPitch, -fExternalYaw);
104  fAxionEvent->RotateXY(fPosition, -fInternalPitch, -fInternalYaw);
105  }
106  RESTDebug << "EoEP: Final Position. X: " << fAxionEvent->GetPosition().X()
107  << " Y: " << fAxionEvent->GetPosition().Y() << " Z: " << fAxionEvent->GetPosition().Z()
108  << RESTendl;
109  RESTDebug << "EoEP: Final Direction. X: " << fAxionEvent->GetDirection().X()
110  << " Y: " << fAxionEvent->GetDirection().Y() << " Z: " << fAxionEvent->GetDirection().Z()
111  << RESTendl;
112  RESTDebug << " ++++ " << RESTendl;
113 }
114 
123 
124  RESTMetadata << "Position: (" << fPosition.X() << ", " << fPosition.Y() << ", " << fPosition.Z() << ") mm"
125  << RESTendl;
126  RESTMetadata << " " << RESTendl;
127  RESTMetadata << "Internal Yaw angle (Y-axis): " << fInternalYaw * units("degrees") << " degrees"
128  << RESTendl;
129  RESTMetadata << "Internal Pitch angle (X-axis): " << fInternalPitch * units("degrees") << " degrees"
130  << RESTendl;
131  RESTMetadata << " " << RESTendl;
132  RESTMetadata << "External rotation center: (" << fExternalRotationCenter.X() << ", "
133  << fExternalRotationCenter.Y() << ", " << fExternalRotationCenter.Z() << ") mm" << RESTendl;
134  RESTMetadata << "External Yaw angle (Y-axis): " << fExternalYaw * units("degrees") << " degrees"
135  << RESTendl;
136  RESTMetadata << "External Pitch angle (X-axis): " << fExternalPitch * units("degrees") << " degrees"
137  << RESTendl;
138  RESTMetadata << " " << RESTendl;
139  if (fLocalAxis)
140  RESTMetadata << "Local axis is true " << RESTendl;
141  else
142  RESTMetadata << "Universal axis is true " << RESTendl;
143  RESTMetadata << " --------------------------- " << RESTendl;
144  RESTMetadata << " " << RESTendl;
145 }
146 
150 void TRestAxionEventProcess::EndPrintProcess() { TRestEventProcess::EndPrintProcess(); }
A base class for any axion event process. Defines position, rotation and component displacement.
void BeginPrintProcess()
Pre-defined printer, can be used at the beginning in the implementation of PrintMetadata()
virtual void EndOfEventProcess(TRestEvent *evInput=nullptr) override
End of event process. Called directly after ProcessEvent()
virtual void BeginOfEventProcess(TRestEvent *evInput=nullptr) override
Begin of event process, preparation work. Called right before ProcessEvent()
void EndPrintProcess()
Adds the footer for PrintMetadata.
An event data class to define the parameters related to an axion particle.
virtual void EndOfEventProcess(TRestEvent *inputEvent=nullptr)
End of event process. Nothing to do. Called directly after ProcessEvent()
void BeginPrintProcess()
[name, cut range]
virtual void BeginOfEventProcess(TRestEvent *inputEvent=nullptr)
Begin of event process, preparation work. Called right before ProcessEvent()
A base class for any REST event.
Definition: TRestEvent.h:38