Import Geant4 0.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-01 15:25:35 +02:00
parent 54d6b71f95
commit b97f8d0df7
3237 changed files with 807095 additions and 0 deletions
+15
View File
@@ -0,0 +1,15 @@
# $Id: GNUmakefile,v 2.0 1998/07/02 16:15:33 gunter Exp $
# --------------------------------------------------------------
# GNUmakefile for digits+hits library. Makoto Asai, 1/11/96.
# --------------------------------------------------------------
name := G4digits+hits
SUBDIRS := detector hits digits
SUBLIBS = G4detector G4digits G4hits
ifndef G4INSTALL
G4INSTALL = ../..
endif
include $(G4INSTALL)/config/globlib.gmk
+57
View File
@@ -0,0 +1,57 @@
$Id: History,v 2.3 1998/10/26 01:52:40 asaim Exp $
-------------------------------------------------------------------
=========================================================
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
=========================================================
Category History file
---------------------
This file should be used by G4 developers and category coordinators
to briefly summarize all major modifications introduced in the code
and keep track of all category-tags.
It DOES NOT substitute the CVS log-message one should put at every
committal in the CVS repository !
----------------------------------------------------------
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
Oct 26, 98 M.Asai (tag digits+hits-00-03-01)
- Debugged in G4HCofThisEvent.hh and G4DCofThisEvent.hh
July 15, 98 M.Asai (tag digits+hits-00-01-02)
- Modify some UI command definitions.
July 4, 98 M.Asai (tag digits+hits-00-01-01)
- Ready for the beta release.
July 1, 98 M.Asai (tag digits+hits-00-07-02)
- G4TDigiCollection has been debugged.
June 30, 98 M.Asai (tag digits+hits-00-07-01)
- Introduce G4Allocator for G4HCofThisEvent, G4DCofThisEvent,
G4HitsCollection, G4DigiCollection.
- New template classes G4THitsCollection and G4TDigiCollection
- New base class protected method in G4VSensitiveDetector
- Corrections in G4VReadoutGeometry
June 11, 98 G.Cosmo (digits+hits-00-06-02)
- Removed CR characters from G4HCtable.hh, .cc (P.Urban)
June 8, 98 M.Asai
- Tagged as digits+hits-00-06-01
June 6, 98 M.Asai
- New sub-directories (detector, hits, digits) are introduced.
- All codes which used to be in include and src directories are
moved to the newly created sub-directories.
- GNUmakefile is completely changed to catch up the new directory
structure.
April 21, 98 M.Asai
- Tagged as hits-00-05-01.
December 19, 97 G. Cosmo - (alpha03)
- Created.
+28
View File
@@ -0,0 +1,28 @@
# $Id: GNUmakefile,v 2.0 1998/07/02 16:14:54 gunter Exp $
# --------------------------------------------------------------
# GNUmakefile for digits+hits library. Makoto Asai, 1/11/96.
# --------------------------------------------------------------
name := G4detector
ifndef G4INSTALL
G4INSTALL = ../../..
endif
include $(G4INSTALL)/config/architecture.gmk
CPPFLAGS += \
-I$(G4BASE)/global/HEPRandom/include \
-I$(G4BASE)/global/management/include \
-I$(G4BASE)/global/HEPGeometry/include \
-I$(G4BASE)/track/include \
-I$(G4BASE)/processes/management/include \
-I$(G4BASE)/particles/management/include \
-I$(G4BASE)/materials/include \
-I$(G4BASE)/geometry/management/include \
-I$(G4BASE)/geometry/volumes/include \
-I$(G4BASE)/digits+hits/hits/include \
-I$(G4BASE)/intercoms/include
include $(G4INSTALL)/config/common.gmk
+21
View File
@@ -0,0 +1,21 @@
$Id: History,v 2.0 1998/07/02 16:14:40 gunter Exp $
-------------------------------------------------------------------
=========================================================
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
=========================================================
Category History file
---------------------
This file should be used by G4 developers and category coordinators
to briefly summarize all major modifications introduced in the code
and keep track of all category-tags.
It DOES NOT substitute the CVS log-message one should put at every
committal in the CVS repository !
----------------------------------------------------------
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
June 6, 98 M.Asai
- Created.
@@ -0,0 +1,39 @@
// 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: G4HCtable.hh,v 2.1 1998/07/12 02:53:17 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
//
#ifndef G4HCtable_H
#define G4HCtable_H 1
#include "globals.hh"
#include <rw/tvordvec.h>
class G4HCtable
{
public:
G4HCtable();
~G4HCtable();
public:
G4int Registor(G4String SDname,G4String HCname);
G4int GetCollectionID(G4String HCname);
private:
RWTValOrderedVector<G4String> SDlist;
RWTValOrderedVector<G4String> HClist;
public:
inline G4int entries() const
{ return HClist.entries(); }
};
#endif
@@ -0,0 +1,70 @@
// 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: G4SDManager.hh,v 2.1 1998/07/12 02:53:19 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
//
#ifndef G4SDManager_h
#define G4SDManager_h 1
#include "globals.hh"
#include "G4SDStructure.hh"
#include "G4HCtable.hh"
class G4VHitsCollection;
class G4VSensitiveDetector;
class G4HCofThisEvent;
class G4SDmessenger;
class G4SDManager
{
public:
static G4SDManager* GetSDMpointer();
static G4SDManager* GetSDMpointerIfExist();
protected:
G4SDManager();
public:
~G4SDManager();
void AddNewDetector(G4VSensitiveDetector*aSD);
G4HCofThisEvent* PrepareNewEvent();
void TerminateCurrentEvent(G4HCofThisEvent* HCE);
void Activate(G4String dName, G4bool activeFlag);
G4int GetCollectionID(G4String colName);
G4int GetCollectionID(G4VHitsCollection * aHC);
G4VSensitiveDetector* FindSensitiveDetector(G4String dName);
private:
static G4SDManager * fSDManager;
G4SDStructure * treeTop;
G4int verboseLevel;
G4HCtable* HCtable;
G4SDmessenger* theMessenger;
public:
inline void SetVerboseLevel(G4int vl)
{
verboseLevel = vl;
treeTop->SetVerboseLevel(vl);
}
inline G4SDStructure* GetTreeTop() const
{ return treeTop; }
inline void ListTree() const
{ treeTop->ListTree(); }
inline G4int GetCollectionCapacity() const
{ return HCtable->entries(); }
inline G4HCtable* GetHCtable() const
{ return HCtable; }
};
#endif
@@ -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: G4SDStructure.hh,v 2.1 1998/07/12 02:53:19 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
//
#ifndef G4SDStructure_h
#define G4SDStructure_h 1
// Globals
#include "globals.hh"
// G4VSensitiveDetector
#include "G4VSensitiveDetector.hh"
// RWTPtrOrderedVector
#include <rw/tpordvec.h>
class G4HCofThisEvent;
class G4SDStructure
{
public:
G4SDStructure(G4String aPath);
~G4SDStructure();
int operator==(const G4SDStructure &right) const;
void AddNewDetector(G4VSensitiveDetector*aSD, G4String treeStructure);
void Activate(G4String aName, G4bool sensitiveFlag);
void Initialize(G4HCofThisEvent*HCE);
void Terminate(G4HCofThisEvent*HCE);
G4VSensitiveDetector* FindSensitiveDetector(G4String aName);
G4VSensitiveDetector* GetSD(G4String aName);
void ListTree();
private:
G4SDStructure* FindSubDirectory(G4String subD);
G4String ExtractDirName(G4String aPath);
private:
RWTPtrOrderedVector<G4SDStructure> structure;
RWTPtrOrderedVector<G4VSensitiveDetector> detector;
G4String pathName;
G4String dirName;
G4int verboseLevel;
public:
inline void SetVerboseLevel(G4int vl)
{
verboseLevel = vl;
for(int i=0; i<structure.entries(); i++)
{ structure(i)->SetVerboseLevel(vl); }
for(int j=0; j<detector.entries(); j++)
{ detector(j)->SetVerboseLevel(vl); }
};
};
#endif
@@ -0,0 +1,43 @@
// 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: G4SDmessenger.hh,v 2.1 1998/07/12 02:53:20 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
//
#ifndef G4SDmessenger_h
#define G4SDmessenger_h 1
#include "G4UImessenger.hh"
class G4SDManager;
class G4UIdirectory;
class G4UIcmdWithoutParameter;
class G4UIcmdWithAString;
class G4UIcmdWithAnInteger;
class G4SDmessenger: public G4UImessenger
{
public:
G4SDmessenger(G4SDManager * SDManager);
~G4SDmessenger();
void SetNewValue(G4UIcommand * command,G4String newValues);
private:
G4SDManager * fSDMan;
G4UIdirectory* hitsDir;
G4UIcmdWithoutParameter* listCmd;
G4UIcmdWithAString* activeCmd;
G4UIcmdWithAString* inactiveCmd;
G4UIcmdWithAnInteger* verboseCmd;
};
#endif
@@ -0,0 +1,75 @@
// 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: G4SensitiveVolumeList.hh,v 2.1 1998/07/12 02:53:20 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
//
// ------------------------------------------------------------
// GEANT 4 class header file --- Copyright CERN 1996
// CERN Geneva Switzerland
//
// For information related to this code contact:
// CERN, CN Division, ASD group
// History: first implementation, based on Hits+Digi domain
// object model of April 1996, S.Piperov
//
// ---------------- G4SensitiveVolumeList -----------------
#ifndef G4SensitiveVolumeList_h
#define G4SensitiveVolumeList_h 1
#include <rw/tpordvec.h>
#include <rw/tvordvec.h>
#include "G4LogicalVolume.hh"
#include "G4VPhysicalVolume.hh"
class G4SensitiveVolumeList
{
public:
//Constructors
G4SensitiveVolumeList();
G4SensitiveVolumeList(const G4SensitiveVolumeList &right);
//Destructor
~G4SensitiveVolumeList();
//Assignment Operation
const G4SensitiveVolumeList & operator=(const G4SensitiveVolumeList &right
);
//Equality Operations
G4int operator==(const G4SensitiveVolumeList &right) const;
G4int operator!=(const G4SensitiveVolumeList &right) const;
//Other Operations
G4bool CheckPV(const G4VPhysicalVolume *pvp) const;
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 RWTPtrOrderedVector<G4LogicalVolume>& GetTheLogicalVolumeList() const;
void SetTheLogicalVolumeList(const RWTPtrOrderedVector<G4LogicalVolume> value);
private:
//Data Members for Has Relationships
RWTPtrOrderedVector<G4VPhysicalVolume> thePhysicalVolumeList;
RWTPtrOrderedVector<G4LogicalVolume> theLogicalVolumeList;
};
#endif
@@ -0,0 +1,35 @@
// 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: G4SensitiveVolumeList.icc,v 2.0 1998/07/02 16:14:33 gunter Exp $
// GEANT4 tag $Name: geant4-00 $
//
// -----------------------------------------------------------
// Inline functions of GEANT 4 class header file.
// --- Copyright CERN 1996, CERN Geneva Switzerland ---
//
// For information related to this code contact:
// CERN, CN Division, ASD group
// History: first implementation, based on Hits+Digi domain
// object model of April 1996, S.Piperov
//
// ---------------- G4SensitiveVolumeList -----------------
//Get and Set Operations for Has Relationships
inline const RWTPtrOrderedVector<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 const RWTPtrOrderedVector<G4LogicalVolume>& G4SensitiveVolumeList::get_the_G4LogicalVolume() const { return the_G4LogicalVolume_list; }
inline void G4SensitiveVolumeList::set_the_G4LogicalVolume(const RWTPtrOrderedVector<G4LogicalVolume> value) { the_G4LogicalVolume_list = value; }
@@ -0,0 +1,76 @@
// 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: G4VReadOutGeometry.hh,v 2.1 1998/07/12 02:53:20 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
//
// ------------------------------------------------------------
#ifndef G4VReadOutGeometry_h
#define G4VReadOutGeometry_h
#include "G4SensitiveVolumeList.hh"
#include "G4Step.hh"
#include "G4TouchableHistory.hh"
class G4Navigator;
class G4VReadOutGeometry
{
protected:
virtual G4VPhysicalVolume* Build() = 0; // must return the world of the ROGeometry;
public:
G4VReadOutGeometry();
G4VReadOutGeometry(const G4VReadOutGeometry &right);
G4VReadOutGeometry(G4String);
virtual ~G4VReadOutGeometry();
const G4VReadOutGeometry & operator=(const G4VReadOutGeometry &right);
G4int operator==(const G4VReadOutGeometry &right) const;
G4int operator!=(const G4VReadOutGeometry &right) const;
// buildROGeomety must be invoked to Build (ie Build() method)
// the ROGeometry. It sets up in addition the needed
// the G4Navigator used to navigate inside this ROGeometry.
void BuildROGeometry();
G4bool CheckROVolume(G4Step*,G4TouchableHistory*&);
protected:
G4bool FindROTouchable(G4Step*);
G4VPhysicalVolume* ROworld;
G4SensitiveVolumeList* fincludeList;
G4SensitiveVolumeList* fexcludeList;
G4String name;
private:
G4Navigator* ROnavigator;
G4TouchableHistory* touchableHistory;
public:
inline const G4SensitiveVolumeList* GetIncludeList() const
{ return fincludeList; }
inline void SetIncludeList(G4SensitiveVolumeList* value)
{ fincludeList = value; }
inline const G4SensitiveVolumeList* GetExcludeList() const
{ return fexcludeList; }
inline void SetExcludeList(G4SensitiveVolumeList* value)
{ fexcludeList = value; }
inline G4String GetName() const
{ return name; }
inline void SetName(G4String value)
{ name = value; }
// ADDED:
inline G4VPhysicalVolume* GetROWorld() const
{ return ROworld;}
};
#endif
@@ -0,0 +1,96 @@
// 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: G4VSensitiveDetector.hh,v 2.1 1998/07/12 02:53:21 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
//
#ifndef G4VSensitiveDetector_h
#define G4VSensitiveDetector_h 1
#include "G4VHit.hh"
#include "G4Step.hh"
#include "G4HCofThisEvent.hh"
#include "G4VReadOutGeometry.hh"
#include "G4TouchableHistory.hh"
#include <rw/tvordvec.h>
class G4VSensitiveDetector
{
public:
G4VSensitiveDetector(G4String name);
G4VSensitiveDetector(const G4VSensitiveDetector &right);
virtual ~G4VSensitiveDetector();
const G4VSensitiveDetector & operator=(const G4VSensitiveDetector &right);
int operator==(const G4VSensitiveDetector &right) const;
int operator!=(const G4VSensitiveDetector &right) const;
virtual void Initialize(G4HCofThisEvent*HCE);
virtual void EndOfEvent(G4HCofThisEvent*HCE);
virtual void clear();
virtual void DrawAll();
virtual void PrintAll();
protected:
virtual G4bool ProcessHits(G4Step*aStep,G4TouchableHistory*ROhist) = 0;
G4int GetCollectionID(G4int i);
G4String SensitiveDetectorName; // detector name
G4String thePathName; // directory path
G4String fullPathName; // path + detector name
G4int verboseLevel;
G4bool active;
RWTValOrderedVector<G4String> collectionName;
private:
G4VReadOutGeometry * ROgeometry;
public:
inline G4bool Hit(G4Step*aStep)
{
G4bool ack = true;
G4TouchableHistory* ROhis = NULL;
if(!isActive())
{ ack = false; }
else if(ROgeometry)
{ ack = ROgeometry->CheckROVolume(aStep,ROhis); }
if(ack)
{ 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; };
inline void SetROgeometry(G4VReadOutGeometry*value)
{ ROgeometry = value; };
inline G4VReadOutGeometry* GetROgeometry()
{ return ROgeometry; };
};
#endif
@@ -0,0 +1,58 @@
// 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: G4HCtable.cc,v 2.1 1998/07/12 02:53:29 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
//
#include "G4HCtable.hh"
G4HCtable::G4HCtable() {;}
G4HCtable::~G4HCtable() {;}
G4int G4HCtable::Registor(G4String SDname,G4String HCname)
{
for(int i=0;i<HClist.entries();i++)
{ if(HClist[i]==HCname && SDlist[i]==SDname) return -1; }
HClist.insert(HCname);
SDlist.insert(SDname);
return HClist.entries();
}
G4int G4HCtable::GetCollectionID(G4String HCname)
{
G4int i = -1;
if(HCname.index("/")==RW_NPOS) // HCname only
{
for(G4int j=0;j<HClist.entries();j++)
{
if(HClist[j]==HCname)
{
if(i>=0) return -2;
i = j;
}
}
}
else
{
for(G4int j=0;j<HClist.entries();j++)
{
G4String tgt = SDlist[j];
tgt += "/";
tgt += HClist[j];
if(tgt==HCname)
{
if(i>=0) return -2;
i = j;
}
}
}
return i;
}
@@ -0,0 +1,111 @@
// 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: G4SDManager.cc,v 2.2 1998/07/13 16:50:04 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
//
#include "G4SDManager.hh"
#include "G4SDmessenger.hh"
#include "G4HCofThisEvent.hh"
#include "G4VHitsCollection.hh"
#include "G4VSensitiveDetector.hh"
#include "G4ios.hh"
G4SDManager* G4SDManager::fSDManager = 0;
G4SDManager* G4SDManager::GetSDMpointer()
{
if(!fSDManager)
{
fSDManager = new G4SDManager;
}
return fSDManager;
}
G4SDManager* G4SDManager::GetSDMpointerIfExist()
{ return fSDManager; }
G4SDManager::G4SDManager():verboseLevel(0)
{
G4String topName = "/";
treeTop = new G4SDStructure(topName);
theMessenger = new G4SDmessenger(this);
HCtable = new G4HCtable;
}
G4SDManager::~G4SDManager()
{
delete theMessenger;
}
void G4SDManager::AddNewDetector(G4VSensitiveDetector*aSD)
{
G4String pathName = aSD->GetPathName();
G4int numberOfCollections = aSD->GetNumberOfCollections();
if( pathName(0) != '/' ) pathName.prepend("/");
if( pathName(pathName.length()-1) != '/' ) pathName += "/";
treeTop->AddNewDetector(aSD,pathName);
for(int i=0;i<numberOfCollections;i++)
{
G4String SDname = aSD->GetName();
G4String DCname = aSD->GetCollectionName(i);
HCtable->Registor(SDname,DCname);
}
if( verboseLevel > 0 )
{
G4cout << "New sensitive detector <" << aSD->GetName()
<< "> is registored at " << pathName << endl;
}
}
G4HCofThisEvent* G4SDManager::PrepareNewEvent()
{
G4HCofThisEvent* HCE = new G4HCofThisEvent(HCtable->entries());
treeTop->Initialize(HCE);
return HCE;
}
void G4SDManager::TerminateCurrentEvent(G4HCofThisEvent* HCE)
{
treeTop->Terminate(HCE);
}
void G4SDManager::Activate(G4String dName, G4bool activeFlag)
{
G4String pathName = dName;
if( pathName(0) != '/' ) pathName.prepend("/");
treeTop->Activate(pathName,activeFlag);
}
G4VSensitiveDetector* G4SDManager::FindSensitiveDetector(G4String dName)
{
G4String pathName = dName;
if( pathName(0) != '/' ) pathName.prepend("/");
return treeTop->FindSensitiveDetector(pathName);
}
G4int G4SDManager::GetCollectionID(G4String colName)
{
G4int id = HCtable->GetCollectionID(colName);
if(id==-1)
{ G4cout << "<" << colName << "> is not found." << endl; }
else if(id==-2)
{ G4cout << "<" << colName << "> is ambiguous." << endl; }
return id;
}
G4int G4SDManager::GetCollectionID(G4VHitsCollection* aHC)
{
G4String HCname = aHC->GetSDname();
HCname += "/";
HCname += aHC->GetName();
return GetCollectionID(HCname);
}
@@ -0,0 +1,217 @@
// 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: G4SDStructure.cc,v 2.2 1998/07/13 16:50:05 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
//
// G4SDStructure
#include "G4SDStructure.hh"
#include "G4ios.hh"
G4SDStructure::G4SDStructure(G4String aPath):verboseLevel(0)
{
pathName = aPath;
dirName = aPath;
int i = dirName.length();
if( i > 1 )
{
dirName.remove(i-1);
int isl = dirName.last('/');
dirName.remove(0,isl+1);
dirName += "/";
}
}
G4SDStructure::~G4SDStructure()
{
}
int G4SDStructure::operator==(const G4SDStructure &right) const
{
return false;
}
void G4SDStructure::AddNewDetector(G4VSensitiveDetector*aSD,
G4String treeStructure)
{
G4String remainingPath = treeStructure;
remainingPath.remove(0,pathName.length());
if( ! remainingPath.isNull() )
{ // The detector should be kept in subdirectory.
// First, check if the subdirectoy exists.
G4String subD = ExtractDirName( remainingPath );
G4SDStructure* tgtSDS = FindSubDirectory(subD);
if( tgtSDS == NULL )
{ // Subdirectory not found. Create a new directory.
subD.prepend(pathName);
tgtSDS = new G4SDStructure(subD);
structure.insert( tgtSDS );
}
tgtSDS->AddNewDetector(aSD,treeStructure);
}
else
{ // The sensitive detector should be kept in this directory.
G4VSensitiveDetector* tgtSD = GetSD( aSD->GetName() );
if( tgtSD != NULL )
{
G4cout << aSD->GetName() << " had already stored in "
<< pathName << endl;
}
else
{
detector.insert( aSD );
}
}
}
G4SDStructure* G4SDStructure::FindSubDirectory(G4String subD)
{
for( int i=0; i<structure.entries(); i++ )
{
if( subD == structure(i)->dirName ) return structure(i);
}
return NULL;
}
G4VSensitiveDetector* G4SDStructure::GetSD(G4String aSDName)
{
for( int i=0; i<detector.entries(); i++ )
{
G4VSensitiveDetector* tgtSD = detector(i);
if( aSDName == tgtSD->GetName() ) return tgtSD;
}
return NULL;
}
G4String G4SDStructure::ExtractDirName(G4String aName)
{
G4String subD = aName;
int i = aName.first('/');
if( i != RW_NPOS ) subD.remove(i+1);
return subD;
}
void G4SDStructure::Activate(G4String aName, G4bool sensitiveFlag)
{
G4String aPath = aName;
aPath.remove(0,pathName.length());
if( aPath.first('/') != RW_NPOS )
{ // Command is ordered for a subdirectory.
G4String subD = ExtractDirName(aPath);
G4SDStructure* tgtSDS = FindSubDirectory(subD);
if( tgtSDS == NULL )
{ // The subdirectory is not found
G4cout << subD << " is not found in " << pathName << endl;
}
else
{
tgtSDS->Activate(aName,sensitiveFlag);
}
}
else if( aPath.isNull() )
{ // Command is ordered for all detectors in this directory.
for( int i=0; i<detector.entries(); i++)
{
detector(i)->Activate(sensitiveFlag);
}
for( int j=0;j<structure.entries(); j++)
{
structure(j)->Activate(G4String("/"),sensitiveFlag);
}
}
else
{ // Command is ordered to a particular detector.
G4VSensitiveDetector* tgtSD = GetSD(aPath);
if( tgtSD == NULL )
{ // The detector is not found.
G4cout << aPath << " is not found in " << pathName << endl;
}
else
{
tgtSD->Activate(sensitiveFlag);
}
}
}
G4VSensitiveDetector* G4SDStructure::FindSensitiveDetector(G4String aName)
{
G4String aPath = aName;
aPath.remove(0,pathName.length());
if( aPath.first('/') != RW_NPOS )
{ // SD exists in sub-directory
G4String subD = ExtractDirName(aPath);
G4SDStructure* tgtSDS = FindSubDirectory(subD);
if( tgtSDS == NULL )
{ // The subdirectory is not found
G4cout << subD << " is not found in " << pathName << endl;
return NULL;
}
else
{
return tgtSDS->FindSensitiveDetector(aName);
}
}
else
{ // SD must exist in this directory
G4VSensitiveDetector* tgtSD = GetSD(aPath);
if( tgtSD == NULL )
{ // The detector is not found.
G4cout << aPath << " is not found in " << pathName << endl;
}
return tgtSD;
}
}
void G4SDStructure::Initialize(G4HCofThisEvent*HCE)
{
int i;
// Broadcast to subdirectories.
for( i=0; i<structure.entries(); i++ )
{
structure(i)->Initialize(HCE);
}
// Initialize all detectors in this directory.
for( i=0; i<detector.entries(); i++ )
{
if(detector(i)->isActive()) detector(i)->Initialize(HCE);
}
}
void G4SDStructure::Terminate(G4HCofThisEvent*HCE)
{
int i;
// Broadcast to subdirectories.
for( i=0; i<structure.entries(); i++ )
{
structure(i)->Terminate(HCE);
}
// Initialize all detectors in this directory.
for( i=0; i<detector.entries(); i++ )
{
if(detector(i)->isActive()) detector(i)->EndOfEvent(HCE);
}
}
void G4SDStructure::ListTree()
{
G4cout << pathName << endl;
for(int i=0; i<detector.entries(); i++)
{
G4VSensitiveDetector* sd = detector(i);
G4cout << pathName << sd->GetName();
if( sd->isActive() )
{ G4cout << " *** Active "; }
else
{ G4cout << " XXX Inactive "; }
G4cout << endl;
}
for(int j=0; j<structure.entries(); j++)
{ structure(j)->ListTree(); }
}
@@ -0,0 +1,65 @@
// 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: G4SDmessenger.cc,v 2.2 1998/07/14 17:24:16 asaim Exp $
// GEANT4 tag $Name: geant4-00 $
//
// ---------------------------------------------------------------------
#include "G4SDmessenger.hh"
#include "G4SDManager.hh"
#include "G4UIdirectory.hh"
#include "G4UIcmdWithoutParameter.hh"
#include "G4UIcmdWithAString.hh"
#include "G4UIcmdWithAnInteger.hh"
G4SDmessenger::G4SDmessenger(G4SDManager* SDManager):fSDMan(SDManager)
{
hitsDir = new G4UIdirectory("/hits/");
hitsDir->SetGuidance("Sensitive detectors and Hits");
listCmd = new G4UIcmdWithoutParameter("/hits/list",this);
listCmd->SetGuidance("List sensitive detector tree.");
activeCmd = new G4UIcmdWithAString("/hits/activate",this);
activeCmd->SetGuidance("Activate sensitive detector(s).");
activeCmd->SetParameterName("detector",true);
activeCmd->SetDefaultValue("/");
inactiveCmd = new G4UIcmdWithAString("/hits/inactivate",this);
inactiveCmd->SetGuidance("Inactivate sensitive detector(s).");
inactiveCmd->SetParameterName("detector",true);
inactiveCmd->SetDefaultValue("/");
verboseCmd = new G4UIcmdWithAnInteger("/hits/verbose",this);
verboseCmd->SetGuidance("Set the Verbose level.");
verboseCmd->SetParameterName("level",false);
}
G4SDmessenger::~G4SDmessenger()
{
delete listCmd;
delete activeCmd;
delete inactiveCmd;
delete verboseCmd;
delete hitsDir;
}
void G4SDmessenger::SetNewValue(G4UIcommand * command,G4String newVal)
{
if( command==listCmd )
{ fSDMan->ListTree(); }
if( command==activeCmd )
{ fSDMan->Activate(newVal,1); }
if( command==inactiveCmd )
{ fSDMan->Activate(newVal,0); }
if( command==verboseCmd )
{ fSDMan->SetVerboseLevel(verboseCmd->GetNewIntValue(newVal)); }
return;
}
@@ -0,0 +1,81 @@
// 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: G4SensitiveVolumeList.cc,v 2.1 1998/07/12 02:53:31 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
//
// --------------------------------------------------------------
// GEANT 4 class implementation file
//
// For information related to this code contact:
// CERN, CN Division, ASD Group
// History: first implementation June'96, based on Hits+Digi
// domain model of April 1996, S.Piperov
//
// ---------------- G4SensitiveVolumeList -----------------
#include "G4SensitiveVolumeList.hh"
//Constructors
G4SensitiveVolumeList::G4SensitiveVolumeList()
{
}
G4SensitiveVolumeList::G4SensitiveVolumeList(const G4SensitiveVolumeList &right)
{
thePhysicalVolumeList = right.thePhysicalVolumeList;
theLogicalVolumeList = right.theLogicalVolumeList;
}
//Destructor
G4SensitiveVolumeList::~G4SensitiveVolumeList()
{
}
//Assignment Operation
const G4SensitiveVolumeList & G4SensitiveVolumeList::operator=(const G4SensitiveVolumeList &right)
{
thePhysicalVolumeList = right.thePhysicalVolumeList;
theLogicalVolumeList = right.theLogicalVolumeList;
return *this;
}
//Equality Operations
G4int G4SensitiveVolumeList::operator==(const G4SensitiveVolumeList &right) const
{
return (this == (G4SensitiveVolumeList *) &right);
}
G4int G4SensitiveVolumeList::operator!=(const G4SensitiveVolumeList &right) const
{
return (this != (G4SensitiveVolumeList *) &right);
}
//Other Operations
G4bool G4SensitiveVolumeList::CheckPV(const G4VPhysicalVolume * pvp) const
{
if (thePhysicalVolumeList.entries()==0) return false;
for(int i=0;i<thePhysicalVolumeList.entries();i++)
{ if(thePhysicalVolumeList(i)==pvp) return true; }
return false;
}
G4bool G4SensitiveVolumeList::CheckLV(const G4LogicalVolume * lvp) const
{
if (theLogicalVolumeList.entries()==0) return false;
for(int i=0;i<theLogicalVolumeList.entries();i++)
{ if(theLogicalVolumeList(i)==lvp) return true; }
return false;
}
@@ -0,0 +1,136 @@
// 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: G4VReadOutGeometry.cc,v 2.1 1998/07/12 02:53:31 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
//
#include "G4VReadOutGeometry.hh"
#include "G4Navigator.hh"
G4VReadOutGeometry::G4VReadOutGeometry()
:ROworld(NULL),touchableHistory(NULL),
fincludeList(NULL),fexcludeList(NULL)
{
name = "unknown";
ROnavigator = new G4Navigator();
}
G4VReadOutGeometry::G4VReadOutGeometry(const G4VReadOutGeometry &right)
{
fincludeList = right.fincludeList;
fexcludeList = right.fexcludeList;
name = right.name;
ROworld = right.ROworld;
touchableHistory = NULL;
// COPY CONSTRUCTOR NOT STRAIGHT FORWARD: need to copy the touchabelHistory
// VALUE, same foe navigator and same for the World+Geom hierachy ??
}
G4VReadOutGeometry::G4VReadOutGeometry(G4String n)
:name(n),ROworld(NULL),touchableHistory(NULL),
fincludeList(NULL),fexcludeList(NULL)
{
ROnavigator = new G4Navigator();
}
G4VReadOutGeometry::~G4VReadOutGeometry()
{
//if(ROworld) delete ROworld; //should we do ? will it delete the goem tree also ?
if(fincludeList) delete fincludeList;
if(fexcludeList) delete fexcludeList;
if(touchableHistory) delete touchableHistory;
if(ROnavigator) delete ROnavigator;
}
const G4VReadOutGeometry & G4VReadOutGeometry::operator=(const G4VReadOutGeometry &right)
{
fincludeList = right.fincludeList;
fexcludeList = right.fexcludeList;
name = right.name;
ROworld = right.ROworld;
touchableHistory = NULL;
return *this;
}
G4int G4VReadOutGeometry::operator==(const G4VReadOutGeometry &right) const
{ return (this == (G4VReadOutGeometry *) &right); }
G4int G4VReadOutGeometry::operator!=(const G4VReadOutGeometry &right) const
{ return (this != (G4VReadOutGeometry *) &right); }
void G4VReadOutGeometry::BuildROGeometry()
{
ROworld = Build();
ROnavigator->SetWorldVolume(ROworld);
}
G4bool G4VReadOutGeometry::CheckROVolume(G4Step*currentStep,G4TouchableHistory*& ROhist)
{
ROhist = NULL;
G4bool incFlg = true;
G4VPhysicalVolume* PV = currentStep->GetPreStepPoint()->GetPhysicalVolume();
if((fexcludeList)&&(fexcludeList->CheckPV(PV)))
{ incFlg = false; }
else if ((fincludeList)&&(fincludeList->CheckPV(PV)))
{ incFlg = true; }
else if((fexcludeList)&&(fexcludeList->CheckLV(PV->GetLogicalVolume())))
{ incFlg = false; }
else if((fincludeList)&&(fincludeList->CheckLV(PV->GetLogicalVolume())))
{ incFlg = true; }
if(!incFlg) return false;
if(ROworld)
{ incFlg = FindROTouchable(currentStep); }
if(incFlg)
{ ROhist = touchableHistory; }
return incFlg;
}
G4bool G4VReadOutGeometry::FindROTouchable(G4Step*currentStep)
{
// Update G4TouchableHistory object (touchableHistory)
// using the parallel readout world (ROworld)
// Return false in case the current Step is outside of the
// sensitive volume of the readout world.
// At first invokation, creates the touchable history. Note
// that default value (false) of Locate method is used.
if(!touchableHistory)
{
touchableHistory = new G4TouchableHistory();
ROnavigator->LocateGlobalPointAndUpdateTouchable(
currentStep->GetPreStepPoint()->GetPosition(),
touchableHistory);
}
else
{
ROnavigator->LocateGlobalPointAndUpdateTouchable(
currentStep->GetPreStepPoint()->GetPosition(),
touchableHistory,
true);
}
// Can the above be improved by the use of an isotropic safety
// in order to avoid LocateGlobalPointAndUpdateTouchable
// at each Step ?
// Should require that an RO geometry is notified at the
// starting of a track to avoid possible confusion looking
// at the safety value only.
// checks if volume is sensitive:
G4VPhysicalVolume* currentVolume;
// checks first if a physical volume exists here:
if ( currentVolume = touchableHistory->GetVolume() )
{
return currentVolume->GetLogicalVolume()->
GetSensitiveDetector() != NULL;
}
// no sensitive volume found: returns false
return false;
}
@@ -0,0 +1,85 @@
// 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: G4VSensitiveDetector.cc,v 2.1 1998/07/12 02:53:32 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
//
// G4VSensitiveDetector
#include "G4VSensitiveDetector.hh"
#include "G4SDManager.hh"
G4VSensitiveDetector::G4VSensitiveDetector(G4String name)
:verboseLevel(0),active(true),ROgeometry(NULL)
{
size_t sLast = name.last('/');
if(sLast==RW_NPOS)
{ // detector name only
SensitiveDetectorName = name;
thePathName = "/";
}
else
{ // name conatin the directory path
SensitiveDetectorName = name;
SensitiveDetectorName.remove(0,sLast+1);
thePathName = name;
thePathName.remove(sLast+1,name.length()-sLast);
if(thePathName(0)!='/') thePathName.prepend("/");
}
fullPathName = thePathName + SensitiveDetectorName;
}
G4VSensitiveDetector::G4VSensitiveDetector(const G4VSensitiveDetector &right)
{
}
G4VSensitiveDetector::~G4VSensitiveDetector()
{
}
const G4VSensitiveDetector & G4VSensitiveDetector::operator=(const G4VSensitiveDetector &right)
{
return *this;
}
int G4VSensitiveDetector::operator==(const G4VSensitiveDetector &right) const
{
return false;
}
int G4VSensitiveDetector::operator!=(const G4VSensitiveDetector &right) const
{
return true;
}
G4int G4VSensitiveDetector::GetCollectionID(G4int i)
{
return G4SDManager::GetSDMpointer()->GetCollectionID(collectionName[i]);
}
//----- following methoods are abstract methods to be
//----- implemented in the concrete classes
void G4VSensitiveDetector::Initialize(G4HCofThisEvent*HCE)
{
}
void G4VSensitiveDetector::EndOfEvent(G4HCofThisEvent*HCE)
{
}
void G4VSensitiveDetector::clear()
{
}
void G4VSensitiveDetector::DrawAll()
{
}
void G4VSensitiveDetector::PrintAll()
{
}
+20
View File
@@ -0,0 +1,20 @@
# $Id: GNUmakefile,v 2.0 1998/07/02 16:15:12 gunter Exp $
# --------------------------------------------------------------
# GNUmakefile for digits+hits library. Makoto Asai, 1/11/96.
# --------------------------------------------------------------
name := G4digits
ifndef G4INSTALL
G4INSTALL = ../../..
endif
include $(G4INSTALL)/config/architecture.gmk
CPPFLAGS += \
-I$(G4BASE)/global/HEPRandom/include \
-I$(G4BASE)/global/management/include \
-I$(G4BASE)/global/HEPGeometry/include
include $(G4INSTALL)/config/common.gmk
+21
View File
@@ -0,0 +1,21 @@
$Id: History,v 2.0 1998/07/02 16:15:04 gunter Exp $
-------------------------------------------------------------------
=========================================================
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
=========================================================
Category History file
---------------------
This file should be used by G4 developers and category coordinators
to briefly summarize all major modifications introduced in the code
and keep track of all category-tags.
It DOES NOT substitute the CVS log-message one should put at every
committal in the CVS repository !
----------------------------------------------------------
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
June 6, 98 M.Asai
- Created.
@@ -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
@@ -0,0 +1,41 @@
// 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.cc,v 2.1 1998/07/12 02:53:39 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
//
#include "G4DCofThisEvent.hh"
G4Allocator<G4DCofThisEvent> anDCoTHAllocator;
G4DCofThisEvent::G4DCofThisEvent()
{
DC = new RWTPtrOrderedVector<G4VDigiCollection>;
}
G4DCofThisEvent::G4DCofThisEvent(G4int cap)
{
DC = new RWTPtrOrderedVector<G4VDigiCollection>;
for(int i=0;i<cap;i++)
{
DC->insert((G4VDigiCollection*)NULL);
}
}
G4DCofThisEvent::~G4DCofThisEvent()
{
DC->clearAndDestroy();
delete DC;
}
void G4DCofThisEvent::AddDigiCollection(G4int DCID,G4VDigiCollection * aDC)
{
if(DCID>=0 && DCID<DC->entries())
{ (*DC)[DCID] = aDC; }
}
@@ -0,0 +1,28 @@
// 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.cc,v 2.0 1998/07/02 16:15:05 gunter Exp $
// GEANT4 tag $Name: geant4-00 $
//
#include "G4TDigiCollection.hh"
G4Allocator<G4DigiCollection> aDCAllocator;
G4DigiCollection::G4DigiCollection()
{;}
G4DigiCollection::G4DigiCollection(G4String detName,G4String colNam)
: G4VDigiCollection(detName,colNam)
{;}
G4DigiCollection::~G4DigiCollection()
{;}
int G4DigiCollection::operator==(const G4DigiCollection &right) const
{ return (collectionName==right.collectionName); }
+30
View File
@@ -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.cc,v 2.1 1998/07/12 02:53:39 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
//
// G4VDigi
#include "G4VDigi.hh"
#include "globals.hh"
G4VDigi::G4VDigi()
{;}
G4VDigi::~G4VDigi()
{;}
int G4VDigi::operator==(const G4VDigi &right) const
{ return false; }
void G4VDigi::Draw()
{;}
void G4VDigi::Print()
{;}
@@ -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.cc,v 2.1 1998/07/12 02:53:40 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
//
// G4VDigiCollection
#include "G4VDigiCollection.hh"
G4VDigiCollection::G4VDigiCollection()
{
collectionName = "Unknown";
DMname = "Unknown";
}
G4VDigiCollection::G4VDigiCollection(G4String DMnam,G4String colNam)
{
collectionName = colNam;
DMname = DMnam;
}
G4VDigiCollection::~G4VDigiCollection()
{ ; }
int G4VDigiCollection::operator==(const G4VDigiCollection &right) const
{
return ((collectionName==right.collectionName)
&&(DMname==right.DMname));
}
void G4VDigiCollection::DrawAllDigi()
{;}
void G4VDigiCollection::PrintAllDigi()
{;}
+19
View File
@@ -0,0 +1,19 @@
# $Id: GNUmakefile,v 2.0 1998/07/02 16:15:31 gunter Exp $
# --------------------------------------------------------------
# GNUmakefile for digits+hits library. Makoto Asai, 1/11/96.
# --------------------------------------------------------------
name := G4hits
ifndef G4INSTALL
G4INSTALL = ../../..
endif
include $(G4INSTALL)/config/architecture.gmk
CPPFLAGS += \
-I$(G4BASE)/global/HEPRandom/include \
-I$(G4BASE)/global/management/include \
-I$(G4BASE)/global/HEPGeometry/include
include $(G4INSTALL)/config/common.gmk
+21
View File
@@ -0,0 +1,21 @@
$Id: History,v 2.0 1998/07/02 16:15:22 gunter Exp $
-------------------------------------------------------------------
=========================================================
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
=========================================================
Category History file
---------------------
This file should be used by G4 developers and category coordinators
to briefly summarize all major modifications introduced in the code
and keep track of all category-tags.
It DOES NOT substitute the CVS log-message one should put at every
committal in the CVS repository !
----------------------------------------------------------
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
June 6, 98 M.Asai
- Created.
@@ -0,0 +1,68 @@
// 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: G4HCofThisEvent.hh,v 2.2 1998/10/26 01:53:29 asaim Exp $
// GEANT4 tag $Name: geant4-00 $
//
#ifndef G4HCofThisEvent_h
#define G4HCofThisEvent_h 1
#include "globals.hh"
#include "G4Allocator.hh"
#include "G4VHitsCollection.hh"
#include <rw/tpordvec.h>
class G4HCofThisEvent
{
public:
G4HCofThisEvent();
G4HCofThisEvent(G4int cap);
~G4HCofThisEvent();
inline void *operator new(size_t);
inline void operator delete(void* anHCoTE);
void AddHitsCollection(G4int HCID,G4VHitsCollection * aHC);
private:
RWTPtrOrderedVector<G4VHitsCollection> * HC;
public:
inline G4VHitsCollection* GetHC(G4int i)
{ return (*HC)[i]; }
inline G4int GetCapacity()
{
return HC->entries();
}
inline G4int GetNumberOfCollections()
{
G4int n = 0;
for(int i=0;i<HC->entries();i++)
{
if((*HC)[i]) n++;
}
return n;
}
};
extern G4Allocator<G4HCofThisEvent> anHCoTHAllocator;
inline void* G4HCofThisEvent::operator new(size_t)
{
void* anHCoTH;
anHCoTH = (void*)anHCoTHAllocator.MallocSingle();
return anHCoTH;
}
inline void G4HCofThisEvent::operator delete(void* anHCoTH)
{
anHCoTHAllocator.FreeSingle((G4HCofThisEvent*)anHCoTH);
}
#endif
@@ -0,0 +1,126 @@
// 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: G4THitsCollection.hh,v 2.1 1998/07/12 02:53:42 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
//
#ifndef G4THitsCollection_h
#define G4THitsCollection_h 1
#include "G4VHitsCollection.hh"
#include "G4Allocator.hh"
#include "globals.hh"
#include <rw/tpordvec.h>
class G4HitsCollection : public G4VHitsCollection
{
public:
G4HitsCollection();
G4HitsCollection(G4String detName,G4String colNam);
virtual ~G4HitsCollection();
int operator==(const G4HitsCollection &right) const;
protected:
void* theCollection;
};
extern G4Allocator<G4HitsCollection> anHCAllocator;
template <class T> class G4THitsCollection : public G4HitsCollection
{
public:
G4THitsCollection();
G4THitsCollection(G4String detName,G4String colNam);
virtual ~G4THitsCollection();
int operator==(const G4THitsCollection<T> &right) const;
inline void *operator new(size_t);
inline void operator delete(void* anHC);
virtual void DrawAllHits();
virtual void PrintAllHits();
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>*theHitsCollection
= (RWTPtrOrderedVector<T>*)theCollection;
theHitsCollection->insert(aHit);
return theHitsCollection->entries();
}
inline int entries()
{
RWTPtrOrderedVector<T>*theHitsCollection
= (RWTPtrOrderedVector<T>*)theCollection;
return theHitsCollection->entries();
}
};
template <class T> inline void* G4THitsCollection<T>::operator new(size_t)
{
void* anHC;
anHC = (void*)anHCAllocator.MallocSingle();
return anHC;
}
template <class T> inline void G4THitsCollection<T>::operator delete(void* anHC)
{
anHCAllocator.FreeSingle((G4HitsCollection*)anHC);
}
template <class T> G4THitsCollection<T>::G4THitsCollection()
{
RWTPtrOrderedVector<T> * theHitsCollection
= new RWTPtrOrderedVector<T>;
theCollection = (void*)theHitsCollection;
}
template <class T> G4THitsCollection<T>::G4THitsCollection(G4String detName,G4String colNam)
: G4HitsCollection(detName,colNam)
{
RWTPtrOrderedVector<T> * theHitsCollection
= new RWTPtrOrderedVector<T>;
theCollection = (void*)theHitsCollection;
}
template <class T> G4THitsCollection<T>::~G4THitsCollection()
{
RWTPtrOrderedVector<T> * theHitsCollection
= (RWTPtrOrderedVector<T>*)theCollection;
theHitsCollection->clearAndDestroy();
delete theHitsCollection;
}
template <class T> int G4THitsCollection<T>::operator==(const G4THitsCollection<T> &right) const
{ return (collectionName==right.collectionName); }
template <class T> void G4THitsCollection<T>::DrawAllHits()
{
RWTPtrOrderedVector<T> * theHitsCollection
= (RWTPtrOrderedVector<T>*)theCollection;
int n = theHitsCollection->entries();
for(int i=0;i<n;i++)
{ (*theHitsCollection)[i]->Draw(); }
}
template <class T> void G4THitsCollection<T>::PrintAllHits()
{
RWTPtrOrderedVector<T> * theHitsCollection
= (RWTPtrOrderedVector<T>*)theCollection;
int n = theHitsCollection->entries();
for(int i=0;i<n;i++)
{ (*theHitsCollection)[i]->Print(); }
}
#endif
+30
View File
@@ -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: G4VHit.hh,v 2.1 1998/07/12 02:53:42 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
//
#ifndef G4VHit_h
#define G4VHit_h 1
class G4VHit
{
public:
G4VHit();
virtual ~G4VHit();
int operator==(const G4VHit &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: G4VHitsCollection.hh,v 2.1 1998/07/12 02:53:43 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
//
#ifndef G4VHitsCollection_h
#define G4VHitsCollection_h 1
#include "globals.hh"
class G4VHitsCollection
{
public:
G4VHitsCollection();
G4VHitsCollection(G4String detName,G4String colNam);
virtual ~G4VHitsCollection();
int operator==(const G4VHitsCollection &right) const;
virtual void DrawAllHits();
virtual void PrintAllHits();
protected:
// Collection name
G4String collectionName;
G4String SDname;
public:
inline G4String GetName()
{ return collectionName; }
inline G4String GetSDname()
{ return SDname; }
};
#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: G4HCofThisEvent.cc,v 2.1 1998/07/12 02:53:44 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
//
#include "G4HCofThisEvent.hh"
G4Allocator<G4HCofThisEvent> anHCoTHAllocator;
G4HCofThisEvent::G4HCofThisEvent()
{
HC = new RWTPtrOrderedVector<G4VHitsCollection>;
}
G4HCofThisEvent::G4HCofThisEvent(G4int cap)
{
HC = new RWTPtrOrderedVector<G4VHitsCollection>;
for(int i=0;i<cap;i++)
{
HC->insert((G4VHitsCollection*)NULL);
}
}
G4HCofThisEvent::~G4HCofThisEvent()
{
HC->clearAndDestroy();
delete HC;
}
void G4HCofThisEvent::AddHitsCollection(G4int HCID,G4VHitsCollection * aHC)
{
if(HCID>=0 && HCID<HC->entries())
{ (*HC)[HCID] = aHC; }
}
@@ -0,0 +1,28 @@
// 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: G4THitsCollection.cc,v 2.0 1998/07/02 16:15:23 gunter Exp $
// GEANT4 tag $Name: geant4-00 $
//
#include "G4THitsCollection.hh"
G4Allocator<G4HitsCollection> anHCAllocator;
G4HitsCollection::G4HitsCollection()
{;}
G4HitsCollection::G4HitsCollection(G4String detName,G4String colNam)
: G4VHitsCollection(detName,colNam)
{;}
G4HitsCollection::~G4HitsCollection()
{;}
int G4HitsCollection::operator==(const G4HitsCollection &right) const
{ return (collectionName==right.collectionName); }
+30
View File
@@ -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: G4VHit.cc,v 2.1 1998/07/12 02:53:44 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
//
// G4VHit
#include "G4VHit.hh"
#include "globals.hh"
G4VHit::G4VHit()
{;}
G4VHit::~G4VHit()
{;}
int G4VHit::operator==(const G4VHit &right) const
{ return false; }
void G4VHit::Draw()
{;}
void G4VHit::Print()
{;}
@@ -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: G4VHitsCollection.cc,v 2.1 1998/07/12 02:53:45 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
//
// G4VHitsCollection
#include "G4VHitsCollection.hh"
G4VHitsCollection::G4VHitsCollection()
{
collectionName = "Unknown";
SDname = "Unknown";
}
G4VHitsCollection::G4VHitsCollection(G4String detName,G4String colNam)
{
collectionName = colNam;
SDname = detName;
}
G4VHitsCollection::~G4VHitsCollection()
{ ; }
int G4VHitsCollection::operator==(const G4VHitsCollection &right) const
{
return ((collectionName==right.collectionName)
&&(SDname==right.SDname));
}
void G4VHitsCollection::DrawAllHits()
{;}
void G4VHitsCollection::PrintAllHits()
{;}