G4MuonDecayChannel.cc

Go to the documentation of this file.
00001 //
00002 // ********************************************************************
00003 // * License and Disclaimer                                           *
00004 // *                                                                  *
00005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
00006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
00007 // * conditions of the Geant4 Software License,  included in the file *
00008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
00009 // * include a list of copyright holders.                             *
00010 // *                                                                  *
00011 // * Neither the authors of this software system, nor their employing *
00012 // * institutes,nor the agencies providing financial support for this *
00013 // * work  make  any representation or  warranty, express or implied, *
00014 // * regarding  this  software system or assume any liability for its *
00015 // * use.  Please see the license in the file  LICENSE  and URL above *
00016 // * for the full disclaimer and the limitation of liability.         *
00017 // *                                                                  *
00018 // * This  code  implementation is the result of  the  scientific and *
00019 // * technical work of the GEANT4 collaboration.                      *
00020 // * By using,  copying,  modifying or  distributing the software (or *
00021 // * any work based  on the software)  you  agree  to acknowledge its *
00022 // * use  in  resulting  scientific  publications,  and indicate your *
00023 // * acceptance of all terms of the Geant4 Software license.          *
00024 // ********************************************************************
00025 //
00026 //
00027 // $Id$
00028 //
00029 // 
00030 // ------------------------------------------------------------
00031 //      GEANT 4 class header file
00032 //
00033 //      History: first implementation, based on object model of
00034 //      30 May  1997 H.Kurashige
00035 //
00036 //      Fix bug in calcuration of electron energy in DecayIt 28 Feb. 01 H.Kurashige 
00037 //2005
00038 // M. Melissas ( melissas AT cppm.in2p3.fr)
00039 // J. Brunner ( brunner AT cppm.in2p3.fr) 
00040 // Adding V-A fluxes for neutrinos using a new algortithm : 
00041 // ------------------------------------------------------------
00042 
00043 #include "G4ParticleDefinition.hh"
00044 #include "G4PhysicalConstants.hh"
00045 #include "G4SystemOfUnits.hh"
00046 #include "G4DecayProducts.hh"
00047 #include "G4VDecayChannel.hh"
00048 #include "G4MuonDecayChannel.hh"
00049 #include "Randomize.hh"
00050 #include "G4LorentzVector.hh"
00051 #include "G4LorentzRotation.hh"
00052 #include "G4RotationMatrix.hh"
00053 
00054 G4MuonDecayChannel::G4MuonDecayChannel()
00055                    :G4VDecayChannel()
00056 {
00057 }
00058 
00059 G4MuonDecayChannel::G4MuonDecayChannel(const G4String& theParentName, 
00060                                        G4double        theBR)
00061                    :G4VDecayChannel("Muon Decay",1)
00062 {
00063   // set names for daughter particles
00064   if (theParentName == "mu+") {
00065     SetBR(theBR);
00066     SetParent("mu+");
00067     SetNumberOfDaughters(3);
00068     SetDaughter(0, "e+");
00069     SetDaughter(1, "nu_e");
00070     SetDaughter(2, "anti_nu_mu");
00071   } else if (theParentName == "mu-") {
00072     SetBR(theBR);
00073     SetParent("mu-");
00074     SetNumberOfDaughters(3);
00075     SetDaughter(0, "e-");
00076     SetDaughter(1, "anti_nu_e");
00077     SetDaughter(2, "nu_mu");
00078   } else {
00079 #ifdef G4VERBOSE
00080     if (GetVerboseLevel()>0) {
00081       G4cout << "G4MuonDecayChannel:: constructor :";
00082       G4cout << " parent particle is not muon but ";
00083       G4cout << theParentName << G4endl;
00084     }
00085 #endif
00086   }
00087 }
00088 
00089 G4MuonDecayChannel::G4MuonDecayChannel(const G4MuonDecayChannel &right):
00090   G4VDecayChannel(right)
00091 {
00092 }
00093 
00094 G4MuonDecayChannel::~G4MuonDecayChannel()
00095 {
00096 }
00097 
00098 G4MuonDecayChannel & G4MuonDecayChannel::operator=(const G4MuonDecayChannel & right)
00099 {
00100   if (this != &right) { 
00101     kinematics_name = right.kinematics_name;
00102     verboseLevel = right.verboseLevel;
00103     rbranch = right.rbranch;
00104 
00105     // copy parent name
00106     parent_name = new G4String(*right.parent_name);
00107 
00108     // clear daughters_name array
00109     ClearDaughtersName();
00110 
00111     // recreate array
00112     numberOfDaughters = right.numberOfDaughters;
00113     if ( numberOfDaughters >0 ) {
00114       if (daughters_name !=0) ClearDaughtersName();
00115       daughters_name = new G4String*[numberOfDaughters];
00116       //copy daughters name
00117       for (G4int index=0; index < numberOfDaughters; index++) {
00118           daughters_name[index] = new G4String(*right.daughters_name[index]);
00119       }
00120     }
00121   }
00122   return *this;
00123 }
00124 
00125 G4DecayProducts *G4MuonDecayChannel::DecayIt(G4double) 
00126 {
00127   // this version neglects muon polarization,and electron mass  
00128   //              assumes the pure V-A coupling
00129   //              the Neutrinos are correctly V-A. 
00130 #ifdef G4VERBOSE
00131   if (GetVerboseLevel()>1) G4cout << "G4MuonDecayChannel::DecayIt ";
00132 #endif
00133 
00134   if (parent == 0) FillParent();  
00135   if (daughters == 0) FillDaughters();
00136  
00137   // parent mass
00138   G4double parentmass = parent->GetPDGMass();
00139 
00140   //daughters'mass
00141   G4double daughtermass[3]; 
00142   G4double sumofdaughtermass = 0.0;
00143   for (G4int index=0; index<3; index++){
00144     daughtermass[index] = daughters[index]->GetPDGMass();
00145     sumofdaughtermass += daughtermass[index];
00146   }
00147 
00148    //create parent G4DynamicParticle at rest
00149   G4ThreeVector dummy;
00150   G4DynamicParticle * parentparticle = new G4DynamicParticle( parent, dummy, 0.0);
00151   //create G4Decayproducts
00152   G4DecayProducts *products = new G4DecayProducts(*parentparticle);
00153   delete parentparticle;
00154 
00155   // calculate daughter momentum
00156   G4double daughtermomentum[3];
00157     // calcurate electron energy
00158   G4double xmax = (1.0+daughtermass[0]*daughtermass[0]/parentmass/parentmass);
00159   G4double x;
00160   
00161   G4double Ee,Ene;
00162   
00163   G4double gam;
00164    G4double EMax=parentmass/2-daughtermass[0];
00165    
00166   
00167    //Generating Random Energy
00168 do {
00169   Ee=G4UniformRand();
00170     do{
00171       x=xmax*G4UniformRand();
00172       gam=G4UniformRand();
00173     }while (gam >x*(1.-x));
00174     Ene=x;
00175   } while ( Ene < (1.-Ee));
00176  G4double Enm=(2.-Ee-Ene);
00177 
00178 
00179  //initialisation of rotation parameters
00180 
00181   G4double costheta,sintheta,rphi,rtheta,rpsi;
00182   costheta= 1.-2./Ee-2./Ene+2./Ene/Ee;
00183   sintheta=std::sqrt(1.-costheta*costheta);
00184   
00185 
00186   rphi=twopi*G4UniformRand()*rad;
00187   rtheta=(std::acos(2.*G4UniformRand()-1.));
00188   rpsi=twopi*G4UniformRand()*rad;
00189 
00190   G4RotationMatrix rot;
00191   rot.set(rphi,rtheta,rpsi);
00192 
00193   //electron 0
00194   daughtermomentum[0]=std::sqrt(Ee*Ee*EMax*EMax+2.0*Ee*EMax * daughtermass[0]);
00195   G4ThreeVector direction0(0.0,0.0,1.0);
00196 
00197   direction0 *= rot;
00198 
00199   G4DynamicParticle * daughterparticle = new G4DynamicParticle ( daughters[0],   direction0 * daughtermomentum[0]);
00200 
00201   products->PushProducts(daughterparticle);
00202   
00203   //electronic neutrino  1
00204 
00205   daughtermomentum[1]=std::sqrt(Ene*Ene*EMax*EMax+2.0*Ene*EMax * daughtermass[1]);
00206   G4ThreeVector direction1(sintheta,0.0,costheta);
00207 
00208   direction1 *= rot;
00209 
00210   G4DynamicParticle * daughterparticle1 = new G4DynamicParticle ( daughters[1],  direction1 * daughtermomentum[1]);
00211   products->PushProducts(daughterparticle1);
00212 
00213   //muonnic neutrino 2
00214   
00215      daughtermomentum[2]=std::sqrt(Enm*Enm*EMax*EMax +2.0*Enm*EMax*daughtermass[2]);
00216   G4ThreeVector direction2(-Ene/Enm*sintheta,0,-Ee/Enm-Ene/Enm*costheta);
00217 
00218   direction2 *= rot;
00219 
00220   G4DynamicParticle * daughterparticle2 = new G4DynamicParticle ( daughters[2],
00221          direction2 * daughtermomentum[2]);
00222   products->PushProducts(daughterparticle2);
00223 
00224 
00225 
00226 
00227  // output message
00228 #ifdef G4VERBOSE
00229   if (GetVerboseLevel()>1) {
00230     G4cout << "G4MuonDecayChannel::DecayIt ";
00231     G4cout << "  create decay products in rest frame " <<G4endl;
00232     products->DumpInfo();
00233   }
00234 #endif
00235   return products;
00236 }
00237 
00238 
00239 
00240 
00241 
00242 

Generated on Mon May 27 17:48:54 2013 for Geant4 by  doxygen 1.4.7