Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Member Functions
G4HadPhaseSpaceKopylov Class Reference

#include <G4HadPhaseSpaceKopylov.hh>

Inheritance diagram for G4HadPhaseSpaceKopylov:
G4VHadPhaseSpaceAlgorithm G4VHadDecayAlgorithm

Public Member Functions

 G4HadPhaseSpaceKopylov (G4int verbose=0)
 
virtual ~G4HadPhaseSpaceKopylov ()
 
- Public Member Functions inherited from G4VHadPhaseSpaceAlgorithm
 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 GenerateMultiBody (G4double initialMass, const std::vector< G4double > &masses, std::vector< G4LorentzVector > &finalState)
 
G4double BetaKopylov (G4int K) const
 
- Protected Member Functions inherited from G4VHadPhaseSpaceAlgorithm
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 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 38 of file G4HadPhaseSpaceKopylov.hh.

Constructor & Destructor Documentation

G4HadPhaseSpaceKopylov::G4HadPhaseSpaceKopylov ( G4int  verbose = 0)
inline

Definition at line 40 of file G4HadPhaseSpaceKopylov.hh.

41  : G4VHadPhaseSpaceAlgorithm("G4HadPhaseSpaceKopylov",verbose) {;}
G4VHadPhaseSpaceAlgorithm(const G4String &algName, G4int verbose=0)
virtual G4HadPhaseSpaceKopylov::~G4HadPhaseSpaceKopylov ( )
inlinevirtual

Definition at line 42 of file G4HadPhaseSpaceKopylov.hh.

42 {;}

Member Function Documentation

G4double G4HadPhaseSpaceKopylov::BetaKopylov ( G4int  K) const
protected

Definition at line 93 of file G4HadPhaseSpaceKopylov.cc.

References G4UniformRand, G4Pow::GetInstance(), N, and G4Pow::powN().

Referenced by GenerateMultiBody().

93  {
94  G4Pow* g4pow = G4Pow::GetInstance();
95 
96  G4int N = 3*K - 5;
97  G4double xN = G4double(N);
98  G4double Fmax = std::sqrt(g4pow->powN(xN/(xN+1.),N)/(xN+1.));
99 
100  G4double F, chi;
101  do {
102  chi = G4UniformRand();
103  F = std::sqrt(g4pow->powN(chi,N)*(1.-chi));
104  } while ( Fmax*G4UniformRand() > F);
105  return chi;
106 }
static G4Pow * GetInstance()
Definition: G4Pow.cc:53
G4double powN(G4double x, G4int n) const
Definition: G4Pow.cc:125
Definition: G4Pow.hh:56
int G4int
Definition: G4Types.hh:78
#define G4UniformRand()
Definition: Randomize.hh:87
**D E S C R I P T I O N
double G4double
Definition: G4Types.hh:76
void G4HadPhaseSpaceKopylov::GenerateMultiBody ( G4double  initialMass,
const std::vector< G4double > &  masses,
std::vector< G4LorentzVector > &  finalState 
)
protectedvirtual

Implements G4VHadDecayAlgorithm.

Definition at line 45 of file G4HadPhaseSpaceKopylov.cc.

References BetaKopylov(), CLHEP::HepLorentzVector::boost(), CLHEP::HepLorentzVector::boostVector(), G4cout, G4endl, G4VHadDecayAlgorithm::GetName(), G4VHadDecayAlgorithm::GetVerboseLevel(), N, CLHEP::HepLorentzVector::setVectM(), G4VHadDecayAlgorithm::TwoBodyMomentum(), and G4VHadPhaseSpaceAlgorithm::UniformVector().

47  {
48  if (GetVerboseLevel()) G4cout << GetName() << "::GenerateMultiBody" << G4endl;
49 
50  finalState.clear();
51 
52  size_t N = masses.size();
53  finalState.resize(N);
54 
55  G4double mtot = std::accumulate(masses.begin(), masses.end(), 0.0);
56  G4double mu = mtot;
57  G4double PFragMagCM = 0.0;
58  G4double Mass = initialMass;
59  G4double T = Mass-mtot;
60  G4LorentzVector PFragCM(0.0,0.0,0.0,0.0);
61  G4LorentzVector PRestCM(0.0,0.0,0.0,0.0);
62  G4LorentzVector PRestLab(0.0,0.0,0.0,Mass);
63 
64  for (size_t k=N-1; k>0; --k) {
65  mu -= masses[k];
66  T *= (k>1) ? BetaKopylov(k) : 0.;
67 
68  G4double RestMass = mu + T;
69 
70  PFragMagCM = TwoBodyMomentum(Mass,masses[k],RestMass);
71 
72  // Create a unit vector with a random direction isotropically distributed
73  G4ThreeVector RandVector = UniformVector(PFragMagCM);
74 
75  PFragCM.setVectM(RandVector,masses[k]);
76  PRestCM.setVectM(-RandVector,RestMass);
77 
78  G4ThreeVector BoostV = PRestLab.boostVector();
79 
80  PFragCM.boost(BoostV);
81  PRestCM.boost(BoostV);
82  PRestLab = PRestCM;
83  Mass = RestMass;
84  finalState[k] = PFragCM;
85  }
86 
87  finalState[0] = PRestLab;
88 }
G4int GetVerboseLevel() const
G4GLOB_DLL std::ostream G4cout
G4double BetaKopylov(G4int K) const
const G4String & GetName() const
G4double TwoBodyMomentum(G4double M0, G4double M1, G4double M2) const
#define G4endl
Definition: G4ios.hh:61
**D E S C R I P T I O N
double G4double
Definition: G4Types.hh:76
G4ThreeVector UniformVector(G4double mag=1.) const

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