Import Geant4 1.0.0 source tree
This commit is contained in:
@@ -1,19 +1,17 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
// the GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4Allocator.hh,v 1.1 1999/01/07 16:09:00 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
// $Id: G4Allocator.hh,v 1.3 1999/11/23 15:00:03 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
//
|
||||
// For information related to this code contact:
|
||||
// CERN, CN Division, ASD group
|
||||
// History: first implementation, based on object model of
|
||||
// 2nd December 1995, G.Cosmo
|
||||
// ---------------- G4Allocator ----------------
|
||||
@@ -72,11 +70,14 @@ public:
|
||||
fUnit->deleted = Deleted;
|
||||
fUnit->fNext = fFreeList;
|
||||
fFreeList = fUnit;
|
||||
} else if (fUnit->deleted == Deleted) {
|
||||
// cerr << "G4Allocator : This object is already deleted" << endl;
|
||||
} else {
|
||||
// cerr << "G4Allocator: This object is allocated not by G4Allocator"<< endl;
|
||||
}
|
||||
/*
|
||||
else if (fUnit->deleted == Deleted) {
|
||||
// G4cerr << "G4Allocator : This object is already deleted" << G4endl;
|
||||
} else {
|
||||
// G4cerr << "G4Allocator: This object is allocated not by G4Allocator"<< G4endl;
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
@@ -1,19 +1,17 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
// the GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4AllocatorPage.hh,v 1.1 1999/01/07 16:09:00 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
// $Id: G4AllocatorPage.hh,v 1.2 1999/11/16 17:40:22 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
//
|
||||
// For information related to this code contact:
|
||||
// CERN, CN Division, ASD group
|
||||
// History: first implementation, based on object model of
|
||||
// 2nd December 1995, G.Cosmo
|
||||
// -------------- G4AllocatorPage ----------------
|
||||
@@ -23,7 +21,6 @@
|
||||
#ifndef G4AllocatorPage_h
|
||||
#define G4AllocatorPage_h 1
|
||||
|
||||
//G4AllocatorUnit
|
||||
#include "G4AllocatorUnit.hh"
|
||||
|
||||
template <class Type>
|
||||
|
||||
@@ -1,19 +1,17 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
// the GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4AllocatorUnit.hh,v 1.1 1999/01/07 16:09:00 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
// $Id: G4AllocatorUnit.hh,v 1.2 1999/11/16 17:40:22 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
//
|
||||
// For information related to this code contact:
|
||||
// CERN, CN Division, ASD group
|
||||
// History: first implementation, based on object model of
|
||||
// 2nd December 1995, G.Cosmo
|
||||
// -------------- G4AllocatorUnit ----------------
|
||||
|
||||
@@ -1,29 +1,24 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
// the GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4DataVector.hh,v 1.1 1999/01/07 16:09:00 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
// $Id: G4DataVector.hh,v 1.4 1999/11/23 15:00:03 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
//
|
||||
// For information related to this code contact:
|
||||
// CERN, IT Division, ASD group
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
|
||||
#ifndef G4DataVector_h
|
||||
#define G4DataVector_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4ios.hh"
|
||||
#include <rw/tvordvec.h>
|
||||
#include "g4rw/tvordvec.h"
|
||||
|
||||
typedef RWTValOrderedVector<G4double> G4DataVector;
|
||||
typedef G4RWTValOrderedVector<G4double> G4DataVector;
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,19 +1,17 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
// the GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4FastVector.hh,v 1.1 1999/01/07 16:09:00 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
// $Id: G4FastVector.hh,v 1.3 1999/11/23 15:00:03 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
//
|
||||
// For information related to this code contact:
|
||||
// CERN, CN Division, ASD group
|
||||
// History: first implementation, based on object model of
|
||||
// 2nd December 1995, G.Cosmo
|
||||
// ------------------------------------------------------------
|
||||
@@ -22,8 +20,6 @@
|
||||
#define G4FastVector_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4ios.hh"
|
||||
|
||||
|
||||
template <class Type, G4int N>
|
||||
class G4FastVector
|
||||
|
||||
@@ -1,24 +1,26 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
// the GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4LPhysicsFreeVector.hh,v 1.1 1999/01/07 16:09:01 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
// $Id: G4LPhysicsFreeVector.hh,v 1.2 1999/11/16 17:40:38 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------------
|
||||
//
|
||||
// Class G4LPhysicsFreeVector -- header file
|
||||
//
|
||||
// Class description:
|
||||
//
|
||||
// Derived from base class G4PhysicsVector
|
||||
// This is a free vector for Low Energy Physics cross section data.
|
||||
// The class name includes an "L" to distinguish it from other groups
|
||||
// who may wish to implement a free vector in a different way.
|
||||
// A subdivision method is used to find the energy|momentum bin.
|
||||
//
|
||||
|
||||
// F.W. Jones, TRIUMF, 04-JUN-96
|
||||
//
|
||||
// 10-JUL-96 FWJ: adapted to changes in G4PhysicsVector.
|
||||
@@ -41,42 +43,20 @@ public:
|
||||
|
||||
~G4LPhysicsFreeVector();
|
||||
|
||||
// G4PhysicsVector has PutValue() but it is inconvenient.
|
||||
// Want to simultaneously fill the bin and data vectors.
|
||||
inline
|
||||
void PutValues(size_t binNumber, G4double binValue, G4double dataValue)
|
||||
{
|
||||
binVector(binNumber) = binValue;
|
||||
dataVector(binNumber) = dataValue;
|
||||
}
|
||||
void PutValues(size_t binNumber, G4double binValue, G4double dataValue);
|
||||
// G4PhysicsVector has PutValue() but it is inconvenient.
|
||||
// Want to simultaneously fill the bin and data vectors.
|
||||
|
||||
// Note that theEnergy could be energy, momentum, or whatever.
|
||||
inline
|
||||
G4double GetValue(G4double theEnergy, G4bool& isOutRange);
|
||||
// Note that theEnergy could be energy, momentum, or whatever.
|
||||
|
||||
inline
|
||||
void SetVerboseLevel(G4int value)
|
||||
{
|
||||
verboseLevel = value;
|
||||
}
|
||||
void SetVerboseLevel(G4int value);
|
||||
|
||||
inline
|
||||
G4int GetVerboseLevel(G4int)
|
||||
{
|
||||
return verboseLevel;
|
||||
}
|
||||
G4int GetVerboseLevel(G4int);
|
||||
|
||||
inline
|
||||
G4double GetLastEnergy()
|
||||
{
|
||||
return lastEnergy;
|
||||
}
|
||||
G4double GetLastEnergy();
|
||||
|
||||
inline
|
||||
size_t GetLastBin()
|
||||
{
|
||||
return lastBin;
|
||||
}
|
||||
size_t GetLastBin();
|
||||
|
||||
void DumpValues();
|
||||
|
||||
@@ -84,75 +64,10 @@ private:
|
||||
|
||||
G4int verboseLevel;
|
||||
|
||||
// Pure virtual in G4PhysicsVector
|
||||
inline
|
||||
size_t FindBinLocation(G4double theEnergy) const;
|
||||
// Pure virtual in G4PhysicsVector
|
||||
};
|
||||
|
||||
#include "G4LPhysicsFreeVector.icc"
|
||||
|
||||
// Note: GetValue() is no longer virtual in the parent class
|
||||
// G4PhysicsVector, so at present the following function cannot
|
||||
// be called through a base class pointer.
|
||||
|
||||
inline
|
||||
G4double
|
||||
G4LPhysicsFreeVector::GetValue(G4double theEnergy, G4bool& isOutRange)
|
||||
{
|
||||
G4double returnValue;
|
||||
|
||||
// verboseLevel = 2;
|
||||
|
||||
if (theEnergy < edgeMin) {
|
||||
isOutRange = true;
|
||||
|
||||
if (verboseLevel > 1) G4cout << "G4LPhysicsFreeVector::GetValue " <<
|
||||
theEnergy << " " << dataVector(0) << " " << isOutRange << endl;
|
||||
|
||||
returnValue = dataVector(0);
|
||||
}
|
||||
else if (theEnergy > edgeMax) {
|
||||
isOutRange = true;
|
||||
|
||||
if (verboseLevel > 1) G4cout << "G4LPhysicsFreeVector::GetValue " <<
|
||||
theEnergy << " " << dataVector(numberOfBin - 1) << " " <<
|
||||
isOutRange << endl;
|
||||
|
||||
returnValue = dataVector(numberOfBin - 1);
|
||||
}
|
||||
else {
|
||||
isOutRange = false;
|
||||
|
||||
G4int n = FindBinLocation(theEnergy);
|
||||
|
||||
G4double dsde = (dataVector(n + 1) - dataVector(n))/
|
||||
(binVector(n + 1) - binVector(n));
|
||||
|
||||
if (verboseLevel > 1) G4cout << "G4LPhysicsFreeVector::GetValue " <<
|
||||
theEnergy << " " << dataVector(n) + (theEnergy - binVector(n))*dsde <<
|
||||
" " << isOutRange << endl;
|
||||
|
||||
returnValue = dataVector(n) + (theEnergy - binVector(n))*dsde;
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
|
||||
inline
|
||||
size_t
|
||||
G4LPhysicsFreeVector::FindBinLocation(G4double theEnergy) const
|
||||
{
|
||||
G4int n1 = 0;
|
||||
G4int n2 = numberOfBin/2;
|
||||
G4int n3 = numberOfBin - 1;
|
||||
while (n1 != n3 - 1) {
|
||||
if (theEnergy > binVector(n2))
|
||||
n1 = n2;
|
||||
else
|
||||
n3 = n2;
|
||||
n2 = n1 + (n3 - n1 + 1)/2;
|
||||
}
|
||||
if (verboseLevel > 1) G4cout <<
|
||||
"G4LPhysicsFreeVector::FindBinLocation: returning " << n1 << endl;
|
||||
return (size_t)n1;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,121 @@
|
||||
// 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: G4LPhysicsFreeVector.icc,v 1.2 1999/11/23 15:00:03 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------------
|
||||
//
|
||||
// Class G4LPhysicsFreeVector -- source file
|
||||
//
|
||||
// Derived from base class G4PhysicsVector
|
||||
// This is a free vector for Low Energy Physics cross section data.
|
||||
// The class name includes an "L" to distinguish it from other groups
|
||||
// who may wish to implement a free vector in a different way.
|
||||
// A subdivision method is used to find the energy|momentum bin.
|
||||
//
|
||||
// F.W. Jones, TRIUMF, 04-JUN-96
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
// G4PhysicsVector has PutValue() but it is inconvenient.
|
||||
// Want to simultaneously fill the bin and data vectors.
|
||||
|
||||
inline
|
||||
void G4LPhysicsFreeVector::PutValues(size_t binNumber, G4double binValue, G4double dataValue)
|
||||
{
|
||||
binVector(binNumber) = binValue;
|
||||
dataVector(binNumber) = dataValue;
|
||||
}
|
||||
|
||||
// Note that theEnergy could be energy, momentum, or whatever.
|
||||
// Note: GetValue() is no longer virtual in the parent class
|
||||
// G4PhysicsVector, so at present the following function cannot
|
||||
// be called through a base class pointer.
|
||||
|
||||
inline
|
||||
G4double G4LPhysicsFreeVector::GetValue(G4double theEnergy, G4bool& isOutRange)
|
||||
{
|
||||
G4double returnValue;
|
||||
|
||||
// verboseLevel = 2;
|
||||
|
||||
if (theEnergy < edgeMin) {
|
||||
isOutRange = true;
|
||||
|
||||
if (verboseLevel > 1) G4cout << "G4LPhysicsFreeVector::GetValue " <<
|
||||
theEnergy << " " << dataVector(0) << " " << isOutRange << G4endl;
|
||||
|
||||
returnValue = dataVector(0);
|
||||
}
|
||||
else if (theEnergy > edgeMax) {
|
||||
isOutRange = true;
|
||||
|
||||
if (verboseLevel > 1) G4cout << "G4LPhysicsFreeVector::GetValue " <<
|
||||
theEnergy << " " << dataVector(numberOfBin - 1) << " " <<
|
||||
isOutRange << G4endl;
|
||||
|
||||
returnValue = dataVector(numberOfBin - 1);
|
||||
}
|
||||
else {
|
||||
isOutRange = false;
|
||||
|
||||
G4int n = FindBinLocation(theEnergy);
|
||||
|
||||
G4double dsde = (dataVector(n + 1) - dataVector(n))/
|
||||
(binVector(n + 1) - binVector(n));
|
||||
|
||||
if (verboseLevel > 1) G4cout << "G4LPhysicsFreeVector::GetValue " <<
|
||||
theEnergy << " " << dataVector(n) + (theEnergy - binVector(n))*dsde <<
|
||||
" " << isOutRange << G4endl;
|
||||
|
||||
returnValue = dataVector(n) + (theEnergy - binVector(n))*dsde;
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
inline
|
||||
void G4LPhysicsFreeVector::SetVerboseLevel(G4int value)
|
||||
{
|
||||
verboseLevel = value;
|
||||
}
|
||||
|
||||
inline
|
||||
G4int G4LPhysicsFreeVector::GetVerboseLevel(G4int)
|
||||
{
|
||||
return verboseLevel;
|
||||
}
|
||||
|
||||
inline
|
||||
G4double G4LPhysicsFreeVector::GetLastEnergy()
|
||||
{
|
||||
return lastEnergy;
|
||||
}
|
||||
|
||||
inline
|
||||
size_t G4LPhysicsFreeVector::GetLastBin()
|
||||
{
|
||||
return lastBin;
|
||||
}
|
||||
|
||||
inline
|
||||
size_t G4LPhysicsFreeVector::FindBinLocation(G4double theEnergy) const
|
||||
{
|
||||
G4int n1 = 0;
|
||||
G4int n2 = numberOfBin/2;
|
||||
G4int n3 = numberOfBin - 1;
|
||||
while (n1 != n3 - 1) {
|
||||
if (theEnergy > binVector(n2))
|
||||
n1 = n2;
|
||||
else
|
||||
n3 = n2;
|
||||
n2 = n1 + (n3 - n1 + 1)/2;
|
||||
}
|
||||
if (verboseLevel > 1) G4cout <<
|
||||
"G4LPhysicsFreeVector::FindBinLocation: returning " << n1 << G4endl;
|
||||
return (size_t)n1;
|
||||
}
|
||||
@@ -1,12 +1,12 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
// the GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4OrderedTable.hh,v 1.1 1999/01/07 16:09:01 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
// $Id: G4OrderedTable.hh,v 1.4 1999/11/16 17:40:39 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
@@ -21,16 +21,16 @@
|
||||
#define G4OrderedTable_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include <rw/tvordvec.h>
|
||||
#include <rw/tpordvec.h>
|
||||
#include "g4rw/tvordvec.h"
|
||||
#include "g4rw/tpordvec.h"
|
||||
|
||||
class G4ValVector : public RWTValOrderedVector<G4double>
|
||||
class G4ValVector : public G4RWTValOrderedVector<G4double>
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
G4ValVector(size_t capac=RWDEFAULT_CAPACITY)
|
||||
: RWTValOrderedVector<G4double>(capac) {;}
|
||||
G4ValVector(size_t capac=G4RWDEFAULT_CAPACITY)
|
||||
: G4RWTValOrderedVector<G4double>(capac) {;}
|
||||
|
||||
virtual ~G4ValVector() {;}
|
||||
|
||||
@@ -42,6 +42,6 @@ class G4ValVector : public RWTValOrderedVector<G4double>
|
||||
|
||||
};
|
||||
|
||||
typedef RWTPtrOrderedVector<G4ValVector> G4OrderedTable;
|
||||
typedef G4RWTPtrOrderedVector<G4ValVector> G4OrderedTable;
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
// the GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4PhysicsFreeVector.hh,v 1.1 1999/01/07 16:09:01 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
// $Id: G4PhysicsFreeVector.hh,v 1.2 1999/11/16 17:40:40 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
//
|
||||
//--------------------------------------------------------------------
|
||||
@@ -14,7 +14,8 @@
|
||||
//
|
||||
// G4PhysicsFreeVector.hh
|
||||
//
|
||||
// Description:
|
||||
// Class description:
|
||||
//
|
||||
// A physics vector which has values of energy-loss, cross-section,
|
||||
// and other physics values of a particle in matter in a given
|
||||
// range of the energy, momentum, etc. The scale of energy/momentum
|
||||
@@ -22,7 +23,7 @@
|
||||
// restrication is that bin values alway have to increase from
|
||||
// a lower bin to a higher bin. This is necessary for the binary
|
||||
// search to work correctly.
|
||||
//
|
||||
|
||||
// History:
|
||||
// 02 Dec. 1995, G.Cosmo : Structure created based on object model
|
||||
// 06 Jun. 1996, K.Amako : Implemented the 1st version
|
||||
@@ -58,10 +59,10 @@ class G4PhysicsFreeVector : public G4PhysicsVector
|
||||
// Destructor
|
||||
~G4PhysicsFreeVector();
|
||||
|
||||
// Special PutValue function for PhyiscsFreeVector
|
||||
// Special PutValue function for PhysicsFreeVector
|
||||
void PutValue( size_t binNumber, G4double binValue,
|
||||
G4double dataValue );
|
||||
// To use this method to fill a PhyiscsFreeVector, you have
|
||||
// To use this method to fill a PhysicsFreeVector, you have
|
||||
// to Construct a PhysicsFreeVector of the size you need
|
||||
// using G4PhysicsFreeVector(size_t theNbin). Also take
|
||||
// note that you have to fill all bin values and data
|
||||
@@ -74,8 +75,8 @@ class G4PhysicsFreeVector : public G4PhysicsVector
|
||||
};
|
||||
|
||||
|
||||
inline size_t G4PhysicsFreeVector::FindBinLocation(G4double theEnergy) const {
|
||||
|
||||
inline size_t G4PhysicsFreeVector::FindBinLocation(G4double theEnergy) const
|
||||
{
|
||||
// For G4PhysicsFreeVector, FindBinLocation is implemented using
|
||||
// the binary search algorithm.
|
||||
//
|
||||
@@ -101,17 +102,3 @@ inline size_t G4PhysicsFreeVector::FindBinLocation(G4double theEnergy) const {
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
// the GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4PhysicsLinearVector.hh,v 1.1 1999/01/07 16:09:01 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
// $Id: G4PhysicsLinearVector.hh,v 1.2 1999/11/16 17:40:40 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
//
|
||||
//--------------------------------------------------------------------
|
||||
@@ -14,12 +14,13 @@
|
||||
//
|
||||
// G4PhysicsLinearVector.hh
|
||||
//
|
||||
// Description:
|
||||
// Class description:
|
||||
//
|
||||
// A physics vector which has values of energy-loss, cross-section,
|
||||
// and other physics values of a particle in matter in a given
|
||||
// range of the energy, momentum, etc. The scale of energy/momentum
|
||||
// bins is in linear.
|
||||
//
|
||||
|
||||
// History:
|
||||
// 02 Dec. 1995, G.Cosmo : Structure created based on object model
|
||||
// 03 Mar. 1996, K.Amako : Implemented the 1st version
|
||||
@@ -61,8 +62,8 @@ class G4PhysicsLinearVector : public G4PhysicsVector
|
||||
};
|
||||
|
||||
|
||||
inline size_t G4PhysicsLinearVector::FindBinLocation(G4double theEnergy) const {
|
||||
|
||||
inline size_t G4PhysicsLinearVector::FindBinLocation(G4double theEnergy) const
|
||||
{
|
||||
// For G4PhysicsLinearVector, FindBinLocation is implemented using
|
||||
// a simple arithmetic calculation.
|
||||
//
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
// the GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4PhysicsLogVector.hh,v 1.1 1999/01/07 16:09:01 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
// $Id: G4PhysicsLogVector.hh,v 1.2 1999/11/16 17:40:41 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
//
|
||||
//--------------------------------------------------------------------
|
||||
@@ -14,12 +14,13 @@
|
||||
//
|
||||
// G4PhysicsLogVector.hh
|
||||
//
|
||||
// Description:
|
||||
// Class description:
|
||||
//
|
||||
// A physics vector which has values of energy-loss, cross-section,
|
||||
// and other physics values of a particle in matter in a given
|
||||
// range of the energy, momentum, etc. The scale of energy/momentum
|
||||
// bins is in logarithmic.
|
||||
//
|
||||
|
||||
// History:
|
||||
// 02 Dec. 1995, G.Cosmo : Structure created based on object model
|
||||
// 03 Mar. 1996, K.Amako : Implemented the 1st version
|
||||
@@ -64,8 +65,8 @@ class G4PhysicsLogVector : public G4PhysicsVector
|
||||
};
|
||||
|
||||
|
||||
inline size_t G4PhysicsLogVector::FindBinLocation(G4double theEnergy) const {
|
||||
|
||||
inline size_t G4PhysicsLogVector::FindBinLocation(G4double theEnergy) const
|
||||
{
|
||||
// For G4PhysicsLogVector, FindBinLocation is implemented using
|
||||
// a simple arithmetic calculation.
|
||||
//
|
||||
@@ -80,17 +81,3 @@ inline size_t G4PhysicsLogVector::FindBinLocation(G4double theEnergy) const {
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
// the GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4PhysicsOrderedFreeVector.hh,v 1.1 1999/01/07 16:09:02 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
// $Id: G4PhysicsOrderedFreeVector.hh,v 1.3 1999/11/16 17:40:41 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// PhysicsOrderedFreeVector Class Definition
|
||||
@@ -20,7 +20,8 @@
|
||||
// > cosmetics (only)
|
||||
// mail: gum@triumf.ca
|
||||
//
|
||||
// Description:
|
||||
// Class description:
|
||||
//
|
||||
// A physics ordered free vector inherits from G4PhysicsVector which
|
||||
// has values of energy-loss, cross-section, and other physics values
|
||||
// of a particle in matter in a given range of the energy, momentum,
|
||||
@@ -28,7 +29,7 @@
|
||||
// the user to insert energy/value pairs in sequence. Methods to
|
||||
// Retrieve the Max and Min energies and values from the vector are
|
||||
// also provided.
|
||||
//
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef G4PhysicsOrderedFreeVector_h
|
||||
@@ -38,7 +39,7 @@
|
||||
// Includes
|
||||
/////////////
|
||||
|
||||
#include <rw/tpordvec.h>
|
||||
#include "g4rw/tpordvec.h"
|
||||
#include "G4PhysicsVector.hh"
|
||||
|
||||
/////////////////////
|
||||
@@ -89,57 +90,6 @@ private:
|
||||
G4double LinearInterpolationOfEnergy(G4double aValue, size_t theLocBin);
|
||||
};
|
||||
|
||||
////////////////////
|
||||
// Inline methods
|
||||
////////////////////
|
||||
|
||||
inline
|
||||
G4double G4PhysicsOrderedFreeVector::GetMaxValue()
|
||||
{
|
||||
return dataVector.last();
|
||||
}
|
||||
|
||||
inline
|
||||
G4double G4PhysicsOrderedFreeVector::GetMinValue()
|
||||
{
|
||||
return dataVector.first();
|
||||
}
|
||||
|
||||
inline
|
||||
G4double G4PhysicsOrderedFreeVector::GetMaxLowEdgeEnergy()
|
||||
{
|
||||
return binVector.last();
|
||||
}
|
||||
|
||||
inline
|
||||
G4double G4PhysicsOrderedFreeVector::GetMinLowEdgeEnergy()
|
||||
{
|
||||
return binVector.first();
|
||||
}
|
||||
|
||||
inline
|
||||
void G4PhysicsOrderedFreeVector::DumpValues()
|
||||
{
|
||||
for (G4int i = 0; i < numberOfBin; i++) {
|
||||
G4cout << binVector[i] << "\t" << dataVector[i] << endl;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
inline
|
||||
size_t G4PhysicsOrderedFreeVector::FindBinLocation(G4double theEnergy) const
|
||||
{
|
||||
G4int n1 = 0;
|
||||
G4int n2 = numberOfBin/2;
|
||||
G4int n3 = numberOfBin - 1;
|
||||
while (n1 != n3 - 1) {
|
||||
if (theEnergy > binVector(n2))
|
||||
n1 = n2;
|
||||
else
|
||||
n3 = n2;
|
||||
n2 = n1 + (n3 - n1 + 1)/2;
|
||||
}
|
||||
return (size_t)n1;
|
||||
}
|
||||
#include "G4PhysicsOrderedFreeVector.icc"
|
||||
|
||||
#endif /* G4PhysicsOrderedFreeVector_h */
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
// 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: G4PhysicsOrderedFreeVector.icc,v 1.2 1999/11/23 15:00:03 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// PhysicsOrderedFreeVector Class Inline Functions Definitions
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// File: G4PhysicsOrderedFreeVector.icc
|
||||
// Version: 1.0
|
||||
// Author: Juliet Armstrong
|
||||
// mail: gum@triumf.ca
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////
|
||||
// Inline methods
|
||||
////////////////////
|
||||
|
||||
inline
|
||||
G4double G4PhysicsOrderedFreeVector::GetMaxValue()
|
||||
{
|
||||
return dataVector.last();
|
||||
}
|
||||
|
||||
inline
|
||||
G4double G4PhysicsOrderedFreeVector::GetMinValue()
|
||||
{
|
||||
return dataVector.first();
|
||||
}
|
||||
|
||||
inline
|
||||
G4double G4PhysicsOrderedFreeVector::GetMaxLowEdgeEnergy()
|
||||
{
|
||||
return binVector.last();
|
||||
}
|
||||
|
||||
inline
|
||||
G4double G4PhysicsOrderedFreeVector::GetMinLowEdgeEnergy()
|
||||
{
|
||||
return binVector.first();
|
||||
}
|
||||
|
||||
inline
|
||||
void G4PhysicsOrderedFreeVector::DumpValues()
|
||||
{
|
||||
for (G4int i = 0; i < numberOfBin; i++) {
|
||||
G4cout << binVector[i] << "\t" << dataVector[i] << G4endl;
|
||||
}
|
||||
}
|
||||
|
||||
inline
|
||||
size_t G4PhysicsOrderedFreeVector::FindBinLocation(G4double theEnergy) const
|
||||
{
|
||||
G4int n1 = 0;
|
||||
G4int n2 = numberOfBin/2;
|
||||
G4int n3 = numberOfBin - 1;
|
||||
while (n1 != n3 - 1) {
|
||||
if (theEnergy > binVector(n2))
|
||||
n1 = n2;
|
||||
else
|
||||
n3 = n2;
|
||||
n2 = n1 + (n3 - n1 + 1)/2;
|
||||
}
|
||||
return (size_t)n1;
|
||||
}
|
||||
@@ -1,12 +1,12 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
// the GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4PhysicsTable.hh,v 1.1 1999/01/07 16:09:02 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
// $Id: G4PhysicsTable.hh,v 1.3 1999/11/16 17:40:42 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
@@ -21,11 +21,11 @@
|
||||
#ifndef G4PhysicsTable_h
|
||||
#define G4PhysicsTable_h 1
|
||||
|
||||
#include <rw/tpordvec.h>
|
||||
#include "g4rw/tpordvec.h"
|
||||
#include "globals.hh"
|
||||
#include "G4PhysicsVector.hh"
|
||||
|
||||
typedef RWTPtrOrderedVector<G4PhysicsVector> G4PhysicsTable;
|
||||
typedef G4RWTPtrOrderedVector<G4PhysicsVector> G4PhysicsTable;
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
// the GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4PhysicsVector.hh,v 1.1 1999/01/07 16:09:02 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
// $Id: G4PhysicsVector.hh,v 1.3 1999/11/16 17:40:43 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
@@ -14,13 +14,14 @@
|
||||
//
|
||||
// G4PhysicsVector.hh
|
||||
//
|
||||
// Description:
|
||||
// Class description:
|
||||
//
|
||||
// A physics vector which has values of energy-loss, cross-section,
|
||||
// and other physics values of a particle in matter in a given
|
||||
// range of the energy, momentum, etc.
|
||||
// This class serves as the base class for a vector having various
|
||||
// energy scale, for example like 'log', 'linear', 'free', etc.
|
||||
//
|
||||
|
||||
// History:
|
||||
// 02 Dec. 1995, G.Cosmo : Structure created based on object model
|
||||
// 03 Mar. 1996, K.Amako : Implemented the 1st version
|
||||
@@ -35,15 +36,15 @@
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4DataVector.hh"
|
||||
#include <rw/tpordvec.h>
|
||||
#include "g4rw/tpordvec.h"
|
||||
|
||||
class G4PhysicsVector
|
||||
{
|
||||
public:
|
||||
|
||||
// Constructor and destructor
|
||||
G4PhysicsVector(){};
|
||||
virtual ~G4PhysicsVector(){};
|
||||
G4PhysicsVector();
|
||||
virtual ~G4PhysicsVector();
|
||||
|
||||
// Public functions
|
||||
G4double GetValue(G4double theEnergy, G4bool& isOutRange);
|
||||
@@ -84,11 +85,11 @@ class G4PhysicsVector
|
||||
G4bool IsFilledVectorExist() const;
|
||||
// Is non-empty physics vector already exist?
|
||||
|
||||
void LinkPhysicsTable(RWTPtrOrderedVector<G4PhysicsVector>& theTable);
|
||||
void LinkPhysicsTable(G4RWTPtrOrderedVector<G4PhysicsVector>& theTable);
|
||||
// Link the given G4PhysicsTable to the current G4PhyiscsVector.
|
||||
G4bool IsLinkedTableExist() const;
|
||||
// Has this physics vector an extended physics table?
|
||||
const RWTPtrOrderedVector<G4PhysicsVector>* GetNextTable() const;
|
||||
const G4RWTPtrOrderedVector<G4PhysicsVector>* GetNextTable() const;
|
||||
// Returns the pointer to a physics table created for elements
|
||||
// or isotopes (when the cross-sesctions or energy-losses
|
||||
// depend explicitly on them).
|
||||
@@ -112,7 +113,7 @@ class G4PhysicsVector
|
||||
G4DataVector dataVector; // Vector to keep the crossection/energyloss
|
||||
G4DataVector binVector; // Vector to keep the low edge value of bin
|
||||
|
||||
RWTPtrOrderedVector<G4PhysicsVector>* ptrNextTable;
|
||||
G4RWTPtrOrderedVector<G4PhysicsVector>* ptrNextTable;
|
||||
// Link to the connected physics table
|
||||
|
||||
G4double LinearInterpolation(G4double theEnergy, size_t theLocBin);
|
||||
@@ -125,100 +126,6 @@ class G4PhysicsVector
|
||||
G4String comment;
|
||||
};
|
||||
|
||||
|
||||
inline G4double G4PhysicsVector::operator[](const size_t binNumber) const
|
||||
{
|
||||
return dataVector[binNumber];
|
||||
}
|
||||
|
||||
|
||||
inline G4double G4PhysicsVector::operator()(const size_t binNumber) const
|
||||
{
|
||||
return dataVector(binNumber);
|
||||
}
|
||||
|
||||
|
||||
inline const RWTPtrOrderedVector<G4PhysicsVector>*
|
||||
G4PhysicsVector::GetNextTable() const
|
||||
{
|
||||
return ptrNextTable;
|
||||
}
|
||||
|
||||
|
||||
inline G4double G4PhysicsVector::LinearInterpolation(G4double theEnergy,
|
||||
size_t theLocBin) {
|
||||
|
||||
// Linear interpolation is used to get the value. If the give energy
|
||||
// is in the highest bin, no interpolation will be Done. Because
|
||||
// there is an extra bin hidden from a user at locBin=numberOfBin,
|
||||
// the following interpolation is valid even the current locBin=
|
||||
// numberOfBin-1.
|
||||
|
||||
G4double intplFactor = (theEnergy-binVector(theLocBin))
|
||||
/ (binVector(theLocBin+1)-binVector(theLocBin)); // Interpolation factor
|
||||
|
||||
return dataVector(theLocBin) +
|
||||
( dataVector(theLocBin+1)-dataVector(theLocBin) ) * intplFactor;
|
||||
}
|
||||
|
||||
|
||||
inline G4double G4PhysicsVector::GetValue(G4double theEnergy,
|
||||
G4bool& isOutRange) {
|
||||
|
||||
// Use cache for speed up - check if the value 'theEnergy' is same as the
|
||||
// last call. If it is same, then use the last bin location. Also the
|
||||
// value 'theEnergy' lies between the last energy and low edge of of the
|
||||
// bin of last call, then the last bin location is used.
|
||||
|
||||
isOutRange = false; // No range check.
|
||||
|
||||
size_t locBin;
|
||||
|
||||
if( theEnergy == lastEnergy ) {
|
||||
return lastValue;
|
||||
}
|
||||
else if( (theEnergy < lastEnergy) &&
|
||||
(theEnergy >= binVector(lastBin)) ) {
|
||||
locBin = lastBin;
|
||||
|
||||
lastEnergy = theEnergy;
|
||||
lastValue = LinearInterpolation(theEnergy, locBin);
|
||||
return lastValue;
|
||||
}
|
||||
else if( theEnergy < edgeMin ){
|
||||
lastBin = 0;
|
||||
lastEnergy = theEnergy;
|
||||
lastValue = dataVector(0);
|
||||
return lastValue;
|
||||
}
|
||||
else if( theEnergy >= edgeMax ){
|
||||
lastBin = numberOfBin-1;
|
||||
lastEnergy = theEnergy;
|
||||
lastValue = dataVector( numberOfBin-1 );
|
||||
return lastValue;
|
||||
}
|
||||
else {
|
||||
locBin = FindBinLocation(theEnergy);
|
||||
|
||||
lastBin = locBin;
|
||||
lastEnergy = theEnergy;
|
||||
lastValue = LinearInterpolation(theEnergy, locBin);
|
||||
return lastValue;
|
||||
}
|
||||
}
|
||||
#include "G4PhysicsVector.icc"
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,106 @@
|
||||
// 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: G4PhysicsVector.icc,v 1.1 1999/11/16 17:40:46 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
// GEANT 4 class source file
|
||||
//
|
||||
// G4PhysicsVector.icc
|
||||
//
|
||||
// Description:
|
||||
// A physics vector which has values of energy-loss, cross-section,
|
||||
// and other physics values of a particle in matter in a given
|
||||
// range of the energy, momentum, etc.
|
||||
// This class serves as the base class for a vector having various
|
||||
// energy scale, for example like 'log', 'linear', 'free', etc.
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
|
||||
|
||||
inline G4double G4PhysicsVector::operator[](const size_t binNumber) const
|
||||
{
|
||||
return dataVector[binNumber];
|
||||
}
|
||||
|
||||
|
||||
inline G4double G4PhysicsVector::operator()(const size_t binNumber) const
|
||||
{
|
||||
return dataVector(binNumber);
|
||||
}
|
||||
|
||||
|
||||
inline const G4RWTPtrOrderedVector<G4PhysicsVector>*
|
||||
G4PhysicsVector::GetNextTable() const
|
||||
{
|
||||
return ptrNextTable;
|
||||
}
|
||||
|
||||
|
||||
inline G4double G4PhysicsVector::LinearInterpolation(G4double theEnergy,
|
||||
size_t theLocBin) {
|
||||
|
||||
// Linear interpolation is used to get the value. If the give energy
|
||||
// is in the highest bin, no interpolation will be Done. Because
|
||||
// there is an extra bin hidden from a user at locBin=numberOfBin,
|
||||
// the following interpolation is valid even the current locBin=
|
||||
// numberOfBin-1.
|
||||
|
||||
G4double intplFactor = (theEnergy-binVector(theLocBin))
|
||||
/ (binVector(theLocBin+1)-binVector(theLocBin)); // Interpolation factor
|
||||
|
||||
return dataVector(theLocBin) +
|
||||
( dataVector(theLocBin+1)-dataVector(theLocBin) ) * intplFactor;
|
||||
}
|
||||
|
||||
|
||||
inline G4double G4PhysicsVector::GetValue(G4double theEnergy,
|
||||
G4bool& isOutRange) {
|
||||
|
||||
// Use cache for speed up - check if the value 'theEnergy' is same as the
|
||||
// last call. If it is same, then use the last bin location. Also the
|
||||
// value 'theEnergy' lies between the last energy and low edge of of the
|
||||
// bin of last call, then the last bin location is used.
|
||||
|
||||
isOutRange = false; // No range check.
|
||||
|
||||
size_t locBin;
|
||||
|
||||
if( theEnergy == lastEnergy ) {
|
||||
return lastValue;
|
||||
}
|
||||
else if( (theEnergy < lastEnergy) &&
|
||||
(theEnergy >= binVector(lastBin)) ) {
|
||||
locBin = lastBin;
|
||||
|
||||
lastEnergy = theEnergy;
|
||||
lastValue = LinearInterpolation(theEnergy, locBin);
|
||||
return lastValue;
|
||||
}
|
||||
else if( theEnergy < edgeMin ){
|
||||
lastBin = 0;
|
||||
lastEnergy = theEnergy;
|
||||
lastValue = dataVector(0);
|
||||
return lastValue;
|
||||
}
|
||||
else if( theEnergy >= edgeMax ){
|
||||
lastBin = numberOfBin-1;
|
||||
lastEnergy = theEnergy;
|
||||
lastValue = dataVector( numberOfBin-1 );
|
||||
return lastValue;
|
||||
}
|
||||
else {
|
||||
locBin = FindBinLocation(theEnergy);
|
||||
|
||||
lastBin = locBin;
|
||||
lastEnergy = theEnergy;
|
||||
lastValue = LinearInterpolation(theEnergy, locBin);
|
||||
return lastValue;
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,12 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
// the GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4RotationMatrix.hh,v 1.1 1999/01/07 16:09:02 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
// $Id: G4RotationMatrix.hh,v 1.2 1999/11/16 17:40:47 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
// the GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4ThreeVector.hh,v 1.1 1999/01/07 16:09:02 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
// $Id: G4ThreeVector.hh,v 1.2 1999/11/16 17:40:47 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
@@ -1,19 +1,20 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
// the GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4Timer.hh,v 1.6 1999/05/24 20:39:23 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
// $Id: G4Timer.hh,v 1.8 1999/11/23 15:00:03 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// class G4Timer
|
||||
// Class G4Timer
|
||||
//
|
||||
// Class for timer objects, able to measure elasped user/system process
|
||||
// time.
|
||||
// Class description:
|
||||
//
|
||||
// Class for timer objects, able to measure elasped user/system process time.
|
||||
//
|
||||
// Note: Uses <sys/times.h> & <unistd.h> - POSIX.1 defined
|
||||
//
|
||||
@@ -49,7 +50,7 @@
|
||||
// Real times (arbitrary time 0)
|
||||
// tms fStartTimes,fEndTimes
|
||||
// Timing structures (see times(2)) for start and end times
|
||||
//
|
||||
|
||||
// History:
|
||||
// 23.08.96 P.Kent Updated to also computed real elapsed time
|
||||
// 21.08.95 P.Kent
|
||||
@@ -84,8 +85,7 @@
|
||||
#endif /* WIN32 */
|
||||
|
||||
#include "G4Types.hh"
|
||||
|
||||
class ostream;
|
||||
#include "G4ios.hh"
|
||||
|
||||
class G4Timer
|
||||
{
|
||||
@@ -104,7 +104,7 @@ private:
|
||||
tms fStartTimes,fEndTimes;
|
||||
};
|
||||
|
||||
ostream& operator << (ostream& os, const G4Timer& t);
|
||||
G4std::ostream& operator << (G4std::ostream& os, const G4Timer& t);
|
||||
|
||||
// Inline functions:
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
// the GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4Types.hh,v 1.1 1999/05/24 18:23:09 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
// $Id: G4Types.hh,v 1.3 1999/11/16 17:40:48 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
//
|
||||
// GEANT4 native types
|
||||
@@ -18,9 +18,18 @@
|
||||
|
||||
#include <CLHEP/config/CLHEP.h>
|
||||
|
||||
// Define G4std namespace for standard std.
|
||||
// Needed to allow both ISO/not-ISO ANSI compliant code installations
|
||||
//
|
||||
#ifndef G4USE_STD_NAMESPACE
|
||||
#define G4std
|
||||
#else
|
||||
#define G4std std
|
||||
#endif
|
||||
|
||||
// Typedefs to decouple from library classes
|
||||
// Typedefs for numeric types
|
||||
// [NOTE: Will in future need to be made more sophisticated]
|
||||
//
|
||||
typedef HepDouble G4double;
|
||||
typedef HepFloat G4float;
|
||||
typedef HepInt G4int;
|
||||
@@ -32,4 +41,3 @@ typedef HepInt G4int;
|
||||
typedef long G4long;
|
||||
|
||||
#endif /* G4TYPES_HH */
|
||||
|
||||
|
||||
@@ -1,25 +1,31 @@
|
||||
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
// the GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4UnitsTable.hh,v 1.2 1999/03/30 13:09:25 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
// $Id: G4UnitsTable.hh,v 1.7 1999/11/23 15:00:04 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
//
|
||||
// -----------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
//
|
||||
// For information related to this code contact:
|
||||
// CERN, CN Division, ASD group
|
||||
//
|
||||
// ------------------- class G4UnitsTable -----------------
|
||||
//
|
||||
// 17-05-98: first version, M.Maire
|
||||
// 13-10-98: Units and symbols printed in fxed length
|
||||
// 13-10-98: Units and symbols printed in fixed length
|
||||
|
||||
// Class description:
|
||||
//
|
||||
// This class maintains a table of Units.
|
||||
// A Unit has a name, a symbol, a value and belong to a category (i.e. its
|
||||
// dimensional definition): Length, Time, Energy, etc...
|
||||
// The Units are grouped by category. The TableOfUnits is a list of categories.
|
||||
// The class BestUnit allow to convert automaticaly a physical quantity
|
||||
// from its internal value into the most appropriate Unit of the same category.
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
@@ -28,28 +34,34 @@
|
||||
#define G4UnitsTable_HH
|
||||
|
||||
#include "globals.hh"
|
||||
#include <rw/tpordvec.h>
|
||||
#include "g4rw/tpordvec.h"
|
||||
|
||||
class G4UnitsCategory;
|
||||
typedef RWTPtrOrderedVector<G4UnitsCategory> G4UnitsTable;
|
||||
typedef G4RWTPtrOrderedVector<G4UnitsCategory> G4UnitsTable;
|
||||
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
class G4UnitDefinition
|
||||
{
|
||||
public:
|
||||
public: // with description
|
||||
|
||||
G4UnitDefinition(G4String name, G4String symbol,G4String category,
|
||||
G4double value);
|
||||
|
||||
public: // without description
|
||||
|
||||
~G4UnitDefinition();
|
||||
G4int operator==(const G4UnitDefinition&) const;
|
||||
G4int operator!=(const G4UnitDefinition&) const;
|
||||
|
||||
private:
|
||||
|
||||
G4UnitDefinition(G4UnitDefinition&);
|
||||
G4UnitDefinition& operator=(const G4UnitDefinition&);
|
||||
|
||||
public:
|
||||
public: // with description
|
||||
|
||||
G4String GetName() {return Name;};
|
||||
G4String GetSymbol() {return SymbolName;};
|
||||
G4double GetValue() {return Value;};
|
||||
@@ -66,6 +78,7 @@ public:
|
||||
static G4String GetCategory(G4String);
|
||||
|
||||
private:
|
||||
|
||||
G4String Name; // SI name
|
||||
G4String SymbolName; // SI symbol
|
||||
G4double Value; // value in the internal system of units
|
||||
@@ -79,21 +92,24 @@ private:
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
typedef RWTPtrOrderedVector<G4UnitDefinition> G4UnitsContainer;
|
||||
typedef G4RWTPtrOrderedVector<G4UnitDefinition> G4UnitsContainer;
|
||||
|
||||
class G4UnitsCategory
|
||||
{
|
||||
public:
|
||||
public: // without description
|
||||
|
||||
G4UnitsCategory(G4String name);
|
||||
~G4UnitsCategory();
|
||||
G4int operator==(const G4UnitsCategory&) const;
|
||||
G4int operator!=(const G4UnitsCategory&) const;
|
||||
|
||||
private:
|
||||
|
||||
G4UnitsCategory(G4UnitsCategory&);
|
||||
G4UnitsCategory& operator=(const G4UnitsCategory&);
|
||||
|
||||
public:
|
||||
public: // without description
|
||||
|
||||
G4String GetName() {return Name;};
|
||||
G4UnitsContainer& GetUnitsList() {return UnitsList;};
|
||||
G4int GetNameMxLen() {return NameMxLen;};
|
||||
@@ -103,6 +119,7 @@ public:
|
||||
void PrintCategory();
|
||||
|
||||
private:
|
||||
|
||||
G4String Name; // dimensional family: Length,Volume,Energy ...
|
||||
G4UnitsContainer UnitsList; // List of units in this family
|
||||
G4int NameMxLen; // max length of the units name
|
||||
@@ -113,20 +130,29 @@ private:
|
||||
|
||||
class G4BestUnit
|
||||
{
|
||||
public:
|
||||
G4BestUnit(G4double,G4String);
|
||||
public: // with description
|
||||
|
||||
G4BestUnit(G4double internalValue, G4String category);
|
||||
// This constructor converts a physical quantity from its internalValue
|
||||
// into the most appropriate unit of the same category.
|
||||
// In practice it builds an object VU = (newValue, newUnit)
|
||||
|
||||
~G4BestUnit();
|
||||
|
||||
public:
|
||||
public: // without description
|
||||
|
||||
G4double GetValue() {return Value;};
|
||||
G4String GetCategory() {return Category;};
|
||||
size_t GetIndexOfCategory() {return IndexOfCategory;};
|
||||
|
||||
public: // with description
|
||||
|
||||
friend
|
||||
ostream& operator<<(ostream&,G4BestUnit);
|
||||
|
||||
G4std::ostream& operator<<(G4std::ostream&,G4BestUnit VU);
|
||||
// Default format to print the objet VU above.
|
||||
|
||||
private:
|
||||
|
||||
G4double Value; // value in the internal system of units
|
||||
G4String Category; // dimensional family: Length,Volume,Energy ...
|
||||
size_t IndexOfCategory; // position of Category in UnitsTable
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
// the GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4UnitsTest.hh,v 1.1 1999/04/29 17:55:39 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
//
|
||||
// -*- C++ -*-
|
||||
// $Id: G4UnitsTest.hh,v 1.4 1999/11/19 09:19:30 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
//
|
||||
// Class description:
|
||||
//
|
||||
// This file is a modified version of SystemOfUnits.h
|
||||
// It is provided for checking the overall 'units coherence' of the
|
||||
// Geant4 kernel.
|
||||
@@ -37,6 +37,7 @@
|
||||
// The others physical constants are defined in the header file :
|
||||
// PhysicalConstants.h
|
||||
//
|
||||
|
||||
// Authors: M.Maire, S.Giani
|
||||
//
|
||||
// History:
|
||||
|
||||
@@ -1,29 +1,37 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
// the GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4UserLimits.hh,v 1.1 1999/01/07 16:09:03 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
//
|
||||
// $Id: G4UserLimits.hh,v 1.4 1999/11/23 15:00:04 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
//
|
||||
// class G4UserLimits Simple placeholder for user Step limitations
|
||||
// Paul Kent August 96
|
||||
// class G4UserLimits
|
||||
//
|
||||
// Class description:
|
||||
//
|
||||
// Simple placeholder for user Step limitations
|
||||
//
|
||||
|
||||
// Author: Paul Kent August 96
|
||||
//
|
||||
// 01-11-97: change GetMaxAllowedStep(), Hisaya Kurashige
|
||||
// 08-04-98: new data members, mma
|
||||
//
|
||||
#ifndef G4USERLIMITS_HH
|
||||
#define G4USERLIMITS_HH
|
||||
|
||||
#include "globals.hh"
|
||||
|
||||
class G4Track;
|
||||
|
||||
class G4UserLimits
|
||||
{
|
||||
public:
|
||||
public: // with description
|
||||
|
||||
G4UserLimits(G4double ustepMax = DBL_MAX,
|
||||
G4double utrakMax = DBL_MAX,
|
||||
G4double utimeMax = DBL_MAX,
|
||||
@@ -31,11 +39,12 @@ public:
|
||||
G4double urangMin = 0. );
|
||||
virtual ~G4UserLimits();
|
||||
|
||||
public:
|
||||
public: // with description
|
||||
|
||||
// If a Logical Volume has a G4UserLimits object,
|
||||
//the Step length should be limited as shorter
|
||||
//than MaxAllowedStep in the volume.
|
||||
// In the current design, the others limits are irrelavant in tracking
|
||||
// the Step length should be limited as shorter
|
||||
// than MaxAllowedStep in the volume.
|
||||
// In the current design, the other limits are irrelavant in tracking
|
||||
|
||||
virtual G4double GetMaxAllowedStep(const G4Track&);
|
||||
virtual G4double GetUserMaxTrackLength(const G4Track&) ;
|
||||
@@ -49,12 +58,13 @@ public:
|
||||
virtual void SetUserMinEkine(G4double uekinMin);
|
||||
virtual void SetUserMinRange(G4double urangMin);
|
||||
|
||||
protected:
|
||||
G4double fMaxStep; //max allowed Step size in this volume
|
||||
G4double fMaxTrack; //max total track length
|
||||
G4double fMaxTime; //max time
|
||||
G4double fMinEkine; //min kinetic energy
|
||||
G4double fMinRange; //min remaining range
|
||||
protected: // with description
|
||||
|
||||
G4double fMaxStep; // max allowed Step size in this volume
|
||||
G4double fMaxTrack; // max total track length
|
||||
G4double fMaxTime; // max time
|
||||
G4double fMinEkine; // min kinetic energy (only for charged particles)
|
||||
G4double fMinRange; // min remaining range (only for charged particles)
|
||||
};
|
||||
|
||||
#include "G4UserLimits.icc"
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
// the GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4UserLimits.icc,v 1.1 1999/01/07 16:09:03 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
// $Id: G4UserLimits.icc,v 1.3 1999/11/22 15:12:45 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
//
|
||||
//
|
||||
@@ -15,8 +15,12 @@
|
||||
// 01-11-97: change GetMaxAllowedStep(), Hisaya Kurashige
|
||||
// 08-04-98: new data members, mma
|
||||
//
|
||||
|
||||
#include "G4UserLimits.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline G4UserLimits::G4UserLimits(G4double ustepMax,
|
||||
G4double utrakMax,
|
||||
G4double utimeMax,
|
||||
@@ -26,57 +30,78 @@ inline G4UserLimits::G4UserLimits(G4double ustepMax,
|
||||
fMinEkine(uekinMin),fMinRange(urangMin)
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline G4UserLimits::~G4UserLimits(){}
|
||||
|
||||
// In this implementation, G4UserLimits has a single value
|
||||
// for MaxAllowedStep.
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline G4double G4UserLimits::GetMaxAllowedStep(const G4Track&)
|
||||
{
|
||||
return fMaxStep;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline G4double G4UserLimits::GetUserMaxTrackLength(const G4Track&)
|
||||
{
|
||||
return fMaxTrack;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline G4double G4UserLimits::GetUserMaxTime(const G4Track&)
|
||||
{
|
||||
return fMaxTime;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline G4double G4UserLimits::GetUserMinEkine(const G4Track&)
|
||||
{
|
||||
return fMinEkine;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline G4double G4UserLimits::GetUserMinRange(const G4Track&)
|
||||
{
|
||||
return fMinRange;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline void G4UserLimits::SetMaxAllowedStep(G4double ustepMax)
|
||||
{
|
||||
fMaxStep=ustepMax;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline void G4UserLimits::SetUserMaxTrackLength(G4double utrakMax)
|
||||
{
|
||||
fMaxTrack=utrakMax;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline void G4UserLimits::SetUserMaxTime(G4double utimeMax)
|
||||
{
|
||||
fMaxTime=utimeMax;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline void G4UserLimits::SetUserMinEkine(G4double uekinMin)
|
||||
{
|
||||
fMinEkine=uekinMin;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline void G4UserLimits::SetUserMinRange(G4double urangMin)
|
||||
{
|
||||
fMinRange=urangMin;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -1,3 +1,20 @@
|
||||
// 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: G4coutDestination.hh,v 1.2 1999/11/16 17:40:51 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
//
|
||||
// ---------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
//
|
||||
// G4coutDestination.hh
|
||||
//
|
||||
// ---------------------------------------------------------------
|
||||
#ifndef G4COUTDESTINATION_HH
|
||||
#define G4COUTDESTINATION_HH
|
||||
|
||||
@@ -9,5 +26,6 @@ public:
|
||||
virtual int ReceiveG4cout(G4String){return 0;}
|
||||
virtual int ReceiveG4cerr(G4String){return 0;}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1,3 +1,20 @@
|
||||
// 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: G4ios.hh,v 1.4 1999/11/23 15:00:04 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
//
|
||||
// ---------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
//
|
||||
// G4ios.hh
|
||||
//
|
||||
// ---------------------------------------------------------------
|
||||
#ifndef included_G4ios
|
||||
#define included_G4ios
|
||||
|
||||
@@ -11,14 +28,13 @@
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#include <iostream.h>
|
||||
#include "g4std/iostream"
|
||||
#include "G4Types.hh"
|
||||
|
||||
#ifdef G4STREAM
|
||||
extern ostream G4cout;
|
||||
extern ostream G4cerr;
|
||||
#else
|
||||
#define G4cout cout
|
||||
#define G4cerr cerr
|
||||
#endif
|
||||
extern G4std::ostream G4cout;
|
||||
extern G4std::ostream G4cerr;
|
||||
|
||||
#define G4cin G4std::cin
|
||||
#define G4endl G4std::endl
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,73 +1,37 @@
|
||||
// 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: G4strstreambuf.hh,v 1.4 1999/11/23 15:00:04 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
//
|
||||
// ---------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
//
|
||||
// G4strstrambuf.hh
|
||||
//
|
||||
// ---------------------------------------------------------------
|
||||
#ifndef G4STRSTREAM_HH
|
||||
#define G4STRSTREAM_HH
|
||||
|
||||
#include <iostream.h>
|
||||
#ifdef WIN32
|
||||
#include <Strstrea.h>
|
||||
#else
|
||||
#include <strstream.h>
|
||||
#endif
|
||||
#include "g4std/strstream"
|
||||
#include "globals.hh"
|
||||
#include "G4coutDestination.hh"
|
||||
|
||||
class G4strstreambuf;
|
||||
extern G4strstreambuf G4coutbuf;
|
||||
extern G4strstreambuf G4cerrbuf;
|
||||
#ifndef G4STREAM_STREAMBUF_IMPLEMENTATION
|
||||
|
||||
|
||||
class G4strstreambuf : public strstreambuf {
|
||||
public:
|
||||
G4strstreambuf() {
|
||||
destination = NULL;
|
||||
}
|
||||
void SetDestination(G4coutDestination * value) {
|
||||
destination = value;
|
||||
}
|
||||
int sync() {
|
||||
G4String stringToSend;
|
||||
int c;
|
||||
int result;
|
||||
result = EOF;
|
||||
while (( c= sbumpc() ) != EOF) {
|
||||
stringToSend += (char) c;
|
||||
}
|
||||
if(this == & G4coutbuf && destination != NULL) {
|
||||
result = destination->ReceiveG4cout(stringToSend);
|
||||
} else
|
||||
if(this == & G4cerrbuf && destination != NULL) {
|
||||
result = destination->ReceiveG4cerr(stringToSend);
|
||||
} else
|
||||
if(this == & G4coutbuf && destination == NULL) {
|
||||
cout << stringToSend << flush;
|
||||
result =0;
|
||||
} else
|
||||
if(this == & G4cerrbuf && destination == NULL) {
|
||||
cerr << stringToSend << flush;
|
||||
result =0;
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
private:
|
||||
G4coutDestination *destination;
|
||||
};
|
||||
|
||||
//
|
||||
|
||||
#else // G4STREAM_STREAMBUF_IMPLEMENTATION :
|
||||
|
||||
// On NT the upper implementation involves that
|
||||
// first character is lost when sending to destination !
|
||||
// Below implementation is correct on this platform.
|
||||
|
||||
|
||||
class G4strstreambuf : public streambuf {
|
||||
class G4strstreambuf : public G4std::streambuf {
|
||||
public:
|
||||
G4strstreambuf() {
|
||||
destination = NULL;
|
||||
count = 0;
|
||||
size = 127;
|
||||
size = 4095;
|
||||
buffer = new char[size+1];
|
||||
}
|
||||
~G4strstreambuf() {
|
||||
@@ -111,10 +75,10 @@ public:
|
||||
} else if(this == & G4cerrbuf && destination != NULL) {
|
||||
result = destination->ReceiveG4cerr(stringToSend);
|
||||
} else if(this == & G4coutbuf && destination == NULL) {
|
||||
cout << stringToSend << flush;
|
||||
G4std::cout << stringToSend << G4std::flush;
|
||||
result =0;
|
||||
} else if(this == & G4cerrbuf && destination == NULL) {
|
||||
cerr << stringToSend << flush;
|
||||
G4std::cerr << stringToSend << G4std::flush;
|
||||
result =0;
|
||||
}
|
||||
return result;
|
||||
@@ -126,8 +90,6 @@ private:
|
||||
int count,size;
|
||||
};
|
||||
|
||||
#endif // G4STREAM_STREAMBUF_IMPLEMENTATION :
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,19 +1,20 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
// the GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: PhysicalConstants.h,v 1.1 1999/01/07 16:09:04 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
//
|
||||
// -*- C++ -*-
|
||||
// $Id: PhysicalConstants.h,v 1.4 1999/11/19 09:19:31 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
//
|
||||
// Class description:
|
||||
//
|
||||
// HEP coherent Physical Constants
|
||||
//
|
||||
// This file has been provided by Geant4 (simulation toolkit for HEP).
|
||||
// This file has been provided to CLHEP by Geant4 (simulation toolkit for HEP).
|
||||
//
|
||||
// The basic units are :
|
||||
// millimeter
|
||||
@@ -36,6 +37,7 @@
|
||||
//
|
||||
// You can add your own constants.
|
||||
//
|
||||
|
||||
// Author: M.Maire
|
||||
//
|
||||
// History:
|
||||
@@ -48,6 +50,7 @@
|
||||
#define HEP_PHYSICAL_CONSTANTS_H
|
||||
|
||||
#include "SystemOfUnits.h"
|
||||
///#include "G4UnitsTest.hh"
|
||||
|
||||
//
|
||||
//
|
||||
@@ -136,8 +139,3 @@ static const HepDouble kGasThreshold = 10.*mg/cm3;
|
||||
static const HepDouble universe_mean_density = 1.e-25*g/cm3;
|
||||
|
||||
#endif /* HEP_PHYSICAL_CONSTANTS_H */
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,19 +1,20 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
// the GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: SystemOfUnits.h,v 1.1 1999/01/07 16:09:04 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
//
|
||||
// -*- C++ -*-
|
||||
// $Id: SystemOfUnits.h,v 1.4 1999/11/19 09:19:31 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
//
|
||||
// Class description:
|
||||
//
|
||||
// HEP coherent system of Units
|
||||
//
|
||||
// This file has been provided by Geant4 (simulation toolkit for HEP).
|
||||
// This file has been provided to CLHEP by Geant4 (simulation toolkit for HEP).
|
||||
//
|
||||
// The basic units are :
|
||||
// millimeter (millimeter)
|
||||
@@ -36,6 +37,7 @@
|
||||
// The others physical constants are defined in the header file :
|
||||
// PhysicalConstants.h
|
||||
//
|
||||
|
||||
// Authors: M.Maire, S.Giani
|
||||
//
|
||||
// History:
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
// 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: algorithm,v 1.3 1999/11/16 17:42:57 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
// ---------------- algorithm ----------------
|
||||
//
|
||||
#ifndef G4_ALGORITHM_H
|
||||
#define G4_ALGORITHM_H
|
||||
|
||||
#ifdef G4USE_OLDSTL
|
||||
#include <algo.h>
|
||||
#else
|
||||
#include <algorithm>
|
||||
#endif /* G4USE_OLDSTL */
|
||||
|
||||
#endif /* G4_ALGORITHM_H */
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
// 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: fstream,v 1.3 1999/11/16 17:43:06 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
// ---------------- fstream ----------------
|
||||
//
|
||||
#ifndef G4_FSTREAM_H
|
||||
#define G4_FSTREAM_H
|
||||
|
||||
#ifndef G4USE_STD_NAMESPACE
|
||||
#include <fstream.h>
|
||||
#else
|
||||
#include <fstream>
|
||||
#endif
|
||||
|
||||
#endif /* G4_FSTREAM_H */
|
||||
@@ -0,0 +1,23 @@
|
||||
// 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: functional,v 1.3 1999/11/16 17:43:06 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
// ---------------- functional ----------------
|
||||
//
|
||||
#ifndef G4_FUNCTIONAL_H
|
||||
#define G4_FUNCTIONAL_H
|
||||
|
||||
#ifdef G4USE_OLDSTL
|
||||
#include <function.h>
|
||||
#else
|
||||
#include <functional>
|
||||
#endif /* G4USE_OLDSTL */
|
||||
|
||||
#endif /* G4_FUNCTIONAL_H */
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
// 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: iomanip,v 1.3 1999/11/16 17:43:08 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
// ---------------- iomanip ----------------
|
||||
//
|
||||
#ifndef G4_IOMANIP_H
|
||||
#define G4_IOMANIP_H
|
||||
|
||||
#ifndef G4USE_STD_NAMESPACE
|
||||
#include <iomanip.h>
|
||||
#else
|
||||
#include <iomanip>
|
||||
#endif
|
||||
|
||||
#endif /* G4_IOMANIP_H */
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
// 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: iostream,v 1.3 1999/11/16 17:43:08 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
// ---------------- iostream ----------------
|
||||
//
|
||||
#ifndef G4_IOSTREAM_H
|
||||
#define G4_IOSTREAM_H
|
||||
|
||||
#ifndef G4USE_STD_NAMESPACE
|
||||
#include <iostream.h>
|
||||
#else
|
||||
#include <iostream>
|
||||
#endif
|
||||
|
||||
#endif /* G4_IOSTREAM_H */
|
||||
@@ -0,0 +1,22 @@
|
||||
// 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: map,v 1.3 1999/11/16 17:43:08 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
// ---------------- map ----------------
|
||||
//
|
||||
#ifndef G4_MAP_H
|
||||
#define G4_MAP_H
|
||||
|
||||
#ifdef G4USE_OLDSTL
|
||||
#include <map.h>
|
||||
#else
|
||||
#include <map>
|
||||
#endif /* G4USE_OLDSTL */
|
||||
|
||||
#endif /* G4_MAP_H */
|
||||
@@ -0,0 +1,23 @@
|
||||
// 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: set,v 1.3 1999/11/16 17:43:08 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
// ---------------- set ----------------
|
||||
//
|
||||
#ifndef G4_SET_H
|
||||
#define G4_SET_H
|
||||
|
||||
#ifdef G4USE_OLDSTL
|
||||
#include <set.h>
|
||||
#else
|
||||
#include <set>
|
||||
#endif /* G4USE_OLDSTL */
|
||||
|
||||
#endif /* G4_SET_H */
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
// 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: streambuf,v 1.3 1999/11/16 17:43:09 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
// ---------------- streambuf ----------------
|
||||
//
|
||||
#ifndef G4_STREAMBUF_H
|
||||
#define G4_STREAMBUF_H
|
||||
|
||||
#ifndef G4USE_STD_NAMESPACE
|
||||
#ifdef WIN32
|
||||
#include <strstrea.h>
|
||||
#else
|
||||
#include <g4std/strstream>
|
||||
#endif /* WIN32 */
|
||||
#else
|
||||
#include <streambuf>
|
||||
#endif /* G4USE_STD_NAMESPACE */
|
||||
|
||||
#endif /* G4_STREAMBUF_H */
|
||||
@@ -0,0 +1,26 @@
|
||||
// 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: strstream,v 1.3 1999/11/16 17:43:09 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
// ---------------- strstream ----------------
|
||||
//
|
||||
#ifndef G4_STRSTREAM_H
|
||||
#define G4_STRSTREAM_H
|
||||
|
||||
#ifndef G4USE_STD_NAMESPACE
|
||||
#ifdef WIN32
|
||||
#include <strstrea.h>
|
||||
#else
|
||||
#include <strstream.h>
|
||||
#endif /* WIN32 */
|
||||
#else
|
||||
#include <strstream>
|
||||
#endif /* G4USE_STD_NAMESPACE */
|
||||
|
||||
#endif /* G4_STRSTREAM_H */
|
||||
@@ -0,0 +1,24 @@
|
||||
// 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: vector,v 1.3 1999/11/16 17:43:09 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
// ---------------- vector ----------------
|
||||
//
|
||||
#ifndef G4_VECTOR_H
|
||||
#define G4_VECTOR_H
|
||||
|
||||
#ifdef G4USE_OLDSTL
|
||||
#include <vector.h>
|
||||
#else
|
||||
#include <algorithm>
|
||||
#include <vector>
|
||||
#endif /* G4USE_OLDSTL */
|
||||
|
||||
#endif /* G4_VECTOR_H */
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
// the GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: globals.hh,v 1.8 1999/05/25 03:44:39 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
// $Id: globals.hh,v 1.11 1999/11/23 15:00:04 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
//
|
||||
// Global Constants and typedefs
|
||||
@@ -45,8 +45,8 @@
|
||||
#endif
|
||||
|
||||
#ifdef G4USE_STL
|
||||
#include <algorithm>
|
||||
#define CLHEP_MAX_MIN_DEFINED
|
||||
#include "g4std/algorithm"
|
||||
#define CLHEP_MAX_MIN_DEFINED
|
||||
#endif
|
||||
// min, max, abs and sqr are in TemplateFunctions.h.
|
||||
// Includes also CLHEP.h with typedef for numeric types and
|
||||
@@ -56,16 +56,15 @@
|
||||
// Include base types
|
||||
#include "G4Types.hh"
|
||||
|
||||
// Other typedefs
|
||||
#include <rw/cstring.h>
|
||||
typedef RWCString G4String;
|
||||
// Get definition of G4String
|
||||
#include "g4rw/cstring.h"
|
||||
|
||||
// Includes some additional definitions
|
||||
#include "templates.hh"
|
||||
|
||||
// cbrt() function - define G4_NO_CBRT if the function is not available
|
||||
#ifdef G4_NO_CBRT
|
||||
static double cbrt(double x) { return pow(x,1./3.); }
|
||||
static double cbrt(double x) { return pow(x,1./3.); }
|
||||
#endif
|
||||
|
||||
// System of Units and Physical Constants
|
||||
@@ -75,9 +74,9 @@ static double cbrt(double x) { return pow(x,1./3.); }
|
||||
// Global error function
|
||||
void G4Exception(const char* s=0);
|
||||
#ifdef G4USE_STL
|
||||
#include <string>
|
||||
void G4Exception(string s);
|
||||
void G4Exception(G4String s);
|
||||
void G4Exception(G4std::string s);
|
||||
void G4Exception(G4String s);
|
||||
#endif
|
||||
|
||||
#endif /* GLOBALS_HH */
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
// the GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: templates.hh,v 1.2 1999/05/19 18:45:00 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
// $Id: templates.hh,v 1.3 1999/11/16 17:40:53 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
//
|
||||
// -*- C++ -*-
|
||||
|
||||
Reference in New Issue
Block a user