#include <G4HadPhaseSpaceGenbod.hh>
|
virtual void | GenerateMultiBody (G4double initialMass, const std::vector< G4double > &masses, std::vector< G4LorentzVector > &finalState) |
|
void | Initialize (G4double initialMass, const std::vector< G4double > &masses) |
|
void | FillRandomBuffer () |
|
void | ComputeWeightScale (const std::vector< G4double > &masses) |
|
void | FillEnergySteps (G4double initialMass, const std::vector< G4double > &masses) |
|
void | GenerateMomenta (const std::vector< G4double > &masses, std::vector< G4LorentzVector > &finalState) |
|
void | AccumulateFinalState (size_t i, const std::vector< G4double > &masses, std::vector< G4LorentzVector > &finalState) |
|
G4bool | AcceptEvent () const |
|
G4double | ComputeWeight () const |
|
virtual void | GenerateTwoBody (G4double initialMass, const std::vector< G4double > &masses, std::vector< G4LorentzVector > &finalState) |
|
G4ThreeVector | UniformVector (G4double mag=1.) const |
|
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 |
|
Definition at line 38 of file G4HadPhaseSpaceGenbod.hh.
G4HadPhaseSpaceGenbod::G4HadPhaseSpaceGenbod |
( |
G4int |
verbose = 0 | ) |
|
Definition at line 52 of file G4HadPhaseSpaceGenbod.cc.
54 nFinal(0), totalMass(0.), massExcess(0.), weightMax(0.), nTrials(0) {;}
G4VHadPhaseSpaceAlgorithm(const G4String &algName, G4int verbose=0)
virtual G4HadPhaseSpaceGenbod::~G4HadPhaseSpaceGenbod |
( |
| ) |
|
|
inlinevirtual |
G4bool G4HadPhaseSpaceGenbod::AcceptEvent |
( |
| ) |
const |
|
protected |
Definition at line 171 of file G4HadPhaseSpaceGenbod.cc.
G4int GetVerboseLevel() const
G4double ComputeWeight() const
G4GLOB_DLL std::ostream G4cout
const G4String & GetName() const
void G4HadPhaseSpaceGenbod::AccumulateFinalState |
( |
size_t |
i, |
|
|
const std::vector< G4double > & |
masses, |
|
|
std::vector< G4LorentzVector > & |
finalState |
|
) |
| |
|
protected |
Definition at line 198 of file G4HadPhaseSpaceGenbod.cc.
205 finalState[i].setVectM(
G4ThreeVector(0.,pd[i],0.),masses[i]);
209 finalState[i].setVectM(
G4ThreeVector(0.,-pd[i-1],0.),masses[i]);
214 G4cout <<
" initialized Py " << -pd[i-1] <<
" phi " << phi
215 <<
" theta " << theta <<
G4endl;
220 esys = std::sqrt(pd[i]*pd[i]+meff[i]*meff[i]);
222 gamma = esys / meff[i];
225 G4cout <<
" esys " << esys <<
" beta " << beta <<
" gamma " << gamma
229 for (
size_t j=0; j<=i; j++) {
230 finalState[j].rotateZ(theta).rotateY(phi);
231 finalState[j].setY(gamma*(finalState[j].y() + beta*finalState[j].e()));
CLHEP::Hep3Vector G4ThreeVector
G4int GetVerboseLevel() const
static constexpr double twopi
G4GLOB_DLL std::ostream G4cout
const G4String & GetName() const
G4double G4HadPhaseSpaceGenbod::ComputeWeight |
( |
| ) |
const |
|
protected |
Definition at line 164 of file G4HadPhaseSpaceGenbod.cc.
167 return (std::accumulate(pd.begin(), pd.end(), 1./weightMax,
168 std::multiplies<G4double>()));
G4int GetVerboseLevel() const
G4GLOB_DLL std::ostream G4cout
const G4String & GetName() const
void G4HadPhaseSpaceGenbod::ComputeWeightScale |
( |
const std::vector< G4double > & |
masses | ) |
|
|
protected |
Definition at line 149 of file G4HadPhaseSpaceGenbod.cc.
154 for (
size_t i=1; i<nFinal; i++) {
155 weightMax *=
TwoBodyMomentum(massExcess+msum[i], msum[i-1], masses[i]);
G4int GetVerboseLevel() const
G4GLOB_DLL std::ostream G4cout
const G4String & GetName() const
G4double TwoBodyMomentum(G4double M0, G4double M1, G4double M2) const
void G4HadPhaseSpaceGenbod::FillEnergySteps |
( |
G4double |
initialMass, |
|
|
const std::vector< G4double > & |
masses |
|
) |
| |
|
protected |
Definition at line 124 of file G4HadPhaseSpaceGenbod.cc.
131 meff.push_back(masses[0]);
132 for (
size_t i=1; i<nFinal-1; i++) {
133 meff.push_back(rndm[i-1]*massExcess + msum[i]);
136 meff.push_back(initialMass);
137 pd.push_back(
TwoBodyMomentum(meff[nFinal-1], meff[nFinal-2], masses[nFinal-1]));
G4int GetVerboseLevel() const
G4GLOB_DLL std::ostream G4cout
void PrintVector(const std::vector< G4double > &v, const G4String &name, std::ostream &os) const
const G4String & GetName() const
G4double TwoBodyMomentum(G4double M0, G4double M1, G4double M2) const
void G4HadPhaseSpaceGenbod::FillRandomBuffer |
( |
| ) |
|
|
protected |
Definition at line 111 of file G4HadPhaseSpaceGenbod.cc.
114 rndm.resize(nFinal-2,0.);
116 std::sort(rndm.begin(), rndm.end());
G4int GetVerboseLevel() const
G4GLOB_DLL std::ostream G4cout
void PrintVector(const std::vector< G4double > &v, const G4String &name, std::ostream &os) const
const G4String & GetName() const
void generate(const G4double sqrtS, ParticleList &particles)
Generate an event in the CM system.
Definition at line 182 of file G4HadPhaseSpaceGenbod.cc.
186 finalState.resize(nFinal);
188 for (
size_t i=0; i<nFinal; i++) {
191 G4cout <<
" finalState[" << i <<
"] " << finalState[i] <<
G4endl;
void AccumulateFinalState(size_t i, const std::vector< G4double > &masses, std::vector< G4LorentzVector > &finalState)
G4int GetVerboseLevel() const
G4GLOB_DLL std::ostream G4cout
const G4String & GetName() const
Implements G4VHadDecayAlgorithm.
Definition at line 60 of file G4HadPhaseSpaceGenbod.cc.
69 const G4int maxNumberOfLoops = 10000;
75 }
while ( (!
AcceptEvent()) && nTrials < maxNumberOfLoops );
76 if ( nTrials >= maxNumberOfLoops ) {
78 ed <<
" Failed sampling after maxNumberOfLoops attempts : forced exit" <<
G4endl;
std::ostringstream G4ExceptionDescription
void FillEnergySteps(G4double initialMass, const std::vector< G4double > &masses)
void GenerateMomenta(const std::vector< G4double > &masses, std::vector< G4LorentzVector > &finalState)
G4int GetVerboseLevel() const
G4GLOB_DLL std::ostream G4cout
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
const G4String & GetName() const
void Initialize(G4double initialMass, const std::vector< G4double > &masses)
G4bool AcceptEvent() const
void G4HadPhaseSpaceGenbod::Initialize |
( |
G4double |
initialMass, |
|
|
const std::vector< G4double > & |
masses |
|
) |
| |
|
protected |
Definition at line 85 of file G4HadPhaseSpaceGenbod.cc.
88 nFinal = masses.size();
89 msum.resize(nFinal, 0.);
90 msq.resize(nFinal, 0.);
92 std::partial_sum(masses.begin(), masses.end(), msum.begin());
93 std::transform(masses.begin(), masses.end(), masses.begin(), msq.begin(),
94 std::multiplies<G4double>());
95 totalMass = msum.back();
96 massExcess = initialMass - totalMass;
101 G4cout <<
" totalMass " << totalMass <<
" massExcess " << massExcess
void ComputeWeightScale(const std::vector< G4double > &masses)
G4int GetVerboseLevel() const
G4GLOB_DLL std::ostream G4cout
void PrintVector(const std::vector< G4double > &v, const G4String &name, std::ostream &os) const
const G4String & GetName() const
The documentation for this class was generated from the following files: