Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4InuclParamAngDst Class Reference

#include <G4InuclParamAngDst.hh>

+ Inheritance diagram for G4InuclParamAngDst:

Public Member Functions

 G4InuclParamAngDst (const G4String &name, const G4double(&abnC)[2][4][4], G4int verbose=0)
 
virtual ~G4InuclParamAngDst ()
 
virtual G4double GetCosTheta (G4int ptype, G4double ekin) const
 
virtual G4double GetCosTheta (const G4double &ekin, const G4double &pcm) const
 
- Public Member Functions inherited from G4VThreeBodyAngDst
 G4VThreeBodyAngDst (const G4String &name, G4int verbose=0)
 
virtual ~G4VThreeBodyAngDst ()
 
virtual G4double GetCosTheta (G4int ptype, G4double ekin) const =0
 
virtual G4double GetCosTheta (const G4double &ekin, const G4double &pcm) const
 
- Public Member Functions inherited from G4VTwoBodyAngDst
 G4VTwoBodyAngDst (const G4String &name, G4int verbose=0)
 
virtual ~G4VTwoBodyAngDst ()
 
virtual G4double GetCosTheta (const G4double &ekin, const G4double &pcm) const =0
 
virtual void setVerboseLevel (G4int verbose=0)
 
virtual const G4StringGetName () const
 

Protected Attributes

const G4double(& coeffAB )[2][4][4]
 
- Protected Attributes inherited from G4VTwoBodyAngDst
G4String theName
 
G4int verboseLevel
 

Detailed Description

Definition at line 41 of file G4InuclParamAngDst.hh.

Constructor & Destructor Documentation

◆ G4InuclParamAngDst()

G4InuclParamAngDst::G4InuclParamAngDst ( const G4String name,
const G4double(&)  abnC[2][4][4],
G4int  verbose = 0 
)
inline

Definition at line 44 of file G4InuclParamAngDst.hh.

47 : G4VThreeBodyAngDst(name, verbose), coeffAB(abnC) {;}
const G4double(& coeffAB)[2][4][4]

◆ ~G4InuclParamAngDst()

virtual G4InuclParamAngDst::~G4InuclParamAngDst ( )
inlinevirtual

Definition at line 49 of file G4InuclParamAngDst.hh.

49{;}

Member Function Documentation

◆ GetCosTheta() [1/2]

virtual G4double G4InuclParamAngDst::GetCosTheta ( const G4double ekin,
const G4double pcm 
) const
inlinevirtual

Reimplemented from G4VThreeBodyAngDst.

Definition at line 55 of file G4InuclParamAngDst.hh.

55 {
56 return G4VThreeBodyAngDst::GetCosTheta(ekin, pcm);
57 }
virtual G4double GetCosTheta(G4int ptype, G4double ekin) const =0

◆ GetCosTheta() [2/2]

G4double G4InuclParamAngDst::GetCosTheta ( G4int  ptype,
G4double  ekin 
) const
virtual

Implements G4VThreeBodyAngDst.

Definition at line 44 of file G4InuclParamAngDst.cc.

44 {
45 if (verboseLevel>3) {
46 G4cout << theName << "::GetCosTheta: ptype " << ptype << " ekin " << ekin
47 << G4endl;
48 }
49
50 G4int J = (ptype==pro || ptype==neu) ? 0 : 1; // nucleon vs. other
51 if (verboseLevel > 3) G4cout << " J " << J << G4endl;
52
53 const G4int itry_max = 100; // Parametrizations aren't properly bounded
54
55 G4double Spow = -999.;
56 G4int itry = 0;
57
58 /* Loop checking 08.06.2015 MHK */
59 while ((Spow < 0. || Spow > 1.) && itry < itry_max) {
60 itry++;
61 Spow = randomInuclPowers(ekin, coeffAB[J]);
62 }
63
64 if (itry == itry_max) { // No success, just throw flat distribution
65 if (verboseLevel > 2) {
66 G4cout << theName << "::GetCosTheta -> itry = itry_max " << itry
67 << G4endl;
68 }
69
70 Spow = inuclRndm();
71 }
72
73 return 2.0*Spow - 1.0; // Convert generated [0..1] to [-1..1]
74}
double G4double
Definition: G4Types.hh:83
int G4int
Definition: G4Types.hh:85
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
G4double randomInuclPowers(G4double ekin, const G4double(&coeff)[4][4])

Member Data Documentation

◆ coeffAB

const G4double(& G4InuclParamAngDst::coeffAB)[2][4][4]
protected

Definition at line 60 of file G4InuclParamAngDst.hh.

Referenced by GetCosTheta().


The documentation for this class was generated from the following files: