G4PropagatorInField.icc

Go to the documentation of this file.
00001 //
00002 // ********************************************************************
00003 // * License and Disclaimer                                           *
00004 // *                                                                  *
00005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
00006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
00007 // * conditions of the Geant4 Software License,  included in the file *
00008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
00009 // * include a list of copyright holders.                             *
00010 // *                                                                  *
00011 // * Neither the authors of this software system, nor their employing *
00012 // * institutes,nor the agencies providing financial support for this *
00013 // * work  make  any representation or  warranty, express or implied, *
00014 // * regarding  this  software system or assume any liability for its *
00015 // * use.  Please see the license in the file  LICENSE  and URL above *
00016 // * for the full disclaimer and the limitation of liability.         *
00017 // *                                                                  *
00018 // * This  code  implementation is the result of  the  scientific and *
00019 // * technical work of the GEANT4 collaboration.                      *
00020 // * By using,  copying,  modifying or  distributing the software (or *
00021 // * any work based  on the software)  you  agree  to acknowledge its *
00022 // * use  in  resulting  scientific  publications,  and indicate your *
00023 // * acceptance of all terms of the Geant4 Software license.          *
00024 // ********************************************************************
00025 //
00026 //
00027 // $Id$
00028 //
00029 // 
00030 // ------------------------------------------------------------------------
00031 //  GEANT 4  inline implementation
00032 //
00033 // ------------------------------------------------------------------------
00034 // 
00035 // 25.10.96 John Apostolakis, design and implementation 
00036 // 25.03.97 John Apostolakis, adaptation for G4Transportation and cleanup
00037 //
00038 //  To create an object of this type, must have:
00039 //  - an object that calculates the Curved paths 
00040 //  - the navigator to find (linear) intersections
00041 //  - and ?? also must know the value of the maximum displacement allowed
00042 // ------------------------------------------------------------------------
00043 
00044 inline
00045 G4ChordFinder* G4PropagatorInField::GetChordFinder()
00046 {
00047   // The "Chord Finder" of the current Field Mgr is used
00048   //    -- this could be of the global field manager
00049   //        or that of another, from the current volume 
00050   return fCurrentFieldMgr->GetChordFinder(); 
00051 }
00052 
00053 inline
00054 void G4PropagatorInField::SetChargeMomentumMass( 
00055             G4double Charge,            // in e+ units
00056             G4double Momentum,          // in GeV/c 
00057             G4double Mass)              // in ? units
00058 {
00059   // GetChordFinder()->SetChargeMomentumMass(Charge, Momentum, Mass);
00060   //  --> Not needed anymore, as it is done in ComputeStep for the 
00061   //       ChordFinder of the current step (which is known only then).
00062   fCharge = Charge;
00063   fInitialMomentumModulus = Momentum;
00064   fMass = Mass; 
00065 }
00066 
00067 //  Obtain the final space-point and velocity (normal) at the end of the Step
00068 //
00069 inline
00070 G4ThreeVector  G4PropagatorInField::EndPosition() const
00071 {
00072   return   End_PointAndTangent.GetPosition(); 
00073 }
00074 
00075 inline
00076 G4ThreeVector  G4PropagatorInField::EndMomentumDir() const
00077 {
00078   return   End_PointAndTangent.GetMomentumDir(); 
00079 }
00080 
00081 inline
00082 G4double G4PropagatorInField::GetEpsilonStep() const
00083 { 
00084   return fEpsilonStep; 
00085 }
00086 
00087 inline
00088 void     G4PropagatorInField::SetEpsilonStep( G4double newEps )
00089 {
00090   fEpsilonStep=newEps;
00091 }
00092 
00093 inline
00094 G4bool   G4PropagatorInField::IsParticleLooping() const
00095 {
00096   return fParticleIsLooping;
00097 }
00098 
00099 inline
00100 G4int    G4PropagatorInField::GetMaxLoopCount() const
00101 {
00102   return fMax_loop_count;
00103 }
00104 
00105 inline
00106 void     G4PropagatorInField::SetMaxLoopCount( G4int new_max ) 
00107 {
00108   fMax_loop_count = new_max;
00109 }
00110 
00111 // #if 0
00112 inline
00113 G4double G4PropagatorInField::GetDeltaIntersection() const
00114 {
00115   return fCurrentFieldMgr->GetDeltaIntersection();
00116 } 
00117 
00118 inline
00119 G4double G4PropagatorInField::GetDeltaOneStep() const
00120 {
00121   return fCurrentFieldMgr->GetDeltaOneStep();
00122 }
00123 // #endif 
00124 
00125 inline
00126 G4int G4PropagatorInField::GetVerboseLevel() const
00127 {
00128   return fVerboseLevel;
00129 }
00130 inline
00131 G4int G4PropagatorInField::Verbose() const     // Obsolete
00132 {
00133   return GetVerboseLevel();
00134 }
00135 
00136 inline
00137 G4FieldTrack G4PropagatorInField::GetEndState() const
00138 {
00139   return End_PointAndTangent;
00140 }
00141 
00142 // Minimum for Relative accuracy of a Step in volumes of global field
00143 inline 
00144 G4double  G4PropagatorInField::GetMinimumEpsilonStep() const
00145 {
00146   return fDetectorFieldMgr->GetMinimumEpsilonStep();
00147 }
00148 
00149 inline 
00150 void      G4PropagatorInField::SetMinimumEpsilonStep( G4double newEpsMin )
00151 {
00152   fDetectorFieldMgr->SetMinimumEpsilonStep(newEpsMin);
00153 }
00154 
00155 // Maximum for Relative accuracy of any Step 
00156 inline 
00157 G4double  G4PropagatorInField::GetMaximumEpsilonStep() const
00158 {
00159   return fDetectorFieldMgr->GetMaximumEpsilonStep();
00160 }
00161 
00162 inline 
00163 void      G4PropagatorInField::SetMaximumEpsilonStep( G4double newEpsMax )
00164 {
00165   fDetectorFieldMgr->SetMaximumEpsilonStep( newEpsMax );
00166 }
00167 
00168 inline
00169 void G4PropagatorInField::SetLargestAcceptableStep( G4double newBigDist )
00170 {
00171   if( fLargestAcceptableStep>0.0 )
00172   {
00173     fLargestAcceptableStep = newBigDist;
00174   }
00175 }
00176 
00177 inline
00178 G4double  G4PropagatorInField::GetLargestAcceptableStep()
00179 {
00180   return fLargestAcceptableStep;
00181 }
00182 
00183 inline
00184 G4FieldManager*  G4PropagatorInField::GetCurrentFieldManager()
00185 {
00186   return fCurrentFieldMgr;
00187 } 
00188 
00189 inline
00190 void G4PropagatorInField::SetThresholdNoZeroStep( G4int noAct,
00191                                                   G4int noHarsh,
00192                                                   G4int noAbandon )
00193 {
00194   if( noAct>0 ) 
00195     fActionThreshold_NoZeroSteps = noAct; 
00196 
00197   if( noHarsh > fActionThreshold_NoZeroSteps )
00198     fSevereActionThreshold_NoZeroSteps = noHarsh; 
00199   else
00200     fSevereActionThreshold_NoZeroSteps = 2*(fActionThreshold_NoZeroSteps+1);
00201 
00202   if( noAbandon > fSevereActionThreshold_NoZeroSteps+5 )
00203     fAbandonThreshold_NoZeroSteps = noAbandon; 
00204   else
00205     fAbandonThreshold_NoZeroSteps = 2*(fSevereActionThreshold_NoZeroSteps+3); 
00206 }
00207 
00208 inline
00209 G4int G4PropagatorInField::GetThresholdNoZeroSteps( G4int i )
00210 {
00211    G4int t=0;
00212    if( i==0 )     { t = 3; }     // No of parameters
00213    else if (i==1) { t = fActionThreshold_NoZeroSteps; }
00214    else if (i==2) { t = fSevereActionThreshold_NoZeroSteps; }
00215    else if (i==3) { t = fAbandonThreshold_NoZeroSteps; }
00216 
00217    return t;
00218 }
00219 
00220 inline G4double  G4PropagatorInField::GetZeroStepThreshold(){ return fZeroStepThreshold; }
00221 inline void      G4PropagatorInField::SetZeroStepThreshold( G4double newLength )
00222 { 
00223   fZeroStepThreshold= newLength;
00224 }
00225 
00226 inline
00227 void G4PropagatorInField::SetDetectorFieldManager(G4FieldManager* newDetectorFieldManager)
00228 {
00229    fDetectorFieldMgr = newDetectorFieldManager; 
00230 }
00231 
00232   
00233 inline
00234 void  G4PropagatorInField:: SetUseSafetyForOptimization( G4bool value )
00235 {
00236    fUseSafetyForOptimisation= value;
00237 }
00238 
00239 inline 
00240 G4bool G4PropagatorInField::GetUseSafetyForOptimization() 
00241 { 
00242    return fUseSafetyForOptimisation; 
00243 }
00244 
00245 inline 
00246 void G4PropagatorInField::
00247 SetNavigatorForPropagating( G4Navigator *SimpleOrMultiNavigator )
00248 {
00249   if(SimpleOrMultiNavigator)  { 
00250      fNavigator= SimpleOrMultiNavigator; 
00251      if( fIntersectionLocator ) {
00252          fIntersectionLocator->SetNavigatorFor( SimpleOrMultiNavigator );
00253      }
00254   }
00255 }
00256 
00257 inline
00258 G4Navigator* G4PropagatorInField::GetNavigatorForPropagating()
00259 {
00260   return fNavigator;
00261 } 
00262 
00263 inline 
00264 void G4PropagatorInField::
00265 SetIntersectionLocator( G4VIntersectionLocator *pIntLoc )
00266 {
00267   if(pIntLoc)  { fIntersectionLocator= pIntLoc; }
00268 }
00269 
00270 inline
00271 G4VIntersectionLocator* G4PropagatorInField::GetIntersectionLocator()
00272 {
00273   return fIntersectionLocator;
00274 } 
00275 
00276 inline
00277 G4bool G4PropagatorInField::IntersectChord( const G4ThreeVector&  StartPointA,
00278                                             const G4ThreeVector&  EndPointB,
00279                                             G4double      &NewSafety,
00280                                             G4double      &LinearStepLength,
00281                                             G4ThreeVector &IntersectionPoint )
00282 {
00283   // Calculate the direction and length of the chord AB
00284   //
00285   return fIntersectionLocator
00286          ->IntersectChord(StartPointA,EndPointB,NewSafety,
00287                           fPreviousSafety,fPreviousSftOrigin,
00288                           LinearStepLength,IntersectionPoint);
00289 }
00290 

Generated on Mon May 27 17:49:26 2013 for Geant4 by  doxygen 1.4.7