source: trunk/source/processes/transportation/include/G4CoupledTransportation.hh @ 847

Last change on this file since 847 was 819, checked in by garnier, 16 years ago

import all except CVS

File size: 8.9 KB
Line 
1//
2// ********************************************************************
3// * License and Disclaimer                                           *
4// *                                                                  *
5// * The  Geant4 software  is  copyright of the Copyright Holders  of *
6// * the Geant4 Collaboration.  It is provided  under  the terms  and *
7// * conditions of the Geant4 Software License,  included in the file *
8// * LICENSE and available at  http://cern.ch/geant4/license .  These *
9// * include a list of copyright holders.                             *
10// *                                                                  *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work  make  any representation or  warranty, express or implied, *
14// * regarding  this  software system or assume any liability for its *
15// * use.  Please see the license in the file  LICENSE  and URL above *
16// * for the full disclaimer and the limitation of liability.         *
17// *                                                                  *
18// * This  code  implementation is the result of  the  scientific and *
19// * technical work of the GEANT4 collaboration.                      *
20// * By using,  copying,  modifying or  distributing the software (or *
21// * any work based  on the software)  you  agree  to acknowledge its *
22// * use  in  resulting  scientific  publications,  and indicate your *
23// * acceptance of all terms of the Geant4 Software license.          *
24// ********************************************************************
25//
26//
27// $Id: G4CoupledTransportation.hh,v 1.6 2007/05/29 13:50:14 japost Exp $
28// GEANT4 tag $Name:  $
29//
30//
31// ------------------------------------------------------------
32//        GEANT 4  include file implementation
33// ------------------------------------------------------------
34//
35// Class description:
36//
37// G4CoupledTransportation is an optional process to transport 
38// a particle, in case of coupled navigation in parallel geometries
39//  i.e. the geometrical propagation will be done
40//   encountering the geometrical volumes of the detectors and
41//   those of parallel geometries (eg for biasing, scoring, fast simulation)
42// It is tasked with updating the "safety" to reflect the geometrical
43//   distance to the nearest volume, and the time of flight of the particle.
44
45// =======================================================================
46// Created:  17 May 2006, J. Apostolakis
47// =======================================================================
48#ifndef G4CoupledTransportation_hh
49#define G4CoupledTransportation_hh 1
50
51#include "G4VProcess.hh"
52
53#include "G4FieldManager.hh"
54
55#include "G4Navigator.hh"
56#include "G4TransportationManager.hh"
57#include "G4PropagatorInField.hh"
58#include "G4PathFinder.hh"
59
60#include "G4Track.hh"
61#include "G4Step.hh"
62#include "G4ParticleChangeForTransport.hh"
63
64class G4CoupledTransportation : public G4VProcess
65{
66  // Concrete class that does the geometrical transport
67
68  public:  // with description
69
70     G4CoupledTransportation( G4int verbosityLevel= 0); 
71     ~G4CoupledTransportation(); 
72
73     G4double      AlongStepGetPhysicalInteractionLength(
74                             const G4Track& track,
75                                   G4double  previousStepSize,
76                                   G4double  currentMinimumStep, 
77                                   G4double& currentSafety,
78                                   G4GPILSelection* selection
79                            );
80
81     G4VParticleChange* AlongStepDoIt(
82                             const G4Track& track,
83                             const G4Step& stepData
84                            );
85
86     G4VParticleChange* PostStepDoIt(
87                             const G4Track& track,
88                             const G4Step&  stepData
89                            );
90       // Responsible for the relocation.
91
92     G4double PostStepGetPhysicalInteractionLength(
93                             const G4Track& ,
94                             G4double   previousStepSize,
95                             G4ForceCondition* pForceCond
96                            );
97       // Forces the PostStepDoIt action to be called,
98       // but does not limit the step.
99
100     G4PropagatorInField* GetPropagatorInField();
101     void SetPropagatorInField( G4PropagatorInField* pFieldPropagator);
102       // Access/set the assistant class that Propagate in a Field.
103
104     inline void   SetVerboseLevel( G4int verboseLevel );
105     inline G4int  GetVerboseLevel() const;
106       // Level of warnings regarding eg energy conservation
107       // in field integration.
108
109     inline G4double GetThresholdWarningEnergy() const; 
110     inline G4double GetThresholdImportantEnergy() const; 
111     inline G4int GetThresholdTrials() const; 
112
113     inline void SetThresholdWarningEnergy( G4double newEnWarn ); 
114     inline void SetThresholdImportantEnergy( G4double newEnImp ); 
115     inline void SetThresholdTrials(G4int newMaxTrials ); 
116
117     // Get/Set parameters for killing loopers:
118     //   Above 'important' energy a 'looping' particle in field will
119     //   *NOT* be abandoned, except after fThresholdTrials attempts.
120     // Below Warning energy, no verbosity for looping particles is issued
121
122     inline G4double GetMaxEnergyKilled() const; 
123     inline G4double GetSumEnergyKilled() const;
124     inline void ResetKilledStatistics( G4int report = 1);     
125     // Statistics for tracks killed (currently due to looping in field)
126
127  public:  // without description
128
129     void StartTracking(G4Track* aTrack); 
130
131     G4double AtRestGetPhysicalInteractionLength(
132                             const G4Track& ,
133                             G4ForceCondition* 
134                            ) { return -1.0; };
135       // No operation in  AtRestDoIt.
136
137     G4VParticleChange* AtRestDoIt(
138                             const G4Track& ,
139                             const G4Step&
140                            ) {return 0;};
141       // No operation in  AtRestDoIt.
142
143  protected:
144
145     G4bool               DoesGlobalFieldExist();
146       // Checks whether a field exists for the "global" field manager.
147
148     void ReportInexactEnergy(G4double startEnergy, G4double endEnergy);
149       // Issue warning
150
151  private:
152
153     G4Navigator*         fMassNavigator;
154       // The navigator for the 'mass' geometry (the real one, that physics occurs in)
155     G4PathFinder*        fPathFinder;
156     G4int fNavigatorId;
157       // The PathFinder used to transport the particle
158
159     G4PropagatorInField* fFieldPropagator;
160       // Still required in order to find/set the fieldmanager
161
162     G4bool fGlobalFieldExists; 
163     // G4bool fStartedNewTrack;   //  True for first step or restarted tracking
164                                   //    until first step's AlongStepGPIL
165
166     G4ThreeVector        fTransportEndPosition;
167     G4ThreeVector        fTransportEndMomentumDir;
168     G4double             fTransportEndKineticEnergy;
169     G4ThreeVector        fTransportEndSpin;
170     G4bool               fMomentumChanged;
171     G4bool               fEnergyChanged;
172       // The particle's state after this Step, Store for DoIt
173
174     G4bool               fEndGlobalTimeComputed; 
175     G4double             fCandidateEndGlobalTime;
176
177     G4bool               fParticleIsLooping;
178   
179     G4ThreeVector        fPreviousSftOrigin; 
180     G4double             fPreviousMassSafety;
181     G4double             fPreviousFullSafety;
182
183     G4TouchableHandle    fCurrentTouchableHandle;
184     
185     // G4bool         fFieldExists;
186       // Whether a magnetic field exists ...
187       // A data member for this is problematic: it is useful only if it
188       // can be initialised and updated -- and a scheme is not yet possible.
189
190     G4bool fMassGeometryLimitedStep;
191       // Flag to determine whether a 'mass' boundary was reached.
192     G4bool fAnyGeometryLimitedStep; 
193       // Did any geometry limit the step ?
194
195     G4ParticleChangeForTransport fParticleChange;
196       // New ParticleChange
197
198     G4double endpointDistance;
199
200
201  // Thresholds for looping particles:
202  //
203     G4double fThreshold_Warning_Energy;     //  Warn above this energy
204     G4double fThreshold_Important_Energy;   //  Hesitate above this
205     G4int    fThresholdTrials;              //    for this no of trials
206       // Above 'important' energy a 'looping' particle in field will
207       //   *NOT* be abandoned, except after fThresholdTrials attempts.
208     G4double fUnimportant_Energy;
209       //  Below this energy, no verbosity for looping particles is issued
210
211  // Counter for steps in which particle reports 'looping',
212  //   if it is above 'Important' Energy
213     G4int    fNoLooperTrials; 
214  // Statistics for tracks abandoned
215     G4double fSumEnergyKilled;
216     G4double fMaxEnergyKilled;
217
218  // Verbosity
219     G4int    fVerboseLevel;
220       // Verbosity level for warnings
221       // eg about energy non-conservation in magnetic field.
222};
223
224#include "G4CoupledTransportation.icc"
225
226#endif 
Note: See TracBrowser for help on using the repository browser.