REST-for-Physics  v2.3
Rare Event Searches ToolKit for Physics
TRestWimpSensitivity.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 RestCore_TRestWimpSensitivity
24#define RestCore_TRestWimpSensitivity
25
26#include <TH1D.h>
27#include <TRestMetadata.h>
28#include <TRestWimpNucleus.h>
29
33 private:
35 std::vector<TRestWimpNucleus> fNuclei;
37 Double_t fWimpDensity = 0.3;
39 Double_t fLabVelocity = 232;
41 Double_t fEscapeVelocity = 544;
43 Double_t fRmsVelocity = 220;
45 Double_t fExposure = 365. * 0.32;
47 Double_t fBackground = 1;
48 // TODO add option to use a histogram for the spectra
50 TVector2 fEnergySpectra = TVector2(0, 2);
52 Double_t fEnergySpectraStep = 0.01;
54 TVector2 fEnergyRange = TVector2(0.1, 1.1);
56 Bool_t fUseQuenchingFactor = true;
57
59 std::map<std::string, TH1D*> quenchingFactor;
60
61 public:
62 TRestWimpSensitivity(const char* configFilename, const std::string& name = "");
63
65
66 void Initialize() override;
67 void InitFromConfigFile() override;
68 void PrintMetadata() override;
69
70 void ReadNuclei();
71 const Double_t GetSensitivity(const double wimpMass);
73 bool isEnergySpectraWideEnough();
74 const std::string BuildOutputFileName(const std::string& extension = ".txt");
75
76 std::map<std::string, TH1D*> GetRecoilSpectra(const double wimpMass, const double crossSection);
77 std::map<std::string, TH1D*> GetFormFactor();
78 inline auto GetQuenchingFactor() { return quenchingFactor; }
79 inline std::vector<TRestWimpNucleus>& GetNuclei() { return fNuclei; };
80 inline auto GetEnergySpectra() { return fEnergySpectra; }
81 inline auto GetEnergySpectraStep() { return fEnergySpectraStep; }
82 inline auto GetEnergyRange() { return fEnergyRange; }
83 inline auto GetWimpDensity() { return fWimpDensity; }
84 inline auto GetLabVelocity() { return fLabVelocity; }
85 inline auto GetEscapeVelocity() { return fEscapeVelocity; }
86 inline auto GetRmsVelocity() { return fRmsVelocity; }
87 inline auto GetExposure() { return fExposure; }
88 inline auto GetBackground() { return fBackground; }
89 inline auto GetUseQuenchingFactor() { return fUseQuenchingFactor; }
90
91 void SetNuclei(const std::vector<TRestWimpNucleus>& nuclei) { fNuclei = nuclei; }
92 void SetEnergySpectra(const TVector2& energySpectra) { fEnergySpectra = energySpectra; }
93 void SetEnergySpectraStep(const Double_t energySpectraStep) { fEnergySpectraStep = energySpectraStep; }
94 void SetEnergyRange(const TVector2& energyRange) { fEnergyRange = energyRange; }
95 void SetWimpDensity(const Double_t wimpDensity) { fWimpDensity = wimpDensity; }
96 void SetLabVelocity(const Double_t labVelocity) { fLabVelocity = labVelocity; }
97 void SetEscapeVelocity(const Double_t escapeVelocity) { fEscapeVelocity = escapeVelocity; }
98 void SetRmsVelocity(const Double_t rmsVelocity) { fRmsVelocity = rmsVelocity; }
99 void SetExposure(const Double_t exposure) { fExposure = exposure; }
100 void SetBackground(const Double_t background) { fBackground = background; }
101 void SetUseQuenchingFactor(const Bool_t useQuenchingFactor) { fUseQuenchingFactor = useQuenchingFactor; }
102
103 ClassDefOverride(TRestWimpSensitivity, 1);
104};
105
106#endif
A base class for any REST metadata class.
Definition: TRestMetadata.h:74
void Initialize() override
Initialization of TRestWimpSensitivity members.
Double_t fExposure
Detector exposure in kg*day.
~TRestWimpSensitivity()
Default destructor.
void InitFromConfigFile() override
Initialization of TRestWimpSensitivity members through a RML file.
std::map< std::string, TH1D * > GetRecoilSpectra(const double wimpMass, const double crossSection)
Get recoil spectra for a given WIMP mass and cross section Better performance version (velocity integ...
Double_t fEscapeVelocity
WIMP escape velocity (km/s)
TVector2 fEnergySpectra
Energy range for the recoil spectra in keV.
Double_t fEnergySpectraStep
Energy step for the recoil spectra in keV.
void PrintMetadata() override
Prints on screen the details about WIMP parameters, stored in TRestWimpSensitivity.
const Double_t GetSensitivity(const double wimpMass)
Get sensitivity for a give WIMP mass.
TVector2 fEnergyRange
Energy range for the sensitivity prospects in keV.
Double_t fBackground
Detector background level in c/keV/day.
std::map< std::string, TH1D * > quenchingFactor
Map containing quenching factor for a nucleus.
void CalculateQuenchingFactor()
Calculate Quenching factor and stores in a map.
Bool_t fUseQuenchingFactor
Use or not quenching factor.
Double_t fRmsVelocity
WIMP RMS velocity (km/s)
Double_t fWimpDensity
WIMP density in GeV/cm3.
Double_t fLabVelocity
WIMP velocity in the lab (Earth) frame reference in km/s.
void ReadNuclei()
Initialization of TRestWimpSensitivity members through a RML file.
TRestWimpSensitivity(const char *configFilename, const std::string &name="")
Constructor loading data from a config file.
std::map< std::string, TH1D * > GetFormFactor()
Return a map of histograms with the Form Factor of the different elements.
const std::string BuildOutputFileName(const std::string &extension=".txt")
Return output file format with different parameters used in the calculation.
std::vector< TRestWimpNucleus > fNuclei
A vector containing TRestWimpNucleus with different nucleus parameters.