Import Geant4 5.1.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 10:15:15 +02:00
parent 37fff30d2e
commit fbd4999cf7
4396 changed files with 56662 additions and 52446 deletions
+15 -1
View File
@@ -1,4 +1,4 @@
$Id: History,v 1.29 2002/11/20 13:19:09 gcosmo Exp $
$Id: History,v 1.32 2003/04/11 07:13:24 dressel Exp $
-------------------------------------------------------------------
=========================================================
@@ -17,6 +17,20 @@ committal in the CVS repository !
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
Apt, 11th 2003 M.Dressel geombias-V05-00-03
- implementation of "IsInWorld" in G4IStore using IsAncestor of
G4LogicalVolume
Apr, 3rd 2003 G.Cosmo geombias-V05-00-02
- Fixed few trivial strict pedantic warnings.
Mar, 27th 2003 G.Cosmo geombias-V05-00-01
- G4ParallelNavigator.cc: set cout precision to 12 (was 50 !?!).
Mar, 24th 2003 M.Dressel geombias-V05-00-00
- G4ParallelNavigator.cc: modified shift mechanism
in ComputeStepLengthShifted().
Nov, 20th 2002 G.Cosmo geombias-V04-01-04
- changed definition of G4NSplit_Weight from struct to class
to allow porting on Windows DLLs.
@@ -22,7 +22,7 @@
//
//
// $Id: G4GeometryCell.hh,v 1.5 2002/10/22 13:18:43 dressel Exp $
// GEANT4 tag $Name: geant4-05-00 $
// GEANT4 tag $Name: geant4-05-01 $
//
// ----------------------------------------------------------------------
// Class G4GeometryCell
@@ -22,7 +22,7 @@
//
//
// $Id: G4GeometryCellComp.hh,v 1.1 2002/10/22 13:18:44 dressel Exp $
// GEANT4 tag $Name: geant4-05-00 $
// GEANT4 tag $Name: geant4-05-01 $
//
// ----------------------------------------------------------------------
// Class G4GeometryCellComp
@@ -22,7 +22,7 @@
//
//
// $Id: G4GeometryCellImportance.hh,v 1.2 2002/10/22 13:18:44 dressel Exp $
// GEANT4 tag $Name: geant4-05-00 $
// GEANT4 tag $Name: geant4-05-01 $
//
// ----------------------------------------------------------------------
// Class G4GeometryCellImportance
@@ -22,7 +22,7 @@
//
//
// $Id: G4GeometryCellStep.hh,v 1.1 2002/10/22 13:18:44 dressel Exp $
// GEANT4 tag $Name: geant4-05-00 $
// GEANT4 tag $Name: geant4-05-01 $
//
// ----------------------------------------------------------------------
// Class G4GeometryCellStep
@@ -22,7 +22,7 @@
//
//
// $Id: G4GeometryCellStepStream.hh,v 1.1 2002/10/22 13:18:44 dressel Exp $
// GEANT4 tag $Name: geant4-05-00 $
// GEANT4 tag $Name: geant4-05-01 $
//
// ----------------------------------------------------------------------
// Declarations
+1 -1
View File
@@ -22,7 +22,7 @@
//
//
// $Id: G4IStore.hh,v 1.9 2002/10/22 13:18:44 dressel Exp $
// GEANT4 tag $Name: geant4-05-00 $
// GEANT4 tag $Name: geant4-05-01 $
//
// ----------------------------------------------------------------------
// Class G4IStore
@@ -22,7 +22,7 @@
//
//
// $Id: G4ImportanceAlgorithm.hh,v 1.6 2002/10/14 12:36:00 dressel Exp $
// GEANT4 tag $Name: geant4-05-00 $
// GEANT4 tag $Name: geant4-05-01 $
//
// ----------------------------------------------------------------------
// Class G4ImportanceAlgorithm
@@ -22,7 +22,7 @@
//
//
// $Id: G4ImportanceFinder.hh,v 1.6 2002/10/14 12:36:00 dressel Exp $
// GEANT4 tag $Name: geant4-05-00 $
// GEANT4 tag $Name: geant4-05-01 $
//
// ----------------------------------------------------------------------
// Class G4ImportanceFinder
@@ -22,7 +22,7 @@
//
//
// $Id: G4ImportanceSplitExaminer.hh,v 1.5 2002/10/14 12:36:00 dressel Exp $
// GEANT4 tag $Name: geant4-05-00 $
// GEANT4 tag $Name: geant4-05-01 $
//
// ----------------------------------------------------------------------
// Class G4ImportanceSplitExaminer
@@ -22,7 +22,7 @@
//
//
// $Id: G4Nsplit_Weight.hh,v 1.9 2002/11/20 13:18:47 gcosmo Exp $
// GEANT4 tag $Name: geant4-05-00 $
// GEANT4 tag $Name: geant4-05-01 $
//
// ----------------------------------------------------------------------
// Class G4Nsplit_Weight
@@ -22,7 +22,7 @@
//
//
// $Id: G4ParallelNavigator.hh,v 1.9 2002/10/14 12:36:00 dressel Exp $
// GEANT4 tag $Name: geant4-05-00 $
// GEANT4 tag $Name: geant4-05-01 $
//
// ----------------------------------------------------------------------
// Class G4ParallelNavigator
@@ -22,7 +22,7 @@
//
//
// $Id: G4ParallelStepper.hh,v 1.6 2002/10/22 13:18:45 dressel Exp $
// GEANT4 tag $Name: geant4-05-00 $
// GEANT4 tag $Name: geant4-05-01 $
//
// ----------------------------------------------------------------------
// Class G4ParallelStepper
@@ -22,7 +22,7 @@
//
//
// $Id: G4ParallelWorld.hh,v 1.6 2002/10/14 12:36:00 dressel Exp $
// GEANT4 tag $Name: geant4-05-00 $
// GEANT4 tag $Name: geant4-05-01 $
//
// ----------------------------------------------------------------------
// Class G4ParallelWorld
@@ -22,7 +22,7 @@
//
//
// $Id: G4VCellScorer.hh,v 1.6 2002/10/28 09:53:50 dressel Exp $
// GEANT4 tag $Name: geant4-05-00 $
// GEANT4 tag $Name: geant4-05-01 $
//
// ----------------------------------------------------------------------
// Class G4VCellScorer
@@ -22,7 +22,7 @@
//
//
// $Id: G4VCellScorerStore.hh,v 1.6 2002/10/28 09:53:50 dressel Exp $
// GEANT4 tag $Name: geant4-05-00 $
// GEANT4 tag $Name: geant4-05-01 $
//
// ----------------------------------------------------------------------
// Class G4VCellScorerStore
@@ -22,7 +22,7 @@
//
//
// $Id: G4VGCellFinder.hh,v 1.1 2002/10/16 14:30:00 dressel Exp $
// GEANT4 tag $Name: geant4-05-00 $
// GEANT4 tag $Name: geant4-05-01 $
//
// ----------------------------------------------------------------------
// Class G4VGCellFinder
+1 -1
View File
@@ -22,7 +22,7 @@
//
//
// $Id: G4VIStore.hh,v 1.8 2002/10/14 12:36:01 dressel Exp $
// GEANT4 tag $Name: geant4-05-00 $
// GEANT4 tag $Name: geant4-05-01 $
//
// ----------------------------------------------------------------------
// Class G4VIStore
@@ -22,7 +22,7 @@
//
//
// $Id: G4VImportanceAlgorithm.hh,v 1.7 2002/10/14 12:36:01 dressel Exp $
// GEANT4 tag $Name: geant4-05-00 $
// GEANT4 tag $Name: geant4-05-01 $
//
// ----------------------------------------------------------------------
// Class G4VImportanceAlgorithm
@@ -22,7 +22,7 @@
//
//
// $Id: G4VImportanceSplitExaminer.hh,v 1.4 2002/10/14 12:36:01 dressel Exp $
// GEANT4 tag $Name: geant4-05-00 $
// GEANT4 tag $Name: geant4-05-01 $
//
// ----------------------------------------------------------------------
// Class G4VImportanceSplitExaminer
@@ -22,7 +22,7 @@
//
//
// $Id: G4VPGeoDriver.hh,v 1.6 2002/10/14 12:36:01 dressel Exp $
// GEANT4 tag $Name: geant4-05-00 $
// GEANT4 tag $Name: geant4-05-01 $
//
// ----------------------------------------------------------------------
// Class G4VPGeoDriver
@@ -22,7 +22,7 @@
//
//
// $Id: G4VParallelStepper.hh,v 1.7 2002/10/22 13:18:46 dressel Exp $
// GEANT4 tag $Name: geant4-05-00 $
// GEANT4 tag $Name: geant4-05-01 $
//
// ----------------------------------------------------------------------
// Class G4VParallelStepper
+1 -1
View File
@@ -22,7 +22,7 @@
//
//
// $Id: G4VScorer.hh,v 1.1 2002/10/28 09:53:50 dressel Exp $
// GEANT4 tag $Name: geant4-05-00 $
// GEANT4 tag $Name: geant4-05-01 $
//
// ----------------------------------------------------------------------
// Class G4VScorer
@@ -22,7 +22,7 @@
//
//
// $Id: G4VWeightWindowAlgorithm.hh,v 1.5 2002/10/14 12:36:01 dressel Exp $
// GEANT4 tag $Name: geant4-05-00 $
// GEANT4 tag $Name: geant4-05-01 $
//
// ----------------------------------------------------------------------
// Class G4VWeightWindowAlgorithm
@@ -22,7 +22,7 @@
//
//
// $Id: G4WeightWindowAlgorithm.hh,v 1.4 2002/10/14 12:36:01 dressel Exp $
// GEANT4 tag $Name: geant4-05-00 $
// GEANT4 tag $Name: geant4-05-01 $
//
// ----------------------------------------------------------------------
// Class G4WeightWindowAlgorithm
@@ -22,7 +22,7 @@
//
//
// $Id: G4GeometryCell.cc,v 1.5 2002/10/22 13:18:46 dressel Exp $
// GEANT4 tag $Name: geant4-05-00 $
// GEANT4 tag $Name: geant4-05-01 $
//
// ----------------------------------------------------------------------
// GEANT 4 class source file
@@ -21,7 +21,7 @@
// ********************************************************************
//
// $Id: G4GeometryCellComp.cc,v 1.3 2002/12/13 11:54:19 gcosmo Exp $
// GEANT4 tag $Name: geant4-05-00 $
// GEANT4 tag $Name: geant4-05-01 $
//
// ----------------------------------------------------------------------
// GEANT 4 class source file
@@ -22,7 +22,7 @@
//
//
// $Id: G4GeometryCellImportance.cc,v 1.3 2002/10/22 13:18:46 dressel Exp $
// GEANT4 tag $Name: geant4-05-00 $
// GEANT4 tag $Name: geant4-05-01 $
//
// ----------------------------------------------------------------------
// GEANT 4 class source file
@@ -22,7 +22,7 @@
//
//
// $Id: G4GeometryCellStep.cc,v 1.1 2002/10/22 13:18:46 dressel Exp $
// GEANT4 tag $Name: geant4-05-00 $
// GEANT4 tag $Name: geant4-05-01 $
//
// ----------------------------------------------------------------------
// GEANT 4 class source file
@@ -22,7 +22,7 @@
//
//
// $Id: G4GeometryCellStepStream.cc,v 1.1 2002/10/22 13:18:47 dressel Exp $
// GEANT4 tag $Name: geant4-05-00 $
// GEANT4 tag $Name: geant4-05-01 $
//
// ----------------------------------------------------------------------
// GEANT 4 class source file
+22 -16
View File
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4IStore.cc,v 1.10 2002/11/04 10:43:07 dressel Exp $
// GEANT4 tag $Name: geant4-05-00 $
// $Id: G4IStore.cc,v 1.12 2003/04/03 10:45:51 dressel Exp $
// GEANT4 tag $Name: geant4-05-01 $
//
// ----------------------------------------------------------------------
// GEANT 4 class source file
@@ -35,7 +35,7 @@
#include "G4VPhysicalVolume.hh"
#include "G4GeometryCell.hh"
#include "G4GeometryCellStepStream.hh"
#include "G4LogicalVolume.hh"
G4IStore::G4IStore(const G4VPhysicalVolume &worldvolume) :
fWorldVolume(worldvolume)
@@ -51,9 +51,6 @@ const G4VPhysicalVolume &G4IStore::GetWorldVolume() const
void G4IStore::SetInternalIterator(const G4GeometryCell &gCell) const
{
// if (!IsInWorld(aVolume)) {
// Error("SetInternalIterator: physical volume not in this World");
// }
fCurrentIterator = fGeometryCelli.find(gCell);
}
@@ -62,6 +59,9 @@ void G4IStore::AddImportanceGeometryCell(G4double importance,
if (importance < 0 ) {
Error("AddImportanceGeometryCell: invalid importance value given");
}
if (!IsInWorld(gCell.GetPhysicalVolume()) ) {
Error("AddImportanceGeometryCell: physical volume not in this World");
}
SetInternalIterator(gCell);
if (fCurrentIterator!=fGeometryCelli.end()) {
Error("AddImportanceGeometryCell: Region allready exists");
@@ -82,6 +82,9 @@ void G4IStore::ChangeImportance(G4double importance,
if (importance < 0 ) {
Error("ChangeImportance: Invalid importance value given");
}
if (!IsInWorld(gCell.GetPhysicalVolume()) ) {
Error("ChangeImportance: physical volume not in this World");
}
SetInternalIterator(gCell);
if (fCurrentIterator==fGeometryCelli.end()) {
Error("ChangeImportance: Region does not exist");
@@ -120,23 +123,26 @@ G4double G4IStore::GetImportance(const G4GeometryCell &gCell) const
}
G4bool G4IStore::IsKnown(const G4GeometryCell &gCell) const {
SetInternalIterator(gCell);
return (fCurrentIterator!=fGeometryCelli.end());
G4bool inWorldKnown(IsInWorld(gCell.GetPhysicalVolume()));
if ( inWorldKnown ) {
SetInternalIterator(gCell);
inWorldKnown = (fCurrentIterator!=fGeometryCelli.end());
}
return inWorldKnown;
}
G4bool G4IStore::IsInWorld(const G4VPhysicalVolume &aVolume) const
{
return true;
/*
if (!aVolume) return false;
if (*aVolume==G4ParallelWorld::GetWorldVolume()) {
return true;
G4bool isIn(true);
if (!(aVolume == fWorldVolume)) {
isIn = fWorldVolume.GetLogicalVolume()->IsAncestor(&aVolume);
}
return IsInWorld(aVolume->GetMother());
*/
return isIn;
}
void G4IStore::Error(const G4String &m) const
{
G4cout << "ERROR - G4IStore::" << m << G4endl;
@@ -22,7 +22,7 @@
//
//
// $Id: G4ImportanceAlgorithm.cc,v 1.9 2002/11/04 10:43:07 dressel Exp $
// GEANT4 tag $Name: geant4-05-00 $
// GEANT4 tag $Name: geant4-05-01 $
//
// ----------------------------------------------------------------------
// GEANT 4 class source file
@@ -22,7 +22,7 @@
//
//
// $Id: G4ImportanceFinder.cc,v 1.9 2002/11/04 10:43:07 dressel Exp $
// GEANT4 tag $Name: geant4-05-00 $
// GEANT4 tag $Name: geant4-05-01 $
//
// ----------------------------------------------------------------------
// GEANT 4 class source file
@@ -22,7 +22,7 @@
//
//
// $Id: G4ImportanceSplitExaminer.cc,v 1.6 2002/10/22 13:18:47 dressel Exp $
// GEANT4 tag $Name: geant4-05-00 $
// GEANT4 tag $Name: geant4-05-01 $
//
// ----------------------------------------------------------------------
// GEANT 4 class source file
@@ -22,7 +22,7 @@
//
//
// $Id: G4Nsplit_Weight.cc,v 1.8 2002/12/13 11:54:19 gcosmo Exp $
// GEANT4 tag $Name: geant4-05-00 $
// GEANT4 tag $Name: geant4-05-01 $
//
// ----------------------------------------------------------------------
// GEANT 4 class source file
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4ParallelNavigator.cc,v 1.14 2002/11/04 10:43:07 dressel Exp $
// GEANT4 tag $Name: geant4-05-00 $
// $Id: G4ParallelNavigator.cc,v 1.16 2003/03/27 09:34:34 gcosmo Exp $
// GEANT4 tag $Name: geant4-05-01 $
//
// ----------------------------------------------------------------------
// GEANT 4 class source file
@@ -43,7 +43,7 @@ G4ParallelNavigator::G4ParallelNavigator(G4VPhysicalVolume &aWorldVolume)
fMaxShiftedTrys(10),
fCurrentTouchableH((fNavigator.SetWorldVolume(&aWorldVolume),
fNavigator.CreateTouchableHistory())),
fVerbose(1)
fVerbose(0)
{}
G4ParallelNavigator::~G4ParallelNavigator()
@@ -208,25 +208,24 @@ ComputeStepLengthShifted(const G4String &m,
const G4ThreeVector &aPosition,
const G4ThreeVector &aDirection)
{
if (fVerbose>=1) {
G4cout.precision(12);
G4cout << "G4ParallelNavigator::ComputeStepLengthShifted: invoked by: "
<< m << G4endl;
}
G4ThreeVector shift_pos(aPosition);
shift_pos+=G4ThreeVector(Shift(aDirection.x()),
Shift(aDirection.y()),
Shift(aDirection.z()));
G4double stepLength = 0.;
G4int trys = 0;
while (stepLength<=2*kCarTolerance && trys < fMaxShiftedTrys) {
if (fVerbose>=1) {
G4cout << "G4ParallelNavigator::ComputeStepLengthShifted: trys = "
shift_pos+=G4ThreeVector(Shift(aDirection.x()),
Shift(aDirection.y()),
Shift(aDirection.z()));
if (fVerbose>=1 || trys >= fMaxShiftedTrys - 1) {
G4cout << "G4ParallelNavigator::ComputeStepLengthShifted: invoked by: "
<< m << G4endl;
G4cout << " trys = "
<< ++trys << G4endl;
G4cout << "shifted position: " << shift_pos
G4cout.precision(12);
G4cout << " shifted position: " << shift_pos
<< ", direction: " << aDirection << G4endl;
}
Locate(shift_pos, aDirection, true, true); // to get into the correct volume
fNavigator.SetGeometricallyLimitedStep();
Locate(shift_pos, aDirection, true, false); // to get into the correct volume
G4double newSafety = 0;
fNavigator.LocateGlobalPointWithinVolume(aPosition); // to place at the correct position
stepLength = fNavigator.ComputeStep( aPosition, aDirection,
@@ -268,12 +267,13 @@ void G4ParallelNavigator::Error(const G4String &m,
G4double G4ParallelNavigator::Shift(G4double d)
{
G4double s=0;
G4double s(0);
G4double ds(10 * kCarTolerance);
if (d>0){
s = 2 * kCarTolerance;
s = ds;
}
else if (d<0) {
s = -2 * kCarTolerance;
s = -1 * ds;
}
return s;
}
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4ParallelStepper.cc,v 1.8 2002/11/04 10:43:07 dressel Exp $
// GEANT4 tag $Name: geant4-05-00 $
// $Id: G4ParallelStepper.cc,v 1.10 2003/04/03 08:01:36 gcosmo Exp $
// GEANT4 tag $Name: geant4-05-01 $
//
// ----------------------------------------------------------------------
// GEANT 4 class source file
@@ -34,8 +34,9 @@
#include "G4ParallelStepper.hh"
#include "G4VPhysicalVolume.hh"
G4ParallelStepper::G4ParallelStepper()
: fPStep(0)
G4ParallelStepper::G4ParallelStepper() :
G4VParallelStepper(),
fPStep(0)
{}
G4ParallelStepper::~G4ParallelStepper()
@@ -46,8 +47,7 @@ G4ParallelStepper::~G4ParallelStepper()
}
G4ParallelStepper::G4ParallelStepper(const G4ParallelStepper &rhs)
:
fPStep(new G4GeometryCellStep(rhs.GetPStep()))
: G4VParallelStepper(), fPStep(new G4GeometryCellStep(rhs.GetPStep()))
{
if (!fPStep) {
Error("G4ParallelStepper:: new failed to create a G4GeometryCellStep!");
@@ -22,7 +22,7 @@
//
//
// $Id: G4ParallelWorld.cc,v 1.6 2002/11/04 10:43:07 dressel Exp $
// GEANT4 tag $Name: geant4-05-00 $
// GEANT4 tag $Name: geant4-05-01 $
//
// ----------------------------------------------------------------------
// GEANT 4 class source file
+1 -1
View File
@@ -22,7 +22,7 @@
//
//
// $Id: G4VCellScorer.cc,v 1.5 2002/12/13 11:54:20 gcosmo Exp $
// GEANT4 tag $Name: geant4-05-00 $
// GEANT4 tag $Name: geant4-05-01 $
//
// ----------------------------------------------------------------------
// GEANT 4 class source file
@@ -22,7 +22,7 @@
//
//
// $Id: G4VCellScorerStore.cc,v 1.3 2002/10/28 09:53:51 dressel Exp $
// GEANT4 tag $Name: geant4-05-00 $
// GEANT4 tag $Name: geant4-05-01 $
//
// ----------------------------------------------------------------------
// GEANT 4 class source file
@@ -22,7 +22,7 @@
//
//
// $Id: G4VGCellFinder.cc,v 1.1 2002/10/16 14:30:01 dressel Exp $
// GEANT4 tag $Name: geant4-05-00 $
// GEANT4 tag $Name: geant4-05-01 $
//
// ----------------------------------------------------------------------
// GEANT 4 class source file
+1 -1
View File
@@ -22,7 +22,7 @@
//
//
// $Id: G4VIStore.cc,v 1.1 2002/10/14 12:36:50 dressel Exp $
// GEANT4 tag $Name: geant4-05-00 $
// GEANT4 tag $Name: geant4-05-01 $
//
// ----------------------------------------------------------------------
// GEANT 4 class source file
@@ -22,7 +22,7 @@
//
//
// $Id: G4VImportanceAlgorithm.cc,v 1.1 2002/10/14 12:36:50 dressel Exp $
// GEANT4 tag $Name: geant4-05-00 $
// GEANT4 tag $Name: geant4-05-01 $
//
// ----------------------------------------------------------------------
// GEANT 4 class source file
@@ -22,7 +22,7 @@
//
//
// $Id: G4VImportanceSplitExaminer.cc,v 1.1 2002/10/14 12:36:50 dressel Exp $
// GEANT4 tag $Name: geant4-05-00 $
// GEANT4 tag $Name: geant4-05-01 $
//
// ----------------------------------------------------------------------
// GEANT 4 class source file
+1 -1
View File
@@ -22,7 +22,7 @@
//
//
// $Id: G4VPGeoDriver.cc,v 1.1 2002/10/14 12:36:50 dressel Exp $
// GEANT4 tag $Name: geant4-05-00 $
// GEANT4 tag $Name: geant4-05-01 $
//
// ----------------------------------------------------------------------
// GEANT 4 class source file
@@ -22,7 +22,7 @@
//
//
// $Id: G4VParallelStepper.cc,v 1.1 2002/10/14 12:36:50 dressel Exp $
// GEANT4 tag $Name: geant4-05-00 $
// GEANT4 tag $Name: geant4-05-01 $
//
// ----------------------------------------------------------------------
// GEANT 4 class source file
+1 -1
View File
@@ -22,7 +22,7 @@
//
//
// $Id: G4VScorer.cc,v 1.1 2002/10/28 09:53:51 dressel Exp $
// GEANT4 tag $Name: geant4-05-00 $
// GEANT4 tag $Name: geant4-05-01 $
//
// ----------------------------------------------------------------------
// GEANT 4 class source file
@@ -22,7 +22,7 @@
//
//
// $Id: G4VWeightWindowAlgorithm.cc,v 1.1 2002/10/14 12:36:50 dressel Exp $
// GEANT4 tag $Name: geant4-05-00 $
// GEANT4 tag $Name: geant4-05-01 $
//
// ----------------------------------------------------------------------
// GEANT 4 class source file
@@ -22,7 +22,7 @@
//
//
// $Id: G4WeightWindowAlgorithm.cc,v 1.5 2002/10/16 14:29:07 dressel Exp $
// GEANT4 tag $Name: geant4-05-00 $
// GEANT4 tag $Name: geant4-05-01 $
//
// ----------------------------------------------------------------------
// GEANT 4 class source file
+14 -1
View File
@@ -1,4 +1,4 @@
$Id: History,v 1.69 2002/12/12 08:21:38 gcosmo Exp $
$Id: History,v 1.71 2003/04/02 08:53:38 gcosmo Exp $
-------------------------------------------------------------------
=========================================================
@@ -17,6 +17,19 @@ committal in the CVS repository !
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
Apr 2nd, 2003 G. Cosmo - field-V05-00-01
---------------------------
- Created .cc files for G4MagneticField and G4ElecroMagneticField.
- Fixed definition of copy constructors in fields inheritance chain.
- Moved obsolete method StepWithEst() to private in G4RKG3_Stepper,
G4CashKarpRKF45 and G4ClassicalRK4.
- Cleared strict pedantic warnings.
Feb 5th, 2003 G. Cosmo - field-V05-00-00
---------------------------
- Removed redundant inclusions of PhysicalConstants.h or SystemOfUnits.h.
Now using directly CLHEP's headers.
Dec 12th, 2002 G. Cosmo - field-V04-01-06
---------------------------
- Moved unused variable 'nStpPr' to debug section in G4MagIntegratorDriver.cc,
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4CashKarpRKF45.hh,v 1.7 2001/07/11 09:59:06 gunter Exp $
// GEANT4 tag $Name: geant4-05-00 $
// $Id: G4CashKarpRKF45.hh,v 1.8 2003/04/02 08:52:32 gcosmo Exp $
// GEANT4 tag $Name: geant4-05-01 $
//
//
// class G4CashKarpRKF45
@@ -49,35 +49,37 @@ class G4CashKarpRKF45 : public G4MagIntegratorStepper
public: // with description
G4CashKarpRKF45(G4EquationOfMotion *EqRhs, G4int numberOfVariables = 6, G4bool primary= true) ;
G4CashKarpRKF45( G4EquationOfMotion *EqRhs,
G4int numberOfVariables = 6,
G4bool primary= true ) ;
~G4CashKarpRKF45() ;
void Stepper( const G4double y[],
const G4double dydx[],
G4double h,
G4double yout[],
G4double yerr[] ) ;
void StepWithEst( const G4double yIn[],
const G4double dydx[],
G4double Step,
G4double yOut[],
G4double& alpha2,
G4double& beta2,
const G4double B1[],
G4double B2[] ) ;
const G4double dydx[],
G4double h,
G4double yout[],
G4double yerr[] ) ;
public: // without description
G4double DistChord() const;
G4int IntegratorOrder() const { return 4; }
G4double DistChord() const;
G4int IntegratorOrder() const { return 4; }
private:
G4CashKarpRKF45(const G4CashKarpRKF45&);
G4CashKarpRKF45& operator=(const G4CashKarpRKF45&);
// Private copy constructor and assignment operator.
void StepWithEst( const G4double yIn[],
const G4double dydx[],
G4double Step,
G4double yOut[],
G4double& alpha2,
G4double& beta2,
const G4double B1[],
G4double B2[] );
// No longer used. Obsolete.
G4CashKarpRKF45(const G4CashKarpRKF45&);
G4CashKarpRKF45& operator=(const G4CashKarpRKF45&);
// Private copy constructor and assignment operator.
private:
@@ -87,7 +89,8 @@ class G4CashKarpRKF45 : public G4MagIntegratorStepper
// for DistChord calculations
G4double fLastStepLength;
G4double *fLastInitialVector, *fLastFinalVector, *fLastDyDx, *fMidVector, *fMidError;
G4double *fLastInitialVector, *fLastFinalVector,
*fLastDyDx, *fMidVector, *fMidError;
G4CashKarpRKF45* fAuxStepper;
};
@@ -22,7 +22,7 @@
//
//
// $Id: G4ChordFinder.hh,v 1.9 2002/11/09 03:05:13 japost Exp $
// GEANT4 tag $Name: geant4-05-00 $
// GEANT4 tag $Name: geant4-05-01 $
//
//
// class G4ChordFinder
@@ -22,7 +22,7 @@
//
//
// $Id: G4ChordFinder.icc,v 1.4 2001/08/16 23:54:51 japost Exp $
// GEANT4 tag $Name: geant4-05-00 $
// GEANT4 tag $Name: geant4-05-01 $
//
// G4ChordFinder inline implementations
//
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4ClassicalRK4.hh,v 1.6 2002/11/20 17:56:35 japost Exp $
// GEANT4 tag $Name: geant4-05-00 $
// $Id: G4ClassicalRK4.hh,v 1.7 2003/04/02 08:52:54 gcosmo Exp $
// GEANT4 tag $Name: geant4-05-01 $
//
//
// class G4ClassicalRK4
@@ -51,9 +51,9 @@ class G4ClassicalRK4 : public G4MagErrorStepper
// It is used by the MagErrorStepper stepper.
void DumbStepper( const G4double yIn[],
const G4double dydx[],
G4double h,
G4double yOut[]) ;
const G4double dydx[],
G4double h,
G4double yOut[] ) ;
// Given values for the variables y[0,..,n-1] and their derivatives
// dydx[0,...,n-1] known at x, use the classical 4th Runge-Kutta
// method to advance the solution over an interval h and return the
@@ -64,21 +64,20 @@ class G4ClassicalRK4 : public G4MagErrorStepper
public: // without description
void StepWithEst( const G4double yIn[],
const G4double dydx[],
G4double h,
G4double yOut[],
G4double& alpha2,
G4double& beta2,
const G4double B1[],
G4double B2[] );
// Could make above G4SixPoint to keep tangents too ...?
G4int IntegratorOrder() const { return 4; }
private:
void StepWithEst( const G4double yIn[],
const G4double dydx[],
G4double h,
G4double yOut[],
G4double& alpha2,
G4double& beta2,
const G4double B1[],
G4double B2[] );
// No longer used. Obsolete.
G4ClassicalRK4(const G4ClassicalRK4&);
G4ClassicalRK4& operator=(const G4ClassicalRK4&);
// Private copy constructor and assignment operator.
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4ElectroMagneticField.hh,v 1.6 2001/11/08 17:31:06 grichine Exp $
// GEANT4 tag $Name: geant4-05-00 $
// $Id: G4ElectroMagneticField.hh,v 1.7 2003/04/02 08:49:19 gcosmo Exp $
// GEANT4 tag $Name: geant4-05-01 $
//
//
// class G4ElectroMagneticField
@@ -45,25 +45,15 @@ class G4ElectroMagneticField : public G4MagneticField
{
public: // with description
G4ElectroMagneticField() {;}
virtual ~G4ElectroMagneticField() {;}
G4ElectroMagneticField();
virtual ~G4ElectroMagneticField();
G4ElectroMagneticField(const G4ElectroMagneticField &) {;}
G4ElectroMagneticField& operator = (const G4ElectroMagneticField &);
G4ElectroMagneticField(const G4ElectroMagneticField &r);
G4ElectroMagneticField& operator = (const G4ElectroMagneticField &p);
// Copy constructor & assignment operators.
virtual void GetFieldValue(const G4double Point[4],
G4double *Bfield ) const = 0;
G4double *Bfield ) const = 0;
};
// Inline implementations
inline
G4ElectroMagneticField&
G4ElectroMagneticField::operator = (const G4ElectroMagneticField &p)
{
if (&p == this) return *this;
*this = p; return *this;
}
#endif /* G4ELECTROMAGNETIC_FIELD_DEF */
@@ -22,7 +22,7 @@
//
//
// $Id: G4EqMagElectricField.hh,v 1.6 2001/07/11 09:59:07 gunter Exp $
// GEANT4 tag $Name: geant4-05-00 $
// GEANT4 tag $Name: geant4-05-01 $
//
//
// class G4EqMagElectricField
@@ -22,7 +22,7 @@
//
//
// $Id: G4EquationOfMotion.hh,v 1.7 2002/06/11 08:38:56 japost Exp $
// GEANT4 tag $Name: geant4-05-00 $
// GEANT4 tag $Name: geant4-05-01 $
//
//
// class G4EquationOfMotion
@@ -22,7 +22,7 @@
//
//
// $Id: G4EquationOfMotion.icc,v 1.7 2002/06/11 08:39:14 japost Exp $
// GEANT4 tag $Name: geant4-05-00 $
// GEANT4 tag $Name: geant4-05-01 $
//
//
// Inline implementation
@@ -22,7 +22,7 @@
//
//
// $Id: G4ExplicitEuler.hh,v 1.6 2002/11/29 13:47:49 japost Exp $
// GEANT4 tag $Name: geant4-05-00 $
// GEANT4 tag $Name: geant4-05-01 $
//
//
// class G4ExplicitEuler
@@ -22,7 +22,7 @@
//
//
// $Id: G4Field.hh,v 1.6 2001/11/08 17:31:07 grichine Exp $
// GEANT4 tag $Name: geant4-05-00 $
// GEANT4 tag $Name: geant4-05-01 $
//
//
// class G4Field
@@ -22,7 +22,7 @@
//
//
// $Id: G4FieldManager.hh,v 1.8 2002/07/24 10:43:31 gcosmo Exp $
// GEANT4 tag $Name: geant4-05-00 $
// GEANT4 tag $Name: geant4-05-01 $
//
//
// class G4FieldManager
@@ -22,7 +22,7 @@
//
//
// $Id: G4FieldManager.icc,v 1.5 2001/11/28 18:44:43 japost Exp $
// GEANT4 tag $Name: geant4-05-00 $
// GEANT4 tag $Name: geant4-05-01 $
//
//
// G4FieldManager inline implementation
@@ -22,7 +22,7 @@
//
//
// $Id: G4FieldTrack.hh,v 1.8 2001/10/25 17:02:16 japost Exp $
// GEANT4 tag $Name: geant4-05-00 $
// GEANT4 tag $Name: geant4-05-01 $
//
//
// class G4FieldTrack
@@ -21,10 +21,9 @@
// ********************************************************************
//
//
// $Id: G4FieldTrack.icc,v 1.9 2001/10/25 17:02:16 japost Exp $
// GEANT4 tag $Name: geant4-05-00 $
// $Id: G4FieldTrack.icc,v 1.11 2003/04/02 14:22:56 gcosmo Exp $
// GEANT4 tag $Name: geant4-05-01 $
//
#include "PhysicalConstants.h"
inline
G4FieldTrack::G4FieldTrack( const G4ThreeVector& pPosition,
@@ -32,7 +31,7 @@ G4FieldTrack::G4FieldTrack( const G4ThreeVector& pPosition,
G4double curve_length,
G4double kineticEnergy,
const G4double restMass_c2,
G4double velocity,
G4double, // velocity
G4double pLaboratoryTimeOfFlight,
G4double pProperTimeOfFlight,
const G4ThreeVector* pSpin)
@@ -22,7 +22,7 @@
//
//
// $Id: G4HelixExplicitEuler.hh,v 1.6 2001/07/11 09:59:08 gunter Exp $
// GEANT4 tag $Name: geant4-05-00 $
// GEANT4 tag $Name: geant4-05-01 $
//
//
// class G4HelixExplicitEuler
@@ -22,7 +22,7 @@
//
//
// $Id: G4HelixHeum.hh,v 1.6 2001/07/11 09:59:08 gunter Exp $
// GEANT4 tag $Name: geant4-05-00 $
// GEANT4 tag $Name: geant4-05-01 $
//
//
// class G4HelixHeum
@@ -22,7 +22,7 @@
//
//
// $Id: G4HelixImplicitEuler.hh,v 1.6 2001/07/11 09:59:08 gunter Exp $
// GEANT4 tag $Name: geant4-05-00 $
// GEANT4 tag $Name: geant4-05-01 $
//
//
// class G4HelixImplicitEuler
@@ -22,7 +22,7 @@
//
//
// $Id: G4HelixSimpleRunge.hh,v 1.5 2001/07/11 09:59:08 gunter Exp $
// GEANT4 tag $Name: geant4-05-00 $
// GEANT4 tag $Name: geant4-05-01 $
//
//
// W. Wander <wwc@mit.edu> 03/12/98
@@ -22,7 +22,7 @@
//
//
// $Id: G4ImplicitEuler.hh,v 1.5 2002/11/29 13:48:47 japost Exp $
// GEANT4 tag $Name: geant4-05-00 $
// GEANT4 tag $Name: geant4-05-01 $
//
//
// W. Wander <wwc@mit.edu> 12/09/97
@@ -22,7 +22,7 @@
//
//
// $Id: G4LineSection.hh,v 1.7 2001/12/05 16:40:18 gcosmo Exp $
// GEANT4 tag $Name: geant4-05-00 $
// GEANT4 tag $Name: geant4-05-01 $
//
//
// class G4LineSection
@@ -22,7 +22,7 @@
//
//
// $Id: G4MagErrorStepper.hh,v 1.8 2001/07/11 09:59:08 gunter Exp $
// GEANT4 tag $Name: geant4-05-00 $
// GEANT4 tag $Name: geant4-05-01 $
//
//
// class G4MagErrorStepper
@@ -22,7 +22,7 @@
//
//
// $Id: G4MagErrorStepper.icc,v 1.9 2002/11/09 03:06:15 japost Exp $
// GEANT4 tag $Name: geant4-05-00 $
// GEANT4 tag $Name: geant4-05-01 $
//
inline
@@ -22,7 +22,7 @@
//
//
// $Id: G4MagHelicalStepper.hh,v 1.7 2001/07/11 09:59:08 gunter Exp $
// GEANT4 tag $Name: geant4-05-00 $
// GEANT4 tag $Name: geant4-05-01 $
//
//
// class G4MagHelicalStepper
@@ -22,7 +22,7 @@
//
//
// $Id: G4MagHelicalStepper.icc,v 1.7 2002/05/31 16:22:54 japost Exp $
// GEANT4 tag $Name: geant4-05-00 $
// GEANT4 tag $Name: geant4-05-01 $
//
// linear Step in regions of no field
@@ -22,7 +22,7 @@
//
//
// $Id: G4MagIntegratorDriver.hh,v 1.12 2002/11/09 02:32:15 japost Exp $
// GEANT4 tag $Name: geant4-05-00 $
// GEANT4 tag $Name: geant4-05-01 $
//
//
// class G4MagInt_Driver
@@ -22,7 +22,7 @@
//
//
// $Id: G4MagIntegratorDriver.icc,v 1.7 2001/10/25 09:11:09 japost Exp $
// GEANT4 tag $Name: geant4-05-00 $
// GEANT4 tag $Name: geant4-05-01 $
//
inline
@@ -22,7 +22,7 @@
//
//
// $Id: G4MagIntegratorStepper.hh,v 1.9 2002/11/20 18:09:22 japost Exp $
// GEANT4 tag $Name: geant4-05-00 $
// GEANT4 tag $Name: geant4-05-01 $
//
//
// class G4MagIntegratorStepper
@@ -22,7 +22,7 @@
//
//
// $Id: G4MagIntegratorStepper.icc,v 1.7 2002/11/20 18:10:44 japost Exp $
// GEANT4 tag $Name: geant4-05-00 $
// GEANT4 tag $Name: geant4-05-01 $
//
inline
@@ -22,7 +22,7 @@
//
//
// $Id: G4Mag_EqRhs.hh,v 1.6 2001/07/11 09:59:09 gunter Exp $
// GEANT4 tag $Name: geant4-05-00 $
// GEANT4 tag $Name: geant4-05-01 $
//
//
// class G4Mag_EqRhs
@@ -22,7 +22,7 @@
//
//
// $Id: G4Mag_SpinEqRhs.hh,v 1.8 2002/06/07 18:25:09 japost Exp $
// GEANT4 tag $Name: geant4-05-00 $
// GEANT4 tag $Name: geant4-05-01 $
//
//
// class G4Mag_SpinEqRhs
@@ -22,7 +22,7 @@
//
//
// $Id: G4Mag_UsualEqRhs.hh,v 1.5 2002/04/29 16:54:02 japost Exp $
// GEANT4 tag $Name: geant4-05-00 $
// GEANT4 tag $Name: geant4-05-01 $
//
//
// class G4Mag_UsualEqRhs
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4MagneticField.hh,v 1.10 2001/12/04 17:47:02 gcosmo Exp $
// GEANT4 tag $Name: geant4-05-00 $
// $Id: G4MagneticField.hh,v 1.11 2003/04/02 08:49:20 gcosmo Exp $
// GEANT4 tag $Name: geant4-05-01 $
//
//
// class G4MagneticField
@@ -50,20 +50,12 @@ class G4MagneticField : public G4Field
virtual ~G4MagneticField();
// Constructor and destructor. No actions.
G4MagneticField(const G4MagneticField &);
G4MagneticField& operator = (const G4MagneticField &);
G4MagneticField(const G4MagneticField &r);
G4MagneticField& operator = (const G4MagneticField &p);
// Copy constructor & assignment operator.
virtual void GetFieldValue( const G4double Point[4],
G4double *Bfield ) const = 0;
};
// Inline implementations
inline G4MagneticField::G4MagneticField() {}
inline G4MagneticField::~G4MagneticField() {}
inline G4MagneticField::G4MagneticField(const G4MagneticField &):G4Field() {}
inline G4MagneticField& G4MagneticField::operator = (const G4MagneticField &p)
{ if (&p == this) return *this; *this = p; return *this; }
#endif /* G4MAGNETIC_FIELD_DEF */
@@ -22,7 +22,7 @@
//
//
// $Id: G4RKG3_Stepper.hh,v 1.8 2001/07/11 09:59:09 gunter Exp $
// GEANT4 tag $Name: geant4-05-00 $
// GEANT4 tag $Name: geant4-05-01 $
//
//
// class G4RKG3_Stepper
@@ -22,7 +22,7 @@
//
//
// $Id: G4SimpleHeum.hh,v 1.5 2001/07/11 09:59:09 gunter Exp $
// GEANT4 tag $Name: geant4-05-00 $
// GEANT4 tag $Name: geant4-05-01 $
//
//
// class G4SimpleHeum
@@ -22,7 +22,7 @@
//
//
// $Id: G4SimpleRunge.hh,v 1.5 2001/07/11 09:59:09 gunter Exp $
// GEANT4 tag $Name: geant4-05-00 $
// GEANT4 tag $Name: geant4-05-01 $
//
//
// class G4SimpleRunge
@@ -22,7 +22,7 @@
//
//
// $Id: G4UniformElectricField.hh,v 1.6 2001/12/04 17:35:52 gcosmo Exp $
// GEANT4 tag $Name: geant4-05-00 $
// GEANT4 tag $Name: geant4-05-01 $
//
//
// class G4UniformElectricField
@@ -22,7 +22,7 @@
//
//
// $Id: G4UniformMagField.hh,v 1.7 2001/12/04 17:35:52 gcosmo Exp $
// GEANT4 tag $Name: geant4-05-00 $
// GEANT4 tag $Name: geant4-05-01 $
//
//
// class G4UniformMagField
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4CashKarpRKF45.cc,v 1.10 2001/11/21 17:56:18 japost Exp $
// GEANT4 tag $Name: geant4-05-00 $
// $Id: G4CashKarpRKF45.cc,v 1.11 2003/04/02 08:52:17 gcosmo Exp $
// GEANT4 tag $Name: geant4-05-01 $
//
// The Cash-Karp Runge-Kutta-Fehlberg 4/5 method is an embedded fourth
// order method (giving fifth-order accuracy) for the solution
@@ -103,10 +103,10 @@ G4CashKarpRKF45::~G4CashKarpRKF45()
void
G4CashKarpRKF45::Stepper(const G4double yInput[],
const G4double dydx[],
G4double Step,
G4double yOut[],
G4double yErr[])
const G4double dydx[],
G4double Step,
G4double yOut[],
G4double yErr[])
{
// const G4int nvar = 6 ;
// const G4double a2 = 0.2 , a3 = 0.3 , a4 = 0.6 , a5 = 1.0 , a6 = 0.875;
@@ -128,7 +128,7 @@ G4CashKarpRKF45::Stepper(const G4double yInput[],
dc5 = -277.0/14336.0 ;
const G4double dc1 = c1 - 2825.0/27648.0 , dc3 = c3 - 18575.0/48384.0 ,
dc4 = c4 - 13525.0/55296.0 , dc6 = c6 - 0.25 ;
dc4 = c4 - 13525.0/55296.0 , dc6 = c6 - 0.25 ;
// Saving yInput because yInput and yOut can be aliases for same array
@@ -193,142 +193,22 @@ G4CashKarpRKF45::Stepper(const G4double yInput[],
fLastStepLength =Step;
return ;
}
///////////////////////////////////////////////////////////////////////////////
void
G4CashKarpRKF45::StepWithEst(const G4double yInput[],
const G4double dydx[],
G4double Step,
G4double yOut[],
G4double& alpha2,
G4double& beta2,
const G4double B1[],
G4double B2[] )
G4CashKarpRKF45::StepWithEst( const G4double*,
const G4double*,
G4double,
G4double*,
G4double&,
G4double&,
const G4double*,
G4double* )
{
G4Exception("G4CashKarpRKF45::StepWithEst ERROR: This Method is no longer used.");
#if 0
// const G4int nvar = 6 ;
G4int i;
// Saving yInput because yInput and yOut can be aliases for same array
for(i=0;i<fNumberOfVariables;i++)
{
yIn[i]=yInput[i];
}
const G4double a2 = 0.2 , a3 = 0.3 , a4 = 0.6 , a5 = 1.0 , a6 = 0.875 ,
b21 = 0.2 ,
b31 = 3.0/40.0 , b32 = 9.0/40.0 ,
b41 = 0.3 , b42 = -0.9 , b43 = 1.2 ,
b51 = -11.0/54.0 , b52 = 2.5 , b53 = -70.0/27.0 ,
b54 = 35.0/27.0 ,
b61 = 1631.0/55296.0 , b62 = 175.0/512.0 ,
b63 = 575.0/13824.0 , b64 = 44275.0/110592.0 ,
b65 = 253.0/4096.0 ,
c1 = 37.0/378.0 , c3 = 250.0/621.0 , c4 = 125.0/594.0 ,
c6 = 512.0/1771.0 ,
dc5 = -277.0/14336.0 ;
const G4double dc1 = c1 - 2825.0/27648.0 , dc3 = c3 - 18575.0/48384.0 ,
dc4 = c4 - 13525.0/55296.0 , dc6 = c6 - 0.25 ;
alpha2 = 0 ;
beta2 = 0 ;
// RightHandSide(yIn, dydx) ; // 1st Step
for(i=0;i<3;i++)
{
alpha2 += B1[i]*B1[i] ;
beta2 += dydx[i+3]*dydx[i+3] ;
}
for(i=0;i<fNumberOfVariables;i++)
{
yTemp[i] = yIn[i] + b21*Step*dydx[i] ;
}
GetEquationOfMotion()->EvaluateRhsReturnB(yTemp,ak2,B2) ; // Calculates yderive &
// returns B too!
for(i=0;i<3;i++)
{
alpha2 += B2[i]*B2[i] ;
beta2 += ak2[i+3]*ak2[i+3] ;
}
for(i=0;i<fNumberOfVariables;i++)
{
yTemp[i] = yIn[i] + Step*(b31*dydx[i] + b32*ak2[i]) ;
}
GetEquationOfMotion()->EvaluateRhsReturnB(yTemp,ak3,B2) ;
for(i=0;i<3;i++)
{
alpha2 += B2[i]*B2[i] ;
beta2 += ak3[i+3]*ak3[i+3] ;
}
for(i=0;i<fNumberOfVariables;i++)
{
yTemp[i] = yIn[i] + Step*(b41*dydx[i] + b42*ak2[i] + b43*ak3[i]) ;
}
GetEquationOfMotion()->EvaluateRhsReturnB(yTemp,ak4,B2) ;
for(i=0;i<3;i++)
{
alpha2 += B2[i]*B2[i] ;
beta2 += ak4[i+3]*ak4[i+3] ;
}
for(i=0;i<fNumberOfVariables;i++)
{
yTemp[i] = yIn[i] + Step*(b51*dydx[i] + b52*ak2[i] + b53*ak3[i] +
b54*ak4[i]) ;
}
GetEquationOfMotion()->EvaluateRhsReturnB(yTemp,ak5,B2) ;
for(i=0;i<3;i++)
{
alpha2 += B2[i]*B2[i] ;
beta2 += ak5[i+3]*ak5[i+3] ;
}
for(i=0;i<fNumberOfVariables;i++)
{
yTemp[i] = yIn[i] + Step*(b61*dydx[i] + b62*ak2[i] + b63*ak3[i] +
b64*ak4[i] + b65*ak5[i]) ;
}
GetEquationOfMotion()->EvaluateRhsReturnB(yTemp,ak6,B2) ;
for(i=0;i<3;i++)
{
alpha2 += B2[i]*B2[i] ;
beta2 += ak6[i+3]*ak6[i+3] ;
}
for(i=0;i<fNumberOfVariables;i++)
{
// Accumulate increments with proper weights
yOut[i] = yIn[i] + Step*(c1*dydx[i] + c3*ak3[i] + c4*ak4[i] + c6*ak6[i]) ;
}
alpha2 *= sqr(GetEquationOfMotion()->FCof()*Step)/6.0 ;
beta2 *= (Step*Step)/6.0 ;
// NormaliseTangentVector( yOut );
#endif
return ;
G4Exception("ERROR - G4CashKarpRKF45::StepWithEst(): Method no longer used.");
return ;
}
/////////////////////////////////////////////////////////////////
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4ChordFinder.cc,v 1.31 2002/11/09 02:50:48 japost Exp $
// GEANT4 tag $Name: geant4-05-00 $
// $Id: G4ChordFinder.cc,v 1.32 2003/04/02 08:53:20 gcosmo Exp $
// GEANT4 tag $Name: geant4-05-01 $
//
//
// 25.02.97 John Apostolakis, design and implimentation
@@ -44,9 +44,9 @@ const G4double G4ChordFinder::fDefaultDeltaChord = 3. * mm;
// ..........................................................................
G4ChordFinder::G4ChordFinder( G4MagneticField* theMagField,
G4double stepMinimum,
G4MagIntegratorStepper* pItsStepper ) // A default one
: fDeltaChord( fDefaultDeltaChord )
G4double stepMinimum,
G4MagIntegratorStepper* pItsStepper )
: fDeltaChord( fDefaultDeltaChord )
{
// Construct the Chord Finder
// by creating in inverse order the Driver, the Stepper and EqRhs ...
@@ -66,9 +66,8 @@ G4ChordFinder::G4ChordFinder( G4MagneticField* theMagField,
{
fAllocatedStepper= false;
}
fIntgrDriver = new G4MagInt_Driver(stepMinimum,
pItsStepper,
pItsStepper->GetNumberOfVariables() );
fIntgrDriver = new G4MagInt_Driver(stepMinimum, pItsStepper,
pItsStepper->GetNumberOfVariables() );
}
// ......................................................................
@@ -87,8 +86,8 @@ G4ChordFinder::~G4ChordFinder()
G4double
G4ChordFinder::AdvanceChordLimited( G4FieldTrack& yCurrent,
G4double stepMax,
G4double epsStep )
G4double stepMax,
G4double epsStep )
{
G4double stepPossible;
G4double dyErr;
@@ -99,7 +98,7 @@ G4ChordFinder::AdvanceChordLimited( G4FieldTrack& yCurrent,
static G4bool dbg= false;
if( dbg )
G4cerr << "Entered AdvanceChordLimited with:\n yCurrent: " << yCurrent
<< " and initial Step=stepMax=" << stepMax << " mm. " << G4endl;
<< " and initial Step=stepMax=" << stepMax << " mm. " << G4endl;
#endif
stepPossible= FindNextChord(yCurrent, stepMax, yEnd, dyErr, epsStep);
@@ -116,7 +115,7 @@ G4ChordFinder::AdvanceChordLimited( G4FieldTrack& yCurrent,
good_advance = fIntgrDriver->AccurateAdvance(yCurrent, stepPossible, epsStep);
#ifdef G4DEBUG_FIELD
if (dbg) G4cerr << "Accurate advance to end of chord attemped"
<< "with result " << good_advance << G4endl ;
<< "with result " << good_advance << G4endl ;
#endif
if ( ! good_advance ){
// In this case the driver could not do the full distance
@@ -126,7 +125,7 @@ G4ChordFinder::AdvanceChordLimited( G4FieldTrack& yCurrent,
#ifdef G4DEBUG_FIELD
if( dbg ) G4cerr << "Exiting FindNextChord Limited with:\n yCurrent: "
<< yCurrent<< G4endl;
<< yCurrent<< G4endl;
#endif
return stepPossible;
@@ -134,16 +133,15 @@ G4ChordFinder::AdvanceChordLimited( G4FieldTrack& yCurrent,
// #define TEST_CHORD_PRINT 1
// ..............................................................................
// ............................................................................
G4double
G4ChordFinder::FindNextChord( const G4FieldTrack yStart,
G4double stepMax,
G4FieldTrack& yEnd, // Endpoint
G4double& dyErr, // Error of endpoint
G4double epsStep )
// Returns Length of Step taken
G4double stepMax,
G4FieldTrack& yEnd, // Endpoint
G4double& dyErr, // Error of endpoint
G4double )
// Returns Length of Step taken
{
// G4int stepRKnumber=0;
G4FieldTrack yCurrent= yStart;
@@ -162,7 +160,7 @@ G4ChordFinder::FindNextChord( const G4FieldTrack yStart,
G4int noTrials=0;
stepTrial = G4std::min( stepMax,
(1-perThousand)*fLastStepEstimate_Unconstrained );
(1-perThousand)*fLastStepEstimate_Unconstrained );
do
{
@@ -181,22 +179,24 @@ G4ChordFinder::FindNextChord( const G4FieldTrack yStart,
oldStepTrial = stepTrial;
// This method estimates to step size for a good chord.
stepForChord = NewStep(stepTrial, dChordStep, fLastStepEstimate_Unconstrained );
stepForChord = NewStep(stepTrial, dChordStep,
fLastStepEstimate_Unconstrained );
if( ! validEndPoint ) {
if( (stepForChord <= oldStepTrial) || (stepTrial<=0.0) )
stepTrial = stepForChord;
stepTrial = stepForChord;
else
stepTrial *= 0.1;
stepTrial *= 0.1;
#if 0
// Possible complementary approach:
// Get the driver to calculate the new step size, if it is needed
stepForAccuracy = fIntgrDriver->ComputeNewStepSize( dyErr/(epsStep*oldStepTrial),
stepTrial);
stepTrial = G4std::min(stepForChord, stepForAccuracy);
// Possible complementary approach:
// Get the driver to calculate the new step size, if it is needed
stepForAccuracy =
fIntgrDriver->ComputeNewStepSize( dyErr/(epsStep*oldStepTrial),
stepTrial );
stepTrial = G4std::min(stepForChord, stepForAccuracy);
#endif
// if(dbg) G4cerr<<"Dchord too big. Try new hstep="<<stepTrial<<G4endl;
// if(dbg) G4cerr<<"Dchord too big. Try new hstep="<<stepTrial<<G4endl;
}
#ifdef TEST_CHORD_PRINT
G4cout.precision(5);
@@ -210,12 +210,14 @@ G4ChordFinder::FindNextChord( const G4FieldTrack yStart,
G4cout << " dChordStep= " << G4std::setw(12) << dChordStep;
}
if( dChordStep > fDeltaChord )
G4cout << " d+";
G4cout << " d+";
else
G4cout << " d-";
G4cout << " d-";
G4cout.precision(5);
G4cout << " new_step= " << G4std::setw(10) << fLastStepEstimate_Unconstrained
<< " new_step_constr= " << G4std::setw(10) << stepTrial << G4endl;
G4cout << " new_step= " << G4std::setw(10)
<< fLastStepEstimate_Unconstrained
<< " new_step_constr= " << G4std::setw(10)
<< stepTrial << G4endl;
#endif
noTrials++;
}
@@ -226,7 +228,7 @@ G4ChordFinder::FindNextChord( const G4FieldTrack yStart,
static int dbg=0;
if( dbg )
G4cout << "ChordF/FindNextChord: NoTrials= " << noTrials
<< " StepForGoodChord=" << G4std::setw(10) << stepTrial << G4endl;
<< " StepForGoodChord=" << G4std::setw(10) << stepTrial << G4endl;
#endif
yEnd= yCurrent;
@@ -246,24 +248,25 @@ if( dbg ) {
// ...........................................................................
G4double G4ChordFinder::NewStep(G4double stepTrialOld,
G4double dChordStep, // Current dchord achieved.
G4double dChordStep, // Curr. dchord achieved
G4double& stepEstimate_Unconstrained )
//
// Is called to estimate the next step size, even for successful steps,
// in order to predict an accurate 'chord-sensitive' first step
// which is likely to assist in more performant 'stepping'.
// Is called to estimate the next step size, even for successful steps,
// in order to predict an accurate 'chord-sensitive' first step
// which is likely to assist in more performant 'stepping'.
//
{
G4double stepTrial;
static G4double lastStepTrial = 1., lastDchordStep= 1.;
#if 1
// const G4double threshold = 1.21, multiplier = 0.9; // 0.9 < 1 / sqrt(1.21)
// const G4double threshold = 1.21, multiplier = 0.9;
// 0.9 < 1 / sqrt(1.21)
if (dChordStep > 0.0)
{
stepEstimate_Unconstrained = stepTrialOld * sqrt( fDeltaChord / dChordStep );
stepEstimate_Unconstrained = stepTrialOld*sqrt( fDeltaChord / dChordStep );
stepTrial = 0.98 * stepEstimate_Unconstrained;
}
else
@@ -281,11 +284,11 @@ G4double G4ChordFinder::NewStep(G4double stepTrialOld,
stepTrial= stepTrialOld * 0.03;
}else{
if ( dChordStep > 100. * fDeltaChord ){
stepTrial= stepTrialOld * 0.1;
}else{
// Try halving the length until dChordStep OK
stepTrial= stepTrialOld * 0.5;
}
stepTrial= stepTrialOld * 0.1;
}else{
// Try halving the length until dChordStep OK
stepTrial= stepTrialOld * 0.5;
}
}
}else if (stepTrial > 1000.0 * stepTrialOld)
{
@@ -303,10 +306,10 @@ G4double G4ChordFinder::NewStep(G4double stepTrialOld,
stepTrial= stepTrialOld * 0.03;
}else{
if ( dChordStep > 100. * fDeltaChord ){
stepTrial= stepTrialOld * 0.1;
stepTrial= stepTrialOld * 0.1;
}else{
// Keep halving the length until dChordStep OK
stepTrial= stepTrialOld * 0.5;
stepTrial= stepTrialOld * 0.5;
}
}
#endif
@@ -324,17 +327,17 @@ G4double G4ChordFinder::NewStep(G4double stepTrialOld,
}
//
// Given a starting curve point A (CurveA_PointVelocity), a later
// Given a starting curve point A (CurveA_PointVelocity), a later
// curve point B (CurveB_PointVelocity) and a point E which is (generally)
// not on the curve, find and return a point F which is on the curve and
// which is close to E. While advancing towards F utilise eps_step
// as a measure of the relative accuracy of each Step.
G4FieldTrack G4ChordFinder::ApproxCurvePointV(
const G4FieldTrack& CurveA_PointVelocity,
const G4FieldTrack& CurveB_PointVelocity,
const G4ThreeVector& CurrentE_Point,
G4double eps_step)
G4FieldTrack
G4ChordFinder::ApproxCurvePointV( const G4FieldTrack& CurveA_PointVelocity,
const G4FieldTrack& CurveB_PointVelocity,
const G4ThreeVector& CurrentE_Point,
G4double eps_step)
{
// 1st implementation:
// if r=|AE|/|AB|, and s=true path lenght (AB)
@@ -352,23 +355,25 @@ G4FieldTrack G4ChordFinder::ApproxCurvePointV(
G4double curve_length; // A curve length of AB
G4double AE_fraction;
curve_length=
CurveB_PointVelocity.GetCurveLength() - CurveA_PointVelocity.GetCurveLength();
curve_length= CurveB_PointVelocity.GetCurveLength()
- CurveA_PointVelocity.GetCurveLength();
// const
G4double integrationInaccuracyLimit= G4std::max( perMillion, 0.5*eps_step );
if( curve_length < ABdist * (1. - integrationInaccuracyLimit) ){
#ifdef G4DEBUG_FIELD
G4cerr << " Warning in G4ChordFinder::ApproxCurvePoint: " << G4endl <<
" The two points are further apart than the curve length " << G4endl <<
" Dist = " << ABdist <<
" curve length = " << curve_length
<< " relativeDiff = " << (curve_length-ABdist)/ABdist
<< G4endl;
G4cerr << " Warning in G4ChordFinder::ApproxCurvePoint: "
<< G4endl
<< " The two points are further apart than the curve length "
<< G4endl
<< " Dist = " << ABdist
<< " curve length = " << curve_length
<< " relativeDiff = " << (curve_length-ABdist)/ABdist
<< G4endl;
if( curve_length < ABdist * (1. - 10*eps_step) ) {
G4cerr << " ERROR: the size of the above difference exceeds allowed limits. Aborting."
<< G4endl;
G4Exception("G4ChordFinder::ApproxCurvePoint> Unphysical curve length.");
G4cerr << " ERROR: the size of the above difference"
<< " exceeds allowed limits. Aborting." << G4endl;
G4Exception("G4ChordFinder::ApproxCurvePoint > Unphysical curve length.");
}
#endif
// Take default corrective action:
@@ -384,19 +389,22 @@ G4FieldTrack G4ChordFinder::ApproxCurvePointV(
}else{
AE_fraction = 0.5; // Guess .. ?;
#ifdef G4DEBUG_FIELD
G4cout << "Warning in G4ChordFinder::ApproxCurvePoint: A and B are the same point\n" <<
" Chord AB length = " << ChordAE_Vector.mag() << G4endl << G4endl;
G4cout << "Warning in G4ChordFinder::ApproxCurvePoint:"
<< " A and B are the same point!" << G4endl
<< " Chord AB length = " << ChordAE_Vector.mag() << G4endl
<< G4endl;
#endif
}
if( (AE_fraction> 1.0 + perMillion) || (AE_fraction< 0.) ){
#ifdef G4DEBUG_FIELD
G4cerr << " G4ChordFinder::ApproxCurvePointV: Warning: Anomalous condition:AE > AB or AE/AB <= 0 " << G4endl <<
" AE_fraction = " << AE_fraction << G4endl <<
" Chord AE length = " << ChordAE_Vector.mag() << G4endl <<
" Chord AB length = " << ABdist << G4endl << G4endl;
G4cerr << " OK if this condition occurs after a recalculation of 'B'" << G4endl
<< " Otherwise it is an error. " << G4endl ;
G4cerr << " G4ChordFinder::ApproxCurvePointV - Warning:"
<< " Anomalous condition:AE > AB or AE/AB <= 0 " << G4endl
<< " AE_fraction = " << AE_fraction << G4endl
<< " Chord AE length = " << ChordAE_Vector.mag() << G4endl
<< " Chord AB length = " << ABdist << G4endl << G4endl;
G4cerr << " OK if this condition occurs after a recalculation of 'B'"
<< G4endl << " Otherwise it is an error. " << G4endl ;
#endif
// This course can now result if B has been re-evaluated,
// without E being recomputed (1 July 99)
@@ -411,8 +419,8 @@ G4FieldTrack G4ChordFinder::ApproxCurvePointV(
if ( AE_fraction > 0.0 ) {
good_advance =
fIntgrDriver->AccurateAdvance(Current_PointVelocity,
new_st_length,
eps_step ); // Relative accuracy
new_st_length,
eps_step ); // Relative accuracy
// In this case it does not matter if it cannot advance the full distance
}
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4ClassicalRK4.cc,v 1.6 2002/11/20 17:56:35 japost Exp $
// GEANT4 tag $Name: geant4-05-00 $
// $Id: G4ClassicalRK4.cc,v 1.7 2003/04/02 08:52:18 gcosmo Exp $
// GEANT4 tag $Name: geant4-05-01 $
//
#include "G4ClassicalRK4.hh"
#include "G4ThreeVector.hh"
@@ -66,9 +66,9 @@ G4ClassicalRK4::~G4ClassicalRK4()
void
G4ClassicalRK4::DumbStepper( const G4double yIn[],
const G4double dydx[],
G4double h,
G4double yOut[])
const G4double dydx[],
G4double h,
G4double yOut[])
{
const G4int nvar = this->GetNumberOfVariables(); // fNumberOfVariables();
G4int i;
@@ -101,12 +101,11 @@ G4ClassicalRK4::DumbStepper( const G4double yIn[],
for(i=0;i<nvar;i++) // Final RK4 output
{
yOut[i] = yIn[i] + h6*(dydx[i]+dydxt[i]+2.0*dydxm[i]); //+K1/6+K4/6+(K2+K3)/3
yOut[i] = yIn[i]+h6*(dydx[i]+dydxt[i]+2.0*dydxm[i]); //+K1/6+K4/6+(K2+K3)/3
}
// NormaliseTangentVector( yOut );
return ;
} // end of DumbStepper ....................................................
////////////////////////////////////////////////////////////////////
@@ -114,74 +113,17 @@ G4ClassicalRK4::DumbStepper( const G4double yIn[],
//
void
G4ClassicalRK4::StepWithEst( const G4double yIn[],
const G4double dydx[],
G4double h,
G4double yOut[],
G4double& alpha2,
G4double& beta2,
const G4double B1[],
G4double B2[] )
G4ClassicalRK4::StepWithEst( const G4double*,
const G4double*,
G4double,
G4double*,
G4double&,
G4double&,
const G4double*,
G4double* )
{
G4Exception(" G4ClassicalRK4::StepWithEst ERROR: this Method is no longer used.");
#if 0 // const G4int nvar = 6 ;
G4int nvar = GetNumberOfVariables();
G4int i;
G4double hh = h*0.5 , h6 = h/6.0 ;
G4double B[3] ;
alpha2 = 0 ;
beta2 = 0 ;
for(i=0;i<nvar;i++)
{
yt[i] = yIn[i] + hh*dydx[i] ; // 1st Step K1=h*dydx
}
GetEquationOfMotion()->EvaluateRhsReturnB(yt,dydxt,B) ; // Calculates yderive &
// returns B too!
// RightHandSide(yt,dydxt) ; // 2nd Step K2=h*dydxt
for(i=0;i<nvar;i++)
{
yt[i] = yIn[i] + hh*dydxt[i] ;
}
GetEquationOfMotion()->EvaluateRhsReturnB(yt,dydxm,B2) ;
// RightHandSide(yt,dydxm) ; // 3rd Step K3=h*dydxm
for(i=0;i<3;i++)
{
beta2 += dydx[i+3] *dydx[i+3]
+ dydxt[i+3]*dydxt[i+3]
+ dydxm[i+3]*dydxm[i+3] ;
alpha2 += B1[i]*B1[i] + B[i]*B[i] + B2[i]*B2[i] ;
}
for(i=0;i<nvar;i++)
{
yt[i] = yIn[i] + h*dydxm[i] ;
dydxm[i] += dydxt[i] ; // now dydxm=(K2+K3)/h
}
GetEquationOfMotion()->EvaluateRhsReturnB(yt,dydxt,B2) ;
// RightHandSide(yt,dydxt) ; // 4th Step K4=h*dydxt
for(i=0;i<nvar;i++) // Final RK4 output
{
yOut[i] = yIn[i] + h6*(dydx[i]+dydxt[i]+2.0*dydxm[i]); //+K1/6+K4/6+(K2+K3)/3
}
for(i=0;i<3;i++)
{
beta2 += dydxt[i+3]*dydxt[i+3] ;
alpha2 += B2[i]*B2[i] ;
}
beta2 *= 0.25*h*h;
alpha2 *= sqr(GetEquationOfMotion()->FCof()*h)*0.25 ;
// NormaliseTangentVector( yOut );
#endif
return ;
G4Exception("ERROR - G4ClassicalRK4::StepWithEst(): method no longer used.");
return ;
} // end of StepWithEst ......................................................
@@ -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: G4ElectroMagneticField.cc,v 1.1 2003/04/02 08:49:11 gcosmo Exp $
// GEANT4 tag $Name: geant4-05-01 $
//
// --------------------------------------------------------------------
#include "G4ElectroMagneticField.hh"
G4ElectroMagneticField::G4ElectroMagneticField()
{
}
G4ElectroMagneticField::~G4ElectroMagneticField()
{
}
G4ElectroMagneticField::G4ElectroMagneticField(const G4ElectroMagneticField &r)
: G4MagneticField(r)
{
}
G4ElectroMagneticField&
G4ElectroMagneticField::operator = (const G4ElectroMagneticField &p)
{
if (&p == this) return *this;
*this = p; return *this;
}
@@ -33,7 +33,7 @@
void
G4EqMagElectricField::SetChargeMomentumMass(G4double particleCharge, // e+ units
G4double MomentumXc,
G4double,
G4double particleMass)
{
fElectroMagCof = eplus*particleCharge*c_light ;
@@ -22,7 +22,7 @@
//
//
// $Id: G4EquationOfMotion.cc,v 1.7 2002/06/11 08:34:27 japost Exp $
// GEANT4 tag $Name: geant4-05-00 $
// GEANT4 tag $Name: geant4-05-01 $
//
#include "G4EquationOfMotion.hh"
@@ -22,7 +22,7 @@
//
//
// $Id: G4ExplicitEuler.cc,v 1.5 2002/11/29 13:50:18 japost Exp $
// GEANT4 tag $Name: geant4-05-00 $
// GEANT4 tag $Name: geant4-05-01 $
//
//
// Explicit Euler: x_1 = x_0 + h * dx_0
@@ -22,7 +22,7 @@
//
//
// $Id: G4FieldManager.cc,v 1.7 2002/07/24 10:43:38 gcosmo Exp $
// GEANT4 tag $Name: geant4-05-00 $
// GEANT4 tag $Name: geant4-05-01 $
//
#include "G4FieldManager.hh"
@@ -22,7 +22,7 @@
//
//
// $Id: G4FieldTrack.cc,v 1.4 2001/07/11 09:59:11 gunter Exp $
// GEANT4 tag $Name: geant4-05-00 $
// GEANT4 tag $Name: geant4-05-01 $
//
#include "G4FieldTrack.hh"
@@ -22,7 +22,7 @@
//
//
// $Id: G4HelixExplicitEuler.cc,v 1.4 2001/07/11 09:59:11 gunter Exp $
// GEANT4 tag $Name: geant4-05-00 $
// GEANT4 tag $Name: geant4-05-01 $
//
#include "G4HelixExplicitEuler.hh"
#include "G4ThreeVector.hh"
@@ -22,7 +22,7 @@
//
//
// $Id: G4HelixHeum.cc,v 1.4 2001/07/11 09:59:12 gunter Exp $
// GEANT4 tag $Name: geant4-05-00 $
// GEANT4 tag $Name: geant4-05-01 $
//
#include "G4HelixHeum.hh"
#include "G4ThreeVector.hh"
@@ -22,7 +22,7 @@
//
//
// $Id: G4HelixImplicitEuler.cc,v 1.4 2001/07/11 09:59:12 gunter Exp $
// GEANT4 tag $Name: geant4-05-00 $
// GEANT4 tag $Name: geant4-05-01 $
//
#include "G4HelixImplicitEuler.hh"
#include "G4ThreeVector.hh"
@@ -22,7 +22,7 @@
//
//
// $Id: G4HelixSimpleRunge.cc,v 1.5 2001/07/11 09:59:12 gunter Exp $
// GEANT4 tag $Name: geant4-05-00 $
// GEANT4 tag $Name: geant4-05-01 $
//
#include "G4HelixSimpleRunge.hh"
#include "G4ThreeVector.hh"

Some files were not shown because too many files have changed in this diff Show More