Import Geant4 1.1.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-08 15:34:16 +02:00
parent ca1c8cb059
commit 103bda00c8
2654 changed files with 29719 additions and 20203 deletions
+12 -1
View File
@@ -1,4 +1,4 @@
$Id: History,v 1.7 1999/11/09 00:57:22 asaim Exp $
$Id: History,v 1.9 2000/01/26 06:42:14 asaim Exp $
-------------------------------------------------------------------
=========================================================
@@ -17,6 +17,17 @@ committal in the CVS repository !
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
Jan 26, 00, M.Asai (tag event-V01-00-01)
- Corrections for trajectories of suspended tracks
- This tag requires tracking-V01-00-01
Jan 12, 00, M.Asai (tag event-V01-00-00)
- G4EventManager becomes a singleton.
- G4EventManager keeps the pointers of all user action classes except
run action.
- Null pointer protections are added for SetUserAction methods in
G4EventManager and G4StackManager.
Nov 4, 99, M.Asai (tag event-V00-01-01)
- Comments are enriched for the software reference manual
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4ClassificationOfNewTrack.hh,v 1.2.4.1 1999/12/07 20:47:49 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
// $Id: G4ClassificationOfNewTrack.hh,v 1.3 1999/12/15 14:49:38 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
//
//
+2 -2
View File
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4EvManMessenger.hh,v 1.2.4.1 1999/12/07 20:47:49 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
// $Id: G4EvManMessenger.hh,v 1.3 1999/12/15 14:49:38 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
//
#ifndef G4EvManMessenger_h
+2 -2
View File
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4Event.hh,v 1.2.4.1 1999/12/07 20:47:49 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
// $Id: G4Event.hh,v 1.3 1999/12/15 14:49:38 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
//
#ifndef G4Event_h
+37 -13
View File
@@ -5,12 +5,10 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4EventManager.hh,v 1.3.4.1 1999/12/07 20:47:49 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
// $Id: G4EventManager.hh,v 1.5 2000/01/12 01:29:50 asaim Exp $
// GEANT4 tag $Name: geant4-01-01 $
//
//
// Last Modification : 10/Dec/96 M.Asai
//
#ifndef G4EventManager_h
@@ -41,6 +39,12 @@ class G4SDManager;
class G4EventManager
{
public: // with description
static G4EventManager* GetEventManager();
// This method returns the singleton pointer of G4EventManager.
private:
static G4EventManager* fpEventManager;
public:
G4EventManager();
@@ -67,16 +71,24 @@ class G4EventManager
int verboseLevel;
G4SDManager* sdManager;
G4PrimaryTransformer* transformer;
G4UserEventAction* userEventAction;
G4bool tracking;
G4EvManMessenger* theMessenger;
public:
G4UserEventAction* userEventAction;
G4UserStackingAction* userStackingAction;
G4UserTrackingAction* userTrackingAction;
G4UserSteppingAction* userSteppingAction;
public: // with description
inline const G4Event* GetConstCurrentEvent()
{ return currentEvent; }
inline G4Event* GetNonconstCurrentEvent()
{ return currentEvent; }
// These methods returns the pointers of const G4Event*
// and G4Event*, respectively. Null will be returned when
// an event is not processing.
public: // with description
inline void AbortCurrentEvent()
{
@@ -87,14 +99,25 @@ class G4EventManager
// tracks are deleted. The contents of G4Event object is not completed,
// but trajectories, hits, and/or digits which are created before the
// moment of abortion can be used.
public:
public: // with description
void SetUserAction(G4UserEventAction* userAction);
inline void SetUserAction(G4UserStackingAction* userAction)
{ trackContainer->SetUserStackingAction(userAction); }
inline void SetUserAction(G4UserTrackingAction* userAction)
{ trackManager->SetUserAction(userAction); }
inline void SetUserAction(G4UserSteppingAction* userAction)
{ trackManager->SetUserAction(userAction); }
void SetUserAction(G4UserStackingAction* userAction);
void SetUserAction(G4UserTrackingAction* userAction);
void SetUserAction(G4UserSteppingAction* userAction);
inline G4UserEventAction* GetUserEventAction()
{ return userEventAction; }
inline G4UserStackingAction* GetUserStackingAction()
{ return userStackingAction; }
inline G4UserTrackingAction* GetUserTrackingAction()
{ return userTrackingAction; }
inline G4UserSteppingAction* GetUserSteppingAction()
{ return userSteppingAction; }
// Set and get methods for user action classes. User action classes
// which should belong to the other managers will be sent to the
// corresponding managers.
public: // with description
inline G4int GetVerboseLevel()
{ return verboseLevel; }
inline void SetVerboseLevel( G4int value )
@@ -103,6 +126,7 @@ class G4EventManager
trackContainer->SetVerboseLevel( value );
transformer->SetVerboseLevel( value );
}
// Set and get method of the verbose level
};
+4 -4
View File
@@ -5,14 +5,14 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4HEPEvtInterface.hh,v 1.2.2.1.2.1 1999/12/07 20:47:50 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
// $Id: G4HEPEvtInterface.hh,v 1.4 1999/12/15 14:49:38 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
//
#ifndef G4HEPEvtInterface_h
#define G4HEPEvtInterface_h 1
#include <fstream.h>
#include "g4std/fstream"
#include "g4rw/tpordvec.h"
#include "globals.hh"
#include "G4VPrimaryGenerator.hh"
@@ -69,7 +69,7 @@ class G4HEPEvtInterface:public G4VPrimaryGenerator
private:
G4String fileName;
ifstream inputFile;
G4std::ifstream inputFile;
G4RWTPtrOrderedVector<G4HEPEvtParticle> HPlist;
};
+2 -2
View File
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4HEPEvtParticle.hh,v 1.2.4.1 1999/12/07 20:47:50 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
// $Id: G4HEPEvtParticle.hh,v 1.3 1999/12/15 14:49:38 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
//
//
+2 -2
View File
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4ParticleGun.hh,v 1.2.4.1 1999/12/07 20:47:50 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
// $Id: G4ParticleGun.hh,v 1.3 1999/12/15 14:49:38 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
//
#ifndef G4ParticleGun_h
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4ParticleGunMessenger.hh,v 1.2.4.1 1999/12/07 20:47:50 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
// $Id: G4ParticleGunMessenger.hh,v 1.3 1999/12/15 14:49:39 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
//
//
+2 -2
View File
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4PrimaryParticle.hh,v 1.2.4.1 1999/12/07 20:47:50 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
// $Id: G4PrimaryParticle.hh,v 1.3 1999/12/15 14:49:39 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
//
//
+2 -2
View File
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4PrimaryTransformer.hh,v 1.2.4.1 1999/12/07 20:47:50 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
// $Id: G4PrimaryTransformer.hh,v 1.3 1999/12/15 14:49:39 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
//
#ifndef G4PromaryTransformer_h
+2 -2
View File
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4PrimaryVertex.hh,v 1.2.4.1 1999/12/07 20:47:51 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
// $Id: G4PrimaryVertex.hh,v 1.3 1999/12/15 14:49:39 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
//
//
+6 -8
View File
@@ -5,12 +5,10 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4StackManager.hh,v 1.2.4.1 1999/12/07 20:47:51 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
// $Id: G4StackManager.hh,v 1.5 2000/01/26 06:42:14 asaim Exp $
// GEANT4 tag $Name: geant4-01-01 $
//
//
// Last Modification : 09/Dec/96 M.Asai
//
#ifndef G4StackManager_h
@@ -24,6 +22,7 @@
#include "G4TrackStatus.hh"
#include "globals.hh"
class G4StackingMessenger;
class G4VTrajectory;
// class description:
//
@@ -55,8 +54,8 @@ class G4StackManager
int operator!=(const G4StackManager &right) const;
public:
G4int PushOneTrack(G4Track *newTrack);
G4Track * PopNextTrack();
G4int PushOneTrack(G4Track *newTrack, G4VTrajectory *newTrajectory = NULL);
G4Track * PopNextTrack(G4VTrajectory**newTrajectory);
G4int PrepareNewEvent();
public: // with description
@@ -103,9 +102,8 @@ class G4StackManager
{ verboseLevel = value; }
inline void SetUserStackingAction(G4UserStackingAction* value)
{
if (userStackingAction) delete userStackingAction;
userStackingAction = value;
userStackingAction->SetStackManager(this);
if(userStackingAction) userStackingAction->SetStackManager(this);
}
private:
+8 -4
View File
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4StackedTrack.hh,v 1.2.4.1 1999/12/07 20:47:51 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
// $Id: G4StackedTrack.hh,v 1.4 2000/01/26 06:42:15 asaim Exp $
// GEANT4 tag $Name: geant4-01-01 $
//
//
// Last Modification : 02/Feb/96 M.Asai
@@ -19,6 +19,7 @@
#include "G4Track.hh"
#include "globals.hh"
#include "G4Allocator.hh"
class G4VTrajectory;
// class description:
//
@@ -33,7 +34,7 @@ class G4StackedTrack
inline void operator delete(void *aStackedTrack);
G4StackedTrack();
G4StackedTrack(G4Track * aTrack);
G4StackedTrack(G4Track * aTrack, G4VTrajectory * aTrajectory = 0);
~G4StackedTrack();
const G4StackedTrack & operator=(const G4StackedTrack &right);
@@ -42,7 +43,8 @@ class G4StackedTrack
private:
G4double priorityWeight;
G4Track *track;
G4Track * track;
G4VTrajectory * trajectory;
G4StackedTrack * previousStackedTrack;
G4StackedTrack * nextStackedTrack;
@@ -53,6 +55,8 @@ class G4StackedTrack
{ priorityWeight = value; }
inline G4Track * GetTrack() const
{ return track; }
inline G4VTrajectory * GetTrajectory() const
{ return trajectory; }
inline G4StackedTrack * GetPrevious() const
{ return previousStackedTrack; }
inline G4StackedTrack * GetNext() const
+2 -2
View File
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4StackingMessenger.hh,v 1.2.4.1 1999/12/07 20:47:51 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
// $Id: G4StackingMessenger.hh,v 1.3 1999/12/15 14:49:39 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
//
#ifndef G4StackingMessenger_h
+2 -2
View File
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4TrackStack.hh,v 1.2.4.1 1999/12/07 20:47:51 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
// $Id: G4TrackStack.hh,v 1.3 1999/12/15 14:49:39 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
//
//
// Last Modification : 09/Dec/96 M.Asai
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4TrajectoryContainer.hh,v 1.3.2.1.2.1 1999/12/07 20:47:51 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
// $Id: G4TrajectoryContainer.hh,v 1.5 1999/12/15 14:49:39 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
//
//
// G4TrajectoryContainer
+2 -2
View File
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4UserEventAction.hh,v 1.3.4.1 1999/12/07 20:47:52 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
// $Id: G4UserEventAction.hh,v 1.4 1999/12/15 14:49:39 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
//
//
//
+2 -2
View File
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4UserStackingAction.hh,v 1.3.4.1 1999/12/07 20:47:52 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
// $Id: G4UserStackingAction.hh,v 1.4 1999/12/15 14:49:39 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
//
#ifndef G4UserStackingAction_h
+2 -2
View File
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VPrimaryGenerator.hh,v 1.2.4.1 1999/12/07 20:47:52 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
// $Id: G4VPrimaryGenerator.hh,v 1.3 1999/12/15 14:49:39 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
//
#ifndef G4VPrimaryGenerator_h
+2 -2
View File
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: eventgendefs.hh,v 1.1.10.1 1999/12/07 20:47:52 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
// $Id: eventgendefs.hh,v 1.2 1999/12/15 14:49:40 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
//
#ifndef EventGenerator_DEBUG
#define EventGenerator_DEBUG
+2 -2
View File
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: evmandefs.hh,v 1.1.10.1 1999/12/07 20:47:52 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
// $Id: evmandefs.hh,v 1.2 1999/12/15 14:49:40 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
//
///#define G4EVENTMANAGER_DEBUG 1
+2 -2
View File
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: trajectoryControl.hh,v 1.1.10.1 1999/12/07 20:47:52 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
// $Id: trajectoryControl.hh,v 1.2 1999/12/15 14:49:40 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
//
////#define G4_STORE_TRAJECTORY 1
+2 -2
View File
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4EvManMessenger.cc,v 1.1.10.1 1999/12/07 20:47:52 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
// $Id: G4EvManMessenger.cc,v 1.2 1999/12/15 14:49:40 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
//
// --------------------------------------------------------------------
+3 -3
View File
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4Event.cc,v 1.1.10.1 1999/12/07 20:47:53 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
// $Id: G4Event.cc,v 1.2 1999/12/15 14:49:40 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
//
// G4Event
@@ -57,7 +57,7 @@ int G4Event::operator!=(const G4Event &right) const
void G4Event::Print() const
{
G4cout << "G4Event " << eventID << endl;
G4cout << "G4Event " << eventID << G4endl;
}
void G4Event::Draw() const
+68 -21
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.2.8.1 1999/12/07 20:47:53 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
// $Id: G4EventManager.cc,v 1.5 2000/01/26 06:42:15 asaim Exp $
// GEANT4 tag $Name: geant4-01-01 $
//
//
//
@@ -19,15 +19,31 @@
#include "G4UserStackingAction.hh"
#include "G4SDManager.hh"
G4EventManager* G4EventManager::fpEventManager = 0;
G4EventManager* G4EventManager::GetEventManager()
{ return fpEventManager; }
G4EventManager::G4EventManager()
:verboseLevel(0),trajectoryContainer(NULL),userEventAction(NULL),
:verboseLevel(0),trajectoryContainer(NULL),
tracking(false),currentEvent(NULL)
{
if(fpEventManager)
{
G4Exception("G4EventManager::G4EventManager() has already been made.");
}
else
{
trackManager = new G4TrackingManager;
transformer = new G4PrimaryTransformer;
trackContainer = new G4StackManager;
theMessenger = new G4EvManMessenger(this);
sdManager = G4SDManager::GetSDMpointerIfExist();
fpEventManager = this;
userEventAction = 0;
userStackingAction = 0;
userTrackingAction = 0;
userSteppingAction = 0;
}
}
// private -> never called
@@ -43,7 +59,8 @@ G4EventManager::~G4EventManager()
delete transformer;
delete trackManager;
delete theMessenger;
if (userEventAction) delete userEventAction;
if(userEventAction) delete userEventAction;
fpEventManager = 0;
}
/*
@@ -63,9 +80,9 @@ void G4EventManager::ProcessOneEvent(G4Event* anEvent)
#ifdef G4VERBOSE
if ( verboseLevel > 0 )
{
G4cout << "=====================================" << endl;
G4cout << " G4EventManager::ProcessOneEvent() " << endl;
G4cout << "=====================================" << endl;
G4cout << "=====================================" << G4endl;
G4cout << " G4EventManager::ProcessOneEvent() " << G4endl;
G4cout << "=====================================" << G4endl;
}
#endif
@@ -85,7 +102,7 @@ void G4EventManager::ProcessOneEvent(G4Event* anEvent)
if ( verboseLevel > 1 )
{
G4cout << currentEvent->GetNumberOfPrimaryVertex()
<< " vertices passed from G4Event." << endl;
<< " vertices passed from G4Event." << G4endl;
}
#endif
@@ -95,12 +112,13 @@ void G4EventManager::ProcessOneEvent(G4Event* anEvent)
if ( verboseLevel > 0 )
{
G4cout << trackContainer->GetNTotalTrack() << " primaries "
<< "are passed from G4EventTransformer." << endl;
G4cout << "!!!!!!! Now start processing an event !!!!!!!" << endl;
<< "are passed from G4EventTransformer." << G4endl;
G4cout << "!!!!!!! Now start processing an event !!!!!!!" << G4endl;
}
#endif
while( ( track = trackContainer->PopNextTrack() ) != NULL )
G4VTrajectory* previousTrajectory;
while( ( track = trackContainer->PopNextTrack(&previousTrajectory) ) != NULL )
{
#ifdef G4VERBOSE
@@ -108,7 +126,7 @@ void G4EventManager::ProcessOneEvent(G4Event* anEvent)
{
G4cout << "Track " << track << " (trackID " << track->GetTrackID()
<< ", parentID " << track->GetParentID()
<< ") is passed to G4TrackingManager." << endl;
<< ") is passed to G4TrackingManager." << G4endl;
}
#endif
@@ -122,13 +140,20 @@ void G4EventManager::ProcessOneEvent(G4Event* anEvent)
{
G4cout << "Track (trackID " << track->GetTrackID()
<< ", parentID " << track->GetParentID()
<< ") is processed with stopping code " << istop << endl;
<< ") is processed with stopping code " << istop << G4endl;
}
#endif
#ifdef G4_STORE_TRAJECTORY
G4VTrajectory * aTrajectory = trackManager->GimmeTrajectory();
if(aTrajectory)
if(previousTrajectory)
{
previousTrajectory->MergeTrajectory(aTrajectory);
delete aTrajectory;
aTrajectory = previousTrajectory;
}
if(aTrajectory&&(istop!=fStopButAlive)&&(istop!=fSuspend))
{
if(!trajectoryContainer)
{ trajectoryContainer = new G4TrajectoryContainer; }
@@ -141,6 +166,10 @@ void G4EventManager::ProcessOneEvent(G4Event* anEvent)
{
case fStopButAlive:
case fSuspend:
trackContainer->PushOneTrack( track, aTrajectory );
StackTracks( secondaries );
break;
case fPostponeToNextEvent:
trackContainer->PushOneTrack( track );
StackTracks( secondaries );
@@ -153,7 +182,7 @@ void G4EventManager::ProcessOneEvent(G4Event* anEvent)
case fAlive:
G4cout << "Illeagal TrackStatus returned from G4TrackingManager!"
<< endl;
<< G4endl;
case fKillTrackAndSecondaries:
if( secondaries ) secondaries->clearAndDestroy();
delete track;
@@ -164,8 +193,8 @@ void G4EventManager::ProcessOneEvent(G4Event* anEvent)
#ifdef G4VERBOSE
if ( verboseLevel > 0 )
{
G4cout << "NULL returned from G4StackManager." << endl;
G4cout << "Terminate current event processing." << endl;
G4cout << "NULL returned from G4StackManager." << G4endl;
G4cout << "Terminate current event processing." << G4endl;
}
#endif
@@ -202,7 +231,7 @@ void G4EventManager::StackTracks(G4TrackVector *trackVector)
G4cout << "A new track " << newTrack
<< " (trackID " << newTrack->GetTrackID()
<< ", parentID " << newTrack->GetParentID()
<< ") is passed to G4StackManager." << endl;
<< ") is passed to G4StackManager." << G4endl;
}
#endif
}
@@ -212,8 +241,26 @@ void G4EventManager::StackTracks(G4TrackVector *trackVector)
void G4EventManager::SetUserAction(G4UserEventAction* userAction)
{
if (userEventAction) delete userEventAction;
userEventAction = userAction;
userEventAction->SetEventManager(this);
if(userEventAction) userEventAction->SetEventManager(this);
}
void G4EventManager::SetUserAction(G4UserStackingAction* userAction)
{
userStackingAction = userAction;
trackContainer->SetUserStackingAction(userAction);
}
void G4EventManager::SetUserAction(G4UserTrackingAction* userAction)
{
userTrackingAction = userAction;
trackManager->SetUserAction(userAction);
}
void G4EventManager::SetUserAction(G4UserSteppingAction* userAction)
{
userSteppingAction = userAction;
trackManager->SetUserAction(userAction);
}
+3 -7
View File
@@ -5,17 +5,13 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4HEPEvtInterface.cc,v 1.2.8.1 1999/12/07 20:47:53 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
// $Id: G4HEPEvtInterface.cc,v 1.3 1999/12/15 14:49:40 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
//
//
// --------------------------------------------------------------------
#ifdef WIN32
# include <Strstrea.h>
#else
# include <strstream.h>
#endif
#include "g4std/strstream"
#include "G4ios.hh"
#include "G4HEPEvtInterface.hh"
+2 -2
View File
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4HEPEvtParticle.cc,v 1.1.10.1 1999/12/07 20:47:53 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
// $Id: G4HEPEvtParticle.cc,v 1.2 1999/12/15 14:49:40 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
//
//
+8 -8
View File
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4ParticleGun.cc,v 1.1.10.1 1999/12/07 20:47:53 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
// $Id: G4ParticleGun.cc,v 1.2 1999/12/15 14:49:41 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
//
// G4ParticleGun
@@ -57,8 +57,8 @@ void G4ParticleGun::SetParticleMomentum(G4ParticleMomentum aMomentum)
{
if(particle_definition==NULL)
{
G4cout <<"Particle Definition not defined yet for G4ParticleGun"<< endl;
G4cout <<"Zero Mass is assumed"<<endl;
G4cout <<"Particle Definition not defined yet for G4ParticleGun"<< G4endl;
G4cout <<"Zero Mass is assumed"<<G4endl;
particle_momentum_direction = aMomentum.unit();
particle_energy = aMomentum.mag();
}
@@ -69,13 +69,13 @@ void G4ParticleGun::SetParticleMomentum(G4ParticleMomentum aMomentum)
particle_momentum_direction = aMomentum.unit();
if ((particle_energy>0.0)&&(abs(particle_energy+mass-sqrt(p*p+mass*mass))>keV))
{
G4cout << "G4ParticleGun::" << particle_definition->GetParticleName() << endl;
G4cout << " KineticEnergy and Momentum could be inconsistent" << endl;
G4cout << "G4ParticleGun::" << particle_definition->GetParticleName() << G4endl;
G4cout << " KineticEnergy and Momentum could be inconsistent" << G4endl;
G4cout << " (Momentum:" << p/GeV << " GeV/c";
G4cout << " Mass:" << mass/GeV << " GeV/c/c)" << endl;
G4cout << " Mass:" << mass/GeV << " GeV/c/c)" << G4endl;
G4cout << " KineticEnergy is overwritten!! ";
G4cout << particle_energy/GeV << "->";
G4cout << (sqrt(p*p+mass*mass)-mass)/GeV << "GeV" << endl;
G4cout << (sqrt(p*p+mass*mass)-mass)/GeV << "GeV" << G4endl;
}
particle_energy = sqrt(p*p+mass*mass)-mass;
}
+2 -2
View File
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4ParticleGunMessenger.cc,v 1.1.10.1 1999/12/07 20:47:53 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
// $Id: G4ParticleGunMessenger.cc,v 1.2 1999/12/15 14:49:41 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
//
#include "G4ParticleGunMessenger.hh"
+8 -8
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.1.10.1 1999/12/07 20:47:53 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
// $Id: G4PrimaryParticle.cc,v 1.2 1999/12/15 14:49:41 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
//
#include "G4PrimaryParticle.hh"
@@ -80,20 +80,20 @@ void G4PrimaryParticle::Print() const
{
G4cout << "==== PDGcode " << PDGcode << " Particle name ";
if(G4code != NULL)
{ G4cout << G4code->GetParticleName() << endl; }
{ G4cout << G4code->GetParticleName() << G4endl; }
else
{ G4cout << "is not defined in G4." << endl; }
G4cout << " Momentum ( " << Px << ", " << Py << ", " << Pz << " )" << endl;
{ G4cout << "is not defined in G4." << G4endl; }
G4cout << " Momentum ( " << Px << ", " << Py << ", " << Pz << " )" << G4endl;
G4cout << " Polarization ( " << polX << ", " << polY << ", "
<< polZ << " )" << endl;
<< polZ << " )" << G4endl;
if(daughterParticle != NULL)
{
G4cout << ">>>> Daughters" << endl;
G4cout << ">>>> Daughters" << G4endl;
daughterParticle->Print();
}
if(nextParticle != NULL)
{ nextParticle->Print(); }
else
{ G4cout << "<<<< End of link" << endl; }
{ G4cout << "<<<< End of link" << G4endl; }
}
+7 -7
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.1.10.1 1999/12/07 20:47:53 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
// $Id: G4PrimaryTransformer.cc,v 1.2 1999/12/15 14:49:41 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
//
#include "G4PrimaryTransformer.hh"
@@ -52,7 +52,7 @@ void G4PrimaryTransformer::GenerateTracks(G4PrimaryVertex* primaryVertex)
<< X0 / mm << "(mm),"
<< Y0 / mm << "(mm),"
<< Z0 / mm << "(mm),"
<< T0 / nanosecond << "(nsec))" << endl;
<< T0 / nanosecond << "(nsec))" << G4endl;
}
#endif
@@ -76,7 +76,7 @@ void G4PrimaryTransformer::GenerateSingleTrack
if(verboseLevel>2)
{
G4cout << "Primary particle (PDGcode " << primaryParticle->GetPDGcode()
<< ") --- Ignored" << endl;
<< ") --- Ignored" << G4endl;
}
#endif
G4PrimaryParticle* daughter = primaryParticle->GetDaughter();
@@ -96,7 +96,7 @@ void G4PrimaryTransformer::GenerateSingleTrack
{
G4cout << "Primary particle (" << partDef->GetParticleName()
<< ") --- Transfered with momentum " << primaryParticle->GetMomentum()
<< endl;
<< G4endl;
}
#endif
G4DynamicParticle* DP =
@@ -135,7 +135,7 @@ void G4PrimaryTransformer::SetDecayProducts
if(verboseLevel>2)
{
G4cout << " >> Decay product (PDGcode " << daughter->GetPDGcode()
<< ") --- Ignored" << endl;
<< ") --- Ignored" << G4endl;
}
#endif
SetDecayProducts(daughter,motherDP);
@@ -147,7 +147,7 @@ void G4PrimaryTransformer::SetDecayProducts
{
G4cout << " >> Decay product (" << partDef->GetParticleName()
<< ") --- Attached with momentum " << daughter->GetMomentum()
<< endl;
<< G4endl;
}
#endif
G4DynamicParticle*DP
+4 -4
View File
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4PrimaryVertex.cc,v 1.1.10.1 1999/12/07 20:47:54 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
// $Id: G4PrimaryVertex.cc,v 1.2 1999/12/15 14:49:41 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
//
#include "G4PrimaryVertex.hh"
@@ -53,8 +53,8 @@ int G4PrimaryVertex::operator!=(const G4PrimaryVertex &right) const
void G4PrimaryVertex::Print() const
{
G4cout << "Vertex ( "
<< X0 << ", " << Y0 << ", " << Z0 << ", " << T0 << " )" << endl;
G4cout << "#### Primary particles" << endl;
<< X0 << ", " << Y0 << ", " << Z0 << ", " << T0 << " )" << G4endl;
G4cout << "#### Primary particles" << G4endl;
G4PrimaryParticle* aPrim = theParticle;
if(aPrim != NULL)
{
+16 -11
View File
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4StackManager.cc,v 1.1.10.1 1999/12/07 20:47:54 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
// $Id: G4StackManager.cc,v 1.3 2000/01/26 06:42:16 asaim Exp $
// GEANT4 tag $Name: geant4-01-01 $
//
//
// Last Modification : 09/Dec/96 M.Asai
@@ -14,6 +14,7 @@
#include "G4StackManager.hh"
#include "G4StackingMessenger.hh"
#include "G4VTrajectory.hh"
#include "evmandefs.hh"
#include "G4ios.hh"
@@ -42,7 +43,7 @@ const{ return false; }
int G4StackManager::operator!=(const G4StackManager &)
const{ return true; }
G4int G4StackManager::PushOneTrack(G4Track *newTrack)
G4int G4StackManager::PushOneTrack(G4Track *newTrack,G4VTrajectory *newTrajectory)
{
G4ClassificationOfNewTrack classification;
if(userStackingAction)
@@ -57,14 +58,15 @@ G4int G4StackManager::PushOneTrack(G4Track *newTrack)
{
G4cout << " ---> G4Track " << newTrack << " (trackID "
<< newTrack->GetTrackID() << ", parentID "
<< newTrack->GetParentID() << ") is not to be stored." << endl;
<< newTrack->GetParentID() << ") is not to be stored." << G4endl;
}
#endif
delete newTrack;
delete newTrajectory;
}
else
{
G4StackedTrack * newStackedTrack = new G4StackedTrack( newTrack );
G4StackedTrack * newStackedTrack = new G4StackedTrack( newTrack, newTrajectory );
switch (classification)
{
case fUrgent:
@@ -85,13 +87,13 @@ G4int G4StackManager::PushOneTrack(G4Track *newTrack)
}
G4Track * G4StackManager::PopNextTrack()
G4Track * G4StackManager::PopNextTrack(G4VTrajectory**newTrajectory)
{
#ifdef G4VERBOSE
if( verboseLevel > 0 )
{
G4cout << "### pop requested out of "
<< GetNUrgentTrack() << " stacked tracks." << endl;
<< GetNUrgentTrack() << " stacked tracks." << G4endl;
}
#endif
@@ -99,20 +101,21 @@ G4Track * G4StackManager::PopNextTrack()
{
#ifdef G4VERBOSE
if( verboseLevel > 0 ) G4cout << "### " << GetNWaitingTrack()
<< " waiting tracks are re-classified to" << endl;
<< " waiting tracks are re-classified to" << G4endl;
#endif
waitingStack->TransferTo(urgentStack);
if(userStackingAction) userStackingAction->NewStage();
#ifdef G4VERBOSE
if( verboseLevel > 0 ) G4cout << " " << GetNUrgentTrack()
<< " urgent tracks and " << GetNWaitingTrack()
<< " waiting tracks." << endl;
<< " waiting tracks." << G4endl;
#endif
if( ( GetNUrgentTrack()==0 ) && ( GetNWaitingTrack()==0 ) ) return NULL;
}
G4StackedTrack * selectedStackedTrack = urgentStack->PopFromStack();
G4Track * selectedTrack = selectedStackedTrack->GetTrack();
*newTrajectory = selectedStackedTrack->GetTrajectory();
#ifdef G4VERBOSE
if( verboseLevel > 1 )
@@ -121,7 +124,7 @@ G4Track * G4StackManager::PopNextTrack()
<< " with G4Track " << selectedStackedTrack->GetTrack()
<< " (trackID " << selectedStackedTrack->GetTrack()->GetTrackID()
<< ", parentID " << selectedStackedTrack->GetTrack()->GetParentID()
<< ")" << endl;
<< ")" << G4endl;
}
#endif
@@ -146,6 +149,7 @@ void G4StackManager::ReClassify()
{
case fKill:
delete aStackedTrack->GetTrack();
delete aStackedTrack->GetTrajectory();
delete aStackedTrack;
break;
case fUrgent:
@@ -173,7 +177,7 @@ G4int G4StackManager::PrepareNewEvent()
if( verboseLevel > 0 )
{
G4cout << GetNPostponedTrack()
<< " postponed tracked are now shifted to the stack." << endl;
<< " postponed tracked are now shifted to the stack." << G4endl;
}
#endif
@@ -185,6 +189,7 @@ G4int G4StackManager::PrepareNewEvent()
while( (aStackedTrack=tmpStack.PopFromStack()) != NULL )
{
G4Track* aTrack = aStackedTrack->GetTrack();
G4VTrajectory* aTrajectory = aStackedTrack->GetTrajectory();
aTrack->SetParentID(-1);
G4ClassificationOfNewTrack classification;
if(userStackingAction)
+6 -4
View File
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4StackedTrack.cc,v 1.1.10.1 1999/12/07 20:47:54 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
// $Id: G4StackedTrack.cc,v 1.3 2000/01/26 06:42:16 asaim Exp $
// GEANT4 tag $Name: geant4-01-01 $
//
//
// Last Modification : 02/Feb/96 M.Asai
@@ -17,10 +17,12 @@
G4Allocator<G4StackedTrack> aStackedTrackAllocator;
G4StackedTrack::G4StackedTrack()
:track(NULL),trajectory(NULL),priorityWeight(0.),
previousStackedTrack(NULL),nextStackedTrack(NULL)
{ }
G4StackedTrack::G4StackedTrack(G4Track * newTrack)
:track(newTrack),priorityWeight(0.),
G4StackedTrack::G4StackedTrack(G4Track * newTrack, G4VTrajectory * aTrajectory)
:track(newTrack),trajectory(aTrajectory),priorityWeight(0.),
previousStackedTrack(NULL),nextStackedTrack(NULL)
{ }
+7 -7
View File
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4StackingMessenger.cc,v 1.1.10.1 1999/12/07 20:47:54 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
// $Id: G4StackingMessenger.cc,v 1.2 1999/12/15 14:49:41 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
//
// --------------------------------------------------------------------
@@ -50,11 +50,11 @@ void G4StackingMessenger::SetNewValue(G4UIcommand * command,G4String newValues)
{
if( command==statusCmd )
{
G4cout << "========================== Current status of the stack =====" << endl;
G4cout << " Number of tracks in the stack" << endl;
G4cout << " Urgent stack : " << fContainer->GetNUrgentTrack() << endl;
G4cout << " Waiting stack : " << fContainer->GetNWaitingTrack() << endl;
G4cout << " Postponed stack : " << fContainer->GetNPostponedTrack() << endl;
G4cout << "========================== Current status of the stack =====" << G4endl;
G4cout << " Number of tracks in the stack" << G4endl;
G4cout << " Urgent stack : " << fContainer->GetNUrgentTrack() << G4endl;
G4cout << " Waiting stack : " << fContainer->GetNWaitingTrack() << G4endl;
G4cout << " Postponed stack : " << fContainer->GetNPostponedTrack() << G4endl;
}
if( command==clearCmd )
{
+2 -2
View File
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4TrackStack.cc,v 1.1.10.1 1999/12/07 20:47:54 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
// $Id: G4TrackStack.cc,v 1.2 1999/12/15 14:49:41 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
//
//
// Last Modification : 09/Dec/96 M.Asai
+2 -2
View File
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4UserEventAction.cc,v 1.2.8.1 1999/12/07 20:47:54 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
// $Id: G4UserEventAction.cc,v 1.3 1999/12/15 14:49:41 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
//
#include "G4UserEventAction.hh"
+2 -2
View File
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4UserStackingAction.cc,v 1.2.8.1 1999/12/07 20:47:55 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
// $Id: G4UserStackingAction.cc,v 1.3 1999/12/15 14:49:42 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
//
#include "G4UserStackingAction.hh"
+2 -2
View File
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VPrimaryGenerator.cc,v 1.1.10.1 1999/12/07 20:47:55 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
// $Id: G4VPrimaryGenerator.cc,v 1.2 1999/12/15 14:49:42 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
//
// G4VPrimaryGenerator