Geant4  10.02.p03
G4VDecayChannel Class Referenceabstract

#include <G4VDecayChannel.hh>

Inheritance diagram for G4VDecayChannel:
Collaboration diagram for G4VDecayChannel:

Public Member Functions

 G4VDecayChannel (const G4String &aName, G4int Verbose=1)
 
 G4VDecayChannel (const G4String &aName, const G4String &theParentName, G4double theBR, G4int theNumberOfDaughters, const G4String &theDaughterName1, const G4String &theDaughterName2="", const G4String &theDaughterName3="", const G4String &theDaughterName4="")
 
virtual ~G4VDecayChannel ()
 
G4int operator== (const G4VDecayChannel &right) const
 
G4int operator!= (const G4VDecayChannel &right) const
 
G4int operator< (const G4VDecayChannel &right) const
 
virtual G4DecayProductsDecayIt (G4double parentMass=-1.0)=0
 
const G4StringGetKinematicsName () const
 
G4double GetBR () const
 
G4int GetNumberOfDaughters () const
 
G4ParticleDefinitionGetParent ()
 
G4ParticleDefinitionGetDaughter (G4int anIndex)
 
G4int GetAngularMomentum ()
 
const G4StringGetParentName () const
 
const G4StringGetDaughterName (G4int anIndex) const
 
G4double GetParentMass () const
 
G4double GetDaughterMass (G4int anIndex) const
 
void SetParent (const G4ParticleDefinition *particle_type)
 
void SetParent (const G4String &particle_name)
 
void SetBR (G4double value)
 
void SetNumberOfDaughters (G4int value)
 
void SetDaughter (G4int anIndex, const G4ParticleDefinition *particle_type)
 
void SetDaughter (G4int anIndex, const G4String &particle_name)
 
void SetVerboseLevel (G4int value)
 
G4int GetVerboseLevel () const
 
void DumpInfo ()
 
G4double GetRangeMass () const
 
void SetRangeMass (G4double val)
 
virtual G4bool IsOKWithParentMass (G4double parentMass)
 
void SetPolarization (const G4ThreeVector &)
 
const G4ThreeVectorGetPolarization () const
 

Protected Member Functions

void ClearDaughtersName ()
 
void CheckAndFillDaughters ()
 
void CheckAndFillParent ()
 
 G4VDecayChannel ()
 
 G4VDecayChannel (const G4VDecayChannel &)
 
G4VDecayChanneloperator= (const G4VDecayChannel &)
 
G4double DynamicalMass (G4double massPDG, G4double width, G4double maxDev=+1.) const
 

Protected Attributes

G4String kinematics_name
 
G4double rbranch
 
G4int numberOfDaughters
 
G4Stringparent_name
 
G4String ** daughters_name
 
G4double rangeMass
 
G4ThreeVector parent_polarization
 
G4ParticleTableparticletable
 
G4int verboseLevel
 
G4ParticleDefinitionG4MT_parent
 
G4ParticleDefinition ** G4MT_daughters
 
G4double G4MT_parent_mass
 
G4doubleG4MT_daughters_mass
 
G4doubleG4MT_daughters_width
 
G4Mutex daughtersMutex
 
G4Mutex parentMutex
 

Static Protected Attributes

static const G4String noName = " "
 

Private Member Functions

void FillDaughters ()
 
void FillParent ()
 
const G4StringGetNoName () const
 

Detailed Description

Definition at line 53 of file G4VDecayChannel.hh.

Constructor & Destructor Documentation

◆ G4VDecayChannel() [1/4]

G4VDecayChannel::G4VDecayChannel ( const G4String aName,
G4int  Verbose = 1 
)

Definition at line 69 of file G4VDecayChannel.cc.

70  :kinematics_name(aName),
71  rbranch(0.0),
74  rangeMass(2.5),
76  particletable(0),
77  verboseLevel(Verbose),
80 {
81  G4MT_parent = 0;
82  G4MT_daughters = 0;
83  G4MT_parent_mass = 0.0;
86 
87  // set pointer to G4ParticleTable (static and singleton object)
89 }
G4double * G4MT_daughters_mass
G4ParticleDefinition * G4MT_parent
G4ParticleDefinition ** G4MT_daughters
G4double G4MT_parent_mass
G4ParticleTable * particletable
#define G4MUTEX_INITIALIZER
Definition: G4Threading.hh:175
G4String kinematics_name
G4String * parent_name
G4ThreeVector parent_polarization
static G4ParticleTable * GetParticleTable()
G4double * G4MT_daughters_width
G4String ** daughters_name
Here is the call graph for this function:

◆ G4VDecayChannel() [2/4]

G4VDecayChannel::G4VDecayChannel ( const G4String aName,
const G4String theParentName,
G4double  theBR,
G4int  theNumberOfDaughters,
const G4String theDaughterName1,
const G4String theDaughterName2 = "",
const G4String theDaughterName3 = "",
const G4String theDaughterName4 = "" 
)

Definition at line 91 of file G4VDecayChannel.cc.

99  :kinematics_name(aName),
100  rbranch(theBR),
101  numberOfDaughters(theNumberOfDaughters),
103  rangeMass(1.0),
105  particletable(0),
106  verboseLevel(1),
109 {
110  G4MT_parent = 0;
111  G4MT_daughters = 0;
112  G4MT_parent_mass = 0.0;
115 
116  // set pointer to G4ParticleTable (static and singleton object)
118 
119  // parent name
120  parent_name = new G4String(theParentName);
121 
122  // cleate array
125 
126  // daughters' name
127  if (numberOfDaughters>0) daughters_name[0] = new G4String(theDaughterName1);
128  if (numberOfDaughters>1) daughters_name[1] = new G4String(theDaughterName2);
129  if (numberOfDaughters>2) daughters_name[2] = new G4String(theDaughterName3);
130  if (numberOfDaughters>3) daughters_name[3] = new G4String(theDaughterName4);
131 }
G4double * G4MT_daughters_mass
Int_t index
G4ParticleDefinition * G4MT_parent
G4ParticleDefinition ** G4MT_daughters
G4double G4MT_parent_mass
G4ParticleTable * particletable
int G4int
Definition: G4Types.hh:78
#define G4MUTEX_INITIALIZER
Definition: G4Threading.hh:175
G4String kinematics_name
G4String * parent_name
G4ThreeVector parent_polarization
static G4ParticleTable * GetParticleTable()
G4double * G4MT_daughters_width
G4String ** daughters_name
Here is the call graph for this function:

◆ ~G4VDecayChannel()

G4VDecayChannel::~G4VDecayChannel ( )
virtual

Definition at line 214 of file G4VDecayChannel.cc.

215 {
217  if (parent_name != 0) delete parent_name;
218  parent_name = 0;
219  if (G4MT_daughters_mass != 0) delete [] G4MT_daughters_mass;
221  if (G4MT_daughters_width != 0) delete [] G4MT_daughters_width;
225 }
G4double * G4MT_daughters_mass
G4String * parent_name
G4double * G4MT_daughters_width
#define G4MUTEXDESTROY(mutex)
Definition: G4Threading.hh:178
Here is the call graph for this function:

◆ G4VDecayChannel() [3/4]

G4VDecayChannel::G4VDecayChannel ( )
protected

Definition at line 49 of file G4VDecayChannel.cc.

50  :kinematics_name(""),
51  rbranch(0.0),
54  rangeMass(2.5),
56  particletable(0),
57  verboseLevel(1)
58 {
59  G4MT_parent = 0;
60  G4MT_daughters = 0;
61  G4MT_parent_mass = 0.0;
64 
65  // set pointer to G4ParticleTable (static and singleton object)
67 }
G4double * G4MT_daughters_mass
G4ParticleDefinition * G4MT_parent
G4ParticleDefinition ** G4MT_daughters
G4double G4MT_parent_mass
G4ParticleTable * particletable
G4String kinematics_name
G4String * parent_name
G4ThreeVector parent_polarization
static G4ParticleTable * GetParticleTable()
G4double * G4MT_daughters_width
G4String ** daughters_name
Here is the call graph for this function:
Here is the caller graph for this function:

◆ G4VDecayChannel() [4/4]

G4VDecayChannel::G4VDecayChannel ( const G4VDecayChannel right)
protected

Definition at line 133 of file G4VDecayChannel.cc.

134 {
136  verboseLevel = right.verboseLevel;
137  rbranch = right.rbranch;
138  rangeMass = right.rangeMass;
139 
140  // copy parent name
141  parent_name = new G4String(*right.parent_name);
142  G4MT_parent = 0;
143  G4MT_parent_mass = 0.0;
144 
145  //create array
147 
148  daughters_name =0;
149  if ( numberOfDaughters >0 ) {
151  //copy daughters name
152  for (G4int index=0; index < numberOfDaughters; index++)
153  {
155  }
156  }
157 
158  //
160  G4MT_daughters = 0;
162 
163  // particle table
165 
167 
170 }
G4double * G4MT_daughters_mass
Int_t index
G4ParticleDefinition * G4MT_parent
G4ParticleDefinition ** G4MT_daughters
#define G4MUTEXINIT(mutex)
Definition: G4Threading.hh:177
G4double G4MT_parent_mass
G4ParticleTable * particletable
int G4int
Definition: G4Types.hh:78
G4String kinematics_name
G4String * parent_name
G4ThreeVector parent_polarization
static G4ParticleTable * GetParticleTable()
G4double * G4MT_daughters_width
G4String ** daughters_name
Here is the call graph for this function:

Member Function Documentation

◆ CheckAndFillDaughters()

void G4VDecayChannel::CheckAndFillDaughters ( )
inlineprotected

Definition at line 324 of file G4VDecayChannel.hh.

324  {
326  if ( G4MT_daughters ==0 ) {
327  l.unlock();
328  FillDaughters();
329  }
330 }
G4ParticleDefinition ** G4MT_daughters
Here is the call graph for this function:
Here is the caller graph for this function:

◆ CheckAndFillParent()

void G4VDecayChannel::CheckAndFillParent ( )
inlineprotected

Definition at line 332 of file G4VDecayChannel.hh.

332  {
334  if ( G4MT_parent == 0 ) {
335  l.unlock();
336  FillParent();
337  }
338 }
G4ParticleDefinition * G4MT_parent
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ClearDaughtersName()

void G4VDecayChannel::ClearDaughtersName ( )
protected

Definition at line 227 of file G4VDecayChannel.cc.

228 {
230  if ( daughters_name != 0) {
231  if (numberOfDaughters>0) {
232 #ifdef G4VERBOSE
233  if (verboseLevel>1) {
234  G4cout << "G4VDecayChannel::ClearDaughtersName "
235  << " for " << *parent_name << G4endl;
236  }
237 #endif
238  for (G4int index=0; index < numberOfDaughters; index++) {
239  if (daughters_name[index] != 0) delete daughters_name[index];
240  }
241  }
242  delete [] daughters_name;
243  daughters_name = 0;
244  }
245  //
246  if (G4MT_daughters != 0) delete [] G4MT_daughters;
247  if (G4MT_daughters_mass != 0) delete [] G4MT_daughters_mass;
248  if (G4MT_daughters_width != 0) delete [] G4MT_daughters_width;
250  G4MT_daughters = 0;
253 
254  numberOfDaughters = 0;
255 }
G4double * G4MT_daughters_mass
Int_t index
G4ParticleDefinition ** G4MT_daughters
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
G4String * parent_name
G4double * G4MT_daughters_width
#define G4endl
Definition: G4ios.hh:61
G4String ** daughters_name
Here is the caller graph for this function:

◆ DecayIt()

virtual G4DecayProducts* G4VDecayChannel::DecayIt ( G4double  parentMass = -1.0)
pure virtual

◆ DumpInfo()

void G4VDecayChannel::DumpInfo ( )

Definition at line 547 of file G4VDecayChannel.cc.

548 {
549  G4cout << " BR: " << rbranch << " [" << kinematics_name << "]";
550  G4cout << " : " ;
551  for (G4int index=0; index < numberOfDaughters; index++){
552  if(daughters_name[index] != 0) {
553  G4cout << " " << *(daughters_name[index]);
554  } else {
555  G4cout << " not defined ";
556  }
557  }
558  G4cout << G4endl;
559 }
Int_t index
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
G4String kinematics_name
#define G4endl
Definition: G4ios.hh:61
G4String ** daughters_name
Here is the caller graph for this function:

◆ DynamicalMass()

G4double G4VDecayChannel::DynamicalMass ( G4double  massPDG,
G4double  width,
G4double  maxDev = +1. 
) const
protected

Definition at line 567 of file G4VDecayChannel.cc.

568 {
569  if (maxDev >rangeMass) maxDev = rangeMass;
570  if (maxDev <=-1.*rangeMass) return massPDG; // can not calculate
571 
572  G4double x = G4UniformRand()*(maxDev+rangeMass) - rangeMass;
574  const size_t MAX_LOOP=10000;
575  for (size_t loop_counter=0; loop_counter <MAX_LOOP; ++loop_counter){
576  if ( y * (width*width*x*x + massPDG*massPDG*width*width) <= massPDG*massPDG*width*width ) break;
577  x = G4UniformRand()*(maxDev+rangeMass) - rangeMass;
578  y = G4UniformRand();
579  }
580  G4double mass = massPDG + x*width;
581  return mass;
582 }
#define width
Double_t y
#define G4UniformRand()
Definition: Randomize.hh:97
double G4double
Definition: G4Types.hh:76
Here is the caller graph for this function:

◆ FillDaughters()

void G4VDecayChannel::FillDaughters ( )
private

Definition at line 330 of file G4VDecayChannel.cc.

331 {
332  G4AutoLock lock(&daughtersMutex);
333  //Double check, check again if another thread has already filled this, in
334  //case do not need to do anything
335  if ( G4MT_daughters != 0 ) return;
336 
337  G4int index;
338 
339 #ifdef G4VERBOSE
340  if (verboseLevel>1) G4cout << "G4VDecayChannel::FillDaughters()" <<G4endl;
341 #endif
342  if (G4MT_daughters != 0) {
343  delete [] G4MT_daughters;
344  G4MT_daughters = 0;
345  }
346 
347  // parent mass
349  G4double parentmass = G4MT_parent->GetPDGMass();
350 
351  //
352  G4double sumofdaughtermass = 0.0;
353  G4double sumofdaughterwidthsq = 0.0;
354 
355  if ((numberOfDaughters <=0) || (daughters_name == 0) ){
356 #ifdef G4VERBOSE
357  if (verboseLevel>0) {
358  G4cout << "G4VDecayChannel::FillDaughters "
359  << "[ " << G4MT_parent->GetParticleName() << " ]"
360  << "numberOfDaughters is not defined yet";
361  }
362 #endif
363  G4MT_daughters = 0;
364  G4Exception("G4VDecayChannel::FillDaughters",
365  "PART011", FatalException,
366  "Can not fill daughters: numberOfDaughters is not defined yet");
367  }
368 
369  //create and set the array of pointers to daughter particles
371  if (G4MT_daughters_mass != 0) delete [] G4MT_daughters_mass;
372  if (G4MT_daughters_width != 0) delete [] G4MT_daughters_width;
375  // loop over all daughters
376  for (index=0; index < numberOfDaughters; index++) {
377  if (daughters_name[index] == 0) {
378  // daughter name is not defined
379 #ifdef G4VERBOSE
380  if (verboseLevel>0) {
381  G4cout << "G4VDecayChannel::FillDaughters "
382  << "[ " << G4MT_parent->GetParticleName() << " ]"
383  << index << "-th daughter is not defined yet" << G4endl;
384  }
385 #endif
386  G4MT_daughters[index] = 0;
387  G4Exception("G4VDecayChannel::FillDaughters",
388  "PART011", FatalException,
389  "Can not fill daughters: name of a daughter is not defined yet");
390  }
391  //search daughter particles in the particle table
393  if (G4MT_daughters[index] == 0) {
394  // can not find the daughter particle
395 #ifdef G4VERBOSE
396  if (verboseLevel>0) {
397  G4cout << "G4VDecayChannel::FillDaughters "
398  << "[ " << G4MT_parent->GetParticleName() << " ]"
399  << index << ":" << *daughters_name[index]
400  << " is not defined !!" << G4endl;
401  G4cout << " The BR of this decay mode is set to zero " << G4endl;
402  }
403 #endif
404  SetBR(0.0);
405  return;
406  }
407 #ifdef G4VERBOSE
408  if (verboseLevel>1) {
409  G4cout << index << ":" << *daughters_name[index];
410  G4cout << ":" << G4MT_daughters[index] << G4endl;
411  }
412 #endif
415  G4MT_daughters_width[index] = d_width;
416  sumofdaughtermass += G4MT_daughters[index]->GetPDGMass();
417  sumofdaughterwidthsq += d_width*d_width;
418  } // end loop over all daughters
419 
420  // check sum of daghter mass
421  G4double widthMass = std::sqrt(G4MT_parent->GetPDGWidth()*G4MT_parent->GetPDGWidth()+sumofdaughterwidthsq);
422  if ( (G4MT_parent->GetParticleType() != "nucleus") &&
423  (sumofdaughtermass > parentmass + rangeMass*widthMass) ){
424  // !!! illegal mass !!!
425 #ifdef G4VERBOSE
426  if (GetVerboseLevel()>0) {
427  G4cout << "G4VDecayChannel::FillDaughters "
428  << "[ " << G4MT_parent->GetParticleName() << " ]"
429  << " Energy/Momentum conserevation breaks " <<G4endl;
430  if (GetVerboseLevel()>1) {
431  G4cout << " parent:" << *parent_name
432  << " mass:" << parentmass/GeV << "[GeV/c/c]" <<G4endl;
433  for (index=0; index < numberOfDaughters; index++){
434  G4cout << " daughter " << index << ":" << *daughters_name[index]
435  << " mass:" << G4MT_daughters[index]->GetPDGMass()/GeV
436  << "[GeV/c/c]" <<G4endl;
437  }
438  }
439  }
440 #endif
441  }
442 }
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
void SetBR(G4double value)
G4double * G4MT_daughters_mass
Int_t index
G4ParticleDefinition * G4MT_parent
G4ParticleDefinition ** G4MT_daughters
const G4String & GetParticleType() const
G4ParticleTable * particletable
int G4int
Definition: G4Types.hh:78
const G4String & GetParticleName() const
G4GLOB_DLL std::ostream G4cout
G4double GetPDGWidth() const
G4String * parent_name
static const double GeV
Definition: G4SIunits.hh:214
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
G4double * G4MT_daughters_width
#define G4endl
Definition: G4ios.hh:61
G4int GetVerboseLevel() const
double G4double
Definition: G4Types.hh:76
G4String ** daughters_name
Here is the call graph for this function:
Here is the caller graph for this function:

◆ FillParent()

void G4VDecayChannel::FillParent ( )
private

Definition at line 445 of file G4VDecayChannel.cc.

446 {
447  G4AutoLock lock(&parentMutex);
448  //Double check, check again if another thread has already filled this, in
449  //case do not need to do anything
450  if ( G4MT_parent != 0 ) return;
451 
452  if (parent_name == 0) {
453  // parent name is not defined
454 #ifdef G4VERBOSE
455  if (verboseLevel>0) {
456  G4cout << "G4VDecayChannel::FillParent "
457  << ": parent name is not defined !!" << G4endl;
458  }
459 #endif
460  G4MT_parent = 0;
461  G4Exception("G4VDecayChannel::FillParent()",
462  "PART012", FatalException,
463  "Can not fill parent: parent name is not defined yet");
464  return;
465  }
466  // search parent particle in the particle table
468  if (G4MT_parent == 0) {
469  // parent particle does not exist
470 #ifdef G4VERBOSE
471  if (verboseLevel>0) {
472  G4cout << "G4VDecayChannel::FillParent "
473  << *parent_name << " does not exist !!" << G4endl;
474  }
475 #endif
476  G4Exception("G4VDecayChannel::FillParent()",
477  "PART012", FatalException,
478  "Can not fill parent: parent does not exist");
479  return;
480  }
482 }
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
G4ParticleDefinition * G4MT_parent
G4double G4MT_parent_mass
G4ParticleTable * particletable
G4GLOB_DLL std::ostream G4cout
G4String * parent_name
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
#define G4endl
Definition: G4ios.hh:61
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetAngularMomentum()

G4int G4VDecayChannel::GetAngularMomentum ( )

Definition at line 489 of file G4VDecayChannel.cc.

490 {
491  // determine angular momentum
492 
493  // fill pointers to daughter particles if not yet set
495 
496  const G4int PiSpin = G4MT_parent->GetPDGiSpin();
497  const G4int PParity = G4MT_parent->GetPDGiParity();
498  if (2==numberOfDaughters) { // up to now we can only handle two particle decays
499  const G4int D1iSpin = G4MT_daughters[0]->GetPDGiSpin();
500  const G4int D1Parity = G4MT_daughters[0]->GetPDGiParity();
501  const G4int D2iSpin = G4MT_daughters[1]->GetPDGiSpin();
502  const G4int D2Parity = G4MT_daughters[1]->GetPDGiParity();
503  const G4int MiniSpin = std::abs (D1iSpin - D2iSpin);
504  const G4int MaxiSpin = D1iSpin + D2iSpin;
505  const G4int lMax = (PiSpin+D1iSpin+D2iSpin)/2; // l is allways int
506  G4int lMin;
507 #ifdef G4VERBOSE
508  if (verboseLevel>1) {
509  G4cout << "iSpin: " << PiSpin << " -> " << D1iSpin << " + " << D2iSpin << G4endl;
510  G4cout << "2*jmin, 2*jmax, lmax " << MiniSpin << " " << MaxiSpin << " " << lMax << G4endl;
511  }
512 #endif
513  for (G4int j=MiniSpin; j<=MaxiSpin; j+=2){ // loop over all possible spin couplings
514  lMin = std::abs(PiSpin-j)/2;
515 #ifdef G4VERBOSE
516  if (verboseLevel>1)
517  G4cout << "-> checking 2*j=" << j << G4endl;
518 #endif
519  for (G4int l=lMin; l<=lMax; l++) {
520 #ifdef G4VERBOSE
521  if (verboseLevel>1)
522  G4cout << " checking l=" << l << G4endl;
523 #endif
524  if (l%2==0) {
525  if (PParity == D1Parity*D2Parity) { // check parity for this l
526  return l;
527  }
528  } else {
529  if (PParity == -1*D1Parity*D2Parity) { // check parity for this l
530  return l;
531  }
532  }
533  }
534  }
535  } else {
536  G4Exception("G4VDecayChannel::GetAngularMomentum",
537  "PART111", JustWarning,
538  "Sorry, can't handle 3 particle decays (up to now)");
539  return 0;
540  }
541  G4Exception ("G4VDecayChannel::GetAngularMomentum",
542  "PART111", JustWarning,
543  "Can't find angular momentum for this decay");
544  return 0;
545 }
void CheckAndFillDaughters()
G4ParticleDefinition * G4MT_parent
G4ParticleDefinition ** G4MT_daughters
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
#define G4endl
Definition: G4ios.hh:61
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetBR()

G4double G4VDecayChannel::GetBR ( ) const
inline

Definition at line 297 of file G4VDecayChannel.hh.

297 { return rbranch; }
Here is the caller graph for this function:

◆ GetDaughter()

G4ParticleDefinition * G4VDecayChannel::GetDaughter ( G4int  anIndex)
inline

Definition at line 212 of file G4VDecayChannel.hh.

213  {
214  // pointers to daughter particles are filled, if they are not set yet
216 
217  // get the pointer to a daughter particle
218  if ( (anIndex>=0) && (anIndex<numberOfDaughters) ) {
219  return G4MT_daughters[anIndex];
220  } else {
221  if (verboseLevel>0)
222  G4cout << "G4VDecayChannel::GetDaughter index out of range "<<anIndex<<G4endl;
223  return 0;
224  }
225 }
void CheckAndFillDaughters()
G4ParticleDefinition ** G4MT_daughters
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetDaughterMass()

G4double G4VDecayChannel::GetDaughterMass ( G4int  anIndex) const
inline

Definition at line 242 of file G4VDecayChannel.hh.

243 {
244  if ( (anIndex>=0) && (anIndex<numberOfDaughters) ) {
245  return G4MT_daughters_mass[anIndex];
246  } else {
247  if (verboseLevel>0){
248  G4cout << "G4VDecayChannel::GetDaughterMass ";
249  G4cout << "index out of range " << anIndex << G4endl;
250  }
251  return 0.0;
252  }
253 }
G4double * G4MT_daughters_mass
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
Here is the caller graph for this function:

◆ GetDaughterName()

const G4String & G4VDecayChannel::GetDaughterName ( G4int  anIndex) const
inline

Definition at line 228 of file G4VDecayChannel.hh.

229 {
230  if ( (anIndex>=0) && (anIndex<numberOfDaughters) ) {
231  return *daughters_name[anIndex];
232  } else {
233  if (verboseLevel>0){
234  G4cout << "G4VDecayChannel::GetDaughterName ";
235  G4cout << "index out of range " << anIndex << G4endl;
236  }
237  return GetNoName();
238  }
239 }
const G4String & GetNoName() const
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
G4String ** daughters_name
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetKinematicsName()

const G4String & G4VDecayChannel::GetKinematicsName ( ) const
inline

Definition at line 291 of file G4VDecayChannel.hh.

291 { return kinematics_name; }
G4String kinematics_name
Here is the caller graph for this function:

◆ GetNoName()

const G4String & G4VDecayChannel::GetNoName ( ) const
private

Definition at line 561 of file G4VDecayChannel.cc.

562 {
563  return noName;
564 }
static const G4String noName
Here is the caller graph for this function:

◆ GetNumberOfDaughters()

G4int G4VDecayChannel::GetNumberOfDaughters ( ) const
inline

Definition at line 285 of file G4VDecayChannel.hh.

286 {
287  return numberOfDaughters;
288 }
Here is the caller graph for this function:

◆ GetParent()

G4ParticleDefinition * G4VDecayChannel::GetParent ( )
inline

Definition at line 256 of file G4VDecayChannel.hh.

257 {
258  // the pointer to the parent particle is filled, if it is not set yet
260  // get the pointer to the parent particle
261  return G4MT_parent;
262 }
G4ParticleDefinition * G4MT_parent
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetParentMass()

G4double G4VDecayChannel::GetParentMass ( ) const
inline

Definition at line 271 of file G4VDecayChannel.hh.

272 {
273  return G4MT_parent_mass;
274 }
G4double G4MT_parent_mass
Here is the caller graph for this function:

◆ GetParentName()

const G4String & G4VDecayChannel::GetParentName ( ) const
inline

Definition at line 265 of file G4VDecayChannel.hh.

266 {
267  return *parent_name;
268 }
G4String * parent_name
Here is the caller graph for this function:

◆ GetPolarization()

const G4ThreeVector & G4VDecayChannel::GetPolarization ( ) const
inline

Definition at line 318 of file G4VDecayChannel.hh.

319 {
320  return parent_polarization;
321 }
G4ThreeVector parent_polarization
Here is the caller graph for this function:

◆ GetRangeMass()

G4double G4VDecayChannel::GetRangeMass ( ) const
inline

Definition at line 306 of file G4VDecayChannel.hh.

306 { return rangeMass; }
Here is the caller graph for this function:

◆ GetVerboseLevel()

G4int G4VDecayChannel::GetVerboseLevel ( ) const
inline

Definition at line 303 of file G4VDecayChannel.hh.

303 { return verboseLevel; }
Here is the caller graph for this function:

◆ IsOKWithParentMass()

G4bool G4VDecayChannel::IsOKWithParentMass ( G4double  parentMass)
virtual

Reimplemented in G4PhaseSpaceDecayChannel.

Definition at line 584 of file G4VDecayChannel.cc.

585 {
586  G4double sumOfDaughterMassMin=0.0;
589 
590  for (G4int index=0; index < numberOfDaughters; index++) {
591  sumOfDaughterMassMin +=
593  }
594  return (parentMass > sumOfDaughterMassMin);
595 }
void CheckAndFillDaughters()
G4double * G4MT_daughters_mass
Int_t index
int G4int
Definition: G4Types.hh:78
G4double * G4MT_daughters_width
double G4double
Definition: G4Types.hh:76
Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator!=()

G4int G4VDecayChannel::operator!= ( const G4VDecayChannel right) const
inline

Definition at line 77 of file G4VDecayChannel.hh.

77 {return (this != &right);}
Here is the call graph for this function:

◆ operator<()

G4int G4VDecayChannel::operator< ( const G4VDecayChannel right) const
inline

Definition at line 206 of file G4VDecayChannel.hh.

207 {
208  return (this->rbranch < right.rbranch);
209 }
Here is the caller graph for this function:

◆ operator=()

G4VDecayChannel & G4VDecayChannel::operator= ( const G4VDecayChannel right)
protected

Definition at line 172 of file G4VDecayChannel.cc.

173 {
174  if (this != &right) {
176  verboseLevel = right.verboseLevel;
177  rbranch = right.rbranch;
178  rangeMass = right.rangeMass;
180  // copy parent name
181  parent_name = new G4String(*right.parent_name);
182 
183  // clear daughters_name array
185 
186  // recreate array
188  if ( numberOfDaughters >0 ) {
191  //copy daughters name
192  for (G4int index=0; index < numberOfDaughters; index++) {
194  }
195  }
196  }
197 
198  //
199  G4MT_parent = 0;
200  G4MT_daughters = 0;
201  G4MT_parent_mass = 0.0;
204 
205  // particle table
207 
210 
211  return *this;
212 }
G4double * G4MT_daughters_mass
Int_t index
G4ParticleDefinition * G4MT_parent
G4ParticleDefinition ** G4MT_daughters
#define G4MUTEXINIT(mutex)
Definition: G4Threading.hh:177
G4double G4MT_parent_mass
G4ParticleTable * particletable
int G4int
Definition: G4Types.hh:78
G4String kinematics_name
G4String * parent_name
G4ThreeVector parent_polarization
static G4ParticleTable * GetParticleTable()
G4double * G4MT_daughters_width
G4String ** daughters_name
Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator==()

G4int G4VDecayChannel::operator== ( const G4VDecayChannel right) const
inline

Definition at line 76 of file G4VDecayChannel.hh.

76 {return (this == &right);}

◆ SetBR()

void G4VDecayChannel::SetBR ( G4double  value)
inline

Definition at line 294 of file G4VDecayChannel.hh.

294 { rbranch = value; }
Here is the caller graph for this function:

◆ SetDaughter() [1/2]

void G4VDecayChannel::SetDaughter ( G4int  anIndex,
const G4ParticleDefinition particle_type 
)

Definition at line 325 of file G4VDecayChannel.cc.

326 {
327  if (parent_type != 0) SetDaughter(anIndex, parent_type->GetParticleName());
328 }
void SetDaughter(G4int anIndex, const G4ParticleDefinition *particle_type)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetDaughter() [2/2]

void G4VDecayChannel::SetDaughter ( G4int  anIndex,
const G4String particle_name 
)

Definition at line 269 of file G4VDecayChannel.cc.

271 {
272  // check numberOfDaughters is positive
273  if (numberOfDaughters<=0) {
274 #ifdef G4VERBOSE
275  if (verboseLevel>0) {
276  G4cout << "G4VDecayChannel::SetDaughter: "
277  << "Number of daughters is not defined" << G4endl;
278  }
279 #endif
280  return;
281  }
282 
283  //ANDREA:-> Feb 25 2016
284  // An analysis of this code, shows that this method is called
285  // only in the constructor of derived classes.
286  // The general idea of this method is probably to support
287  // the possibility to re-define daughters on the fly, however
288  // this design is extremely problematic for MT mode, we thus
289  // require (as practically happens) that the method is called only
290  // at construction, i.e. when G4MT_daugheters == 0
291  // moreover this method can be called only after SetNumberOfDaugthers
292  // has been called (see previous if), in such a case daughters_name != 0
293  if ( daughters_name == 0 ) {
294  G4Exception("G4VDecayChannel::SetDaughter","PART112",FatalException,
295  "Trying to add a daughter without specifying number of secondaries, useSetNumberOfDaughters first");
296  return;
297  }
298  if ( G4MT_daughters != 0 ) {
299  G4Exception("G4VDecayChannel::SetDaughter","PART111",FatalException,
300  "Trying to modify a daughter of a decay channel, but decay channel already has daughters.");
301  return;
302  }
303  //<-:ANDREA
304 
305  // check an index
306  if ( (anIndex<0) || (anIndex>=numberOfDaughters) ) {
307 #ifdef G4VERBOSE
308  if (verboseLevel>0) {
309  G4cout << "G4VDecayChannel::SetDaughter"
310  << "index out of range " << anIndex << G4endl;
311  }
312 #endif
313  } else {
314  // fill the name
315  daughters_name[anIndex] = new G4String(particle_name);
316 #ifdef G4VERBOSE
317  if (verboseLevel>1) {
318  G4cout << "G4VDecayChannel::SetDaughter[" << anIndex <<"] :";
319  G4cout << daughters_name[anIndex] << ":" << *daughters_name[anIndex]<<G4endl;
320  }
321 #endif
322  }
323 }
G4ParticleDefinition ** G4MT_daughters
G4GLOB_DLL std::ostream G4cout
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
#define G4endl
Definition: G4ios.hh:61
G4String ** daughters_name
Here is the call graph for this function:

◆ SetNumberOfDaughters()

void G4VDecayChannel::SetNumberOfDaughters ( G4int  value)

Definition at line 257 of file G4VDecayChannel.cc.

258 {
259  if (size >0) {
260  // remove old contents
262  // cleate array
263  daughters_name = new G4String*[size];
264  for (G4int index=0;index<size;index++) daughters_name[index]=0;
265  numberOfDaughters = size;
266  }
267 }
Int_t index
int G4int
Definition: G4Types.hh:78
G4String ** daughters_name
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetParent() [1/2]

void G4VDecayChannel::SetParent ( const G4ParticleDefinition particle_type)

Definition at line 484 of file G4VDecayChannel.cc.

485 {
486  if (parent_type != 0) SetParent(parent_type->GetParticleName());
487 }
void SetParent(const G4ParticleDefinition *particle_type)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetParent() [2/2]

void G4VDecayChannel::SetParent ( const G4String particle_name)
inline

Definition at line 277 of file G4VDecayChannel.hh.

278 {
279  if (parent_name != 0) delete parent_name;
280  parent_name = new G4String(particle_name);
281  G4MT_parent = 0;
282 }
G4ParticleDefinition * G4MT_parent
G4String * parent_name

◆ SetPolarization()

void G4VDecayChannel::SetPolarization ( const G4ThreeVector polar)
inline

Definition at line 312 of file G4VDecayChannel.hh.

313 {
314  parent_polarization = polar;
315 }
G4ThreeVector parent_polarization
Here is the caller graph for this function:

◆ SetRangeMass()

void G4VDecayChannel::SetRangeMass ( G4double  val)
inline

Definition at line 309 of file G4VDecayChannel.hh.

309 { if(val>=0.) rangeMass=val; }
Here is the caller graph for this function:

◆ SetVerboseLevel()

void G4VDecayChannel::SetVerboseLevel ( G4int  value)
inline

Definition at line 300 of file G4VDecayChannel.hh.

300 { verboseLevel = value; }
Here is the caller graph for this function:

Member Data Documentation

◆ daughters_name

G4String** G4VDecayChannel::daughters_name
protected

Definition at line 173 of file G4VDecayChannel.hh.

◆ daughtersMutex

G4Mutex G4VDecayChannel::daughtersMutex
protected

Definition at line 197 of file G4VDecayChannel.hh.

◆ G4MT_daughters

G4ParticleDefinition** G4VDecayChannel::G4MT_daughters
protected

Definition at line 193 of file G4VDecayChannel.hh.

◆ G4MT_daughters_mass

G4double* G4VDecayChannel::G4MT_daughters_mass
protected

Definition at line 195 of file G4VDecayChannel.hh.

◆ G4MT_daughters_width

G4double* G4VDecayChannel::G4MT_daughters_width
protected

Definition at line 196 of file G4VDecayChannel.hh.

◆ G4MT_parent

G4ParticleDefinition* G4VDecayChannel::G4MT_parent
protected

Definition at line 192 of file G4VDecayChannel.hh.

◆ G4MT_parent_mass

G4double G4VDecayChannel::G4MT_parent_mass
protected

Definition at line 194 of file G4VDecayChannel.hh.

◆ kinematics_name

G4String G4VDecayChannel::kinematics_name
protected

Definition at line 165 of file G4VDecayChannel.hh.

◆ noName

const G4String G4VDecayChannel::noName = " "
staticprotected

Definition at line 190 of file G4VDecayChannel.hh.

◆ numberOfDaughters

G4int G4VDecayChannel::numberOfDaughters
protected

Definition at line 169 of file G4VDecayChannel.hh.

◆ parent_name

G4String* G4VDecayChannel::parent_name
protected

Definition at line 171 of file G4VDecayChannel.hh.

◆ parent_polarization

G4ThreeVector G4VDecayChannel::parent_polarization
protected

Definition at line 179 of file G4VDecayChannel.hh.

◆ parentMutex

G4Mutex G4VDecayChannel::parentMutex
protected

Definition at line 198 of file G4VDecayChannel.hh.

◆ particletable

G4ParticleTable* G4VDecayChannel::particletable
protected

Definition at line 182 of file G4VDecayChannel.hh.

◆ rangeMass

G4double G4VDecayChannel::rangeMass
protected

Definition at line 176 of file G4VDecayChannel.hh.

◆ rbranch

G4double G4VDecayChannel::rbranch
protected

Definition at line 167 of file G4VDecayChannel.hh.

◆ verboseLevel

G4int G4VDecayChannel::verboseLevel
protected

Definition at line 185 of file G4VDecayChannel.hh.


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