Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4VDecayChannel Class Referenceabstract

#include <G4VDecayChannel.hh>

+ Inheritance 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 ()
 

Protected Member Functions

 G4VDecayChannel ()
 
 G4VDecayChannel (const G4VDecayChannel &)
 
G4VDecayChanneloperator= (const G4VDecayChannel &)
 
void ClearDaughtersName ()
 
void FillDaughters ()
 
void FillParent ()
 

Protected Attributes

G4String kinematics_name
 
G4double rbranch
 
G4int numberOfDaughters
 
G4Stringparent_name
 
G4String ** daughters_name
 
G4ParticleTableparticletable
 
G4ParticleDefinitionparent
 
G4ParticleDefinition ** daughters
 
G4double parent_mass
 
G4doubledaughters_mass
 
G4int verboseLevel
 

Static Protected Attributes

static const G4String noName = " "
 

Detailed Description

Definition at line 49 of file G4VDecayChannel.hh.

Constructor & Destructor Documentation

◆ G4VDecayChannel() [1/4]

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

Definition at line 63 of file G4VDecayChannel.cc.

64 :kinematics_name(aName),
65 rbranch(0.0),
69 parent(0), daughters(0),
71 verboseLevel(Verbose)
72{
73 // set pointer to G4ParticleTable (static and singleton object)
75}
static G4ParticleTable * GetParticleTable()
G4String * parent_name
G4String ** daughters_name
G4double * daughters_mass
G4ParticleDefinition * parent
G4ParticleDefinition ** daughters
G4ParticleTable * particletable
G4String kinematics_name

◆ 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 77 of file G4VDecayChannel.cc.

85 :kinematics_name(aName),
86 rbranch(theBR),
87 numberOfDaughters(theNumberOfDaughters),
90 parent(0), daughters(0),
92 verboseLevel(1)
93{
94 // set pointer to G4ParticleTable (static and singleton object)
96
97 // parent name
98 parent_name = new G4String(theParentName);
99
100 // cleate array
102 for (G4int index=0;index<numberOfDaughters;index++) daughters_name[index]=0;
103
104 // daughters' name
105 if (numberOfDaughters>0) daughters_name[0] = new G4String(theDaughterName1);
106 if (numberOfDaughters>1) daughters_name[1] = new G4String(theDaughterName2);
107 if (numberOfDaughters>2) daughters_name[2] = new G4String(theDaughterName3);
108 if (numberOfDaughters>3) daughters_name[3] = new G4String(theDaughterName4);
109}
int G4int
Definition: G4Types.hh:66

◆ ~G4VDecayChannel()

G4VDecayChannel::~G4VDecayChannel ( )
virtual

Definition at line 183 of file G4VDecayChannel.cc.

184{
186 if (parent_name != 0) delete parent_name;
187 parent_name = 0;
188 if (daughters_mass != 0) delete [] daughters_mass;
190}

◆ G4VDecayChannel() [3/4]

G4VDecayChannel::G4VDecayChannel ( )
protected

Definition at line 48 of file G4VDecayChannel.cc.

49 :kinematics_name(""),
50 rbranch(0.0),
54 parent(0), daughters(0),
56 verboseLevel(1)
57{
58 // set pointer to G4ParticleTable (static and singleton object)
60}

◆ G4VDecayChannel() [4/4]

G4VDecayChannel::G4VDecayChannel ( const G4VDecayChannel right)
protected

Definition at line 113 of file G4VDecayChannel.cc.

114{
117 rbranch = right.rbranch;
118
119 // copy parent name
120 parent_name = new G4String(*right.parent_name);
121 parent = 0;
122 parent_mass = 0.0;
123
124 //create array
126
128 if ( numberOfDaughters >0 ) {
130 //copy daughters name
131 for (G4int index=0; index < numberOfDaughters; index++)
132 {
133 daughters_name[index] = new G4String(*right.daughters_name[index]);
134 }
135 }
136
137 //
138 daughters_mass = 0;
139 daughters = 0;
140
141 // particle table
143}

Member Function Documentation

◆ ClearDaughtersName()

void G4VDecayChannel::ClearDaughtersName ( )
protected

Definition at line 192 of file G4VDecayChannel.cc.

193{
194 if ( daughters_name != 0) {
195 if (numberOfDaughters>0) {
196#ifdef G4VERBOSE
197 if (verboseLevel>1) {
198 G4cerr << "G4VDecayChannel::ClearDaughtersName "
199 << " for " << *parent_name << G4endl;
200 }
201#endif
202 for (G4int index=0; index < numberOfDaughters; index++) {
203 if (daughters_name[index] != 0) delete daughters_name[index];
204 }
205 }
206 delete [] daughters_name;
207 daughters_name = 0;
208 }
209 //
210 if (daughters != 0) delete [] daughters;
211 if (daughters_mass != 0) delete [] daughters_mass;
212 daughters = 0;
213 daughters_mass = 0;
214
216}
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cerr

Referenced by G4DalitzDecayChannel::operator=(), G4KL3DecayChannel::operator=(), G4MuonDecayChannel::operator=(), G4MuonDecayChannelWithSpin::operator=(), G4MuonRadiativeDecayChannelWithSpin::operator=(), G4NeutronBetaDecayChannel::operator=(), G4PionRadiativeDecayChannel::operator=(), G4TauLeptonicDecayChannel::operator=(), operator=(), SetNumberOfDaughters(), and ~G4VDecayChannel().

◆ DecayIt()

◆ DumpInfo()

void G4VDecayChannel::DumpInfo ( )

Definition at line 480 of file G4VDecayChannel.cc.

481{
482 G4cout << " BR: " << rbranch << " [" << kinematics_name << "]";
483 G4cout << " : " ;
484 for (G4int index=0; index < numberOfDaughters; index++)
485 {
486 if(daughters_name[index] != 0) {
487 G4cout << " " << *(daughters_name[index]);
488 } else {
489 G4cout << " not defined ";
490 }
491 }
492 G4cout << G4endl;
493}
G4DLLIMPORT std::ostream G4cout

Referenced by G4GeneralPhaseSpaceDecay::DecayIt(), G4NuclearDecayChannel::DecayIt(), G4PhaseSpaceDecayChannel::DecayIt(), and G4KL3DecayChannel::G4KL3DecayChannel().

◆ FillDaughters()

void G4VDecayChannel::FillDaughters ( )
protected

Definition at line 282 of file G4VDecayChannel.cc.

283{
284 G4int index;
285
286#ifdef G4VERBOSE
287 if (verboseLevel>1) G4cout << "G4VDecayChannel::FillDaughters()" <<G4endl;
288#endif
289 if (daughters != 0) {
290 delete [] daughters;
291 daughters = 0;
292 }
293
294 // parent mass
295 if (parent == 0) FillParent();
296 G4double parentmass = parent->GetPDGMass();
297
298 //
299 G4double sumofdaughtermass = 0.0;
300 if ((numberOfDaughters <=0) || (daughters_name == 0) ){
301#ifdef G4VERBOSE
302 if (verboseLevel>0) {
303 G4cerr << "G4VDecayChannel::FillDaughters "
304 << "[ " << parent->GetParticleName() << " ]"
305 << "numberOfDaughters is not defined yet";
306 }
307#endif
308 daughters = 0;
309 G4Exception("G4VDecayChannel::FillDaughters",
310 "PART011", FatalException,
311 "Can not fill daughters: numberOfDaughters is not defined yet");
312 }
313
314 //create and set the array of pointers to daughter particles
316 if (daughters_mass != 0) delete [] daughters_mass;
318 // loop over all daughters
319 for (index=0; index < numberOfDaughters; index++) {
320 if (daughters_name[index] == 0) {
321 // daughter name is not defined
322#ifdef G4VERBOSE
323 if (verboseLevel>0) {
324 G4cerr << "G4VDecayChannel::FillDaughters "
325 << "[ " << parent->GetParticleName() << " ]"
326 << index << "-th daughter is not defined yet" << G4endl;
327 }
328#endif
329 daughters[index] = 0;
330 G4Exception("G4VDecayChannel::FillDaughters",
331 "PART011", FatalException,
332 "Can not fill daughters: name of a daughter is not defined yet");
333 }
334 //search daughter particles in the particle table
336 if (daughters[index] == 0) {
337 // can not find the daughter particle
338#ifdef G4VERBOSE
339 if (verboseLevel>0) {
340 G4cerr << "G4VDecayChannel::FillDaughters "
341 << "[ " << parent->GetParticleName() << " ]"
342 << index << ":" << *daughters_name[index]
343 << " is not defined !!" << G4endl;
344 G4cerr << " The BR of this decay mode is set to zero " << G4endl;
345 }
346#endif
347 SetBR(0.0);
348 return;
349 }
350#ifdef G4VERBOSE
351 if (verboseLevel>1) {
352 G4cout << index << ":" << *daughters_name[index];
353 G4cout << ":" << daughters[index] << G4endl;
354 }
355#endif
356 daughters_mass[index] = daughters[index]->GetPDGMass();
357 sumofdaughtermass += daughters[index]->GetPDGMass();
358 } // end loop over all daughters
359
360 // check sum of daghter mass
361 G4double widthMass = parent->GetPDGWidth();
362 if ( (parent->GetParticleType() != "nucleus") &&
363 (sumofdaughtermass > parentmass + 5*widthMass) ){
364 // !!! illegal mass !!!
365#ifdef G4VERBOSE
366 if (GetVerboseLevel()>0) {
367 G4cerr << "G4VDecayChannel::FillDaughters "
368 << "[ " << parent->GetParticleName() << " ]"
369 << " Energy/Momentum conserevation breaks " <<G4endl;
370 if (GetVerboseLevel()>1) {
371 G4cerr << " parent:" << *parent_name
372 << " mass:" << parentmass/GeV << "[GeV/c/c]" <<G4endl;
373 for (index=0; index < numberOfDaughters; index++){
374 G4cerr << " daughter " << index << ":" << *daughters_name[index]
375 << " mass:" << daughters[index]->GetPDGMass()/GeV
376 << "[GeV/c/c]" <<G4endl;
377 }
378 }
379 }
380#endif
381 }
382}
@ FatalException
double G4double
Definition: G4Types.hh:64
const G4String & GetParticleType() const
G4double GetPDGWidth() const
const G4String & GetParticleName() const
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
void SetBR(G4double value)
G4int GetVerboseLevel() const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41

Referenced by G4GeneralPhaseSpaceDecay::DecayIt(), G4NuclearDecayChannel::DecayIt(), G4DalitzDecayChannel::DecayIt(), G4KL3DecayChannel::DecayIt(), G4MuonDecayChannel::DecayIt(), G4MuonDecayChannelWithSpin::DecayIt(), G4MuonRadiativeDecayChannelWithSpin::DecayIt(), G4NeutronBetaDecayChannel::DecayIt(), G4PhaseSpaceDecayChannel::DecayIt(), G4PionRadiativeDecayChannel::DecayIt(), G4TauLeptonicDecayChannel::DecayIt(), GetAngularMomentum(), GetDaughter(), and SetDaughter().

◆ FillParent()

void G4VDecayChannel::FillParent ( )
protected

Definition at line 385 of file G4VDecayChannel.cc.

386{
387 if (parent_name == 0) {
388 // parent name is not defined
389#ifdef G4VERBOSE
390 if (verboseLevel>0) {
391 G4cerr << "G4VDecayChannel::FillParent "
392 << ": parent name is not defined !!" << G4endl;
393 }
394#endif
395 parent = 0;
396 G4Exception("G4VDecayChannel::FillParent()",
397 "PART012", FatalException,
398 "Can not fill parent: parent name is not defined yet");
399 }
400 // search parent particle in the particle table
402 if (parent == 0) {
403 // parent particle does not exist
404#ifdef G4VERBOSE
405 if (verboseLevel>0) {
406 G4cerr << "G4VDecayChannel::FillParent "
407 << *parent_name << " does not exist !!" << G4endl;
408 }
409#endif
410 G4Exception("G4VDecayChannel::FillParent()",
411 "PART012", FatalException,
412 "Can not fill parent: parent does not exist");
413 }
415}

Referenced by G4GeneralPhaseSpaceDecay::DecayIt(), G4NuclearDecayChannel::DecayIt(), G4DalitzDecayChannel::DecayIt(), G4KL3DecayChannel::DecayIt(), G4MuonDecayChannel::DecayIt(), G4MuonDecayChannelWithSpin::DecayIt(), G4MuonRadiativeDecayChannelWithSpin::DecayIt(), G4NeutronBetaDecayChannel::DecayIt(), G4PhaseSpaceDecayChannel::DecayIt(), G4PionRadiativeDecayChannel::DecayIt(), G4TauLeptonicDecayChannel::DecayIt(), FillDaughters(), G4NuclearDecayChannel::G4NuclearDecayChannel(), and GetParent().

◆ GetAngularMomentum()

G4int G4VDecayChannel::GetAngularMomentum ( )

Definition at line 422 of file G4VDecayChannel.cc.

423{
424 // determine angular momentum
425
426 // fill pointers to daughter particles if not yet set
427 if (daughters == 0) FillDaughters();
428
429 const G4int PiSpin = parent->GetPDGiSpin();
430 const G4int PParity = parent->GetPDGiParity();
431 if (2==numberOfDaughters) { // up to now we can only handle two particle decays
432 const G4int D1iSpin = daughters[0]->GetPDGiSpin();
433 const G4int D1Parity = daughters[0]->GetPDGiParity();
434 const G4int D2iSpin = daughters[1]->GetPDGiSpin();
435 const G4int D2Parity = daughters[1]->GetPDGiParity();
436 const G4int MiniSpin = std::abs (D1iSpin - D2iSpin);
437 const G4int MaxiSpin = D1iSpin + D2iSpin;
438 const G4int lMax = (PiSpin+D1iSpin+D2iSpin)/2; // l is allways int
439 G4int lMin;
440#ifdef G4VERBOSE
441 if (verboseLevel>1) {
442 G4cout << "iSpin: " << PiSpin << " -> " << D1iSpin << " + " << D2iSpin << G4endl;
443 G4cout << "2*jmin, 2*jmax, lmax " << MiniSpin << " " << MaxiSpin << " " << lMax << G4endl;
444 }
445#endif
446 for (G4int j=MiniSpin; j<=MaxiSpin; j+=2){ // loop over all possible spin couplings
447 lMin = std::abs(PiSpin-j)/2;
448#ifdef G4VERBOSE
449 if (verboseLevel>1)
450 G4cout << "-> checking 2*j=" << j << G4endl;
451#endif
452 for (G4int l=lMin; l<=lMax; l++) {
453#ifdef G4VERBOSE
454 if (verboseLevel>1)
455 G4cout << " checking l=" << l << G4endl;
456#endif
457 if (l%2==0) {
458 if (PParity == D1Parity*D2Parity) { // check parity for this l
459 return l;
460 }
461 } else {
462 if (PParity == -1*D1Parity*D2Parity) { // check parity for this l
463 return l;
464 }
465 }
466 }
467 }
468 } else {
469 G4Exception("G4VDecayChannel::GetAngularMomentum",
470 "PART111", JustWarning,
471 "Sorry, can't handle 3 particle decays (up to now)");
472 return 0;
473 }
474 G4Exception ("G4VDecayChannel::GetAngularMomentum",
475 "PART111", JustWarning,
476 "Can't find angular momentum for this decay");
477 return 0;
478}
@ JustWarning

◆ GetBR()

◆ GetDaughter()

G4ParticleDefinition * G4VDecayChannel::GetDaughter ( G4int  anIndex)
inline

Definition at line 184 of file G4VDecayChannel.hh.

185 {
186 //pointers to daughter particles are filled, if they are not set yet
187 if (daughters == 0) FillDaughters();
188
189 //get the pointer to a daughter particle
190 if ( (anIndex>=0) && (anIndex<numberOfDaughters) ) {
191 return daughters[anIndex];
192 } else {
193 if (verboseLevel>0)
194 G4cout << "G4VDecayChannel::GetDaughter index out of range "<<anIndex<<G4endl;
195 return 0;
196 }
197}

Referenced by G4KineticTrack::Decay(), G4KineticTrack::G4KineticTrack(), and G4TextPPReporter::GeneratePropertyTable().

◆ GetDaughterMass()

G4double G4VDecayChannel::GetDaughterMass ( G4int  anIndex) const
inline

Definition at line 214 of file G4VDecayChannel.hh.

215{
216 if ( (anIndex>=0) && (anIndex<numberOfDaughters) ) {
217 return daughters_mass[anIndex];
218 } else {
219 if (verboseLevel>0){
220 G4cout << "G4VDecayChannel::GetDaughterMass ";
221 G4cout << "index out of range " << anIndex << G4endl;
222 }
223 return 0.0;
224 }
225}

◆ GetDaughterName()

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

Definition at line 200 of file G4VDecayChannel.hh.

201{
202 if ( (anIndex>=0) && (anIndex<numberOfDaughters) ) {
203 return *daughters_name[anIndex];
204 } else {
205 if (verboseLevel>0){
206 G4cout << "G4VDecayChannel::GetDaughterName ";
207 G4cout << "index out of range " << anIndex << G4endl;
208 }
209 return GetNoName();
210 }
211}

Referenced by G4KineticTrack::Decay().

◆ GetKinematicsName()

const G4String & G4VDecayChannel::GetKinematicsName ( ) const
inline

Definition at line 264 of file G4VDecayChannel.hh.

264{ return kinematics_name; }

Referenced by G4TextPPReporter::GeneratePropertyTable().

◆ GetNumberOfDaughters()

◆ GetParent()

G4ParticleDefinition * G4VDecayChannel::GetParent ( )
inline

Definition at line 228 of file G4VDecayChannel.hh.

229{
230 //the pointer to the parent particle is filled, if it is not set yet
231 if (parent == 0) FillParent();
232 //get the pointer to the parent particle
233 return parent;
234}

Referenced by G4DecayTable::Insert().

◆ GetParentMass()

G4double G4VDecayChannel::GetParentMass ( ) const
inline

Definition at line 243 of file G4VDecayChannel.hh.

244{
245 return parent_mass;
246}

◆ GetParentName()

const G4String & G4VDecayChannel::GetParentName ( ) const
inline

Definition at line 237 of file G4VDecayChannel.hh.

238{
239 return *parent_name;
240}

Referenced by G4KineticTrack::Decay(), and G4MuonRadiativeDecayChannelWithSpin::DecayIt().

◆ GetVerboseLevel()

G4int G4VDecayChannel::GetVerboseLevel ( ) const
inline

Definition at line 276 of file G4VDecayChannel.hh.

276{ return verboseLevel; }

Referenced by G4KL3DecayChannel::DalitzDensity(), G4Decay::DecayIt(), G4GeneralPhaseSpaceDecay::DecayIt(), G4NuclearDecayChannel::DecayIt(), G4DalitzDecayChannel::DecayIt(), G4KL3DecayChannel::DecayIt(), G4MuonDecayChannel::DecayIt(), G4MuonDecayChannelWithSpin::DecayIt(), G4MuonRadiativeDecayChannelWithSpin::DecayIt(), G4NeutronBetaDecayChannel::DecayIt(), G4PhaseSpaceDecayChannel::DecayIt(), G4PionRadiativeDecayChannel::DecayIt(), G4TauLeptonicDecayChannel::DecayIt(), FillDaughters(), G4AlphaDecayChannel::G4AlphaDecayChannel(), G4BetaMinusDecayChannel::G4BetaMinusDecayChannel(), G4BetaPlusDecayChannel::G4BetaPlusDecayChannel(), G4GeneralPhaseSpaceDecay::G4GeneralPhaseSpaceDecay(), G4ITDecayChannel::G4ITDecayChannel(), G4KL3DecayChannel::G4KL3DecayChannel(), G4KshellECDecayChannel::G4KshellECDecayChannel(), G4LshellECDecayChannel::G4LshellECDecayChannel(), G4MshellECDecayChannel::G4MshellECDecayChannel(), G4MuonDecayChannel::G4MuonDecayChannel(), G4MuonRadiativeDecayChannelWithSpin::G4MuonRadiativeDecayChannelWithSpin(), G4NeutronBetaDecayChannel::G4NeutronBetaDecayChannel(), G4NuclearDecayChannel::G4NuclearDecayChannel(), G4PionRadiativeDecayChannel::G4PionRadiativeDecayChannel(), G4TauLeptonicDecayChannel::G4TauLeptonicDecayChannel(), G4GeneralPhaseSpaceDecay::ManyBodyDecayIt(), G4GeneralPhaseSpaceDecay::OneBodyDecayIt(), G4KL3DecayChannel::PhaseSpace(), G4GeneralPhaseSpaceDecay::ThreeBodyDecayIt(), and G4GeneralPhaseSpaceDecay::TwoBodyDecayIt().

◆ operator!=()

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

Definition at line 80 of file G4VDecayChannel.hh.

80{return (this != &right);};

◆ operator<()

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

Definition at line 178 of file G4VDecayChannel.hh.

179{
180 return (this->rbranch < right.rbranch);
181}

◆ operator=()

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

Definition at line 145 of file G4VDecayChannel.cc.

146{
147 if (this != &right) {
150 rbranch = right.rbranch;
151
152 // copy parent name
153 parent_name = new G4String(*right.parent_name);
154
155 // clear daughters_name array
157
158 // recreate array
160 if ( numberOfDaughters >0 ) {
163 //copy daughters name
164 for (G4int index=0; index < numberOfDaughters; index++) {
165 daughters_name[index] = new G4String(*right.daughters_name[index]);
166 }
167 }
168 }
169
170 //
171 parent = 0;
172 daughters = 0;
173 parent_mass = 0.0;
174 daughters_mass = 0;
175
176 // particle table
178
179 return *this;
180}

◆ operator==()

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

Definition at line 79 of file G4VDecayChannel.hh.

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

◆ SetBR()

◆ SetDaughter() [1/2]

◆ SetDaughter() [2/2]

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

Definition at line 230 of file G4VDecayChannel.cc.

232{
233 // check numberOfDaughters is positive
234 if (numberOfDaughters<=0) {
235#ifdef G4VERBOSE
236 if (verboseLevel>0) {
237 G4cerr << "G4VDecayChannel::SetDaughter: "
238 << "Number of daughters is not defined" << G4endl;
239 }
240#endif
241 return;
242 }
243
244 // check existence of daughters_name array
245 if (daughters_name == 0) {
246 // cleate array
248 for (G4int index=0;index<numberOfDaughters;index++) {
249 daughters_name[index]=0;
250 }
251 }
252
253 // check an index
254 if ( (anIndex<0) || (anIndex>=numberOfDaughters) ) {
255#ifdef G4VERBOSE
256 if (verboseLevel>0) {
257 G4cerr << "G4VDecayChannel::SetDaughter"
258 << "index out of range " << anIndex << G4endl;
259 }
260#endif
261 } else {
262 // delete the old name if it exists
263 if (daughters_name[anIndex]!=0) delete daughters_name[anIndex];
264 // fill the name
265 daughters_name[anIndex] = new G4String(particle_name);
266 // refill the array of daughters[] if it exists
267 if (daughters != 0) FillDaughters();
268#ifdef G4VERBOSE
269 if (verboseLevel>1) {
270 G4cout << "G4VDecayChannel::SetDaughter[" << anIndex <<"] :";
271 G4cout << daughters_name[anIndex] << ":" << *daughters_name[anIndex]<<G4endl;
272 }
273#endif
274 }
275}

◆ SetNumberOfDaughters()

◆ SetParent() [1/2]

◆ SetParent() [2/2]

void G4VDecayChannel::SetParent ( const G4String particle_name)
inline

Definition at line 250 of file G4VDecayChannel.hh.

251{
252 if (parent_name != 0) delete parent_name;
253 parent_name = new G4String(particle_name);
254 parent = 0;
255}

◆ SetVerboseLevel()

void G4VDecayChannel::SetVerboseLevel ( G4int  value)
inline

Definition at line 273 of file G4VDecayChannel.hh.

273{ verboseLevel = value; }

Referenced by G4Decay::DecayIt().

Member Data Documentation

◆ daughters

◆ daughters_mass

G4double* G4VDecayChannel::daughters_mass
protected

◆ daughters_name

◆ kinematics_name

◆ noName

const G4String G4VDecayChannel::noName = " "
staticprotected

Definition at line 174 of file G4VDecayChannel.hh.

◆ numberOfDaughters

◆ parent

◆ parent_mass

◆ parent_name

◆ particletable

G4ParticleTable* G4VDecayChannel::particletable
protected

Definition at line 143 of file G4VDecayChannel.hh.

Referenced by FillDaughters(), FillParent(), G4VDecayChannel(), and operator=().

◆ rbranch

◆ verboseLevel


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