Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Member Functions
G4MuonRadiativeDecayChannelWithSpin Class Reference

#include <G4MuonRadiativeDecayChannelWithSpin.hh>

Inheritance diagram for G4MuonRadiativeDecayChannelWithSpin:
G4VDecayChannel

Public Member Functions

 G4MuonRadiativeDecayChannelWithSpin (const G4String &theParentName, G4double theBR)
 
virtual ~G4MuonRadiativeDecayChannelWithSpin ()
 
virtual G4DecayProducts * DecayIt (G4double)
 
void SetPolarization (G4ThreeVector)
 
const G4ThreeVector & GetPolarization () const
 
- 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 ()
 
G4int operator== (const G4VDecayChannel &right) const
 
G4int operator!= (const G4VDecayChannel &right) const
 
G4int operator< (const G4VDecayChannel &right) const
 
const G4String & GetKinematicsName () const
 
G4double GetBR () const
 
G4int GetNumberOfDaughters () const
 
G4ParticleDefinition * GetParent ()
 
G4ParticleDefinition * GetDaughter (G4int anIndex)
 
G4int GetAngularMomentum ()
 
const G4String & GetParentName () const
 
const G4String & GetDaughterName (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

 G4MuonRadiativeDecayChannelWithSpin (const G4MuonRadiativeDecayChannelWithSpin &)
 
G4MuonRadiativeDecayChannelWithSpin & operator= (const G4MuonRadiativeDecayChannelWithSpin &)
 
- Protected Member Functions inherited from G4VDecayChannel
void ClearDaughtersName ()
 
void FillDaughters ()
 
void FillParent ()
 
 G4VDecayChannel ()
 
 G4VDecayChannel (const G4VDecayChannel &)
 
G4VDecayChannel & operator= (const G4VDecayChannel &)
 

Additional Inherited Members

- Protected Attributes inherited from G4VDecayChannel
G4String kinematics_name
 
G4double rbranch
 
G4int numberOfDaughters
 
G4String * parent_name
 
G4String ** daughters_name
 
G4ParticleTable * particletable
 
G4int verboseLevel
 
G4ParticleDefinition * G4MT_parent
 
G4ParticleDefinition ** G4MT_daughters
 
G4double G4MT_parent_mass
 
G4double * G4MT_daughters_mass
 
- Static Protected Attributes inherited from G4VDecayChannel
static const G4String noName = " "
 

Detailed Description

Definition at line 61 of file G4MuonRadiativeDecayChannelWithSpin.hh.

Constructor & Destructor Documentation

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

Definition at line 60 of file G4MuonRadiativeDecayChannelWithSpin.cc.

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

Referenced by G4MuonRadiativeDecayChannelWithSpin().

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

Definition at line 93 of file G4MuonRadiativeDecayChannelWithSpin.cc.

94 {
95 }
G4MuonRadiativeDecayChannelWithSpin::G4MuonRadiativeDecayChannelWithSpin ( const G4MuonRadiativeDecayChannelWithSpin &  right)
protected

Definition at line 97 of file G4MuonRadiativeDecayChannelWithSpin.cc.

References G4MuonRadiativeDecayChannelWithSpin().

97  :
98  G4VDecayChannel(right)
99 {
100  parent_polarization = right.parent_polarization;
101 }

Member Function Documentation

G4DecayProducts * G4MuonRadiativeDecayChannelWithSpin::DecayIt ( G4double  )
virtual

if(i<10000000)goto leap1:

Implements G4VDecayChannel.

Definition at line 132 of file G4MuonRadiativeDecayChannelWithSpin.cc.

References CLHEP::HepLorentzVector::boost(), G4DecayProducts::DumpInfo(), G4VDecayChannel::FillDaughters(), G4VDecayChannel::FillParent(), G4cout, G4endl, G4VDecayChannel::G4MT_daughters, G4VDecayChannel::G4MT_parent, G4UniformRand, G4DynamicParticle::Get4Momentum(), G4VDecayChannel::GetParentName(), G4ParticleDefinition::GetPDGMass(), G4DynamicParticle::GetTotalMomentum(), G4VDecayChannel::GetVerboseLevel(), G4INCL::Math::min(), G4DecayProducts::PushProducts(), python.hepunit::rad, CLHEP::Hep3Vector::rotateUz(), G4DynamicParticle::Set4Momentum(), python.hepunit::twopi, CLHEP::Hep3Vector::unit(), and test::x.

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

Definition at line 114 of file G4MuonRadiativeDecayChannelWithSpin.hh.

115 {
116  return parent_polarization;
117 }
G4MuonRadiativeDecayChannelWithSpin & G4MuonRadiativeDecayChannelWithSpin::operator= ( const G4MuonRadiativeDecayChannelWithSpin &  right)
protected

Definition at line 103 of file G4MuonRadiativeDecayChannelWithSpin.cc.

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

104 {
105  if (this != &right) {
107  verboseLevel = right.verboseLevel;
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 ) {
121  //copy daughters name
122  for (G4int index=0; index < numberOfDaughters; index++) {
123  daughters_name[index] = new G4String(*right.daughters_name[index]);
124  }
125  }
126  parent_polarization = right.parent_polarization;
127  }
128  return *this;
129 }
int G4int
Definition: G4Types.hh:78
G4String kinematics_name
G4String * parent_name
G4String ** daughters_name
void G4MuonRadiativeDecayChannelWithSpin::SetPolarization ( G4ThreeVector  polar)
inline

Definition at line 108 of file G4MuonRadiativeDecayChannelWithSpin.hh.

109 {
110  parent_polarization = polar;
111 }

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