Import Geant4 1.0.0 source tree
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user