REST-for-Physics  v2.3
Rare Event Searches ToolKit for Physics
TRestGeant4ParticleSourceCosmics.h
1
2#ifndef REST_TRESTGEANT4PARTICLESOURCECOSMICS_H
3#define REST_TRESTGEANT4PARTICLESOURCECOSMICS_H
4
5#include <TH2D.h>
6#include <TRandom3.h>
7#include <TRestGeant4ParticleSource.h>
8
10 private:
11 std::set<std::string> fParticleNames;
12 std::string fFilename;
13 std::map<std::string, double> fParticleWeights;
14 std::pair<double, double> fEnergyRange = {0, 0};
15
16 unsigned long long fCounterEnergyTotal = 0;
17 unsigned long long fCounterEnergyAccepted = 0;
18
19 std::map<std::string, TH2D*> fHistograms;
20 std::map<std::string, TH2D*> fHistogramsTransformed;
21
22 static std::mutex fMutex;
23 static std::unique_ptr<TRandom3> fRandom;
24
25 public:
26 void Update() override;
27 void InitFromConfigFile() override;
28
29 static void SetSeed(unsigned int seed);
30
33
34 const char* GetName() const override { return "TRestGeant4ParticleSourceCosmics"; }
35
36 std::map<std::string, TH2D*> GetHistogramsTransformed() const { return fHistogramsTransformed; }
37 std::set<std::string> GetParticleNames() const { return fParticleNames; }
38
39 double GetEnergyRangeScalingFactor() const;
40
41 ClassDefOverride(TRestGeant4ParticleSourceCosmics, 3);
42};
43
44#endif // REST_TRESTGEANT4PARTICLESOURCECOSMICS_H
void InitFromConfigFile() override
To make settings from rml file. This method must be implemented in the derived class.