Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Data Structures | Public Member Functions | Protected Member Functions | Protected Attributes
G4ITTransportation Class Reference

#include <G4ITTransportation.hh>

Inheritance diagram for G4ITTransportation:
G4VITProcess G4VProcess G4DNABrownianTransportation

Data Structures

struct  G4ITTransportationState
 

Public Member Functions

 G4ITTransportation (const G4String &aName="ITTransportation", G4int verbosityLevel=1)
 
virtual ~G4ITTransportation ()
 
 G4ITTransportation (const G4ITTransportation &)
 
virtual void BuildPhysicsTable (const G4ParticleDefinition &)
 
virtual void ComputeStep (const G4Track &, const G4Step &, const double timeStep, double &spaceStep)
 
virtual void StartTracking (G4Track *aTrack)
 
virtual G4double AtRestGetPhysicalInteractionLength (const G4Track &, G4ForceCondition *)
 
virtual G4VParticleChangeAtRestDoIt (const G4Track &, const G4Step &)
 
virtual G4double AlongStepGetPhysicalInteractionLength (const G4Track &track, G4double, G4double currentMinimumStep, G4double &currentSafety, G4GPILSelection *selection)
 
virtual G4double PostStepGetPhysicalInteractionLength (const G4Track &, G4double, G4ForceCondition *pForceCond)
 
virtual G4VParticleChangeAlongStepDoIt (const G4Track &track, const G4Step &stepData)
 
virtual G4VParticleChangePostStepDoIt (const G4Track &track, const G4Step &)
 
G4PropagatorInFieldGetPropagatorInField ()
 
void SetPropagatorInField (G4PropagatorInField *pFieldPropagator)
 
void SetVerboseLevel (G4int verboseLevel)
 
G4int GetVerboseLevel () const
 
G4double GetThresholdWarningEnergy () const
 
G4double GetThresholdImportantEnergy () const
 
G4int GetThresholdTrials () const
 
void SetThresholdWarningEnergy (G4double newEnWarn)
 
void SetThresholdImportantEnergy (G4double newEnImp)
 
void SetThresholdTrials (G4int newMaxTrials)
 
G4double GetMaxEnergyKilled () const
 
G4double GetSumEnergyKilled () const
 
void ResetKilledStatistics (G4int report=1)
 
void EnableShortStepOptimisation (G4bool optimise=true)
 
- Public Member Functions inherited from G4VITProcess
 G4VITProcess (const G4String &name, G4ProcessType type=fNotDefined)
 
virtual ~G4VITProcess ()
 
 G4VITProcess (const G4VITProcess &other)
 
G4VITProcessoperator= (const G4VITProcess &other)
 
G4int operator== (const G4VITProcess &right) const
 
G4int operator!= (const G4VITProcess &right) const
 
size_t GetProcessID () const
 
G4ProcessState_LockGetProcessState ()
 
void SetProcessState (G4ProcessState_Lock *aProcInfo)
 
G4double GetInteractionTimeLeft ()
 
virtual void ResetNumberOfInteractionLengthLeft ()
 
G4bool ProposesTimeStep () const
 
- Public Member Functions inherited from G4VProcess
 G4VProcess (const G4String &aName="NoName", G4ProcessType aType=fNotDefined)
 
 G4VProcess (const G4VProcess &right)
 
virtual ~G4VProcess ()
 
G4int operator== (const G4VProcess &right) const
 
G4int operator!= (const G4VProcess &right) const
 
G4double GetCurrentInteractionLength () const
 
void SetPILfactor (G4double value)
 
G4double GetPILfactor () const
 
G4double AlongStepGPIL (const G4Track &track, G4double previousStepSize, G4double currentMinimumStep, G4double &proposedSafety, G4GPILSelection *selection)
 
G4double AtRestGPIL (const G4Track &track, G4ForceCondition *condition)
 
G4double PostStepGPIL (const G4Track &track, G4double previousStepSize, G4ForceCondition *condition)
 
virtual G4bool IsApplicable (const G4ParticleDefinition &)
 
virtual void PreparePhysicsTable (const G4ParticleDefinition &)
 
virtual G4bool StorePhysicsTable (const G4ParticleDefinition *, const G4String &, G4bool)
 
virtual G4bool RetrievePhysicsTable (const G4ParticleDefinition *, const G4String &, G4bool)
 
const G4StringGetPhysicsTableFileName (const G4ParticleDefinition *, const G4String &directory, const G4String &tableName, G4bool ascii=false)
 
const G4StringGetProcessName () const
 
G4ProcessType GetProcessType () const
 
void SetProcessType (G4ProcessType)
 
G4int GetProcessSubType () const
 
void SetProcessSubType (G4int)
 
virtual void EndTracking ()
 
virtual void SetProcessManager (const G4ProcessManager *)
 
virtual const G4ProcessManagerGetProcessManager ()
 
G4double GetNumberOfInteractionLengthLeft () const
 
G4double GetTotalNumberOfInteractionLengthTraversed () const
 
G4bool isAtRestDoItIsEnabled () const
 
G4bool isAlongStepDoItIsEnabled () const
 
G4bool isPostStepDoItIsEnabled () const
 
virtual void DumpInfo () const
 
void SetVerboseLevel (G4int value)
 
G4int GetVerboseLevel () const
 
virtual void SetMasterProcess (G4VProcess *masterP)
 
const G4VProcessGetMasterProcess () const
 
virtual void BuildWorkerPhysicsTable (const G4ParticleDefinition &part)
 
virtual void PrepareWorkerPhysicsTable (const G4ParticleDefinition &)
 

Protected Member Functions

G4bool DoesGlobalFieldExist ()
 
void SetInstantiateProcessState (G4bool flag)
 
G4bool InstantiateProcessState ()
 
- Protected Member Functions inherited from G4VITProcess
void RetrieveProcessInfo ()
 
void CreateInfo ()
 
virtual void ClearInteractionTimeLeft ()
 
virtual void ClearNumberOfInteractionLengthLeft ()
 
void SetInstantiateProcessState (G4bool flag)
 
G4bool InstantiateProcessState ()
 
- Protected Member Functions inherited from G4VProcess
void SubtractNumberOfInteractionLengthLeft (G4double previousStepSize)
 
void ClearNumberOfInteractionLengthLeft ()
 

Protected Attributes

G4ITTransportationState *const & fTransportationState
 
G4ITNavigatorfLinearNavigator
 
G4PropagatorInFieldfFieldPropagator
 
G4ParticleChangeForTransport fParticleChange
 
G4double fThreshold_Warning_Energy
 
G4double fThreshold_Important_Energy
 
G4int fThresholdTrials
 
G4double fUnimportant_Energy
 
G4double fSumEnergyKilled
 
G4double fMaxEnergyKilled
 
G4bool fShortStepOptimisation
 
G4SafetyHelperfpSafetyHelper
 
G4int fVerboseLevel
 
- Protected Attributes inherited from G4VITProcess
G4ProcessStatefpState
 
G4bool fProposesTimeStep
 
- Protected Attributes inherited from G4VProcess
const G4ProcessManageraProcessManager
 
G4VParticleChangepParticleChange
 
G4ParticleChange aParticleChange
 
G4double theNumberOfInteractionLengthLeft
 
G4double currentInteractionLength
 
G4double theInitialNumberOfInteractionLength
 
G4String theProcessName
 
G4String thePhysicsTableFileName
 
G4ProcessType theProcessType
 
G4int theProcessSubType
 
G4double thePILfactor
 
G4bool enableAtRestDoIt
 
G4bool enableAlongStepDoIt
 
G4bool enablePostStepDoIt
 
G4int verboseLevel
 

Additional Inherited Members

- Static Public Member Functions inherited from G4VITProcess
static const size_t & GetMaxProcessIndex ()
 
- Static Public Member Functions inherited from G4VProcess
static const G4StringGetProcessTypeName (G4ProcessType)
 

Detailed Description

Definition at line 57 of file G4ITTransportation.hh.

Constructor & Destructor Documentation

G4ITTransportation::G4ITTransportation ( const G4String aName = "ITTransportation",
G4int  verbosityLevel = 1 
)

Definition at line 81 of file G4ITTransportation.cc.

References G4VProcess::enableAlongStepDoIt, G4VProcess::enableAtRestDoIt, G4VProcess::enablePostStepDoIt, fFieldPropagator, fLinearNavigator, fParticleChange, fpSafetyHelper, G4ITTransportationManager::GetNavigatorForTracking(), G4TransportationManager::GetPropagatorInField(), G4ITTransportationManager::GetTransportationManager(), G4TransportationManager::GetTransportationManager(), G4VProcess::pParticleChange, G4VITProcess::SetInstantiateProcessState(), SetInstantiateProcessState(), and G4VProcess::SetProcessSubType().

81  :
86  fThresholdTrials( 10 ),
87  fUnimportant_Energy( 1 * MeV ), // Not used
88  fSumEnergyKilled( 0.0 ), fMaxEnergyKilled( 0.0 ),
89  fShortStepOptimisation(false), // Old default: true (=fast short steps)
90  fVerboseLevel( verbose )
91 {
93  G4TransportationManager* transportMgr ;
95  G4ITTransportationManager* ITtransportMgr ;
97  fLinearNavigator = ITtransportMgr->GetNavigatorForTracking() ;
98  fFieldPropagator = transportMgr->GetPropagatorInField() ;
99  fpSafetyHelper = 0; // transportMgr->GetSafetyHelper(); // New
100 
101  // Cannot determine whether a field exists here, as it would
102  // depend on the relative order of creating the detector's
103  // field and this process. That order is not guaranted.
104  // Instead later the method DoesGlobalFieldExist() is called
105 
106  enableAtRestDoIt = false;
107  enableAlongStepDoIt = true;
108  enablePostStepDoIt = true;
109  SetProcessSubType(60);
112  fInstantiateProcessState = true;
113 }
G4ParticleChangeForTransport fParticleChange
G4VITProcess(const G4String &name, G4ProcessType type=fNotDefined)
Definition: G4VITProcess.cc:34
G4ProcessState * fpState
G4bool enableAtRestDoIt
Definition: G4VProcess.hh:350
void SetInstantiateProcessState(G4bool flag)
G4ITNavigator * fLinearNavigator
static G4ITTransportationManager * GetTransportationManager()
G4PropagatorInField * fFieldPropagator
void SetInstantiateProcessState(G4bool flag)
void SetProcessSubType(G4int)
Definition: G4VProcess.hh:432
G4bool enablePostStepDoIt
Definition: G4VProcess.hh:352
static G4TransportationManager * GetTransportationManager()
#define InitProcessState(destination, source)
Definition: G4VITProcess.hh:53
G4VParticleChange * pParticleChange
Definition: G4VProcess.hh:283
G4SafetyHelper * fpSafetyHelper
G4bool enableAlongStepDoIt
Definition: G4VProcess.hh:351
G4double fThreshold_Important_Energy
G4PropagatorInField * GetPropagatorInField() const
G4ITTransportationState *const & fTransportationState
G4ITTransportation::~G4ITTransportation ( )
virtual

Definition at line 190 of file G4ITTransportation.cc.

References fMaxEnergyKilled, fSumEnergyKilled, fVerboseLevel, G4cout, and G4endl.

191 {
192 #ifdef G4VERBOSE
193  if( (fVerboseLevel > 0) && (fSumEnergyKilled > 0.0 ) )
194  {
195  G4cout << " G4ITTransportation: Statistics for looping particles " << G4endl;
196  G4cout << " Sum of energy of loopers killed: " << fSumEnergyKilled << G4endl;
197  G4cout << " Max energy of loopers killed: " << fMaxEnergyKilled << G4endl;
198  }
199 #endif
200 }
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
G4ITTransportation::G4ITTransportation ( const G4ITTransportation right)

Definition at line 116 of file G4ITTransportation.cc.

References G4VProcess::enableAlongStepDoIt, G4VProcess::enableAtRestDoIt, G4VProcess::enablePostStepDoIt, fFieldPropagator, fLinearNavigator, fMaxEnergyKilled, fParticleChange, fpSafetyHelper, fShortStepOptimisation, fSumEnergyKilled, fThreshold_Important_Energy, fThreshold_Warning_Energy, fThresholdTrials, fUnimportant_Energy, fVerboseLevel, G4ITTransportationManager::GetNavigatorForTracking(), G4TransportationManager::GetPropagatorInField(), G4ITTransportationManager::GetTransportationManager(), G4TransportationManager::GetTransportationManager(), G4VProcess::pParticleChange, G4VITProcess::SetInstantiateProcessState(), and SetInstantiateProcessState().

116  :
117  G4VITProcess(right),
119 {
120  // Copy attributes
121  fVerboseLevel = right.fVerboseLevel ;
129 
130  // Setup Navigators
131  G4TransportationManager* transportMgr ;
133  G4ITTransportationManager* ITtransportMgr ;
135  fLinearNavigator = ITtransportMgr->GetNavigatorForTracking() ;
136  fFieldPropagator = transportMgr->GetPropagatorInField() ;
137  fpSafetyHelper = 0; //transportMgr->GetSafetyHelper(); // New
138 
139  // Cannot determine whether a field exists here, as it would
140  // depend on the relative order of creating the detector's
141  // field and this process. That order is not guaranted.
142  // Instead later the method DoesGlobalFieldExist() is called
143 
144  enableAtRestDoIt = false;
145  enableAlongStepDoIt = true;
146  enablePostStepDoIt = true;
147 
151  fInstantiateProcessState = right.fInstantiateProcessState;
152 }
G4ParticleChangeForTransport fParticleChange
G4VITProcess(const G4String &name, G4ProcessType type=fNotDefined)
Definition: G4VITProcess.cc:34
G4ProcessState * fpState
G4bool enableAtRestDoIt
Definition: G4VProcess.hh:350
void SetInstantiateProcessState(G4bool flag)
G4ITNavigator * fLinearNavigator
static G4ITTransportationManager * GetTransportationManager()
G4PropagatorInField * fFieldPropagator
void SetInstantiateProcessState(G4bool flag)
G4bool enablePostStepDoIt
Definition: G4VProcess.hh:352
static G4TransportationManager * GetTransportationManager()
#define InitProcessState(destination, source)
Definition: G4VITProcess.hh:53
G4VParticleChange * pParticleChange
Definition: G4VProcess.hh:283
G4SafetyHelper * fpSafetyHelper
G4bool enableAlongStepDoIt
Definition: G4VProcess.hh:351
G4double fThreshold_Important_Energy
G4PropagatorInField * GetPropagatorInField() const
G4ITTransportationState *const & fTransportationState

Member Function Documentation

G4VParticleChange * G4ITTransportation::AlongStepDoIt ( const G4Track track,
const G4Step stepData 
)
virtual

!!!!!!! A REVOIR !!!!


Implements G4VProcess.

Reimplemented in G4DNABrownianTransportation.

Definition at line 611 of file G4ITTransportation.cc.

References G4Track::CalculateVelocityForOpticalPhoton(), fFieldPropagator, G4ParticleTable::FindParticle(), fMaxEnergyKilled, fParticleChange, fStopAndKill, fSumEnergyKilled, fThreshold_Important_Energy, fThreshold_Warning_Energy, fThresholdTrials, fVerboseLevel, G4cout, G4endl, G4ThreadLocal, G4Track::GetGlobalTime(), G4Track::GetKineticEnergy(), G4Track::GetLocalTime(), G4Track::GetParticleDefinition(), G4ParticleTable::GetParticleTable(), G4Step::GetPreStepPoint(), G4Track::GetStepLength(), G4StepPoint::GetVelocity(), G4PropagatorInField::GimmeTrajectoryVectorAndForgetIt(), G4ParticleChangeForTransport::Initialize(), python.hepunit::MeV, G4ParticleChange::ProposeEnergy(), G4ParticleChange::ProposeGlobalTime(), G4ParticleChange::ProposeLocalTime(), G4ParticleChange::ProposeMomentumDirection(), G4ParticleChange::ProposePolarization(), G4ParticleChange::ProposePosition(), G4VParticleChange::ProposeTrackStatus(), G4ParticleChange::ProposeVelocity(), G4ParticleChangeForTransport::SetMomentumChanged(), G4ParticleChangeForTransport::SetPointerToVectorOfAuxiliaryPoints(), and State.

Referenced by G4DNABrownianTransportation::AlongStepDoIt().

613 {
614 
615  // G4cout << "G4ITTransportation::AlongStepDoIt" << G4endl;
616  // set pdefOpticalPhoton
617  //Andrea Dotti: the following statement should be in a single line:
618  // G4-MT transformation tools get confused if statement spans two lines
619  // If needed contact: adotti@slac.stanford.edu
620  static G4ThreadLocal G4ParticleDefinition* pdefOpticalPhoton = 0 ; if (!pdefOpticalPhoton) pdefOpticalPhoton= G4ParticleTable::GetParticleTable()->FindParticle("opticalphoton");
621 
622  static G4ThreadLocal G4int noCalls=0;
623  noCalls++;
624 
625  fParticleChange.Initialize(track) ;
626 
627  // Code for specific process
628  //
629  fParticleChange.ProposePosition(State(fTransportEndPosition)) ;
630  fParticleChange.ProposeMomentumDirection(State(fTransportEndMomentumDir)) ;
631  fParticleChange.ProposeEnergy(State(fTransportEndKineticEnergy)) ;
632  fParticleChange.SetMomentumChanged(State(fMomentumChanged)) ;
633 
634  fParticleChange.ProposePolarization(State(fTransportEndSpin));
635 
636  G4double deltaTime = 0.0 ;
637 
638  // Calculate Lab Time of Flight (ONLY if field Equations used it!)
639  // G4double endTime = State(fCandidateEndGlobalTime);
640  // G4double delta_time = endTime - startTime;
641 
642  G4double startTime = track.GetGlobalTime() ;
643  ///___________________________________________________________________________
644  /// !!!!!!!
645  /// A REVOIR !!!!
646  if (State(fEndGlobalTimeComputed) == false)
647  {
648  // The time was not integrated .. make the best estimate possible
649  //
650  G4double initialVelocity = stepData.GetPreStepPoint()->GetVelocity() ;
651  G4double stepLength = track.GetStepLength() ;
652 
653  deltaTime= 0.0; // in case initialVelocity = 0
654  if (track.GetParticleDefinition() == pdefOpticalPhoton)
655  {
656  // For only Optical Photon, final velocity is used
657  double finalVelocity = track.CalculateVelocityForOpticalPhoton();
658  fParticleChange.ProposeVelocity(finalVelocity);
659  deltaTime = stepLength/finalVelocity ;
660  }
661  else if( initialVelocity > 0.0 )
662  {
663  deltaTime = stepLength/initialVelocity ;
664  }
665 
666  State(fCandidateEndGlobalTime) = startTime + deltaTime ;
667  }
668  else
669  {
670  deltaTime = State(fCandidateEndGlobalTime) - startTime ;
671  }
672 
673  fParticleChange.ProposeGlobalTime( State(fCandidateEndGlobalTime) ) ;
674  fParticleChange.ProposeLocalTime( track.GetLocalTime() + deltaTime) ;
675  /*
676  // Now Correct by Lorentz factor to get delta "proper" Time
677 
678  G4double restMass = track.GetDynamicParticle()->GetMass() ;
679  G4double deltaProperTime = deltaTime*( restMass/track.GetTotalEnergy() ) ;
680 
681  fParticleChange.ProposeProperTime(track.GetProperTime() + deltaProperTime) ;
682 */
683 
684  fParticleChange. ProposeTrueStepLength( track.GetStepLength() ) ;
685 
686  ///___________________________________________________________________________
687  ///
688 
689  // If the particle is caught looping or is stuck (in very difficult
690  // boundaries) in a magnetic field (doing many steps)
691  // THEN this kills it ...
692  //
693  if ( State(fParticleIsLooping) )
694  {
695  G4double endEnergy= State(fTransportEndKineticEnergy);
696 
697  if( (endEnergy < fThreshold_Important_Energy)
698  || (State(fNoLooperTrials) >= fThresholdTrials ) )
699  {
700  // Kill the looping particle
701  //
702  // G4cout << "G4ITTransportation will killed the molecule"<< G4endl;
704 
705  // 'Bare' statistics
706  fSumEnergyKilled += endEnergy;
707  if( endEnergy > fMaxEnergyKilled)
708  {
709  fMaxEnergyKilled= endEnergy;
710  }
711 
712 #ifdef G4VERBOSE
713  if( (fVerboseLevel > 1) ||
714  ( endEnergy > fThreshold_Warning_Energy ) )
715  {
716  G4cout << " G4ITTransportation is killing track that is looping or stuck "
717  << G4endl
718  << " This track has " << track.GetKineticEnergy() / MeV
719  << " MeV energy." << G4endl;
720  G4cout << " Number of trials = " << State(fNoLooperTrials)
721  << " No of calls to AlongStepDoIt = " << noCalls
722  << G4endl;
723  }
724 #endif
725  State(fNoLooperTrials)=0;
726  }
727  else
728  {
729  State(fNoLooperTrials) ++;
730 #ifdef G4VERBOSE
731  if( (fVerboseLevel > 2) )
732  {
733  G4cout << " G4ITTransportation::AlongStepDoIt(): Particle looping - "
734  << " Number of trials = " << State(fNoLooperTrials)
735  << " No of calls to = " << noCalls
736  << G4endl;
737  }
738 #endif
739  }
740  }
741  else
742  {
743  State(fNoLooperTrials)=0;
744  }
745 
746  // Another (sometimes better way) is to use a user-limit maximum Step size
747  // to alleviate this problem ..
748 
749  // Introduce smooth curved trajectories to particle-change
750  //
753 
754  return &fParticleChange ;
755 }
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
G4double GetLocalTime() const
G4ParticleChangeForTransport fParticleChange
std::vector< G4ThreeVector > * GimmeTrajectoryVectorAndForgetIt() const
void ProposePolarization(G4double Px, G4double Py, G4double Pz)
G4double GetVelocity() const
#define G4ThreadLocal
Definition: tls.hh:52
#define State(theXInfo)
int G4int
Definition: G4Types.hh:78
void ProposePosition(G4double x, G4double y, G4double z)
G4StepPoint * GetPreStepPoint() const
virtual void Initialize(const G4Track &)
G4double CalculateVelocityForOpticalPhoton() const
Definition: G4Track.cc:247
G4double GetKineticEnergy() const
G4GLOB_DLL std::ostream G4cout
G4PropagatorInField * fFieldPropagator
const G4ParticleDefinition * GetParticleDefinition() const
G4double GetGlobalTime() const
static G4ParticleTable * GetParticleTable()
void SetPointerToVectorOfAuxiliaryPoints(std::vector< G4ThreeVector > *theNewVectorPointer)
void ProposeGlobalTime(G4double t)
void ProposeEnergy(G4double finalEnergy)
#define G4endl
Definition: G4ios.hh:61
void ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz)
double G4double
Definition: G4Types.hh:76
void ProposeTrackStatus(G4TrackStatus status)
G4double fThreshold_Important_Energy
void SetMomentumChanged(G4bool b)
void ProposeVelocity(G4double finalVelocity)
void ProposeLocalTime(G4double t)
G4double GetStepLength() const
G4double G4ITTransportation::AlongStepGetPhysicalInteractionLength ( const G4Track track,
G4double  ,
G4double  currentMinimumStep,
G4double currentSafety,
G4GPILSelection selection 
)
virtual

Implements G4VProcess.

Reimplemented in G4DNABrownianTransportation.

Definition at line 219 of file G4ITTransportation.cc.

References CandidateForSelection, G4ITNavigator::ComputeSafety(), G4ITNavigator::ComputeStep(), G4FieldManager::ConfigureForTrack(), FatalException, fFieldPropagator, G4PropagatorInField::FindAndSetFieldManager(), fLinearNavigator, fpSafetyHelper, fShortStepOptimisation, G4cout, G4endl, G4Exception(), G4DynamicParticle::GetCharge(), G4FieldManager::GetDetectorField(), G4Track::GetDynamicParticle(), G4Track::GetGlobalTime(), G4Track::GetKineticEnergy(), G4DynamicParticle::GetMomentumDirection(), G4Track::GetPolarization(), G4Track::GetPosition(), G4Track::GetTouchableHandle(), G4Track::GetVelocity(), G4Track::GetVolume(), CLHEP::Hep3Vector::mag2(), G4SafetyHelper::SetCurrentSafety(), sqr(), and State.

Referenced by G4DNABrownianTransportation::AlongStepGetPhysicalInteractionLength().

225 {
226  G4double geometryStepLength(-1.0), newSafety(-1.0) ;
227 
228  State(fParticleIsLooping) = false ;
229  State(fEndGlobalTimeComputed) = false ;
230  State(fGeometryLimitedStep) = false ;
231 
232  // Initial actions moved to StartTrack()
233  // --------------------------------------
234  // Note: in case another process changes touchable handle
235  // it will be necessary to add here (for all steps)
236  State(fCurrentTouchableHandle) = track.GetTouchableHandle();
237 
238  // GPILSelection is set to defaule value of CandidateForSelection
239  // It is a return value
240  //
241  *selection = CandidateForSelection ;
242 
243  // Get initial Energy/Momentum of the track
244  //
245  const G4DynamicParticle* pParticle = track.GetDynamicParticle() ;
246 // const G4ParticleDefinition* pParticleDef = pParticle->GetDefinition() ;
247  G4ThreeVector startMomentumDir = pParticle->GetMomentumDirection() ;
248  G4ThreeVector startPosition = track.GetPosition() ;
249 
250  // G4double theTime = track.GetGlobalTime() ;
251 
252  // The Step Point safety can be limited by other geometries and/or the
253  // assumptions of any process - it's not always the geometrical safety.
254  // We calculate the starting point's isotropic safety here.
255  //
256  G4ThreeVector OriginShift = startPosition - State(fPreviousSftOrigin) ;
257  G4double MagSqShift = OriginShift.mag2() ;
258  if( MagSqShift >= sqr(State(fPreviousSafety)) )
259  {
260  currentSafety = 0.0 ;
261  }
262  else
263  {
264  currentSafety = State(fPreviousSafety) - std::sqrt(MagSqShift) ;
265  }
266 
267  // Is the particle charged ?
268  //
269  G4double particleCharge = pParticle->GetCharge() ;
270 
271 
272  // There is no need to locate the current volume. It is Done elsewhere:
273  // On track construction
274  // By the tracking, after all AlongStepDoIts, in "Relocation"
275 
276  // Check whether the particle have an (EM) field force exerting upon it
277  //
278  G4FieldManager* fieldMgr=0;
279  G4bool fieldExertsForce = false ;
280  if( (particleCharge != 0.0) )
281  {
282  fieldMgr= fFieldPropagator->FindAndSetFieldManager( track.GetVolume() );
283  if (fieldMgr != 0)
284  {
285  // Message the field Manager, to configure it for this track
286  fieldMgr->ConfigureForTrack( &track );
287  // Moved here, in order to allow a transition
288  // from a zero-field status (with fieldMgr->(field)0
289  // to a finite field status
290 
291  // If the field manager has no field, there is no field !
292  fieldExertsForce = (fieldMgr->GetDetectorField() != 0);
293  }
294  }
295 
296  // G4cout << " G4Transport: field exerts force= " << fieldExertsForce
297  // << " fieldMgr= " << fieldMgr << G4endl;
298 
299  // Choose the calculation of the transportation: Field or not
300  //
301  if( !fieldExertsForce )
302  {
303  G4double linearStepLength ;
304  if( fShortStepOptimisation && (currentMinimumStep <= currentSafety) )
305  {
306  // The Step is guaranteed to be taken
307  //
308  geometryStepLength = currentMinimumStep ;
309  State(fGeometryLimitedStep) = false ;
310  }
311  else
312  {
313  // Find whether the straight path intersects a volume
314  //
315  linearStepLength = fLinearNavigator->ComputeStep( startPosition,
316  startMomentumDir,
317  currentMinimumStep,
318  newSafety) ;
319  // Remember last safety origin & value.
320  //
321  State(fPreviousSftOrigin) = startPosition ;
322  State(fPreviousSafety) = newSafety ;
323  // fpSafetyHelper->SetCurrentSafety( newSafety, startPosition);
324 
325  // The safety at the initial point has been re-calculated:
326  //
327  currentSafety = newSafety ;
328 
329  State(fGeometryLimitedStep)= (linearStepLength <= currentMinimumStep);
330  if( State(fGeometryLimitedStep) )
331  {
332  // The geometry limits the Step size (an intersection was found.)
333  geometryStepLength = linearStepLength ;
334  }
335  else
336  {
337  // The full Step is taken.
338  geometryStepLength = currentMinimumStep ;
339  }
340  }
341  State(endpointDistance) = geometryStepLength ;
342 
343  // Calculate final position
344  //
345  State(fTransportEndPosition) = startPosition+geometryStepLength*startMomentumDir ;
346 
347  // Momentum direction, energy and polarisation are unchanged by transport
348  //
349  State(fTransportEndMomentumDir) = startMomentumDir ;
350  State(fTransportEndKineticEnergy) = track.GetKineticEnergy() ;
351  State(fTransportEndSpin) = track.GetPolarization();
352  State(fParticleIsLooping) = false ;
353  State(fMomentumChanged) = false ;
354  State(fEndGlobalTimeComputed) = true ;
355  State(theInteractionTimeLeft) = State(endpointDistance)/track.GetVelocity();
356  State(fCandidateEndGlobalTime) = State(theInteractionTimeLeft)+track.GetGlobalTime();
357 
358  // G4cout << "track.GetVelocity() : " << track.GetVelocity() << G4endl;
359  // G4cout << "State(endpointDistance) : " << G4BestUnit(State(endpointDistance),"Length") << G4endl;
360  // G4cout << "State(theInteractionTimeLeft) : " << G4BestUnit(State(theInteractionTimeLeft),"Time") << G4endl;
361  // G4cout << "track.GetGlobalTime() : " << G4BestUnit(track.GetGlobalTime(),"Time") << G4endl;
362 
363  }
364  else // A field exerts force
365  {
366 
367  G4ExceptionDescription exceptionDescription;
368  exceptionDescription << "ITTransportation does not support external fields.";
369  exceptionDescription << " If you are dealing with a tradiational MC simulation, ";
370  exceptionDescription << "please use G4Transportation.";
371 
372  G4Exception("G4ITTransportation::AlongStepGetPhysicalInteractionLength","NoExternalFieldSupport",
373  FatalException,exceptionDescription);
374  /*
375  G4double momentumMagnitude = pParticle->GetTotalMomentum() ;
376  // G4ThreeVector EndUnitMomentum ;
377  G4double lengthAlongCurve ;
378  G4double restMass = pParticleDef->GetPDGMass() ;
379 
380  fFieldPropagator->SetChargeMomentumMass( particleCharge, // in e+ units
381  momentumMagnitude, // in Mev/c
382  restMass ) ;
383 
384  G4ThreeVector spin = track.GetPolarization() ;
385  G4FieldTrack aFieldTrack = G4FieldTrack( startPosition,
386  track.GetMomentumDirection(),
387  0.0,
388  track.GetKineticEnergy(),
389  restMass,
390  track.GetVelocity(),
391  track.GetGlobalTime(), // Lab.
392  track.GetProperTime(), // Part.
393  &spin ) ;
394  if( currentMinimumStep > 0 )
395  {
396  // Do the Transport in the field (non recti-linear)
397  //
398  lengthAlongCurve = fFieldPropagator->ComputeStep( aFieldTrack,
399  currentMinimumStep,
400  currentSafety,
401  track.GetVolume() ) ;
402  State(fGeometryLimitedStep)= lengthAlongCurve < currentMinimumStep;
403  if( State(fGeometryLimitedStep) )
404  {
405  geometryStepLength = lengthAlongCurve ;
406  }
407  else
408  {
409  geometryStepLength = currentMinimumStep ;
410  }
411 
412  // Remember last safety origin & value.
413  //
414  State(fPreviousSftOrigin) = startPosition ;
415  State(fPreviousSafety) = currentSafety ;
416  fpSafetyHelper->SetCurrentSafety( newSafety, startPosition);
417  }
418  else
419  {
420  geometryStepLength = lengthAlongCurve= 0.0 ;
421  State(fGeometryLimitedStep) = false ;
422  }
423 
424  // Get the End-Position and End-Momentum (Dir-ection)
425  //
426  State(fTransportEndPosition) = aFieldTrack.GetPosition() ;
427 
428  // Momentum: Magnitude and direction can be changed too now ...
429  //
430  State(fMomentumChanged) = true ;
431  State(fTransportEndMomentumDir) = aFieldTrack.GetMomentumDir() ;
432 
433  State(fTransportEndKineticEnergy) = aFieldTrack.GetKineticEnergy() ;
434 
435  if( fFieldPropagator->GetCurrentFieldManager()->DoesFieldChangeEnergy() )
436  {
437  // If the field can change energy, then the time must be integrated
438  // - so this should have been updated
439  //
440  State(fCandidateEndGlobalTime) = aFieldTrack.GetLabTimeOfFlight();
441  State(fEndGlobalTimeComputed) = true;
442 
443  State(theInteractionTimeLeft) = State(fCandidateEndGlobalTime) - track.GetGlobalTime() ;
444 
445  // was ( State(fCandidateEndGlobalTime) != track.GetGlobalTime() );
446  // a cleaner way is to have FieldTrack knowing whether time is updated.
447  }
448  else
449  {
450  // The energy should be unchanged by field transport,
451  // - so the time changed will be calculated elsewhere
452  //
453  State(fEndGlobalTimeComputed) = false;
454 
455  // Check that the integration preserved the energy
456  // - and if not correct this!
457  G4double startEnergy= track.GetKineticEnergy();
458  G4double endEnergy= State(fTransportEndKineticEnergy);
459 
460  static G4int no_inexact_steps=0, no_large_ediff;
461  G4double absEdiff = std::fabs(startEnergy- endEnergy);
462  if( absEdiff > perMillion * endEnergy )
463  {
464  no_inexact_steps++;
465  // Possible statistics keeping here ...
466  }
467 #ifdef G4VERBOSE
468  if( fVerboseLevel > 1 )
469  {
470  if( std::fabs(startEnergy- endEnergy) > perThousand * endEnergy )
471  {
472  static G4int no_warnings= 0, warnModulo=1, moduloFactor= 10;
473  no_large_ediff ++;
474  if( (no_large_ediff% warnModulo) == 0 )
475  {
476  no_warnings++;
477  G4cout << "WARNING - G4Transportation::AlongStepGetPIL() "
478  << " Energy change in Step is above 1^-3 relative value. " << G4endl
479  << " Relative change in 'tracking' step = "
480  << std::setw(15) << (endEnergy-startEnergy)/startEnergy << G4endl
481  << " Starting E= " << std::setw(12) << startEnergy / MeV << " MeV " << G4endl
482  << " Ending E= " << std::setw(12) << endEnergy / MeV << " MeV " << G4endl;
483  G4cout << " Energy has been corrected -- however, review"
484  << " field propagation parameters for accuracy." << G4endl;
485  if( (fVerboseLevel > 2 ) || (no_warnings<4) || (no_large_ediff == warnModulo * moduloFactor) )
486  {
487  G4cout << " These include EpsilonStepMax(/Min) in G4FieldManager "
488  << " which determine fractional error per step for integrated quantities. " << G4endl
489  << " Note also the influence of the permitted number of integration steps."
490  << G4endl;
491  }
492  G4cerr << "ERROR - G4Transportation::AlongStepGetPIL()" << G4endl
493  << " Bad 'endpoint'. Energy change detected"
494  << " and corrected. "
495  << " Has occurred already "
496  << no_large_ediff << " times." << G4endl;
497  if( no_large_ediff == warnModulo * moduloFactor )
498  {
499  warnModulo *= moduloFactor;
500  }
501  }
502  }
503  } // end of if (fVerboseLevel)
504 #endif
505  // Correct the energy for fields that conserve it
506  // This - hides the integration error
507  // - but gives a better physical answer
508  State(fTransportEndKineticEnergy)= track.GetKineticEnergy();
509  }
510 
511  State(fTransportEndSpin) = aFieldTrack.GetSpin();
512  State(fParticleIsLooping) = fFieldPropagator->IsParticleLooping() ;
513  State(endpointDistance) = (State(fTransportEndPosition) - startPosition).mag() ;
514  // State(theInteractionTimeLeft) = track.GetVelocity()/State(endpointDistance) ;
515 */
516  }
517 
518  // If we are asked to go a step length of 0, and we are on a boundary
519  // then a boundary will also limit the step -> we must flag this.
520  //
521  if( currentMinimumStep == 0.0 )
522  {
523  if( currentSafety == 0.0 )
524  {
525  State(fGeometryLimitedStep) = true ;
526 // G4cout << "!!!! Safety is NULL, on the Boundary !!!!!" << G4endl;
527 // G4cout << " Track position : " << track.GetPosition() /nanometer << G4endl;
528  }
529  }
530 
531  // Update the safety starting from the end-point,
532  // if it will become negative at the end-point.
533  //
534  if( currentSafety < State(endpointDistance) )
535  {
536  // if( particleCharge == 0.0 )
537  // G4cout << " Avoiding call to ComputeSafety : charge = 0.0 " << G4endl;
538 
539  if( particleCharge != 0.0 )
540  {
541 
542  G4double endSafety =
543  fLinearNavigator->ComputeSafety( State(fTransportEndPosition)) ;
544  currentSafety = endSafety ;
545  State(fPreviousSftOrigin) = State(fTransportEndPosition) ;
546  State(fPreviousSafety) = currentSafety ;
547  fpSafetyHelper->SetCurrentSafety( currentSafety, State(fTransportEndPosition));
548 
549  // Because the Stepping Manager assumes it is from the start point,
550  // add the StepLength
551  //
552  currentSafety += State(endpointDistance) ;
553 
554 #ifdef G4DEBUG_TRANSPORT
555  G4cout.precision(12) ;
556  G4cout << "***G4Transportation::AlongStepGPIL ** " << G4endl ;
557  G4cout << " Called Navigator->ComputeSafety at " << State(fTransportEndPosition)
558  << " and it returned safety= " << endSafety << G4endl ;
559  G4cout << " Adding endpoint distance " << State(endpointDistance)
560  << " to obtain pseudo-safety= " << currentSafety << G4endl ;
561 #endif
562  }
563  }
564 
565  // fParticleChange.ProposeTrueStepLength(geometryStepLength) ;
566 
567  return geometryStepLength ;
568 }
const G4ThreeVector & GetPolarization() const
std::ostringstream G4ExceptionDescription
Definition: globals.hh:76
G4double GetVelocity() const
const G4DynamicParticle * GetDynamicParticle() const
virtual G4double ComputeSafety(const G4ThreeVector &globalpoint, const G4double pProposedMaxLength=DBL_MAX, const G4bool keepState=false)
const G4ThreeVector & GetPosition() const
virtual G4double ComputeStep(const G4ThreeVector &pGlobalPoint, const G4ThreeVector &pDirection, const G4double pCurrentProposedStepLength, G4double &pNewSafety)
#define State(theXInfo)
G4ITNavigator * fLinearNavigator
virtual void ConfigureForTrack(const G4Track *)
G4double GetKineticEnergy() const
G4GLOB_DLL std::ostream G4cout
bool G4bool
Definition: G4Types.hh:79
const G4ThreeVector & GetMomentumDirection() const
G4PropagatorInField * fFieldPropagator
G4double GetCharge() const
G4double GetGlobalTime() const
G4FieldManager * FindAndSetFieldManager(G4VPhysicalVolume *pCurrentPhysVol)
const G4TouchableHandle & GetTouchableHandle() const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
G4SafetyHelper * fpSafetyHelper
double mag2() const
G4VPhysicalVolume * GetVolume() const
void SetCurrentSafety(G4double val, const G4ThreeVector &pos)
#define G4endl
Definition: G4ios.hh:61
T sqr(const T &x)
Definition: templates.hh:145
double G4double
Definition: G4Types.hh:76
const G4Field * GetDetectorField() const
virtual G4VParticleChange* G4ITTransportation::AtRestDoIt ( const G4Track ,
const G4Step  
)
inlinevirtual

Implements G4VProcess.

Definition at line 91 of file G4ITTransportation.hh.

95  {
96  return 0;
97  }
virtual G4double G4ITTransportation::AtRestGetPhysicalInteractionLength ( const G4Track ,
G4ForceCondition  
)
inlinevirtual

Implements G4VProcess.

Definition at line 82 of file G4ITTransportation.hh.

86  {
87  return -1.0;
88  }
virtual void G4ITTransportation::BuildPhysicsTable ( const G4ParticleDefinition )
inlinevirtual

Reimplemented from G4VITProcess.

Reimplemented in G4DNABrownianTransportation.

Definition at line 69 of file G4ITTransportation.hh.

69 {;}
void G4ITTransportation::ComputeStep ( const G4Track track,
const G4Step ,
const double  timeStep,
double &  spaceStep 
)
virtual

Reimplemented in G4DNABrownianTransportation.

Definition at line 571 of file G4ITTransportation.cc.

References G4Track::CalculateVelocity(), fParticleChange, G4Track::GetDynamicParticle(), G4Track::GetGlobalTime(), G4DynamicParticle::GetMomentumDirection(), G4Track::GetPosition(), G4Track::GetVelocity(), G4ParticleChange::ProposeVelocity(), and State.

Referenced by G4ITStepProcessor::DoDefinePhysicalStepLength(), and G4ITStepProcessor::FindTransportationStep().

575 {
576  const G4DynamicParticle* pParticle = track.GetDynamicParticle() ;
577  G4ThreeVector startMomentumDir = pParticle->GetMomentumDirection() ;
578  G4ThreeVector startPosition = track.GetPosition() ;
579 
580  track.CalculateVelocity();
581  G4double initialVelocity = track.GetVelocity() ;
582 
583  State(fGeometryLimitedStep) = false;
584 
585  /////////////////////////
586  // !!! CASE NO FIELD !!!
587  /////////////////////////
588  State(fCandidateEndGlobalTime) = timeStep + track.GetGlobalTime();
589  State(fEndGlobalTimeComputed) = true ;
590 
591  // Choose the calculation of the transportation: Field or not
592  //
593  if( !State(fMomentumChanged) )
594  {
595  // G4cout << "Momentum has not changed" << G4endl;
596  fParticleChange.ProposeVelocity(initialVelocity);
597  oPhysicalStep = initialVelocity*timeStep ;
598 
599  // Calculate final position
600  //
601  State(fTransportEndPosition) = startPosition + oPhysicalStep*startMomentumDir ;
602  }
603 }
G4ParticleChangeForTransport fParticleChange
G4double GetVelocity() const
const G4DynamicParticle * GetDynamicParticle() const
const G4ThreeVector & GetPosition() const
#define State(theXInfo)
const G4ThreeVector & GetMomentumDirection() const
G4double GetGlobalTime() const
G4double CalculateVelocity() const
Definition: G4Track.cc:214
double G4double
Definition: G4Types.hh:76
void ProposeVelocity(G4double finalVelocity)
G4bool G4ITTransportation::DoesGlobalFieldExist ( )
protected

Definition at line 202 of file G4ITTransportation.cc.

References G4FieldManager::DoesFieldExist(), G4TransportationManager::GetFieldManager(), and G4TransportationManager::GetTransportationManager().

Referenced by StartTracking().

203 {
204  G4TransportationManager* transportMgr;
206 
207  // fFieldExists= transportMgr->GetFieldManager()->DoesFieldExist();
208  // return fFieldExists;
209  return transportMgr->GetFieldManager()->DoesFieldExist();
210 }
G4bool DoesFieldExist() const
static G4TransportationManager * GetTransportationManager()
G4FieldManager * GetFieldManager() const
void G4ITTransportation::EnableShortStepOptimisation ( G4bool  optimise = true)
inline
G4double G4ITTransportation::GetMaxEnergyKilled ( ) const
inline
G4PropagatorInField* G4ITTransportation::GetPropagatorInField ( )
G4double G4ITTransportation::GetSumEnergyKilled ( ) const
inline
G4double G4ITTransportation::GetThresholdImportantEnergy ( ) const
inline
G4int G4ITTransportation::GetThresholdTrials ( ) const
inline
G4double G4ITTransportation::GetThresholdWarningEnergy ( ) const
inline
G4int G4ITTransportation::GetVerboseLevel ( ) const
inline
G4bool G4ITTransportation::InstantiateProcessState ( )
inlineprotected

Definition at line 239 of file G4ITTransportation.hh.

239 { return fInstantiateProcessState; }
G4VParticleChange * G4ITTransportation::PostStepDoIt ( const G4Track track,
const G4Step  
)
virtual

Implements G4VProcess.

Reimplemented in G4DNABrownianTransportation.

Definition at line 777 of file G4ITTransportation.cc.

References G4ITNavigator::EnteredDaughterVolume(), G4ITNavigator::ExitedMotherVolume(), FatalErrorInArgument, fLinearNavigator, fParticleChange, fStopAndKill, fVerboseLevel, G4cout, G4endl, G4Exception(), G4VPhysicalVolume::GetLogicalVolume(), G4MaterialCutsCouple::GetMaterial(), G4LogicalVolume::GetMaterial(), G4ProductionCutsTable::GetMaterialCutsCouple(), G4LogicalVolume::GetMaterialCutsCouple(), G4Track::GetMomentumDirection(), G4Track::GetPosition(), G4MaterialCutsCouple::GetProductionCuts(), G4ProductionCutsTable::GetProductionCutsTable(), G4LogicalVolume::GetSensitiveDetector(), G4Track::GetTouchableHandle(), G4Track::GetTrackID(), G4Track::GetTrackStatus(), G4VTouchable::GetVolume(), G4ParticleChangeForTransport::Initialize(), G4ITNavigator::LocateGlobalPointWithinVolume(), python.hepunit::nanometer, G4VParticleChange::ProposeLastStepInVolume(), G4VParticleChange::ProposeTrackStatus(), G4ITNavigator::SetGeometricallyLimitedStep(), G4ParticleChangeForTransport::SetMaterialCutsCoupleInTouchable(), G4ParticleChangeForTransport::SetMaterialInTouchable(), G4ParticleChangeForTransport::SetSensitiveDetectorInTouchable(), G4ParticleChangeForTransport::SetTouchableHandle(), and State.

Referenced by G4DNABrownianTransportation::PostStepDoIt().

779 {
780  // G4cout << "G4ITTransportation::PostStepDoIt" << G4endl;
781  G4TouchableHandle retCurrentTouchable ; // The one to return
782  G4bool isLastStep= false;
783 
784  // Initialize ParticleChange (by setting all its members equal
785  // to corresponding members in G4Track)
786  fParticleChange.Initialize(track) ; // To initialise TouchableChange
787 
789 
790  // If the Step was determined by the volume boundary,
791  // logically relocate the particle
792 
793  if(State(fGeometryLimitedStep))
794  {
795 
796  // G4cout << "Step is limited by geometry " << "track ID : " << track.GetTrackID() << G4endl;
797 
798  // fCurrentTouchable will now become the previous touchable,
799  // and what was the previous will be freed.
800  // (Needed because the preStepPoint can point to the previous touchable)
801 
802  if( State(fCurrentTouchableHandle)->GetVolume() == 0 )
803  {
804  G4ExceptionDescription exceptionDescription ;
805  exceptionDescription << "No current touchable found " ;
806  G4Exception(" G4ITTransportation::PostStepDoIt","G4ITTransportation001",
807  FatalErrorInArgument,exceptionDescription);
808  }
809 
812  LocateGlobalPointAndUpdateTouchableHandle( track.GetPosition(),
813  track.GetMomentumDirection(),
814  State(fCurrentTouchableHandle),
815  true ) ;
816  // Check whether the particle is out of the world volume
817  // If so it has exited and must be killed.
818  //
819  if( State(fCurrentTouchableHandle)->GetVolume() == 0 )
820  {
821 #ifdef G4VERBOSE
822  if(fVerboseLevel > 0)
823  {
824  G4cout << "Track position : " << track.GetPosition() / nanometer << " [nm]"
825  << " Track ID : " << track.GetTrackID()<< G4endl;
826  G4cout << "G4ITTransportation will killed the track because State(fCurrentTouchableHandle)->GetVolume() == 0"<< G4endl;
827  }
828 #endif
830  }
831 
832  retCurrentTouchable = State(fCurrentTouchableHandle) ;
833 
834 // G4cout << "Current volume : " << track.GetVolume()->GetName()
835 // << " Next volume : "
836 // << (State(fCurrentTouchableHandle)->GetVolume() ? State(fCurrentTouchableHandle)->GetVolume()->GetName():"OutWorld")
837 // << " Position : " << track.GetPosition() / nanometer
838 // << " track ID : " << track.GetTrackID()
839 // << G4endl;
840 
841  fParticleChange.SetTouchableHandle( State(fCurrentTouchableHandle) ) ;
842 
843  // Update the Step flag which identifies the Last Step in a volume
844  isLastStep = fLinearNavigator->ExitedMotherVolume()
846 
847 #ifdef G4DEBUG_TRANSPORT
848  // Checking first implementation of flagging Last Step in Volume
851 
852  if( ! (exiting || entering) )
853  {
854  G4cout << " Transport> : Proposed isLastStep= " << isLastStep
855  << " Exiting " << fLinearNavigator->ExitedMotherVolume()
856  << " Entering " << fLinearNavigator->EnteredDaughterVolume()
857  << " Track position : " << track.GetPosition() /nanometer << " [nm]"
858  << G4endl;
859  G4cout << " Track position : " << track.GetPosition() /nanometer << G4endl;
860  }
861 #endif
862  }
863  else // fGeometryLimitedStep is false
864  {
865  // This serves only to move the Navigator's location
866  //
868 
869  // The value of the track's current Touchable is retained.
870  // (and it must be correct because we must use it below to
871  // overwrite the (unset) one in particle change)
872  // It must be fCurrentTouchable too ??
873  //
875  retCurrentTouchable = track.GetTouchableHandle() ;
876 
877  isLastStep= false;
878 #ifdef G4DEBUG_TRANSPORT
879  // Checking first implementation of flagging Last Step in Volume
880  G4cout << " Transport> Proposed isLastStep= " << isLastStep
881  << " Geometry did not limit step. Position : "
882  << track.GetPosition()/ nanometer << G4endl;
883 #endif
884  } // endif ( fGeometryLimitedStep )
885 
887 
888  const G4VPhysicalVolume* pNewVol = retCurrentTouchable->GetVolume() ;
889  const G4Material* pNewMaterial = 0 ;
890  const G4VSensitiveDetector* pNewSensitiveDetector = 0 ;
891 
892  if( pNewVol != 0 )
893  {
894  pNewMaterial= pNewVol->GetLogicalVolume()->GetMaterial();
895  pNewSensitiveDetector= pNewVol->GetLogicalVolume()->GetSensitiveDetector();
896  }
897 
898  // ( <const_cast> pNewMaterial ) ;
899  // ( <const_cast> pNewSensitiveDetector) ;
900 
903 
904  const G4MaterialCutsCouple* pNewMaterialCutsCouple = 0;
905  if( pNewVol != 0 )
906  {
907  pNewMaterialCutsCouple=pNewVol->GetLogicalVolume()->GetMaterialCutsCouple();
908  }
909 
910  if( pNewVol!=0 && pNewMaterialCutsCouple!=0 && pNewMaterialCutsCouple->GetMaterial()!=pNewMaterial )
911  {
912  // for parametrized volume
913  //
914  pNewMaterialCutsCouple =
916  ->GetMaterialCutsCouple(pNewMaterial,
917  pNewMaterialCutsCouple->GetProductionCuts());
918  }
919  fParticleChange.SetMaterialCutsCoupleInTouchable( pNewMaterialCutsCouple );
920 
921  // temporarily until Get/Set Material of ParticleChange,
922  // and StepPoint can be made const.
923  // Set the touchable in ParticleChange
924  // this must always be done because the particle change always
925  // uses this value to overwrite the current touchable pointer.
926  //
927  fParticleChange.SetTouchableHandle(retCurrentTouchable) ;
928 
929  return &fParticleChange ;
930 }
void SetMaterialInTouchable(G4Material *fMaterial)
void SetTouchableHandle(const G4TouchableHandle &fTouchable)
G4ParticleChangeForTransport fParticleChange
void SetMaterialCutsCoupleInTouchable(const G4MaterialCutsCouple *fMaterialCutsCouple)
std::ostringstream G4ExceptionDescription
Definition: globals.hh:76
G4Material * GetMaterial() const
const G4ThreeVector & GetPosition() const
G4TrackStatus GetTrackStatus() const
virtual void LocateGlobalPointWithinVolume(const G4ThreeVector &position)
#define State(theXInfo)
G4bool ExitedMotherVolume() const
G4ITNavigator * fLinearNavigator
int nanometer
Definition: hepunit.py:35
virtual void Initialize(const G4Track &)
void SetGeometricallyLimitedStep()
G4GLOB_DLL std::ostream G4cout
bool G4bool
Definition: G4Types.hh:79
G4int GetTrackID() const
const G4TouchableHandle & GetTouchableHandle() const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
static G4ProductionCutsTable * GetProductionCutsTable()
const G4ThreeVector & GetMomentumDirection() const
G4LogicalVolume * GetLogicalVolume() const
const G4MaterialCutsCouple * GetMaterialCutsCouple(G4int i) const
void SetSensitiveDetectorInTouchable(G4VSensitiveDetector *fSensitiveDetector)
virtual G4VPhysicalVolume * GetVolume(G4int depth=0) const
Definition: G4VTouchable.cc:44
G4bool EnteredDaughterVolume() const
#define G4endl
Definition: G4ios.hh:61
void ProposeLastStepInVolume(G4bool flag)
const G4MaterialCutsCouple * GetMaterialCutsCouple() const
void ProposeTrackStatus(G4TrackStatus status)
G4ProductionCuts * GetProductionCuts() const
G4VSensitiveDetector * GetSensitiveDetector() const
const G4Material * GetMaterial() const
G4double G4ITTransportation::PostStepGetPhysicalInteractionLength ( const G4Track ,
G4double  ,
G4ForceCondition pForceCond 
)
virtual

Implements G4VProcess.

Definition at line 764 of file G4ITTransportation.cc.

References DBL_MAX, and Forced.

769 {
770  *pForceCond = Forced ;
771  return DBL_MAX ; // was kInfinity ; but convention now is DBL_MAX
772 }
#define DBL_MAX
Definition: templates.hh:83
void G4ITTransportation::ResetKilledStatistics ( G4int  report = 1)
inline
void G4ITTransportation::SetInstantiateProcessState ( G4bool  flag)
inlineprotected

Definition at line 236 of file G4ITTransportation.hh.

Referenced by G4ITTransportation(), and G4DNABrownianTransportation::StartTracking().

237  { fInstantiateProcessState = flag; }
void G4ITTransportation::SetPropagatorInField ( G4PropagatorInField pFieldPropagator)
void G4ITTransportation::SetThresholdImportantEnergy ( G4double  newEnImp)
inline
void G4ITTransportation::SetThresholdTrials ( G4int  newMaxTrials)
inline
void G4ITTransportation::SetThresholdWarningEnergy ( G4double  newEnWarn)
inline
void G4ITTransportation::SetVerboseLevel ( G4int  verboseLevel)
inline
void G4ITTransportation::StartTracking ( G4Track aTrack)
virtual

Reimplemented from G4VITProcess.

Reimplemented in G4DNABrownianTransportation.

Definition at line 936 of file G4ITTransportation.cc.

References G4PropagatorInField::ClearPropagatorState(), DoesGlobalFieldExist(), fFieldPropagator, G4VITProcess::fpState, G4ThreadLocal, G4FieldManagerStore::GetInstance(), G4Track::GetTouchableHandle(), G4VITProcess::StartTracking(), G4VProcess::StartTracking(), and State.

Referenced by G4DNABrownianTransportation::StartTracking().

937 {
939  if(fInstantiateProcessState)
940  G4VITProcess::fpState = new G4ITTransportationState();
941  // Will set in the same time fTransportationState
942 
943  // The actions here are those that were taken in AlongStepGPIL
944  // when track.GetCurrentStepNumber()==1
945 
946  // reset safety value and center
947  //
948  // State(fPreviousSafety) = 0.0 ;
949  // State(fPreviousSftOrigin) = G4ThreeVector(0.,0.,0.) ;
950 
951  // reset looping counter -- for motion in field
952  // State(fNoLooperTrials)= 0;
953  // Must clear this state .. else it depends on last track's value
954  // --> a better solution would set this from state of suspended track TODO ?
955  // Was if( aTrack->GetCurrentStepNumber()==1 ) { .. }
956 
957  // ChordFinder reset internal state
958  //
959  if( DoesGlobalFieldExist() )
960  {
962  // Resets all state of field propagator class (ONLY)
963  // including safety values (in case of overlaps and to wipe for first track).
964 
965  // G4ChordFinder* chordF= fFieldPropagator->GetChordFinder();
966  // if( chordF ) chordF->ResetStepEstimate();
967  }
968 
969  // Make sure to clear the chord finders of all fields (ie managers)
970  static G4ThreadLocal G4FieldManagerStore* fieldMgrStore = 0 ; if (!fieldMgrStore) fieldMgrStore= G4FieldManagerStore::GetInstance();
971  fieldMgrStore->ClearAllChordFindersState();
972 
973  // Update the current touchable handle (from the track's)
974  //
975  State(fCurrentTouchableHandle) = track->GetTouchableHandle();
976 
978 }
G4ProcessState * fpState
#define G4ThreadLocal
Definition: tls.hh:52
#define State(theXInfo)
virtual void StartTracking(G4Track *)
Definition: G4VProcess.cc:101
G4PropagatorInField * fFieldPropagator
virtual void StartTracking(G4Track *)
Definition: G4VITProcess.cc:83
static G4FieldManagerStore * GetInstance()

Field Documentation

G4PropagatorInField* G4ITTransportation::fFieldPropagator
protected
G4ITNavigator* G4ITTransportation::fLinearNavigator
protected
G4double G4ITTransportation::fMaxEnergyKilled
protected

Definition at line 223 of file G4ITTransportation.hh.

Referenced by AlongStepDoIt(), G4ITTransportation(), and ~G4ITTransportation().

G4ParticleChangeForTransport G4ITTransportation::fParticleChange
protected
G4SafetyHelper* G4ITTransportation::fpSafetyHelper
protected
G4bool G4ITTransportation::fShortStepOptimisation
protected
G4double G4ITTransportation::fSumEnergyKilled
protected

Definition at line 222 of file G4ITTransportation.hh.

Referenced by AlongStepDoIt(), G4ITTransportation(), and ~G4ITTransportation().

G4double G4ITTransportation::fThreshold_Important_Energy
protected

Definition at line 213 of file G4ITTransportation.hh.

Referenced by AlongStepDoIt(), and G4ITTransportation().

G4double G4ITTransportation::fThreshold_Warning_Energy
protected

Definition at line 212 of file G4ITTransportation.hh.

Referenced by AlongStepDoIt(), and G4ITTransportation().

G4int G4ITTransportation::fThresholdTrials
protected

Definition at line 214 of file G4ITTransportation.hh.

Referenced by AlongStepDoIt(), and G4ITTransportation().

G4ITTransportationState* const& G4ITTransportation::fTransportationState
protected

Definition at line 196 of file G4ITTransportation.hh.

G4double G4ITTransportation::fUnimportant_Energy
protected

Definition at line 217 of file G4ITTransportation.hh.

Referenced by G4ITTransportation().

G4int G4ITTransportation::fVerboseLevel
protected

The documentation for this class was generated from the following files: