Geant4-11
Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Member Functions
G4MuonRadiativeDecayChannelWithSpin Class Reference

#include <G4MuonRadiativeDecayChannelWithSpin.hh>

Inheritance diagram for G4MuonRadiativeDecayChannelWithSpin:
G4VDecayChannel

Public Member Functions

virtual G4DecayProductsDecayIt (G4double)
 
void DumpInfo ()
 
 G4MuonRadiativeDecayChannelWithSpin (const G4String &theParentName, G4double theBR)
 
G4int GetAngularMomentum ()
 
G4double GetBR () const
 
G4ParticleDefinitionGetDaughter (G4int anIndex)
 
G4double GetDaughterMass (G4int anIndex) const
 
const G4StringGetDaughterName (G4int anIndex) const
 
const G4StringGetKinematicsName () const
 
G4int GetNumberOfDaughters () const
 
G4ParticleDefinitionGetParent ()
 
G4double GetParentMass () const
 
const G4StringGetParentName () const
 
const G4ThreeVectorGetPolarization () const
 
G4double GetRangeMass () const
 
G4int GetVerboseLevel () const
 
virtual G4bool IsOKWithParentMass (G4double parentMass)
 
G4bool operator!= (const G4VDecayChannel &r) const
 
G4bool operator< (const G4VDecayChannel &right) const
 
G4bool operator== (const G4VDecayChannel &r) const
 
void SetBR (G4double value)
 
void SetDaughter (G4int anIndex, const G4ParticleDefinition *particle_type)
 
void SetDaughter (G4int anIndex, const G4String &particle_name)
 
void SetNumberOfDaughters (G4int value)
 
void SetParent (const G4ParticleDefinition *particle_type)
 
void SetParent (const G4String &particle_name)
 
void SetPolarization (const G4ThreeVector &)
 
void SetRangeMass (G4double val)
 
void SetVerboseLevel (G4int value)
 
virtual ~G4MuonRadiativeDecayChannelWithSpin ()
 

Protected Member Functions

void CheckAndFillDaughters ()
 
void CheckAndFillParent ()
 
void ClearDaughtersName ()
 
G4double DynamicalMass (G4double massPDG, G4double width, G4double maxDev=1.0) const
 
 G4MuonRadiativeDecayChannelWithSpin (const G4MuonRadiativeDecayChannelWithSpin &)
 
G4MuonRadiativeDecayChannelWithSpinoperator= (const G4MuonRadiativeDecayChannelWithSpin &)
 

Protected Attributes

G4String ** daughters_name = nullptr
 
G4Mutex daughtersMutex
 
G4ParticleDefinition ** G4MT_daughters = nullptr
 
G4doubleG4MT_daughters_mass = nullptr
 
G4doubleG4MT_daughters_width = nullptr
 
G4ParticleDefinitionG4MT_parent = nullptr
 
G4double G4MT_parent_mass = 0.0
 
G4String kinematics_name = ""
 
G4int numberOfDaughters = 0
 
G4Stringparent_name = nullptr
 
G4ThreeVector parent_polarization
 
G4Mutex parentMutex
 
G4ParticleTableparticletable = nullptr
 
G4double rangeMass = 2.5
 
G4double rbranch = 0.0
 
G4int verboseLevel = 1
 

Static Protected Attributes

static const G4String noName = " "
 

Private Member Functions

G4double atan4 (G4double x, G4double y)
 
void FillDaughters ()
 
void FillParent ()
 
G4double fron (G4double Pmu, G4double x, G4double y, G4double cthetaE, G4double cthetaG, G4double cthetaEG)
 
 G4MuonRadiativeDecayChannelWithSpin ()
 
const G4StringGetNoName () const
 
void rn3dim (G4double &x, G4double &y, G4double &z, G4double xlong)
 

Detailed Description

Definition at line 53 of file G4MuonRadiativeDecayChannelWithSpin.hh.

Constructor & Destructor Documentation

◆ G4MuonRadiativeDecayChannelWithSpin() [1/3]

G4MuonRadiativeDecayChannelWithSpin::G4MuonRadiativeDecayChannelWithSpin ( const G4String theParentName,
G4double  theBR 
)

Definition at line 52 of file G4MuonRadiativeDecayChannelWithSpin.cc.

55 : G4VDecayChannel("Radiative Muon Decay",1)
56{
57 // set names for daughter particles
58 if (theParentName == "mu+")
59 {
60 SetBR(theBR);
61 SetParent("mu+");
63 SetDaughter(0, "e+");
64 SetDaughter(1, "gamma");
65 SetDaughter(2, "nu_e");
66 SetDaughter(3, "anti_nu_mu");
67 }
68 else if (theParentName == "mu-")
69 {
70 SetBR(theBR);
71 SetParent("mu-");
73 SetDaughter(0, "e-");
74 SetDaughter(1, "gamma");
75 SetDaughter(2, "anti_nu_e");
76 SetDaughter(3, "nu_mu");
77 }
78 else
79 {
80#ifdef G4VERBOSE
81 if (GetVerboseLevel()>0)
82 {
83 G4cout << "G4RadiativeMuonDecayChannel::G4RadiativeMuonDecayChannel():";
84 G4cout << " parent particle is not muon but ";
85 G4cout << theParentName << G4endl;
86 }
87#endif
88 }
89}
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
void SetBR(G4double value)
G4int GetVerboseLevel() const
void SetNumberOfDaughters(G4int value)
void SetDaughter(G4int anIndex, const G4ParticleDefinition *particle_type)
void SetParent(const G4ParticleDefinition *particle_type)

References G4cout, G4endl, G4VDecayChannel::GetVerboseLevel(), G4VDecayChannel::SetBR(), G4VDecayChannel::SetDaughter(), G4VDecayChannel::SetNumberOfDaughters(), and G4VDecayChannel::SetParent().

◆ ~G4MuonRadiativeDecayChannelWithSpin()

G4MuonRadiativeDecayChannelWithSpin::~G4MuonRadiativeDecayChannelWithSpin ( )
virtual

Definition at line 91 of file G4MuonRadiativeDecayChannelWithSpin.cc.

92{
93}

◆ G4MuonRadiativeDecayChannelWithSpin() [2/3]

G4MuonRadiativeDecayChannelWithSpin::G4MuonRadiativeDecayChannelWithSpin ( const G4MuonRadiativeDecayChannelWithSpin r)
protected

Definition at line 95 of file G4MuonRadiativeDecayChannelWithSpin.cc.

98{
99}

◆ G4MuonRadiativeDecayChannelWithSpin() [3/3]

G4MuonRadiativeDecayChannelWithSpin::G4MuonRadiativeDecayChannelWithSpin ( )
private

Definition at line 47 of file G4MuonRadiativeDecayChannelWithSpin.cc.

49{
50}

Member Function Documentation

◆ atan4()

G4double G4MuonRadiativeDecayChannelWithSpin::atan4 ( G4double  x,
G4double  y 
)
inlineprivate

Definition at line 110 of file G4MuonRadiativeDecayChannelWithSpin.hh.

112{
113 G4double phi = 0.;
114
115 if (x==0. && y>0.){
116 phi = 0.5*CLHEP::pi;
117 } else if (x==0. && y<0.){
118 phi = 1.5*CLHEP::pi;
119 } else if (y==0. && x>0.){
120 phi = 0.;
121 } else if (y==0. && x<0.){
122 phi = CLHEP::pi;
123 } else if (x>0. ){
124 phi = std::atan(y/x);
125 } else if (x<0. ){
126 phi = std::atan(y/x) + CLHEP::pi;
127 }
128
129 return phi;
130}
double G4double
Definition: G4Types.hh:83
static constexpr double pi
Definition: SystemOfUnits.h:55

References CLHEP::pi.

Referenced by DecayIt().

◆ CheckAndFillDaughters()

void G4VDecayChannel::CheckAndFillDaughters ( )
inlineprotectedinherited

◆ CheckAndFillParent()

void G4VDecayChannel::CheckAndFillParent ( )
inlineprotectedinherited

◆ ClearDaughtersName()

void G4VDecayChannel::ClearDaughtersName ( )
protectedinherited

Definition at line 183 of file G4VDecayChannel.cc.

184{
186 if ( daughters_name != nullptr)
187 {
188 if (numberOfDaughters>0)
189 {
190#ifdef G4VERBOSE
191 if (verboseLevel>1)
192 {
193 G4cout << "G4VDecayChannel::ClearDaughtersName() "
194 << " for " << *parent_name << G4endl;
195 }
196#endif
197 for (G4int index=0; index<numberOfDaughters; ++index)
198 {
199 delete daughters_name[index];
200 }
201 }
202 delete [] daughters_name;
203 daughters_name = nullptr;
204 }
205
206 delete [] G4MT_daughters;
207 delete [] G4MT_daughters_mass;
208 delete [] G4MT_daughters_width;
209 G4MT_daughters_width = nullptr;
210 G4MT_daughters = nullptr;
211 G4MT_daughters_mass = nullptr;
212
214}
int G4int
Definition: G4Types.hh:85
G4String * parent_name
G4String ** daughters_name
G4double * G4MT_daughters_mass
G4double * G4MT_daughters_width

References G4VDecayChannel::daughters_name, G4VDecayChannel::daughtersMutex, G4cout, G4endl, G4VDecayChannel::G4MT_daughters, G4VDecayChannel::G4MT_daughters_mass, G4VDecayChannel::G4MT_daughters_width, G4VDecayChannel::numberOfDaughters, G4VDecayChannel::parent_name, and G4VDecayChannel::verboseLevel.

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

◆ DecayIt()

G4DecayProducts * G4MuonRadiativeDecayChannelWithSpin::DecayIt ( G4double  )
virtual

Implements G4VDecayChannel.

Definition at line 134 of file G4MuonRadiativeDecayChannelWithSpin.cc.

135{
136#ifdef G4VERBOSE
137 if (GetVerboseLevel()>1)
138 G4cout << "G4MuonRadiativeDecayChannelWithSpin::DecayIt()";
139#endif
140
143
144 // parent mass
145 G4double parentmass = G4MT_parent->GetPDGMass();
146
147 G4double EMMU = parentmass;
148
149 // daughters'mass
150 G4double daughtermass[4];
151 //G4double sumofdaughtermass = 0.0;
152 for (G4int index=0; index<4; ++index)
153 {
154 daughtermass[index] = G4MT_daughters[index]->GetPDGMass();
155 //sumofdaughtermass += daughtermass[index];
156 }
157
158 G4double EMASS = daughtermass[0];
159
160 //create parent G4DynamicParticle at rest
161 G4ThreeVector dummy;
162 G4DynamicParticle* parentparticle
163 = new G4DynamicParticle( G4MT_parent, dummy, 0.0 );
164
165 // create G4Decayproducts
166 G4DecayProducts *products = new G4DecayProducts(*parentparticle);
167 delete parentparticle;
168
169 G4int i = 0;
170
171 G4double eps = EMASS/EMMU;
172
173 G4double som0, x, y, xx, yy, zz;
174 G4double cthetaE, cthetaG, cthetaGE, phiE, phiG;
175 const std::size_t MAX_LOOP=10000;
176
177 for (std::size_t loop_counter1=0; loop_counter1<MAX_LOOP; ++loop_counter1)
178 {
179 // leap1:
180
181 ++i;
182
183 // leap2:
184
185 for (std::size_t loop_counter2=0; loop_counter2<MAX_LOOP; ++loop_counter2)
186 {
187 // -------------------------------------------------------------------
188 // Build two vectors of random length and random direction, for the
189 // positron and the photon.
190 // x/y is the length of the vector, xx, yy and zz the components,
191 // phi is the azimutal angle, theta the polar angle.
192 // -------------------------------------------------------------------
193
194 // For the positron
195 //
196 x = G4UniformRand();
197
198 rn3dim(xx,yy,zz,x);
199
200 if(std::fabs((xx*xx)+(yy*yy)+(zz*zz)-(x*x))>0.001)
201 {
202 G4cout << "Norm of x not correct" << G4endl;
203 }
204
205 phiE = atan4(xx,yy);
206 cthetaE = zz/x;
207 G4double sthetaE = std::sqrt((xx*xx)+(yy*yy))/x;
208
209 // What you get:
210 //
211 // x = positron energy
212 // phiE = azimutal angle of positron momentum
213 // cthetaE = cosine of polar angle of positron momentum
214 // sthetaE = sine of polar angle of positron momentum
215 //
221
222 // For the photon
223 //
224 y = G4UniformRand();
225
226 rn3dim(xx,yy,zz,y);
227
228 if(std::fabs((xx*xx)+(yy*yy)+(zz*zz)-(y*y))>0.001)
229 {
230 G4cout << " Norm of y not correct " << G4endl;
231 }
232
233 phiG = atan4(xx,yy);
234 cthetaG = zz/y;
235 G4double sthetaG = std::sqrt((xx*xx)+(yy*yy))/y;
236
237 // What you get:
238 //
239 // y = photon energy
240 // phiG = azimutal angle of photon momentum
241 // cthetaG = cosine of polar angle of photon momentum
242 // sthetaG = sine of polar angle of photon momentum
243 //
249
250 // Calculate the angle between positron and photon (cosine)
251 //
252 cthetaGE = cthetaE*cthetaG+sthetaE*sthetaG*std::cos(phiE-phiG);
253
257
258 G4double term0 = eps*eps;
259 G4double term1 = x*((1.0-eps)*(1.0-eps))+2.0*eps;
260 G4double beta = std::sqrt( x*((1.0-eps)*(1.0-eps))*
261 (x*((1.0-eps)*(1.0-eps))+4.0*eps))/term1;
262 G4double delta = 1.0-beta*cthetaGE;
263
264 G4double term3 = y*(1.0-(eps*eps));
265 G4double term6 = term1*delta*term3;
266
267 G4double Qsqr = (1.0-term1-term3+term0+0.5*term6)/((1.0-eps)*(1.0-eps));
268
269 // Check the kinematics.
270 //
271 if ( Qsqr>=0.0 && Qsqr<=1.0 ) break;
272
273 } // end loop count
274
275 // Do the calculation for -1 muon polarization (i.e. mu+)
276 //
277 G4double Pmu = -1.0;
278 if (GetParentName() == "mu-") { Pmu = +1.0; }
279
280 som0 = fron(Pmu,x,y,cthetaE,cthetaG,cthetaGE);
281
282 // Sample the decay rate
283 //
284 if (G4UniformRand()*177.0 <= som0) break;
285 }
286
287 G4double E = EMMU/2.*(x*((1.-eps)*(1.-eps))+2.*eps);
288 G4double G = EMMU/2.*y*(1.-eps*eps);
289
290 if(E < EMASS) E = EMASS;
291
292 // calculate daughter momentum
293 G4double daughtermomentum[4];
294
295 daughtermomentum[0] = std::sqrt(E*E - EMASS*EMASS);
296
297 G4double sthetaE = std::sqrt(1.-cthetaE*cthetaE);
298 G4double cphiE = std::cos(phiE);
299 G4double sphiE = std::sin(phiE);
300
301 // Coordinates of the decay positron with respect to the muon spin
302
303 G4double px = sthetaE*cphiE;
304 G4double py = sthetaE*sphiE;
305 G4double pz = cthetaE;
306
307 G4ThreeVector direction0(px,py,pz);
308
309 direction0.rotateUz(parent_polarization);
310
311 G4DynamicParticle * daughterparticle0
312 = new G4DynamicParticle( G4MT_daughters[0], daughtermomentum[0]*direction0);
313
314 products->PushProducts(daughterparticle0);
315
316 daughtermomentum[1] = G;
317
318 G4double sthetaG = std::sqrt(1.-cthetaG*cthetaG);
319 G4double cphiG = std::cos(phiG);
320 G4double sphiG = std::sin(phiG);
321
322 // Coordinates of the decay gamma with respect to the muon spin
323
324 px = sthetaG*cphiG;
325 py = sthetaG*sphiG;
326 pz = cthetaG;
327
328 G4ThreeVector direction1(px,py,pz);
329
330 direction1.rotateUz(parent_polarization);
331
332 G4DynamicParticle * daughterparticle1
333 = new G4DynamicParticle( G4MT_daughters[1], daughtermomentum[1]*direction1);
334
335 products->PushProducts(daughterparticle1);
336
337 // daughter 3 ,4 (neutrinos)
338 // create neutrinos in the C.M frame of two neutrinos
339
340 G4double energy2 = parentmass-E-G;
341
342 G4ThreeVector P34 = -1.*(daughtermomentum[0]*direction0
343 +daughtermomentum[1]*direction1);
344 G4double vmass2 = energy2*energy2 - P34.mag2();
345 G4double vmass = std::sqrt(vmass2);
346
347 G4double costhetan = 2.*G4UniformRand()-1.0;
348 G4double sinthetan = std::sqrt((1.0-costhetan)*(1.0+costhetan));
350 G4double sinphin = std::sin(phin);
351 G4double cosphin = std::cos(phin);
352
353 G4ThreeVector direction2(sinthetan*cosphin,sinthetan*sinphin,costhetan);
354
355 G4DynamicParticle * daughterparticle2
356 = new G4DynamicParticle( G4MT_daughters[2], direction2*(vmass/2.));
357 G4DynamicParticle * daughterparticle3
358 = new G4DynamicParticle( G4MT_daughters[3], direction2*(-1.0*vmass/2.));
359
360 // boost to the muon rest frame
361 G4double beta = P34.mag()/energy2;
362 G4ThreeVector direction34 = P34.unit();
363
364 G4LorentzVector p4 = daughterparticle2->Get4Momentum();
365 p4.boost(direction34.x()*beta,direction34.y()*beta,direction34.z()*beta);
366 daughterparticle2->Set4Momentum(p4);
367
368 p4 = daughterparticle3->Get4Momentum();
369 p4.boost(direction34.x()*beta,direction34.y()*beta,direction34.z()*beta);
370 daughterparticle3->Set4Momentum(p4);
371
372 products->PushProducts(daughterparticle2);
373 products->PushProducts(daughterparticle3);
374
375 daughtermomentum[2] = daughterparticle2->GetTotalMomentum();
376 daughtermomentum[3] = daughterparticle3->GetTotalMomentum();
377
378 // output message
379#ifdef G4VERBOSE
380 if (GetVerboseLevel()>1)
381 {
382 G4cout << "G4MuonRadiativeDecayChannelWithSpin::DecayIt() -";
383 G4cout << " create decay products in rest frame " <<G4endl;
384 G4double TT = daughterparticle0->GetTotalEnergy()
385 + daughterparticle1->GetTotalEnergy()
386 + daughterparticle2->GetTotalEnergy()
387 + daughterparticle3->GetTotalEnergy();
388 G4cout << "e :" << daughterparticle0->GetTotalEnergy()/MeV << G4endl;
389 G4cout << "gamma:" << daughterparticle1->GetTotalEnergy()/MeV << G4endl;
390 G4cout << "nu2 :" << daughterparticle2->GetTotalEnergy()/MeV << G4endl;
391 G4cout << "nu2 :" << daughterparticle3->GetTotalEnergy()/MeV << G4endl;
392 G4cout << "total:" << (TT-parentmass)/keV << G4endl;
393 if (GetVerboseLevel()>1) { products->DumpInfo(); }
394 }
395#endif
396
397 return products;
398}
static const G4double eps
static constexpr double twopi
Definition: G4SIunits.hh:56
static constexpr double rad
Definition: G4SIunits.hh:129
static constexpr double keV
Definition: G4SIunits.hh:202
static constexpr double MeV
Definition: G4SIunits.hh:200
#define G4UniformRand()
Definition: Randomize.hh:52
double z() const
Hep3Vector unit() const
double x() const
double mag2() const
double y() const
double mag() const
HepLorentzVector & boost(double, double, double)
void DumpInfo() const
G4int PushProducts(G4DynamicParticle *aParticle)
G4LorentzVector Get4Momentum() const
G4double GetTotalEnergy() const
void Set4Momentum(const G4LorentzVector &momentum)
G4double GetTotalMomentum() const
void rn3dim(G4double &x, G4double &y, G4double &z, G4double xlong)
G4double fron(G4double Pmu, G4double x, G4double y, G4double cthetaE, G4double cthetaG, G4double cthetaEG)
const G4String & GetParentName() const
void CheckAndFillDaughters()
G4ThreeVector parent_polarization

References atan4(), anonymous_namespace{G4PionRadiativeDecayChannel.cc}::beta, CLHEP::HepLorentzVector::boost(), G4VDecayChannel::CheckAndFillDaughters(), G4VDecayChannel::CheckAndFillParent(), G4DecayProducts::DumpInfo(), eps, fron(), G4cout, G4endl, G4VDecayChannel::G4MT_daughters, G4VDecayChannel::G4MT_parent, G4UniformRand, G4DynamicParticle::Get4Momentum(), G4VDecayChannel::GetParentName(), G4ParticleDefinition::GetPDGMass(), G4DynamicParticle::GetTotalEnergy(), G4DynamicParticle::GetTotalMomentum(), G4VDecayChannel::GetVerboseLevel(), keV, CLHEP::Hep3Vector::mag(), CLHEP::Hep3Vector::mag2(), MeV, G4VDecayChannel::parent_polarization, G4DecayProducts::PushProducts(), rad, rn3dim(), CLHEP::Hep3Vector::rotateUz(), G4DynamicParticle::Set4Momentum(), twopi, CLHEP::Hep3Vector::unit(), CLHEP::Hep3Vector::x(), CLHEP::Hep3Vector::y(), and CLHEP::Hep3Vector::z().

◆ DumpInfo()

void G4VDecayChannel::DumpInfo ( )
inherited

Definition at line 560 of file G4VDecayChannel.cc.

561{
562 G4cout << " BR: " << rbranch << " [" << kinematics_name << "]";
563 G4cout << " : " ;
564 for (G4int index=0; index<numberOfDaughters; ++index)
565 {
566 if(daughters_name[index] != nullptr)
567 {
568 G4cout << " " << *(daughters_name[index]);
569 }
570 else
571 {
572 G4cout << " not defined ";
573 }
574 }
575 G4cout << G4endl;
576}
G4String kinematics_name

References G4VDecayChannel::daughters_name, G4cout, G4endl, G4VDecayChannel::kinematics_name, G4VDecayChannel::numberOfDaughters, and G4VDecayChannel::rbranch.

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

◆ DynamicalMass()

G4double G4VDecayChannel::DynamicalMass ( G4double  massPDG,
G4double  width,
G4double  maxDev = 1.0 
) const
protectedinherited

Definition at line 585 of file G4VDecayChannel.cc.

587{
588 if (width<=0.0) return massPDG;
589 if (maxDev >rangeMass) maxDev = rangeMass;
590 if (maxDev <=-1.*rangeMass) return massPDG; // cannot calculate
591
592 G4double x = G4UniformRand()*(maxDev+rangeMass) - rangeMass;
594 const std::size_t MAX_LOOP=10000;
595 for (std::size_t loop_counter=0; loop_counter <MAX_LOOP; ++loop_counter)
596 {
597 if ( y * (width*width*x*x + massPDG*massPDG*width*width)
598 <= massPDG*massPDG*width*width ) break;
599 x = G4UniformRand()*(maxDev+rangeMass) - rangeMass;
600 y = G4UniformRand();
601 }
602 G4double mass = massPDG + x*width;
603 return mass;
604}

References G4UniformRand, and G4VDecayChannel::rangeMass.

Referenced by G4PhaseSpaceDecayChannel::ThreeBodyDecayIt(), and G4PhaseSpaceDecayChannel::TwoBodyDecayIt().

◆ FillDaughters()

void G4VDecayChannel::FillDaughters ( )
privateinherited

Definition at line 308 of file G4VDecayChannel.cc.

309{
311
312 // Double check, check again if another thread has already filled this, in
313 // case do not need to do anything
314 if ( G4MT_daughters != nullptr ) return;
315
316 G4int index;
317
318#ifdef G4VERBOSE
319 if (verboseLevel>1) G4cout << "G4VDecayChannel::FillDaughters()" << G4endl;
320#endif
321 if (G4MT_daughters != nullptr)
322 {
323 delete [] G4MT_daughters;
324 G4MT_daughters = nullptr;
325 }
326
327 // parent mass
329 G4double parentmass = G4MT_parent->GetPDGMass();
330
331 //
332 G4double sumofdaughtermass = 0.0;
333 G4double sumofdaughterwidthsq = 0.0;
334
335 if ((numberOfDaughters <=0) || (daughters_name == nullptr) )
336 {
337#ifdef G4VERBOSE
338 if (verboseLevel>0)
339 {
340 G4cout << "G4VDecayChannel::FillDaughters() - "
341 << "[ " << G4MT_parent->GetParticleName() << " ]"
342 << "numberOfDaughters is not defined yet";
343 }
344#endif
345 G4MT_daughters = nullptr;
346 G4Exception("G4VDecayChannel::FillDaughters()",
347 "PART011", FatalException,
348 "Cannot fill daughters: numberOfDaughters is not defined yet");
349 }
350
351 // create and set the array of pointers to daughter particles
353 if (G4MT_daughters_mass != nullptr) delete [] G4MT_daughters_mass;
354 if (G4MT_daughters_width != nullptr) delete [] G4MT_daughters_width;
357 // loop over all daughters
358 for (index=0; index<numberOfDaughters; ++index)
359 {
360 if (daughters_name[index] == nullptr)
361 {
362 // daughter name is not defined
363#ifdef G4VERBOSE
364 if (verboseLevel>0)
365 {
366 G4cout << "G4VDecayChannel::FillDaughters() - "
367 << "[ " << G4MT_parent->GetParticleName() << " ]"
368 << index << "-th daughter is not defined yet" << G4endl;
369 }
370#endif
371 G4MT_daughters[index] = nullptr;
372 G4Exception("G4VDecayChannel::FillDaughters()",
373 "PART011", FatalException,
374 "Cannot fill daughters: name of daughter is not defined yet");
375 }
376 // search daughter particles in the particle table
378 if (G4MT_daughters[index] == nullptr )
379 {
380 // cannot find the daughter particle
381#ifdef G4VERBOSE
382 if (verboseLevel>0)
383 {
384 G4cout << "G4VDecayChannel::FillDaughters() - "
385 << "[ " << G4MT_parent->GetParticleName() << " ]"
386 << index << ":" << *daughters_name[index]
387 << " is not defined !!" << G4endl;
388 G4cout << " The BR of this decay mode is set to zero." << G4endl;
389 }
390#endif
391 SetBR(0.0);
392 return;
393 }
394#ifdef G4VERBOSE
395 if (verboseLevel>1)
396 {
397 G4cout << index << ":" << *daughters_name[index];
398 G4cout << ":" << G4MT_daughters[index] << G4endl;
399 }
400#endif
402 G4double d_width = G4MT_daughters[index]->GetPDGWidth();
403 G4MT_daughters_width[index] = d_width;
404 sumofdaughtermass += G4MT_daughters[index]->GetPDGMass();
405 sumofdaughterwidthsq += d_width*d_width;
406 } // end loop over all daughters
407
408 // check sum of daghter mass
409 G4double widthMass = std::sqrt(G4MT_parent->GetPDGWidth()
411 +sumofdaughterwidthsq);
412 if ( (G4MT_parent->GetParticleType() != "nucleus")
413 && (numberOfDaughters !=1)
414 && (sumofdaughtermass > parentmass + rangeMass*widthMass) )
415 {
416 // !!! illegal mass !!!
417#ifdef G4VERBOSE
418 if (GetVerboseLevel()>0)
419 {
420 G4cout << "G4VDecayChannel::FillDaughters() - "
421 << "[ " << G4MT_parent->GetParticleName() << " ]"
422 << " Energy/Momentum conserevation breaks " << G4endl;
423 if (GetVerboseLevel()>1)
424 {
425 G4cout << " parent:" << *parent_name
426 << " mass:" << parentmass/GeV << "[GeV/c/c]" << G4endl;
427 for (index=0; index<numberOfDaughters; ++index)
428 {
429 G4cout << " daughter " << index << ":" << *daughters_name[index]
430 << " mass:" << G4MT_daughters[index]->GetPDGMass()/GeV
431 << "[GeV/c/c]" << G4endl;
432 }
433 }
434 }
435#endif
436 }
437}
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:35
static constexpr double GeV
Definition: G4SIunits.hh:203
const G4String & GetParticleType() const
G4double GetPDGWidth() const
const G4String & GetParticleName() const
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
G4ParticleTable * particletable

References G4VDecayChannel::CheckAndFillParent(), G4VDecayChannel::daughters_name, G4VDecayChannel::daughtersMutex, FatalException, G4ParticleTable::FindParticle(), G4cout, G4endl, G4Exception(), G4VDecayChannel::G4MT_daughters, G4VDecayChannel::G4MT_daughters_mass, G4VDecayChannel::G4MT_daughters_width, G4VDecayChannel::G4MT_parent, G4ParticleDefinition::GetParticleName(), G4ParticleDefinition::GetParticleType(), G4ParticleDefinition::GetPDGMass(), G4ParticleDefinition::GetPDGWidth(), G4VDecayChannel::GetVerboseLevel(), GeV, G4VDecayChannel::numberOfDaughters, G4VDecayChannel::parent_name, G4VDecayChannel::particletable, G4VDecayChannel::rangeMass, G4VDecayChannel::SetBR(), and G4VDecayChannel::verboseLevel.

Referenced by G4VDecayChannel::CheckAndFillDaughters().

◆ FillParent()

void G4VDecayChannel::FillParent ( )
privateinherited

Definition at line 440 of file G4VDecayChannel.cc.

441{
442 G4AutoLock lock(&parentMutex);
443
444 // Double check, check again if another thread has already filled this, in
445 // case do not need to do anything
446 if ( G4MT_parent != nullptr ) return;
447
448 if (parent_name == nullptr)
449 {
450 // parent name is not defined
451#ifdef G4VERBOSE
452 if (verboseLevel>0)
453 {
454 G4cout << "G4VDecayChannel::FillParent() - "
455 << "parent name is not defined !!" << G4endl;
456 }
457#endif
458 G4MT_parent = nullptr;
459 G4Exception("G4VDecayChannel::FillParent()",
460 "PART012", FatalException,
461 "Cannot fill parent: parent name is not defined yet");
462 return;
463 }
464
465 // search parent particle in the particle table
467 if (G4MT_parent == nullptr)
468 {
469 // parent particle does not exist
470#ifdef G4VERBOSE
471 if (verboseLevel>0)
472 {
473 G4cout << "G4VDecayChannel::FillParent() - "
474 << *parent_name << " does not exist !!" << G4endl;
475 }
476#endif
477 G4Exception("G4VDecayChannel::FillParent()",
478 "PART012", FatalException,
479 "Cannot fill parent: parent does not exist");
480 return;
481 }
483}
G4double G4MT_parent_mass

References FatalException, G4ParticleTable::FindParticle(), G4cout, G4endl, G4Exception(), G4VDecayChannel::G4MT_parent, G4VDecayChannel::G4MT_parent_mass, G4ParticleDefinition::GetPDGMass(), G4VDecayChannel::parent_name, G4VDecayChannel::parentMutex, G4VDecayChannel::particletable, and G4VDecayChannel::verboseLevel.

Referenced by G4VDecayChannel::CheckAndFillParent().

◆ fron()

G4double G4MuonRadiativeDecayChannelWithSpin::fron ( G4double  Pmu,
G4double  x,
G4double  y,
G4double  cthetaE,
G4double  cthetaG,
G4double  cthetaEG 
)
private

Definition at line 400 of file G4MuonRadiativeDecayChannelWithSpin.cc.

406{
407 G4double mu = 105.65;
408 G4double me = 0.511;
409 G4double rho = 0.75;
410 G4double del = 0.75;
411 G4double eps = 0.0;
412 G4double kap = 0.0;
413 G4double ksi = 1.0;
414
415 G4double delta = 1-cthetaGE;
416
417 // Calculation of the functions f(x,y)
418
419 G4double f_1s = 12.0*((y*y)*(1.0-y)+x*y*(2.0-3.0*y)
420 +2.0*(x*x)*(1.0-2.0*y)-2.0*(x*x*x));
421 G4double f0s = 6.0*(-x*y*(2.0-3.0*(y*y))
422 -2.0*(x*x)*(1.0-y-3.0*(y*y))+2.0*(x*x*x)*(1.0+2.0*y));
423 G4double f1s = 3.0*((x*x)*y*(2.0-3.0*y-3.0*(y*y))
424 -(x*x*x)*y*(4.0+3.0*y));
425 G4double f2s = 1.5*((x*x*x)*(y*y)*(2.0+y));
426
427 G4double f_1se = 12.0*(x*y*(1.0-y)+(x*x)*(2.0-3.0*y)
428 -2.0*(x*x*x));
429 G4double f0se = 6.0*(-(x*x)*(2.0-y-2.0*(y*y))
430 +(x*x*x)*(2.0+3.0*y));
431 G4double f1se = -3.0*(x*x*x)*y*(2.0+y);
432 G4double f2se = 0.0;
433
434 G4double f_1sg = 12.0*((y*y)*(1.0-y)+x*y*(1.0-2.0*y)
435 -(x*x)*y);
436 G4double f0sg = 6.0*(-x*(y*y)*(2.0-3.0*y)-(x*x)*y*(1.0-4.0*y)
437 +(x*x*x)*y);
438 G4double f1sg = 3.0*((x*x)*(y*y)*(1.0-3.0*y)
439 -2.0*(x*x*x)*(y*y));
440 G4double f2sg = 1.5*(x*x*x)*(y*y*y);
441
442 G4double f_1v = 8.0*((y*y)*(3.0-2.0*y)+6.0*x*y*(1.0-y)
443 +2.0*(x*x)*(3.0-4.0*y)-4.0*(x*x*x));
444 G4double f0v = 8.0*(-x*y*(3.0-y-(y*y))-(x*x)*(3.0-y-4.0*(y*y))
445 +2.0*(x*x*x)*(1.0+2.0*y));
446 G4double f1v = 2.0*((x*x)*y*(6.0-5.0*y-2.0*(y*y))
447 -2.0*(x*x*x)*y*(4.0+3.0*y));
448 G4double f2v = 2.0*(x*x*x)*(y*y)*(2.0+y);
449
450 G4double f_1ve = 8.0*(x*y*(1.0-2.0*y)
451 +2.0*(x*x)*(1.0-3.0*y)-4.0*(x*x*x));
452 G4double f0ve = 4.0*(-(x*x)*(2.0-3.0*y-4.0*(y*y))
453 +2.0*(x*x*x)*(2.0+3.0*y));
454 G4double f1ve = -4.0*(x*x*x)*y*(2.0+y);
455 G4double f2ve = 0.0;
456
457 G4double f_1vg = 8.0*((y*y)*(1.0-2.0*y)+x*y*(1.0-4.0*y)
458 -2.0*(x*x)*y);
459 G4double f0vg = 4.0*(2.0*x*(y*y)*(1.0+y)-(x*x)*y*(1.0-4.0*y)
460 +2.0*(x*x*x)*y);
461 G4double f1vg = 2.0*((x*x)*(y*y)*(1.0-2.0*y)
462 -4.0*(x*x*x)*(y*y));
463 G4double f2vg = 2.0*(x*x*x)*(y*y*y);
464
465 G4double f_1t = 8.0*((y*y)*(3.0-y)+3.0*x*y*(2.0-y)
466 +2.0*(x*x)*(3.0-2.0*y)-2.0*(x*x*x));
467 G4double f0t = 4.0*(-x*y*(6.0+(y*y))
468 -2.0*(x*x)*(3.0+y-3.0*(y*y))+2.0*(x*x*x)*(1.0+2.0*y));
469 G4double f1t = 2.0*((x*x)*y*(6.0-5.0*y+(y*y))
470 -(x*x*x)*y*(4.0+3.0*y));
471 G4double f2t = (x*x*x)*(y*y)*(2.0+y);
472
473 G4double f_1te = -8.0*(x*y*(1.0+3.0*y)+(x*x)*(2.0+3.0*y)
474 +2.0*(x*x*x));
475 G4double f0te = 4.0*((x*x)*(2.0+3.0*y+4.0*(y*y))
476 +(x*x*x)*(2.0+3.0*y));
477 G4double f1te = -2.0*(x*x*x)*y*(2.0+y);
478 G4double f2te = 0.0;
479
480 G4double f_1tg = -8.0*((y*y)*(1.0+y)+x*y+(x*x)*y);
481 G4double f0tg = 4.0*(x*(y*y)*(2.0-y)+(x*x)*y*(1.0+2.0*y)
482 +(x*x*x)*y);
483 G4double f1tg = -2.0*((x*x)*(y*y)*(1.0-y)+2.0*(x*x*x)*y);
484 G4double f2tg = (x*x*x)*(y*y*y);
485
486 G4double term = delta+2.0*(me*me)/((mu*mu)*(x*x));
487 term = 1.0/term;
488
489 G4double nss = term*f_1s+f0s+delta*f1s+(delta*delta)*f2s;
490 G4double nv = term*f_1v+f0v+delta*f1v+(delta*delta)*f2v;
491 G4double nt = term*f_1t+f0t+delta*f1t+(delta*delta)*f2t;
492
493 G4double nse = term*f_1se+f0se+delta*f1se+(delta*delta)*f2se;
494 G4double nve = term*f_1ve+f0ve+delta*f1ve+(delta*delta)*f2ve;
495 G4double nte = term*f_1te+f0te+delta*f1te+(delta*delta)*f2te;
496
497 G4double nsg = term*f_1sg+f0sg+delta*f1sg+(delta*delta)*f2sg;
498 G4double nvg = term*f_1vg+f0vg+delta*f1vg+(delta*delta)*f2vg;
499 G4double ntg = term*f_1tg+f0tg+delta*f1tg+(delta*delta)*f2tg;
500
501 G4double term1 = nv;
502 G4double term2 = 2.0*nss+nv-nt;
503 G4double term3 = 2.0*nss-2.0*nv+nt;
504
505 G4double term1e = 1.0/3.0*(1.0-4.0/3.0*del);
506 G4double term2e = 2.0*nse+5.0*nve-nte;
507 G4double term3e = 2.0*nse-2.0*nve+nte;
508
509 G4double term1g = 1.0/3.0*(1.0-4.0/3.0*del);
510 G4double term2g = 2.0*nsg+5.0*nvg-ntg;
511 G4double term3g = 2.0*nsg-2.0*nvg+ntg;
512
513 G4double som00 = term1+(1.0-4.0/3.0*rho)*term2+eps*term3;
514 G4double som01 = Pmu*ksi*(cthetaE*(nve-term1e*term2e+kap*term3e)
515 +cthetaG*(nvg-term1g*term2g+kap*term3g));
516
517 G4double som0 = (som00+som01)/y;
518 som0 = fine_structure_const/8./(twopi*twopi*twopi)*som0;
519
520 return som0;
521}
int fine_structure_const
Definition: hepunit.py:286

References eps, source.hepunit::fine_structure_const, and twopi.

Referenced by DecayIt().

◆ GetAngularMomentum()

G4int G4VDecayChannel::GetAngularMomentum ( )
inherited

Definition at line 492 of file G4VDecayChannel.cc.

493{
494 // determine angular momentum
495
496 // fill pointers to daughter particles if not yet set
498
499 const G4int PiSpin = G4MT_parent->GetPDGiSpin();
500 const G4int PParity = G4MT_parent->GetPDGiParity();
501 if (2==numberOfDaughters) // up to now we can only handle two particle decays
502 {
503 const G4int D1iSpin = G4MT_daughters[0]->GetPDGiSpin();
504 const G4int D1Parity = G4MT_daughters[0]->GetPDGiParity();
505 const G4int D2iSpin = G4MT_daughters[1]->GetPDGiSpin();
506 const G4int D2Parity = G4MT_daughters[1]->GetPDGiParity();
507 const G4int MiniSpin = std::abs (D1iSpin - D2iSpin);
508 const G4int MaxiSpin = D1iSpin + D2iSpin;
509 const G4int lMax = (PiSpin+D1iSpin+D2iSpin)/2; // l is always int
510 G4int lMin;
511#ifdef G4VERBOSE
512 if (verboseLevel>1)
513 {
514 G4cout << "iSpin: " << PiSpin << " -> " << D1iSpin
515 << " + " << D2iSpin << G4endl;
516 G4cout << "2*jmin, 2*jmax, lmax " << MiniSpin << " " << MaxiSpin
517 << " " << lMax << G4endl;
518 }
519#endif
520 for (G4int j=MiniSpin; j<=MaxiSpin; j+=2) // loop over all possible
521 { // spin couplings
522 lMin = std::abs(PiSpin-j)/2;
523#ifdef G4VERBOSE
524 if (verboseLevel>1)
525 G4cout << "-> checking 2*j=" << j << G4endl;
526#endif
527 for (G4int l=lMin; l<=lMax; ++l)
528 {
529#ifdef G4VERBOSE
530 if (verboseLevel>1)
531 G4cout << " checking l=" << l << G4endl;
532#endif
533 if (l%2==0)
534 {
535 if (PParity == D1Parity*D2Parity) // check parity for this l
536 return l;
537 }
538 else
539 {
540 if (PParity == -1*D1Parity*D2Parity) // check parity for this l
541 return l;
542 }
543 }
544 }
545 }
546 else
547 {
548 G4Exception("G4VDecayChannel::GetAngularMomentum()",
549 "PART111", JustWarning,
550 "Sorry, can't handle 3 particle decays (up to now)");
551 return 0;
552 }
553 G4Exception ("G4VDecayChannel::GetAngularMomentum()",
554 "PART111", JustWarning,
555 "Can't find angular momentum for this decay");
556 return 0;
557}
@ JustWarning

References G4VDecayChannel::CheckAndFillDaughters(), G4cout, G4endl, G4Exception(), G4VDecayChannel::G4MT_daughters, G4VDecayChannel::G4MT_parent, G4ParticleDefinition::GetPDGiParity(), G4ParticleDefinition::GetPDGiSpin(), JustWarning, G4VDecayChannel::numberOfDaughters, and G4VDecayChannel::verboseLevel.

◆ GetBR()

G4double G4VDecayChannel::GetBR ( ) const
inlineinherited

◆ GetDaughter()

G4ParticleDefinition * G4VDecayChannel::GetDaughter ( G4int  anIndex)
inlineinherited

Definition at line 201 of file G4VDecayChannel.hh.

202{
203 // pointers to daughter particles are filled, if they are not set yet
205
206 // get the pointer to a daughter particle
207 if ( (anIndex>=0) && (anIndex<numberOfDaughters) )
208 {
209 return G4MT_daughters[anIndex];
210 }
211 else
212 {
213 if (verboseLevel>0)
214 G4cout << "G4VDecayChannel::GetDaughter index out of range "
215 << anIndex << G4endl;
216 return nullptr;
217 }
218}

References G4VDecayChannel::CheckAndFillDaughters(), G4cout, G4endl, G4VDecayChannel::G4MT_daughters, G4VDecayChannel::numberOfDaughters, and G4VDecayChannel::verboseLevel.

Referenced by G4IonTable::CreateIon(), G4KineticTrack::Decay(), G4KineticTrack::G4KineticTrack(), G4HtmlPPReporter::GeneratePropertyTable(), G4TextPPReporter::GeneratePropertyTable(), G4NuclearDecay::GetDaughterNucleus(), G4MTRunManagerKernel::SetUpDecayChannels(), and G4TaskRunManagerKernel::SetUpDecayChannels().

◆ GetDaughterMass()

G4double G4VDecayChannel::GetDaughterMass ( G4int  anIndex) const
inlineinherited

Definition at line 239 of file G4VDecayChannel.hh.

240{
241 if ( (anIndex>=0) && (anIndex<numberOfDaughters) )
242 {
243 return G4MT_daughters_mass[anIndex];
244 }
245 else
246 {
247 if (verboseLevel>0)
248 {
249 G4cout << "G4VDecayChannel::GetDaughterMass ";
250 G4cout << "index out of range " << anIndex << G4endl;
251 }
252 return 0.0;
253 }
254}

References G4cout, G4endl, G4VDecayChannel::G4MT_daughters_mass, G4VDecayChannel::numberOfDaughters, and G4VDecayChannel::verboseLevel.

◆ GetDaughterName()

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

◆ GetKinematicsName()

const G4String & G4VDecayChannel::GetKinematicsName ( ) const
inlineinherited

◆ GetNoName()

const G4String & G4VDecayChannel::GetNoName ( ) const
privateinherited

Definition at line 579 of file G4VDecayChannel.cc.

580{
581 return noName;
582}
static const G4String noName

References G4VDecayChannel::noName.

Referenced by G4VDecayChannel::GetDaughterName().

◆ GetNumberOfDaughters()

G4int G4VDecayChannel::GetNumberOfDaughters ( ) const
inlineinherited

◆ GetParent()

G4ParticleDefinition * G4VDecayChannel::GetParent ( )
inlineinherited

Definition at line 257 of file G4VDecayChannel.hh.

258{
259 // the pointer to the parent particle is filled, if it is not set yet
261 // get the pointer to the parent particle
262 return G4MT_parent;
263}

References G4VDecayChannel::CheckAndFillParent(), and G4VDecayChannel::G4MT_parent.

Referenced by G4DecayTable::Insert().

◆ GetParentMass()

G4double G4VDecayChannel::GetParentMass ( ) const
inlineinherited

Definition at line 272 of file G4VDecayChannel.hh.

273{
274 return G4MT_parent_mass;
275}

References G4VDecayChannel::G4MT_parent_mass.

◆ GetParentName()

const G4String & G4VDecayChannel::GetParentName ( ) const
inlineinherited

◆ GetPolarization()

const G4ThreeVector & G4VDecayChannel::GetPolarization ( ) const
inlineinherited

Definition at line 331 of file G4VDecayChannel.hh.

332{
333 return parent_polarization;
334}

References G4VDecayChannel::parent_polarization.

◆ GetRangeMass()

G4double G4VDecayChannel::GetRangeMass ( ) const
inlineinherited

Definition at line 316 of file G4VDecayChannel.hh.

317{
318 return rangeMass;
319}

References G4VDecayChannel::rangeMass.

◆ GetVerboseLevel()

G4int G4VDecayChannel::GetVerboseLevel ( ) const
inlineinherited

◆ IsOKWithParentMass()

G4bool G4VDecayChannel::IsOKWithParentMass ( G4double  parentMass)
virtualinherited

Reimplemented in G4PhaseSpaceDecayChannel.

Definition at line 607 of file G4VDecayChannel.cc.

608{
609 G4double sumOfDaughterMassMin = 0.0;
612 // skip one body decay
613 if (numberOfDaughters==1) return true;
614
615 for (G4int index=0; index<numberOfDaughters; ++index)
616 {
617 sumOfDaughterMassMin +=
619 }
620 return (parentMass >= sumOfDaughterMassMin);
621}

References G4VDecayChannel::CheckAndFillDaughters(), G4VDecayChannel::CheckAndFillParent(), G4VDecayChannel::G4MT_daughters_mass, G4VDecayChannel::G4MT_daughters_width, G4VDecayChannel::numberOfDaughters, and G4VDecayChannel::rangeMass.

Referenced by G4Decay::DecayIt(), G4MuonicAtomDecay::DecayIt(), and G4PhaseSpaceDecayChannel::IsOKWithParentMass().

◆ operator!=()

G4bool G4VDecayChannel::operator!= ( const G4VDecayChannel r) const
inlineinherited

Definition at line 69 of file G4VDecayChannel.hh.

69{ return (this != &r); }

◆ operator<()

G4bool G4VDecayChannel::operator< ( const G4VDecayChannel right) const
inlineinherited

Definition at line 195 of file G4VDecayChannel.hh.

196{
197 return (this->rbranch < right.rbranch);
198}

References G4VDecayChannel::rbranch.

◆ operator=()

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

Definition at line 101 of file G4MuonRadiativeDecayChannelWithSpin.cc.

103{
104 if (this != &right)
105 {
108 rbranch = right.rbranch;
109
110 // copy parent name
111 parent_name = new G4String(*right.parent_name);
112
113 // clear daughters_name array
115
116 // recreate array
118 if ( numberOfDaughters > 0 )
119 {
120 if (daughters_name != nullptr) ClearDaughtersName();
122 // copy daughters name
123 for (G4int index=0; index<numberOfDaughters; ++index)
124 {
125 daughters_name[index] = new G4String(*right.daughters_name[index]);
126 }
127 }
129 }
130 return *this;
131}

References G4VDecayChannel::ClearDaughtersName(), G4VDecayChannel::daughters_name, G4VDecayChannel::kinematics_name, G4VDecayChannel::numberOfDaughters, G4VDecayChannel::parent_name, G4VDecayChannel::parent_polarization, G4VDecayChannel::rbranch, and G4VDecayChannel::verboseLevel.

◆ operator==()

G4bool G4VDecayChannel::operator== ( const G4VDecayChannel r) const
inlineinherited

Definition at line 68 of file G4VDecayChannel.hh.

68{ return (this == &r); }

◆ rn3dim()

void G4MuonRadiativeDecayChannelWithSpin::rn3dim ( G4double x,
G4double y,
G4double z,
G4double  xlong 
)
inlineprivate

Definition at line 87 of file G4MuonRadiativeDecayChannelWithSpin.hh.

91{
92 G4double a = 0.; G4double b = 0.; G4double c = 0.; G4double r = 0.;
93
94 do
95 {
96 a = G4UniformRand() - 0.5;
97 b = G4UniformRand() - 0.5;
98 c = G4UniformRand() - 0.5;
99 r = a*a + b*b + c*c;
100 } while (r > 0.25); // Loop checking, 09.08.2015, K.Kurashige
101
102 G4double rinv = xlong/(std::sqrt(r));
103 x = a * rinv;
104 y = b * rinv;
105 z = c * rinv;
106
107 return;
108}

References G4UniformRand.

Referenced by DecayIt().

◆ SetBR()

void G4VDecayChannel::SetBR ( G4double  value)
inherited

◆ SetDaughter() [1/2]

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

◆ SetDaughter() [2/2]

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

Definition at line 234 of file G4VDecayChannel.cc.

235{
236 // check numberOfDaughters is positive
237 if (numberOfDaughters<=0)
238 {
239#ifdef G4VERBOSE
240 if (verboseLevel>0)
241 {
242 G4cout << "G4VDecayChannel::SetDaughter() - "
243 << "Number of daughters is not defined" << G4endl;
244 }
245#endif
246 return;
247 }
248
249 // An analysis of this code, shows that this method is called
250 // only in the constructor of derived classes.
251 // The general idea of this method is probably to support
252 // the possibility to re-define daughters on the fly, however
253 // this design is extremely problematic for MT mode, we thus
254 // require (as practically happens) that the method is called only
255 // at construction, i.e. when G4MT_daughters == 0
256 // moreover this method can be called only after SetNumberOfDaugthers()
257 // has been called (see previous if), in such a case daughters_name != nullptr
258 //
259 if ( daughters_name == nullptr )
260 {
261 G4Exception("G4VDecayChannel::SetDaughter()", "PART112", FatalException,
262 "Trying to add a daughter without specifying number of secondaries!");
263 return;
264 }
265 if ( G4MT_daughters != nullptr )
266 {
267 G4Exception("G4VDecayChannel::SetDaughter()", "PART111", FatalException,
268 "Trying to modify a daughter of a decay channel, \
269 but decay channel already has daughters.");
270 return;
271 }
272
273 // check an index
274 if ( (anIndex<0) || (anIndex>=numberOfDaughters) )
275 {
276#ifdef G4VERBOSE
277 if (verboseLevel>0)
278 {
279 G4cout << "G4VDecayChannel::SetDaughter() - "
280 << "index out of range " << anIndex << G4endl;
281 }
282#endif
283 }
284 else
285 {
286 // fill the name
287 daughters_name[anIndex] = new G4String(particle_name);
288#ifdef G4VERBOSE
289 if (verboseLevel>1)
290 {
291 G4cout << "G4VDecayChannel::SetDaughter[" << anIndex <<"] :";
292 G4cout << daughters_name[anIndex] << ":"
293 << *daughters_name[anIndex]<<G4endl;
294 }
295#endif
296 }
297}

References G4VDecayChannel::daughters_name, FatalException, G4cout, G4endl, G4Exception(), G4VDecayChannel::G4MT_daughters, G4VDecayChannel::numberOfDaughters, and G4VDecayChannel::verboseLevel.

◆ SetNumberOfDaughters()

void G4VDecayChannel::SetNumberOfDaughters ( G4int  value)
inherited

◆ SetParent() [1/2]

void G4VDecayChannel::SetParent ( const G4ParticleDefinition particle_type)
inherited

◆ SetParent() [2/2]

void G4VDecayChannel::SetParent ( const G4String particle_name)
inlineinherited

Definition at line 278 of file G4VDecayChannel.hh.

279{
280 if (parent_name != nullptr) delete parent_name;
281 parent_name = new G4String(particle_name);
282 G4MT_parent = nullptr;
283}

References G4VDecayChannel::G4MT_parent, and G4VDecayChannel::parent_name.

◆ SetPolarization()

void G4VDecayChannel::SetPolarization ( const G4ThreeVector polar)
inlineinherited

◆ SetRangeMass()

void G4VDecayChannel::SetRangeMass ( G4double  val)
inlineinherited

Definition at line 322 of file G4VDecayChannel.hh.

322{ if(val>=0.) rangeMass=val; }

References G4VDecayChannel::rangeMass.

◆ SetVerboseLevel()

void G4VDecayChannel::SetVerboseLevel ( G4int  value)
inlineinherited

Definition at line 304 of file G4VDecayChannel.hh.

305{
306 verboseLevel = value;
307}

References G4VDecayChannel::verboseLevel.

Referenced by G4Decay::DecayIt(), and G4MuonicAtomDecay::DecayIt().

Field Documentation

◆ daughters_name

G4String** G4VDecayChannel::daughters_name = nullptr
protectedinherited

◆ daughtersMutex

G4Mutex G4VDecayChannel::daughtersMutex
protectedinherited

◆ G4MT_daughters

G4ParticleDefinition** G4VDecayChannel::G4MT_daughters = nullptr
protectedinherited

◆ G4MT_daughters_mass

G4double* G4VDecayChannel::G4MT_daughters_mass = nullptr
protectedinherited

◆ G4MT_daughters_width

G4double* G4VDecayChannel::G4MT_daughters_width = nullptr
protectedinherited

◆ G4MT_parent

G4ParticleDefinition* G4VDecayChannel::G4MT_parent = nullptr
protectedinherited

◆ G4MT_parent_mass

G4double G4VDecayChannel::G4MT_parent_mass = 0.0
protectedinherited

◆ kinematics_name

G4String G4VDecayChannel::kinematics_name = ""
protectedinherited

◆ noName

const G4String G4VDecayChannel::noName = " "
staticprotectedinherited

Definition at line 170 of file G4VDecayChannel.hh.

Referenced by G4VDecayChannel::GetNoName().

◆ numberOfDaughters

G4int G4VDecayChannel::numberOfDaughters = 0
protectedinherited

◆ parent_name

G4String* G4VDecayChannel::parent_name = nullptr
protectedinherited

◆ parent_polarization

G4ThreeVector G4VDecayChannel::parent_polarization
protectedinherited

◆ parentMutex

G4Mutex G4VDecayChannel::parentMutex
protectedinherited

◆ particletable

G4ParticleTable* G4VDecayChannel::particletable = nullptr
protectedinherited

◆ rangeMass

G4double G4VDecayChannel::rangeMass = 2.5
protectedinherited

◆ rbranch

G4double G4VDecayChannel::rbranch = 0.0
protectedinherited

◆ verboseLevel

G4int G4VDecayChannel::verboseLevel = 1
protectedinherited

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