Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4MuonRadiativeDecayChannelWithSpin Class Reference

#include <G4MuonRadiativeDecayChannelWithSpin.hh>

+ Inheritance diagram for G4MuonRadiativeDecayChannelWithSpin:

Public Member Functions

 G4MuonRadiativeDecayChannelWithSpin (const G4String &theParentName, G4double theBR)
 
virtual ~G4MuonRadiativeDecayChannelWithSpin ()
 
virtual G4DecayProductsDecayIt (G4double)
 
- Public Member Functions inherited from G4VDecayChannel
 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 ()
 
G4bool operator== (const G4VDecayChannel &r) const
 
G4bool operator!= (const G4VDecayChannel &r) const
 
G4bool 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

 G4MuonRadiativeDecayChannelWithSpin (const G4MuonRadiativeDecayChannelWithSpin &)
 
G4MuonRadiativeDecayChannelWithSpinoperator= (const G4MuonRadiativeDecayChannelWithSpin &)
 
- Protected Member Functions inherited from G4VDecayChannel
void ClearDaughtersName ()
 
void CheckAndFillDaughters ()
 
void CheckAndFillParent ()
 
G4double DynamicalMass (G4double massPDG, G4double width, G4double maxDev=1.0) const
 
 G4VDecayChannel ()
 
 G4VDecayChannel (const G4VDecayChannel &)
 
G4VDecayChanneloperator= (const G4VDecayChannel &)
 

Additional Inherited Members

- Protected Attributes inherited from G4VDecayChannel
G4String kinematics_name = ""
 
G4double rbranch = 0.0
 
G4Stringparent_name = nullptr
 
G4String ** daughters_name = nullptr
 
G4double rangeMass = 2.5
 
G4ThreeVector parent_polarization
 
G4ParticleTableparticletable = nullptr
 
G4ParticleDefinitionG4MT_parent = nullptr
 
G4ParticleDefinition ** G4MT_daughters = nullptr
 
G4double G4MT_parent_mass = 0.0
 
G4doubleG4MT_daughters_mass = nullptr
 
G4doubleG4MT_daughters_width = nullptr
 
G4Mutex daughtersMutex
 
G4Mutex parentMutex
 
G4int numberOfDaughters = 0
 
G4int verboseLevel = 1
 
- Static Protected Attributes inherited from G4VDecayChannel
static const G4String noName = " "
 

Detailed Description

Definition at line 53 of file G4MuonRadiativeDecayChannelWithSpin.hh.

Constructor & Destructor Documentation

◆ G4MuonRadiativeDecayChannelWithSpin() [1/2]

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)

◆ ~G4MuonRadiativeDecayChannelWithSpin()

G4MuonRadiativeDecayChannelWithSpin::~G4MuonRadiativeDecayChannelWithSpin ( )
virtual

Definition at line 91 of file G4MuonRadiativeDecayChannelWithSpin.cc.

92{
93}

◆ G4MuonRadiativeDecayChannelWithSpin() [2/2]

G4MuonRadiativeDecayChannelWithSpin::G4MuonRadiativeDecayChannelWithSpin ( const G4MuonRadiativeDecayChannelWithSpin r)
protected

Definition at line 95 of file G4MuonRadiativeDecayChannelWithSpin.cc.

98{
99}

Member Function Documentation

◆ 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 //
216 //// G4cout << " x, xx, yy, zz " << x << " " << xx << " "
217 //// << yy << " " << zz << G4endl;
218 //// G4cout << " phiE, cthetaE, sthetaE " << phiE << " "
219 //// << cthetaE << " "
220 //// << sthetaE << " " << G4endl;
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 //
244 //// G4cout << " y, xx, yy, zz " << y << " " << xx << " "
245 //// << yy << " " << zz << G4endl;
246 //// G4cout << " phiG, cthetaG, sthetaG " << phiG << " "
247 //// << cthetaG << " "
248 //// << sthetaG << " " << G4endl;
249
250 // Calculate the angle between positron and photon (cosine)
251 //
252 cthetaGE = cthetaE*cthetaG+sthetaE*sthetaG*std::cos(phiE-phiG);
253
254 //// G4cout << x << " " << cthetaE << " " << sthetaE << " "
255 //// << y << " " << cthetaG << " " << sthetaG << " "
256 //// << cthetaGE
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));
349 G4double phin = twopi*G4UniformRand()*rad;
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}
double G4double
Definition: G4Types.hh:83
int G4int
Definition: G4Types.hh:85
#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
G4ParticleDefinition ** G4MT_daughters
const G4String & GetParentName() const
G4ParticleDefinition * G4MT_parent
void CheckAndFillDaughters()
G4ThreeVector parent_polarization

◆ 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}
G4String * parent_name
G4String ** daughters_name
G4String kinematics_name

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