Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4VSIntegration.hh
Go to the documentation of this file.
1//
2// ********************************************************************
3// * License and Disclaimer *
4// * *
5// * The Geant4 software is copyright of the Copyright Holders of *
6// * the Geant4 Collaboration. It is provided under the terms and *
7// * conditions of the Geant4 Software License, included in the file *
8// * LICENSE and available at http://cern.ch/geant4/license . These *
9// * include a list of copyright holders. *
10// * *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work make any representation or warranty, express or implied, *
14// * regarding this software system or assume any liability for its *
15// * use. Please see the license in the file LICENSE and URL above *
16// * for the full disclaimer and the limitation of liability. *
17// * *
18// * This code implementation is the result of the scientific and *
19// * technical work of the GEANT4 collaboration. *
20// * By using, copying, modifying or distributing the software (or *
21// * any work based on the software) you agree to acknowledge its *
22// * use in resulting scientific publications, and indicate your *
23// * acceptance of all terms of the Geant4 Software license. *
24// ********************************************************************
25//
26// G4VSIntegration
27//
28// Class description:
29//
30// Numerical algorithm for integration of probability density function
31// and sampling of the energy. Parameters of the algorithm should
32// be defined by consumer class via the InitialiseIntegrator(..) method.
33// The method is effective for the case of functions with a peak and long
34// tail. Tunning of parameters may increase efficiency of the algorithm.
35// The default set of parameters is optimized for the pre-compound model.
36//
37// Created 03.03.2025 V.Ivanchenko
38//
39// --------------------------------------------------------------------
40
41#ifndef G4VSIntegration_HH
42#define G4VSIntegration_HH 1
43
44#include "globals.hh"
45
47{
48 public:
49 G4VSIntegration() = default;
50
51 virtual ~G4VSIntegration() = default;
52
53 // this method should be implemented in a consumer class
55
56 virtual const G4String& ModelName() const;
57
58 // initialisation before run called once
59 // accuracy - accuracy of integration
60 // fact1 - value < 1 to define energy E1: Pmax*fact = P(E1)
61 // and E2: P(E1)*fact = P(E2)
62 // fact2 - value > 1 provides tolerance for max cross section
63 // deltaE - the default step in energy
64 // dmin, dmax - min and max values of step
65 void InitialiseIntegrator(G4double accuracy, G4double fact1, G4double fact2,
66 G4double de, G4double dmin, G4double dmax);
67
68 // compute integral of probability density function
69 G4double ComputeIntegral(const G4double emin, const G4double emax);
70
71 // sample value according to probability density function
72 // it is assumed that ComputeIntegral(emin, emax) was executed
74
77 G4bool operator==(const G4VSIntegration &right) const = delete;
78 G4bool operator!=(const G4VSIntegration &right) const = delete;
79
80 void SetVerbose(G4int verb) { fVerbose = verb; }
81
82private:
83
84 G4double fAcc{0.001}; // accuracy of integration
85 G4double fMinDelta{0.1}; // minimal step integration
86 G4double fMaxDelta{2.0}; // maximal step integration
87 G4double fDelta{1.0}; // the default step
88 G4double fFactor1{0.25};
89 G4double fFactor2{1.05};
90
91 // parameters describing function
92 G4double fEmin{0.0};
93 G4double fEmax{0.0};
94 G4double fE1{0.0};
95 G4double fP1{0.0};
96 G4double fE2{0.0};
97 G4double fP2{0.0};
98 G4double fPmax{0.0};
99
100 G4int fVerbose{0};
101 G4int fWarnLimit{4};
102 G4int fnWarn{0};
103
104 G4String dummy{""};
105};
106
107#endif
double G4double
Definition G4Types.hh:83
bool G4bool
Definition G4Types.hh:86
int G4int
Definition G4Types.hh:85
void SetVerbose(G4int verb)
virtual G4double ProbabilityDensityFunction(G4double)=0
virtual ~G4VSIntegration()=default
G4bool operator!=(const G4VSIntegration &right) const =delete
G4bool operator==(const G4VSIntegration &right) const =delete
G4double ComputeIntegral(const G4double emin, const G4double emax)
virtual const G4String & ModelName() const
void InitialiseIntegrator(G4double accuracy, G4double fact1, G4double fact2, G4double de, G4double dmin, G4double dmax)
G4VSIntegration(const G4VSIntegration &)=delete
G4VSIntegration()=default
G4VSIntegration & operator=(const G4VSIntegration &)=delete