Import Geant4 6.0.0 source tree
This commit is contained in:
@@ -0,0 +1,86 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of 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: G4CellScoreComposer.hh,v 1.1 2003/10/03 10:06:49 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-06-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// Class G4CellScoreComposer
|
||||
//
|
||||
// Class description:
|
||||
// This class will be created for every cell standard
|
||||
// scoring should be applied. It does the actual scoring.
|
||||
// GetStandardCellScoreValues() delivers the struct
|
||||
// G4CellScoreValues does calculations based on the
|
||||
// sums of scores and delivers the results in
|
||||
// G4CellScoreValues.
|
||||
//
|
||||
|
||||
// Author: Michael Dressel (Michael.Dressel@cern.ch)
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
#ifndef G4CellScoreComposer_hh
|
||||
#define G4CellScoreComposer_hh G4CellScoreComposer_hh
|
||||
|
||||
#include "G4CellScoreValues.hh"
|
||||
|
||||
class G4Step;
|
||||
|
||||
class G4CellScoreComposer {
|
||||
public: // with description
|
||||
|
||||
G4CellScoreComposer();
|
||||
|
||||
~G4CellScoreComposer();
|
||||
|
||||
void EstimatorCalculation(const G4Step &step);
|
||||
// get values for estimators based on
|
||||
// track length
|
||||
|
||||
void TrackEnters();
|
||||
// to be called if a track enters the cell
|
||||
|
||||
void NewTrackPopedUp();
|
||||
// to be caled if the cell popultion is increased
|
||||
|
||||
void SetCollisionWeight(G4double weight);
|
||||
// to be called for every collision
|
||||
// in the cell with the weight of the colliding particle
|
||||
|
||||
void SetImportnace(G4double importance);
|
||||
// informs G4CellScoreComposer about the importance of the cell
|
||||
|
||||
const G4CellScoreValues &GetStandardCellScoreValues() const;
|
||||
// return scores in G4CellScoreValues
|
||||
|
||||
private:
|
||||
mutable G4CellScoreValues fSCScoreValues;
|
||||
};
|
||||
|
||||
std::ostream& operator<<(std::ostream &out,
|
||||
const G4CellScoreComposer &ps);
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of 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: G4CellScoreValues.hh,v 1.1 2003/10/03 10:07:07 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-06-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// Class G4CellScoreValues
|
||||
//
|
||||
// Class description:
|
||||
// This struct holds sums of scores for standard scoring.
|
||||
//
|
||||
//
|
||||
|
||||
// Author: Michael Dressel (Michael.Dressel@cern.ch)
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
#ifndef G4CellScoreValues_hh
|
||||
#define G4CellScoreValues_hh G4CellScoreValues_hh
|
||||
|
||||
#include "globals.hh"
|
||||
|
||||
class G4CellScoreValues {
|
||||
public:
|
||||
G4CellScoreValues() :
|
||||
fSumSL(0),
|
||||
fSumSLW(0),
|
||||
fSumSLW_v(0),
|
||||
fSumSLWE(0),
|
||||
fSumSLWE_v(0),
|
||||
fSumTracksEntering(0),
|
||||
fSumPopulation(0),
|
||||
fSumCollisions(0),
|
||||
fSumCollisionsWeight(0),
|
||||
fNumberWeightedEnergy(0),
|
||||
fFluxWeightedEnergy(0),
|
||||
fAverageTrackWeight(0),
|
||||
fImportance(0)
|
||||
{}
|
||||
|
||||
G4double fSumSL;
|
||||
G4double fSumSLW;
|
||||
G4double fSumSLW_v;
|
||||
G4double fSumSLWE;
|
||||
G4double fSumSLWE_v;
|
||||
G4int fSumTracksEntering;
|
||||
G4int fSumPopulation;
|
||||
G4int fSumCollisions;
|
||||
G4double fSumCollisionsWeight;
|
||||
G4double fNumberWeightedEnergy;
|
||||
G4double fFluxWeightedEnergy;
|
||||
G4double fAverageTrackWeight;
|
||||
G4double fImportance;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,73 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of 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: G4CellStoreScorer.hh,v 1.1 2003/10/03 10:07:30 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-06-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// Class G4CellStoreScorer
|
||||
//
|
||||
// Class description:
|
||||
//
|
||||
// This class invokes a G4VCellScorer according to the current
|
||||
// step:
|
||||
// - pre and post step are in a volume -> chose post gCell (cell)
|
||||
// and call ScoreInVolume
|
||||
// - cross boundary between gCells (cells)
|
||||
// call ScoreAnExtingStep on the pre cell
|
||||
// and ScoreAnEnteringStep on the post cell.
|
||||
//
|
||||
|
||||
// Author: Michael Dressel (Michael.Dressel@cern.ch)
|
||||
// ----------------------------------------------------------------------
|
||||
//
|
||||
|
||||
#ifndef G4CellStoreScorer_hh
|
||||
#define G4CellStoreScorer_hh G4CellStoreScorer_hh
|
||||
|
||||
|
||||
#include "G4VScorer.hh"
|
||||
|
||||
class G4VCellScorerStore;
|
||||
class G4Step;
|
||||
class G4GeometryCellStep;
|
||||
class G4GeometryCell;
|
||||
|
||||
class G4CellStoreScorer : public G4VScorer
|
||||
{
|
||||
public: // with description
|
||||
explicit G4CellStoreScorer(G4VCellScorerStore &csc);
|
||||
// take a G4VCellScorerStore created by the user to score
|
||||
// the cells contained in it.
|
||||
|
||||
virtual ~G4CellStoreScorer();
|
||||
virtual void Score(const G4Step &aStep, const G4GeometryCellStep &aPStep);
|
||||
// called to score a track for every step
|
||||
|
||||
private:
|
||||
G4VCellScorerStore &fCellScorerStore;
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of 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: G4CollectionNameVector.hh,v 1.1 2003/10/03 10:07:48 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-06-00 $
|
||||
//
|
||||
|
||||
#ifndef G4CollectionNameVector_H
|
||||
#define G4CollectionNameVector_H 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include <vector>
|
||||
|
||||
class G4CollectionNameVector : public std::vector<G4String>
|
||||
{
|
||||
public:
|
||||
G4CollectionNameVector() {;}
|
||||
virtual ~G4CollectionNameVector() {;}
|
||||
|
||||
void insert(G4String s) { push_back(s); }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of 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 2003/10/03 10:08:05 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-06-00 $
|
||||
//
|
||||
|
||||
#ifndef G4HCtable_H
|
||||
#define G4HCtable_H 1
|
||||
|
||||
#include "globals.hh"
|
||||
//#include "g4rw/tvordvec.h"
|
||||
#include <vector>
|
||||
|
||||
// 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
|
||||
{
|
||||
public:
|
||||
G4HCtable();
|
||||
~G4HCtable();
|
||||
|
||||
public:
|
||||
G4int Registor(G4String SDname,G4String HCname);
|
||||
G4int GetCollectionID(G4String HCname);
|
||||
|
||||
private:
|
||||
std::vector<G4String> SDlist;
|
||||
std::vector<G4String> HClist;
|
||||
|
||||
public:
|
||||
inline G4int entries() const
|
||||
{ return HClist.size(); }
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,106 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of 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 2003/10/03 10:08:25 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-06-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 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: // with description
|
||||
static G4SDManager* GetSDMpointer();
|
||||
// Returns the pointer to the singleton object.
|
||||
public:
|
||||
static G4SDManager* GetSDMpointerIfExist();
|
||||
|
||||
protected:
|
||||
G4SDManager();
|
||||
|
||||
public:
|
||||
~G4SDManager();
|
||||
|
||||
public: // with description
|
||||
void AddNewDetector(G4VSensitiveDetector*aSD);
|
||||
// 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;
|
||||
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,88 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of 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 2003/10/03 10:08:42 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-06-00 $
|
||||
//
|
||||
|
||||
#ifndef G4SDStructure_h
|
||||
#define G4SDStructure_h 1
|
||||
|
||||
// Globals
|
||||
#include "globals.hh"
|
||||
// G4VSensitiveDetector
|
||||
#include "G4VSensitiveDetector.hh"
|
||||
#include <vector>
|
||||
|
||||
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:
|
||||
G4SDStructure(G4String aPath);
|
||||
~G4SDStructure();
|
||||
|
||||
G4int 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:
|
||||
std::vector<G4SDStructure*> structure;
|
||||
std::vector<G4VSensitiveDetector*> detector;
|
||||
G4String pathName;
|
||||
G4String dirName;
|
||||
G4int verboseLevel;
|
||||
|
||||
public:
|
||||
inline void SetVerboseLevel(G4int vl)
|
||||
{
|
||||
verboseLevel = vl;
|
||||
for(size_t i=0; i<structure.size(); i++)
|
||||
{ structure[i]->SetVerboseLevel(vl); }
|
||||
for(size_t j=0; j<detector.size(); j++)
|
||||
{ detector[j]->SetVerboseLevel(vl); }
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of 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 2003/10/03 10:09:00 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-06-00 $
|
||||
//
|
||||
|
||||
#ifndef G4SDmessenger_h
|
||||
#define G4SDmessenger_h 1
|
||||
|
||||
#include "G4UImessenger.hh"
|
||||
|
||||
class G4SDManager;
|
||||
class G4UIdirectory;
|
||||
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:
|
||||
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,97 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of 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 2003/10/03 10:09:17 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-06-00 $
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// GEANT 4 class header file --- Copyright CERN 1996
|
||||
// CERN Geneva Switzerland
|
||||
//
|
||||
// History: first implementation, based on Hits+Digi domain
|
||||
// object model of April 1996, S.Piperov
|
||||
//
|
||||
// ---------------- G4SensitiveVolumeList -----------------
|
||||
|
||||
#ifndef G4SensitiveVolumeList_h
|
||||
#define G4SensitiveVolumeList_h 1
|
||||
|
||||
//#include "g4rw/tpordvec.h"
|
||||
//#include "g4rw/tvordvec.h"
|
||||
#include <vector>
|
||||
#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
|
||||
{
|
||||
|
||||
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 std::vector<G4VPhysicalVolume*>& GetThePhysicalVolumeList() const;
|
||||
void SetThePhysicalVolumeList(const std::vector<G4VPhysicalVolume*> value);
|
||||
|
||||
const std::vector<G4LogicalVolume*>& GetTheLogicalVolumeList() const;
|
||||
void SetTheLogicalVolumeList(const std::vector<G4LogicalVolume*> value);
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
//Data Members for Has Relationships
|
||||
|
||||
std::vector<G4VPhysicalVolume*> thePhysicalVolumeList;
|
||||
std::vector<G4LogicalVolume*> theLogicalVolumeList;
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of 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 2003/10/03 10:09:26 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-06-00 $
|
||||
//
|
||||
// -----------------------------------------------------------
|
||||
// Inline functions of GEANT 4 class header file.
|
||||
// --- Copyright CERN 1996, CERN Geneva Switzerland ---
|
||||
//
|
||||
// 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 std::vector<G4VPhysicalVolume*>& G4SensitiveVolumeList::get_the_G4VPhysicalVolume_list() const { return the_G4VPhysicalVolume_list; }
|
||||
|
||||
inline void G4SensitiveVolumeList::set_the_G4VPhysicalVolume_list(const std::vector<G4VPhysicalVolume*> value) { the_G4VPhysicalVolume_list = value; }
|
||||
|
||||
|
||||
inline const std::vector<G4LogicalVolume*>& G4SensitiveVolumeList::get_the_G4LogicalVolume() const { return the_G4LogicalVolume_list; }
|
||||
|
||||
inline void G4SensitiveVolumeList::set_the_G4LogicalVolume(const std::vector<G4LogicalVolume*> value) { the_G4LogicalVolume_list = value; }
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of 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: G4TrackLogger.hh,v 1.1 2003/10/03 10:09:45 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-06-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// Class G4TrackLogger
|
||||
//
|
||||
// Class description:
|
||||
//
|
||||
// This class loggs every track via it's id. It may tell if
|
||||
// a track has been logged. The loggs are cleared when ever
|
||||
// the object has been informed about a new event.
|
||||
//
|
||||
// Author: Michael Dressel (Michael.Dressel@cern.ch)
|
||||
// ----------------------------------------------------------------------
|
||||
//
|
||||
|
||||
#ifndef G4TrackLogger_hh
|
||||
#define G4TrackLogger_hh G4TrackLogger_hh
|
||||
|
||||
#include "globals.hh"
|
||||
#include <set>
|
||||
|
||||
class G4TrackLogger {
|
||||
public:
|
||||
G4TrackLogger();
|
||||
~G4TrackLogger();
|
||||
|
||||
void SetEventID(G4int id);
|
||||
// inform the object about the event number
|
||||
// if the event number changes the loggs are cleared.
|
||||
|
||||
G4bool FirstEnterance(G4int trid);
|
||||
// returns true if the track is new to this event.
|
||||
|
||||
typedef std::set<G4int > TrackIDsSet;
|
||||
// log for the track ids.
|
||||
|
||||
private:
|
||||
G4int fPreviousEventID;
|
||||
TrackIDsSet fTrackIDsSet;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,92 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of 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 2003/10/03 10:10:00 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-06-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,157 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of 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 2003/10/03 10:10:18 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-06-00 $
|
||||
//
|
||||
|
||||
#ifndef G4VSensitiveDetector_h
|
||||
#define G4VSensitiveDetector_h 1
|
||||
|
||||
#include "G4VHit.hh"
|
||||
#include "G4Step.hh"
|
||||
#include "G4HCofThisEvent.hh"
|
||||
#include "G4VReadOutGeometry.hh"
|
||||
#include "G4TouchableHistory.hh"
|
||||
#include "G4CollectionNameVector.hh"
|
||||
|
||||
// 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: // 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);
|
||||
|
||||
G4int operator==(const G4VSensitiveDetector &right) const;
|
||||
G4int operator!=(const G4VSensitiveDetector &right) const;
|
||||
|
||||
public: // with description
|
||||
virtual void Initialize(G4HCofThisEvent*);
|
||||
virtual void EndOfEvent(G4HCofThisEvent*);
|
||||
// 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: // 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.
|
||||
G4CollectionNameVector 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;
|
||||
|
||||
private:
|
||||
G4VReadOutGeometry * ROgeometry;
|
||||
|
||||
public: // with description
|
||||
inline G4bool Hit(G4Step*aStep)
|
||||
{
|
||||
G4bool ack = true;
|
||||
G4TouchableHistory* ROhis = 0;
|
||||
if(!isActive())
|
||||
{ ack = false; }
|
||||
else if(ROgeometry)
|
||||
{ ack = ROgeometry->CheckROVolume(aStep,ROhis); }
|
||||
if(ack)
|
||||
{ ack = ProcessHits(aStep,ROhis); }
|
||||
return ack;
|
||||
}
|
||||
// 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; }
|
||||
// Register the Readout geometry.
|
||||
|
||||
public:
|
||||
inline G4int GetNumberOfCollections()
|
||||
{ return collectionName.size(); }
|
||||
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; }
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user