Import Geant4 0.1.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-08 15:09:25 +02:00
parent b97f8d0df7
commit aaa409b6ee
2922 changed files with 55107 additions and 81674 deletions
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4PhaseSpaceDecayChannel.cc,v 2.5 1998/11/18 09:46:39 kurasige Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4PhaseSpaceDecayChannel.cc,v 1.3 1999/04/13 08:00:34 kurasige Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// ------------------------------------------------------------
@@ -64,10 +64,10 @@ G4DecayProducts *G4PhaseSpaceDecayChannel::DecayIt(G4double parentMass)
if (GetVerboseLevel()>1) G4cout << "G4PhaseSpaceDecayChannel::DecayIt ";
#endif
G4DecayProducts * products = NULL;
G4DecayProducts * products = 0;
if (parent == NULL) FillParent();
if (daughters == NULL) FillDaughters();
if (parent == 0) FillParent();
if (daughters == 0) FillDaughters();
if (parentMass >0.0) parent_mass = parentMass;
switch (numberOfDaughters){
@@ -93,7 +93,7 @@ G4DecayProducts *G4PhaseSpaceDecayChannel::DecayIt(G4double parentMass)
break;
}
#ifdef G4VERBOSE
if ((products == NULL) && (GetVerboseLevel()>0)) {
if ((products == 0) && (GetVerboseLevel()>0)) {
G4cout << "G4PhaseSpaceDecayChannel::DecayIt ";
G4cout << *parent_name << " can not decay " << endl;
DumpInfo();
@@ -111,7 +111,7 @@ G4DecayProducts *G4PhaseSpaceDecayChannel::OneBodyDecayIt()
G4double daughtermass = daughters_mass[0];
//create parent G4DynamicParticle at rest
G4ParticleMomentum dummy;
G4ThreeVector dummy;
G4DynamicParticle * parentparticle = new G4DynamicParticle( parent, dummy, 0.0);
//create G4Decayproducts
G4DecayProducts *products = new G4DecayProducts(*parentparticle);
@@ -147,7 +147,7 @@ G4DecayProducts *G4PhaseSpaceDecayChannel::TwoBodyDecayIt()
G4double sumofdaughtermass = daughtermass[0] + daughtermass[1];
//create parent G4DynamicParticle at rest
G4ParticleMomentum dummy;
G4ThreeVector dummy;
G4DynamicParticle * parentparticle = new G4DynamicParticle( parent, dummy, 0.0);
//create G4Decayproducts
G4DecayProducts *products = new G4DecayProducts(*parentparticle);
@@ -158,7 +158,7 @@ G4DecayProducts *G4PhaseSpaceDecayChannel::TwoBodyDecayIt()
G4double costheta = 2.*G4UniformRand()-1.0;
G4double sintheta = sqrt((1.0 - costheta)*(1.0 + costheta));
G4double phi = 2.0*M_PI*G4UniformRand()*rad;
G4ParticleMomentum direction(sintheta*cos(phi),sintheta*sin(phi),costheta);
G4ThreeVector direction(sintheta*cos(phi),sintheta*sin(phi),costheta);
//create daughter G4DynamicParticle
G4DynamicParticle * daughterparticle = new G4DynamicParticle( daughters[0], direction*daughtermomentum);
@@ -193,7 +193,7 @@ G4DecayProducts *G4PhaseSpaceDecayChannel::ThreeBodyDecayIt()
}
//create parent G4DynamicParticle at rest
G4ParticleMomentum dummy;
G4ThreeVector dummy;
G4DynamicParticle * parentparticle = new G4DynamicParticle( parent, dummy, 0.0);
//create G4Decayproducts
G4DecayProducts *products = new G4DecayProducts(*parentparticle);
@@ -250,7 +250,7 @@ G4DecayProducts *G4PhaseSpaceDecayChannel::ThreeBodyDecayIt()
phi = 2.0*M_PI*G4UniformRand()*rad;
sinphi = sin(phi);
cosphi = cos(phi);
G4ParticleMomentum direction0(sintheta*cosphi,sintheta*sinphi,costheta);
G4ThreeVector direction0(sintheta*cosphi,sintheta*sinphi,costheta);
G4DynamicParticle * daughterparticle
= new G4DynamicParticle( daughters[0], direction0*daughtermomentum[0]);
products->PushProducts(daughterparticle);
@@ -260,7 +260,7 @@ G4DecayProducts *G4PhaseSpaceDecayChannel::ThreeBodyDecayIt()
phin = 2.0*M_PI*G4UniformRand()*rad;
sinphin = sin(phin);
cosphin = cos(phin);
G4ParticleMomentum direction2;
G4ThreeVector direction2;
direction2.setX( sinthetan*cosphin*costheta*cosphi - sinthetan*sinphin*sinphi + costhetan*sintheta*cosphi);
direction2.setY( sinthetan*cosphin*costheta*sinphi + sinthetan*sinphin*cosphi + costhetan*sintheta*sinphi);
direction2.setZ( -sinthetan*cosphin*sintheta + costhetan*costheta);
@@ -315,7 +315,7 @@ G4DecayProducts *G4PhaseSpaceDecayChannel::ManyBodyDecayIt()
//Calculate daughter momentum
G4double *daughtermomentum = new G4double[numberOfDaughters];
G4ParticleMomentum direction;
G4ThreeVector direction;
G4DynamicParticle **daughterparticle;
G4double *sm = new G4double[numberOfDaughters];
G4double tmas;
@@ -381,7 +381,7 @@ G4DecayProducts *G4PhaseSpaceDecayChannel::ManyBodyDecayIt()
delete [] sm;
delete [] daughtermass;
delete [] daughtermomentum;
return NULL; // Error detection
return 0; // Error detection
} else {
// calculate weight of this events
@@ -405,7 +405,7 @@ G4DecayProducts *G4PhaseSpaceDecayChannel::ManyBodyDecayIt()
delete [] sm;
delete [] daughtermass;
delete [] daughtermomentum;
return NULL; // Error detection
return 0; // Error detection
}
} while ( weight > G4UniformRand());