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.5 ] [ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

Diff markup

Differences between /particles/management/src/G4TauLeptonicDecayChannel.cc (Version 11.3.0) and /particles/management/src/G4TauLeptonicDecayChannel.cc (Version 10.2.p3)


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