OMSim
Geant4 for IceCube optical module studies
Loading...
Searching...
No Matches
OMSimSNTools.hh
Go to the documentation of this file.
1
10#pragma once
11
12#include <globals.hh>
13#include <vector>
14#include <G4ThreeVector.hh>
15#include <TGraph.h>
16
17
24{
25 public:
28 G4double sampleFromDistribution();
29 void setData(const std::vector<G4double>& pX, const std::vector<G4double>& pY, G4String pName);
30 void makeInterpolator();
31 void setUnits(G4double pX, G4double pY);
32 G4double interpolate(G4double pX);
33
34 private:
36 G4double m_XUnit;
37 G4double m_YUnit;
38 std::vector<G4double> m_X;
39 std::vector<G4double> m_Y;
40 std::vector<G4double> m_slopes;
41 std::vector<G4double> m_CDF;
42 G4String m_distName;
43 TGraph *m_interpolator = nullptr;
44};
45
56{
57public:
58
59 OMSimSNTools(){};
60 ~OMSimSNTools(){};
61
62 G4ThreeVector randomPosition();
63 std::pair<std::string, std::string> getFileNames(int value);
64 G4double sampleEnergy(G4double Emean, G4double Emean2, G4double& alpha);
65 G4double getAlpha(G4double Emean,G4double Emean2);
66 G4double calculateWeight(G4double sigma, G4double NTargets);
67 G4double numberOfTargets(G4int targetPerMolecule);
68private:
69 std::vector <G4double> m_DOMpos;
70 G4double m_rMin;
71 bool checkVolumeForOMs(G4ThreeVector position);
72};
73
Utility class for sampling from a given distribution using the inverse cumulative function and interp...
Definition OMSimSNTools.hh:24
G4double interpolate(G4double pX)
Interpolates distribution using TGraph (ROOT)
Definition OMSimSNTools.cc:320
void setData(const std::vector< G4double > &pX, const std::vector< G4double > &pY, G4String pName)
Sets data for the distribution.
Definition OMSimSNTools.cc:266
void calculateSlopesAndCDF()
Calculates the slopes and cumulative function of a dataset for the inverse cumulative algorithm.
Definition OMSimSNTools.cc:294
G4double sampleFromDistribution()
Samples values from a given distribution using the Inverse CDF algorithm.
Definition OMSimSNTools.cc:224
void setUnits(G4double pX, G4double pY)
Sets units for the x and y data points of the distribution.
Definition OMSimSNTools.cc:337
void makeInterpolator()
Initializes the interpolator using TGraph.
Definition OMSimSNTools.cc:281
Provides utility methods for generating ENES and IBD interactions.
Definition OMSimSNTools.hh:56
bool checkVolumeForOMs(G4ThreeVector position)
Checks if a given position is within any of the modules.
Definition OMSimSNTools.cc:59
G4double numberOfTargets(G4int targetPerMolecule)
Calculates the number of target particles in ice per cubic meter.
Definition OMSimSNTools.cc:179
G4double sampleEnergy(G4double Emean, G4double Emean2, G4double &alpha)
Randomly samle the energy depending on the properties of the energy spectrum.
Definition OMSimSNTools.cc:124
G4double calculateWeight(G4double sigma, G4double NTargets)
Calculates the interaction weight based on the cross section and number of targets.
Definition OMSimSNTools.cc:208
G4ThreeVector randomPosition()
Randomly determines a vertex position within the generation volume.
Definition OMSimSNTools.cc:76
std::pair< std::string, std::string > getFileNames(int value)
Retrieves file names for neutrino and antineutrino fluxes based on a specified supernova model.
Definition OMSimSNTools.cc:22
G4double getAlpha(G4double Emean, G4double Emean2)
Calculates pinching parameter of energy spectrum.
Definition OMSimSNTools.cc:164