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10.5 ] [ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

  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 // G4MagHelicalStepper
 27 //
 28 // Class description:
 29 //
 30 // Abstract base class for integrator of particle's equation of motion,
 31 // used in tracking in space dependent magnetic field
 32 //
 33 // It is used for a set of steppers which use the helix as a sort of
 34 // 'first order' solution.
 35 //   - Most obtain an error by breaking up the step in two
 36 //   - G4ExactHelicalStepper does not provide an error estimate
 37 
 38 // Created: J.Apostolakis, CERN - 05.11.1998
 39 // --------------------------------------------------------------------
 40 #ifndef G4MAGHELICALSTEPPER_HH
 41 #define G4MAGHELICALSTEPPER_HH
 42 
 43 #include <CLHEP/Units/PhysicalConstants.h>
 44 
 45 #include "G4Types.hh"
 46 #include "G4MagIntegratorStepper.hh"
 47 #include "G4Mag_EqRhs.hh"
 48 #include "G4ThreeVector.hh"
 49 
 50 class G4MagHelicalStepper : public G4MagIntegratorStepper
 51 {
 52   public:
 53 
 54     G4MagHelicalStepper(G4Mag_EqRhs *EqRhs);
 55    ~G4MagHelicalStepper() override;
 56   
 57     G4MagHelicalStepper(const G4MagHelicalStepper&) = delete;
 58     G4MagHelicalStepper& operator=(const G4MagHelicalStepper&) = delete;
 59  
 60     void Stepper( const G4double y[], // VIRTUAL for ExactHelix
 61                   const G4double dydx[],
 62                         G4double h,
 63                         G4double yout[],
 64                         G4double yerr[] ) override;
 65       // The stepper for the Runge Kutta integration.
 66       // The stepsize is fixed, equal to h.
 67       // Integrates ODE starting values y[0 to 6]
 68       // Outputs yout[] and its estimated error yerr[].
 69   
 70     virtual  void DumbStepper( const G4double y[],
 71                                      G4ThreeVector Bfld,
 72                                      G4double h,
 73                                      G4double yout[] ) = 0;
 74       // Performs a 'dump' Step without error calculation.
 75   
 76     G4double DistChord()const override ;
 77       // Estimate maximum distance of curved solution and chord ... 
 78 
 79   protected:
 80 
 81     inline void LinearStep( const G4double yIn[],
 82                                   G4double h,
 83                                   G4double yHelix[]) const;
 84       // A linear Step in regions without magnetic field.
 85 
 86     void AdvanceHelix( const G4double yIn[],
 87                        const G4ThreeVector& Bfld,
 88                              G4double h,
 89                              G4double yHelix[], G4double yHelix2[] = nullptr);
 90       // A first order Step along a helix inside the field.
 91 
 92     inline void MagFieldEvaluate( const G4double y[], G4ThreeVector& Bfield );
 93       // Evaluate the field at a certain point.
 94   
 95     inline G4double GetInverseCurve( const G4double Momentum,
 96                                      const G4double Bmag );
 97       // Evaluate Inverse of Curvature of Track
 98 
 99     // Store and use the parameters of track : 
100     // radius of curve, Stepping angle, Radius of projected helix
101 
102     inline void SetAngCurve(const G4double Ang);
103     inline G4double GetAngCurve()const;
104 
105     inline void SetCurve(const G4double Curve);
106     inline G4double GetCurve()const;
107 
108     inline void SetRadHelix(const G4double Rad);
109     inline G4double GetRadHelix()const;
110 
111   private:
112 
113     static const G4double fUnitConstant;
114       // As in G4Mag_EqRhs.hh/cc where it is not used.
115 
116     G4Mag_EqRhs* fPtrMagEqOfMot = nullptr;
117  
118     // Data stored in order to find the chord
119     //
120     G4double fAngCurve = 0.0;
121     G4double frCurve = 0.0;
122     G4double frHelix = 0.0;
123     G4ThreeVector yInitial, yMidPoint, yFinal;
124 };
125 
126 #include  "G4MagHelicalStepper.icc"
127 
128 #endif
129