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: 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:
|
||||
|
||||
Reference in New Issue
Block a user