Import Geant4 3.1.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-08 16:03:00 +02:00
parent cfcb558cfe
commit 137e303ecc
2843 changed files with 37082 additions and 38426 deletions
+1 -1
View File
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4EvManMessenger.cc,v 1.2 1999/12/15 14:49:40 gunter Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
// --------------------------------------------------------------------
+1 -1
View File
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4Event.cc,v 1.2 1999/12/15 14:49:40 gunter Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
// G4Event
+10 -4
View File
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4EventManager.cc,v 1.5 2000/01/26 06:42:15 asaim Exp $
// GEANT4 tag $Name: geant4-03-00 $
// $Id: G4EventManager.cc,v 1.6 2001/02/08 06:07:16 asaim Exp $
// GEANT4 tag $Name: geant4-03-01 $
//
//
//
@@ -184,7 +184,13 @@ void G4EventManager::ProcessOneEvent(G4Event* anEvent)
G4cout << "Illeagal TrackStatus returned from G4TrackingManager!"
<< G4endl;
case fKillTrackAndSecondaries:
if( secondaries ) secondaries->clearAndDestroy();
//if( secondaries ) secondaries->clearAndDestroy();
if( secondaries )
{
for(G4int i=0;i<secondaries->size();i++)
{ delete (*secondaries)[i]; }
secondaries->clear();
}
delete track;
break;
}
@@ -217,7 +223,7 @@ void G4EventManager::StackTracks(G4TrackVector *trackVector)
if( trackVector )
{
size_t n_passedTrack = trackVector->entries();
size_t n_passedTrack = trackVector->size();
if( n_passedTrack == 0 ) return;
for( size_t i = 0; i < n_passedTrack; i++ )
{
+16 -4
View File
@@ -21,6 +21,17 @@
// CHANGE HISTORY
// --------------
//
// 26-01-2001, F. Lei
// replace:
// posphi = acos(tx/sin(posthe));
//
// with:
// if (posthe != 0. && posthe != pi)
// { posphi = acos(tx/sin(posthe)); }
// else
// { posphi = 0.0;}
// endif
//
// 10-Nov-2000, F. Lei
// some bug fixing:
// i) dclared ' G4int count' in all ****Interpolation functions
@@ -28,7 +39,7 @@
// as default.
//
// 09-Nov-2000, F Lei
// Changed to a fast mplementation for generating iso and cos angular directions
// Changed to a fast implementation for generating iso and cos angular directions
//
// Version 1.1, 18 October 2000, Modified to inherit from G4VPrimaryGenerator.
// New name at the request of M. Asai.
@@ -261,7 +272,6 @@ void G4GeneralParticleSource::ConfineSourceToVolume(G4String Vname)
found = tempPV->GetName() == theRequiredVolumeName;
if(verbosityLevel == 2)
G4cout << i << " " << " " << tempPV->GetName() << " " << theRequiredVolumeName << " " << found << G4endl;
if (!found)
{i++;}
}
@@ -298,7 +308,6 @@ void G4GeneralParticleSource::GeneratePointsInPlane()
G4double expression;
G4ThreeVector RandPos;
G4double tempx, tempy, tempz;
z = 0.;
if(SourcePosType != "Plane" && verbosityLevel >= 1)
@@ -1112,7 +1121,10 @@ void G4GeneralParticleSource::GenerateIsotropicFlux()
tz = tz/tt;
// G4cout << "unit position " << tx << " " << ty << " " << tz << G4endl;
posthe = acos(tz);
posphi = acos(tx/sin(posthe));
if (posthe != 0. && posthe != pi)
{ posphi = acos(tx/sin(posthe)); }
else
{ posphi = 0.0;}
// G4cout << "Posthe and posphi " << posthe << " " << posphi << G4endl;
G4double finx, finy, finz;
finx = (px*cos(posthe)*cos(posphi)) - (py*sin(posphi)) + (pz*sin(posthe)*cos(posphi));
+19 -16
View File
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4HEPEvtInterface.cc,v 1.3 1999/12/15 14:49:40 gunter Exp $
// GEANT4 tag $Name: geant4-03-00 $
// $Id: G4HEPEvtInterface.cc,v 1.4 2001/02/08 06:07:17 asaim Exp $
// GEANT4 tag $Name: geant4-03-01 $
//
//
// --------------------------------------------------------------------
@@ -75,28 +75,28 @@ void G4HEPEvtInterface::GeneratePrimaryVertex(G4Event* evt)
= new G4HEPEvtParticle( particle, ISTHEP, JDAHEP1, JDAHEP2 );
// Store
HPlist.insert( hepParticle );
HPlist.push_back( hepParticle );
}
// check if there is at least one particle
if( HPlist.entries() == 0 ) return;
if( HPlist.size() == 0 ) return;
// make connection between daughter particles decayed from
// the same mother
for( int i=0; i<HPlist.entries(); i++ )
for( int i=0; i<HPlist.size(); i++ )
{
if( HPlist(i)->GetJDAHEP1() > 0 ) // it has daughters
if( HPlist[i]->GetJDAHEP1() > 0 ) // it has daughters
{
int jda1 = HPlist(i)->GetJDAHEP1()-1; // FORTRAN index starts from 1
int jda2 = HPlist(i)->GetJDAHEP2()-1; // but C++ starts from 0.
G4PrimaryParticle* mother = HPlist(i)->GetTheParticle();
int jda1 = HPlist[i]->GetJDAHEP1()-1; // FORTRAN index starts from 1
int jda2 = HPlist[i]->GetJDAHEP2()-1; // but C++ starts from 0.
G4PrimaryParticle* mother = HPlist[i]->GetTheParticle();
for( int j=jda1; j<=jda2; j++ )
{
G4PrimaryParticle* daughter = HPlist(j)->GetTheParticle();
if(HPlist(j)->GetISTHEP()>0)
G4PrimaryParticle* daughter = HPlist[j]->GetTheParticle();
if(HPlist[j]->GetISTHEP()>0)
{
mother->SetDaughter( daughter );
HPlist(j)->Done();
HPlist[j]->Done();
}
}
}
@@ -110,18 +110,21 @@ void G4HEPEvtInterface::GeneratePrimaryVertex(G4Event* evt)
G4PrimaryVertex* vertex = new G4PrimaryVertex(x0,y0,z0,t0);
// put initial particles to the vertex
for( int ii=0; ii<HPlist.entries(); ii++ )
for( int ii=0; ii<HPlist.size(); ii++ )
{
if( HPlist(ii)->GetISTHEP() > 0 ) // ISTHEP of daughters had been
if( HPlist[ii]->GetISTHEP() > 0 ) // ISTHEP of daughters had been
// set to negative
{
G4PrimaryParticle* initialParticle = HPlist(ii)->GetTheParticle();
G4PrimaryParticle* initialParticle = HPlist[ii]->GetTheParticle();
vertex->SetPrimary( initialParticle );
}
}
// clear G4HEPEvtParticles
HPlist.clearAndDestroy();
//HPlist.clearAndDestroy();
for(G4int iii=0;iii<HPlist.size();iii++)
{ delete HPlist[iii]; }
HPlist.clear();
// Put the vertex to G4Event object
evt->AddPrimaryVertex( vertex );
+1 -1
View File
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4HEPEvtParticle.cc,v 1.2 1999/12/15 14:49:40 gunter Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
//
+1 -1
View File
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4ParticleGun.cc,v 1.3 2000/10/18 12:41:25 kurasige Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
// G4ParticleGun
+1 -1
View File
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4ParticleGunMessenger.cc,v 1.4 2000/10/19 13:29:38 kurasige Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
#include "G4ParticleGunMessenger.hh"
+9 -7
View File
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4PrimaryParticle.cc,v 1.3 2000/10/19 15:19:37 asaim Exp $
// GEANT4 tag $Name: geant4-03-00 $
// $Id: G4PrimaryParticle.cc,v 1.5 2001/02/08 06:07:17 asaim Exp $
// GEANT4 tag $Name: geant4-03-01 $
//
#include "G4PrimaryParticle.hh"
@@ -19,33 +19,33 @@ G4Allocator<G4PrimaryParticle> aPrimaryParticleAllocator;
G4PrimaryParticle::G4PrimaryParticle()
:PDGcode(0),G4code(NULL),Px(0.),Py(0.),Pz(0.),
nextParticle(NULL),daughterParticle(NULL),trackID(-1),
mass(0.),polX(0.),polY(0.),polZ(0.),Weight0(1.0)
mass(0.),polX(0.),polY(0.),polZ(0.),Weight0(1.0),properTime(0.0)
{;}
G4PrimaryParticle::G4PrimaryParticle(G4int Pcode)
:PDGcode(Pcode),Px(0.),Py(0.),Pz(0.),
nextParticle(NULL),daughterParticle(NULL),trackID(-1),
mass(0.),polX(0.),polY(0.),polZ(0.),Weight0(1.0)
mass(0.),polX(0.),polY(0.),polZ(0.),Weight0(1.0),properTime(0.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(NULL),daughterParticle(NULL),trackID(-1),
mass(0.),polX(0.),polY(0.),polZ(0.),Weight0(1.0)
mass(0.),polX(0.),polY(0.),polZ(0.),Weight0(1.0),properTime(0.0)
{ G4code = G4ParticleTable::GetParticleTable()->FindParticle(Pcode); }
G4PrimaryParticle::G4PrimaryParticle(G4ParticleDefinition* Gcode)
:G4code(Gcode),Px(0.),Py(0.),Pz(0.),
nextParticle(NULL),daughterParticle(NULL),trackID(-1),
mass(0.),polX(0.),polY(0.),polZ(0.),Weight0(1.0)
mass(0.),polX(0.),polY(0.),polZ(0.),Weight0(1.0),properTime(0.0)
{ PDGcode = Gcode->GetPDGEncoding(); }
G4PrimaryParticle::G4PrimaryParticle(G4ParticleDefinition* Gcode,
G4double px,G4double py,G4double pz)
:G4code(Gcode),Px(px),Py(py),Pz(pz),
nextParticle(NULL),daughterParticle(NULL),trackID(-1),
mass(0.),polX(0.),polY(0.),polZ(0.),Weight0(1.0)
mass(0.),polX(0.),polY(0.),polZ(0.),Weight0(1.0),properTime(0.0)
{ PDGcode = Gcode->GetPDGEncoding(); }
G4PrimaryParticle::~G4PrimaryParticle()
@@ -87,6 +87,8 @@ void G4PrimaryParticle::Print() const
G4cout << " Polarization ( " << polX << ", " << polY << ", "
<< polZ << " )" << G4endl;
G4cout << " Weight : " << Weight0 << G4endl;
if(properTime>0.0)
{ G4cout << " PreAssigned proper decay time : " << properTime/ns << " (nsec)" << G4endl; }
if(daughterParticle != NULL)
{
G4cout << ">>>> Daughters" << G4endl;
+9 -4
View File
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4PrimaryTransformer.cc,v 1.5 2000/10/19 15:19:37 asaim Exp $
// GEANT4 tag $Name: geant4-03-00 $
// $Id: G4PrimaryTransformer.cc,v 1.8 2001/02/09 00:11:31 asaim Exp $
// GEANT4 tag $Name: geant4-03-01 $
//
#include "G4PrimaryTransformer.hh"
@@ -30,7 +30,10 @@ G4PrimaryTransformer::~G4PrimaryTransformer()
G4TrackVector* G4PrimaryTransformer::GimmePrimaries(G4Event* anEvent)
{
TV.clearAndDestroy();
//TV.clearAndDestroy();
for( int ii=0; ii<TV.size();ii++)
{ delete TV[ii]; }
TV.clear();
G4int n_vertex = anEvent->GetNumberOfPrimaryVertex();
if(n_vertex==0) return NULL;
for( int i=0; i<n_vertex; i++ )
@@ -105,6 +108,8 @@ void G4PrimaryTransformer::GenerateSingleTrack
DP->SetPolarization(primaryParticle->GetPolX(),
primaryParticle->GetPolY(),
primaryParticle->GetPolZ());
if(primaryParticle->GetProperTime()>0.0)
{ DP->SetPreAssignedDecayProperTime(primaryParticle->GetProperTime()); }
// Set Charge
if (abs(primaryParticle->GetCharge()-DP->GetCharge())>eplus) {
DP->SetCharge(primaryParticle->GetCharge());
@@ -118,7 +123,7 @@ void G4PrimaryTransformer::GenerateSingleTrack
// Set weight ( vertex weight * particle weight )
track->SetWeight(wv*(primaryParticle->GetWeight()));
// Store it to G4TrackVector
TV.insert( track );
TV.push_back( track );
}
}
+1 -1
View File
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4PrimaryVertex.cc,v 1.3 2000/10/19 15:19:37 asaim Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
#include "G4PrimaryVertex.hh"
+1 -1
View File
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4StackManager.cc,v 1.3 2000/01/26 06:42:16 asaim Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
//
// Last Modification : 09/Dec/96 M.Asai
+1 -1
View File
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4StackedTrack.cc,v 1.3 2000/01/26 06:42:16 asaim Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
//
// Last Modification : 02/Feb/96 M.Asai
+1 -1
View File
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4StackingMessenger.cc,v 1.2 1999/12/15 14:49:41 gunter Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
// --------------------------------------------------------------------
+1 -1
View File
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4TrackStack.cc,v 1.2 1999/12/15 14:49:41 gunter Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
//
// Last Modification : 09/Dec/96 M.Asai
+1 -1
View File
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4UserEventAction.cc,v 1.3 1999/12/15 14:49:41 gunter Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
#include "G4UserEventAction.hh"
+1 -1
View File
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4UserStackingAction.cc,v 1.3 1999/12/15 14:49:42 gunter Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
#include "G4UserStackingAction.hh"
+1 -1
View File
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4VPrimaryGenerator.cc,v 1.2 1999/12/15 14:49:42 gunter Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
// G4VPrimaryGenerator