2424#define _TRestAxionField
2525
2626#include " TRestAxionBufferGas.h"
27+ #include " TRestAxionMagneticField.h"
2728
2829// ! A basic class to define analytical axion-photon conversion calculations for axion helioscopes
2930class TRestAxionField : public TObject {
3031 private:
3132 Bool_t fDebug = false ; // !
3233
33- // / The magnetic field in Teslas
34+ // / The magnetic field in Teslas (used for constant field formulas)
3435 Double_t fBmag = 2.5 ;
3536
36- // / The coherence lenght (in mm) where the magnetic field is defined
37+ // / The coherence lenght (in mm) where the magnetic field is defined (for constant field)
3738 Double_t fLcoh = 10000 ;
3839
3940 // / The energy of the axion in keV
@@ -42,7 +43,16 @@ class TRestAxionField : public TObject {
4243 void Initialize ();
4344
4445 // / A pointer to the buffer gas definition
45- TRestAxionBufferGas* fBufferGas = NULL ; // !
46+ TRestAxionBufferGas* fBufferGas = nullptr ; // !
47+
48+ // / A pointer to the magnetic field definition
49+ TRestAxionMagneticField* fMagneticField = nullptr ; // !
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);
4656
4757 public:
4858 void SetMagneticField (Double_t b) { fBmag = b; }
@@ -62,6 +72,9 @@ class TRestAxionField : public TObject {
6272 // / It assigns a gas buffer medium to the calculation
6373 void AssignBufferGas (TRestAxionBufferGas* buffGas) { fBufferGas = buffGas; }
6474
75+ // / It assigns a magnetic field to the calculation
76+ void AssignMagneticField (TRestAxionMagneticField* mField ) { fMagneticField = mField ; }
77+
6578 // / It assigns a gas buffer medium to the calculation
6679 void SetBufferGas (TRestAxionBufferGas* buffGas) { fBufferGas = buffGas; }
6780
@@ -78,6 +91,21 @@ class TRestAxionField : public TObject {
7891 Double_t GammaTransmissionProbability (std::vector<Double_t> Bmag, Double_t deltaL, Double_t Ea,
7992 Double_t ma, Double_t mg = 0 , Double_t absLength = 0 );
8093
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+
99+ // / Integrand used for axion-photon probability integration
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+
81109 Double_t GammaTransmissionFWHM (Double_t step = 0.00001 );
82110
83111 std::vector<std::pair<Double_t, Double_t>> GetMassDensityScanning (std::string gasName = " He" ,
0 commit comments