REST-for-Physics  v2.3
Rare Event Searches ToolKit for Physics
Loading...
Searching...
No Matches
TRestAxionOpticsProcess.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#include "TRestAxionOpticsProcess.h"
41using namespace std;
42
44
49
62 Initialize();
63
64 LoadConfig(cfgFileName);
65}
66
71
76 SetName(this->ClassName());
77 SetTitle("Default config");
78}
79
90void TRestAxionOpticsProcess::LoadConfig(std::string cfgFilename, std::string name) {
91 if (LoadConfigFromFile(cfgFilename, name)) LoadDefaultConfig();
92}
93
98 SetSectionName(this->ClassName());
99 SetLibraryVersion(LIBRARY_VERSION);
100
102}
103
109 RESTDebug << "Entering ... TRestAxionGeneratorProcess::InitProcess" << RESTendl;
110
112
113 if (fOptics) {
114 fOptics->PrintMetadata();
115 } else {
116 RESTError << "TRestAxionOptics::InitProcess. No sucess instantiating optics." << RESTendl;
117 }
118}
119
124 fAxionEvent = (TRestAxionEvent*)evInput;
125
126 TVector3 inPos = fAxionEvent->GetPosition();
127 TVector3 inDir = fAxionEvent->GetDirection();
128 Double_t energy = fAxionEvent->GetEnergy();
129
131 Double_t efficiency = fOptics->PropagatePhoton(inPos, inDir, energy);
132
133 SetObservableValue("efficiency", efficiency);
134
135 RESTDebug << "Optics efficiency: " << efficiency << RESTendl;
136
137 // We register the event even if it is not properly reflected, i.e. efficiency = 0
138 fAxionEvent->SetPosition(fOptics->GetLastGoodPosition());
139 fAxionEvent->SetDirection(fOptics->GetLastGoodDirection());
140
142
144 fAxionEvent->PrintEvent();
145
147 }
148
149 return fAxionEvent;
150}
TRestAxionEvent * fAxionEvent
A pointer to the specific TRestAxionEvent.
An event data class to define the parameters related to an axion particle.
A process to introduce the response from optics in the axion signal generation chain.
void Initialize() override
Function to initialize input/output event members and define the section name.
void LoadDefaultConfig()
Function to load the default config in absence of RML input.
TRestEvent * ProcessEvent(TRestEvent *evInput) override
The main processing event function.
TRestAxionOpticsProcess()
Default constructor.
void InitProcess() override
Process initialization. Data members that require initialization just before start processing should ...
TRestAxionOptics * fOptics
A pointer to the optics description defined inside TRestRun.
void LoadConfig(std::string cfgFilename, std::string name="")
Function to load the configuration from an external configuration file.
~TRestAxionOpticsProcess()
Default destructor.
T * GetMetadata()
Get a metadata object from the host TRestRun.
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
Int_t GetChar(std::string hint="Press a KEY to continue ...")
Helps to pause the program, printing a message before pausing.