Import Geant4 7.1.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 12:11:21 +02:00
parent 516dbf1a58
commit d93e1e39a9
5384 changed files with 125662 additions and 82444 deletions
@@ -22,7 +22,7 @@
//
//
// $Id: G4DalitzDecayChannel.cc,v 1.7 2004/12/10 18:02:04 gcosmo Exp $
// GEANT4 tag $Name: geant4-07-00-cand-05 $
// GEANT4 tag $Name: geant4-07-01 $
//
//
// ------------------------------------------------------------
@@ -22,7 +22,7 @@
//
//
// $Id: G4DecayProducts.cc,v 1.13 2004/12/02 07:46:08 kurasige Exp $
// GEANT4 tag $Name: geant4-07-00-cand-03 $
// GEANT4 tag $Name: geant4-07-01 $
//
//
// ------------------------------------------------------------
@@ -22,7 +22,7 @@
//
//
// $Id: G4DecayTable.cc,v 1.7 2001/07/11 10:01:59 gunter Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
// GEANT4 tag $Name: geant4-07-01 $
//
//
// ------------------------------------------------------------
@@ -22,7 +22,7 @@
//
//
// $Id: G4DecayTableMessenger.cc,v 1.5 2003/06/16 16:58:24 gunter Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
// GEANT4 tag $Name: geant4-07-01 $
//
//
//---------------------------------------------------------------
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4DynamicParticle.cc,v 1.21 2004/12/02 07:46:08 kurasige Exp $
// GEANT4 tag $Name: geant4-07-00-cand-03 $
// $Id: G4DynamicParticle.cc,v 1.22 2005/05/30 07:13:18 asaim Exp $
// GEANT4 tag $Name: geant4-07-01 $
//
//
// --------------------------------------------------------------
@@ -78,7 +78,8 @@ G4DynamicParticle::G4DynamicParticle():
thePreAssignedDecayProducts(0),
thePreAssignedDecayTime(-1.0),
verboseLevel(1),
primaryParticle(0)
primaryParticle(0),
thePDGcode(0)
{
theDynamicalMass = 0.0;
theDynamicalCharge= 0.0;
@@ -98,7 +99,8 @@ G4DynamicParticle::G4DynamicParticle(G4ParticleDefinition * aParticleDefinition,
thePreAssignedDecayProducts(0),
thePreAssignedDecayTime(-1.0),
verboseLevel(1),
primaryParticle(0)
primaryParticle(0),
thePDGcode(0)
{
// set dynamic charge/mass
theDynamicalMass = aParticleDefinition->GetPDGMass();
@@ -114,7 +116,8 @@ G4DynamicParticle::G4DynamicParticle(G4ParticleDefinition * aParticleDefinition,
thePreAssignedDecayProducts(0),
thePreAssignedDecayTime(-1.0),
verboseLevel(1),
primaryParticle(0)
primaryParticle(0),
thePDGcode(0)
{
// set dynamic charge/mass
theDynamicalMass = aParticleDefinition->GetPDGMass();
@@ -144,7 +147,8 @@ G4DynamicParticle::G4DynamicParticle(G4ParticleDefinition * aParticleDefinition,
thePreAssignedDecayProducts(0),
thePreAssignedDecayTime(-1.0),
verboseLevel(1),
primaryParticle(0)
primaryParticle(0),
thePDGcode(0)
{
// set dynamic charge/mass
theDynamicalMass = aParticleDefinition->GetPDGMass();
@@ -184,7 +188,8 @@ G4DynamicParticle::G4DynamicParticle(G4ParticleDefinition * aParticleDefinition,
thePreAssignedDecayProducts(0),
thePreAssignedDecayTime(-1.0),
verboseLevel(1),
primaryParticle(0)
primaryParticle(0),
thePDGcode(0)
{
// set dynamic charge/mass
theDynamicalMass = aParticleDefinition->GetPDGMass();
@@ -239,6 +244,7 @@ G4DynamicParticle::G4DynamicParticle(const G4DynamicParticle &right)
thePreAssignedDecayTime = -1.0;
primaryParticle = right.primaryParticle;
thePDGcode = right.thePDGcode;
}
////////////////////
@@ -22,7 +22,7 @@
//
//
// $Id: G4ElectronOccupancy.cc,v 1.8 2004/06/11 14:25:29 gcosmo Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
// GEANT4 tag $Name: geant4-07-01 $
//
//
// ----------------------------------------------------------------------
@@ -22,7 +22,7 @@
//
//
// $Id: G4IonTable.cc,v 1.36 2004/12/02 07:46:08 kurasige Exp $
// GEANT4 tag $Name: geant4-07-00-cand-03 $
// GEANT4 tag $Name: geant4-07-01 $
//
//
// --------------------------------------------------------------
+1 -1
View File
@@ -22,7 +22,7 @@
//
//
// $Id: G4Ions.cc,v 1.9 2003/06/16 16:58:27 gunter Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
// GEANT4 tag $Name: geant4-07-01 $
//
//
// ----------------------------------------------------------------------
@@ -22,7 +22,7 @@
//
//
// $Id: G4IsotopeProperty.cc,v 1.4 2003/06/16 16:58:28 gunter Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
// GEANT4 tag $Name: geant4-07-01 $
//
//
// ----------------------------------------------------------------------
@@ -22,7 +22,7 @@
//
//
// $Id: G4KL3DecayChannel.cc,v 1.7 2004/12/10 18:02:04 gcosmo Exp $
// GEANT4 tag $Name: geant4-07-00-cand-05 $
// GEANT4 tag $Name: geant4-07-01 $
//
//
// ------------------------------------------------------------
@@ -1,183 +1,202 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: G4MuonDecayChannel.cc,v 1.11 2004/12/10 18:02:04 gcosmo Exp $
// GEANT4 tag $Name: geant4-07-00-cand-05 $
//
//
// ------------------------------------------------------------
// GEANT 4 class header file
//
// History: first implementation, based on object model of
// 30 May 1997 H.Kurashige
//
// Fix bug in calcuration of electron energy in DecayIt 28 Feb. 01 H.Kurashige
// ------------------------------------------------------------
#include "G4ParticleDefinition.hh"
#include "G4DecayProducts.hh"
#include "G4VDecayChannel.hh"
#include "G4MuonDecayChannel.hh"
#include "Randomize.hh"
#include "G4LorentzVector.hh"
#include "G4LorentzRotation.hh"
G4MuonDecayChannel::G4MuonDecayChannel(const G4String& theParentName,
G4double theBR)
:G4VDecayChannel("Muon Decay",1)
{
// set names for daughter particles
if (theParentName == "mu+") {
SetBR(theBR);
SetParent("mu+");
SetNumberOfDaughters(3);
SetDaughter(0, "e+");
SetDaughter(1, "nu_e");
SetDaughter(2, "anti_nu_mu");
} else if (theParentName == "mu-") {
SetBR(theBR);
SetParent("mu-");
SetNumberOfDaughters(3);
SetDaughter(0, "e-");
SetDaughter(1, "anti_nu_e");
SetDaughter(2, "nu_mu");
} else {
#ifdef G4VERBOSE
if (GetVerboseLevel()>0) {
G4cout << "G4MuonDecayChannel:: constructor :";
G4cout << " parent particle is not muon but ";
G4cout << theParentName << G4endl;
}
#endif
}
}
G4MuonDecayChannel::~G4MuonDecayChannel()
{
}
G4DecayProducts *G4MuonDecayChannel::DecayIt(G4double)
{
// this version neglects muon polarization
// assumes the pure V-A coupling
// gives incorrect energy spectrum for neutrinos
#ifdef G4VERBOSE
if (GetVerboseLevel()>1) G4cout << "G4MuonDecayChannel::DecayIt ";
#endif
if (parent == 0) FillParent();
if (daughters == 0) FillDaughters();
// parent mass
G4double parentmass = parent->GetPDGMass();
//daughters'mass
G4double daughtermass[3];
G4double sumofdaughtermass = 0.0;
for (G4int index=0; index<3; index++){
daughtermass[index] = daughters[index]->GetPDGMass();
sumofdaughtermass += daughtermass[index];
}
//create parent G4DynamicParticle at rest
G4ThreeVector dummy;
G4DynamicParticle * parentparticle = new G4DynamicParticle( parent, dummy, 0.0);
//create G4Decayproducts
G4DecayProducts *products = new G4DecayProducts(*parentparticle);
delete parentparticle;
// calculate daughter momentum
G4double daughtermomentum[3];
G4double energy;
// calcurate electron energy
G4double xmax = (1.0+daughtermass[0]*daughtermass[0]/parentmass/parentmass);
G4double x;
G4double r;
do {
do {
r = G4UniformRand();
x = xmax*G4UniformRand();
} while (r > (3.0 - 2.0*x)*x*x);
energy = x*parentmass/2.0 - daughtermass[0];
} while (energy <0.0);
//create daughter G4DynamicParticle
// daughter 0 (electron)
daughtermomentum[0] = std::sqrt(energy*energy + 2.0*energy* daughtermass[0]);
G4double costheta, sintheta, phi, sinphi, cosphi;
costheta = 2.*G4UniformRand()-1.0;
sintheta = std::sqrt((1.0-costheta)*(1.0+costheta));
phi = twopi*G4UniformRand()*rad;
sinphi = std::sin(phi);
cosphi = std::cos(phi);
G4ThreeVector direction0(sintheta*cosphi,sintheta*sinphi,costheta);
G4DynamicParticle * daughterparticle
= new G4DynamicParticle( daughters[0], direction0*daughtermomentum[0]);
products->PushProducts(daughterparticle);
// daughter 1 ,2 (nutrinos)
// create neutrinos in the C.M frame of two neutrinos
G4double energy2 = parentmass*(1.0 - x/2.0);
G4double vmass = std::sqrt((energy2-daughtermomentum[0])*(energy2+daughtermomentum[0]));
G4double beta = -1.0*daughtermomentum[0]/energy2;
G4double costhetan = 2.*G4UniformRand()-1.0;
G4double sinthetan = std::sqrt((1.0-costhetan)*(1.0+costhetan));
G4double phin = twopi*G4UniformRand()*rad;
G4double sinphin = std::sin(phin);
G4double cosphin = std::cos(phin);
G4ThreeVector direction1(sinthetan*cosphin,sinthetan*sinphin,costhetan);
G4DynamicParticle * daughterparticle1
= new G4DynamicParticle( daughters[1], direction1*(vmass/2.));
G4DynamicParticle * daughterparticle2
= new G4DynamicParticle( daughters[2], direction1*(-1.0*vmass/2.));
// boost to the muon rest frame
G4LorentzVector p4;
p4 = daughterparticle1->Get4Momentum();
p4.boost( direction0.x()*beta, direction0.y()*beta, direction0.z()*beta);
daughterparticle1->Set4Momentum(p4);
p4 = daughterparticle2->Get4Momentum();
p4.boost( direction0.x()*beta, direction0.y()*beta, direction0.z()*beta);
daughterparticle2->Set4Momentum(p4);
products->PushProducts(daughterparticle1);
products->PushProducts(daughterparticle2);
daughtermomentum[1] = daughterparticle1->GetTotalMomentum();
daughtermomentum[2] = daughterparticle2->GetTotalMomentum();
// output message
#ifdef G4VERBOSE
if (GetVerboseLevel()>1) {
G4cout << "G4MuonDecayChannel::DecayIt ";
G4cout << " create decay products in rest frame " <<G4endl;
products->DumpInfo();
}
#endif
return products;
}
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: G4MuonDecayChannel.cc,v 1.13 2005/06/23 11:02:26 gcosmo Exp $
// GEANT4 tag $Name: geant4-07-01 $
//
//
// ------------------------------------------------------------
// GEANT 4 class header file
//
// History: first implementation, based on object model of
// 30 May 1997 H.Kurashige
//
// Fix bug in calcuration of electron energy in DecayIt 28 Feb. 01 H.Kurashige
//2005
// M. Melissas ( melissas AT cppm.in2p3.fr)
// J. Brunner ( brunner AT cppm.in2p3.fr)
// Adding V-A fluxes for neutrinos using a new algortithm :
// ------------------------------------------------------------
#include "G4ParticleDefinition.hh"
#include "G4DecayProducts.hh"
#include "G4VDecayChannel.hh"
#include "G4MuonDecayChannel.hh"
#include "Randomize.hh"
#include "G4LorentzVector.hh"
#include "G4LorentzRotation.hh"
#include "G4RotationMatrix.hh"
G4MuonDecayChannel::G4MuonDecayChannel(const G4String& theParentName,
G4double theBR)
:G4VDecayChannel("Muon Decay",1)
{
// set names for daughter particles
if (theParentName == "mu+") {
SetBR(theBR);
SetParent("mu+");
SetNumberOfDaughters(3);
SetDaughter(0, "e+");
SetDaughter(1, "nu_e");
SetDaughter(2, "anti_nu_mu");
} else if (theParentName == "mu-") {
SetBR(theBR);
SetParent("mu-");
SetNumberOfDaughters(3);
SetDaughter(0, "e-");
SetDaughter(1, "anti_nu_e");
SetDaughter(2, "nu_mu");
} else {
#ifdef G4VERBOSE
if (GetVerboseLevel()>0) {
G4cout << "G4MuonDecayChannel:: constructor :";
G4cout << " parent particle is not muon but ";
G4cout << theParentName << G4endl;
}
#endif
}
}
G4MuonDecayChannel::~G4MuonDecayChannel()
{
}
G4DecayProducts *G4MuonDecayChannel::DecayIt(G4double)
{
// this version neglects muon polarization,and electron mass
// assumes the pure V-A coupling
// the Neutrinos are correctly V-A.
#ifdef G4VERBOSE
if (GetVerboseLevel()>1) G4cout << "G4MuonDecayChannel::DecayIt ";
#endif
if (parent == 0) FillParent();
if (daughters == 0) FillDaughters();
// parent mass
G4double parentmass = parent->GetPDGMass();
//daughters'mass
G4double daughtermass[3];
G4double sumofdaughtermass = 0.0;
for (G4int index=0; index<3; index++){
daughtermass[index] = daughters[index]->GetPDGMass();
sumofdaughtermass += daughtermass[index];
}
//create parent G4DynamicParticle at rest
G4ThreeVector dummy;
G4DynamicParticle * parentparticle = new G4DynamicParticle( parent, dummy, 0.0);
//create G4Decayproducts
G4DecayProducts *products = new G4DecayProducts(*parentparticle);
delete parentparticle;
// calculate daughter momentum
G4double daughtermomentum[3];
// calcurate electron energy
G4double xmax = (1.0+daughtermass[0]*daughtermass[0]/parentmass/parentmass);
G4double x;
G4double Ee,Ene;
G4double gam;
G4double EMax=parentmass/2-daughtermass[0];
//Generating Random Energy
do {
Ee=G4UniformRand();
do{
x=xmax*G4UniformRand();
gam=G4UniformRand();
}while (gam >x*(1.-x));
Ene=x;
} while ( Ene < (1.-Ee));
G4double Enm=(2.-Ee-Ene);
//initialisation of rotation parameters
G4double costheta,sintheta,rphi,rtheta,rpsi;
costheta= 1.-2./Ee-2./Ene+2./Ene/Ee;
sintheta=sqrt(1.-costheta*costheta);
rphi=twopi*G4UniformRand()*rad;
rtheta=(acos(2.*G4UniformRand()-1.));
rpsi=twopi*G4UniformRand()*rad;
G4RotationMatrix *rot= new G4RotationMatrix();
rot->set(rphi,rtheta,rpsi);
//electron 0
daughtermomentum[0]=sqrt(Ee*Ee*EMax*EMax+2.0*Ee*EMax * daughtermass[0]);
G4ThreeVector *direction0 =new G4ThreeVector(0.0,0.0,1.0);
*direction0 *= *rot;
G4DynamicParticle * daughterparticle = new G4DynamicParticle ( daughters[0], *direction0 * daughtermomentum[0]);
products->PushProducts(daughterparticle);
//electronic neutrino 1
daughtermomentum[1]=sqrt(Ene*Ene*EMax*EMax+2.0*Ene*EMax * daughtermass[1]);
G4ThreeVector *direction1 =new G4ThreeVector(sintheta,0.0,costheta);
*direction1 *= *rot;
G4DynamicParticle * daughterparticle1 = new G4DynamicParticle ( daughters[1], *direction1 * daughtermomentum[1]);
products->PushProducts(daughterparticle1);
//muonnic neutrino 2
daughtermomentum[2]=sqrt(Enm*Enm*EMax*EMax +2.0*Enm*EMax*daughtermass[2]);
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;
}
@@ -22,7 +22,7 @@
//
//
// $Id: G4NeutronBetaDecayChannel.cc,v 1.6 2004/12/10 18:02:04 gcosmo Exp $
// GEANT4 tag $Name: geant4-07-00-cand-05 $
// GEANT4 tag $Name: geant4-07-01 $
//
//
// ------------------------------------------------------------
@@ -22,7 +22,7 @@
//
//
// $Id: G4NucleiProperties.cc,v 1.11 2004/12/02 08:08:59 kurasige Exp $
// GEANT4 tag $Name: geant4-07-00-cand-03 $
// GEANT4 tag $Name: geant4-07-01 $
//
//
// ------------------------------------------------------------
@@ -22,7 +22,7 @@
//
//
// $Id: G4NucleiPropertiesTableA.cc,v 1.9 2004/12/02 08:08:59 kurasige Exp $
// GEANT4 tag $Name: geant4-07-00-cand-03 $
// GEANT4 tag $Name: geant4-07-01 $
//
// -------------------------------------------------------------------
// GEANT 4 class file --- Copyright CERN 1997
@@ -22,7 +22,7 @@
//
//
// $Id: G4NucleiPropertiesTableB.cc,v 1.8 2003/12/12 06:48:41 kurasige Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
// GEANT4 tag $Name: geant4-07-01 $
//
// -------------------------------------------------------------------
// GEANT 4 class implementation file
@@ -22,7 +22,7 @@
//
//
// $Id: G4NucleiPropertiesTheoreticalTableA.cc,v 1.7 2004/12/02 08:08:59 kurasige Exp $
// GEANT4 tag $Name: geant4-07-00-cand-03 $
// GEANT4 tag $Name: geant4-07-01 $
//
//
// ------------------------------------------------------------
@@ -22,7 +22,7 @@
//
//
// $Id: G4PDGCodeChecker.cc,v 1.7 2004/12/07 09:05:51 gcosmo Exp $
// GEANT4 tag $Name: geant4-07-00-cand-03 $
// GEANT4 tag $Name: geant4-07-01 $
//
//
// ----------------------------------------------------------------------
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4ParticleDefinition.cc,v 1.22 2004/12/02 08:09:00 kurasige Exp $
// GEANT4 tag $Name: geant4-07-00-cand-03 $
// $Id: G4ParticleDefinition.cc,v 1.24 2005/04/17 04:59:41 kurasige Exp $
// GEANT4 tag $Name: geant4-07-01 $
//
//
// --------------------------------------------------------------
@@ -71,7 +71,10 @@ G4ParticleDefinition::G4ParticleDefinition(
G4bool stable,
G4double lifetime,
G4DecayTable *decaytable,
G4bool shortlived)
G4bool shortlived,
const G4String& subType,
G4int anti_encoding)
: theParticleName(aName),
thePDGMass(mass),
thePDGWidth(width),
@@ -88,7 +91,7 @@ G4ParticleDefinition::G4ParticleDefinition(
theLeptonNumber(lepton),
theBaryonNumber(baryon),
theParticleType(pType),
theParticleSubType(""),
theParticleSubType(subType),
thePDGEncoding(encoding),
theAntiPDGEncoding(-1*encoding),
fShortLivedFlag(shortlived),
@@ -96,6 +99,8 @@ G4ParticleDefinition::G4ParticleDefinition(
thePDGLifeTime(lifetime),
theDecayTable(decaytable),
theProcessManager(0),
theAtomicNumber(0),
theAtomicMass(0),
verboseLevel(1),
fApplyCutsFlag(false)
{
@@ -103,13 +108,13 @@ G4ParticleDefinition::G4ParticleDefinition(
theParticleTable = G4ParticleTable::GetParticleTable();
theParticleTable->Insert(this);
if (anti_encoding !=0) theAntiPDGEncoding = anti_encoding;
// check quark contents
#ifdef G4VERBOSE
if (this->FillQuarkContents() != thePDGEncoding) {
if (verboseLevel>0) {
// cerr bnot G4cerr is used intentionally
// because G4ParticleDefinition constructor may be called
// before G4cerr object is instantiated !!
// Using G4cerr expecting that it is available in construction of static objects
G4cerr << "Particle " << aName << " has a strange PDGEncoding " <<G4endl;
}
}
@@ -22,7 +22,7 @@
//
//
// $Id: G4ParticleMessenger.cc,v 1.7 2003/06/16 16:58:32 gunter Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
// GEANT4 tag $Name: geant4-07-01 $
//
//
//---------------------------------------------------------------
@@ -22,7 +22,7 @@
//
//
// $Id: G4ParticlePropertyMessenger.cc,v 1.6 2003/06/16 16:58:33 gunter Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
// GEANT4 tag $Name: geant4-07-01 $
//
//
//---------------------------------------------------------------
@@ -22,7 +22,7 @@
//
//
// $Id: G4ParticleTable.cc,v 1.22 2004/12/08 00:07:24 asaim Exp $
// GEANT4 tag $Name: geant4-07-00-cand-03 $
// GEANT4 tag $Name: geant4-07-01 $
//
// class G4ParticleTable
//
@@ -22,7 +22,7 @@
//
//
// $Id: G4PhaseSpaceDecayChannel.cc,v 1.9 2004/12/10 18:02:04 gcosmo Exp $
// GEANT4 tag $Name: geant4-07-00-cand-05 $
// GEANT4 tag $Name: geant4-07-01 $
//
//
// ------------------------------------------------------------
@@ -0,0 +1,165 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: G4PrimaryParticle.cc,v 1.1 2005/03/25 00:40:32 asaim Exp $
// GEANT4 tag $Name: geant4-07-01 $
//
#include "G4PrimaryParticle.hh"
#include "G4ParticleDefinition.hh"
#include "G4ParticleTable.hh"
#include "G4ios.hh"
#include "G4VUserPrimaryParticleInformation.hh"
G4Allocator<G4PrimaryParticle> aPrimaryParticleAllocator;
G4PrimaryParticle::G4PrimaryParticle()
:PDGcode(0),G4code(0),Px(0.),Py(0.),Pz(0.),
nextParticle(0),daughterParticle(0),trackID(-1),
mass(-1.),charge(DBL_MAX),polX(0.),polY(0.),polZ(0.),
Weight0(1.0),properTime(0.0),userInfo(0)
{;}
G4PrimaryParticle::G4PrimaryParticle(G4int Pcode)
:PDGcode(Pcode),Px(0.),Py(0.),Pz(0.),
nextParticle(0),daughterParticle(0),trackID(-1),
mass(-1.),charge(DBL_MAX),polX(0.),polY(0.),polZ(0.),
Weight0(1.0),properTime(0.0),userInfo(0)
{ G4code = G4ParticleTable::GetParticleTable()->FindParticle(Pcode); }
G4PrimaryParticle::G4PrimaryParticle(G4int Pcode,
G4double px,G4double py,G4double pz)
:PDGcode(Pcode),Px(px),Py(py),Pz(pz),
nextParticle(0),daughterParticle(0),trackID(-1),
mass(-1.),charge(DBL_MAX),polX(0.),polY(0.),polZ(0.),
Weight0(1.0),properTime(0.0),userInfo(0)
{ G4code = G4ParticleTable::GetParticleTable()->FindParticle(Pcode); }
G4PrimaryParticle::G4PrimaryParticle(G4int Pcode,
G4double px,G4double py,G4double pz,G4double E)
:PDGcode(Pcode),Px(px),Py(py),Pz(pz),
nextParticle(0),daughterParticle(0),trackID(-1),
charge(DBL_MAX),polX(0.),polY(0.),polZ(0.),
Weight0(1.0),properTime(0.0),userInfo(0)
{
G4code = G4ParticleTable::GetParticleTable()->FindParticle(Pcode);
G4double mas2 = E*E - px*px - py*py - pz*pz;
if(mas2>=0.)
{ mass = std::sqrt(mas2); }
else
{ mass = -1.0; }
}
G4PrimaryParticle::G4PrimaryParticle(G4ParticleDefinition* Gcode)
:G4code(Gcode),Px(0.),Py(0.),Pz(0.),
nextParticle(0),daughterParticle(0),trackID(-1),
mass(-1.),charge(DBL_MAX),polX(0.),polY(0.),polZ(0.),
Weight0(1.0),properTime(0.0),userInfo(0)
{ PDGcode = Gcode->GetPDGEncoding(); }
G4PrimaryParticle::G4PrimaryParticle(G4ParticleDefinition* Gcode,
G4double px,G4double py,G4double pz)
:G4code(Gcode),Px(px),Py(py),Pz(pz),
nextParticle(0),daughterParticle(0),trackID(-1),
mass(-1.),charge(DBL_MAX),polX(0.),polY(0.),polZ(0.),
Weight0(1.0),properTime(0.0),userInfo(0)
{ PDGcode = Gcode->GetPDGEncoding(); }
G4PrimaryParticle::G4PrimaryParticle(G4ParticleDefinition* Gcode,
G4double px,G4double py,G4double pz,G4double E)
:G4code(Gcode),Px(px),Py(py),Pz(pz),
nextParticle(0),daughterParticle(0),trackID(-1),
charge(DBL_MAX),polX(0.),polY(0.),polZ(0.),
Weight0(1.0),properTime(0.0),userInfo(0)
{
PDGcode = Gcode->GetPDGEncoding();
G4double mas2 = E*E - px*px - py*py - pz*pz;
if(mas2>=0.)
{ mass = std::sqrt(mas2); }
else
{ mass = -1.0; }
}
G4PrimaryParticle::~G4PrimaryParticle()
{
if(nextParticle != 0)
{ delete nextParticle; }
if(daughterParticle != 0)
{ delete daughterParticle; }
if(userInfo!=0)
{ delete userInfo; }
}
void G4PrimaryParticle::SetPDGcode(G4int Pcode)
{
PDGcode = Pcode;
G4code = G4ParticleTable::GetParticleTable()->FindParticle(Pcode);
}
void G4PrimaryParticle::SetG4code(G4ParticleDefinition* Gcode)
{
G4code = Gcode;
PDGcode = Gcode->GetPDGEncoding();
}
const G4PrimaryParticle &
G4PrimaryParticle::operator=(const G4PrimaryParticle &)
{ return *this; }
G4int G4PrimaryParticle::operator==(const G4PrimaryParticle &right) const
{ return (this==&right); }
G4int G4PrimaryParticle::operator!=(const G4PrimaryParticle &right) const
{ return (this!=&right); }
void G4PrimaryParticle::Print() const
{
G4cout << "==== PDGcode " << PDGcode << " Particle name ";
if(G4code != 0)
{ G4cout << G4code->GetParticleName() << G4endl; }
else
{ G4cout << " is not defined in G4." << G4endl; }
if(charge<DBL_MAX)
{ G4cout << " Assigned charge : " << charge << G4endl; }
else
{ G4cout << " Charge will be taken from PDG charge." << G4endl; }
G4cout << " Momentum ( " << Px << ", " << Py << ", " << Pz << " )" << G4endl;
if(mass>=0.)
{ G4cout << " Mass in MeV : " << mass/MeV << G4endl; }
else
{ G4cout << " Nominal mass will be taken from particle definition." << G4endl; }
G4cout << " Polarization ( " << polX << ", " << polY << ", "
<< polZ << " )" << G4endl;
G4cout << " Weight : " << Weight0 << G4endl;
if(properTime>0.0)
{ G4cout << " PreAssigned proper decay time : " << properTime/ns << " (nsec)" << G4endl; }
if(userInfo != 0) userInfo->Print();
if(daughterParticle != 0)
{
G4cout << ">>>> Daughters" << G4endl;
daughterParticle->Print();
}
if(nextParticle != 0)
{ nextParticle->Print(); }
else
{ G4cout << "<<<< End of link" << G4endl; }
}
@@ -0,0 +1,85 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: G4PrimaryVertex.cc,v 1.1 2005/03/25 00:40:32 asaim Exp $
// GEANT4 tag $Name: geant4-07-01 $
//
#include "G4PrimaryVertex.hh"
#include "G4VUserPrimaryVertexInformation.hh"
#include "G4ios.hh"
G4Allocator<G4PrimaryVertex> aPrimaryVertexAllocator;
G4PrimaryVertex::G4PrimaryVertex()
:X0(0.),Y0(0.),Z0(0.),T0(0.),theParticle(0),theTail(0),
nextVertex(0),numberOfParticle(0),Weight0(1.0),userInfo(0)
{;}
G4PrimaryVertex::G4PrimaryVertex(
G4double x0,G4double y0,G4double z0,G4double t0)
:X0(x0),Y0(y0),Z0(z0),T0(t0),theParticle(0),theTail(0),
nextVertex(0),numberOfParticle(0),Weight0(1.0),userInfo(0)
{;}
G4PrimaryVertex::G4PrimaryVertex(G4ThreeVector xyz0,G4double t0)
:T0(t0),theParticle(0),theTail(0),
nextVertex(0),numberOfParticle(0),Weight0(1.0),userInfo(0)
{
X0=xyz0.x();
Y0=xyz0.y();
Z0=xyz0.z();
}
G4PrimaryVertex::~G4PrimaryVertex()
{
if(theParticle != 0)
{ delete theParticle; }
if(nextVertex != 0)
{ delete nextVertex; }
if(userInfo != 0)
{ delete userInfo; }
}
const G4PrimaryVertex &
G4PrimaryVertex::operator=(const G4PrimaryVertex &)
{ return *this; }
G4int G4PrimaryVertex::operator==(const G4PrimaryVertex &right) const
{ return (this==&right); }
G4int G4PrimaryVertex::operator!=(const G4PrimaryVertex &right) const
{ return (this!=&right); }
void G4PrimaryVertex::Print() const
{
G4cout << "Vertex ( "
<< X0 << ", " << Y0 << ", " << Z0 << ", " << T0 << " )"
<< " Weight " << Weight0 << G4endl;
if(userInfo!=0) userInfo->Print();
G4cout << "#### Primary particles" << G4endl;
G4PrimaryParticle* aPrim = theParticle;
if(aPrim != 0)
{
aPrim->Print();
aPrim = aPrim->GetNext();
}
}
@@ -22,7 +22,7 @@
//
//
// $Id: G4ShortLivedTable.cc,v 1.11 2003/06/16 16:58:43 gunter Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
// GEANT4 tag $Name: geant4-07-01 $
//
//
// --------------------------------------------------------------
@@ -22,7 +22,7 @@
//
//
// $Id: G4TauLeptonicDecayChannel.cc,v 1.4 2004/12/10 18:02:04 gcosmo Exp $
// GEANT4 tag $Name: geant4-07-00-cand-05 $
// GEANT4 tag $Name: geant4-07-01 $
//
//
// ------------------------------------------------------------
@@ -22,7 +22,7 @@
//
//
// $Id: G4VDecayChannel.cc,v 1.16 2004/12/02 08:09:00 kurasige Exp $
// GEANT4 tag $Name: geant4-07-00-cand-03 $
// GEANT4 tag $Name: geant4-07-01 $
//
//
// ------------------------------------------------------------
@@ -0,0 +1,30 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: G4VUserPrimaryParticleInformation.cc,v 1.1 2005/03/25 00:40:32 asaim Exp $
// GEANT4 tag $Name: geant4-07-01 $
//
#include "G4VUserPrimaryParticleInformation.hh"
G4VUserPrimaryParticleInformation::G4VUserPrimaryParticleInformation() {;}
G4VUserPrimaryParticleInformation::~G4VUserPrimaryParticleInformation() {;}
@@ -0,0 +1,33 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: G4VUserPrimaryVertexInformation.cc,v 1.1 2005/03/25 00:40:32 asaim Exp $
// GEANT4 tag $Name: geant4-07-01 $
//
//
//---------------------------------------------------------------
#include "G4VUserPrimaryVertexInformation.hh"
G4VUserPrimaryVertexInformation::G4VUserPrimaryVertexInformation() {;}
G4VUserPrimaryVertexInformation::~G4VUserPrimaryVertexInformation() {;}