REST-for-Physics  v2.3
Rare Event Searches ToolKit for Physics
TRestAxionBufferGas.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 _TRestAxionBufferGas
24 #define _TRestAxionBufferGas
25 
26 #include <TRestMetadata.h>
27 
30  private:
31  void Initialize();
32 
33  void InitFromConfigFile();
34 
36  std::vector<TString> fBufferGasName; //->
37 
39  std::vector<Double_t> fBufferGasDensity; //->
40 
42  std::vector<std::vector<Double_t> > fAbsEnergy; //->
43 
45  std::vector<std::vector<Double_t> > fGasAbsCoefficient; //->
46 
48  std::vector<std::vector<Double_t> > fFactorEnergy; //->
49 
51  std::vector<std::vector<Double_t> > fGasFormFactor; //->
52 
53  void ReadGasData(TString gasName);
54 
55  Int_t FindGasIndex(TString gName);
56  Int_t GetEnergyIndex(std::vector<Double_t> enVector, Double_t energy);
57 
58  public:
59  void SetGasDensity(TString gasName, Double_t density);
60  Double_t GetGasDensity(TString gasName);
61 
62  void SetGasMixture(TString gasMixture, TString gasDensities = "0");
63 
65  Int_t GetNumberOfGases() { return (Int_t)fBufferGasName.size(); }
66 
67  Double_t GetAbsorptionCoefficient(TString gasName, Double_t energy);
68  Double_t GetFormFactor(TString gasName, Double_t energy);
69 
70  Double_t GetPhotonAbsorptionLength(Double_t energy);
71 
72  Double_t GetPhotonAbsorptionLengthIneV(Double_t energy);
73 
74  Double_t cmToeV(double l_Inv);
75 
76  Double_t GetPhotonMass(double en);
77 
78  Double_t GetDensityForMass(double m_gamma, double en = 4.2);
79 
80  void PrintAbsorptionGasData(TString gasName);
81  void PrintFormFactorGasData(TString gasName);
82 
83  void PrintMetadata();
84 
86  TRestAxionBufferGas(const char* cfgFileName, std::string name = "");
87 
89 
90  ClassDef(TRestAxionBufferGas, 1);
91 };
92 #endif
A metadata class to define the gas properties used in axion search calculations.
TRestAxionBufferGas()
Default constructor.
Int_t GetNumberOfGases()
It returns the number of gases in the mixture.
void Initialize()
Initialization of TRestAxionBufferGas members. It removes all gases.
void InitFromConfigFile()
Initialization of TRestAxionBufferGas field members through a RML file.
void PrintMetadata()
Prints on screen the information about the metadata members of TRestAxionBufferGas.
Double_t cmToeV(double l_Inv)
It transforms cm-1 to eV.
std::vector< std::vector< Double_t > > fGasFormFactor
Gas form factor.
void PrintFormFactorGasData(TString gasName)
Prints out the atomic form factors as function of the energy for the given gas component,...
std::vector< std::vector< Double_t > > fGasAbsCoefficient
Gas absorption coefficient in cm2/g.
Int_t GetEnergyIndex(std::vector< Double_t > enVector, Double_t energy)
It returns the vector element index, from enVector, that is just below the given input energy.
Double_t GetPhotonMass(double en)
It returns the equivalent photon mass (in eV) for the gas mixture at the given input energy expressed...
std::vector< std::vector< Double_t > > fFactorEnergy
Energy values for gas form factor in keV.
std::vector< Double_t > fBufferGasDensity
Gas density of the corresponding gasName in g/cm3.
Double_t GetGasDensity(TString gasName)
It returns the gas density - from the chosen gasName component - in g/cm3.
void ReadGasData(TString gasName)
It reads the data files from the corresponding gas component.
Double_t GetDensityForMass(double m_gamma, double en=4.2)
It returns the equivalent gas density for a given photon mass expressed in eV and a given axion energ...
void SetGasDensity(TString gasName, Double_t density)
It adds a new gas component to the mixture. If it already exists it will update its density.
Int_t FindGasIndex(TString gName)
It returns the internal index of the gas component given by gasName.
std::vector< TString > fBufferGasName
Name of the buffer gas (He, Ne, Ar, Xe, ..., etc )
void PrintAbsorptionGasData(TString gasName)
Prints out the absorption coefficients as function of the energy for the given gas component,...
Double_t GetPhotonAbsorptionLengthIneV(Double_t energy)
It returns the inverse of the absorption lenght, for the gas mixture, in eV, for the given energy in ...
void SetGasMixture(TString gasMixture, TString gasDensities="0")
It re-initializes the gas mixture to the one provided by argument.
std::vector< std::vector< Double_t > > fAbsEnergy
Energy values for gas absorption coefficient in keV.
Double_t GetAbsorptionCoefficient(TString gasName, Double_t energy)
It returns the absorption coefficient, in cm2/g, for the given gas component and energy in keV.
Double_t GetFormFactor(TString gasName, Double_t energy)
It returns the atomic form factor of the gasName component at the given energy.
Double_t GetPhotonAbsorptionLength(Double_t energy)
It returns the inverse of the absorption lenght, for the gas mixture, in cm-1, for the given energy i...
~TRestAxionBufferGas()
Default destructor.
A base class for any REST metadata class.
Definition: TRestMetadata.h:74