12.07.2015 Views

Geant4 User's Guide for Application Developers - Geant4 - CERN

Geant4 User's Guide for Application Developers - Geant4 - CERN

Geant4 User's Guide for Application Developers - Geant4 - CERN

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Detector Definition and ResponseThus the accuracy of the position of the track after a number of boundary crossings is directly proportional to thenumber of boundaries.4.3.2.6. Reducing the number of field calls to speed-up simulationAn additional method to reduce the number of field evaluations is to utilise the new class G4CachedMagneticFieldclass. It is applicable only <strong>for</strong> pure magnetic fields which do not vary with time.G4MagneticField * pMagField; // Your field - Defined elsewhereG4doubledistanceConst = 2.5 * millimeter;G4MagneticField * pCachedMagField= new G4CachedMagneticField( pMagField, distanceConst);4.3.2.7. Choosing different accuracies <strong>for</strong> the same volumeIt is possible to create a FieldManager which has different properties <strong>for</strong> particles of different momenta (or dependingon other parameters of a track). This is useful, <strong>for</strong> example, in obtaining high accuracy <strong>for</strong> 'important'tracks (e.g. muons) and accept less accuracy in tracking others (e.g. electrons). To use this, you must create yourown field manager which uses the methodvoid ConfigureForTrack( const G4Track * );to configure itself using the parameters of the current track. An example of this will be available in examples/extended/field05.4.3.2.8. Parameters that must scale with problem sizeThe default settings of this module are <strong>for</strong> problems with the physical size of a typical high energy physics setup,that is, distances smaller than about one kilometer. A few parameters are necessary to carry this in<strong>for</strong>mationto the magnetic field module, and must typically be rescaled <strong>for</strong> problems of vastly different sizes in order toget reasonable per<strong>for</strong>mance and robustness. Two of these parameters are the maximum acceptable step and theminimum step size.The maximum acceptable step should be set to a distance larger than the biggest reasonable step. If the apparatusin a setup has a diameter of two meters, a likely maximum acceptable steplength would be 10 meters. A particlecould then take large spiral steps, but would not attempt to take, <strong>for</strong> example, a 1000-meter-long step in the caseof a very low-density material. Similarly, <strong>for</strong> problems of a planetary scale, such as the earth with its radius ofroughly 6400 km, a maximum acceptabe steplength of a few times this value would be reasonable.An upper limit <strong>for</strong> the size of a step is a parameter of G4PropagatorInField, and can be set by calling itsSetLargestAcceptableStep method.The minimum step size is used during integration to limit the amount of work in difficult cases. It is possible thatstrong fields or integration problems can <strong>for</strong>ce the integrator to try very small steps; this parameter stops themfrom becoming unnecessarily small.Trial steps smaller than this parameter will be treated with less accuracy, and may even be ignored, dependingon the situation.The minimum step size is a parameter of the MagInt_Driver, but can be set in the contstructor of G4ChordFinder,as in the source listing above.4.3.2.9. Known IssuesCurrently it is computationally expensive to change the miss distance to very small values, as it causes tracks tobe limited to curved sections whose 'bend' is smaller than this value. (The bend is the distance of the mid-point123

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!