REST-for-Physics  v2.3
Rare Event Searches ToolKit for Physics
Loading...
Searching...
No Matches
TRestAxionFieldPropagationProcess.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
117#include "TRestAxionFieldPropagationProcess.h"
118
119#include <TVectorD.h>
120
121#include <numeric>
122using namespace std;
123
125
130
143
148
153 SetSectionName(this->ClassName());
154 SetLibraryVersion(LIBRARY_VERSION);
155
157}
158
164 RESTDebug << "Entering ... TRestAxionFieldPropagationProcess::InitProcess" << RESTendl;
165
166 fMagneticField = (TRestAxionMagneticField*)this->GetMetadata("TRestAxionMagneticField");
167
168 if (!fMagneticField) {
169 RESTError << "TRestAxionFieldPropagationprocess. Magnetic Field was not defined!" << RESTendl;
170 exit(0);
171 }
172
173 for (size_t n = 0; n < fMagneticField->GetNumberOfVolumes(); n++) fMagneticField->ReMap(n, fReMap);
174
175 if (!fAxionField) {
177
178 fBufferGas = (TRestAxionBufferGas*)this->GetMetadata("TRestAxionBufferGas");
179 if (fBufferGas)
180 fAxionField->AssignBufferGas(fBufferGas);
181 else
183
184 fAxionField->AssignMagneticField(fMagneticField);
186 fMagneticField->PrintMetadata();
187 }
188
189 RESTDebug << "Axion-field : " << fAxionField << RESTendl;
190 RESTDebug << "Buffer gas : " << fBufferGas << RESTendl;
191 RESTDebug << "Magnetic field : " << fMagneticField << RESTendl;
192}
193
195 fAxionEvent = (TRestAxionEvent*)evInput;
196
197 RESTDebug << "TRestAxionFieldPropagationProcess::ProcessEvent : " << fAxionEvent->GetID() << RESTendl;
198
199 fMagneticField->SetTrack(fAxionEvent->GetPosition(), fAxionEvent->GetDirection());
200
201 Double_t Ea = fAxionEvent->GetEnergy();
202 Double_t ma = fAxionEvent->GetMass() * units("eV");
203
204 std::pair<Double_t, Double_t> prob =
205 fAxionField->GammaTransmissionFieldMapProbability(Ea, ma, fAccuracy, fNumIntervals, fQawoLevels);
206
207 SetObservableValue("probability", prob.first);
208 SetObservableValue("error", prob.second);
209
210 Double_t transmission = 1;
212 Double_t Gamma = fBufferGas->GetPhotonAbsorptionLength(Ea); // cm-1
213 Double_t GammaL = Gamma * fBufferGasAdditionalLength * units("cm");
214 transmission = exp(-GammaL);
215 }
216
217 SetObservableValue("transmission", transmission);
218
219 RESTDebug << " --- Process observables: " << RESTendl;
220 RESTDebug << "Probability: " << prob.first << " T" << RESTendl;
221 RESTDebug << "Error: " << prob.second << " T" << RESTendl;
222 RESTDebug << "Transmission: " << transmission << " mm" << RESTendl;
223
225
229
230 return fAxionEvent;
231}
A metadata class to define the gas properties used in axion search calculations.
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 magnetic field profile integration along the track.
Int_t fNumIntervals
Number of intervales used by the GSL integrator.
TRestEvent * ProcessEvent(TRestEvent *eventInput) override
Process one event.
void InitProcess() override
Process initialization. Data members that require initialization just before start processing should ...
TRestAxionField * fAxionField
A pointer to TRestAxionField that implements probability calculations.
TVector3 fReMap
It will re-size the cells in the magnetic field (affecting the time required for integral computation...
TRestAxionBufferGas * fBufferGas
A pointer to TRestBufferGas given to TRestAxionField to perform calculations in a particular gas.
Double_t fAccuracy
The tolerance or accuracy used inside the GSL integrator.
Int_t fQawoLevels
Number of levels used by the GSL integrator to parameterize the cosine integral.
Double_t fBufferGasAdditionalLength
The additional length in mm that the converted photon propagates without magnetic field.
TRestAxionMagneticField * fMagneticField
A pointer to the magnetic field description stored in TRestRun.
void Initialize() override
Function to initialize input/output event members and define the section name.
A basic class to define analytical axion-photon conversion calculations for axion helioscopes.
A class to load magnetic field maps and evaluate the field on those maps including interpolation.
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.
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_Info
+show most of the information for each steps
@ REST_Debug
+show the defined debug messages