Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4TauLeptonicDecayChannel.cc
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 //
27 // $Id: G4TauLeptonicDecayChannel.cc 95906 2016-03-02 10:56:50Z gcosmo $
28 //
29 //
30 // ------------------------------------------------------------
31 // GEANT 4 class header file
32 //
33 // History: first implementation, based on object model of
34 // 30 May 1997 H.Kurashige
35 //
36 // Fix bug in calcuration of electron energy in DecayIt 28 Feb. 01 H.Kurashige
37 // ------------------------------------------------------------
38 
39 #include "G4ParticleDefinition.hh"
40 #include "G4PhysicalConstants.hh"
41 #include "G4SystemOfUnits.hh"
42 #include "G4DecayProducts.hh"
43 #include "G4VDecayChannel.hh"
45 #include "Randomize.hh"
46 #include "G4LorentzVector.hh"
47 #include "G4LorentzRotation.hh"
48 
49 
52 {
53 }
54 
55 
57  const G4String& theParentName,
58  G4double theBR,
59  const G4String& theLeptonName)
60  :G4VDecayChannel("Tau Leptonic Decay",1)
61 {
62  // set names for daughter particles
63  if (theParentName == "tau+") {
64  SetBR(theBR);
65  SetParent("tau+");
67  if ((theLeptonName=="e-"||theLeptonName=="e+")){
68  SetDaughter(0, "e+");
69  SetDaughter(1, "nu_e");
70  SetDaughter(2, "anti_nu_tau");
71  } else {
72  SetDaughter(0, "mu+");
73  SetDaughter(1, "nu_mu");
74  SetDaughter(2, "anti_nu_tau");
75  }
76  } else if (theParentName == "tau-") {
77  SetBR(theBR);
78  SetParent("tau-");
80  if ((theLeptonName=="e-"||theLeptonName=="e+")){
81  SetDaughter(0, "e-");
82  SetDaughter(1, "anti_nu_e");
83  SetDaughter(2, "nu_tau");
84  } else {
85  SetDaughter(0, "mu-");
86  SetDaughter(1, "anti_nu_mu");
87  SetDaughter(2, "nu_tau");
88  }
89  } else {
90 #ifdef G4VERBOSE
91  if (GetVerboseLevel()>0) {
92  G4cout << "G4TauLeptonicDecayChannel:: constructor :";
93  G4cout << " parent particle is not tau but ";
94  G4cout << theParentName << G4endl;
95  }
96 #endif
97  }
98 }
99 
101 {
102 }
103 
105  G4VDecayChannel(right)
106 {
107 }
108 
110 {
111  if (this != &right) {
113  verboseLevel = right.verboseLevel;
114  rbranch = right.rbranch;
115 
116  // copy parent name
117  parent_name = new G4String(*right.parent_name);
118 
119  // clear daughters_name array
121 
122  // recreate array
124  if ( numberOfDaughters >0 ) {
127  //copy daughters name
128  for (G4int index=0; index < numberOfDaughters; index++) {
129  daughters_name[index] = new G4String(*right.daughters_name[index]);
130  }
131  }
132  }
133  return *this;
134 }
135 
137 {
138  // this version neglects muon polarization
139  // assumes the pure V-A coupling
140  // gives incorrect energy spectrum for neutrinos
141 #ifdef G4VERBOSE
142  if (GetVerboseLevel()>1) G4cout << "G4TauLeptonicDecayChannel::DecayIt ";
143 #endif
144 
147 
148  // parent mass
149  G4double parentmass = G4MT_parent->GetPDGMass();
150 
151  //daughters'mass
152  const G4int N_DAUGHTER=3;
153  G4double daughtermass[N_DAUGHTER];
154  for (G4int index=0; index<N_DAUGHTER; index++){
155  daughtermass[index] = G4MT_daughters[index]->GetPDGMass();
156  }
157 
158  //create parent G4DynamicParticle at rest
159  G4ThreeVector dummy;
160  G4DynamicParticle * parentparticle = new G4DynamicParticle( G4MT_parent, dummy, 0.0);
161  //create G4Decayproducts
162  G4DecayProducts *products = new G4DecayProducts(*parentparticle);
163  delete parentparticle;
164 
165  // calculate daughter momentum
166  G4double daughtermomentum[N_DAUGHTER];
167 
168  // calcurate lepton momentum
169  G4double pmax = (parentmass*parentmass-daughtermass[0]*daughtermass[0])/2./parentmass;
170  G4double p, e;
171  G4double r;
172  const size_t MAX_LOOP=10000;
173  for (size_t loop_counter=0; loop_counter <MAX_LOOP; ++loop_counter){
174  // determine momentum/energy
175  r = G4UniformRand();
176  p = pmax*G4UniformRand();
177  e = std::sqrt(p*p + daughtermass[0]*daughtermass[0]);
178  if (r < spectrum(p,e,parentmass,daughtermass[0]) ) break;
179  }
180 
181  //create daughter G4DynamicParticle
182  // daughter 0 (lepton)
183  daughtermomentum[0] = p;
184  G4double costheta, sintheta, phi, sinphi, cosphi;
185  costheta = 2.*G4UniformRand()-1.0;
186  sintheta = std::sqrt((1.0-costheta)*(1.0+costheta));
187  phi = twopi*G4UniformRand()*rad;
188  sinphi = std::sin(phi);
189  cosphi = std::cos(phi);
190  G4ThreeVector direction0(sintheta*cosphi,sintheta*sinphi,costheta);
191  G4DynamicParticle * daughterparticle
192  = new G4DynamicParticle( G4MT_daughters[0], direction0*daughtermomentum[0]);
193  products->PushProducts(daughterparticle);
194 
195  // daughter 1 ,2 (nutrinos)
196  // create neutrinos in the C.M frame of two neutrinos
197  G4double energy2 = parentmass-e;
198  G4double vmass = std::sqrt((energy2-daughtermomentum[0])*(energy2+daughtermomentum[0]));
199  G4double beta = -1.0*daughtermomentum[0]/energy2;
200  G4double costhetan = 2.*G4UniformRand()-1.0;
201  G4double sinthetan = std::sqrt((1.0-costhetan)*(1.0+costhetan));
202  G4double phin = twopi*G4UniformRand()*rad;
203  G4double sinphin = std::sin(phin);
204  G4double cosphin = std::cos(phin);
205 
206  G4ThreeVector direction1(sinthetan*cosphin,sinthetan*sinphin,costhetan);
207  G4DynamicParticle * daughterparticle1
208  = new G4DynamicParticle( G4MT_daughters[1], direction1*(vmass/2.));
209  G4DynamicParticle * daughterparticle2
210  = new G4DynamicParticle( G4MT_daughters[2], direction1*(-1.0*vmass/2.));
211 
212  // boost to the muon rest frame
213  G4LorentzVector p4;
214  p4 = daughterparticle1->Get4Momentum();
215  p4.boost( direction0.x()*beta, direction0.y()*beta, direction0.z()*beta);
216  daughterparticle1->Set4Momentum(p4);
217  p4 = daughterparticle2->Get4Momentum();
218  p4.boost( direction0.x()*beta, direction0.y()*beta, direction0.z()*beta);
219  daughterparticle2->Set4Momentum(p4);
220  products->PushProducts(daughterparticle1);
221  products->PushProducts(daughterparticle2);
222  daughtermomentum[1] = daughterparticle1->GetTotalMomentum();
223  daughtermomentum[2] = daughterparticle2->GetTotalMomentum();
224 
225 
226  // output message
227 #ifdef G4VERBOSE
228  if (GetVerboseLevel()>1) {
229  G4cout << "G4TauLeptonicDecayChannel::DecayIt ";
230  G4cout << " create decay products in rest frame " <<G4endl;
231  products->DumpInfo();
232  }
233 #endif
234  return products;
235 }
236 
237 
238 
239 
240 G4double G4TauLeptonicDecayChannel::spectrum(G4double p,
241  G4double e,
242  G4double mtau,
243  G4double ml)
244 {
245  G4double f1;
246  f1 = 3.0*e*(mtau*mtau+ml*ml)-4.0*mtau*e*e-2.0*mtau*ml*ml;
247  return p*(f1)/(mtau*mtau*mtau*mtau)/(0.6);
248 }
249 
250 
251 
void CheckAndFillDaughters()
virtual G4DecayProducts * DecayIt(G4double)
void SetBR(G4double value)
double x() const
G4int PushProducts(G4DynamicParticle *aParticle)
G4ParticleDefinition * G4MT_parent
const char * p
Definition: xmltok.h:285
G4ParticleDefinition ** G4MT_daughters
static constexpr double rad
Definition: G4SIunits.hh:149
int G4int
Definition: G4Types.hh:78
double z() const
static constexpr double twopi
Definition: G4SIunits.hh:76
G4double GetTotalMomentum() const
#define G4UniformRand()
Definition: Randomize.hh:97
G4GLOB_DLL std::ostream G4cout
G4String kinematics_name
void DumpInfo() const
void SetNumberOfDaughters(G4int value)
G4TauLeptonicDecayChannel & operator=(const G4TauLeptonicDecayChannel &)
HepLorentzVector & boost(double, double, double)
G4String * parent_name
G4LorentzVector Get4Momentum() const
void Set4Momentum(const G4LorentzVector &momentum)
G4int GetVerboseLevel() const
G4double GetPDGMass() const
void SetParent(const G4ParticleDefinition *particle_type)
double y() const
void SetDaughter(G4int anIndex, const G4ParticleDefinition *particle_type)
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
G4String ** daughters_name