Muon Decay Channel file

This commit is contained in:
paraiso
2006-03-15 10:37:11 +00:00
parent 9e34d2e943
commit 441cec0b4e
2 changed files with 210 additions and 191 deletions

View File

@ -1,190 +1,209 @@
// //
// ******************************************************************** // ********************************************************************
// * DISCLAIMER * // * DISCLAIMER *
// * * // * *
// * The following disclaimer summarizes all the specific disclaimers * // * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which * // * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: * // * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license * // * http://cern.ch/geant4/license *
// * * // * *
// * Neither the authors of this software system, nor their employing * // * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this * // * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, * // * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its * // * regarding this software system or assume any liability for its *
// * use. * // * use. *
// * * // * *
// * This code implementation is the intellectual property of the * // * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. * // * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work * // * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this * // * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. * // * statement, and all its terms. *
// ******************************************************************** // ********************************************************************
// //
// //
// $Id: G4MuonDecayChannel.cc,v 1.11 2004/12/10 18:02:04 gcosmo Exp $ // $Id: G4MuonDecayChannel.cc,v 1.13 2005/06/23 11:02:26 gcosmo Exp $
// GEANT4 tag $Name: geant4-07-00-cand-05 $ // GEANT4 tag $Name: geant4-07-01 $
// //
// //
// ------------------------------------------------------------ // ------------------------------------------------------------
// GEANT 4 class header file // GEANT 4 class header file
// //
// History: first implementation, based on object model of // History: first implementation, based on object model of
// 30 May 1997 H.Kurashige // 30 May 1997 H.Kurashige
// //
// Fix bug in calcuration of electron energy in DecayIt 28 Feb. 01 H.Kurashige // Fix bug in calcuration of electron energy in DecayIt 28 Feb. 01 H.Kurashige
// ------------------------------------------------------------ //2005
// M. Melissas ( melissas AT cppm.in2p3.fr)
#include "G4ParticleDefinition.hh" // J. Brunner ( brunner AT cppm.in2p3.fr)
#include "G4DecayProducts.hh" // Adding V-A fluxes for neutrinos using a new algortithm :
#include "G4VDecayChannel.hh" // ------------------------------------------------------------
#include "G4MuonDecayChannel.hh"
#include "Randomize.hh" #include "G4ParticleDefinition.hh"
#include "G4LorentzVector.hh" #include "G4DecayProducts.hh"
#include "G4LorentzRotation.hh" #include "G4VDecayChannel.hh"
#include "G4MuonDecayChannel.hh"
#include "Randomize.hh"
G4MuonDecayChannel::G4MuonDecayChannel(const G4String& theParentName, #include "G4LorentzVector.hh"
G4double theBR) #include "G4LorentzRotation.hh"
:G4VDecayChannel("Muon Decay",1) #include "G4RotationMatrix.hh"
{
// set names for daughter particles
if (theParentName == "mu+") { G4MuonDecayChannel::G4MuonDecayChannel(const G4String& theParentName,
SetBR(theBR); G4double theBR)
SetParent("mu+"); :G4VDecayChannel("Muon Decay",1)
SetNumberOfDaughters(3); {
SetDaughter(0, "e+"); // set names for daughter particles
SetDaughter(1, "nu_e"); if (theParentName == "mu+") {
SetDaughter(2, "anti_nu_mu"); SetBR(theBR);
} else if (theParentName == "Mu") { SetParent("mu+");
SetBR(theBR); SetNumberOfDaughters(3);
SetParent("Mu"); SetDaughter(0, "e+");
SetNumberOfDaughters(3); SetDaughter(1, "nu_e");
SetDaughter(0, "e+"); SetDaughter(2, "anti_nu_mu");
SetDaughter(1, "nu_e"); } else if (theParentName == "Mu") {
SetDaughter(2, "anti_nu_mu"); SetBR(theBR);
} else if (theParentName == "mu-") { SetParent("Mu");
SetBR(theBR); SetNumberOfDaughters(3);
SetParent("mu-"); SetDaughter(0, "e+");
SetNumberOfDaughters(3); SetDaughter(1, "nu_e");
SetDaughter(0, "e-"); SetDaughter(2, "anti_nu_mu");
SetDaughter(1, "anti_nu_e"); } else if (theParentName == "mu-") {
SetDaughter(2, "nu_mu"); SetBR(theBR);
} else { SetParent("mu-");
#ifdef G4VERBOSE SetNumberOfDaughters(3);
if (GetVerboseLevel()>0) { SetDaughter(0, "e-");
G4cout << "G4MuonDecayChannel:: constructor :"; SetDaughter(1, "anti_nu_e");
G4cout << " parent particle is not muon but "; SetDaughter(2, "nu_mu");
G4cout << theParentName << G4endl; } else {
} #ifdef G4VERBOSE
#endif if (GetVerboseLevel()>0) {
} G4cout << "G4MuonDecayChannel:: constructor :";
} G4cout << " parent particle is not muon but ";
G4cout << theParentName << G4endl;
G4MuonDecayChannel::~G4MuonDecayChannel() }
{ #endif
} }
}
G4DecayProducts *G4MuonDecayChannel::DecayIt(G4double)
{ G4MuonDecayChannel::~G4MuonDecayChannel()
// this version neglects muon polarization {
// assumes the pure V-A coupling }
// gives incorrect energy spectrum for neutrinos
#ifdef G4VERBOSE G4DecayProducts *G4MuonDecayChannel::DecayIt(G4double)
if (GetVerboseLevel()>1) G4cout << "G4MuonDecayChannel::DecayIt "; {
#endif // this version neglects muon polarization,and electron mass
// assumes the pure V-A coupling
if (parent == 0) FillParent(); // the Neutrinos are correctly V-A.
if (daughters == 0) FillDaughters(); #ifdef G4VERBOSE
if (GetVerboseLevel()>1) G4cout << "G4MuonDecayChannel::DecayIt ";
// parent mass #endif
G4double parentmass = parent->GetPDGMass();
if (parent == 0) FillParent();
//daughters'mass if (daughters == 0) FillDaughters();
G4double daughtermass[3];
G4double sumofdaughtermass = 0.0; // parent mass
for (G4int index=0; index<3; index++){ G4double parentmass = parent->GetPDGMass();
daughtermass[index] = daughters[index]->GetPDGMass();
sumofdaughtermass += daughtermass[index]; //daughters'mass
} G4double daughtermass[3];
G4double sumofdaughtermass = 0.0;
//create parent G4DynamicParticle at rest for (G4int index=0; index<3; index++){
G4ThreeVector dummy; daughtermass[index] = daughters[index]->GetPDGMass();
G4DynamicParticle * parentparticle = new G4DynamicParticle( parent, dummy, 0.0); sumofdaughtermass += daughtermass[index];
//create G4Decayproducts }
G4DecayProducts *products = new G4DecayProducts(*parentparticle);
delete parentparticle; //create parent G4DynamicParticle at rest
G4ThreeVector dummy;
// calculate daughter momentum G4DynamicParticle * parentparticle = new G4DynamicParticle( parent, dummy, 0.0);
G4double daughtermomentum[3]; //create G4Decayproducts
G4double energy; G4DecayProducts *products = new G4DecayProducts(*parentparticle);
// calcurate electron energy delete parentparticle;
G4double xmax = (1.0+daughtermass[0]*daughtermass[0]/parentmass/parentmass);
G4double x; // calculate daughter momentum
G4double r; G4double daughtermomentum[3];
do { // calcurate electron energy
do { G4double xmax = (1.0+daughtermass[0]*daughtermass[0]/parentmass/parentmass);
r = G4UniformRand(); G4double x;
x = xmax*G4UniformRand();
} while (r > (3.0 - 2.0*x)*x*x); G4double Ee,Ene;
energy = x*parentmass/2.0 - daughtermass[0];
} while (energy <0.0); G4double gam;
//create daughter G4DynamicParticle G4double EMax=parentmass/2-daughtermass[0];
// daughter 0 (electron)
daughtermomentum[0] = std::sqrt(energy*energy + 2.0*energy* daughtermass[0]);
G4double costheta, sintheta, phi, sinphi, cosphi; //Generating Random Energy
costheta = 2.*G4UniformRand()-1.0; do {
sintheta = std::sqrt((1.0-costheta)*(1.0+costheta)); Ee=G4UniformRand();
phi = twopi*G4UniformRand()*rad; do{
sinphi = std::sin(phi); x=xmax*G4UniformRand();
cosphi = std::cos(phi); gam=G4UniformRand();
G4ThreeVector direction0(sintheta*cosphi,sintheta*sinphi,costheta); }while (gam >x*(1.-x));
G4DynamicParticle * daughterparticle Ene=x;
= new G4DynamicParticle( daughters[0], direction0*daughtermomentum[0]); } while ( Ene < (1.-Ee));
products->PushProducts(daughterparticle); G4double Enm=(2.-Ee-Ene);
// daughter 1 ,2 (nutrinos)
// create neutrinos in the C.M frame of two neutrinos //initialisation of rotation parameters
G4double energy2 = parentmass*(1.0 - x/2.0);
G4double vmass = std::sqrt((energy2-daughtermomentum[0])*(energy2+daughtermomentum[0])); G4double costheta,sintheta,rphi,rtheta,rpsi;
G4double beta = -1.0*daughtermomentum[0]/energy2; costheta= 1.-2./Ee-2./Ene+2./Ene/Ee;
G4double costhetan = 2.*G4UniformRand()-1.0; sintheta=sqrt(1.-costheta*costheta);
G4double sinthetan = std::sqrt((1.0-costhetan)*(1.0+costhetan));
G4double phin = twopi*G4UniformRand()*rad;
G4double sinphin = std::sin(phin); rphi=twopi*G4UniformRand()*rad;
G4double cosphin = std::cos(phin); rtheta=(acos(2.*G4UniformRand()-1.));
rpsi=twopi*G4UniformRand()*rad;
G4ThreeVector direction1(sinthetan*cosphin,sinthetan*sinphin,costhetan);
G4DynamicParticle * daughterparticle1 G4RotationMatrix *rot= new G4RotationMatrix();
= new G4DynamicParticle( daughters[1], direction1*(vmass/2.)); rot->set(rphi,rtheta,rpsi);
G4DynamicParticle * daughterparticle2
= new G4DynamicParticle( daughters[2], direction1*(-1.0*vmass/2.)); //electron 0
daughtermomentum[0]=sqrt(Ee*Ee*EMax*EMax+2.0*Ee*EMax * daughtermass[0]);
// boost to the muon rest frame G4ThreeVector *direction0 =new G4ThreeVector(0.0,0.0,1.0);
G4LorentzVector p4;
p4 = daughterparticle1->Get4Momentum(); *direction0 *= *rot;
p4.boost( direction0.x()*beta, direction0.y()*beta, direction0.z()*beta);
daughterparticle1->Set4Momentum(p4); G4DynamicParticle * daughterparticle = new G4DynamicParticle ( daughters[0], *direction0 * daughtermomentum[0]);
p4 = daughterparticle2->Get4Momentum();
p4.boost( direction0.x()*beta, direction0.y()*beta, direction0.z()*beta); products->PushProducts(daughterparticle);
daughterparticle2->Set4Momentum(p4);
products->PushProducts(daughterparticle1); //electronic neutrino 1
products->PushProducts(daughterparticle2);
daughtermomentum[1] = daughterparticle1->GetTotalMomentum(); daughtermomentum[1]=sqrt(Ene*Ene*EMax*EMax+2.0*Ene*EMax * daughtermass[1]);
daughtermomentum[2] = daughterparticle2->GetTotalMomentum(); G4ThreeVector *direction1 =new G4ThreeVector(sintheta,0.0,costheta);
// output message *direction1 *= *rot;
#ifdef G4VERBOSE
if (GetVerboseLevel()>1) { G4DynamicParticle * daughterparticle1 = new G4DynamicParticle ( daughters[1], *direction1 * daughtermomentum[1]);
G4cout << "G4MuonDecayChannel::DecayIt "; products->PushProducts(daughterparticle1);
G4cout << " create decay products in rest frame " <<G4endl;
products->DumpInfo(); //muonnic neutrino 2
}
#endif daughtermomentum[2]=sqrt(Enm*Enm*EMax*EMax +2.0*Enm*EMax*daughtermass[2]);
return products; G4ThreeVector *direction2 =new G4ThreeVector(-Ene/Enm*sintheta,0,-Ee/Enm-Ene/Enm*costheta);
}
*direction2 *= *rot;
G4DynamicParticle * daughterparticle2 = new G4DynamicParticle ( daughters[2],
*direction2 * daughtermomentum[2]);
products->PushProducts(daughterparticle2);
// output message
#ifdef G4VERBOSE
if (GetVerboseLevel()>1) {
G4cout << "G4MuonDecayChannel::DecayIt ";
G4cout << " create decay products in rest frame " <<G4endl;
products->DumpInfo();
}
#endif
return products;
}

View File

@ -22,7 +22,7 @@
// //
// //
// $Id: G4MuonDecayChannel.hh,v 1.5 2001/07/11 10:01:56 gunter Exp $ // $Id: G4MuonDecayChannel.hh,v 1.5 2001/07/11 10:01:56 gunter Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $ // GEANT4 tag $Name: geant4-07-01 $
// //
// //
// ------------------------------------------------------------ // ------------------------------------------------------------