Import Geant4 1.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-08 15:28:20 +02:00
parent aaa409b6ee
commit ca1c8cb059
2995 changed files with 106830 additions and 299600 deletions
@@ -1,19 +1,31 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// 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: G4HCtable.hh,v 1.1 1999/01/07 16:06:24 gunter Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4HCtable.hh,v 1.2.2.1.2.1 1999/12/07 20:47:41 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
#ifndef G4HCtable_H
#define G4HCtable_H 1
#include "globals.hh"
#include <rw/tvordvec.h>
#include "g4rw/tvordvec.h"
// class description:
//
// This class is used by G4SDManager for book keeping the
// sensitive detector modules and hits collections. The order of
// hits collections stored in G4HCofThisEvent is same as the
// order of HClist.
// The order may vary from run to run, if the user adds/changes
// some of his/her sensitive detector modules.
// In case user wants to make G4Run object persistent, this
// G4HCtable class object should be copied and stored with
// G4Run object.
class G4HCtable
{
@@ -26,8 +38,8 @@ class G4HCtable
G4int GetCollectionID(G4String HCname);
private:
RWTValOrderedVector<G4String> SDlist;
RWTValOrderedVector<G4String> HClist;
G4RWTValOrderedVector<G4String> SDlist;
G4RWTValOrderedVector<G4String> HClist;
public:
inline G4int entries() const
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// 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: G4SDManager.hh,v 1.1 1999/01/07 16:06:24 gunter Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4SDManager.hh,v 1.2.4.1 1999/12/07 20:47:41 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
#ifndef G4SDManager_h
@@ -20,10 +20,21 @@ class G4VSensitiveDetector;
class G4HCofThisEvent;
class G4SDmessenger;
// class description:
//
// This is a singleton class which manages the sensitive detectors.
// The user cannot access to the constructor. The pointer of the
// only existing object can be got via G4SDManager::GetSDMpointer()
// static method. The first invokation of this static method makes
// the singleton object.
//
class G4SDManager
{
public:
public: // with description
static G4SDManager* GetSDMpointer();
// Returns the pointer to the singleton object.
public:
static G4SDManager* GetSDMpointerIfExist();
protected:
@@ -31,13 +42,22 @@ class G4SDManager
public:
~G4SDManager();
public: // with description
void AddNewDetector(G4VSensitiveDetector*aSD);
G4HCofThisEvent* PrepareNewEvent();
void TerminateCurrentEvent(G4HCofThisEvent* HCE);
// Registors the user's sensitive detector. This method must be invoked
// when the user construct his/her sensitive detector.
void Activate(G4String dName, G4bool activeFlag);
// Activate/inactivate the registered sensitive detector. For the inactivated
// detectors, hits collections will not be stored to the G4HCofThisEvent object.
G4int GetCollectionID(G4String colName);
G4int GetCollectionID(G4VHitsCollection * aHC);
// These two methods return the ID number of the sensitive detector.
public:
G4VSensitiveDetector* FindSensitiveDetector(G4String dName);
G4HCofThisEvent* PrepareNewEvent();
void TerminateCurrentEvent(G4HCofThisEvent* HCE);
private:
static G4SDManager * fSDManager;
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// 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: G4SDStructure.hh,v 1.1 1999/01/07 16:06:25 gunter Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4SDStructure.hh,v 1.2.2.1.2.1 1999/12/07 20:47:41 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
#ifndef G4SDStructure_h
@@ -16,11 +16,17 @@
#include "globals.hh"
// G4VSensitiveDetector
#include "G4VSensitiveDetector.hh"
// RWTPtrOrderedVector
#include <rw/tpordvec.h>
// G4RWTPtrOrderedVector
#include "g4rw/tpordvec.h"
class G4HCofThisEvent;
// class description:
//
// This class is exclusively used by G4SDManager for handling the tree
// structure of the user's sensitive detector names.
//
class G4SDStructure
{
public:
@@ -42,8 +48,8 @@ class G4SDStructure
G4String ExtractDirName(G4String aPath);
private:
RWTPtrOrderedVector<G4SDStructure> structure;
RWTPtrOrderedVector<G4VSensitiveDetector> detector;
G4RWTPtrOrderedVector<G4SDStructure> structure;
G4RWTPtrOrderedVector<G4VSensitiveDetector> detector;
G4String pathName;
G4String dirName;
G4int verboseLevel;
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// 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: G4SDmessenger.hh,v 1.1 1999/01/07 16:06:25 gunter Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4SDmessenger.hh,v 1.2.4.1 1999/12/07 20:47:42 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
#ifndef G4SDmessenger_h
@@ -20,6 +20,17 @@ class G4UIcmdWithoutParameter;
class G4UIcmdWithAString;
class G4UIcmdWithAnInteger;
// class description:
//
// This is a cncrete class of G4UImessenger which handles the commands for
// G4SDManager. This class has the following commands:
// /hits/
// /hits/list
// /hits/activate
// /hits/inactivate
// /hts/verbose
//
class G4SDmessenger: public G4UImessenger
{
public:
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// 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: G4SensitiveVolumeList.hh,v 1.1 1999/01/07 16:06:25 gunter Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4SensitiveVolumeList.hh,v 1.2.2.1.2.1 1999/12/07 20:47:42 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
// ------------------------------------------------------------
// GEANT 4 class header file --- Copyright CERN 1996
@@ -22,11 +22,18 @@
#ifndef G4SensitiveVolumeList_h
#define G4SensitiveVolumeList_h 1
#include <rw/tpordvec.h>
#include <rw/tvordvec.h>
#include "g4rw/tpordvec.h"
#include "g4rw/tvordvec.h"
#include "G4LogicalVolume.hh"
#include "G4VPhysicalVolume.hh"
// class description:
//
// This class object can have lists of logical and physical volumes.
// In case a sensitive detector is shared by several logical volumes and/or
// a logical volume is shared by several physical volumes, this class can be
// used by the veto list for individual logical/physical volumes.
//
class G4SensitiveVolumeList
{
@@ -53,11 +60,11 @@ class G4SensitiveVolumeList
G4bool CheckLV(const G4LogicalVolume *lvp) const;
//Get and Set Operations for Has Relationships
const RWTPtrOrderedVector<G4VPhysicalVolume>& GetThePhysicalVolumeList() const;
void SetThePhysicalVolumeList(const RWTPtrOrderedVector<G4VPhysicalVolume> value);
const G4RWTPtrOrderedVector<G4VPhysicalVolume>& GetThePhysicalVolumeList() const;
void SetThePhysicalVolumeList(const G4RWTPtrOrderedVector<G4VPhysicalVolume> value);
const RWTPtrOrderedVector<G4LogicalVolume>& GetTheLogicalVolumeList() const;
void SetTheLogicalVolumeList(const RWTPtrOrderedVector<G4LogicalVolume> value);
const G4RWTPtrOrderedVector<G4LogicalVolume>& GetTheLogicalVolumeList() const;
void SetTheLogicalVolumeList(const G4RWTPtrOrderedVector<G4LogicalVolume> value);
@@ -65,8 +72,8 @@ class G4SensitiveVolumeList
//Data Members for Has Relationships
RWTPtrOrderedVector<G4VPhysicalVolume> thePhysicalVolumeList;
RWTPtrOrderedVector<G4LogicalVolume> theLogicalVolumeList;
G4RWTPtrOrderedVector<G4VPhysicalVolume> thePhysicalVolumeList;
G4RWTPtrOrderedVector<G4LogicalVolume> theLogicalVolumeList;
};
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// 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: G4SensitiveVolumeList.icc,v 1.1 1999/01/07 16:06:25 gunter Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4SensitiveVolumeList.icc,v 1.1.8.1.2.1 1999/12/07 20:47:42 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
// -----------------------------------------------------------
// Inline functions of GEANT 4 class header file.
@@ -22,14 +22,14 @@
//Get and Set Operations for Has Relationships
inline const RWTPtrOrderedVector<G4VPhysicalVolume>& G4SensitiveVolumeList::get_the_G4VPhysicalVolume_list() const { return the_G4VPhysicalVolume_list; }
inline const G4RWTPtrOrderedVector<G4VPhysicalVolume>& G4SensitiveVolumeList::get_the_G4VPhysicalVolume_list() const { return the_G4VPhysicalVolume_list; }
inline void G4SensitiveVolumeList::set_the_G4VPhysicalVolume_list(const RWTPtrOrderedVector<G4VPhysicalVolume> value) { the_G4VPhysicalVolume_list = value; }
inline void G4SensitiveVolumeList::set_the_G4VPhysicalVolume_list(const G4RWTPtrOrderedVector<G4VPhysicalVolume> value) { the_G4VPhysicalVolume_list = value; }
inline const RWTPtrOrderedVector<G4LogicalVolume>& G4SensitiveVolumeList::get_the_G4LogicalVolume() const { return the_G4LogicalVolume_list; }
inline const G4RWTPtrOrderedVector<G4LogicalVolume>& G4SensitiveVolumeList::get_the_G4LogicalVolume() const { return the_G4LogicalVolume_list; }
inline void G4SensitiveVolumeList::set_the_G4LogicalVolume(const RWTPtrOrderedVector<G4LogicalVolume> value) { the_G4LogicalVolume_list = value; }
inline void G4SensitiveVolumeList::set_the_G4LogicalVolume(const G4RWTPtrOrderedVector<G4LogicalVolume> value) { the_G4LogicalVolume_list = value; }
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// 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: G4VReadOutGeometry.hh,v 1.1 1999/01/07 16:06:25 gunter Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4VReadOutGeometry.hh,v 1.1.10.1 1999/12/07 20:47:42 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
// ------------------------------------------------------------
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// 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: G4VSensitiveDetector.hh,v 1.1 1999/01/07 16:06:25 gunter Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4VSensitiveDetector.hh,v 1.2.2.1.2.1 1999/12/07 20:47:43 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
#ifndef G4VSensitiveDetector_h
@@ -17,15 +17,28 @@
#include "G4HCofThisEvent.hh"
#include "G4VReadOutGeometry.hh"
#include "G4TouchableHistory.hh"
#include <rw/tvordvec.h>
#include "g4rw/tvordvec.h"
// class description:
//
// This is the abstract base class of the sensitive detector. The user's
// sensitive detector which generates hits must be derived from this
// class.
// In the derived class constructor, name(s) of hits collection(s) which
// are made by the sensitive detector must be set to "collectionName" string
// vector.
class G4VSensitiveDetector
{
public:
public: // with description
G4VSensitiveDetector(G4String name);
G4VSensitiveDetector(const G4VSensitiveDetector &right);
// Constructors. The user's concrete class must use one of these constructors
// by the constructor initializer of the derived class. The name of
// the sensitive detector must be unique.
public:
virtual ~G4VSensitiveDetector();
const G4VSensitiveDetector & operator=(const G4VSensitiveDetector &right);
@@ -33,28 +46,53 @@ class G4VSensitiveDetector
int operator==(const G4VSensitiveDetector &right) const;
int operator!=(const G4VSensitiveDetector &right) const;
public: // with description
virtual void Initialize(G4HCofThisEvent*HCE);
virtual void EndOfEvent(G4HCofThisEvent*HCE);
// These two methods are invoked at the begining and at the end of each
// event. The hits collection(s) created by this sensitive detector must
// be set to the G4HCofThisEvent object at one of these two methods.
virtual void clear();
// This method is invoked if the event abortion is occured. Hits collections
// created but not beibg set to G4HCofThisEvent at the event should be deleted.
// Collection(s) which have already set to G4HCofThisEvent will be deleted
// automatically.
public:
virtual void DrawAll();
virtual void PrintAll();
protected:
protected: // with description
virtual G4bool ProcessHits(G4Step*aStep,G4TouchableHistory*ROhist) = 0;
// The user MUST implement this method for generating hit(s) using the
// information of G4Step object. Note that the volume and the position
// information is kept in PreStepPoint of G4Step.
// Be aware that this method is a protected method and it sill be invoked
// by Hit() method of Base class after Readout geometry associated to the
// sensitive detector is handled.
// "ROhist" will be given only is a Readout geometry is defined to this
// sensitive detector. The G4TouchableHistory object of the tracking geometry
// is stored in the PreStepPoint object of G4Step.
G4int GetCollectionID(G4int i);
// This is a utility method which returns the hits collection ID of the
// "i"-th collection. "i" is the order (starting with zero) of the collection
// whose name is stored to the collectionName protected vector.
G4RWTValOrderedVector<G4String> collectionName;
// This protected name vector must be filled at the constructor of the user's
// concrete class for registering the name(s) of hits collection(s) being
// created by this particular sensitive detector.
protected:
G4String SensitiveDetectorName; // detector name
G4String thePathName; // directory path
G4String fullPathName; // path + detector name
G4int verboseLevel;
G4bool active;
RWTValOrderedVector<G4String> collectionName;
private:
G4VReadOutGeometry * ROgeometry;
public:
public: // with description
inline G4bool Hit(G4Step*aStep)
{
G4bool ack = true;
@@ -67,26 +105,33 @@ class G4VSensitiveDetector
{ ack = ProcessHits(aStep,ROhis); }
return ack;
}
inline G4int GetNumberOfCollections()
{ return collectionName.entries(); };
inline G4String GetCollectionName(G4int id)
{ return collectionName[id]; };
inline void SetVerboseLevel(G4int vl)
{ verboseLevel = vl; };
inline void Activate(G4bool activeFlag)
{ active = activeFlag; };
inline G4bool isActive()
{ return active; };
inline G4String GetName()
{ return SensitiveDetectorName; };
inline G4String GetPathName()
{ return thePathName; };
inline G4String GetFullPathName()
{ return fullPathName; };
// This is the public method invoked by G4SteppingManager for generating
// hit(s). The actual user's implementation for generating hit(s) must be
// implemented in GenerateHits() virtual protected method. This method
// MUST NOT be overrided.
inline void SetROgeometry(G4VReadOutGeometry*value)
{ ROgeometry = value; };
{ ROgeometry = value; }
// Register the Readout geometry.
public:
inline G4int GetNumberOfCollections()
{ return collectionName.entries(); }
inline G4String GetCollectionName(G4int id)
{ return collectionName[id]; }
inline void SetVerboseLevel(G4int vl)
{ verboseLevel = vl; }
inline void Activate(G4bool activeFlag)
{ active = activeFlag; }
inline G4bool isActive()
{ return active; }
inline G4String GetName()
{ return SensitiveDetectorName; }
inline G4String GetPathName()
{ return thePathName; }
inline G4String GetFullPathName()
{ return fullPathName; }
inline G4VReadOutGeometry* GetROgeometry()
{ return ROgeometry; };
{ return ROgeometry; }
};