Import Geant4 3.2.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-08 16:10:37 +02:00
parent 137e303ecc
commit 36c080dca6
3464 changed files with 119310 additions and 52696 deletions
+36 -20
View File
@@ -1,12 +1,28 @@
// 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.
// ********************************************************************
// * 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: G4PEvent.cc,v 1.11 1999/12/15 14:51:20 gunter Exp $
// GEANT4 tag $Name: geant4-03-01 $
//
// $Id: G4PEvent.cc,v 1.12.2.1 2001/06/28 19:11:26 gunter Exp $
// GEANT4 tag $Name: $
//
// G4PEvent
@@ -17,21 +33,21 @@
G4PEvent::G4PEvent()
:eventID(0),
thePrimaryVertex(NULL),numberOfPrimaryVertex(0),HC(NULL),DC(NULL)
thePrimaryVertex(0),numberOfPrimaryVertex(0),HC(0),DC(0)
{;}
G4PEvent::G4PEvent(const G4Event *evt)
:eventID(0),
thePrimaryVertex(NULL),numberOfPrimaryVertex(0),HC(NULL),DC(NULL)
thePrimaryVertex(0),numberOfPrimaryVertex(0),HC(0),DC(0)
{
InitPEvent(evt, NULL, NULL);
InitPEvent(evt, 0, 0);
}
G4PEvent::G4PEvent(const G4Event *evt,
HepRef(G4PHCofThisEvent) pHC,
HepRef(G4PDCofThisEvent) pDC)
:eventID(0),
thePrimaryVertex(NULL),numberOfPrimaryVertex(0),HC(NULL),DC(NULL)
thePrimaryVertex(0),numberOfPrimaryVertex(0),HC(0),DC(0)
{
InitPEvent(evt, pHC, pDC);
}
@@ -46,9 +62,9 @@ void G4PEvent::InitPEvent(const G4Event *evt,
if(PV) thePrimaryVertex = new(ooThis()) G4PPrimaryVertex(PV);
numberOfPrimaryVertex = evt->GetNumberOfPrimaryVertex();
if(pHC!=NULL) HC = pHC;
if(pHC!=0) HC = pHC;
if(pDC!=NULL) DC = pDC;
if(pDC!=0) DC = pDC;
// const G4TrajectoryContainer* TC = evt->GetTrajectoryContainer();
// if(TC) trajectoryContainer = new G4PTrajectoryContainer(TC);
@@ -57,19 +73,19 @@ void G4PEvent::InitPEvent(const G4Event *evt,
G4PEvent::~G4PEvent()
{
if(thePrimaryVertex != NULL)
if(thePrimaryVertex != 0)
{
G4PPrimaryVertex* aPPV = (HepRef(G4PPrimaryVertex)) thePrimaryVertex;
HepDelete(aPPV);
}
if(HC != NULL)
if(HC != 0)
{
G4PHCofThisEvent* aHC = (HepRef(G4PHCofThisEvent)) HC;
HepDelete(aHC);
}
if(DC != NULL)
if(DC != 0)
{
G4PDCofThisEvent* aDC = (HepRef(G4PDCofThisEvent)) DC;
HepDelete(aDC);
@@ -83,12 +99,12 @@ G4Event* G4PEvent::MakeTransientObject()
{
G4Event* anEvt = new G4Event(eventID);
if(thePrimaryVertex != NULL)
if(thePrimaryVertex != 0)
{
G4PrimaryVertex* aPV = thePrimaryVertex->MakeTransientObject();
for( G4int i = 0; i<numberOfPrimaryVertex; i++ )
{
if( aPV != NULL )
if( aPV != 0 )
{
anEvt->AddPrimaryVertex(aPV);
aPV = aPV->GetNext();
@@ -100,9 +116,9 @@ G4Event* G4PEvent::MakeTransientObject()
// to transient G4Event ... this requires an introduction of
// G4VHCofThisEvent and G4VDCofThisEvent in G4Event
// (will be implemented in next release)
// if(HC != NULL)
// if(HC != 0)
// anEvt->SetHCofThisEvent( HC );
// if(DC != NULL)
// if(DC != 0)
// anEvt->SetDCofThisEvent( DC );
return anEvt;
@@ -1,12 +1,28 @@
// 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.
// ********************************************************************
// * 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: G4PPrimaryParticle.cc,v 1.1 1999/12/05 22:32:26 morita Exp $
// GEANT4 tag $Name: geant4-03-01 $
//
// $Id: G4PPrimaryParticle.cc,v 1.2.2.1 2001/06/28 19:11:26 gunter Exp $
// GEANT4 tag $Name: $
//
#include "G4PPrimaryParticle.hh"
@@ -18,7 +34,7 @@ G4PPrimaryParticle::G4PPrimaryParticle(G4PrimaryParticle* aParticle)
PDGcode = aParticle->GetPDGcode();
G4ParticleDefinition* ag4code = aParticle->GetG4code();
// if( ag4code != NULL )
// if( ag4code != 0 )
// { ...will look up G4PParticleDefinition and set the G4code...; }
Px = aParticle->GetPx();
@@ -26,11 +42,11 @@ G4PPrimaryParticle::G4PPrimaryParticle(G4PrimaryParticle* aParticle)
Pz = aParticle->GetPz();
G4PrimaryParticle* aNext = aParticle->GetNext();
if( aNext != NULL )
if( aNext != 0 )
{ nextParticle = new(ooThis()) G4PPrimaryParticle( aNext ); }
G4PrimaryParticle* aDaughter = aParticle->GetDaughter();
if( aDaughter != NULL )
if( aDaughter != 0 )
{ daughterParticle = new(ooThis()) G4PPrimaryParticle( aDaughter ); }
trackID = aParticle->GetTrackID();
@@ -42,9 +58,9 @@ G4PPrimaryParticle::G4PPrimaryParticle(G4PrimaryParticle* aParticle)
G4PPrimaryParticle::~G4PPrimaryParticle()
{
if(nextParticle != NULL)
if(nextParticle != 0)
{ HepDelete(nextParticle); }
if(daughterParticle != NULL)
if(daughterParticle != 0)
{ HepDelete(daughterParticle); }
}
@@ -54,9 +70,9 @@ G4PrimaryParticle* G4PPrimaryParticle::MakeTransientObject()
// aParticle->SetG4Code(...will lookup G4ParticleDefinition and set it...;)
if(nextParticle != NULL)
if(nextParticle != 0)
{ aParticle->SetNext( nextParticle->MakeTransientObject() ); }
if(daughterParticle != NULL)
if(daughterParticle != 0)
{ aParticle->SetDaughter( daughterParticle->MakeTransientObject() ); }
aParticle->SetTrackID( trackID );
@@ -1,12 +1,28 @@
// 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.
// ********************************************************************
// * 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: G4PPrimaryVertex.cc,v 1.7 1999/12/15 14:51:21 gunter Exp $
// GEANT4 tag $Name: geant4-03-01 $
//
// $Id: G4PPrimaryVertex.cc,v 1.8.2.1 2001/06/28 19:11:26 gunter Exp $
// GEANT4 tag $Name: $
//
#include "G4PPrimaryVertex.hh"
@@ -17,8 +33,8 @@
#include "G4PPrimaryParticle.hh"
G4PPrimaryVertex::G4PPrimaryVertex()
:X0(0.),Y0(0.),Z0(0.),T0(0.),numberOfParticle(0),nextVertex(NULL)
// ,theParticle(NULL)
:X0(0.),Y0(0.),Z0(0.),T0(0.),numberOfParticle(0),nextVertex(0)
// ,theParticle(0)
{;}
G4PPrimaryVertex::G4PPrimaryVertex(const G4PrimaryVertex* vertex)
@@ -35,7 +51,7 @@ G4PPrimaryVertex::G4PPrimaryVertex(const G4PrimaryVertex* vertex)
HepRef(G4PPrimaryParticle) particle = theParticle;
for (G4int i=0; i<numberOfParticle; i++)
{
assert( particle != NULL );
assert( particle != 0 );
particle = particle->GetNext();
}
theTail = particle;
@@ -44,26 +60,26 @@ G4PPrimaryVertex::G4PPrimaryVertex(const G4PrimaryVertex* vertex)
if(nextVX)
{ nextVertex = new(ooThis()) G4PPrimaryVertex(nextVX); }
else
{ nextVertex = NULL; }
{ nextVertex = 0; }
}
G4PPrimaryVertex::~G4PPrimaryVertex()
{
if(theParticle != NULL)
if(theParticle != 0)
{
G4PPrimaryParticle* pp = (HepRef(G4PPrimaryParticle)) theParticle;
HepDelete(pp);
}
{ HepDelete(theParticle); }
if(theTail != NULL)
if(theTail != 0)
{
G4PPrimaryParticle* pt = (HepRef(G4PPrimaryParticle)) theTail;
HepDelete(pt);
}
{ HepDelete(theParticle); }
if(nextVertex != NULL)
if(nextVertex != 0)
{
G4PPrimaryVertex* nv = (HepRef(G4PPrimaryVertex)) nextVertex;
HepDelete(nv);
@@ -74,7 +90,7 @@ G4PrimaryVertex* G4PPrimaryVertex::MakeTransientObject()
{
G4PrimaryVertex* aPV = new G4PrimaryVertex(X0,Y0,Z0,T0);
if(theParticle != NULL)
if(theParticle != 0)
{
G4PrimaryParticle* particle = theParticle->MakeTransientObject();
@@ -86,7 +102,7 @@ G4PrimaryVertex* G4PPrimaryVertex::MakeTransientObject()
}
}
if( nextVertex != NULL )
if( nextVertex != 0 )
aPV->SetNext( nextVertex->MakeTransientObject() );
return aPV;
@@ -101,12 +117,12 @@ HepRef(G4PPrimaryParticle) G4PPrimaryVertex::GetPrimary(G4int i=0) const
HepRef(G4PPrimaryParticle) particle = theParticle;
for( int j=0; j<i; j++ )
{
if( particle == NULL ) return NULL;
if( particle == 0 ) return 0;
particle = particle->GetNext();
}
return particle;
}
else
{ return NULL; }
{ return 0; }
}
@@ -1,12 +1,28 @@
// 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.
// ********************************************************************
// * 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: G4PersistentEventMan.cc,v 1.15 1999/12/02 19:40:51 morita Exp $
// GEANT4 tag $Name: geant4-03-01 $
//
// $Id: G4PersistentEventMan.cc,v 1.16.2.1 2001/06/28 19:11:26 gunter Exp $
// GEANT4 tag $Name: $
//
// class G4PersistentEventMan
//
@@ -29,7 +45,7 @@
#include "G4ios.hh"
G4PersistentEventMan::G4PersistentEventMan()
: f_PHCMan(NULL), f_PDCMan(NULL), f_currentEventID(0)
: f_PHCMan(0), f_PDCMan(0), f_currentEventID(0)
{;}
G4PersistentEventMan::G4PersistentEventMan(
@@ -52,13 +68,13 @@ G4bool G4PersistentEventMan::Store( HepDbApplication* dbApp,
// Create persistent event
f_currentPEvent = new(f_container) G4PEvent(anEvent, aPHC, aPDC);
if( aPHC != NULL )
{ f_PHCMan->SetCurrentPHCofThisEvent(NULL); }
if( aPHC != 0 )
{ f_PHCMan->SetCurrentPHCofThisEvent(0); }
if( aPDC != NULL )
{ f_PDCMan->SetCurrentPDCofThisEvent(NULL); }
if( aPDC != 0 )
{ f_PDCMan->SetCurrentPDCofThisEvent(0); }
if( f_currentPEvent != NULL )
if( f_currentPEvent != 0 )
{
f_currentEventID = anEvent->GetEventID();
return true;
@@ -74,7 +90,7 @@ G4bool G4PersistentEventMan::Retrieve( HepDbApplication* dbApp,
G4Event*& anEvent )
{
G4bool theStatus = false;
anEvent = NULL;
anEvent = 0;
ooItr(G4PEvent) pevt_iterator;
@@ -90,7 +106,7 @@ G4bool G4PersistentEventMan::Retrieve( HepDbApplication* dbApp,
if( pevt_iterator.next() )
{
G4Event* anEvt = pevt_iterator->MakeTransientObject();
if( anEvt != NULL )
if( anEvt != 0 )
{
anEvent = anEvt;
theStatus = true;