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

#include <G4VHadPhaseSpaceAlgorithm.hh>

+ Inheritance diagram for G4VHadPhaseSpaceAlgorithm:

Public Member Functions

 G4VHadPhaseSpaceAlgorithm (const G4String &algName, G4int verbose=0)
 
virtual ~G4VHadPhaseSpaceAlgorithm ()
 
- Public Member Functions inherited from G4VHadDecayAlgorithm
 G4VHadDecayAlgorithm (const G4String &algName, G4int verbose=0)
 
virtual ~G4VHadDecayAlgorithm ()
 
void Generate (G4double initialMass, const std::vector< G4double > &masses, std::vector< G4LorentzVector > &finalState)
 
virtual void SetVerboseLevel (G4int verbose)
 
G4int GetVerboseLevel () const
 
const G4StringGetName () const
 

Protected Member Functions

virtual void GenerateTwoBody (G4double initialMass, const std::vector< G4double > &masses, std::vector< G4LorentzVector > &finalState)
 
G4ThreeVector UniformVector (G4double mag=1.) const
 
- Protected Member Functions inherited from G4VHadDecayAlgorithm
virtual void GenerateMultiBody (G4double initialMass, const std::vector< G4double > &masses, std::vector< G4LorentzVector > &finalState)=0
 
virtual G4bool IsDecayAllowed (G4double initialMass, const std::vector< G4double > &masses) const
 
G4double TwoBodyMomentum (G4double M0, G4double M1, G4double M2) const
 
G4double UniformTheta () const
 
G4double UniformPhi () const
 
void PrintVector (const std::vector< G4double > &v, const G4String &name, std::ostream &os) const
 

Detailed Description

Definition at line 43 of file G4VHadPhaseSpaceAlgorithm.hh.

Constructor & Destructor Documentation

◆ G4VHadPhaseSpaceAlgorithm()

G4VHadPhaseSpaceAlgorithm::G4VHadPhaseSpaceAlgorithm ( const G4String & algName,
G4int verbose = 0 )
inline

Definition at line 45 of file G4VHadPhaseSpaceAlgorithm.hh.

46 : G4VHadDecayAlgorithm(algName, verbose) {;}
G4VHadDecayAlgorithm(const G4String &algName, G4int verbose=0)

◆ ~G4VHadPhaseSpaceAlgorithm()

virtual G4VHadPhaseSpaceAlgorithm::~G4VHadPhaseSpaceAlgorithm ( )
inlinevirtual

Definition at line 47 of file G4VHadPhaseSpaceAlgorithm.hh.

47{;}

Member Function Documentation

◆ GenerateTwoBody()

void G4VHadPhaseSpaceAlgorithm::GenerateTwoBody ( G4double initialMass,
const std::vector< G4double > & masses,
std::vector< G4LorentzVector > & finalState )
protectedvirtual

Implements G4VHadDecayAlgorithm.

Definition at line 50 of file G4VHadPhaseSpaceAlgorithm.cc.

53 {
54 if (GetVerboseLevel()>1)
55 G4cout << " >>> G4HadDecayGenerator::FillTwoBody" << G4endl;
56
57 // Initialization and sanity check
58 finalState.clear();
59 if (masses.size() != 2U) return; // Should not have been called
60
61 // Momentum of final state (energy balance has already been checked)
62 G4double p = TwoBodyMomentum(initialMass,masses[0],masses[1]);
63 if (GetVerboseLevel()>2) G4cout << " finalState momentum = " << p << G4endl;
64
65 finalState.resize(2); // Allows filling by index
66 finalState[0].setVectM(UniformVector(p), masses[0]);
67 finalState[1].setVectM(-finalState[0].vect(), masses[1]);
68}
double G4double
Definition G4Types.hh:83
#define G4endl
Definition G4ios.hh:67
G4GLOB_DLL std::ostream G4cout
G4double TwoBodyMomentum(G4double M0, G4double M1, G4double M2) const
G4ThreeVector UniformVector(G4double mag=1.) const

◆ UniformVector()

G4ThreeVector G4VHadPhaseSpaceAlgorithm::UniformVector ( G4double mag = 1.) const
protected

Definition at line 73 of file G4VHadPhaseSpaceAlgorithm.cc.

73 {
74 // FIXME: Should this be made a static thread-local buffer?
77 return v;
78}
void setRThetaPhi(double r, double theta, double phi)

Referenced by G4HadPhaseSpaceKopylov::GenerateMultiBody(), G4HadPhaseSpaceNBodyAsai::GenerateMultiBody(), and GenerateTwoBody().


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