Import Geant4 1.0.0 source tree
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
$Id: History,v 1.1 1999/01/07 16:06:23 gunter Exp $
|
||||
$Id: History,v 1.3 1999/11/09 00:46:57 asaim Exp $
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=========================================================
|
||||
@@ -17,6 +17,9 @@ committal in the CVS repository !
|
||||
* Reverse chronological order (last date on top), please *
|
||||
----------------------------------------------------------
|
||||
|
||||
Nov 4, 99, M.Asai (tag digits+hits-V00-01-00)
|
||||
- Comments are enriched for software reference manual.
|
||||
|
||||
Oct 26, 98 M.Asai (tag digits+hits-00-03-01)
|
||||
- Debugged in G4HCofThisEvent.hh and G4DCofThisEvent.hh
|
||||
|
||||
|
||||
@@ -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; }
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -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: G4HCtable.cc,v 1.1 1999/01/07 16:06:26 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
// $Id: G4HCtable.cc,v 1.1.8.1.2.1 1999/12/07 20:47:44 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
|
||||
#include "G4HCtable.hh"
|
||||
@@ -27,7 +27,7 @@ G4int G4HCtable::Registor(G4String SDname,G4String HCname)
|
||||
G4int G4HCtable::GetCollectionID(G4String HCname)
|
||||
{
|
||||
G4int i = -1;
|
||||
if(HCname.index("/")==RW_NPOS) // HCname only
|
||||
if(HCname.index("/")==G4std::string::npos) // HCname only
|
||||
{
|
||||
for(G4int j=0;j<HClist.entries();j++)
|
||||
{
|
||||
|
||||
@@ -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.cc,v 1.1 1999/01/07 16:06:26 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
// $Id: G4SDManager.cc,v 1.1.10.1 1999/12/07 20:47:44 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
|
||||
#include "G4SDManager.hh"
|
||||
|
||||
@@ -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.cc,v 1.1 1999/01/07 16:06:26 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
// $Id: G4SDStructure.cc,v 1.1.8.1.2.1 1999/12/07 20:47:45 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
|
||||
// G4SDStructure
|
||||
@@ -92,7 +92,7 @@ G4String G4SDStructure::ExtractDirName(G4String aName)
|
||||
{
|
||||
G4String subD = aName;
|
||||
int i = aName.first('/');
|
||||
if( i != RW_NPOS ) subD.remove(i+1);
|
||||
if( i != G4std::string::npos ) subD.remove(i+1);
|
||||
return subD;
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ void G4SDStructure::Activate(G4String aName, G4bool sensitiveFlag)
|
||||
{
|
||||
G4String aPath = aName;
|
||||
aPath.remove(0,pathName.length());
|
||||
if( aPath.first('/') != RW_NPOS )
|
||||
if( aPath.first('/') != G4std::string::npos )
|
||||
{ // Command is ordered for a subdirectory.
|
||||
G4String subD = ExtractDirName(aPath);
|
||||
G4SDStructure* tgtSDS = FindSubDirectory(subD);
|
||||
@@ -142,7 +142,7 @@ G4VSensitiveDetector* G4SDStructure::FindSensitiveDetector(G4String aName)
|
||||
{
|
||||
G4String aPath = aName;
|
||||
aPath.remove(0,pathName.length());
|
||||
if( aPath.first('/') != RW_NPOS )
|
||||
if( aPath.first('/') != G4std::string::npos )
|
||||
{ // SD exists in sub-directory
|
||||
G4String subD = ExtractDirName(aPath);
|
||||
G4SDStructure* tgtSDS = FindSubDirectory(subD);
|
||||
|
||||
@@ -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.cc,v 1.1 1999/01/07 16:06:26 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
// $Id: G4SDmessenger.cc,v 1.1.10.1 1999/12/07 20:47:45 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: G4SensitiveVolumeList.cc,v 1.1 1999/01/07 16:06:26 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
// $Id: G4SensitiveVolumeList.cc,v 1.1.10.1 1999/12/07 20:47:45 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
// GEANT 4 class implementation file
|
||||
|
||||
@@ -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.cc,v 1.1 1999/01/07 16:06:27 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
// $Id: G4VReadOutGeometry.cc,v 1.2.6.1 1999/12/07 20:47:45 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
|
||||
#include "G4VReadOutGeometry.hh"
|
||||
@@ -101,17 +101,20 @@ G4bool G4VReadOutGeometry::FindROTouchable(G4Step*currentStep)
|
||||
|
||||
// At first invokation, creates the touchable history. Note
|
||||
// that default value (false) of Locate method is used.
|
||||
// ---------> But the default Value is TRUE <-------------------- J.A.
|
||||
if(!touchableHistory)
|
||||
{
|
||||
touchableHistory = new G4TouchableHistory();
|
||||
ROnavigator->LocateGlobalPointAndUpdateTouchable(
|
||||
currentStep->GetPreStepPoint()->GetPosition(),
|
||||
currentStep->GetPreStepPoint()->GetMomentumDirection(),
|
||||
touchableHistory);
|
||||
}
|
||||
else
|
||||
{
|
||||
ROnavigator->LocateGlobalPointAndUpdateTouchable(
|
||||
currentStep->GetPreStepPoint()->GetPosition(),
|
||||
currentStep->GetPreStepPoint()->GetMomentumDirection(),
|
||||
touchableHistory,
|
||||
true);
|
||||
}
|
||||
|
||||
@@ -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.cc,v 1.1 1999/01/07 16:06:27 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
// $Id: G4VSensitiveDetector.cc,v 1.1.8.1.2.1 1999/12/07 20:47:45 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
// G4VSensitiveDetector
|
||||
#include "G4VSensitiveDetector.hh"
|
||||
@@ -16,7 +16,7 @@ G4VSensitiveDetector::G4VSensitiveDetector(G4String name)
|
||||
:verboseLevel(0),active(true),ROgeometry(NULL)
|
||||
{
|
||||
size_t sLast = name.last('/');
|
||||
if(sLast==RW_NPOS)
|
||||
if(sLast==G4std::string::npos)
|
||||
{ // detector name only
|
||||
SensitiveDetectorName = name;
|
||||
thePathName = "/";
|
||||
|
||||
@@ -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: G4DCofThisEvent.hh,v 1.1 1999/01/07 16:06:28 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
// $Id: G4DCofThisEvent.hh,v 1.2.2.1.2.1 1999/12/07 20:47:46 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
|
||||
#ifndef G4DCofThisEvent_h
|
||||
@@ -15,7 +15,18 @@
|
||||
#include "globals.hh"
|
||||
#include "G4Allocator.hh"
|
||||
#include "G4VDigiCollection.hh"
|
||||
#include <rw/tpordvec.h>
|
||||
#include "g4rw/tpordvec.h"
|
||||
|
||||
// class description:
|
||||
//
|
||||
// This is a class which stores digi collections generated at one event.
|
||||
// This class is exclusively constructed by G4DigiManager when the first
|
||||
// digi collection of an event is passed to the manager, and this class
|
||||
// object is deleted by G4RunManager when a G4Event class object is deleted.
|
||||
// Almost all public methods must be used by Geant4 kernel classes and
|
||||
// the user should not invoke them. The user can use two const methods,
|
||||
// GetDC() and GetNumberOfCollections() for accessing to the stored digi
|
||||
// collection(s).
|
||||
|
||||
class G4DCofThisEvent
|
||||
{
|
||||
@@ -29,15 +40,16 @@ class G4DCofThisEvent
|
||||
void AddDigiCollection(G4int DCID,G4VDigiCollection * aDC);
|
||||
|
||||
private:
|
||||
RWTPtrOrderedVector<G4VDigiCollection> * DC;
|
||||
G4RWTPtrOrderedVector<G4VDigiCollection> * DC;
|
||||
|
||||
public:
|
||||
public: // with description
|
||||
inline G4VDigiCollection* GetDC(G4int i) const
|
||||
{ return (*DC)[i]; }
|
||||
inline G4int GetCapacity() const
|
||||
{
|
||||
return DC->entries();
|
||||
}
|
||||
// Returns a pointer to a digi collection. Null will be returned
|
||||
// if the particular collection is not stored at the current event.
|
||||
// The integer argument is ID number which is assigned by G4DigiManager
|
||||
// and the number can be obtained by G4DigiManager::GetDigiCollectionID()
|
||||
// method.
|
||||
inline G4int GetNumberOfCollections() const
|
||||
{
|
||||
G4int n = 0;
|
||||
@@ -47,6 +59,13 @@ class G4DCofThisEvent
|
||||
}
|
||||
return n;
|
||||
}
|
||||
// Returns the number of digi collections which are stored in this class
|
||||
// object.
|
||||
public:
|
||||
inline G4int GetCapacity() const
|
||||
{
|
||||
return DC->entries();
|
||||
}
|
||||
};
|
||||
|
||||
extern G4Allocator<G4DCofThisEvent> anDCoTHAllocator;
|
||||
|
||||
@@ -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: G4TDigiCollection.hh,v 1.1 1999/01/07 16:06:28 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
// $Id: G4TDigiCollection.hh,v 1.5.2.1.2.1 1999/12/07 20:47:46 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
|
||||
#ifndef G4TDigiCollection_h
|
||||
@@ -15,7 +15,17 @@
|
||||
#include "G4VDigiCollection.hh"
|
||||
#include "G4Allocator.hh"
|
||||
#include "globals.hh"
|
||||
#include <rw/tpordvec.h>
|
||||
#include "g4rw/tpordvec.h"
|
||||
|
||||
// class description:
|
||||
//
|
||||
// This is a template class of digi collection and parametrized by
|
||||
// The concrete class of G4VDigi. This is a uniform collection for
|
||||
// a particular concrete digi class objects.
|
||||
// An intermediate layer class G4DigiCollection appeared in this
|
||||
// header file is used just for G4Allocator, because G4Allocator
|
||||
// cannot be instansiated with a template class. Thus G4DigiCollection
|
||||
// class MUST NOT be directly used by the user.
|
||||
|
||||
class G4DigiCollection : public G4VDigiCollection
|
||||
{
|
||||
@@ -35,28 +45,44 @@ template <class T> class G4TDigiCollection : public G4DigiCollection
|
||||
{
|
||||
public:
|
||||
G4TDigiCollection();
|
||||
public: // with description
|
||||
G4TDigiCollection(G4String detName,G4String colNam);
|
||||
// Constructor.
|
||||
public:
|
||||
virtual ~G4TDigiCollection();
|
||||
int operator==(const G4TDigiCollection &right) const;
|
||||
|
||||
inline void *operator new(size_t);
|
||||
inline void operator delete(void* aDC);
|
||||
|
||||
public: // with description
|
||||
virtual void DrawAllDigi();
|
||||
virtual void PrintAllDigi();
|
||||
// These two methods invokes Draw() and Print() methods of all of
|
||||
// digit objects stored in this collection, respectively.
|
||||
|
||||
public:
|
||||
inline T* operator[](size_t i)
|
||||
{ return (*((RWTPtrOrderedVector<T>*)theCollection))[i]; }
|
||||
inline RWTPtrOrderedVector<T>* GetVector()
|
||||
{ return (RWTPtrOrderedVector<T>*)theCollection; }
|
||||
public: // with description
|
||||
inline T* operator[](size_t i) const
|
||||
{ return (*((G4RWTPtrOrderedVector<T>*)theCollection))[i]; }
|
||||
// Returns a pointer to a concrete digi object.
|
||||
inline G4RWTPtrOrderedVector<T>* GetVector() const
|
||||
{ return (G4RWTPtrOrderedVector<T>*)theCollection; }
|
||||
// Returns a collection vector.
|
||||
inline int insert(T* aHit)
|
||||
{
|
||||
RWTPtrOrderedVector<T>*theDigiCollection
|
||||
= (RWTPtrOrderedVector<T>*)theCollection;
|
||||
G4RWTPtrOrderedVector<T>*theDigiCollection
|
||||
= (G4RWTPtrOrderedVector<T>*)theCollection;
|
||||
theDigiCollection->insert(aHit);
|
||||
return theDigiCollection->entries();
|
||||
}
|
||||
// Insert a digi object. Total number of digi objects stored in this
|
||||
// collection is returned.
|
||||
inline int entries() const
|
||||
{
|
||||
G4RWTPtrOrderedVector<T>*theDigiCollection
|
||||
= (G4RWTPtrOrderedVector<T>*)theCollection;
|
||||
return theDigiCollection->entries();
|
||||
}
|
||||
// Returns the number of digi objcets stored in this collection.
|
||||
};
|
||||
|
||||
template <class T> inline void* G4TDigiCollection<T>::operator new(size_t)
|
||||
@@ -73,23 +99,23 @@ template <class T> inline void G4TDigiCollection<T>::operator delete(void* aDC)
|
||||
|
||||
template <class T> G4TDigiCollection<T>::G4TDigiCollection()
|
||||
{
|
||||
RWTPtrOrderedVector<T> * theDigiCollection
|
||||
= new RWTPtrOrderedVector<T>;
|
||||
G4RWTPtrOrderedVector<T> * theDigiCollection
|
||||
= new G4RWTPtrOrderedVector<T>;
|
||||
theCollection = (void*)theDigiCollection;
|
||||
}
|
||||
|
||||
template <class T> G4TDigiCollection<T>::G4TDigiCollection(G4String detName,G4String colNam)
|
||||
: G4DigiCollection(detName,colNam)
|
||||
{
|
||||
RWTPtrOrderedVector<T> * theDigiCollection
|
||||
= new RWTPtrOrderedVector<T>;
|
||||
G4RWTPtrOrderedVector<T> * theDigiCollection
|
||||
= new G4RWTPtrOrderedVector<T>;
|
||||
theCollection = (void*)theDigiCollection;
|
||||
}
|
||||
|
||||
template <class T> G4TDigiCollection<T>::~G4TDigiCollection()
|
||||
{
|
||||
RWTPtrOrderedVector<T> * theDigiCollection
|
||||
= (RWTPtrOrderedVector<T>*)theCollection;
|
||||
G4RWTPtrOrderedVector<T> * theDigiCollection
|
||||
= (G4RWTPtrOrderedVector<T>*)theCollection;
|
||||
theDigiCollection->clearAndDestroy();
|
||||
delete theDigiCollection;
|
||||
}
|
||||
@@ -97,19 +123,19 @@ template <class T> G4TDigiCollection<T>::~G4TDigiCollection()
|
||||
template <class T> int G4TDigiCollection<T>::operator==(const G4TDigiCollection<T> &right) const
|
||||
{ return (collectionName==right.collectionName); }
|
||||
|
||||
template <class T> void G4TDigiCollection<T>::DrawAllDigi()
|
||||
template <class T> void G4TDigiCollection<T>::DrawAllDigi()
|
||||
{
|
||||
RWTPtrOrderedVector<T> * theDigiCollection
|
||||
= (RWTPtrOrderedVector<T>*)theCollection;
|
||||
G4RWTPtrOrderedVector<T> * theDigiCollection
|
||||
= (G4RWTPtrOrderedVector<T>*)theCollection;
|
||||
int n = theDigiCollection->entries();
|
||||
for(int i=0;i<n;i++)
|
||||
{ (*theDigiCollection)[i]->Draw(); }
|
||||
}
|
||||
|
||||
template <class T> void G4TDigiCollection<T>::PrintAllDigi()
|
||||
template <class T> void G4TDigiCollection<T>::PrintAllDigi()
|
||||
{
|
||||
RWTPtrOrderedVector<T> * theDigiCollection
|
||||
= (RWTPtrOrderedVector<T>*)theCollection;
|
||||
G4RWTPtrOrderedVector<T> * theDigiCollection
|
||||
= (G4RWTPtrOrderedVector<T>*)theCollection;
|
||||
int n = theDigiCollection->entries();
|
||||
for(int i=0;i<n;i++)
|
||||
{ (*theDigiCollection)[i]->Print(); }
|
||||
|
||||
@@ -1,17 +1,25 @@
|
||||
// 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: G4VDigi.hh,v 1.1 1999/01/07 16:06:28 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
// $Id: G4VDigi.hh,v 1.4.4.1 1999/12/07 20:47:46 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
|
||||
#ifndef G4VDigi_h
|
||||
#define G4VDigi_h 1
|
||||
|
||||
// class description:
|
||||
//
|
||||
// This is the base class of digi object. The user should derive this
|
||||
// base class to make his/her own digi class. Two virtual method Draw()
|
||||
// and Print() can be implemented if the user wants these functionarities.
|
||||
// If a concrete digi class is used as a transient class, G4Allocator
|
||||
// must be used.
|
||||
|
||||
class G4VDigi
|
||||
{
|
||||
|
||||
|
||||
@@ -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: G4VDigiCollection.hh,v 1.1 1999/01/07 16:06:28 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
// $Id: G4VDigiCollection.hh,v 1.4.4.1 1999/12/07 20:47:46 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
|
||||
#ifndef G4VDigiCollection_h
|
||||
@@ -14,6 +14,15 @@
|
||||
|
||||
#include "globals.hh"
|
||||
|
||||
// class description:
|
||||
//
|
||||
// This is the base class of digi collection. The user is advised to
|
||||
// use G4TDigiCollection template class in case his/her collection is
|
||||
// transient. While, in case the collection is persistent with ODBMS,
|
||||
// the concrete collection class can be directly derived from this
|
||||
// class.
|
||||
// Geant4 kernel will use this class methods.
|
||||
|
||||
class G4VDigiCollection
|
||||
{
|
||||
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: G4DCofThisEvent.cc,v 1.1 1999/01/07 16:06:29 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
// $Id: G4DCofThisEvent.cc,v 1.1.8.1.2.1 1999/12/07 20:47:47 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
|
||||
#include "G4DCofThisEvent.hh"
|
||||
@@ -15,12 +15,12 @@ G4Allocator<G4DCofThisEvent> anDCoTHAllocator;
|
||||
|
||||
G4DCofThisEvent::G4DCofThisEvent()
|
||||
{
|
||||
DC = new RWTPtrOrderedVector<G4VDigiCollection>;
|
||||
DC = new G4RWTPtrOrderedVector<G4VDigiCollection>;
|
||||
}
|
||||
|
||||
G4DCofThisEvent::G4DCofThisEvent(G4int cap)
|
||||
{
|
||||
DC = new RWTPtrOrderedVector<G4VDigiCollection>;
|
||||
DC = new G4RWTPtrOrderedVector<G4VDigiCollection>;
|
||||
for(int i=0;i<cap;i++)
|
||||
{
|
||||
DC->insert((G4VDigiCollection*)NULL);
|
||||
|
||||
@@ -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: G4TDigiCollection.cc,v 1.1 1999/01/07 16:06:29 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
// $Id: G4TDigiCollection.cc,v 1.1.10.1 1999/12/07 20:47:47 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
|
||||
#include "G4TDigiCollection.hh"
|
||||
|
||||
@@ -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: G4VDigi.cc,v 1.1 1999/01/07 16:06:29 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
// $Id: G4VDigi.cc,v 1.3.4.1 1999/12/07 20:47:47 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
|
||||
// G4VDigi
|
||||
@@ -22,9 +22,9 @@ G4VDigi::~G4VDigi()
|
||||
int G4VDigi::operator==(const G4VDigi &right) const
|
||||
{ return false; }
|
||||
|
||||
void G4VDigi::Draw()
|
||||
void G4VDigi::Draw()
|
||||
{;}
|
||||
|
||||
void G4VDigi::Print()
|
||||
void G4VDigi::Print()
|
||||
{;}
|
||||
|
||||
|
||||
@@ -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: G4VDigiCollection.cc,v 1.1 1999/01/07 16:06:29 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
// $Id: G4VDigiCollection.cc,v 1.3.4.1 1999/12/07 20:47:47 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
|
||||
// G4VDigiCollection
|
||||
@@ -34,9 +34,9 @@ int G4VDigiCollection::operator==(const G4VDigiCollection &right) const
|
||||
&&(DMname==right.DMname));
|
||||
}
|
||||
|
||||
void G4VDigiCollection::DrawAllDigi()
|
||||
void G4VDigiCollection::DrawAllDigi()
|
||||
{;}
|
||||
|
||||
void G4VDigiCollection::PrintAllDigi()
|
||||
void G4VDigiCollection::PrintAllDigi()
|
||||
{;}
|
||||
|
||||
|
||||
@@ -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: G4HCofThisEvent.hh,v 1.1 1999/01/07 16:06:30 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
// $Id: G4HCofThisEvent.hh,v 1.2.2.1.2.1 1999/12/07 20:47:47 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
|
||||
#ifndef G4HCofThisEvent_h
|
||||
@@ -15,7 +15,18 @@
|
||||
#include "globals.hh"
|
||||
#include "G4Allocator.hh"
|
||||
#include "G4VHitsCollection.hh"
|
||||
#include <rw/tpordvec.h>
|
||||
#include "g4rw/tpordvec.h"
|
||||
|
||||
// class description:
|
||||
//
|
||||
// This is a class which stores hits collections generated at one event.
|
||||
// This class is exclusively constructed by G4SDManager when the first
|
||||
// hits collection of an event is passed to the manager, and this class
|
||||
// object is deleted by G4RunManager when a G4Event class object is deleted.
|
||||
// Almost all public methods must be used by Geant4 kernel classes and
|
||||
// the user should not invoke them. The user can use two const methods,
|
||||
// GetHC() and GetNumberOfCollections() for accessing to the stored hits
|
||||
// collection(s).
|
||||
|
||||
class G4HCofThisEvent
|
||||
{
|
||||
@@ -29,15 +40,16 @@ class G4HCofThisEvent
|
||||
void AddHitsCollection(G4int HCID,G4VHitsCollection * aHC);
|
||||
|
||||
private:
|
||||
RWTPtrOrderedVector<G4VHitsCollection> * HC;
|
||||
G4RWTPtrOrderedVector<G4VHitsCollection> * HC;
|
||||
|
||||
public:
|
||||
public: // with description
|
||||
inline G4VHitsCollection* GetHC(G4int i)
|
||||
{ return (*HC)[i]; }
|
||||
inline G4int GetCapacity()
|
||||
{
|
||||
return HC->entries();
|
||||
}
|
||||
// Returns a pointer to a hits collection. Null will be returned
|
||||
// if the particular collection is not stored at the current event.
|
||||
// The integer argument is ID number which is assigned by G4SDManager
|
||||
// and the number can be obtained by G4SDManager::GetHitsCollectionID()
|
||||
// method.
|
||||
inline G4int GetNumberOfCollections()
|
||||
{
|
||||
G4int n = 0;
|
||||
@@ -47,6 +59,13 @@ class G4HCofThisEvent
|
||||
}
|
||||
return n;
|
||||
}
|
||||
// Returns the number of hits collections which are stored in this class
|
||||
// object.
|
||||
public:
|
||||
inline G4int GetCapacity()
|
||||
{
|
||||
return HC->entries();
|
||||
}
|
||||
};
|
||||
|
||||
extern G4Allocator<G4HCofThisEvent> anHCoTHAllocator;
|
||||
|
||||
@@ -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: G4THitsCollection.hh,v 1.1 1999/01/07 16:06:30 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
// $Id: G4THitsCollection.hh,v 1.4.2.1.2.1 1999/12/07 20:47:47 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
|
||||
#ifndef G4THitsCollection_h
|
||||
@@ -15,7 +15,17 @@
|
||||
#include "G4VHitsCollection.hh"
|
||||
#include "G4Allocator.hh"
|
||||
#include "globals.hh"
|
||||
#include <rw/tpordvec.h>
|
||||
#include "g4rw/tpordvec.h"
|
||||
|
||||
// class description:
|
||||
//
|
||||
// This is a template class of hits collection and parametrized by
|
||||
// The concrete class of G4VHit. This is a uniform collection for
|
||||
// a particular concrete hit class objects.
|
||||
// An intermediate layer class G4HitsCollection appeared in this
|
||||
// header file is used just for G4Allocator, because G4Allocator
|
||||
// cannot be instansiated with a template class. Thus G4HitsCollection
|
||||
// class MUST NOT be directly used by the user.
|
||||
|
||||
class G4HitsCollection : public G4VHitsCollection
|
||||
{
|
||||
@@ -35,34 +45,44 @@ template <class T> class G4THitsCollection : public G4HitsCollection
|
||||
{
|
||||
public:
|
||||
G4THitsCollection();
|
||||
public: // with description
|
||||
G4THitsCollection(G4String detName,G4String colNam);
|
||||
// constructor.
|
||||
public:
|
||||
virtual ~G4THitsCollection();
|
||||
int operator==(const G4THitsCollection<T> &right) const;
|
||||
|
||||
inline void *operator new(size_t);
|
||||
inline void operator delete(void* anHC);
|
||||
|
||||
public: // with description
|
||||
virtual void DrawAllHits();
|
||||
virtual void PrintAllHits();
|
||||
// These two methods invokes Draw() and Print() methods of all of
|
||||
// hit objects stored in this collection, respectively.
|
||||
|
||||
public:
|
||||
inline T* operator[](size_t i)
|
||||
{ return (*((RWTPtrOrderedVector<T>*)theCollection))[i]; }
|
||||
inline RWTPtrOrderedVector<T>* GetVector()
|
||||
{ return (RWTPtrOrderedVector<T>*)theCollection; }
|
||||
public: // with description
|
||||
inline T* operator[](size_t i) const
|
||||
{ return (*((G4RWTPtrOrderedVector<T>*)theCollection))[i]; }
|
||||
// Returns a pointer to a concrete hit object.
|
||||
inline G4RWTPtrOrderedVector<T>* GetVector() const
|
||||
{ return (G4RWTPtrOrderedVector<T>*)theCollection; }
|
||||
// Returns a collection vector.
|
||||
inline int insert(T* aHit)
|
||||
{
|
||||
RWTPtrOrderedVector<T>*theHitsCollection
|
||||
= (RWTPtrOrderedVector<T>*)theCollection;
|
||||
G4RWTPtrOrderedVector<T>*theHitsCollection
|
||||
= (G4RWTPtrOrderedVector<T>*)theCollection;
|
||||
theHitsCollection->insert(aHit);
|
||||
return theHitsCollection->entries();
|
||||
}
|
||||
inline int entries()
|
||||
// Insert a hit object. Total number of hit objects stored in this
|
||||
// collection is returned.
|
||||
inline int entries() const
|
||||
{
|
||||
RWTPtrOrderedVector<T>*theHitsCollection
|
||||
= (RWTPtrOrderedVector<T>*)theCollection;
|
||||
G4RWTPtrOrderedVector<T>*theHitsCollection
|
||||
= (G4RWTPtrOrderedVector<T>*)theCollection;
|
||||
return theHitsCollection->entries();
|
||||
}
|
||||
// Returns the number of hit objects stored in this collection
|
||||
|
||||
};
|
||||
|
||||
@@ -80,23 +100,23 @@ template <class T> inline void G4THitsCollection<T>::operator delete(void* anHC)
|
||||
|
||||
template <class T> G4THitsCollection<T>::G4THitsCollection()
|
||||
{
|
||||
RWTPtrOrderedVector<T> * theHitsCollection
|
||||
= new RWTPtrOrderedVector<T>;
|
||||
G4RWTPtrOrderedVector<T> * theHitsCollection
|
||||
= new G4RWTPtrOrderedVector<T>;
|
||||
theCollection = (void*)theHitsCollection;
|
||||
}
|
||||
|
||||
template <class T> G4THitsCollection<T>::G4THitsCollection(G4String detName,G4String colNam)
|
||||
: G4HitsCollection(detName,colNam)
|
||||
{
|
||||
RWTPtrOrderedVector<T> * theHitsCollection
|
||||
= new RWTPtrOrderedVector<T>;
|
||||
G4RWTPtrOrderedVector<T> * theHitsCollection
|
||||
= new G4RWTPtrOrderedVector<T>;
|
||||
theCollection = (void*)theHitsCollection;
|
||||
}
|
||||
|
||||
template <class T> G4THitsCollection<T>::~G4THitsCollection()
|
||||
{
|
||||
RWTPtrOrderedVector<T> * theHitsCollection
|
||||
= (RWTPtrOrderedVector<T>*)theCollection;
|
||||
G4RWTPtrOrderedVector<T> * theHitsCollection
|
||||
= (G4RWTPtrOrderedVector<T>*)theCollection;
|
||||
theHitsCollection->clearAndDestroy();
|
||||
delete theHitsCollection;
|
||||
}
|
||||
@@ -104,19 +124,19 @@ template <class T> G4THitsCollection<T>::~G4THitsCollection()
|
||||
template <class T> int G4THitsCollection<T>::operator==(const G4THitsCollection<T> &right) const
|
||||
{ return (collectionName==right.collectionName); }
|
||||
|
||||
template <class T> void G4THitsCollection<T>::DrawAllHits()
|
||||
template <class T> void G4THitsCollection<T>::DrawAllHits()
|
||||
{
|
||||
RWTPtrOrderedVector<T> * theHitsCollection
|
||||
= (RWTPtrOrderedVector<T>*)theCollection;
|
||||
G4RWTPtrOrderedVector<T> * theHitsCollection
|
||||
= (G4RWTPtrOrderedVector<T>*)theCollection;
|
||||
int n = theHitsCollection->entries();
|
||||
for(int i=0;i<n;i++)
|
||||
{ (*theHitsCollection)[i]->Draw(); }
|
||||
}
|
||||
|
||||
template <class T> void G4THitsCollection<T>::PrintAllHits()
|
||||
template <class T> void G4THitsCollection<T>::PrintAllHits()
|
||||
{
|
||||
RWTPtrOrderedVector<T> * theHitsCollection
|
||||
= (RWTPtrOrderedVector<T>*)theCollection;
|
||||
G4RWTPtrOrderedVector<T> * theHitsCollection
|
||||
= (G4RWTPtrOrderedVector<T>*)theCollection;
|
||||
int n = theHitsCollection->entries();
|
||||
for(int i=0;i<n;i++)
|
||||
{ (*theHitsCollection)[i]->Print(); }
|
||||
|
||||
@@ -1,17 +1,25 @@
|
||||
// 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: G4VHit.hh,v 1.1 1999/01/07 16:06:30 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
// $Id: G4VHit.hh,v 1.3.4.1 1999/12/07 20:47:48 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
|
||||
#ifndef G4VHit_h
|
||||
#define G4VHit_h 1
|
||||
|
||||
// class description:
|
||||
//
|
||||
// This is the base class of hit object. The user should derive this
|
||||
// base class to make his/her own hit class. Two virtual method Draw()
|
||||
// and Print() can be implemented if the user wants these functionarities.
|
||||
// If a concrete hit class is used as a transient class, G4Allocator
|
||||
// must be used.
|
||||
|
||||
class G4VHit
|
||||
{
|
||||
|
||||
|
||||
@@ -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: G4VHitsCollection.hh,v 1.1 1999/01/07 16:06:30 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
// $Id: G4VHitsCollection.hh,v 1.3.4.1 1999/12/07 20:47:48 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
|
||||
#ifndef G4VHitsCollection_h
|
||||
@@ -14,6 +14,15 @@
|
||||
|
||||
#include "globals.hh"
|
||||
|
||||
// class description:
|
||||
//
|
||||
// This is the base class of hits collection. The user is advised to
|
||||
// use G4THitsCollection template class in case his/her collection is
|
||||
// transient. While, in case the collection is persistent with ODBMS,
|
||||
// the concrete collection class can be directly derived from this
|
||||
// class.
|
||||
// Geant4 kernel will use this class methods.
|
||||
|
||||
class G4VHitsCollection
|
||||
{
|
||||
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: G4HCofThisEvent.cc,v 1.1 1999/01/07 16:06:31 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
// $Id: G4HCofThisEvent.cc,v 1.1.8.1.2.1 1999/12/07 20:47:48 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
|
||||
#include "G4HCofThisEvent.hh"
|
||||
@@ -15,12 +15,12 @@ G4Allocator<G4HCofThisEvent> anHCoTHAllocator;
|
||||
|
||||
G4HCofThisEvent::G4HCofThisEvent()
|
||||
{
|
||||
HC = new RWTPtrOrderedVector<G4VHitsCollection>;
|
||||
HC = new G4RWTPtrOrderedVector<G4VHitsCollection>;
|
||||
}
|
||||
|
||||
G4HCofThisEvent::G4HCofThisEvent(G4int cap)
|
||||
{
|
||||
HC = new RWTPtrOrderedVector<G4VHitsCollection>;
|
||||
HC = new G4RWTPtrOrderedVector<G4VHitsCollection>;
|
||||
for(int i=0;i<cap;i++)
|
||||
{
|
||||
HC->insert((G4VHitsCollection*)NULL);
|
||||
|
||||
@@ -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: G4THitsCollection.cc,v 1.1 1999/01/07 16:06:31 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
// $Id: G4THitsCollection.cc,v 1.1.10.1 1999/12/07 20:47:48 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
|
||||
#include "G4THitsCollection.hh"
|
||||
|
||||
@@ -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: G4VHit.cc,v 1.1 1999/01/07 16:06:31 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
// $Id: G4VHit.cc,v 1.1.10.1 1999/12/07 20:47:48 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
|
||||
// G4VHit
|
||||
|
||||
@@ -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: G4VHitsCollection.cc,v 1.1 1999/01/07 16:06:31 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
// $Id: G4VHitsCollection.cc,v 1.1.10.1 1999/12/07 20:47:49 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
|
||||
// G4VHitsCollection
|
||||
|
||||
Reference in New Issue
Block a user