REST-for-Physics  v2.3
Rare Event Searches ToolKit for Physics
Loading...
Searching...
No Matches
TRestAxionAnalysisProcess.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
52#include "TRestAxionAnalysisProcess.h"
53using namespace std;
54
56
61
74 Initialize();
75
76 LoadConfig(cfgFileName);
77}
78
83
88 SetName(this->ClassName());
89 SetTitle("Default config");
90}
91
102void TRestAxionAnalysisProcess::LoadConfig(std::string cfgFilename, std::string name) {
103 if (LoadConfigFromFile(cfgFilename, name)) LoadDefaultConfig();
104}
105
110 SetSectionName(this->ClassName());
111 SetLibraryVersion(LIBRARY_VERSION);
112
114
115 fAxionEvent->Initialize();
116}
117
122 fAxionEvent = (TRestAxionEvent*)evInput;
123
124 RESTDebug << "TRestAxionAnalysisProcess::ProcessEvent : " << fAxionEvent->GetID() << RESTendl;
125
126 SetObservableValue("energy", fAxionEvent->GetEnergy());
127 SetObservableValue("mass", fAxionEvent->GetMass() * units("eV"));
128
129 Double_t x = fAxionEvent->GetPosition().X() - fAnalysisPosition.X();
130 Double_t y = fAxionEvent->GetPosition().Y() - fAnalysisPosition.Y();
131 SetObservableValue("posX", x);
132 SetObservableValue("posY", y);
133 SetObservableValue("posZ", fAxionEvent->GetPosition().Z());
134
136 Double_t r = TMath::Sqrt(x * x + y * y);
137 SetObservableValue("R", r);
138
139 SetObservableValue("thetaAngle", fAxionEvent->GetDirection().Theta());
140 SetObservableValue("phiAngle", fAxionEvent->GetDirection().Phi());
141
143
144 return fAxionEvent;
145}
An analyis process to add TRestAxionEvent observables to the analysis tree.
TRestEvent * ProcessEvent(TRestEvent *evInput) override
The main processing event function.
void LoadDefaultConfig()
Function to load the default config in absence of RML input.
~TRestAxionAnalysisProcess()
Default destructor.
void LoadConfig(std::string cfgFilename, std::string name="")
Function to load the configuration from an external configuration file.
TVector3 fAnalysisPosition
The analysis position in mm with regards to the sun at (0,0,-AU).
void Initialize() override
Function to initialize input/output event members and define the section name.
TRestAxionAnalysisProcess()
Default constructor.
TRestAxionEvent * fAxionEvent
A pointer to the specific TRestAxionEvent.
An event data class to define the parameters related to an axion particle.
void SetObservableValue(const std::string &name, const T &value)
Set observable value for AnalysisTree.
A base class for any REST event.
Definition TRestEvent.h:38
endl_t RESTendl
Termination flag object for TRestStringOutput.
Int_t LoadConfigFromFile(const std::string &configFilename, const std::string &sectionName="")
Give the file name, find out the corresponding section. Then call the main starter.
void SetLibraryVersion(TString version)
Set the library version of this metadata class.
TRestStringOutput::REST_Verbose_Level GetVerboseLevel()
returns the verboselevel in type of REST_Verbose_Level enumerator
void SetSectionName(std::string sName)
set the section name, clear the section content
@ REST_Debug
+show the defined debug messages