Import Geant4 9.0.0 source tree
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
$Id: History,v 1.33 2006/11/14 08:56:49 gcosmo Exp $
|
||||
$Id: History,v 1.35 2007/05/18 15:25:29 mverderi Exp $
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=========================================================
|
||||
@@ -17,6 +17,17 @@ committal in the CVS repository !
|
||||
* Reverse chronological order (last date on top), please *
|
||||
----------------------------------------------------------
|
||||
|
||||
May 18, 2007, M. Verderi
|
||||
- tag as param-V08-03-00
|
||||
|
||||
May 11, 2007, M. Verderi
|
||||
- remove include/G4FastSimulationManagerProcess81.hh
|
||||
include/G4FlavoredParallelWorld.hh
|
||||
include/G4GFSManager81.hh
|
||||
src/G4FastSimulationManagerProcess81.cc
|
||||
src/G4GFSManager81.cc
|
||||
|
||||
|
||||
November 10, 2006, M. Verderi - param-V08-01-00
|
||||
- Limited number of warning messages printed by the
|
||||
G4GlobalFastSimulationManager.
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4FastSimulationManager.hh,v 1.12 2006/11/03 17:26:04 mverderi Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// $Id: G4FastSimulationManager.hh,v 1.13 2007/05/11 13:50:20 mverderi Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
@@ -89,13 +89,13 @@ public: // with description
|
||||
//------------------------
|
||||
// Only one Constructor. By default the envelope can
|
||||
// be placed n-Times.
|
||||
// If the user is sure that it'll be placed just one time,
|
||||
// If the user is sure that it is placed just one time,
|
||||
// the IsUnique flag should be set TRUE to avoid the
|
||||
// G4AffineTransform re-calculations each time we reach
|
||||
// the envelope.
|
||||
|
||||
G4FastSimulationManager(G4Envelope *anEnvelope,
|
||||
G4bool IsUnique=FALSE);
|
||||
G4bool IsUnique = FALSE);
|
||||
// This is the only constructor. In this constructor you specify
|
||||
// the envelope by giving the G4Region (typedef-ed as G4Envelope)
|
||||
// pointer. The G4FastSimulationManager object will bind itself to
|
||||
@@ -148,13 +148,6 @@ public: // without description
|
||||
{return ModelList;}
|
||||
|
||||
|
||||
// -------------------------------------------------------------
|
||||
// Deprecated ghost methods, to be dropped @ next major release:
|
||||
// -------------------------------------------------------------
|
||||
G4Transform3D* AddGhostPlacement(G4RotationMatrix*, const G4ThreeVector&);
|
||||
G4Transform3D* AddGhostPlacement(G4Transform3D*);
|
||||
G4bool RemoveGhostPlacement(const G4Transform3D*);
|
||||
G4bool InsertGhostHereIfNecessary(G4VPhysicalVolume*, const G4ParticleDefinition&);
|
||||
//----------------------------------------------
|
||||
// Interface methods for the
|
||||
// G4FastSimulationManagerProcess process.
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4FastSimulationManagerProcess.hh,v 1.13 2006/11/03 17:26:04 mverderi Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// $Id: G4FastSimulationManagerProcess.hh,v 1.14 2007/05/11 13:50:20 mverderi Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
@@ -33,8 +33,7 @@
|
||||
// G4FastSimulationManagerProcess.hh
|
||||
//
|
||||
// Description:
|
||||
// The process that triggers parameterised simulations
|
||||
// if any.
|
||||
// The process that triggers parameterised simulations if any.
|
||||
//
|
||||
// History:
|
||||
// Feb 98: Parallel geometry sensitivity. MoraDeFreitas.
|
||||
@@ -42,146 +41,119 @@
|
||||
// (release B.00 for parameterisation). MoraDeFreitas.
|
||||
// Aug 97: First implementation. Verderi && MoraDeFreitas.
|
||||
// Apr 98: modified for new particle change. H.Kurashige
|
||||
// Oct 06: Move to parallel geometry scheme. M. Verderi
|
||||
// Nov 06: name xxx81 is given for this release. "81" will be
|
||||
// removed @ next maj. rel. so that this process becomes
|
||||
// the standard one.
|
||||
// May 07: remove "81" tags, to migrate to 9.0.
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
|
||||
|
||||
#ifndef G4FastSimulationManagerProcess_h
|
||||
#define G4FastSimulationManagerProcess_h 1
|
||||
#ifndef G4FastSimulationManagerProcess_hh
|
||||
#define G4FastSimulationManagerProcess_hh
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4VProcess.hh"
|
||||
#include "G4FastSimulationManager.hh"
|
||||
#include "G4Step.hh"
|
||||
#include "G4Navigator.hh"
|
||||
#include "G4PropagatorInField.hh"
|
||||
#include "G4VTouchable.hh"
|
||||
#include "G4TouchableHistory.hh"
|
||||
#include "G4VPhysicalVolume.hh"
|
||||
#include "G4VParticleChange.hh"
|
||||
|
||||
//------------------------------------------
|
||||
|
||||
// ---------------------------------------------------------------------
|
||||
//
|
||||
// G4FastSimulationManagerProcess class
|
||||
//
|
||||
//------------------------------------------
|
||||
// ---------------------------------------------------------------------
|
||||
|
||||
|
||||
// Class Description:
|
||||
// This is a G4VProcess. It provides the interface between the tracking and the parameterisation.
|
||||
// It has to be set in the process list of the particles you want to parameterise.
|
||||
// -- G4VProcess providing the interface between the tracking and the fast simulation.
|
||||
//
|
||||
|
||||
class G4FastSimulationManagerProcess : public G4VProcess
|
||||
{
|
||||
public:
|
||||
|
||||
//------------------------
|
||||
// Constructor/Destructor
|
||||
//------------------------
|
||||
|
||||
G4FastSimulationManagerProcess(const G4String&
|
||||
processName =
|
||||
"G4FastSimulationManagerProcess",
|
||||
G4ProcessType
|
||||
theType = fParameterisation);
|
||||
// -------------------------
|
||||
// Constructor/Destructor:
|
||||
// -------------------------
|
||||
// -- Constructor for parameterisation in mass geometry
|
||||
G4FastSimulationManagerProcess(const G4String& processName = "G4FastSimulationManagerProcess",
|
||||
G4ProcessType theType = fParameterisation);
|
||||
|
||||
// -- Contructors for parameterisation attached a parallel geometry.
|
||||
// -- Can also be used for the mass geometry, providing world volume name.
|
||||
// -- World volume specified by name or pointer.
|
||||
G4FastSimulationManagerProcess(const G4String& processName,
|
||||
const G4String& worldVolumeName,
|
||||
G4ProcessType theType = fParameterisation);
|
||||
G4FastSimulationManagerProcess(const G4String& processName,
|
||||
G4VPhysicalVolume* worldVolume,
|
||||
G4ProcessType theType = fParameterisation);
|
||||
|
||||
virtual ~G4FastSimulationManagerProcess();
|
||||
|
||||
//--------------------------------------------------------------
|
||||
// Process interface
|
||||
//--------------------------------------------------------------
|
||||
|
||||
// -----------------------
|
||||
// User access methods:
|
||||
// -----------------------
|
||||
G4VPhysicalVolume* GetWorldVolume() const {return fWorldVolume;}
|
||||
|
||||
// -- Set new world volume to the process
|
||||
void SetWorldVolume(G4String );
|
||||
void SetWorldVolume(G4VPhysicalVolume*);
|
||||
|
||||
|
||||
// --------------------------------------------------------------
|
||||
// Process interface
|
||||
// --------------------------------------------------------------
|
||||
|
||||
// -- Start/End tracking:
|
||||
void StartTracking(G4Track*);
|
||||
void EndTracking();
|
||||
|
||||
//---------------------------------------------------
|
||||
// GetPhysicalInteractionLength() and DoIt() methods:
|
||||
//---------------------------------------------------
|
||||
// -- PostStep methods:
|
||||
G4double PostStepGetPhysicalInteractionLength(const G4Track& track,
|
||||
G4double previousStepSize,
|
||||
G4ForceCondition* condition);
|
||||
|
||||
G4double PostStepGetPhysicalInteractionLength(const G4Track& track,
|
||||
G4double previousStepSize,
|
||||
G4ForceCondition* condition);
|
||||
G4VParticleChange* PostStepDoIt(const G4Track&, const G4Step& );
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// -- AtRest methods (still there after many years of no use...):
|
||||
G4double AtRestGetPhysicalInteractionLength(const G4Track&,
|
||||
G4ForceCondition*);
|
||||
|
||||
G4VParticleChange* AtRestDoIt(const G4Track&, const G4Step&);
|
||||
|
||||
|
||||
// -- unused:
|
||||
G4double AlongStepGetPhysicalInteractionLength(const G4Track&, G4double, G4double, G4double&, G4GPILSelection*) {return 0.0;}
|
||||
G4VParticleChange* AlongStepDoIt(const G4Track& , const G4Step&) {return 0;}
|
||||
|
||||
|
||||
// -- debug:
|
||||
void Verbose() const;
|
||||
|
||||
G4VParticleChange* PostStepDoIt(const G4Track& ,const G4Step& );
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
// GetPhysicalInteractionLength() and DoIt() methods for AtRest particles:
|
||||
//------------------------------------------------------------------------
|
||||
|
||||
G4double AtRestGetPhysicalInteractionLength(
|
||||
const G4Track& ,
|
||||
G4ForceCondition*
|
||||
);
|
||||
|
||||
G4VParticleChange* AtRestDoIt(
|
||||
const G4Track& ,
|
||||
const G4Step&
|
||||
);
|
||||
|
||||
|
||||
// -- no operation in AlongStepDoIt --
|
||||
G4double AlongStepGetPhysicalInteractionLength(
|
||||
const G4Track&,
|
||||
G4double ,
|
||||
G4double ,
|
||||
G4double&,
|
||||
G4GPILSelection*
|
||||
);
|
||||
G4VParticleChange* AlongStepDoIt(
|
||||
const G4Track& ,
|
||||
const G4Step&
|
||||
);
|
||||
|
||||
|
||||
private:
|
||||
// When trigged, the *fFastSimulationManager holds
|
||||
// the pointer used to call the DoIt() method.
|
||||
//-- would be better to my taste to have "const G4VPhysicalVolume* fWorldVolume;", but clashes at compilation
|
||||
G4VPhysicalVolume* fWorldVolume;
|
||||
|
||||
G4bool fIsTrackingTime;
|
||||
G4bool fIsFirstStep;
|
||||
G4Navigator* fNavigator;
|
||||
G4int fNavigatorIndex;
|
||||
|
||||
|
||||
G4FastSimulationManager* fFastSimulationManager;
|
||||
G4bool fFastSimulationTrigger;
|
||||
// this G4VParticleChange is used only when the safety limites the Step.
|
||||
G4VParticleChange aDummyParticleChange;
|
||||
G4ParticleChange xParticleChange;
|
||||
|
||||
// Flags that the track is starting
|
||||
G4bool fStartTracking;
|
||||
|
||||
// -------------------------------
|
||||
// Navigation in the Ghost World:
|
||||
// -------------------------------
|
||||
// Current parallel "ghost" world, related Navigator
|
||||
// and touchable history:
|
||||
G4VPhysicalVolume* fGhostWorld;
|
||||
G4Navigator fGhostNavigator;
|
||||
G4TouchableHistory* fGhostTouchable;
|
||||
G4bool fUpdateGhostTouchable;
|
||||
G4bool fOutOfGhostWorld;
|
||||
// Isotropic safety value to the next ghost volume
|
||||
// and allowed Step length:
|
||||
G4double fGhostSafety,
|
||||
fGhostStepLength;
|
||||
// Navigation with field:
|
||||
G4PropagatorInField* fGhostFieldPropagator;
|
||||
G4double fParticleCharge;
|
||||
G4bool fFieldExertsForce;
|
||||
|
||||
// Tracking Navigation used in PostStep, in case of mag-field:
|
||||
G4Navigator fTrackingNavigator;
|
||||
G4TouchableHistory fTrackingHistory;
|
||||
|
||||
// ******************************************************
|
||||
// ******************************************************
|
||||
//
|
||||
// For TESTS:
|
||||
//
|
||||
// ******************************************************
|
||||
// ******************************************************
|
||||
public:
|
||||
G4double GetPreSafety() {return fPreSafety;}
|
||||
G4double GetPreLinearSafety() {return fPreLinearSafety;}
|
||||
G4double GetSafety() {return fGhostSafety;}
|
||||
G4double GetLinearSafety() {return fGhostStepLength;}
|
||||
void Verbose() const;
|
||||
private:
|
||||
G4double fPreSafety, fPreLinearSafety;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,161 +0,0 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * 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. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4FastSimulationManagerProcess81.hh,v 1.1 2006/11/10 13:23:07 mverderi Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
//
|
||||
// G4FastSimulationManagerProcess81.hh
|
||||
//
|
||||
// Description:
|
||||
// The process that triggers parameterised simulations if any.
|
||||
//
|
||||
// History:
|
||||
// Feb 98: Parallel geometry sensitivity. MoraDeFreitas.
|
||||
// Oct 97: "Fast" replaces "Parameterisation" in class/method names.
|
||||
// (release B.00 for parameterisation). MoraDeFreitas.
|
||||
// Aug 97: First implementation. Verderi && MoraDeFreitas.
|
||||
// Apr 98: modified for new particle change. H.Kurashige
|
||||
// Oct 06: Move to parallel geometry scheme. M. Verderi
|
||||
// Nov 06: name xxx81 is given for this release. "81" will be
|
||||
// removed @ next maj. rel. so that this process becomes
|
||||
// the standard one.
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
|
||||
|
||||
#ifndef G4FastSimulationManagerProcess81_hh
|
||||
#define G4FastSimulationManagerProcess81_hh
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4VProcess.hh"
|
||||
#include "G4FastSimulationManager.hh"
|
||||
#include "G4Step.hh"
|
||||
#include "G4Navigator.hh"
|
||||
#include "G4VPhysicalVolume.hh"
|
||||
#include "G4VParticleChange.hh"
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------
|
||||
//
|
||||
// G4FastSimulationManagerProcess81 class
|
||||
//
|
||||
// ---------------------------------------------------------------------
|
||||
|
||||
|
||||
// Class Description:
|
||||
// -- G4VProcess providing the interface between the tracking and the fast simulation.
|
||||
//
|
||||
|
||||
class G4FastSimulationManagerProcess81 : public G4VProcess
|
||||
{
|
||||
public:
|
||||
|
||||
// -------------------------
|
||||
// Constructor/Destructor:
|
||||
// -------------------------
|
||||
// -- Constructor for parameterisation in mass geometry
|
||||
G4FastSimulationManagerProcess81(const G4String& processName = "G4FastSimulationManagerProcess81",
|
||||
G4ProcessType theType = fParameterisation);
|
||||
|
||||
// -- Contructors for parameterisation attached a parallel geometry.
|
||||
// -- Can also be used for the mass geometry, providing world volume name.
|
||||
// -- World volume specified by name or pointer.
|
||||
G4FastSimulationManagerProcess81(const G4String& processName,
|
||||
const G4String& worldVolumeName,
|
||||
G4ProcessType theType = fParameterisation);
|
||||
G4FastSimulationManagerProcess81(const G4String& processName,
|
||||
G4VPhysicalVolume* worldVolume,
|
||||
G4ProcessType theType = fParameterisation);
|
||||
|
||||
virtual ~G4FastSimulationManagerProcess81();
|
||||
|
||||
// -----------------------
|
||||
// User access methods:
|
||||
// -----------------------
|
||||
// -- const G4VPhysicalVolume* GetWorldVolume() const {return fWorldVolume;}
|
||||
G4VPhysicalVolume* GetWorldVolume() const {return fWorldVolume;}
|
||||
|
||||
// -- Set new world volume to the process
|
||||
void SetWorldVolume(G4String );
|
||||
void SetWorldVolume(G4VPhysicalVolume*);
|
||||
|
||||
|
||||
// --------------------------------------------------------------
|
||||
// Process interface
|
||||
// --------------------------------------------------------------
|
||||
|
||||
// -- Start/End tracking:
|
||||
void StartTracking(G4Track*);
|
||||
void EndTracking();
|
||||
|
||||
// -- PostStep methods:
|
||||
G4double PostStepGetPhysicalInteractionLength(const G4Track& track,
|
||||
G4double previousStepSize,
|
||||
G4ForceCondition* condition);
|
||||
|
||||
G4VParticleChange* PostStepDoIt(const G4Track&, const G4Step& );
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// -- AtRest methods (still there after many years of no use...):
|
||||
G4double AtRestGetPhysicalInteractionLength(const G4Track&,
|
||||
G4ForceCondition*);
|
||||
|
||||
G4VParticleChange* AtRestDoIt(const G4Track&, const G4Step&);
|
||||
|
||||
|
||||
// -- unused:
|
||||
G4double AlongStepGetPhysicalInteractionLength(const G4Track&, G4double, G4double, G4double&, G4GPILSelection*) {return 0.0;}
|
||||
G4VParticleChange* AlongStepDoIt(const G4Track& , const G4Step&) {return 0;}
|
||||
|
||||
|
||||
// -- debug:
|
||||
void Verbose() const;
|
||||
|
||||
|
||||
// ******* private *******
|
||||
|
||||
private:
|
||||
//-- would be better to my taste to have "const G4VPhysicalVolume* fWorldVolume;", but clashes at compilation
|
||||
G4VPhysicalVolume* fWorldVolume;
|
||||
|
||||
G4bool fIsTrackingTime;
|
||||
G4bool fIsFirstStep;
|
||||
G4Navigator* fNavigator;
|
||||
G4int fNavigatorIndex;
|
||||
|
||||
|
||||
G4FastSimulationManager* fFastSimulationManager;
|
||||
G4bool fFastSimulationTrigger;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4FastSimulationMessenger.hh,v 1.6 2006/11/03 17:26:04 mverderi Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// $Id: G4FastSimulationMessenger.hh,v 1.7 2007/05/11 13:50:20 mverderi Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
//
|
||||
// GEANT 4 class header file
|
||||
@@ -64,13 +64,13 @@ private:
|
||||
G4GlobalFastSimulationManager* fGlobalFastSimulationManager;
|
||||
|
||||
//commands
|
||||
G4UIdirectory* fFSDirectory;
|
||||
G4UIcmdWithoutParameter* fShowSetupCmd;
|
||||
G4UIcmdWithAString* fListEnvelopesCmd;
|
||||
G4UIcmdWithAString* fListModelsCmd;
|
||||
G4UIdirectory* fFSDirectory;
|
||||
G4UIcmdWithoutParameter* fShowSetupCmd;
|
||||
G4UIcmdWithAString* fListEnvelopesCmd;
|
||||
G4UIcmdWithAString* fListModelsCmd;
|
||||
G4UIcmdWithAString* fListIsApplicableCmd;
|
||||
G4UIcmdWithAString* fActivateModel;
|
||||
G4UIcmdWithAString* fInActivateModel;
|
||||
G4UIcmdWithAString* fActivateModel;
|
||||
G4UIcmdWithAString* fInActivateModel;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4FastStep.hh,v 1.8 2006/06/29 21:09:14 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4FastStep.icc,v 1.5 2006/06/29 21:09:16 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
// $id: G4ParticleChange.icc,v 1.6 1998/04/14 02:25:54 kurasige Exp $
|
||||
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4FastTrack.hh,v 1.7 2006/06/29 21:09:18 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// $Id: G4FastTrack.hh,v 1.8 2007/05/11 13:50:20 mverderi Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
// $Id:
|
||||
//---------------------------------------------------------------
|
||||
@@ -167,22 +167,24 @@ private:
|
||||
// of the envelope.
|
||||
//------------------------------------------------
|
||||
void FRecordsAffineTransformation(const G4Navigator*);
|
||||
G4bool fAffineTransformationDefined;
|
||||
G4Envelope* fEnvelope;
|
||||
G4bool fIsUnique;
|
||||
G4LogicalVolume* fEnvelopeLogicalVolume;
|
||||
G4VPhysicalVolume* fEnvelopePhysicalVolume;
|
||||
G4VSolid* fEnvelopeSolid;
|
||||
G4ThreeVector fLocalTrackPosition, fLocalTrackMomentum,
|
||||
fLocalTrackDirection, fLocalTrackPolarization;
|
||||
G4AffineTransform fAffineTransformation, fInverseAffineTransformation;
|
||||
G4bool fAffineTransformationDefined;
|
||||
G4Envelope* fEnvelope;
|
||||
G4bool fIsUnique;
|
||||
G4LogicalVolume* fEnvelopeLogicalVolume;
|
||||
G4VPhysicalVolume* fEnvelopePhysicalVolume;
|
||||
G4VSolid* fEnvelopeSolid;
|
||||
G4ThreeVector fLocalTrackPosition,
|
||||
fLocalTrackMomentum,
|
||||
fLocalTrackDirection,
|
||||
fLocalTrackPolarization;
|
||||
G4AffineTransform fAffineTransformation,
|
||||
fInverseAffineTransformation;
|
||||
};
|
||||
|
||||
//*******************************************************************
|
||||
//
|
||||
// Inline functions
|
||||
//
|
||||
//*******************************************************************
|
||||
|
||||
// -----------------
|
||||
// -- Inline methods
|
||||
// -----------------
|
||||
|
||||
inline G4Envelope* G4FastTrack::GetEnvelope() const
|
||||
{
|
||||
|
||||
@@ -1,92 +0,0 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * 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. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4FlavoredParallelWorld.hh,v 1.7 2006/11/03 17:26:04 mverderi Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
//
|
||||
// G4FlavoredParallelWorld.hh
|
||||
//
|
||||
// Description:
|
||||
// Internal class to keep ParticleType X Parallel world
|
||||
// relationship.
|
||||
//
|
||||
// History:
|
||||
// June 98: Verderi && MoraDeFreitas - "G4ParallelWorld" becomes
|
||||
// "G4FlavoredParallelWorld".
|
||||
// Mars 98: Verderi && MoraDeFreitas - First Implementation.
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
|
||||
#ifndef G4FlavoredParallelWorld_hh
|
||||
#define G4FlavoredParallelWorld_hh
|
||||
|
||||
#include "G4VFlavoredParallelWorld.hh"
|
||||
|
||||
class G4ParticleDefinition;
|
||||
#include "G4VPhysicalVolume.hh"
|
||||
|
||||
class G4FlavoredParallelWorld : public G4VFlavoredParallelWorld
|
||||
{
|
||||
public:
|
||||
//
|
||||
// Constructor
|
||||
G4FlavoredParallelWorld(G4ParticleDefinition *pParticleType,
|
||||
G4VPhysicalVolume *pWorld) {
|
||||
ParticleType=pParticleType;
|
||||
World=pWorld;
|
||||
}
|
||||
//
|
||||
// Destructor
|
||||
~G4FlavoredParallelWorld() {
|
||||
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;
|
||||
};
|
||||
|
||||
#endif
|
||||
// end of #ifndef G4FlavoredParallelWorld_hh
|
||||
@@ -1,73 +0,0 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * 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. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4GFSManager81.hh,v 1.1 2006/11/10 13:23:07 mverderi Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
//
|
||||
// G4GFSManager81.hh
|
||||
//
|
||||
// Description:
|
||||
// Gathers code to be dropped @ next major release
|
||||
//
|
||||
// History:
|
||||
// November 06: Marc Verderi
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
|
||||
#ifndef G4GFSManager81_hh
|
||||
#define G4GFSManager81_hh
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4FastSimulationVector.hh"
|
||||
#include "G4FlavoredParallelWorld.hh"
|
||||
#include "G4StateManager.hh"
|
||||
|
||||
class G4GFSManager;
|
||||
|
||||
class G4GFSManager81 {
|
||||
public:
|
||||
|
||||
~G4GFSManager81();
|
||||
|
||||
void FastSimulationNeedsToBeClosed();
|
||||
|
||||
public:
|
||||
void CloseFastSimulation();
|
||||
G4VFlavoredParallelWorld* GetFlavoredWorldForThis(G4ParticleDefinition *);
|
||||
G4bool Notify(G4ApplicationState requestedState);
|
||||
|
||||
G4GFSManager81();
|
||||
|
||||
private:
|
||||
G4bool fClosed;
|
||||
G4FastSimulationVector <G4FlavoredParallelWorld> NeededFlavoredWorlds;
|
||||
G4VPhysicalVolume* GiveMeAWorldVolumeClone();
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4GlobalFastSimulationManager.hh,v 1.12 2006/11/10 13:23:07 mverderi Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// $Id: G4GlobalFastSimulationManager.hh,v 1.13 2007/05/11 13:50:20 mverderi Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
@@ -53,10 +53,8 @@
|
||||
|
||||
#include "G4VGlobalFastSimulationManager.hh"
|
||||
#include "G4FastSimulationManager.hh"
|
||||
#include "G4FastSimulationManagerProcess81.hh"
|
||||
#include "G4StateManager.hh"
|
||||
#include "G4VStateDependent.hh"
|
||||
#include "G4FlavoredParallelWorld.hh"
|
||||
#include "G4FastSimulationManagerProcess.hh"
|
||||
|
||||
|
||||
class G4FastSimulationMessenger;
|
||||
|
||||
@@ -85,44 +83,29 @@ enum listType {
|
||||
// geometries.
|
||||
//
|
||||
|
||||
// -- *** to be dropped @ next major release: >>>
|
||||
#include "G4GFSManager81.hh"
|
||||
// -- <<<.
|
||||
|
||||
class G4GlobalFastSimulationManager : public G4VStateDependent,
|
||||
public G4VGlobalFastSimulationManager
|
||||
class G4GlobalFastSimulationManager
|
||||
{
|
||||
// -- *** to be dropped @ next major release: >>>
|
||||
friend class G4GFSManager81;
|
||||
// -- <<<.
|
||||
|
||||
public: // With description
|
||||
|
||||
static G4GlobalFastSimulationManager* GetGlobalFastSimulationManager();
|
||||
// Provides a global access to the GlobalFastSimulationManager
|
||||
static G4GlobalFastSimulationManager* GetInstance();
|
||||
// Same as GetGlobalFastSimulationManager()
|
||||
|
||||
G4VFastSimulationModel* GetFastSimulationModel(const G4String& modelName,
|
||||
const G4VFastSimulationModel* previousFound = 0) const;
|
||||
// Fetch G4VFastSimulationModel by name:
|
||||
//
|
||||
// Iterative fetch of G4VFastSimulationModel objects by name:
|
||||
// o returns the G4VFastSimulationModel* of model with name modelName;
|
||||
// o returns 0 if no model found;
|
||||
//
|
||||
// - usage:
|
||||
//
|
||||
// myModel = gblManager->GetFastSimulationModel("MyModel");
|
||||
//
|
||||
// o usage:
|
||||
// myModel = gblManager->GetFastSimulationModel("MyModel");
|
||||
// o note for the case of several models having the same name:
|
||||
// - to get the first "MyModel" model:
|
||||
//
|
||||
// myModel1 = gblManager->GetFastSimulationModel("MyModel", 0);
|
||||
//
|
||||
// - to get the next one:
|
||||
//
|
||||
// myModel2 = gblManager->GetFastSimulationModel("MyModel", myModel1);
|
||||
//
|
||||
// - and so on.
|
||||
//
|
||||
// - When gblManager->GetFastSimulationModel("MyModel", myModel_n)
|
||||
// returns a null pointer, no extra model with name "MyModel" exist.
|
||||
|
||||
@@ -133,8 +116,7 @@ public: // Without description
|
||||
~G4GlobalFastSimulationManager();
|
||||
|
||||
//
|
||||
// G4FastSimulationManager(Process)'s management, no intended for
|
||||
// general use.
|
||||
// G4FastSimulationManager(Process)'s management, no intended for general use.
|
||||
//
|
||||
// Methods for a G4FastSimulationManager to register itself
|
||||
//
|
||||
@@ -143,8 +125,8 @@ public: // Without description
|
||||
//
|
||||
// G4FastSimulationManagerProcess bookeeping:
|
||||
//
|
||||
void AddFSMP(G4FastSimulationManagerProcess81*);
|
||||
void RemoveFSMP(G4FastSimulationManagerProcess81*);
|
||||
void AddFSMP(G4FastSimulationManagerProcess*);
|
||||
void RemoveFSMP(G4FastSimulationManagerProcess*);
|
||||
|
||||
|
||||
// Flag that the Parameterisation must be closed.
|
||||
@@ -158,8 +140,6 @@ public: // With description
|
||||
|
||||
|
||||
public: // Without description
|
||||
void CloseFastSimulation();
|
||||
// deprecated
|
||||
|
||||
void ListEnvelopes(const G4String& aName = "all",
|
||||
listType aListType = NAMES_ONLY);
|
||||
@@ -168,11 +148,7 @@ public: // Without description
|
||||
void ActivateFastSimulationModel(const G4String&);
|
||||
void InActivateFastSimulationModel(const G4String&);
|
||||
|
||||
// G4FastSimulationProcess interface
|
||||
G4VFlavoredParallelWorld* GetFlavoredWorldForThis(G4ParticleDefinition *);
|
||||
|
||||
// G4StateManager interface
|
||||
G4bool Notify(G4ApplicationState requestedState);
|
||||
|
||||
private:
|
||||
// Private construtor insures singleton class
|
||||
@@ -182,20 +158,10 @@ private:
|
||||
void DisplayRegion(G4Region* motherRegion, G4int depth, std::vector<G4ParticleDefinition*>& particles) const;
|
||||
|
||||
// The single instance.
|
||||
static G4GlobalFastSimulationManager* fGlobalFastSimulationManager;
|
||||
|
||||
// The G4FastSimulationMessenger
|
||||
G4FastSimulationMessenger* fTheFastSimulationMessenger;
|
||||
|
||||
// List of G4FastSimulationManagers
|
||||
G4FastSimulationVector <G4FastSimulationManager> ManagedManagers;
|
||||
|
||||
// Instantiated fast simulation processes:
|
||||
G4FastSimulationVector <G4FastSimulationManagerProcess81> fFSMPVector;
|
||||
|
||||
|
||||
// -- *** to be dropped @ next major release: >>>
|
||||
G4GFSManager81* _deprecated;
|
||||
static G4GlobalFastSimulationManager* fGlobalFastSimulationManager;
|
||||
G4FastSimulationMessenger* fTheFastSimulationMessenger;
|
||||
G4FastSimulationVector <G4FastSimulationManager> ManagedManagers;
|
||||
G4FastSimulationVector <G4FastSimulationManagerProcess> fFSMPVector;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4VFastSimulationModel.hh,v 1.7 2006/06/29 21:09:24 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4FastSimulationManager.cc,v 1.12 2006/11/03 17:26:04 mverderi Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// $Id: G4FastSimulationManager.cc,v 1.13 2007/05/11 13:50:20 mverderi Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
//
|
||||
@@ -36,6 +36,8 @@
|
||||
//
|
||||
// History:
|
||||
// Oct 97: Verderi && MoraDeFreitas - First Implementation.
|
||||
// ...
|
||||
// May 07: Move to parallel world scheme
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
|
||||
@@ -155,86 +157,10 @@ G4FastSimulationManager::GetFastSimulationModel(const G4String& modelName,
|
||||
return model;
|
||||
}
|
||||
|
||||
// ***************************************** TO BE DROPPED ********************************************** >>>> BEGINNING
|
||||
|
||||
//----------------------------------------
|
||||
// Methods to add/remove GhostPlacements
|
||||
//----------------------------------------
|
||||
|
||||
G4Transform3D*
|
||||
G4FastSimulationManager::AddGhostPlacement(G4RotationMatrix *prot,
|
||||
const G4ThreeVector &tlate)
|
||||
{
|
||||
G4Transform3D* newghostplace;
|
||||
if(prot==0) prot = new G4RotationMatrix();
|
||||
newghostplace = new G4Transform3D(*prot,tlate);
|
||||
AddGhostPlacement(newghostplace);
|
||||
return newghostplace;
|
||||
}
|
||||
|
||||
G4Transform3D*
|
||||
G4FastSimulationManager::AddGhostPlacement(G4Transform3D *trans3d)
|
||||
{
|
||||
GhostPlacements.push_back (trans3d);
|
||||
G4GlobalFastSimulationManager::GetGlobalFastSimulationManager()->
|
||||
FastSimulationNeedsToBeClosed();
|
||||
return trans3d;
|
||||
}
|
||||
|
||||
G4bool
|
||||
G4FastSimulationManager::RemoveGhostPlacement(const G4Transform3D *trans3d)
|
||||
{
|
||||
G4bool found;
|
||||
if((found=(GhostPlacements.remove(trans3d) != 0)))
|
||||
G4GlobalFastSimulationManager::GetGlobalFastSimulationManager()->
|
||||
FastSimulationNeedsToBeClosed();
|
||||
return found;
|
||||
}
|
||||
|
||||
G4bool
|
||||
G4FastSimulationManager::
|
||||
InsertGhostHereIfNecessary(G4VPhysicalVolume* theClone,
|
||||
const G4ParticleDefinition& theParticle)
|
||||
{
|
||||
G4PVPlacement *GhostPhysical;
|
||||
// Not to do if there aren't glost placements
|
||||
if(GhostPlacements.size()==0) return false;
|
||||
|
||||
// If there are, verifies if at least one model is applicable
|
||||
// for theParticle.
|
||||
for (size_t iModel=0; iModel<ModelList.size(); iModel++)
|
||||
if(ModelList[iModel]->IsApplicable(theParticle)) {
|
||||
// Ok, we find one. Place the ghost(s).
|
||||
for (size_t ighost=0; ighost<GhostPlacements.size(); ighost++)
|
||||
{
|
||||
std::vector<G4LogicalVolume*>::iterator ghostIter = fFastTrack.GetEnvelope()->GetRootLogicalVolumeIterator();
|
||||
G4LogicalVolume* rootGhostLV = (*ghostIter);
|
||||
GhostPhysical=new
|
||||
G4PVPlacement(*(GhostPlacements[ighost]),
|
||||
rootGhostLV->GetName(),
|
||||
rootGhostLV,
|
||||
theClone,
|
||||
false,0);
|
||||
// -- I'd like to check if other root LV exist, since it can not be handled today,
|
||||
// -- but how stop the iterator loop ???
|
||||
// ghostIter++;
|
||||
// rootGhostLV = (*ghostIter);
|
||||
// if (rootGhostLV) G4Exception("G4FastSimulationManager does not know today how to handle ghost regions with several root logical volumes.");
|
||||
}
|
||||
// And answer true
|
||||
return true;
|
||||
}
|
||||
//otherwise answer false
|
||||
return false;
|
||||
}
|
||||
|
||||
// ***************************************** TO BE DROPPED **************************************** <<<< END
|
||||
|
||||
//
|
||||
//-------------------------------------
|
||||
// Interface trigger method for the
|
||||
// G4ParameterisationManagerProcess
|
||||
//-------------------------------------
|
||||
//------------------------------------------------------------------
|
||||
// Interface trigger method for the G4ParameterisationManagerProcess
|
||||
//------------------------------------------------------------------
|
||||
// G4bool GetFastSimulationManagerTrigger(const G4Track &);
|
||||
//
|
||||
// This method is used to interface the G4FastSimulationManagerProcess
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4FastSimulationManagerProcess.cc,v 1.14 2006/11/03 17:26:04 mverderi Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// $Id: G4FastSimulationManagerProcess.cc,v 1.15 2007/05/11 13:50:20 mverderi Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
@@ -38,501 +38,252 @@
|
||||
//
|
||||
// History:
|
||||
// August 97: First implementation. Verderi && MoraDeFreitas.
|
||||
// October 06: move to parallel geometry scheme, M. Verderi
|
||||
//---------------------------------------------------------------
|
||||
|
||||
#include "G4ios.hh"
|
||||
#include "G4FastSimulationManagerProcess.hh"
|
||||
#include "G4GlobalFastSimulationManager.hh"
|
||||
#include "G4TransportationManager.hh"
|
||||
#include "G4PathFinder.hh"
|
||||
#include "G4ParticleChange.hh"
|
||||
|
||||
//----------------------------
|
||||
// Constructor with only name:
|
||||
//----------------------------
|
||||
#define PARANOIA
|
||||
|
||||
G4FastSimulationManagerProcess::
|
||||
G4FastSimulationManagerProcess(const G4String& processName,
|
||||
G4ProcessType theType) :
|
||||
G4VProcess(processName,theType)
|
||||
G4ProcessType theType) :
|
||||
G4VProcess(processName,theType),
|
||||
fWorldVolume(0),
|
||||
fIsTrackingTime(false),
|
||||
fNavigator(0),
|
||||
fNavigatorIndex(-1),
|
||||
fFastSimulationManager(0),
|
||||
fFastSimulationTrigger(false)
|
||||
{
|
||||
pParticleChange = &aDummyParticleChange;
|
||||
|
||||
fGhostTouchable = new G4TouchableHistory();
|
||||
if (verboseLevel>0) {
|
||||
G4cout << GetProcessName() << " is created " << G4endl;
|
||||
}
|
||||
fGhostFieldPropagator = new G4PropagatorInField(&fGhostNavigator,
|
||||
G4TransportationManager::
|
||||
GetTransportationManager()->
|
||||
GetFieldManager());
|
||||
SetWorldVolume(G4TransportationManager::GetTransportationManager()->GetNavigatorForTracking()->GetWorldVolume()->GetName());
|
||||
if (verboseLevel>0) G4cout << "G4FastSimulationManagerProcess `" << GetProcessName()
|
||||
<< "' is created, and will message geometry with world volume `"
|
||||
<< fWorldVolume->GetName() << "'." << G4endl;
|
||||
|
||||
G4GlobalFastSimulationManager::GetGlobalFastSimulationManager()->AddFSMP(this);
|
||||
}
|
||||
|
||||
// -----------
|
||||
// Destructor:
|
||||
// -----------
|
||||
|
||||
G4FastSimulationManagerProcess::
|
||||
G4FastSimulationManagerProcess(const G4String& processName,
|
||||
const G4String& worldVolumeName,
|
||||
G4ProcessType theType) :
|
||||
G4VProcess(processName,theType),
|
||||
fWorldVolume(0),
|
||||
fIsTrackingTime(false),
|
||||
fNavigator(0),
|
||||
fNavigatorIndex(-1),
|
||||
fFastSimulationManager(0),
|
||||
fFastSimulationTrigger(false)
|
||||
{
|
||||
SetWorldVolume(worldVolumeName);
|
||||
if (verboseLevel>0) G4cout << "G4FastSimulationManagerProcess `" << GetProcessName()
|
||||
<< "' is created, and will message geometry with world volume `"
|
||||
<< fWorldVolume->GetName() << "'." << G4endl;
|
||||
|
||||
G4GlobalFastSimulationManager::GetGlobalFastSimulationManager()->AddFSMP(this);
|
||||
}
|
||||
|
||||
|
||||
G4FastSimulationManagerProcess::
|
||||
G4FastSimulationManagerProcess(const G4String& processName,
|
||||
G4VPhysicalVolume* worldVolume,
|
||||
G4ProcessType theType) :
|
||||
G4VProcess(processName,theType),
|
||||
fWorldVolume(0),
|
||||
fIsTrackingTime(false),
|
||||
fNavigator(0),
|
||||
fNavigatorIndex(-1),
|
||||
fFastSimulationManager(0),
|
||||
fFastSimulationTrigger(false)
|
||||
{
|
||||
SetWorldVolume(worldVolume);
|
||||
if (verboseLevel>0) G4cout << "G4FastSimulationManagerProcess `" << GetProcessName()
|
||||
<< "' is created, and will message geometry with world volume `"
|
||||
<< fWorldVolume->GetName() << "'." << G4endl;
|
||||
|
||||
G4GlobalFastSimulationManager::GetGlobalFastSimulationManager()->AddFSMP(this);
|
||||
}
|
||||
|
||||
|
||||
G4FastSimulationManagerProcess::~G4FastSimulationManagerProcess()
|
||||
{
|
||||
delete fGhostTouchable;
|
||||
fGhostTouchable = 0;
|
||||
delete fGhostFieldPropagator;
|
||||
fGhostFieldPropagator = 0;
|
||||
G4GlobalFastSimulationManager::GetGlobalFastSimulationManager()->RemoveFSMP(this);
|
||||
}
|
||||
|
||||
|
||||
//----------------------------------------------------------
|
||||
//
|
||||
// PostStepGetPhysicalInteractionLength()
|
||||
//
|
||||
// This method is used to trigger the parameterised
|
||||
// simulation.
|
||||
//
|
||||
//----------------------------------------------------------
|
||||
//
|
||||
// To be triggered the conditions that must be
|
||||
// fullfilled are :
|
||||
//
|
||||
// 1) a call to track->GetVolume()->GetLogicalVolume()->
|
||||
// GetFastSimulationManager() returns a G4FastSimulationManager
|
||||
// not NULL pointer (kept in fFastSimulationManager);
|
||||
//
|
||||
// AND
|
||||
//
|
||||
// 2)a call to this fFastSimulationManager->GetTrigger() method
|
||||
/// returns a G4bool True.
|
||||
//
|
||||
//
|
||||
// If the fFastSimulationManager* is triggered then:
|
||||
//
|
||||
// * condition = ExclusivelyForced
|
||||
// * returns 0.0
|
||||
//
|
||||
// else:
|
||||
// * condition = NotForced
|
||||
// * returns DBL_MAX
|
||||
//
|
||||
//-----------------------------------------------------------
|
||||
G4double
|
||||
G4FastSimulationManagerProcess::PostStepGetPhysicalInteractionLength(
|
||||
const G4Track& track,
|
||||
G4double previousStepSize,
|
||||
G4ForceCondition* condition)
|
||||
// -----------------------
|
||||
// User access methods:
|
||||
// -----------------------
|
||||
void
|
||||
G4FastSimulationManagerProcess::
|
||||
SetWorldVolume(G4String newWorldName)
|
||||
{
|
||||
// ------------------------------
|
||||
// Prelude for initial Step only:
|
||||
// ------------------------------
|
||||
// ----------------------------------------------------------
|
||||
// -- If starting a track, check if there is a parallel World
|
||||
// -- for the new particle being tracked.
|
||||
// -- (may be Done more than once in very special cases,
|
||||
// -- since the fStarTracking is switched off lower.)
|
||||
// ----------------------------------------------------------
|
||||
if(fStartTracking)
|
||||
{
|
||||
G4VFlavoredParallelWorld* flavoredWorld =
|
||||
G4GlobalFastSimulationManager::GetGlobalFastSimulationManager()->
|
||||
GetFlavoredWorldForThis(track.GetDynamicParticle()->GetDefinition());
|
||||
|
||||
fGhostWorld = 0;
|
||||
if (flavoredWorld)
|
||||
fGhostWorld = flavoredWorld->GetThePhysicalVolumeWorld();
|
||||
|
||||
if (fGhostWorld)
|
||||
{
|
||||
fGhostNavigator.SetWorldVolume(fGhostWorld);
|
||||
fUpdateGhostTouchable = true;
|
||||
fGhostSafety = -1.;
|
||||
// Navigation in Field:
|
||||
fParticleCharge = track.GetDynamicParticle()->GetDefinition()->GetPDGCharge();
|
||||
}
|
||||
else
|
||||
{
|
||||
fOutOfGhostWorld = true;
|
||||
}
|
||||
}
|
||||
if (fGhostWorld == 0) fStartTracking = false; // -- case ghost world below
|
||||
|
||||
// -------------------------------------------------------
|
||||
//
|
||||
// Parameterisation Trigger invokation sequence :
|
||||
//
|
||||
// -------------------------------------------------------
|
||||
fFastSimulationTrigger = false;
|
||||
|
||||
//---------------------------------------------
|
||||
// Normal Dispatcher (for tracking geometry) :
|
||||
//---------------------------------------------
|
||||
if( (fFastSimulationManager =
|
||||
track.GetVolume()->GetLogicalVolume()->GetFastSimulationManager()) )
|
||||
{
|
||||
// Yes, so should us trigger a fast simulation model now ?
|
||||
if(fFastSimulationTrigger =
|
||||
fFastSimulationManager->PostStepGetFastSimulationManagerTrigger(track))
|
||||
{
|
||||
// Yes, lets take the control over the stepping !
|
||||
*condition = ExclusivelyForced;
|
||||
return 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// * Parallel geometry Dispatcher if any.
|
||||
// * If no trigger in the parallel geometry
|
||||
// returns the Conditionally forced signal.
|
||||
//-----------------------------------------
|
||||
if(fGhostWorld)
|
||||
{
|
||||
// First, update the touchable history of ghost if necessary, ie when:
|
||||
// - this is first Step of tracking
|
||||
// - the last Step was limited by ghost geometry
|
||||
// otherwise performs a single Locate
|
||||
if (fUpdateGhostTouchable)
|
||||
{
|
||||
fUpdateGhostTouchable=false;
|
||||
if (fStartTracking)
|
||||
{
|
||||
fGhostNavigator.LocateGlobalPointAndUpdateTouchable(
|
||||
track.GetPosition(),
|
||||
track.GetMomentumDirection(),
|
||||
fGhostTouchable,
|
||||
false);
|
||||
fStartTracking = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
fGhostNavigator.SetGeometricallyLimitedStep();
|
||||
fGhostNavigator.LocateGlobalPointAndUpdateTouchable(
|
||||
track.GetPosition(),
|
||||
track.GetMomentumDirection(),
|
||||
fGhostTouchable);
|
||||
}
|
||||
fOutOfGhostWorld = (fGhostTouchable->GetVolume() == 0);
|
||||
}
|
||||
else if (previousStepSize > 0.0)
|
||||
{
|
||||
// G4ThreeVector direction= track.GetMomentumDirection();
|
||||
// fGhostNavigator.LocateGlobalPointAndSetup(track.GetPosition(), &direction, true);
|
||||
// The above looks not enough in case of mag-field, not clear why ?!?
|
||||
fGhostNavigator.LocateGlobalPointAndUpdateTouchable(
|
||||
track.GetPosition(),
|
||||
track.GetMomentumDirection(),
|
||||
fGhostTouchable);
|
||||
}
|
||||
|
||||
|
||||
if (!fOutOfGhostWorld)
|
||||
{
|
||||
if( (fFastSimulationManager =
|
||||
fGhostTouchable->GetVolume()->GetLogicalVolume()->GetFastSimulationManager()) )
|
||||
{
|
||||
// Yes, so should us trigger a fast simulation model now ?
|
||||
if(fFastSimulationTrigger =
|
||||
fFastSimulationManager->PostStepGetFastSimulationManagerTrigger(track,&fGhostNavigator))
|
||||
{
|
||||
// Yes, lets take the control over the stepping !
|
||||
*condition = ExclusivelyForced;
|
||||
return 0.0;
|
||||
}
|
||||
}
|
||||
// No ghost trigger has occured (ie no manager or a manager but no trigger)
|
||||
// Informs the stepping that PostStepDoIt may be called if the AlongGPIL
|
||||
// will limit the Step.
|
||||
// PostStepDoIt will switch on fUpdateGhostTouchable flag,
|
||||
// and eventually correct position and mometum in case of
|
||||
// mag-field.
|
||||
*condition = Conditionally;
|
||||
return DBL_MAX;
|
||||
}
|
||||
}
|
||||
|
||||
*condition = NotForced;
|
||||
return DBL_MAX;
|
||||
}
|
||||
|
||||
//------------------------------------
|
||||
//
|
||||
// PostStepDoIt()
|
||||
//
|
||||
//------------------------------------
|
||||
G4VParticleChange* G4FastSimulationManagerProcess::PostStepDoIt(
|
||||
const G4Track& track,
|
||||
const G4Step& )
|
||||
{
|
||||
if (fFastSimulationTrigger)
|
||||
{
|
||||
// Executes the ParameterisedSimulation code.
|
||||
// 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->GetTrackStatus() != fStopAndKill)
|
||||
Response->ProposeTrackStatus(fSuspend);
|
||||
// Returns the Response
|
||||
return Response;
|
||||
}
|
||||
if (fIsTrackingTime)
|
||||
G4cout << "!!! G4FastSimulationManagerProcess `" << GetProcessName()
|
||||
<< "': changing world volume at tracking time is not allowed for now. Call ignored !!!" << G4endl;
|
||||
else
|
||||
{
|
||||
if (fOutOfGhostWorld) G4cout << " ????????????? Problem of logic in GHOST param !!! " << G4endl;
|
||||
// No FastSimulationManager has asked for trigger. That means here:
|
||||
// - the PostStep is "Conditionally" forced because
|
||||
// - the Step has been limited by the ALong of G4FSMP because
|
||||
// - the track has reached a ghost boundary
|
||||
// => the touchable history must be updated.
|
||||
// fUpdateGhostTouchable = true; : MOVED BELOW: COMPLICATIONS WITH MAG-FIELD !!
|
||||
|
||||
if (fFieldExertsForce)
|
||||
{
|
||||
// -----------------------------------------------------------
|
||||
// in case of field, correct for small discrepancy on position
|
||||
// and momentum computed by the Transportation.
|
||||
// HOWEVER, this correction can be somewhat problematic when
|
||||
// the end point, which is close here to a Ghost boundary by
|
||||
// construction, is also close to a boundary of the tracking
|
||||
// geometry.
|
||||
// Thus we correct when the safety in the tracking geometry
|
||||
// allows to move the point enough. Otherwise we issue
|
||||
// a warning.
|
||||
// ----------------------------------------------------------
|
||||
fTrackingNavigator.SetWorldVolume(G4TransportationManager::GetTransportationManager()->
|
||||
GetNavigatorForTracking()->GetWorldVolume());
|
||||
fTrackingNavigator.LocateGlobalPointAndUpdateTouchable(
|
||||
track.GetPosition(),
|
||||
track.GetMomentumDirection(),
|
||||
&fTrackingHistory);
|
||||
// G4VPhysicalVolume* trackingVolume = fTrackingHistory.GetVolume();
|
||||
|
||||
G4double trackingSafety(0.0);
|
||||
// G4double trackingLinearDistance =
|
||||
fTrackingNavigator.ComputeStep(
|
||||
track.GetPosition(),
|
||||
track.GetMomentumDirection(),
|
||||
DBL_MAX,
|
||||
trackingSafety);
|
||||
|
||||
xParticleChange.Initialize(track);
|
||||
G4ThreeVector deltaPos = fGhostFieldPropagator->EndPosition() - track.GetPosition();
|
||||
if (trackingSafety < deltaPos.mag())
|
||||
{
|
||||
fUpdateGhostTouchable = true; // What should we do here ?!?
|
||||
// false => lot a microscopic steps
|
||||
// is true rasonnably safe ?
|
||||
G4cout << GetProcessName() << " : WARNING: Can not correct for\ndifference between tracking and ghost mag-field computations." << G4endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
// easy case where we have enough room to displace the point where we need:
|
||||
fUpdateGhostTouchable = true;
|
||||
xParticleChange.ProposePosition (fGhostFieldPropagator->EndPosition() );
|
||||
xParticleChange.ProposeMomentumDirection(fGhostFieldPropagator->EndMomentumDir());
|
||||
}
|
||||
return &xParticleChange;
|
||||
}
|
||||
else
|
||||
{
|
||||
fUpdateGhostTouchable = true;
|
||||
pParticleChange->Initialize(track);
|
||||
return pParticleChange;
|
||||
}
|
||||
G4VPhysicalVolume* newWorld = G4TransportationManager::GetTransportationManager()->IsWorldExisting(newWorldName);
|
||||
G4String tellWhatIsWrong;
|
||||
tellWhatIsWrong = "Volume newWorldName = `"; tellWhatIsWrong += newWorldName; tellWhatIsWrong += "' is not a parallel world nor the mass world volume.";
|
||||
if (newWorld == 0) G4Exception("G4FastSimulationManagerProcess::SetWorldVolume(const G4String&, G4bool verbose)",
|
||||
"InvalidWorld",
|
||||
FatalException,
|
||||
tellWhatIsWrong);
|
||||
if (verboseLevel>0)
|
||||
if (fWorldVolume) G4cout << "G4FastSimulationManagerProcess `" << GetProcessName()
|
||||
<< "': changing world volume from '" << fWorldVolume->GetName()
|
||||
<< "' to `" << newWorld << "'." << G4endl;
|
||||
else G4cout << "G4FastSimulationManagerProcess `" << GetProcessName()
|
||||
<< "': setting world volume from to `"<< newWorld->GetName() << "'." << G4endl;
|
||||
fWorldVolume = newWorld;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
G4double G4FastSimulationManagerProcess::AlongStepGetPhysicalInteractionLength(
|
||||
const G4Track& track,
|
||||
G4double previousStepSize,
|
||||
G4double currentMinimumStep,
|
||||
G4double& proposedSafety,
|
||||
G4GPILSelection* selection
|
||||
)
|
||||
{
|
||||
// Informs the stepping that G4FastsimulationProcess wants
|
||||
// to be able to limit the Step.
|
||||
*selection = CandidateForSelection;
|
||||
|
||||
G4double returnedStep = DBL_MAX;
|
||||
|
||||
if (!fOutOfGhostWorld)
|
||||
{
|
||||
if (previousStepSize > 0.) fGhostSafety -= previousStepSize;
|
||||
else fGhostSafety = -1.;
|
||||
if (fGhostSafety < 0.) fGhostSafety = 0.0;
|
||||
|
||||
// ------------------------------------------
|
||||
// Determination of the proposed STEP LENGTH:
|
||||
// ------------------------------------------
|
||||
if (currentMinimumStep <= fGhostSafety)
|
||||
{
|
||||
returnedStep = currentMinimumStep;
|
||||
}
|
||||
else // (currentMinimumStep > fGhostSafety: GFSMP may limit the Step)
|
||||
{
|
||||
fFieldExertsForce = (fParticleCharge != 0.0) &&
|
||||
(G4TransportationManager::GetTransportationManager()->
|
||||
GetFieldManager()->DoesFieldExist());
|
||||
if ( !fFieldExertsForce )
|
||||
{
|
||||
fGhostStepLength = fGhostNavigator.ComputeStep(
|
||||
track.GetPosition(),
|
||||
track.GetMomentumDirection(),
|
||||
currentMinimumStep,
|
||||
fGhostSafety);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
fGhostFieldPropagator->SetChargeMomentumMass(
|
||||
fParticleCharge,
|
||||
track.GetDynamicParticle()->
|
||||
GetTotalMomentum(),
|
||||
track.GetDynamicParticle()->
|
||||
GetMass());
|
||||
|
||||
G4double restMass= track.GetDynamicParticle()->GetMass();
|
||||
G4ThreeVector spin = track.GetPolarization() ;
|
||||
G4FieldTrack aFieldTrack =
|
||||
G4FieldTrack( track.GetPosition(),
|
||||
track.GetMomentumDirection(),
|
||||
0.0,
|
||||
track.GetKineticEnergy(),
|
||||
restMass,
|
||||
track.GetVelocity(),
|
||||
track.GetLocalTime(), // tof lab ?
|
||||
track.GetProperTime(), // tof proper
|
||||
&spin ) ;
|
||||
|
||||
fGhostStepLength = fGhostFieldPropagator->ComputeStep(
|
||||
aFieldTrack,
|
||||
currentMinimumStep,
|
||||
fGhostSafety);
|
||||
}
|
||||
fPreSafety = fGhostSafety;
|
||||
returnedStep = fGhostStepLength;
|
||||
}
|
||||
|
||||
// ----------------------------------------------
|
||||
// Returns the fGhostSafety as the proposedSafety
|
||||
// The SteppingManager will take care of keeping
|
||||
// the smallest one.
|
||||
// ----------------------------------------------
|
||||
proposedSafety = fGhostSafety;
|
||||
}
|
||||
return returnedStep;
|
||||
}
|
||||
|
||||
G4VParticleChange* G4FastSimulationManagerProcess::AlongStepDoIt(
|
||||
const G4Track& track,
|
||||
const G4Step& )
|
||||
{
|
||||
// Dummy ParticleChange ie: does nothing
|
||||
pParticleChange->Initialize(track);
|
||||
return pParticleChange;
|
||||
}
|
||||
|
||||
//--------------------------------------------
|
||||
//
|
||||
// At Rest parameterisation:
|
||||
//
|
||||
//--------------------------------------------
|
||||
//
|
||||
// AtRestGetPhysiscalInteractionLength:
|
||||
//
|
||||
//--------------------------------------------
|
||||
G4double
|
||||
G4FastSimulationManagerProcess::AtRestGetPhysicalInteractionLength(
|
||||
const G4Track& track,
|
||||
G4ForceCondition* condition)
|
||||
{
|
||||
if ( (fFastSimulationManager =
|
||||
track.GetVolume()->GetLogicalVolume()->GetFastSimulationManager())
|
||||
!= 0 )
|
||||
if (fFastSimulationManager->AtRestGetFastSimulationManagerTrigger(track))
|
||||
{
|
||||
// "*condition = ExclusivelyForced;" Not yet available
|
||||
// for AtRest actions, so we use the trick below. However
|
||||
// it is not garantee to work in the situation the track is
|
||||
// alive after parameterisation.
|
||||
// NOTE: Problem: the present stepping doesn't care if the particle
|
||||
// has been killed between two AtRestDoIt() !!!
|
||||
*condition = NotForced;
|
||||
return -1.0; // TEMPORARY TRICK TO TAKE CONTROL !!!!
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// * Parallel geometry Dispatcher if any.
|
||||
// * If no trigger in the parallel geometry
|
||||
// * returns DBL_MAX and NotForced signal.
|
||||
//-----------------------------------------
|
||||
if(fGhostWorld)
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
G4FastSimulationManagerProcess::
|
||||
SetWorldVolume(G4VPhysicalVolume* newWorld)
|
||||
{
|
||||
if (newWorld) SetWorldVolume(newWorld->GetName());
|
||||
else G4cout << "!!! G4FastSimulationManagerProcess::SetWorldVolume(const G4VPhysicalVolume* newWorld) : null pointer passed. !!! Continuing at your own risks..." << G4endl;
|
||||
}
|
||||
|
||||
|
||||
// --------------------
|
||||
// Start/End tracking:
|
||||
// --------------------
|
||||
void
|
||||
G4FastSimulationManagerProcess::
|
||||
StartTracking(G4Track*)
|
||||
{
|
||||
fIsTrackingTime = true;
|
||||
fIsFirstStep = true;
|
||||
|
||||
// -- fetch the navigator (and its index) and activate it:
|
||||
G4TransportationManager* transportationManager = G4TransportationManager::GetTransportationManager();
|
||||
fNavigator = transportationManager->GetNavigator(fWorldVolume);
|
||||
if (fNavigator != transportationManager->GetNavigatorForTracking())
|
||||
fNavigatorIndex = transportationManager->ActivateNavigator(fNavigator);
|
||||
else
|
||||
fNavigatorIndex = 0;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
G4FastSimulationManagerProcess::
|
||||
EndTracking()
|
||||
{
|
||||
fIsTrackingTime = false;
|
||||
}
|
||||
|
||||
|
||||
// ------------------------------------------
|
||||
// PostStepGetPhysicalInteractionLength():
|
||||
// ------------------------------------------
|
||||
G4double
|
||||
G4FastSimulationManagerProcess::
|
||||
PostStepGetPhysicalInteractionLength(const G4Track& track,
|
||||
G4double,
|
||||
G4ForceCondition* condition)
|
||||
{
|
||||
#ifdef PARANOIA
|
||||
if ( fNavigator->GetWorldVolume() != fWorldVolume ) G4Exception("!!! ??? INCONSISTENT NAVIGATORS/WORLD VOLUMES ??? !!!");
|
||||
#endif
|
||||
// -- Get current volume, and check for presence of fast simulation manager.
|
||||
// -- For the case of the navigator for tracking (fNavigatorIndex == 0)
|
||||
// -- we use the track volume. This allows the code to be valid for both
|
||||
// -- cases where the PathFinder is used (G4CoupledTranportation) or not
|
||||
// -- (G4Transportation).
|
||||
const G4VPhysicalVolume* currentVolume(0);
|
||||
if (fNavigatorIndex == 0) currentVolume = track.GetVolume();
|
||||
else currentVolume = G4PathFinder::GetInstance()->GetLocatedVolume(fNavigatorIndex);
|
||||
if ( currentVolume )
|
||||
{
|
||||
// First, update the touchable history of ghost if necessary, ie when:
|
||||
// - this is first Step of tracking
|
||||
// - the last Step was limited by ghost geometry
|
||||
// otherwise performs a single Locate
|
||||
if (fUpdateGhostTouchable)
|
||||
fFastSimulationManager = currentVolume->GetLogicalVolume()->GetFastSimulationManager();
|
||||
if( fFastSimulationManager )
|
||||
{
|
||||
fUpdateGhostTouchable=false;
|
||||
if (fStartTracking)
|
||||
// Ask for trigger:
|
||||
fFastSimulationTrigger = fFastSimulationManager->PostStepGetFastSimulationManagerTrigger(track, fNavigator);
|
||||
if( fFastSimulationTrigger )
|
||||
{
|
||||
fGhostNavigator.LocateGlobalPointAndUpdateTouchable(
|
||||
track.GetPosition(),
|
||||
fGhostTouchable,
|
||||
false);
|
||||
fStartTracking = false;
|
||||
// Take control over stepping:
|
||||
*condition = ExclusivelyForced;
|
||||
return 0.0;
|
||||
}
|
||||
else
|
||||
{
|
||||
fGhostNavigator.SetGeometricallyLimitedStep();
|
||||
fGhostNavigator.LocateGlobalPointAndUpdateTouchable(
|
||||
track.GetPosition(),
|
||||
fGhostTouchable);
|
||||
|
||||
}
|
||||
fOutOfGhostWorld = (fGhostTouchable->GetVolume() == 0);
|
||||
}
|
||||
|
||||
if (!fOutOfGhostWorld)
|
||||
{
|
||||
if( (fFastSimulationManager =
|
||||
fGhostTouchable->GetVolume()->GetLogicalVolume()->GetFastSimulationManager()) )
|
||||
{
|
||||
// Should it trigger a fast simulation model now ?
|
||||
if(fFastSimulationTrigger =
|
||||
fFastSimulationManager->
|
||||
AtRestGetFastSimulationManagerTrigger(track,&fGhostNavigator))
|
||||
{
|
||||
// "*condition = ExclusivelyForced;" Not yet available
|
||||
// for AtRest actions, so we use the trick below. However
|
||||
// it is not garantee to work in the situation the track is
|
||||
// alive after parameterisation.
|
||||
// NOTE: Problem: the present stepping doesn't care if the particle
|
||||
// has been killed between two AtRestDoIt() !!!
|
||||
*condition = NotForced;
|
||||
return -1.0; // TEMPORARY TRICK TO TAKE CONTROL !!!!
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// No, avoid to take control over the PostStepDoIt methods.
|
||||
|
||||
// -- no fast simulation occuring there:
|
||||
*condition = NotForced;
|
||||
return DBL_MAX;
|
||||
}
|
||||
|
||||
//------------------------------------
|
||||
// PostStepDoIt()
|
||||
//------------------------------------
|
||||
G4VParticleChange*
|
||||
G4FastSimulationManagerProcess::
|
||||
PostStepDoIt(const G4Track&,
|
||||
const G4Step&)
|
||||
{
|
||||
G4VParticleChange* finalState = fFastSimulationManager->InvokePostStepDoIt();
|
||||
|
||||
// If the particle is still alive, suspend it to force physics re-initialisation:
|
||||
if (finalState->GetTrackStatus() != fStopAndKill) finalState->ProposeTrackStatus(fSuspend);
|
||||
|
||||
return finalState;
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------
|
||||
// At Rest parameterisation:
|
||||
//--------------------------------------------
|
||||
// AtRestGetPhysiscalInteractionLength:
|
||||
//--------------------------------------------
|
||||
G4double
|
||||
G4FastSimulationManagerProcess::
|
||||
AtRestGetPhysicalInteractionLength(const G4Track& track,
|
||||
G4ForceCondition* condition)
|
||||
{
|
||||
const G4VPhysicalVolume* currentVolume(0);
|
||||
if (fNavigatorIndex == 0) currentVolume = track.GetVolume();
|
||||
else currentVolume = G4PathFinder::GetInstance()->GetLocatedVolume(fNavigatorIndex);
|
||||
fFastSimulationManager = currentVolume->GetLogicalVolume()->GetFastSimulationManager();
|
||||
if( fFastSimulationManager )
|
||||
{
|
||||
// Ask for trigger:
|
||||
fFastSimulationTrigger = fFastSimulationManager->AtRestGetFastSimulationManagerTrigger(track, fNavigator);
|
||||
if( fFastSimulationTrigger )
|
||||
{
|
||||
// Dirty trick to take control over stepping. Does anyone will ever use that ?
|
||||
*condition = NotForced;
|
||||
return -1.0;
|
||||
}
|
||||
}
|
||||
|
||||
// -- no fast simulation occuring there:
|
||||
*condition = NotForced;
|
||||
return DBL_MAX;
|
||||
|
||||
}
|
||||
|
||||
//-----------------------------------------------
|
||||
//
|
||||
// AtRestDoIt:
|
||||
//
|
||||
//-----------------------------------------------
|
||||
G4VParticleChange* G4FastSimulationManagerProcess::AtRestDoIt(
|
||||
const G4Track&, const G4Step&)
|
||||
G4VParticleChange* G4FastSimulationManagerProcess::AtRestDoIt(const G4Track&, const G4Step&)
|
||||
{
|
||||
return fFastSimulationManager->InvokeAtRestDoIt();
|
||||
}
|
||||
|
||||
void G4FastSimulationManagerProcess::StartTracking(G4Track*)
|
||||
{
|
||||
fStartTracking = true;
|
||||
}
|
||||
|
||||
void G4FastSimulationManagerProcess::Verbose() const
|
||||
{
|
||||
@@ -559,3 +310,5 @@ void G4FastSimulationManagerProcess::Verbose() const
|
||||
break;
|
||||
}*/
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,314 +0,0 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * 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. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4FastSimulationManagerProcess81.cc,v 1.1 2006/11/10 13:23:07 mverderi Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
//
|
||||
// G4FastSimulationProcess.cc
|
||||
//
|
||||
// Description:
|
||||
// The process that triggers the parameterised simulations,
|
||||
// if any.
|
||||
//
|
||||
// History:
|
||||
// August 97: First implementation. Verderi && MoraDeFreitas.
|
||||
// October 06: move to parallel geometry scheme, M. Verderi
|
||||
//---------------------------------------------------------------
|
||||
|
||||
#include "G4ios.hh"
|
||||
#include "G4FastSimulationManagerProcess81.hh"
|
||||
#include "G4GlobalFastSimulationManager.hh"
|
||||
#include "G4TransportationManager.hh"
|
||||
#include "G4PathFinder.hh"
|
||||
#include "G4ParticleChange.hh"
|
||||
|
||||
#define PARANOIA
|
||||
|
||||
G4FastSimulationManagerProcess81::
|
||||
G4FastSimulationManagerProcess81(const G4String& processName,
|
||||
G4ProcessType theType) :
|
||||
G4VProcess(processName,theType),
|
||||
fWorldVolume(0),
|
||||
fIsTrackingTime(false),
|
||||
fNavigator(0),
|
||||
fNavigatorIndex(-1),
|
||||
fFastSimulationManager(0),
|
||||
fFastSimulationTrigger(false)
|
||||
{
|
||||
SetWorldVolume(G4TransportationManager::GetTransportationManager()->GetNavigatorForTracking()->GetWorldVolume()->GetName());
|
||||
if (verboseLevel>0) G4cout << "G4FastSimulationManagerProcess81 `" << GetProcessName()
|
||||
<< "' is created, and will message geometry with world volume `"
|
||||
<< fWorldVolume->GetName() << "'." << G4endl;
|
||||
|
||||
G4GlobalFastSimulationManager::GetGlobalFastSimulationManager()->AddFSMP(this);
|
||||
}
|
||||
|
||||
|
||||
G4FastSimulationManagerProcess81::
|
||||
G4FastSimulationManagerProcess81(const G4String& processName,
|
||||
const G4String& worldVolumeName,
|
||||
G4ProcessType theType) :
|
||||
G4VProcess(processName,theType),
|
||||
fWorldVolume(0),
|
||||
fIsTrackingTime(false),
|
||||
fNavigator(0),
|
||||
fNavigatorIndex(-1),
|
||||
fFastSimulationManager(0),
|
||||
fFastSimulationTrigger(false)
|
||||
{
|
||||
SetWorldVolume(worldVolumeName);
|
||||
if (verboseLevel>0) G4cout << "G4FastSimulationManagerProcess81 `" << GetProcessName()
|
||||
<< "' is created, and will message geometry with world volume `"
|
||||
<< fWorldVolume->GetName() << "'." << G4endl;
|
||||
|
||||
G4GlobalFastSimulationManager::GetGlobalFastSimulationManager()->AddFSMP(this);
|
||||
}
|
||||
|
||||
|
||||
G4FastSimulationManagerProcess81::
|
||||
G4FastSimulationManagerProcess81(const G4String& processName,
|
||||
G4VPhysicalVolume* worldVolume,
|
||||
G4ProcessType theType) :
|
||||
G4VProcess(processName,theType),
|
||||
fWorldVolume(0),
|
||||
fIsTrackingTime(false),
|
||||
fNavigator(0),
|
||||
fNavigatorIndex(-1),
|
||||
fFastSimulationManager(0),
|
||||
fFastSimulationTrigger(false)
|
||||
{
|
||||
SetWorldVolume(worldVolume);
|
||||
if (verboseLevel>0) G4cout << "G4FastSimulationManagerProcess81 `" << GetProcessName()
|
||||
<< "' is created, and will message geometry with world volume `"
|
||||
<< fWorldVolume->GetName() << "'." << G4endl;
|
||||
|
||||
G4GlobalFastSimulationManager::GetGlobalFastSimulationManager()->AddFSMP(this);
|
||||
}
|
||||
|
||||
|
||||
G4FastSimulationManagerProcess81::~G4FastSimulationManagerProcess81()
|
||||
{
|
||||
G4GlobalFastSimulationManager::GetGlobalFastSimulationManager()->RemoveFSMP(this);
|
||||
}
|
||||
|
||||
|
||||
// -----------------------
|
||||
// User access methods:
|
||||
// -----------------------
|
||||
void
|
||||
G4FastSimulationManagerProcess81::
|
||||
SetWorldVolume(G4String newWorldName)
|
||||
{
|
||||
if (fIsTrackingTime)
|
||||
G4cout << "!!! G4FastSimulationManagerProcess81 `" << GetProcessName()
|
||||
<< "': changing world volume at tracking time is not allowed for now. Call ignored !!!" << G4endl;
|
||||
else
|
||||
{
|
||||
G4VPhysicalVolume* newWorld = G4TransportationManager::GetTransportationManager()->IsWorldExisting(newWorldName);
|
||||
G4String tellWhatIsWrong;
|
||||
tellWhatIsWrong = "Volume newWorldName = `"; tellWhatIsWrong += newWorldName; tellWhatIsWrong += "' is not a parallel world nor the mass world volume.";
|
||||
if (newWorld == 0) G4Exception("G4FastSimulationManagerProcess81::SetWorldVolume(const G4String&, G4bool verbose)",
|
||||
"InvalidWorld",
|
||||
FatalException,
|
||||
tellWhatIsWrong);
|
||||
if (verboseLevel>0)
|
||||
if (fWorldVolume) G4cout << "G4FastSimulationManagerProcess81 `" << GetProcessName()
|
||||
<< "': changing world volume from '" << fWorldVolume->GetName()
|
||||
<< "' to `" << newWorld << "'." << G4endl;
|
||||
else G4cout << "G4FastSimulationManagerProcess81 `" << GetProcessName()
|
||||
<< "': setting world volume from to `"<< newWorld->GetName() << "'." << G4endl;
|
||||
fWorldVolume = newWorld;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
G4FastSimulationManagerProcess81::
|
||||
SetWorldVolume(G4VPhysicalVolume* newWorld)
|
||||
{
|
||||
if (newWorld) SetWorldVolume(newWorld->GetName());
|
||||
else G4cout << "!!! G4FastSimulationManagerProcess81::SetWorldVolume(const G4VPhysicalVolume* newWorld) : null pointer passed. !!! Continuing at your own risks..." << G4endl;
|
||||
}
|
||||
|
||||
|
||||
// --------------------
|
||||
// Start/End tracking:
|
||||
// --------------------
|
||||
void
|
||||
G4FastSimulationManagerProcess81::
|
||||
StartTracking(G4Track*)
|
||||
{
|
||||
fIsTrackingTime = true;
|
||||
fIsFirstStep = true;
|
||||
|
||||
// -- fetch the navigator (and its index) and activate it:
|
||||
G4TransportationManager* transportationManager = G4TransportationManager::GetTransportationManager();
|
||||
fNavigator = transportationManager->GetNavigator(fWorldVolume);
|
||||
if (fNavigator != transportationManager->GetNavigatorForTracking())
|
||||
fNavigatorIndex = transportationManager->ActivateNavigator(fNavigator);
|
||||
else
|
||||
fNavigatorIndex = 0;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
G4FastSimulationManagerProcess81::
|
||||
EndTracking()
|
||||
{
|
||||
fIsTrackingTime = false;
|
||||
}
|
||||
|
||||
|
||||
// ------------------------------------------
|
||||
// PostStepGetPhysicalInteractionLength():
|
||||
// ------------------------------------------
|
||||
G4double
|
||||
G4FastSimulationManagerProcess81::
|
||||
PostStepGetPhysicalInteractionLength(const G4Track& track,
|
||||
G4double,
|
||||
G4ForceCondition* condition)
|
||||
{
|
||||
#ifdef PARANOIA
|
||||
if ( fNavigator->GetWorldVolume() != fWorldVolume ) G4Exception("!!! ??? INCONSISTENT NAVIGATORS/WORLD VOLUMES ??? !!!");
|
||||
#endif
|
||||
// -- Get current volume, and check for presence of fast simulation manager.
|
||||
// -- For the case of the navigator for tracking (fNavigatorIndex == 0)
|
||||
// -- we use the track volume. This allows the code to be valid for both
|
||||
// -- cases where the PathFinder is used (G4CoupledTranportation) or not
|
||||
// -- (G4Transportation).
|
||||
const G4VPhysicalVolume* currentVolume(0);
|
||||
if (fNavigatorIndex == 0) currentVolume = track.GetVolume();
|
||||
else currentVolume = G4PathFinder::GetInstance()->GetLocatedVolume(fNavigatorIndex);
|
||||
if ( currentVolume )
|
||||
{
|
||||
fFastSimulationManager = currentVolume->GetLogicalVolume()->GetFastSimulationManager();
|
||||
if( fFastSimulationManager )
|
||||
{
|
||||
// Ask for trigger:
|
||||
fFastSimulationTrigger = fFastSimulationManager->PostStepGetFastSimulationManagerTrigger(track, fNavigator);
|
||||
if( fFastSimulationTrigger )
|
||||
{
|
||||
// Take control over stepping:
|
||||
*condition = ExclusivelyForced;
|
||||
return 0.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// -- no fast simulation occuring there:
|
||||
*condition = NotForced;
|
||||
return DBL_MAX;
|
||||
}
|
||||
|
||||
//------------------------------------
|
||||
// PostStepDoIt()
|
||||
//------------------------------------
|
||||
G4VParticleChange*
|
||||
G4FastSimulationManagerProcess81::
|
||||
PostStepDoIt(const G4Track&,
|
||||
const G4Step&)
|
||||
{
|
||||
G4VParticleChange* finalState = fFastSimulationManager->InvokePostStepDoIt();
|
||||
|
||||
// If the particle is still alive, suspend it to force physics re-initialisation:
|
||||
if (finalState->GetTrackStatus() != fStopAndKill) finalState->ProposeTrackStatus(fSuspend);
|
||||
|
||||
return finalState;
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------
|
||||
// At Rest parameterisation:
|
||||
//--------------------------------------------
|
||||
// AtRestGetPhysiscalInteractionLength:
|
||||
//--------------------------------------------
|
||||
G4double
|
||||
G4FastSimulationManagerProcess81::
|
||||
AtRestGetPhysicalInteractionLength(const G4Track& track,
|
||||
G4ForceCondition* condition)
|
||||
{
|
||||
const G4VPhysicalVolume* currentVolume(0);
|
||||
if (fNavigatorIndex == 0) currentVolume = track.GetVolume();
|
||||
else currentVolume = G4PathFinder::GetInstance()->GetLocatedVolume(fNavigatorIndex);
|
||||
fFastSimulationManager = currentVolume->GetLogicalVolume()->GetFastSimulationManager();
|
||||
if( fFastSimulationManager )
|
||||
{
|
||||
// Ask for trigger:
|
||||
fFastSimulationTrigger = fFastSimulationManager->AtRestGetFastSimulationManagerTrigger(track, fNavigator);
|
||||
if( fFastSimulationTrigger )
|
||||
{
|
||||
// Dirty trick to take control over stepping. Does anyone will ever use that ?
|
||||
*condition = NotForced;
|
||||
return -1.0;
|
||||
}
|
||||
}
|
||||
|
||||
// -- no fast simulation occuring there:
|
||||
*condition = NotForced;
|
||||
return DBL_MAX;
|
||||
|
||||
}
|
||||
|
||||
//-----------------------------------------------
|
||||
// AtRestDoIt:
|
||||
//-----------------------------------------------
|
||||
G4VParticleChange* G4FastSimulationManagerProcess81::AtRestDoIt(const G4Track&, const G4Step&)
|
||||
{
|
||||
return fFastSimulationManager->InvokeAtRestDoIt();
|
||||
}
|
||||
|
||||
|
||||
void G4FastSimulationManagerProcess81::Verbose() const
|
||||
{
|
||||
/* G4cout << " >>>>> Trigger Status : ";
|
||||
switch(fFastSimulationManager->GetTriggerStatus())
|
||||
{
|
||||
case NoModel:
|
||||
G4cout << "NoModel" << G4endl;
|
||||
break;
|
||||
case OnBoundaryButLeaving:
|
||||
G4cout << "OnBoundaryButLeaving" << G4endl;
|
||||
break;
|
||||
case OneModelTrigger:
|
||||
G4cout << "OneModelTrigger" << G4endl;
|
||||
break;
|
||||
case NoModelTrigger:
|
||||
G4cout << "NoModelTrigger" << G4endl;
|
||||
break;
|
||||
case Undefined:
|
||||
G4cout << "Undefined" << G4endl;
|
||||
break;
|
||||
default:
|
||||
G4cout << " Bizarre..." << G4endl;
|
||||
break;
|
||||
}*/
|
||||
}
|
||||
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4FastSimulationMessenger.cc,v 1.7 2006/11/03 17:26:04 mverderi Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// $Id: G4FastSimulationMessenger.cc,v 1.8 2007/05/11 13:50:20 mverderi Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
|
||||
#include "G4FastSimulationMessenger.hh"
|
||||
@@ -44,8 +44,13 @@ G4FastSimulationMessenger(G4GlobalFastSimulationManager* theGFSM)
|
||||
|
||||
fShowSetupCmd =
|
||||
new G4UIcmdWithoutParameter("/param/showSetup", this);
|
||||
fShowSetupCmd->SetGuidance("Show fast simulation setup");
|
||||
fShowSetupCmd->AvailableForStates(G4State_GeomClosed);
|
||||
fShowSetupCmd->SetGuidance("Show fast simulation setup:");
|
||||
fShowSetupCmd->SetGuidance(" - for each world region:");
|
||||
fShowSetupCmd->SetGuidance(" 1) fast simulation manager process attached;");
|
||||
fShowSetupCmd->SetGuidance(" - and to which particles the process is attached to;");
|
||||
fShowSetupCmd->SetGuidance(" 2) region hierarchy;");
|
||||
fShowSetupCmd->SetGuidance(" - with for each the fast simulation models attached;");
|
||||
fShowSetupCmd->AvailableForStates(G4State_Idle, G4State_GeomClosed);
|
||||
|
||||
fListEnvelopesCmd =
|
||||
new G4UIcmdWithAString("/param/listEnvelopes", this);
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4FastStep.cc,v 1.16 2006/06/29 21:09:32 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
//
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4FastTrack.cc,v 1.10 2006/06/29 21:09:34 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
//
|
||||
|
||||
@@ -1,167 +0,0 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * 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. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4GFSManager81.cc,v 1.1 2006/11/10 13:23:07 mverderi Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
//
|
||||
// G4GFSManager81.cc
|
||||
//
|
||||
// Description:
|
||||
// Gathers code to be dropped at the next major release
|
||||
//
|
||||
// History:
|
||||
// November 2006
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
|
||||
#include "G4GFSManager81.hh"
|
||||
#include "G4ParticleTable.hh"
|
||||
#include "G4ParticleDefinition.hh"
|
||||
#include "G4Material.hh"
|
||||
#include "G4ThreeVector.hh"
|
||||
#include "G4PVPlacement.hh"
|
||||
#include "G4TransportationManager.hh"
|
||||
#include "G4FastSimulationMessenger.hh"
|
||||
|
||||
#include "G4GlobalFastSimulationManager.hh"
|
||||
|
||||
G4GFSManager81::G4GFSManager81()
|
||||
{
|
||||
// It starts closed.
|
||||
fClosed=true;
|
||||
}
|
||||
|
||||
void G4GFSManager81::FastSimulationNeedsToBeClosed()
|
||||
{
|
||||
fClosed=false;
|
||||
}
|
||||
|
||||
void G4GFSManager81::CloseFastSimulation()
|
||||
{
|
||||
if(fClosed) return;
|
||||
|
||||
G4ParticleTable* theParticleTable;
|
||||
|
||||
// Reset the NeededFlavoredWorlds List
|
||||
NeededFlavoredWorlds.clearAndDestroy();
|
||||
|
||||
// We'll look for models for all particle types
|
||||
theParticleTable=G4ParticleTable::GetParticleTable();
|
||||
|
||||
// Creates the first world volume clone.
|
||||
G4VPhysicalVolume* aClone = GiveMeAWorldVolumeClone();
|
||||
|
||||
G4cout << "Closing Fast-Simulation ..." << G4endl;
|
||||
|
||||
for (G4int iParticle=0;
|
||||
iParticle<theParticleTable->entries(); iParticle++) {
|
||||
G4bool Needed = false;
|
||||
G4GlobalFastSimulationManager* global = G4GlobalFastSimulationManager::GetGlobalFastSimulationManager();
|
||||
for (size_t ifsm=0; ifsm< global->ManagedManagers.size(); ifsm++)
|
||||
Needed = Needed || global->ManagedManagers[ifsm]->
|
||||
InsertGhostHereIfNecessary(aClone,
|
||||
*(theParticleTable->
|
||||
GetParticle(iParticle)));
|
||||
// if some FSM inserted a ghost, keep this clone.
|
||||
if(Needed)
|
||||
{
|
||||
G4Region* aWorldGhostRegion = new G4Region("Ghost world region for " + theParticleTable->GetParticle(iParticle)->GetParticleName());
|
||||
aWorldGhostRegion->AddRootLogicalVolume(aClone->GetLogicalVolume());
|
||||
NeededFlavoredWorlds.push_back(new G4FlavoredParallelWorld(theParticleTable->GetParticle(iParticle), aClone));
|
||||
// and prepare a new one.
|
||||
aClone=GiveMeAWorldVolumeClone();
|
||||
}
|
||||
}
|
||||
|
||||
fClosed=true;
|
||||
}
|
||||
|
||||
G4VFlavoredParallelWorld*
|
||||
G4GFSManager81::
|
||||
GetFlavoredWorldForThis(G4ParticleDefinition* particle)
|
||||
{
|
||||
for (size_t ipw=0; ipw<NeededFlavoredWorlds.size(); ipw++)
|
||||
if(NeededFlavoredWorlds[ipw]->GetTheParticleType()==particle)
|
||||
return NeededFlavoredWorlds[ipw];
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
G4VPhysicalVolume*
|
||||
G4GFSManager81::GiveMeAWorldVolumeClone()
|
||||
{
|
||||
G4VPhysicalVolume* theParallelWorldPhysical;
|
||||
|
||||
G4TransportationManager *transportationManager=
|
||||
G4TransportationManager::GetTransportationManager();
|
||||
|
||||
G4VSolid *parallelWorldSolid=transportationManager->
|
||||
GetNavigatorForTracking()->GetWorldVolume()->
|
||||
GetLogicalVolume()->GetSolid();
|
||||
|
||||
G4Material *parallelWorldMaterial=transportationManager->
|
||||
GetNavigatorForTracking()->GetWorldVolume()->
|
||||
GetLogicalVolume()->GetMaterial();
|
||||
|
||||
G4LogicalVolume *parallelWorldLog =
|
||||
new G4LogicalVolume(parallelWorldSolid,
|
||||
parallelWorldMaterial,
|
||||
"ParallelWorldLogical",
|
||||
0, 0, 0);
|
||||
|
||||
theParallelWorldPhysical= new G4PVPlacement(0,G4ThreeVector(),
|
||||
"ParallelWorldPhysical",
|
||||
parallelWorldLog,
|
||||
0,false,0);
|
||||
|
||||
return theParallelWorldPhysical;
|
||||
}
|
||||
|
||||
|
||||
G4bool
|
||||
G4GFSManager81::Notify(G4ApplicationState requestedState)
|
||||
{
|
||||
G4StateManager * stateManager = G4StateManager::GetStateManager();
|
||||
if((stateManager->GetPreviousState()==G4State_Idle) &&
|
||||
(requestedState==G4State_GeomClosed) && (!fClosed) )
|
||||
{
|
||||
G4cerr
|
||||
<< "ERROR - G4GFSManager81::Notify()" << G4endl
|
||||
<< " 1) you are using ghost volumes;" << G4endl
|
||||
<< " 2) In this case the G4GFSManager81" << G4endl
|
||||
<< " MUST be closed BEFORE closing the geometry;" << G4endl
|
||||
<< " 3) To do this put in your code the call to" << G4endl
|
||||
<< " GetGlobalFastSimulationManager()->CloseFastSimulation();"
|
||||
<< G4endl
|
||||
<< " just before closing the geometry." << G4endl;
|
||||
G4Exception("G4GFSManager81::Notify()", "InvalidState",
|
||||
FatalException, "Fast simulation must be closed.");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4GlobalFastSimulationManager.cc,v 1.19 2006/11/10 15:27:17 mverderi Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// $Id: G4GlobalFastSimulationManager.cc,v 1.20 2007/05/11 13:50:20 mverderi Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
@@ -43,6 +43,7 @@
|
||||
// G4FlavoredParallelWorld pointer.
|
||||
// Feb 98: Verderi && MoraDeFreitas - First Implementation.
|
||||
// March 98: correction to instanciate dynamically the manager
|
||||
// May 07: Move to parallel world scheme
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
|
||||
@@ -59,47 +60,49 @@
|
||||
#include "G4ProcessManager.hh"
|
||||
#include "G4PhysicalVolumeStore.hh"
|
||||
|
||||
// -- *** to be dropped @ next major release: >>>>
|
||||
#include "G4GFSManager81.hh"
|
||||
// -- <<<<<<<<
|
||||
|
||||
G4GlobalFastSimulationManager*
|
||||
G4GlobalFastSimulationManager::fGlobalFastSimulationManager = 0;
|
||||
// ------------------------------------------
|
||||
// -- static instance pointer initialisation:
|
||||
// ------------------------------------------
|
||||
G4GlobalFastSimulationManager* G4GlobalFastSimulationManager::fGlobalFastSimulationManager = 0;
|
||||
|
||||
|
||||
G4GlobalFastSimulationManager*
|
||||
G4GlobalFastSimulationManager::GetGlobalFastSimulationManager()
|
||||
// --------------------------------------------------
|
||||
// -- static methods to retrieve the manager pointer:
|
||||
// --------------------------------------------------
|
||||
G4GlobalFastSimulationManager* G4GlobalFastSimulationManager::GetGlobalFastSimulationManager()
|
||||
{
|
||||
if(!fGlobalFastSimulationManager)
|
||||
{
|
||||
fGlobalFastSimulationManager = new G4GlobalFastSimulationManager;
|
||||
SetConcreteInstance(fGlobalFastSimulationManager);
|
||||
|
||||
}
|
||||
|
||||
return fGlobalFastSimulationManager;
|
||||
}
|
||||
|
||||
|
||||
G4GlobalFastSimulationManager::G4GlobalFastSimulationManager()
|
||||
G4GlobalFastSimulationManager* G4GlobalFastSimulationManager::GetInstance()
|
||||
{
|
||||
// Initialises the G4FastSimulationMessenger
|
||||
fTheFastSimulationMessenger=new G4FastSimulationMessenger(this);
|
||||
|
||||
// -- *** to be dropped @ next major release ***:
|
||||
_deprecated = new G4GFSManager81();
|
||||
return G4GlobalFastSimulationManager::GetGlobalFastSimulationManager();
|
||||
}
|
||||
|
||||
// ---------------
|
||||
// -- constructor
|
||||
// ---------------
|
||||
G4GlobalFastSimulationManager::G4GlobalFastSimulationManager()
|
||||
{
|
||||
fTheFastSimulationMessenger = new G4FastSimulationMessenger(this);
|
||||
}
|
||||
|
||||
// -------------
|
||||
// -- destructor
|
||||
// -------------
|
||||
G4GlobalFastSimulationManager::~G4GlobalFastSimulationManager()
|
||||
{
|
||||
delete fTheFastSimulationMessenger;
|
||||
fTheFastSimulationMessenger = 0;
|
||||
}
|
||||
|
||||
void G4GlobalFastSimulationManager::FastSimulationNeedsToBeClosed()
|
||||
{
|
||||
_deprecated->FastSimulationNeedsToBeClosed();
|
||||
}
|
||||
|
||||
// ----------------------
|
||||
// -- management methods:
|
||||
// ----------------------
|
||||
void G4GlobalFastSimulationManager::
|
||||
AddFastSimulationManager(G4FastSimulationManager* fsmanager)
|
||||
{
|
||||
@@ -112,39 +115,17 @@ RemoveFastSimulationManager(G4FastSimulationManager* fsmanager)
|
||||
ManagedManagers.remove(fsmanager);
|
||||
}
|
||||
|
||||
void G4GlobalFastSimulationManager::
|
||||
AddFSMP(G4FastSimulationManagerProcess81* fp)
|
||||
void G4GlobalFastSimulationManager::AddFSMP(G4FastSimulationManagerProcess* fp)
|
||||
{
|
||||
fFSMPVector.push_back(fp);
|
||||
}
|
||||
|
||||
void G4GlobalFastSimulationManager::
|
||||
RemoveFSMP(G4FastSimulationManagerProcess81* fp)
|
||||
void G4GlobalFastSimulationManager::RemoveFSMP(G4FastSimulationManagerProcess* fp)
|
||||
{
|
||||
fFSMPVector.remove(fp);
|
||||
}
|
||||
|
||||
void G4GlobalFastSimulationManager::CloseFastSimulation()
|
||||
{
|
||||
static int count(0);
|
||||
if (count++ < 5)
|
||||
G4cout << "G4GlobalFastSimulationManager::CloseFastSimulation() : DEPRECATING, will be dropped @ next major release" << G4endl;
|
||||
_deprecated->CloseFastSimulation();
|
||||
}
|
||||
|
||||
G4VFlavoredParallelWorld*
|
||||
G4GlobalFastSimulationManager::
|
||||
GetFlavoredWorldForThis(G4ParticleDefinition* definition)
|
||||
{
|
||||
static int count(0);
|
||||
if (count++ < 5)
|
||||
G4cout << "G4GlobalFastSimulationManager::GetFlavoredWorldForThis(...): DEPRECATING, will be dropped @ next major release" << G4endl;
|
||||
return _deprecated->GetFlavoredWorldForThis(definition);
|
||||
}
|
||||
|
||||
void
|
||||
G4GlobalFastSimulationManager::
|
||||
ActivateFastSimulationModel(const G4String& aName)
|
||||
void G4GlobalFastSimulationManager::ActivateFastSimulationModel(const G4String& aName)
|
||||
{
|
||||
G4bool result = false;
|
||||
for (size_t ifsm=0; ifsm<ManagedManagers.size(); ifsm++)
|
||||
@@ -157,9 +138,7 @@ ActivateFastSimulationModel(const G4String& aName)
|
||||
G4cout << G4endl;
|
||||
}
|
||||
|
||||
void
|
||||
G4GlobalFastSimulationManager::
|
||||
InActivateFastSimulationModel(const G4String& aName)
|
||||
void G4GlobalFastSimulationManager::InActivateFastSimulationModel(const G4String& aName)
|
||||
{
|
||||
G4bool result = false;
|
||||
for (size_t ifsm=0; ifsm<ManagedManagers.size(); ifsm++)
|
||||
@@ -172,8 +151,11 @@ InActivateFastSimulationModel(const G4String& aName)
|
||||
G4cout << G4endl;
|
||||
}
|
||||
|
||||
void
|
||||
G4GlobalFastSimulationManager::ShowSetup()
|
||||
|
||||
// ---------------------------------
|
||||
// -- display fast simulation setup:
|
||||
// ---------------------------------
|
||||
void G4GlobalFastSimulationManager::ShowSetup()
|
||||
{
|
||||
std::vector<G4VPhysicalVolume*> worldDone;
|
||||
G4VPhysicalVolume* world;
|
||||
@@ -224,9 +206,7 @@ G4GlobalFastSimulationManager::ShowSetup()
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
G4GlobalFastSimulationManager::
|
||||
DisplayRegion(G4Region* region, G4int depth, std::vector<G4ParticleDefinition*>& particlesKnown) const
|
||||
void G4GlobalFastSimulationManager::DisplayRegion(G4Region* region, G4int depth, std::vector<G4ParticleDefinition*>& particlesKnown) const
|
||||
{
|
||||
G4String indent = " ";
|
||||
for (G4int I=0; I<depth; I++) indent += " ";
|
||||
@@ -272,10 +252,12 @@ DisplayRegion(G4Region* region, G4int depth, std::vector<G4ParticleDefinition*>&
|
||||
}
|
||||
|
||||
|
||||
// ----------------------------
|
||||
// -- management methods : list
|
||||
// ----------------------------
|
||||
|
||||
void
|
||||
G4GlobalFastSimulationManager::ListEnvelopes(const G4String& aName,
|
||||
listType theType)
|
||||
void G4GlobalFastSimulationManager::ListEnvelopes(const G4String& aName,
|
||||
listType theType)
|
||||
{
|
||||
if (theType == ISAPPLICABLE)
|
||||
{
|
||||
@@ -311,26 +293,15 @@ G4GlobalFastSimulationManager::ListEnvelopes(const G4String& aName,
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
G4GlobalFastSimulationManager::ListEnvelopes(const G4ParticleDefinition* aPD)
|
||||
void G4GlobalFastSimulationManager::ListEnvelopes(const G4ParticleDefinition* aPD)
|
||||
{
|
||||
for (size_t ifsm=0; ifsm<ManagedManagers.size(); ifsm++)
|
||||
ManagedManagers[ifsm]->ListModels(aPD);
|
||||
}
|
||||
|
||||
G4bool
|
||||
G4GlobalFastSimulationManager::Notify(G4ApplicationState requestedState)
|
||||
{
|
||||
static int count(0);
|
||||
if (count++ < 5)
|
||||
G4cout << "G4GlobalFastSimulationManager::Notify() : DEPRECATING, will be dropped @ next major release" << G4endl;
|
||||
return _deprecated->Notify(requestedState);
|
||||
}
|
||||
|
||||
G4VFastSimulationModel*
|
||||
G4GlobalFastSimulationManager::
|
||||
GetFastSimulationModel(const G4String& modelName,
|
||||
const G4VFastSimulationModel* previousFound) const
|
||||
G4VFastSimulationModel* G4GlobalFastSimulationManager::GetFastSimulationModel(const G4String& modelName,
|
||||
const G4VFastSimulationModel* previousFound) const
|
||||
{
|
||||
G4VFastSimulationModel* model = 0;
|
||||
// -- flag used to navigate accross the various managers;
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VFastSimulationModel.cc,v 1.6 2006/06/29 21:09:38 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// $Id: G4VFastSimulationModel.cc,v 1.7 2007/05/11 13:50:20 mverderi Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
//
|
||||
@@ -43,26 +43,24 @@
|
||||
#include "G4VFastSimulationModel.hh"
|
||||
#include "G4FastSimulationManager.hh"
|
||||
|
||||
//
|
||||
// Simple constructor.
|
||||
//
|
||||
G4VFastSimulationModel::
|
||||
G4VFastSimulationModel(const G4String& aName) : theModelName(aName) {}
|
||||
// ----------------------
|
||||
// -- Simple constructor:
|
||||
// ----------------------
|
||||
G4VFastSimulationModel::G4VFastSimulationModel(const G4String& aName)
|
||||
: theModelName(aName) {}
|
||||
|
||||
//
|
||||
// Constructor for beginners. We do all the job, no matters...
|
||||
//
|
||||
G4VFastSimulationModel::
|
||||
G4VFastSimulationModel(const G4String& aName,
|
||||
G4Envelope* anEnvelope,
|
||||
G4bool IsUnique) : theModelName(aName)
|
||||
// ----------------------------------------------------------------------------------------------
|
||||
// -- Constructor with automatic G4FastSimulationManager constructed if needed fo given envelope:
|
||||
// ----------------------------------------------------------------------------------------------
|
||||
G4VFastSimulationModel::G4VFastSimulationModel(const G4String& aName,
|
||||
G4Envelope* anEnvelope,
|
||||
G4bool IsUnique)
|
||||
: theModelName(aName)
|
||||
{
|
||||
// Retrieves the Fast Simulation Manager ou creates one
|
||||
// if needed.
|
||||
// Retrieves the Fast Simulation Manager ou creates one if needed.
|
||||
G4FastSimulationManager* theFastSimulationManager;
|
||||
if ((theFastSimulationManager=anEnvelope->GetFastSimulationManager()) == 0)
|
||||
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