Import Geant4 0.1.0 source tree
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
# $Id: GNUmakefile,v 2.0 1998/07/02 16:41:34 gunter Exp $
|
||||
# $Id: GNUmakefile,v 1.1 1999/01/07 16:14:02 gunter Exp $
|
||||
# ------------------------------------------------------------
|
||||
# GNUmakefile for transportation library. G.Folger 10-Dec-97.
|
||||
# ------------------------------------------------------------
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
$Id: History,v 2.14 1998/12/08 04:06:31 verderi Exp $
|
||||
$Id: History,v 1.4 1999/04/19 14:52:30 mora Exp $
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=========================================================
|
||||
@@ -16,6 +16,274 @@ committal in the CVS repository !
|
||||
----------------------------------------------------------
|
||||
* Reverse chronological order (last date on top), please *
|
||||
----------------------------------------------------------
|
||||
|
||||
April 19, 1999 M. Verderi & P. Mora de Freitas
|
||||
|
||||
Changes in G4FastStep to co-work with track-01-00-04:
|
||||
|
||||
1) The method void CheckIt(const G4Track&) becomes
|
||||
G4bool CheckIt(const G4Track&);
|
||||
2) The FAST_STEP_DEBUG compiling option disappears;
|
||||
3) Call to CheckIt controled by the G4VParticleChange::debugFlag attribute.
|
||||
|
||||
Miscellaneous: the declaration "G4double mass = masss =..." in G4FastStep.hh
|
||||
corrected to G4double mass =...".
|
||||
|
||||
April 15, 1999 M. Verderi & P. Mora de Freitas
|
||||
|
||||
Tasks to decouple visualization from processes/parameterisation:
|
||||
|
||||
1) G4GlobalFastSimulationManager now inherites from the intercoms/
|
||||
G4VGlobalFastSimulationManager to allow visualisation to get a
|
||||
concrete instance pointer to the G4GlobalFastSimulationManager,
|
||||
if any.
|
||||
|
||||
2) G4FlavoredParallelWorld now inherites from the intercoms/
|
||||
G4VFlavoredParallelWorld, a pure virtual abstract class to interface
|
||||
parameterisation with visualization.
|
||||
|
||||
Co-works with intercoms-01-00-01 tag
|
||||
|
||||
Modified files:
|
||||
---------------
|
||||
G4FlavoredParallelWorld.hh
|
||||
G4GlobalFastSimulationManager.hh
|
||||
G4GlobalFastSimulationManager.cc
|
||||
|
||||
Done, tested, system-tested on HP-aCC with exemple N05.
|
||||
|
||||
April 14, 1999 M. Verderi & P. Mora de Freitas
|
||||
|
||||
Several consolidation tasks (thanks to G. Cosmo):
|
||||
|
||||
1) Warning:
|
||||
-----------
|
||||
|
||||
Pointers usage
|
||||
|
||||
- Setting pointers to 0 after delete:
|
||||
|
||||
delete pA;
|
||||
pA = 0;
|
||||
|
||||
- Avoid to use "NULL".
|
||||
|
||||
Modified files:
|
||||
---------------
|
||||
G4FastSimulationManager.hh
|
||||
G4FastTrack.hh
|
||||
G4FlavoredParallelWorld.hh
|
||||
G4FastSimulationManager.cc
|
||||
G4FastSimulationMessenger.cc
|
||||
G4FastSimulationManagerProcess.cc
|
||||
G4FastTrack.cc
|
||||
G4GlobalFastSimulationManager.cc
|
||||
G4VFastSimulationModel.cc
|
||||
|
||||
Status:
|
||||
-------
|
||||
Done, tested, system-tested on HP-aCC with exemple N05.
|
||||
|
||||
2) Warning:
|
||||
-----------
|
||||
include/G4FastSimulationManager.hh:163
|
||||
Public member functions shall always return const handles to member data
|
||||
Severe violation: Universal Coding Standards item 18
|
||||
|
||||
offending code:
|
||||
---------------
|
||||
inline G4VParticleChange* G4FastSimulationManager::GettheParticleChange()
|
||||
{
|
||||
return &fFastStep;
|
||||
}
|
||||
|
||||
Diagnostic:
|
||||
----------
|
||||
|
||||
Called by the G4FastSimulationManagerProcess to return it in the
|
||||
PostStepDoIt call.
|
||||
|
||||
Action:
|
||||
-------
|
||||
The G4FastSimulationManager::GettheParticleChange() method doesn't exist any
|
||||
more. The G4VParticleChange* is now returned directly when invoking the
|
||||
G4FastSimulationManager::InvokePostStepDoIt() and
|
||||
G4FastSimulationManager::InvokeAtRestDoIt() methodes.
|
||||
|
||||
Modified files:
|
||||
---------------
|
||||
G4FastSimulationManager.hh
|
||||
G4FastSimulationManager.cc
|
||||
G4FastSimulationManagerProcess.cc
|
||||
|
||||
Status:
|
||||
-------
|
||||
Done, tested, system-tested on HP-aCC with exemple N05.
|
||||
|
||||
3) Warning:
|
||||
-----------
|
||||
include/G4FastSimulationManagerProcess.hh:52
|
||||
If a class has virtual functions it shall have a virtual destructor
|
||||
Severe violation: Universal Coding Standards item 17
|
||||
class G4FastSimulationManagerProcess has virtual functions without a virtual destructor.
|
||||
|
||||
offending code:
|
||||
---------------
|
||||
~G4FastSimulationManagerProcess();
|
||||
|
||||
Diagnostic:
|
||||
----------
|
||||
Nobody should inherites from G4FastSimulationManagerProcess BUT for virtual
|
||||
is added.
|
||||
|
||||
Action:
|
||||
-------
|
||||
virtual ~G4FastSimulationManagerProcess();
|
||||
|
||||
Modified files:
|
||||
---------------
|
||||
G4FastSimulationManagerProcess.hh
|
||||
|
||||
Status:
|
||||
-------
|
||||
Done.
|
||||
|
||||
4) Warning:
|
||||
-----------
|
||||
include/G4FastSimulationMessenger.hh:36
|
||||
If a class has virtual functions it shall have a virtual destructor
|
||||
Severe violation: Universal Coding Standards item 17
|
||||
class G4FastSimulationMessenger has virtual functions without a virtual destructor.
|
||||
|
||||
|
||||
offending code:
|
||||
---------------
|
||||
~G4FastSimulationMessenger();
|
||||
|
||||
Diagnostic:
|
||||
----------
|
||||
Nobody should inherites from G4FastSimulationMessenger BUT for virtual
|
||||
is added.
|
||||
|
||||
Action:
|
||||
-------
|
||||
virtual ~G4FastSimulationMessenger();
|
||||
|
||||
Modified files:
|
||||
---------------
|
||||
G4FastSimulationMessenger.hh
|
||||
|
||||
Status:
|
||||
-------
|
||||
Done.
|
||||
|
||||
5) Warning:
|
||||
-----------
|
||||
include/G4FastStep.hh:224
|
||||
Operator= should call base class operator=
|
||||
Possible severe violation: Effective C++ item 16
|
||||
operator= in class G4FastStep, should call operator= in base class G4VParticleChange
|
||||
|
||||
offending code:
|
||||
---------------
|
||||
G4FastStep & G4FastStep::operator=(const G4FastStep &right)
|
||||
{
|
||||
if (this != &right)
|
||||
{
|
||||
theListOfSecondaries = right.theListOfSecondaries;
|
||||
theSizeOftheListOfSecondaries = right.theSizeOftheListOfSecondaries;
|
||||
theNumberOfSecondaries = right.theNumberOfSecondaries;
|
||||
theStatusChange = right.theStatusChange;
|
||||
theMomentumChange = right.theMomentumChange;
|
||||
thePolarizationChange = right.thePolarizationChange;
|
||||
thePositionChange = right.thePositionChange;
|
||||
theTimeChange = right.theTimeChange;
|
||||
theEnergyChange = right.theEnergyChange;
|
||||
theTrueStepLength = right.theTrueStepLength;
|
||||
theLocalEnergyDeposit = right.theLocalEnergyDeposit;
|
||||
theSteppingControlFlag = right.theSteppingControlFlag;
|
||||
theWeightChange = right.theWeightChange;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
Diagnostic:
|
||||
----------
|
||||
Bug detected.
|
||||
|
||||
Action:
|
||||
-------
|
||||
Insert the call
|
||||
G4VParticleChange::operator=(right);
|
||||
|
||||
Status:
|
||||
-------
|
||||
Done, tested, system-tested on HP-aCC with exemple N05.
|
||||
|
||||
Modified files:
|
||||
---------------
|
||||
G4FastStep.cc
|
||||
|
||||
6) Warning:
|
||||
-----------
|
||||
include/G4FastStep.hh:59
|
||||
Avoid data members in the public interface
|
||||
Violation: Effective C++ item 20
|
||||
Public data members for class G4FastStep:
|
||||
debugFlag
|
||||
|
||||
|
||||
offending code:
|
||||
---------------
|
||||
public:
|
||||
...
|
||||
G4bool debugFlag;
|
||||
|
||||
Diagnostic:
|
||||
----------
|
||||
Historical usage.
|
||||
|
||||
Action:
|
||||
-------
|
||||
Replaced by #ifdef FAST_STEP_DEBUG in the G4FastStep.cc file.
|
||||
|
||||
Modified files:
|
||||
---------------
|
||||
G4FastStep.hh, G4FastStep.cc
|
||||
|
||||
Status:
|
||||
-------
|
||||
Done, tested, system-tested on HP-aCC with exemple N05.
|
||||
|
||||
7) Warning:
|
||||
-----------
|
||||
include/G4FastStep.hh:59
|
||||
If a class has virtual functions it shall have a virtual destructor
|
||||
Severe violation: Universal Coding Standards item 17
|
||||
class G4FastStep has virtual functions without a virtual destructor.
|
||||
|
||||
|
||||
offending code:
|
||||
---------------
|
||||
~G4FastStep();
|
||||
|
||||
Diagnostic:
|
||||
----------
|
||||
Nobody should inherites from G4FastStep BUT virtual added.
|
||||
|
||||
Action:
|
||||
-------
|
||||
virtual ~G4FastStep();
|
||||
|
||||
Modified files:
|
||||
---------------
|
||||
G4FastStep.hh
|
||||
|
||||
Status:
|
||||
-------
|
||||
Done, tested, system-tested on HP-aCC with exemple N05.
|
||||
|
||||
|
||||
December 7, 1998 M. Verderi
|
||||
G4FastSimulationManagerProcess class:
|
||||
Fixes made for ghost navigation with
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4FastSimulationManager.hh,v 2.7 1998/10/26 14:31:33 mora Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
// $Id: G4FastSimulationManager.hh,v 1.2 1999/04/14 14:25:23 mora Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
@@ -114,17 +114,14 @@ public:
|
||||
//----------------------------------------------
|
||||
// Trigger
|
||||
G4bool PostStepGetFastSimulationManagerTrigger(const G4Track &,
|
||||
const G4Navigator* a = NULL);
|
||||
const G4Navigator* a = 0);
|
||||
// DoIt
|
||||
void InvokePostStepDoIt();
|
||||
G4VParticleChange* InvokePostStepDoIt();
|
||||
|
||||
// AtRest methods:
|
||||
G4bool AtRestGetFastSimulationManagerTrigger(const G4Track &,
|
||||
const G4Navigator* a = NULL);
|
||||
void InvokeAtRestDoIt();
|
||||
|
||||
//Final G4VParticleChange* to return to the Stepping.
|
||||
G4VParticleChange* GettheParticleChange();
|
||||
const G4Navigator* a = 0);
|
||||
G4VParticleChange* InvokeAtRestDoIt();
|
||||
|
||||
// For RW management
|
||||
G4bool operator == ( const G4FastSimulationManager&) const;
|
||||
@@ -147,7 +144,7 @@ G4FastSimulationManager::AddFastSimulationModel(G4VFastSimulationModel* fsm)
|
||||
{
|
||||
ModelList.insert(fsm);
|
||||
// forces the fApplicableModelList to be rebuild
|
||||
fLastCrossedParticle=NULL;
|
||||
fLastCrossedParticle = 0;
|
||||
}
|
||||
|
||||
inline void
|
||||
@@ -155,12 +152,7 @@ G4FastSimulationManager::RemoveFastSimulationModel(G4VFastSimulationModel* fsm)
|
||||
{
|
||||
if(!ModelList.remove(fsm)) fInactivatedModels.remove(fsm);
|
||||
// forces the fApplicableModelList to be rebuild
|
||||
fLastCrossedParticle=NULL;
|
||||
}
|
||||
|
||||
inline G4VParticleChange* G4FastSimulationManager::GettheParticleChange()
|
||||
{
|
||||
return &fFastStep;
|
||||
fLastCrossedParticle = 0;
|
||||
}
|
||||
|
||||
inline G4bool
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4FastSimulationManagerProcess.hh,v 2.4 1998/12/08 04:06:44 verderi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
// $Id: G4FastSimulationManagerProcess.hh,v 1.3 1999/04/28 10:06:39 mora Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
@@ -42,7 +42,6 @@
|
||||
#include "G4TouchableHistory.hh"
|
||||
#include "G4VPhysicalVolume.hh"
|
||||
#include "G4VParticleChange.hh"
|
||||
#include "G4FlavoredParallelWorld.hh"
|
||||
|
||||
//------------------------------------------
|
||||
//
|
||||
@@ -62,7 +61,7 @@ public:
|
||||
"G4FastSimulationManagerProcess",
|
||||
G4ProcessType
|
||||
theType = fParameterisation);
|
||||
~G4FastSimulationManagerProcess();
|
||||
virtual ~G4FastSimulationManagerProcess();
|
||||
|
||||
//--------------------------------------------------------------
|
||||
// Process interface
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4FastSimulationMessenger.hh,v 2.3 1998/10/13 09:54:26 mora Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
// $Id: G4FastSimulationMessenger.hh,v 1.2 1999/04/14 14:25:24 mora Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
//
|
||||
//
|
||||
// GEANT 4 class header file
|
||||
@@ -36,7 +36,7 @@ class G4FastSimulationMessenger: public G4UImessenger
|
||||
{
|
||||
public:
|
||||
G4FastSimulationMessenger(G4GlobalFastSimulationManager* theGFSM);
|
||||
~G4FastSimulationMessenger();
|
||||
virtual ~G4FastSimulationMessenger();
|
||||
|
||||
public:
|
||||
void SetNewValue(G4UIcommand * command,G4String newValues);
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4FastStep.hh,v 2.6 1998/11/20 19:00:26 verderi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
// $Id: G4FastStep.hh,v 1.3 1999/04/19 14:27:44 mora Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
@@ -212,7 +212,7 @@ public:
|
||||
// Constructor/Destructor
|
||||
//------------------------
|
||||
G4FastStep();
|
||||
~G4FastStep();
|
||||
virtual ~G4FastStep();
|
||||
|
||||
// equal/unequal operator
|
||||
G4bool operator==(const G4FastStep &right) const;
|
||||
@@ -302,7 +302,6 @@ private:
|
||||
public:
|
||||
// for Debug
|
||||
void DumpInfo() const;
|
||||
G4bool debugFlag;
|
||||
G4bool CheckIt(const G4Track&);
|
||||
};
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4FastStep.icc,v 2.3 1998/11/20 19:00:27 verderi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
// $Id: G4FastStep.icc,v 1.1 1999/01/07 16:14:04 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
//
|
||||
// $id: G4ParticleChange.icc,v 1.6 1998/04/14 02:25:54 kurasige Exp $
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4FastTrack.hh,v 2.3 1998/10/13 09:54:30 mora Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
// $Id: G4FastTrack.hh,v 1.2 1999/04/14 14:25:27 mora Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
//
|
||||
// $Id:
|
||||
//---------------------------------------------------------------
|
||||
@@ -62,7 +62,7 @@ public:
|
||||
// The fast simulation manager uses the SetCurrentTrack
|
||||
// method to setup the current G4FastTrack object
|
||||
//------------------------------------------------------------
|
||||
void SetCurrentTrack(const G4Track&, const G4Navigator* a = NULL);
|
||||
void SetCurrentTrack(const G4Track&, const G4Navigator* a = 0);
|
||||
|
||||
//------------------------------------------------------------
|
||||
// The fast simulation manager uses the OnTheBoundaryButExiting
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4FlavoredParallelWorld.hh,v 2.1 1998/10/13 09:54:32 mora Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
// $Id: G4FlavoredParallelWorld.hh,v 1.3 1999/04/15 17:17:20 mora Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
@@ -27,41 +27,43 @@
|
||||
#ifndef G4FlavoredParallelWorld_hh
|
||||
#define G4FlavoredParallelWorld_hh
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4ParticleDefinition.hh"
|
||||
#include "G4VPhysicalVolume.hh"
|
||||
#include "G4VFlavoredParallelWorld.hh"
|
||||
|
||||
class G4FlavoredParallelWorld
|
||||
class G4ParticleDefinition;
|
||||
class G4VPhysicalVolume;
|
||||
|
||||
class G4FlavoredParallelWorld : public G4VFlavoredParallelWorld
|
||||
{
|
||||
public:
|
||||
//
|
||||
// Constructor
|
||||
G4FlavoredParallelWorld(G4ParticleDefinition *pParticleType,
|
||||
G4VPhysicalVolume *pWorld) {
|
||||
G4VPhysicalVolume *pWorld) {
|
||||
ParticleType=pParticleType;
|
||||
World=pWorld;
|
||||
}
|
||||
//
|
||||
// Destructor
|
||||
~G4FlavoredParallelWorld() {
|
||||
delete [] World;
|
||||
delete World;
|
||||
World = 0;
|
||||
}
|
||||
// Get/Set
|
||||
inline G4ParticleDefinition* GetTheParticleType() const {
|
||||
return ParticleType;
|
||||
}
|
||||
|
||||
|
||||
inline G4VPhysicalVolume* GetThePhysicalVolumeWorld() const {
|
||||
return World;
|
||||
}
|
||||
|
||||
|
||||
// operator ==
|
||||
inline G4bool
|
||||
operator == (const G4FlavoredParallelWorld& pw) const {
|
||||
return (this==&pw) ? true : false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
G4ParticleDefinition *ParticleType;
|
||||
G4VPhysicalVolume *World;
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4GlobalFastSimulationManager.hh,v 2.5 1998/10/13 09:54:33 mora Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
// $Id: G4GlobalFastSimulationManager.hh,v 1.3 1999/04/28 10:06:39 mora Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
@@ -31,6 +31,7 @@
|
||||
|
||||
#include <rw/tpordvec.h>
|
||||
|
||||
#include "G4VGlobalFastSimulationManager.hh"
|
||||
#include "G4FastSimulationManager.hh"
|
||||
#include "G4FastSimulationManagerProcess.hh"
|
||||
#include "G4StateManager.hh"
|
||||
@@ -45,7 +46,8 @@ enum listType {
|
||||
|
||||
class G4FastSimulationMessenger;
|
||||
|
||||
class G4GlobalFastSimulationManager : public G4VStateDependent
|
||||
class G4GlobalFastSimulationManager : public G4VStateDependent,
|
||||
public G4VGlobalFastSimulationManager
|
||||
{
|
||||
public:
|
||||
// Global access to the GlobalFastSimulationManager
|
||||
@@ -74,7 +76,7 @@ public:
|
||||
void InActivateFastSimulationModel(const G4String&);
|
||||
|
||||
// G4FastSimulationProcess interface
|
||||
G4FlavoredParallelWorld* GetFlavoredWorldForThis(G4ParticleDefinition *);
|
||||
G4VFlavoredParallelWorld* GetFlavoredWorldForThis(G4ParticleDefinition *);
|
||||
|
||||
// G4StateManager interface
|
||||
G4bool Notify(G4ApplicationState requestedState);
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4VFastSimulationModel.hh,v 2.2 1998/10/13 09:54:34 mora Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
// $Id: G4VFastSimulationModel.hh,v 1.1 1999/01/07 16:14:04 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4FastSimulationManager.cc,v 2.7 1998/10/26 14:31:36 mora Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
// $Id: G4FastSimulationManager.cc,v 1.2 1999/04/14 14:25:31 mora Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
//
|
||||
//$Id:
|
||||
//---------------------------------------------------------------
|
||||
@@ -32,8 +32,8 @@
|
||||
G4FastSimulationManager::
|
||||
G4FastSimulationManager(G4Envelope *anEnvelope,
|
||||
G4bool IsUnique) :
|
||||
fFastTrack(anEnvelope,IsUnique),fTriggedFastSimulationModel(NULL),
|
||||
fLastCrossedParticle(NULL)
|
||||
fFastTrack(anEnvelope,IsUnique),fTriggedFastSimulationModel(0),
|
||||
fLastCrossedParticle(0)
|
||||
{
|
||||
// Communicates to the Logical Volume that it becomes a
|
||||
// envelope and with this fast simulation manager.
|
||||
@@ -81,7 +81,7 @@ G4FastSimulationManager::ActivateFastSimulationModel(const G4String& aName)
|
||||
ModelList.
|
||||
insert(fInactivatedModels.removeAt(iModel));
|
||||
// forces the fApplicableModelList to be rebuild
|
||||
fLastCrossedParticle=NULL;
|
||||
fLastCrossedParticle=0;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -97,7 +97,7 @@ G4FastSimulationManager::InActivateFastSimulationModel(const G4String& aName)
|
||||
fInactivatedModels.
|
||||
insert(ModelList.removeAt(iModel));
|
||||
// forces the fApplicableModelList to be rebuild
|
||||
fLastCrossedParticle=NULL;
|
||||
fLastCrossedParticle=0;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -131,7 +131,7 @@ G4bool
|
||||
G4FastSimulationManager::RemoveGhostPlacement(const G4Transform3D *trans3d)
|
||||
{
|
||||
G4bool found;
|
||||
if((found=(GhostPlacements.remove(trans3d) != NULL)))
|
||||
if((found=(GhostPlacements.remove(trans3d) != 0)))
|
||||
G4GlobalFastSimulationManager::GetGlobalFastSimulationManager()->
|
||||
FastSimulationNeedsToBeClosed();
|
||||
return found;
|
||||
@@ -217,10 +217,11 @@ PostStepGetFastSimulationManagerTrigger(const G4Track& track,
|
||||
return false;
|
||||
}
|
||||
|
||||
void G4FastSimulationManager::InvokePostStepDoIt()
|
||||
G4VParticleChange* G4FastSimulationManager::InvokePostStepDoIt()
|
||||
{
|
||||
// const G4FastTrack& parFastTrack=fFastTrack;
|
||||
fTriggedFastSimulationModel->DoIt(fFastTrack,fFastStep);
|
||||
return &fFastStep;
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------
|
||||
@@ -268,11 +269,12 @@ G4FastSimulationManager::AtRestGetFastSimulationManagerTrigger(const G4Track& tr
|
||||
return false;
|
||||
}
|
||||
|
||||
void G4FastSimulationManager::InvokeAtRestDoIt()
|
||||
G4VParticleChange* G4FastSimulationManager::InvokeAtRestDoIt()
|
||||
{
|
||||
fTriggedFastSimulationModel->AtRestDoIt(fFastTrack,fFastStep);
|
||||
return &fFastStep;
|
||||
}
|
||||
|
||||
|
||||
G4bool
|
||||
G4FastSimulationManager::
|
||||
InsertGhostHereIfNecessary(G4VPhysicalVolume* theClone,
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4FastSimulationManagerProcess.cc,v 2.14 1998/12/08 04:06:48 verderi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
// $Id: G4FastSimulationManagerProcess.cc,v 1.3 1999/04/28 10:06:43 mora Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
@@ -53,7 +53,9 @@ G4FastSimulationManagerProcess(const G4String& processName,
|
||||
G4FastSimulationManagerProcess::~G4FastSimulationManagerProcess()
|
||||
{
|
||||
delete fGhostTouchable;
|
||||
fGhostTouchable = 0;
|
||||
delete fGhostFieldPropagator;
|
||||
fGhostFieldPropagator = 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -106,11 +108,11 @@ G4FastSimulationManagerProcess::PostStepGetPhysicalInteractionLength(
|
||||
// ----------------------------------------------------------
|
||||
if(fStartTracking)
|
||||
{
|
||||
G4FlavoredParallelWorld* flavoredWorld =
|
||||
G4VFlavoredParallelWorld* flavoredWorld =
|
||||
G4GlobalFastSimulationManager::GetGlobalFastSimulationManager()->
|
||||
GetFlavoredWorldForThis(track.GetDynamicParticle()->GetDefinition());
|
||||
|
||||
fGhostWorld = NULL;
|
||||
fGhostWorld = 0;
|
||||
if (flavoredWorld)
|
||||
fGhostWorld = flavoredWorld->GetThePhysicalVolumeWorld();
|
||||
|
||||
@@ -182,7 +184,7 @@ G4FastSimulationManagerProcess::PostStepGetPhysicalInteractionLength(
|
||||
track.GetMomentumDirection(),
|
||||
fGhostTouchable);
|
||||
}
|
||||
fOutOfGhostWorld = (fGhostTouchable->GetVolume() == NULL);
|
||||
fOutOfGhostWorld = (fGhostTouchable->GetVolume() == 0);
|
||||
}
|
||||
else if (previousStepSize > 0.0)
|
||||
{
|
||||
@@ -237,9 +239,10 @@ G4VParticleChange* G4FastSimulationManagerProcess::PostStepDoIt(
|
||||
if (fFastSimulationTrigger)
|
||||
{
|
||||
// Executes the ParameterisedSimulation code.
|
||||
fFastSimulationManager->InvokePostStepDoIt();
|
||||
// Gets the ParameterisedSimulation response.
|
||||
G4VParticleChange* Response=fFastSimulationManager->GettheParticleChange();
|
||||
// and gets the ParameterisedSimulation response.
|
||||
G4VParticleChange* Response=
|
||||
fFastSimulationManager->InvokePostStepDoIt();
|
||||
|
||||
// If the particle is still alive, suspend it
|
||||
// to re-initialise the other process.
|
||||
if (Response->GetStatusChange() != fStopAndKill)
|
||||
@@ -410,7 +413,7 @@ G4FastSimulationManagerProcess::AtRestGetPhysicalInteractionLength(
|
||||
{
|
||||
if ( (fFastSimulationManager =
|
||||
track.GetVolume()->GetLogicalVolume()->GetFastSimulationManager())
|
||||
!= NULL )
|
||||
!= 0 )
|
||||
if (fFastSimulationManager->AtRestGetFastSimulationManagerTrigger(track))
|
||||
{
|
||||
// "*condition = ExclusivelyForced;" Not yet available
|
||||
@@ -453,7 +456,7 @@ G4FastSimulationManagerProcess::AtRestGetPhysicalInteractionLength(
|
||||
fGhostTouchable);
|
||||
|
||||
}
|
||||
fOutOfGhostWorld = (fGhostTouchable->GetVolume() == NULL);
|
||||
fOutOfGhostWorld = (fGhostTouchable->GetVolume() == 0);
|
||||
}
|
||||
|
||||
if (!fOutOfGhostWorld)
|
||||
@@ -493,9 +496,7 @@ G4VParticleChange* G4FastSimulationManagerProcess::AtRestDoIt(
|
||||
const G4Track& track,
|
||||
const G4Step& Step)
|
||||
{
|
||||
fFastSimulationManager->InvokeAtRestDoIt();
|
||||
G4VParticleChange* Response = fFastSimulationManager->GettheParticleChange();
|
||||
return Response;
|
||||
return fFastSimulationManager->InvokeAtRestDoIt();
|
||||
}
|
||||
|
||||
void G4FastSimulationManagerProcess::StartTracking()
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4FastSimulationMessenger.cc,v 2.3 1998/10/13 09:54:40 mora Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
// $Id: G4FastSimulationMessenger.cc,v 1.2 1999/04/14 14:25:35 mora Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
//
|
||||
|
||||
#include "G4FastSimulationMessenger.hh"
|
||||
@@ -60,11 +60,17 @@ G4FastSimulationMessenger(G4GlobalFastSimulationManager* theGFSM)
|
||||
G4FastSimulationMessenger::~G4FastSimulationMessenger()
|
||||
{
|
||||
delete fListIsApplicableCmd;
|
||||
fListIsApplicableCmd = 0;
|
||||
delete fActivateModel;
|
||||
fActivateModel = 0;
|
||||
delete fInActivateModel;
|
||||
fInActivateModel = 0;
|
||||
delete fListModelsCmd;
|
||||
fListModelsCmd = 0;
|
||||
delete fListEnvelopesCmd;
|
||||
fListEnvelopesCmd = 0;
|
||||
delete fFSDirectory;
|
||||
fFSDirectory = 0;
|
||||
}
|
||||
|
||||
void G4FastSimulationMessenger::SetNewValue(G4UIcommand * command,G4String newValue)
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4FastStep.cc,v 2.8 1998/11/20 19:00:46 verderi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
// $Id: G4FastStep.cc,v 1.4 1999/05/11 14:29:38 mora Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
//
|
||||
//$Id:
|
||||
//---------------------------------------------------------------
|
||||
@@ -238,7 +238,6 @@ void G4FastStep::Initialize(const G4Track&) {
|
||||
|
||||
G4FastStep::G4FastStep():G4VParticleChange()
|
||||
{
|
||||
debugFlag = true;
|
||||
if (verboseLevel>2) {
|
||||
G4cerr << "G4FastStep::G4FastStep() " << endl;
|
||||
}
|
||||
@@ -262,23 +261,28 @@ G4FastStep & G4FastStep::operator=(const G4FastStep &right)
|
||||
{
|
||||
if (this != &right)
|
||||
{
|
||||
theListOfSecondaries = right.theListOfSecondaries;
|
||||
theSizeOftheListOfSecondaries = right.theSizeOftheListOfSecondaries;
|
||||
theNumberOfSecondaries = right.theNumberOfSecondaries;
|
||||
theStatusChange = right.theStatusChange;
|
||||
theMomentumChange = right.theMomentumChange;
|
||||
thePolarizationChange = right.thePolarizationChange;
|
||||
thePositionChange = right.thePositionChange;
|
||||
theTimeChange = right.theTimeChange;
|
||||
theEnergyChange = right.theEnergyChange;
|
||||
theTrueStepLength = right.theTrueStepLength;
|
||||
theLocalEnergyDeposit = right.theLocalEnergyDeposit;
|
||||
theSteppingControlFlag = right.theSteppingControlFlag;
|
||||
theWeightChange = right.theWeightChange;
|
||||
G4VParticleChange::operator=(right);
|
||||
theListOfSecondaries = right.theListOfSecondaries;
|
||||
theSizeOftheListOfSecondaries = right.theSizeOftheListOfSecondaries;
|
||||
theNumberOfSecondaries = right.theNumberOfSecondaries;
|
||||
theStatusChange = right.theStatusChange;
|
||||
theMomentumChange = right.theMomentumChange;
|
||||
thePolarizationChange = right.thePolarizationChange;
|
||||
thePositionChange = right.thePositionChange;
|
||||
theTimeChange = right.theTimeChange;
|
||||
theEnergyChange = right.theEnergyChange;
|
||||
theTrueStepLength = right.theTrueStepLength;
|
||||
theLocalEnergyDeposit = right.theLocalEnergyDeposit;
|
||||
theSteppingControlFlag = right.theSteppingControlFlag;
|
||||
theWeightChange = right.theWeightChange;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
G4bool G4FastStep::operator==(const G4FastStep &right) const
|
||||
{
|
||||
return ((G4VParticleChange *)this == (G4VParticleChange *) &right);
|
||||
@@ -323,9 +327,9 @@ G4Step* G4FastStep::UpdateStepForPostStep(G4Step* pStep)
|
||||
// update weight
|
||||
pPostStepPoint->SetWeight( theWeightChange );
|
||||
|
||||
|
||||
if (debugFlag) CheckIt(*aTrack);
|
||||
|
||||
|
||||
// Update the G4Step specific attributes
|
||||
return UpdateStepInfo(pStep);
|
||||
}
|
||||
@@ -337,7 +341,7 @@ G4Step* G4FastStep::UpdateStepForAtRest(G4Step* pStep)
|
||||
G4StepPoint* pPreStepPoint = pStep->GetPreStepPoint();
|
||||
G4StepPoint* pPostStepPoint = pStep->GetPostStepPoint();
|
||||
G4Track* aTrack = pStep->GetTrack();
|
||||
G4double mass = mass = aTrack->GetDynamicParticle()->GetMass();
|
||||
G4double mass = aTrack->GetDynamicParticle()->GetMass();
|
||||
|
||||
// update kinetic energy and momentum direction
|
||||
pPostStepPoint->SetMomentumDirection(theMomentumChange);
|
||||
@@ -356,7 +360,6 @@ G4Step* G4FastStep::UpdateStepForAtRest(G4Step* pStep)
|
||||
// update weight
|
||||
pPostStepPoint->SetWeight( theWeightChange );
|
||||
|
||||
|
||||
if (debugFlag) CheckIt(*aTrack);
|
||||
|
||||
// Update the G4Step specific attributes
|
||||
@@ -413,38 +416,79 @@ void G4FastStep::DumpInfo() const
|
||||
|
||||
G4bool G4FastStep::CheckIt(const G4Track& aTrack)
|
||||
{
|
||||
//
|
||||
// In the G4FastStep::CheckIt
|
||||
// We only check a bit
|
||||
//
|
||||
// If the user violates the energy,
|
||||
// We don't care, we agree.
|
||||
//
|
||||
// But for theMomentumDirectionChange,
|
||||
// We do pay attention.
|
||||
// And if too large is its range,
|
||||
// We issue an Exception.
|
||||
//
|
||||
//
|
||||
// It means, the G4FastStep::CheckIt issues an exception only for the
|
||||
// theMomentumDirectionChange which should be an unit vector
|
||||
// and it corrects it because it could cause problems for the ulterior
|
||||
// tracking.For the rest, only warning are issued.
|
||||
|
||||
G4bool itsOK = true;
|
||||
if (theEnergyChange > aTrack.GetKineticEnergy()) {
|
||||
G4cout << " !!! the energy becomes larger than the initial energy !!!"
|
||||
<< " : " << (theEnergyChange -aTrack.GetKineticEnergy())/MeV
|
||||
<< "MeV " <<endl;
|
||||
G4bool exitWithError = false;
|
||||
G4double accuracy;
|
||||
|
||||
if (theEnergyChange > aTrack.GetKineticEnergy() * (1.0 - accuracyForWarning)) {
|
||||
G4cout << " G4FastStep::CheckIt : ";
|
||||
G4cout << "the energy becomes larger than the initial energy !!"
|
||||
<< " Difference : " << (theEnergyChange -aTrack.GetKineticEnergy())/MeV
|
||||
<< "[MeV] " <<endl;
|
||||
itsOK = false;
|
||||
}
|
||||
if ( (theEnergyChange >0.) &&
|
||||
( abs(theMomentumChange.mag2()-1.0) > 1.0e-5 ) ){
|
||||
G4cout << " !!! the Momentum Change is not unit vector !!!!"
|
||||
<< " : " << theMomentumChange.mag()
|
||||
<< endl;
|
||||
|
||||
G4bool itsOKforMomentum = true;
|
||||
if ( theEnergyChange >0.) {
|
||||
accuracy = abs(theMomentumChange.mag2()-1.0);
|
||||
if (accuracy > accuracyForWarning) {
|
||||
G4cout << " G4FastStep::CheckIt : ";
|
||||
G4cout << "the Momentum Change is not unit vector !!"
|
||||
<< " Difference: " << accuracy << endl;
|
||||
itsOK = itsOKforMomentum = false;
|
||||
if (accuracy > accuracyForException) exitWithError = true;
|
||||
}
|
||||
}
|
||||
|
||||
accuracy = (aTrack.GetGlobalTime()- theTimeChange)/ns;
|
||||
if (accuracy > accuracyForWarning) {
|
||||
G4cout << " G4FastStep::CheckIt : ";
|
||||
G4cout << "the global time goes back !!"
|
||||
<< " Difference: " << accuracy << "[ns] " <<endl;
|
||||
itsOK = false;
|
||||
}
|
||||
if (theTimeChange < aTrack.GetGlobalTime()) {
|
||||
G4cout << " !!! the global time goes back !!!"
|
||||
<< " : " << aTrack.GetGlobalTime()/ns
|
||||
<< " -> " << theTimeChange/ns
|
||||
<< "[ns] " <<endl;
|
||||
itsOK = false;
|
||||
}
|
||||
if (theProperTimeChange < aTrack.GetProperTime()) {
|
||||
G4cout << " !!! the poper time goes back !!!"
|
||||
<< " : " << aTrack.GetProperTime()/ns
|
||||
<< " -> " << theProperTimeChange/ns
|
||||
<< "[ns] " <<endl;
|
||||
|
||||
accuracy = (aTrack.GetProperTime() - theProperTimeChange )/ns;
|
||||
if (accuracy) {
|
||||
G4cout << " G4FastStep::CheckIt : ";
|
||||
G4cout << "the proper time goes back !!"
|
||||
<< " Difference: " << accuracy << "[ns] " <<endl;
|
||||
itsOK = false;
|
||||
}
|
||||
|
||||
if (!itsOK) {
|
||||
G4cout << " G4FastStep::CheckIt " <<endl;
|
||||
G4cout << " pointer : " << this <<endl ;
|
||||
DumpInfo();
|
||||
}
|
||||
|
||||
// Exit with error
|
||||
if (exitWithError) G4Exception("G4ParticleChange::CheckIt");
|
||||
|
||||
//correction for Momentum only.
|
||||
if (!itsOKforMomentum) {
|
||||
G4double vmag = theMomentumChange.mag();
|
||||
theMomentumChange = (1./vmag)*theMomentumChange;
|
||||
}
|
||||
|
||||
itsOK = (itsOK) && G4VParticleChange::CheckIt(aTrack);
|
||||
return itsOK;
|
||||
}
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4FastTrack.cc,v 2.3 1998/10/13 09:54:43 mora Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
// $Id: G4FastTrack.cc,v 1.2 1999/04/14 14:25:36 mora Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
//
|
||||
//$Id:
|
||||
//---------------------------------------------------------------
|
||||
@@ -101,7 +101,7 @@ G4FastTrack::FRecordsAffineTransformation(const G4Navigator* theNavigator)
|
||||
// must be deleted by G4FastTrack.
|
||||
//--------------------------------------------------------
|
||||
const G4Navigator* NavigatorToUse;
|
||||
if(theNavigator != NULL ) NavigatorToUse=theNavigator;
|
||||
if(theNavigator != 0 ) NavigatorToUse=theNavigator;
|
||||
else
|
||||
NavigatorToUse=
|
||||
G4TransportationManager::GetTransportationManager()->
|
||||
@@ -147,6 +147,7 @@ G4FastTrack::FRecordsAffineTransformation(const G4Navigator* theNavigator)
|
||||
// Delete the TouchableHistory created by the Navigator:
|
||||
//------------------------------------------------------
|
||||
delete history;
|
||||
history = 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4GlobalFastSimulationManager.cc,v 2.6 1998/10/13 09:54:44 mora Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
// $Id: G4GlobalFastSimulationManager.cc,v 1.4 1999/04/28 10:06:43 mora Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
@@ -46,6 +46,7 @@ G4GlobalFastSimulationManager::GetGlobalFastSimulationManager()
|
||||
if(!fGlobalFastSimulationManager)
|
||||
{
|
||||
fGlobalFastSimulationManager = new G4GlobalFastSimulationManager;
|
||||
fpConcreteInstance = fGlobalFastSimulationManager;
|
||||
}
|
||||
return fGlobalFastSimulationManager;
|
||||
}
|
||||
@@ -62,6 +63,7 @@ G4GlobalFastSimulationManager::G4GlobalFastSimulationManager()
|
||||
G4GlobalFastSimulationManager::~G4GlobalFastSimulationManager()
|
||||
{
|
||||
delete fTheFastSimulationMessenger;
|
||||
fTheFastSimulationMessenger = 0;
|
||||
}
|
||||
|
||||
void G4GlobalFastSimulationManager::FastSimulationNeedsToBeClosed()
|
||||
@@ -118,14 +120,14 @@ void G4GlobalFastSimulationManager::CloseFastSimulation()
|
||||
fClosed=true;
|
||||
}
|
||||
|
||||
G4FlavoredParallelWorld*
|
||||
G4VFlavoredParallelWorld*
|
||||
G4GlobalFastSimulationManager::
|
||||
GetFlavoredWorldForThis(G4ParticleDefinition* particle)
|
||||
{
|
||||
for (G4int ipw=0; ipw<NeededFlavoredWorlds.length(); ipw++)
|
||||
if(NeededFlavoredWorlds(ipw)->GetTheParticleType()==particle)
|
||||
return NeededFlavoredWorlds(ipw);
|
||||
return NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4VFastSimulationModel.cc,v 2.1 1998/10/13 09:54:45 mora Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
// $Id: G4VFastSimulationModel.cc,v 1.2 1999/04/14 14:25:38 mora Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
//
|
||||
// $Id:
|
||||
//---------------------------------------------------------------
|
||||
@@ -42,9 +42,9 @@ G4VFastSimulationModel(const G4String& aName,
|
||||
// Retrieves the Fast Simulation Manager ou creates one
|
||||
// if needed.
|
||||
G4FastSimulationManager* theFastSimulationManager;
|
||||
if ((theFastSimulationManager=anEnvelope->GetFastSimulationManager())
|
||||
==NULL) theFastSimulationManager=
|
||||
new G4FastSimulationManager(anEnvelope,IsUnique);
|
||||
if ((theFastSimulationManager=anEnvelope->GetFastSimulationManager()) == 0)
|
||||
theFastSimulationManager=
|
||||
new G4FastSimulationManager(anEnvelope,IsUnique);
|
||||
// adds this model to the Fast Simulation Manager.
|
||||
theFastSimulationManager->AddFastSimulationModel(this);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user