Import Geant4 0.0.0 source tree
This commit is contained in:
@@ -0,0 +1,67 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 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 2.2 1998/10/26 01:53:21 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
|
||||
#ifndef G4DCofThisEvent_h
|
||||
#define G4DCofThisEvent_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4Allocator.hh"
|
||||
#include "G4VDigiCollection.hh"
|
||||
#include <rw/tpordvec.h>
|
||||
|
||||
class G4DCofThisEvent
|
||||
{
|
||||
public:
|
||||
G4DCofThisEvent();
|
||||
G4DCofThisEvent(G4int cap);
|
||||
~G4DCofThisEvent();
|
||||
inline void *operator new(size_t);
|
||||
inline void operator delete(void* anDCoTE);
|
||||
|
||||
void AddDigiCollection(G4int DCID,G4VDigiCollection * aDC);
|
||||
|
||||
private:
|
||||
RWTPtrOrderedVector<G4VDigiCollection> * DC;
|
||||
|
||||
public:
|
||||
inline G4VDigiCollection* GetDC(G4int i) const
|
||||
{ return (*DC)[i]; }
|
||||
inline G4int GetCapacity() const
|
||||
{
|
||||
return DC->entries();
|
||||
}
|
||||
inline G4int GetNumberOfCollections() const
|
||||
{
|
||||
G4int n = 0;
|
||||
for(int i=0;i<DC->entries();i++)
|
||||
{
|
||||
if((*DC)[i]) n++;
|
||||
}
|
||||
return n;
|
||||
}
|
||||
};
|
||||
|
||||
extern G4Allocator<G4DCofThisEvent> anDCoTHAllocator;
|
||||
|
||||
inline void* G4DCofThisEvent::operator new(size_t)
|
||||
{
|
||||
void* anDCoTH;
|
||||
anDCoTH = (void*)anDCoTHAllocator.MallocSingle();
|
||||
return anDCoTH;
|
||||
}
|
||||
|
||||
inline void G4DCofThisEvent::operator delete(void* anDCoTH)
|
||||
{
|
||||
anDCoTHAllocator.FreeSingle((G4DCofThisEvent*)anDCoTH);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,119 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 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 2.1 1998/07/12 02:53:35 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
|
||||
#ifndef G4TDigiCollection_h
|
||||
#define G4TDigiCollection_h 1
|
||||
|
||||
#include "G4VDigiCollection.hh"
|
||||
#include "G4Allocator.hh"
|
||||
#include "globals.hh"
|
||||
#include <rw/tpordvec.h>
|
||||
|
||||
class G4DigiCollection : public G4VDigiCollection
|
||||
{
|
||||
public:
|
||||
G4DigiCollection();
|
||||
G4DigiCollection(G4String detName,G4String colNam);
|
||||
virtual ~G4DigiCollection();
|
||||
int operator==(const G4DigiCollection &right) const;
|
||||
|
||||
protected:
|
||||
void* theCollection;
|
||||
};
|
||||
|
||||
extern G4Allocator<G4DigiCollection> aDCAllocator;
|
||||
|
||||
template <class T> class G4TDigiCollection : public G4DigiCollection
|
||||
{
|
||||
public:
|
||||
G4TDigiCollection();
|
||||
G4TDigiCollection(G4String detName,G4String colNam);
|
||||
virtual ~G4TDigiCollection();
|
||||
int operator==(const G4TDigiCollection &right) const;
|
||||
|
||||
inline void *operator new(size_t);
|
||||
inline void operator delete(void* aDC);
|
||||
|
||||
virtual void DrawAllDigi();
|
||||
virtual void PrintAllDigi();
|
||||
|
||||
public:
|
||||
inline T* operator[](size_t i)
|
||||
{ return (*((RWTPtrOrderedVector<T>*)theCollection))[i]; }
|
||||
inline RWTPtrOrderedVector<T>* GetVector()
|
||||
{ return (RWTPtrOrderedVector<T>*)theCollection; }
|
||||
inline int insert(T* aHit)
|
||||
{
|
||||
RWTPtrOrderedVector<T>*theDigiCollection
|
||||
= (RWTPtrOrderedVector<T>*)theCollection;
|
||||
theDigiCollection->insert(aHit);
|
||||
return theDigiCollection->entries();
|
||||
}
|
||||
};
|
||||
|
||||
template <class T> inline void* G4TDigiCollection<T>::operator new(size_t)
|
||||
{
|
||||
void* aDC;
|
||||
aDC = (void*)aDCAllocator.MallocSingle();
|
||||
return aDC;
|
||||
}
|
||||
|
||||
template <class T> inline void G4TDigiCollection<T>::operator delete(void* aDC)
|
||||
{
|
||||
aDCAllocator.FreeSingle((G4DigiCollection*)aDC);
|
||||
}
|
||||
|
||||
template <class T> G4TDigiCollection<T>::G4TDigiCollection()
|
||||
{
|
||||
RWTPtrOrderedVector<T> * theDigiCollection
|
||||
= new RWTPtrOrderedVector<T>;
|
||||
theCollection = (void*)theDigiCollection;
|
||||
}
|
||||
|
||||
template <class T> G4TDigiCollection<T>::G4TDigiCollection(G4String detName,G4String colNam)
|
||||
: G4DigiCollection(detName,colNam)
|
||||
{
|
||||
RWTPtrOrderedVector<T> * theDigiCollection
|
||||
= new RWTPtrOrderedVector<T>;
|
||||
theCollection = (void*)theDigiCollection;
|
||||
}
|
||||
|
||||
template <class T> G4TDigiCollection<T>::~G4TDigiCollection()
|
||||
{
|
||||
RWTPtrOrderedVector<T> * theDigiCollection
|
||||
= (RWTPtrOrderedVector<T>*)theCollection;
|
||||
theDigiCollection->clearAndDestroy();
|
||||
delete theDigiCollection;
|
||||
}
|
||||
|
||||
template <class T> int G4TDigiCollection<T>::operator==(const G4TDigiCollection<T> &right) const
|
||||
{ return (collectionName==right.collectionName); }
|
||||
|
||||
template <class T> void G4TDigiCollection<T>::DrawAllDigi()
|
||||
{
|
||||
RWTPtrOrderedVector<T> * theDigiCollection
|
||||
= (RWTPtrOrderedVector<T>*)theCollection;
|
||||
int n = theDigiCollection->entries();
|
||||
for(int i=0;i<n;i++)
|
||||
{ (*theDigiCollection)[i]->Draw(); }
|
||||
}
|
||||
|
||||
template <class T> void G4TDigiCollection<T>::PrintAllDigi()
|
||||
{
|
||||
RWTPtrOrderedVector<T> * theDigiCollection
|
||||
= (RWTPtrOrderedVector<T>*)theCollection;
|
||||
int n = theDigiCollection->entries();
|
||||
for(int i=0;i<n;i++)
|
||||
{ (*theDigiCollection)[i]->Print(); }
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 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 2.1 1998/07/12 02:53:36 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
|
||||
#ifndef G4VDigi_h
|
||||
#define G4VDigi_h 1
|
||||
|
||||
class G4VDigi
|
||||
{
|
||||
|
||||
public:
|
||||
G4VDigi();
|
||||
virtual ~G4VDigi();
|
||||
|
||||
int operator==(const G4VDigi &right) const;
|
||||
|
||||
virtual void Draw();
|
||||
virtual void Print();
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 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 2.1 1998/07/12 02:53:37 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
|
||||
#ifndef G4VDigiCollection_h
|
||||
#define G4VDigiCollection_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
|
||||
class G4VDigiCollection
|
||||
{
|
||||
public:
|
||||
G4VDigiCollection();
|
||||
G4VDigiCollection(G4String DMnam,G4String colNam);
|
||||
virtual ~G4VDigiCollection();
|
||||
int operator==(const G4VDigiCollection &right) const;
|
||||
|
||||
virtual void DrawAllDigi();
|
||||
virtual void PrintAllDigi();
|
||||
|
||||
protected:
|
||||
|
||||
// Collection name
|
||||
G4String collectionName;
|
||||
G4String DMname;
|
||||
|
||||
public:
|
||||
inline G4String GetName()
|
||||
{ return collectionName; };
|
||||
inline G4String GetDMname()
|
||||
{ return DMname; };
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user