REST-for-Physics  v2.3
Rare Event Searches ToolKit for Physics
TRestAxionXrayWindow.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 _TRestAxionXrayWindow
24#define _TRestAxionXrayWindow
25
26#include <TRestMetadata.h>
27#include <TRestPatternMask.h>
28
31 private:
33 Double_t fThickness = 0.0; //<
34
36 std::string fMaterial = "Vacuum"; //<
37
39 TRestPatternMask* fMask = nullptr; //<
40
42 std::vector<Double_t> fEnergy;
43
45 std::vector<Double_t> fTransmission;
46
47 void Initialize();
48
49 void ReadMaterial();
50
51 Bool_t HitsPattern(Double_t x, Double_t y);
52
53 Int_t GetEnergyIndex(Double_t energy);
54
55 public:
56 Double_t GetWindowRadius() {
57 if (!fMask) return 0;
58 return fMask->GetMaskRadius();
59 }
60
61 TRestPatternMask* GetMask() const { return fMask; }
62
63 Double_t GetTransmission(Double_t energy, Double_t x, Double_t y);
64
66
67 void InitFromConfigFile();
68 void PrintMetadata();
69
71 TRestAxionXrayWindow(const char* cfgFileName, std::string name = "");
72
74
75 ClassDef(TRestAxionXrayWindow, 2);
76};
77#endif
A metadata class to create x-ray transmission window definitions.
Double_t GetTransmission(Double_t energy, Double_t x, Double_t y)
It returns the window transmission probability for the given energy (in keV) and window position,...
void PrintTransmissionData()
Prints out the transmission probability curve loaded in memory. for debugging pourposes.
Bool_t HitsPattern(Double_t x, Double_t y)
It returns true if the window pattern is hitted. False otherwise.
void Initialize()
Initialization of TRestAxionXrayWindow members. It removes all gases.
Int_t GetEnergyIndex(Double_t energy)
It returns the vector element index, from fEnergy, that is just below the given input energy.
std::vector< Double_t > fTransmission
A vector with the transmission already renormalized using the material thickness. Not stored in disk.
void PrintMetadata()
Prints on screen the information about the metadata members of TRestAxionXrayWindow.
TRestPatternMask * fMask
A mask defining a pattern where the transmission will be effective.
TRestAxionXrayWindow()
Default constructor.
~TRestAxionXrayWindow()
Default destructor.
std::string fMaterial
Window material name.
void InitFromConfigFile()
To make settings from rml file. This method must be implemented in the derived class.
void ReadMaterial()
It reads the data files from the corresponding material that needs to be found in the axiolib databas...
Double_t fThickness
Thicknesss of window material in mm.
std::vector< Double_t > fEnergy
A vector with the energies loaded from the material file. Not stored in disk.
A base class for any REST metadata class.
Definition: TRestMetadata.h:74
An abstract class used to encapsulate different mask pattern class definitions.
Double_t GetMaskRadius()
It returns the mask radius.