REST-for-Physics  v2.3
Rare Event Searches ToolKit for Physics
TRestAxionField.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 _TRestAxionField
24#define _TRestAxionField
25
26#include "TRestAxionBufferGas.h"
27#include "TRestAxionMagneticField.h"
28
30class TRestAxionField : public TObject {
31 private:
32 Bool_t fDebug = false;
33
35 Double_t fBmag = 2.5;
36
38 Double_t fLcoh = 10000;
39
41 Double_t fEa = 4.2;
42
43 void Initialize();
44
47
50
51 std::pair<Double_t, Double_t> ComputeOffResonanceIntegral(Double_t q, Double_t Gamma, Double_t accuracy,
52 Int_t num_intervals, Int_t qawo_levels);
53
54 std::pair<Double_t, Double_t> ComputeResonanceIntegral(Double_t Gamma, Double_t accuracy,
55 Int_t num_intervals);
56
57 public:
58 void SetMagneticField(Double_t b) { fBmag = b; }
59 void SetCoherenceLength(Double_t l) { fLcoh = l; }
60 void SetAxionEnergy(Double_t e) { fEa = e; }
61
62 Double_t GetMagneticField() const { return fBmag; }
63 Double_t GetCoherenceLength() const { return fLcoh; }
64 Double_t GetAxionEnergy() const { return fEa; }
65
66 Double_t BL(Double_t Bmag, Double_t Lcoh);
67 Double_t BLHalfSquared(Double_t Bmag, Double_t Lcoh);
68
70 void SetDebug(Bool_t v) { fDebug = v; }
71
73 void AssignBufferGas(TRestAxionBufferGas* buffGas) { fBufferGas = buffGas; }
74
77
79 void SetBufferGas(TRestAxionBufferGas* buffGas) { fBufferGas = buffGas; }
80
81 Double_t GammaTransmissionProbability(Double_t ma, Double_t mg = 0, Double_t absLength = 0);
82
83 Double_t GammaTransmissionProbability(Double_t Bmag, Double_t Lcoh, Double_t Ea, Double_t ma,
84 Double_t mg = 0, Double_t absLength = 0);
85
86 Double_t AxionAbsorptionProbability(Double_t ma, Double_t mg = 0, Double_t absLength = 0);
87
88 Double_t AxionAbsorptionProbability(Double_t Bmag, Double_t Lcoh, Double_t Ea, Double_t ma,
89 Double_t mg = 0, Double_t absLength = 0);
90
91 Double_t GammaTransmissionProbability(std::vector<Double_t> Bmag, Double_t deltaL, Double_t Ea,
92 Double_t ma, Double_t mg = 0, Double_t absLength = 0);
93
94 std::pair<Double_t, Double_t> GammaTransmissionFieldMapProbability(Double_t Ea, Double_t ma,
95 Double_t accuracy = 1.e-1,
96 Int_t num_intervals = 100,
97 Int_t qawo_levels = 20);
98
100 static double Integrand(double x, void* params) {
101 auto* data = reinterpret_cast<std::pair<TRestAxionMagneticField*, double>*>(params);
102
103 TRestAxionMagneticField* field = data->first;
104 double gamma = data->second;
105
106 return exp(0.5 * gamma * x) * field->GetTransversalComponentInParametricTrack(x);
107 }
108
109 Double_t GammaTransmissionFWHM(Double_t step = 0.00001);
110
111 std::vector<std::pair<Double_t, Double_t>> GetMassDensityScanning(std::string gasName = "He",
112 Double_t maMax = 0.15,
113 Double_t rampDown = 5.0);
114
117
118 ClassDef(TRestAxionField, 2);
119};
120#endif
A metadata class to define the gas properties used in axion search calculations.
A basic class to define analytical axion-photon conversion calculations for axion helioscopes.
std::pair< Double_t, Double_t > GammaTransmissionFieldMapProbability(Double_t Ea, Double_t ma, Double_t accuracy=1.e-1, Int_t num_intervals=100, Int_t qawo_levels=20)
Performs the calculation of axion-photon conversion probability using directly equation (28) from J....
Double_t BL(Double_t Bmag, Double_t Lcoh)
Performs the calculation of (BL) factor in natural units.
Double_t AxionAbsorptionProbability(Double_t ma, Double_t mg=0, Double_t absLength=0)
Performs the calculation of axion-photon absorption probability using directly equation (18) from van...
void Initialize()
Initialization of TRestAxionField class.
static double Integrand(double x, void *params)
Integrand used for axion-photon probability integration.
void SetBufferGas(TRestAxionBufferGas *buffGas)
It assigns a gas buffer medium to the calculation.
Double_t GammaTransmissionProbability(Double_t ma, Double_t mg=0, Double_t absLength=0)
Performs the calculation of axion-photon conversion probability using directly equation (11) from van...
void AssignBufferGas(TRestAxionBufferGas *buffGas)
It assigns a gas buffer medium to the calculation.
~TRestAxionField()
Default destructor.
void SetDebug(Bool_t v)
It enables/disables debug mode.
void AssignMagneticField(TRestAxionMagneticField *mField)
It assigns a magnetic field to the calculation.
Double_t BLHalfSquared(Double_t Bmag, Double_t Lcoh)
Performs the calculation of (BL/2)^2 factor in natural units.
Double_t fEa
The energy of the axion in keV.
std::vector< std::pair< Double_t, Double_t > > GetMassDensityScanning(std::string gasName="He", Double_t maMax=0.15, Double_t rampDown=5.0)
This method determines the proper densities to be used in an axion helioscope experiment in order to ...
std::pair< Double_t, Double_t > ComputeOffResonanceIntegral(Double_t q, Double_t Gamma, Double_t accuracy, Int_t num_intervals, Int_t qawo_levels)
Performs the calculation of axion-photon conversion probability using directly equation (28) from J....
TRestAxionMagneticField * fMagneticField
A pointer to the magnetic field definition.
TRestAxionBufferGas * fBufferGas
A pointer to the buffer gas definition.
Double_t fBmag
The magnetic field in Teslas (used for constant field formulas)
Double_t fLcoh
The coherence lenght (in mm) where the magnetic field is defined (for constant field)
TRestAxionField()
Default constructor.
Double_t GammaTransmissionFWHM(Double_t step=0.00001)
Performs the calculation of the FWHM for the axion-photon conversion probability computed in TRestAxi...
std::pair< Double_t, Double_t > ComputeResonanceIntegral(Double_t Gamma, Double_t accuracy, Int_t num_intervals)
Performs the calculation of axion-photon conversion probability using directly equation (28) from J....
A class to load magnetic field maps and evaluate the field on those maps including interpolation.
Double_t GetTransversalComponentInParametricTrack(Double_t x)
It will return the transversal magnetic field component evaluated at a parametric distance x (given b...