Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4CascadeFinalStateAlgorithm Class Reference

#include <G4CascadeFinalStateAlgorithm.hh>

Inheritance diagram for G4CascadeFinalStateAlgorithm:
Collaboration diagram for G4CascadeFinalStateAlgorithm:

Public Member Functions

 G4CascadeFinalStateAlgorithm ()
 
virtual ~G4CascadeFinalStateAlgorithm ()
 
virtual void SetVerboseLevel (G4int verbose)
 
void Configure (G4InuclElementaryParticle *bullet, G4InuclElementaryParticle *target, const std::vector< G4int > &particle_kinds)
 
- 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)
 
G4int GetVerboseLevel () const
 
const G4StringGetName () const
 

Protected Member Functions

virtual void GenerateTwoBody (G4double initialMass, const std::vector< G4double > &masses, std::vector< G4LorentzVector > &finalState)
 
virtual void GenerateMultiBody (G4double initialMass, const std::vector< G4double > &masses, std::vector< G4LorentzVector > &finalState)
 
void SaveKinematics (G4InuclElementaryParticle *bullet, G4InuclElementaryParticle *target)
 
void ChooseGenerators (G4int is, G4int fs)
 
void FillMagnitudes (G4double initialMass, const std::vector< G4double > &masses)
 
G4bool satisfyTriangle (const std::vector< G4double > &pmod) const
 
void FillDirections (G4double initialMass, const std::vector< G4double > &masses, std::vector< G4LorentzVector > &finalState)
 
void FillDirThreeBody (G4double initialMass, const std::vector< G4double > &masses, std::vector< G4LorentzVector > &finalState)
 
void FillDirManyBody (G4double initialMass, const std::vector< G4double > &masses, std::vector< G4LorentzVector > &finalState)
 
G4double GenerateCosTheta (G4int ptype, G4double pmod) const
 
void FillUsingKopylov (G4double initialMass, const std::vector< G4double > &masses, std::vector< G4LorentzVector > &finalState)
 
G4double BetaKopylov (G4int K) 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 49 of file G4CascadeFinalStateAlgorithm.hh.

Constructor & Destructor Documentation

G4CascadeFinalStateAlgorithm::G4CascadeFinalStateAlgorithm ( )

Definition at line 76 of file G4CascadeFinalStateAlgorithm.cc.

77  : G4VHadDecayAlgorithm("G4CascadeFinalStateAlgorithm"),
78  momDist(0), angDist(0), multiplicity(0), bullet_ekin(0.) {;}
G4VHadDecayAlgorithm(const G4String &algName, G4int verbose=0)
G4CascadeFinalStateAlgorithm::~G4CascadeFinalStateAlgorithm ( )
virtual

Definition at line 80 of file G4CascadeFinalStateAlgorithm.cc.

80 {;}

Member Function Documentation

G4double G4CascadeFinalStateAlgorithm::BetaKopylov ( G4int  K) const
protected

Definition at line 508 of file G4CascadeFinalStateAlgorithm.cc.

508  {
509  G4Pow* g4pow = G4Pow::GetInstance();
510 
511  G4int N = 3*K - 5;
512  G4double xN = G4double(N);
513  G4double Fmax = std::sqrt(g4pow->powN(xN/(xN+1.),N)/(xN+1.));
514 
515  G4double F, chi;
516  do { /* Loop checking 08.06.2015 MHK */
517  chi = G4UniformRand();
518  F = std::sqrt(g4pow->powN(chi,N)*(1.-chi));
519  } while ( Fmax*G4UniformRand() > F);
520  return chi;
521 }
static G4Pow * GetInstance()
Definition: G4Pow.cc:55
const int N
Definition: mixmax.h:43
G4double powN(G4double x, G4int n) const
Definition: G4Pow.cc:128
Definition: G4Pow.hh:56
int G4int
Definition: G4Types.hh:78
#define G4UniformRand()
Definition: Randomize.hh:97
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

Here is the caller graph for this function:

void G4CascadeFinalStateAlgorithm::ChooseGenerators ( G4int  is,
G4int  fs 
)
protected

Definition at line 137 of file G4CascadeFinalStateAlgorithm.cc.

137  {
138  if (GetVerboseLevel()>1)
139  G4cout << " >>> " << GetName() << "::ChooseGenerators"
140  << " is " << is << " fs " << fs << G4endl;
141 
142  // Get generators for momentum and angle
143  if (G4CascadeParameters::usePhaseSpace()) momDist = 0;
144  else momDist = G4MultiBodyMomentumDist::GetDist(is, multiplicity);
145 
146  if (fs > 0 && multiplicity == 2) {
147  G4int kw = (fs==is) ? 1 : 2;
148  angDist = G4TwoBodyAngularDist::GetDist(is, fs, kw);
149  } else if (multiplicity == 3) {
150  angDist = G4TwoBodyAngularDist::GetDist(is);
151  } else {
152  angDist = 0;
153  }
154 
155  if (GetVerboseLevel()>1) {
156  G4cout << " " << (momDist?momDist->GetName().c_str():"") << " "
157  << (angDist?angDist->GetName().c_str():"") << G4endl;
158  }
159 }
virtual const G4String & GetName() const
static const G4VTwoBodyAngDst * GetDist(G4int is, G4int fs, G4int kw)
G4int GetVerboseLevel() const
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
virtual const G4String & GetName() const
static G4bool usePhaseSpace()
const G4String & GetName() const
#define G4endl
Definition: G4ios.hh:61
static const G4VMultiBodyMomDst * GetDist(G4int is, G4int mult)

Here is the call graph for this function:

Here is the caller graph for this function:

void G4CascadeFinalStateAlgorithm::Configure ( G4InuclElementaryParticle bullet,
G4InuclElementaryParticle target,
const std::vector< G4int > &  particle_kinds 
)

Definition at line 93 of file G4CascadeFinalStateAlgorithm.cc.

95  {
96  if (GetVerboseLevel()>1)
97  G4cout << " >>> " << GetName() << "::Configure" << G4endl;
98 
99  // Identify initial and final state (if two-body) for algorithm selection
100  multiplicity = particle_kinds.size();
101  G4int is = bullet->type() * target->type();
102  G4int fs = (multiplicity==2) ? particle_kinds[0]*particle_kinds[1] : 0;
103 
104  ChooseGenerators(is, fs);
105 
106  // Save kinematics for use with distributions
107  SaveKinematics(bullet, target);
108 
109  // Save particle types for use with distributions
110  kinds = particle_kinds;
111 }
G4int GetVerboseLevel() const
int G4int
Definition: G4Types.hh:78
void SaveKinematics(G4InuclElementaryParticle *bullet, G4InuclElementaryParticle *target)
G4GLOB_DLL std::ostream G4cout
const G4String & GetName() const
#define G4endl
Definition: G4ios.hh:61

Here is the call graph for this function:

Here is the caller graph for this function:

void G4CascadeFinalStateAlgorithm::FillDirections ( G4double  initialMass,
const std::vector< G4double > &  masses,
std::vector< G4LorentzVector > &  finalState 
)
protected

Definition at line 314 of file G4CascadeFinalStateAlgorithm.cc.

315  {
316  if (GetVerboseLevel()>1)
317  G4cout << " >>> " << GetName() << "::FillDirections" << G4endl;
318 
319  finalState.clear(); // Initialization and sanity check
320  if ((G4int)modules.size() != multiplicity) return;
321 
322  // Different order of processing for three vs. N body
323  if (multiplicity == 3)
324  FillDirThreeBody(initialMass, masses, finalState);
325  else
326  FillDirManyBody(initialMass, masses, finalState);
327 }
void FillDirThreeBody(G4double initialMass, const std::vector< G4double > &masses, std::vector< G4LorentzVector > &finalState)
G4int GetVerboseLevel() const
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
const G4String & GetName() const
#define G4endl
Definition: G4ios.hh:61
void FillDirManyBody(G4double initialMass, const std::vector< G4double > &masses, std::vector< G4LorentzVector > &finalState)

Here is the call graph for this function:

Here is the caller graph for this function:

void G4CascadeFinalStateAlgorithm::FillDirManyBody ( G4double  initialMass,
const std::vector< G4double > &  masses,
std::vector< G4LorentzVector > &  finalState 
)
protected

Definition at line 363 of file G4CascadeFinalStateAlgorithm.cc.

364  {
365  if (GetVerboseLevel()>1)
366  G4cout << " >>> " << GetName() << "::FillDirManyBody" << G4endl;
367 
368  // Fill all but the last two particles randomly
369  G4double costh = 0.;
370 
371  finalState.resize(multiplicity);
372 
373  for (G4int i=0; i<multiplicity-2; i++) {
374  costh = GenerateCosTheta(kinds[i], modules[i]);
375  finalState[i] = generateWithFixedTheta(costh, modules[i], masses[i]);
376  finalState[i] = toSCM.rotate(finalState[i]); // Align target axis
377  }
378 
379  // Total momentum so far, to compute recoil of last two particles
380  G4LorentzVector psum =
381  std::accumulate(finalState.begin(), finalState.end()-2, G4LorentzVector());
382  G4double pmod = psum.rho();
383 
384  costh = -0.5 * (pmod*pmod +
385  modules[multiplicity-2]*modules[multiplicity-2] -
386  modules[multiplicity-1]*modules[multiplicity-1])
387  / pmod / modules[multiplicity-2];
388 
389  if (GetVerboseLevel() > 2) G4cout << " ct last " << costh << G4endl;
390 
391  if (std::fabs(costh) >= maxCosTheta) { // Bad kinematics; abort generation
392  finalState.clear();
393  return;
394  }
395 
396  // Report success
397  if (GetVerboseLevel()>2) G4cout << " ok for mult " << multiplicity << G4endl;
398 
399  // First particle is at fixed angle to recoil system
400  finalState[multiplicity-2] =
401  generateWithFixedTheta(costh, modules[multiplicity-2],
402  masses[multiplicity-2]);
403  finalState[multiplicity-2] = toSCM.rotate(psum, finalState[multiplicity-2]);
404 
405  // Remaining particle is constrained to recoil from entire rest of system
406  finalState[multiplicity-1].set(0.,0.,0.,initialMass);
407  finalState[multiplicity-1] -= psum + finalState[multiplicity-2];
408 }
G4int GetVerboseLevel() const
G4LorentzVector rotate(const G4LorentzVector &mom) const
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
double rho() const
G4double GenerateCosTheta(G4int ptype, G4double pmod) const
const G4String & GetName() const
void set(double x, double y, double z, double t)
G4LorentzVector generateWithFixedTheta(G4double ct, G4double p, G4double mass=0.)
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
CLHEP::HepLorentzVector G4LorentzVector

Here is the call graph for this function:

Here is the caller graph for this function:

void G4CascadeFinalStateAlgorithm::FillDirThreeBody ( G4double  initialMass,
const std::vector< G4double > &  masses,
std::vector< G4LorentzVector > &  finalState 
)
protected

Definition at line 330 of file G4CascadeFinalStateAlgorithm.cc.

331  {
332  if (GetVerboseLevel()>1)
333  G4cout << " >>> " << GetName() << "::FillDirThreeBody" << G4endl;
334 
335  finalState.resize(3);
336 
337  G4double costh = GenerateCosTheta(kinds[2], modules[2]);
338  finalState[2] = generateWithFixedTheta(costh, modules[2], masses[2]);
339  finalState[2] = toSCM.rotate(finalState[2]); // Align target axis
340 
341  // Generate direction of first particle
342  costh = -0.5 * (modules[2]*modules[2] + modules[0]*modules[0] -
343  modules[1]*modules[1]) / modules[2] / modules[0];
344 
345  if (std::fabs(costh) >= maxCosTheta) { // Bad kinematics; abort generation
346  finalState.clear();
347  return;
348  }
349 
350  // Report success
351  if (GetVerboseLevel()>2) G4cout << " ok for mult 3" << G4endl;
352 
353  // First particle is at fixed angle to recoil system
354  finalState[0] = generateWithFixedTheta(costh, modules[0], masses[0]);
355  finalState[0] = toSCM.rotate(finalState[2], finalState[0]);
356 
357  // Remaining particle is constrained to recoil from entire rest of system
358  finalState[1].set(0.,0.,0.,initialMass);
359  finalState[1] -= finalState[0] + finalState[2];
360 }
G4int GetVerboseLevel() const
G4LorentzVector rotate(const G4LorentzVector &mom) const
G4GLOB_DLL std::ostream G4cout
G4double GenerateCosTheta(G4int ptype, G4double pmod) const
const G4String & GetName() const
void set(double x, double y, double z, double t)
G4LorentzVector generateWithFixedTheta(G4double ct, G4double p, G4double mass=0.)
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

Here is the caller graph for this function:

void G4CascadeFinalStateAlgorithm::FillMagnitudes ( G4double  initialMass,
const std::vector< G4double > &  masses 
)
protected

Definition at line 229 of file G4CascadeFinalStateAlgorithm.cc.

229  {
230  if (GetVerboseLevel()>1)
231  G4cout << " >>> " << GetName() << "::FillMagnitudes" << G4endl;
232 
233  modules.clear(); // Initialization and sanity checks
234  if (!momDist) return;
235 
236  modules.resize(multiplicity,0.); // Pre-allocate to avoid resizing
237 
238  G4double mass_last = masses.back();
239  G4double pmod = 0.;
240 
241  if (GetVerboseLevel() > 3){
242  G4cout << " knd_last " << kinds.back() << " mass_last "
243  << mass_last << G4endl;
244  }
245 
246  G4int itry = -1;
247  while (++itry < itry_max) { /* Loop checking 08.06.2015 MHK */
248  if (GetVerboseLevel() > 3) {
249  G4cout << " itry in fillMagnitudes " << itry << G4endl;
250  }
251 
252  G4double eleft = initialMass;
253 
254  G4int i; // For access outside of loop
255  for (i=0; i < multiplicity-1; i++) {
256  pmod = momDist->GetMomentum(kinds[i], bullet_ekin);
257 
258  if (pmod < small) break;
259  eleft -= std::sqrt(pmod*pmod + masses[i]*masses[i]);
260 
261  if (GetVerboseLevel() > 3) {
262  G4cout << " kp " << kinds[i] << " pmod " << pmod
263  << " mass2 " << masses[i]*masses[i] << " eleft " << eleft
264  << "\n x1 " << eleft - mass_last << G4endl;
265  }
266 
267  if (eleft <= mass_last) break;
268 
269  modules[i] = pmod;
270  }
271 
272  if (i < multiplicity-1) continue; // Failed to generate full kinematics
273 
274  G4double plast = eleft * eleft - masses.back()*masses.back();
275  if (GetVerboseLevel() > 2) G4cout << " plast ** 2 " << plast << G4endl;
276 
277  if (plast <= small) continue; // Not enough momentum left over
278 
279  plast = std::sqrt(plast); // Final momentum is what's left over
280  modules.back() = plast;
281 
282  if (multiplicity > 3 || satisfyTriangle(modules)) break; // Successful
283  } // while (itry < itry_max)
284 
285  if (itry >= itry_max) { // Too many attempts
286  if (GetVerboseLevel() > 2)
287  G4cerr << " Unable to generate momenta for multiplicity "
288  << multiplicity << G4endl;
289 
290  modules.clear(); // Something went wrong, throw away partial
291  }
292 }
G4int GetVerboseLevel() const
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
G4bool satisfyTriangle(const std::vector< G4double > &pmod) const
virtual G4double GetMomentum(G4int ptype, const G4double &ekin) const =0
const G4String & GetName() const
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
G4GLOB_DLL std::ostream G4cerr

Here is the call graph for this function:

Here is the caller graph for this function:

void G4CascadeFinalStateAlgorithm::FillUsingKopylov ( G4double  initialMass,
const std::vector< G4double > &  masses,
std::vector< G4LorentzVector > &  finalState 
)
protected

Definition at line 465 of file G4CascadeFinalStateAlgorithm.cc.

467  {
468  if (GetVerboseLevel()>2)
469  G4cout << " >>> " << GetName() << "::FillUsingKopylov" << G4endl;
470 
471  finalState.clear();
472 
473  size_t N = masses.size();
474  finalState.resize(N);
475 
476  G4double mtot = std::accumulate(masses.begin(), masses.end(), 0.0);
477  G4double mu = mtot;
478  G4double Mass = initialMass;
479  G4double T = Mass-mtot;
480  G4double recoilMass = 0.0;
481  G4ThreeVector momV, boostV; // Buffers to reduce memory churn
482  G4LorentzVector recoil(0.0,0.0,0.0,Mass);
483 
484  for (size_t k=N-1; k>0; --k) {
485  mu -= masses[k];
486  T *= (k>1) ? BetaKopylov(k) : 0.;
487 
488  recoilMass = mu + T;
489 
490  boostV = recoil.boostVector(); // Previous system's rest frame
491 
492  // Create momentum with a random direction isotropically distributed
493  // FIXME: Should theta distribution should use Bertini fit function?
494  momV.setRThetaPhi(TwoBodyMomentum(Mass,masses[k],recoilMass),
495  UniformTheta(), UniformPhi());
496 
497  finalState[k].setVectM(momV,masses[k]);
498  recoil.setVectM(-momV,recoilMass);
499 
500  finalState[k].boost(boostV);
501  recoil.boost(boostV);
502  Mass = recoilMass;
503  }
504 
505  finalState[0] = recoil;
506 }
const int N
Definition: mixmax.h:43
G4double UniformTheta() const
G4int GetVerboseLevel() const
G4GLOB_DLL std::ostream G4cout
void setRThetaPhi(double r, double theta, double phi)
const G4String & GetName() const
G4double UniformPhi() const
G4double TwoBodyMomentum(G4double M0, G4double M1, G4double M2) const
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

Here is the caller graph for this function:

G4double G4CascadeFinalStateAlgorithm::GenerateCosTheta ( G4int  ptype,
G4double  pmod 
) const
protected

Definition at line 414 of file G4CascadeFinalStateAlgorithm.cc.

414  {
415  if (GetVerboseLevel() > 2) {
416  G4cout << " >>> " << GetName() << "::GenerateCosTheta " << ptype
417  << " " << pmod << G4endl;
418  }
419 
420  if (multiplicity == 3) { // Use distribution for three-body
421  return angDist->GetCosTheta(bullet_ekin, ptype);
422  }
423 
424  // Throw multi-body distribution
425  G4double p0 = ptype<3 ? 0.36 : 0.25; // Nucleon vs. everything else
426  G4double alf = 1.0 / p0 / (p0 - (pmod+p0)*G4Exp(-pmod / p0));
427 
428  G4double sinth = 2.0;
429 
430  G4int itry1 = -1; /* Loop checking 08.06.2015 MHK */
431  while (std::fabs(sinth) > maxCosTheta && ++itry1 < itry_max) {
432  G4double s1 = pmod * inuclRndm();
433  G4double s2 = alf * oneOverE * p0 * inuclRndm();
434  G4double salf = s1 * alf * G4Exp(-s1 / p0);
435  if (GetVerboseLevel() > 3) {
436  G4cout << " s1 * alf * G4Exp(-s1 / p0) " << salf
437  << " s2 " << s2 << G4endl;
438  }
439 
440  if (salf > s2) sinth = s1 / pmod;
441  }
442 
443  if (GetVerboseLevel() > 3)
444  G4cout << " itry1 " << itry1 << " sinth " << sinth << G4endl;
445 
446  if (itry1 == itry_max) {
447  if (GetVerboseLevel() > 2)
448  G4cout << " high energy angles generation: itry1 " << itry1 << G4endl;
449 
450  sinth = 0.5 * inuclRndm();
451  }
452 
453  // Convert generated sin(theta) to cos(theta) with random sign
454  G4double costh = std::sqrt(1.0 - sinth * sinth);
455  if (inuclRndm() > 0.5) costh = -costh;
456 
457  return costh;
458 }
G4int GetVerboseLevel() const
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
Definition: G4Exp.hh:183
const G4String & GetName() const
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
virtual G4double GetCosTheta(const G4double &ekin, const G4double &pcm) const =0

Here is the call graph for this function:

Here is the caller graph for this function:

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

Implements G4VHadDecayAlgorithm.

Definition at line 206 of file G4CascadeFinalStateAlgorithm.cc.

207  {
208  if (GetVerboseLevel()>1)
209  G4cout << " >>> " << GetName() << "::GenerateMultiBody" << G4endl;
210 
212  FillUsingKopylov(initialMass, masses, finalState);
213  return;
214  }
215 
216  finalState.clear(); // Initialization and sanity checks
217  if (multiplicity < 3) return;
218  if (!momDist) return;
219 
220  G4int itry = -1; /* Loop checking 08.06.2015 MHK */
221  while ((G4int)finalState.size() != multiplicity && ++itry < itry_max) {
222  FillMagnitudes(initialMass, masses);
223  FillDirections(initialMass, masses, finalState);
224  }
225 }
G4int GetVerboseLevel() const
int G4int
Definition: G4Types.hh:78
void FillMagnitudes(G4double initialMass, const std::vector< G4double > &masses)
G4GLOB_DLL std::ostream G4cout
static G4bool usePhaseSpace()
const G4String & GetName() const
#define G4endl
Definition: G4ios.hh:61
void FillDirections(G4double initialMass, const std::vector< G4double > &masses, std::vector< G4LorentzVector > &finalState)
void FillUsingKopylov(G4double initialMass, const std::vector< G4double > &masses, std::vector< G4LorentzVector > &finalState)

Here is the call graph for this function:

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

Implements G4VHadDecayAlgorithm.

Definition at line 165 of file G4CascadeFinalStateAlgorithm.cc.

166  {
167  if (GetVerboseLevel()>1)
168  G4cout << " >>> " << GetName() << "::GenerateTwoBody" << G4endl;
169 
170  finalState.clear(); // Initialization and sanity checks
171 
172  if (multiplicity != 2) return;
173 
174  // Generate momentum vector in CMS for back-to-back particles
175  G4double pscm = TwoBodyMomentum(initialMass, masses[0], masses[1]);
176 
177  G4double costh = angDist ? angDist->GetCosTheta(bullet_ekin, pscm)
178  : (2.*G4UniformRand() - 1.);
179 
180  mom.setRThetaPhi(pscm, std::acos(costh), UniformPhi());
181 
182  if (GetVerboseLevel()>3) { // Copied from old G4EPCollider
183  G4cout << " Particle kinds = " << kinds[0] << " , " << kinds[1]
184  << "\n pmod " << pscm
185  << "\n before rotation px " << mom.x() << " py " << mom.y()
186  << " pz " << mom.z() << G4endl;
187  }
188 
189  finalState.resize(2); // Allows filling by index
190 
191  finalState[0].setVectM(mom, masses[0]);
192  finalState[0] = toSCM.rotate(finalState[0]);
193 
194  if (GetVerboseLevel()>3) { // Copied from old G4EPCollider
195  G4cout << " after rotation px " << finalState[0].x() << " py "
196  << finalState[0].y() << " pz " << finalState[0].z() << G4endl;
197  }
198 
199  finalState[1].setVectM(-finalState[0].vect(), masses[1]);
200 }
double x() const
G4int GetVerboseLevel() const
G4LorentzVector rotate(const G4LorentzVector &mom) const
double z() const
#define G4UniformRand()
Definition: Randomize.hh:97
G4GLOB_DLL std::ostream G4cout
void setRThetaPhi(double r, double theta, double phi)
const G4String & GetName() const
G4double UniformPhi() const
double y() const
G4double TwoBodyMomentum(G4double M0, G4double M1, G4double M2) const
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
virtual G4double GetCosTheta(const G4double &ekin, const G4double &pcm) const =0

Here is the call graph for this function:

G4bool G4CascadeFinalStateAlgorithm::satisfyTriangle ( const std::vector< G4double > &  pmod) const
protected

Definition at line 297 of file G4CascadeFinalStateAlgorithm.cc.

297  {
298  if (GetVerboseLevel() > 3)
299  G4cout << " >>> " << GetName() << "::satisfyTriangle" << G4endl;
300 
301  return ( (pmod.size() != 3) ||
302  !(pmod[0] < std::fabs(pmod[1] - pmod[2]) ||
303  pmod[0] > pmod[1] + pmod[2] ||
304  pmod[1] < std::fabs(pmod[0] - pmod[2]) ||
305  pmod[1] > pmod[0] + pmod[2] ||
306  pmod[2] < std::fabs(pmod[0] - pmod[1]) ||
307  pmod[2] > pmod[1] + pmod[0])
308  );
309 }
G4int GetVerboseLevel() const
G4GLOB_DLL std::ostream G4cout
const G4String & GetName() const
#define G4endl
Definition: G4ios.hh:61

Here is the call graph for this function:

Here is the caller graph for this function:

void G4CascadeFinalStateAlgorithm::SaveKinematics ( G4InuclElementaryParticle bullet,
G4InuclElementaryParticle target 
)
protected

Definition at line 116 of file G4CascadeFinalStateAlgorithm.cc.

117  {
118  if (GetVerboseLevel()>1)
119  G4cout << " >>> " << GetName() << "::SaveKinematics" << G4endl;
120 
121  if (target->nucleon()) { // Which particle originated in nucleus?
122  toSCM.setBullet(bullet);
123  toSCM.setTarget(target);
124  } else {
125  toSCM.setBullet(target);
126  toSCM.setTarget(bullet);
127  }
128 
129  toSCM.toTheCenterOfMass();
130 
131  bullet_ekin = toSCM.getKinEnergyInTheTRS();
132 }
G4int GetVerboseLevel() const
void setBullet(const G4InuclParticle *bullet)
G4GLOB_DLL std::ostream G4cout
G4double getKinEnergyInTheTRS() const
const G4String & GetName() const
#define G4endl
Definition: G4ios.hh:61
void setTarget(const G4InuclParticle *target)

Here is the call graph for this function:

Here is the caller graph for this function:

void G4CascadeFinalStateAlgorithm::SetVerboseLevel ( G4int  verbose)
virtual

Reimplemented from G4VHadDecayAlgorithm.

Definition at line 82 of file G4CascadeFinalStateAlgorithm.cc.

82  {
86  toSCM.setVerbose(verbose);
87 }
static void setVerboseLevel(G4int vb=0)
void setVerbose(G4int vb=0)
static void setVerboseLevel(G4int vb=0)
virtual void SetVerboseLevel(G4int verbose)

Here is the call graph for this function:


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