| [831] | 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 | //
|
|---|
| 28 | // $Id: G4MagHelicalStepper.hh,v 1.15 2007/08/21 08:48:28 tnikitin Exp $
|
|---|
| [921] | 29 | // GEANT4 tag $Name: geant4-09-02-cand-01 $
|
|---|
| [831] | 30 | //
|
|---|
| 31 | //
|
|---|
| 32 | //
|
|---|
| 33 | // class G4MagHelicalStepper
|
|---|
| 34 | //
|
|---|
| 35 | // Class description:
|
|---|
| 36 | //
|
|---|
| 37 | // Abstract base class for integrator of particle's equation of motion,
|
|---|
| 38 | // used in tracking in space dependent magnetic field
|
|---|
| 39 |
|
|---|
| 40 | // History:
|
|---|
| 41 | // - 05.11.98 J.Apostolakis Creation of new ABC
|
|---|
| 42 | // --------------------------------------------------------------------
|
|---|
| 43 |
|
|---|
| 44 | #ifndef G4MagHelicalStepper_hh
|
|---|
| 45 | #define G4MagHelicalStepper_hh
|
|---|
| 46 |
|
|---|
| 47 | #include "G4Types.hh"
|
|---|
| 48 | #include "G4MagIntegratorStepper.hh"
|
|---|
| 49 | #include "G4Mag_EqRhs.hh"
|
|---|
| 50 | #include "G4ThreeVector.hh"
|
|---|
| 51 |
|
|---|
| 52 | class G4MagHelicalStepper : public G4MagIntegratorStepper
|
|---|
| 53 | {
|
|---|
| 54 | public: // with description
|
|---|
| 55 |
|
|---|
| 56 | G4MagHelicalStepper(G4Mag_EqRhs *EqRhs);
|
|---|
| 57 | virtual ~G4MagHelicalStepper();
|
|---|
| 58 |
|
|---|
| 59 | virtual void Stepper( const G4double y[], // VIRTUAL for ExactHelix - temporary
|
|---|
| 60 | const G4double dydx[],
|
|---|
| 61 | G4double h,
|
|---|
| 62 | G4double yout[],
|
|---|
| 63 | G4double yerr[] );
|
|---|
| 64 | // The stepper for the Runge Kutta integration.
|
|---|
| 65 | // The stepsize is fixed, equal to h.
|
|---|
| 66 | // Integrates ODE starting values y[0 to 6]
|
|---|
| 67 | // Outputs yout[] and its estimated error yerr[].
|
|---|
| 68 |
|
|---|
| 69 | virtual void DumbStepper( const G4double y[],
|
|---|
| 70 | G4ThreeVector Bfld,
|
|---|
| 71 | G4double h,
|
|---|
| 72 | G4double yout[] ) = 0;
|
|---|
| 73 | // Performs a 'dump' Step without error calculation.
|
|---|
| 74 |
|
|---|
| 75 | G4double DistChord()const ;
|
|---|
| 76 | // Estimate maximum distance of curved solution and chord ...
|
|---|
| 77 |
|
|---|
| 78 | protected: // with description
|
|---|
| 79 |
|
|---|
| 80 | inline void LinearStep( const G4double yIn[],
|
|---|
| 81 | G4double h,
|
|---|
| 82 | G4double yHelix[]) const;
|
|---|
| 83 | // A linear Step in regions without magnetic field.
|
|---|
| 84 |
|
|---|
| 85 | void AdvanceHelix( const G4double yIn[],
|
|---|
| 86 | G4ThreeVector Bfld,
|
|---|
| 87 | G4double h,
|
|---|
| 88 | G4double yHelix[],G4double yHelix2[]=0); // output
|
|---|
| 89 | // A first order Step along a helix inside the field.
|
|---|
| 90 |
|
|---|
| 91 | inline void MagFieldEvaluate( const G4double y[], G4ThreeVector& Bfield );
|
|---|
| 92 | // Evaluate the field at a certain point.
|
|---|
| 93 |
|
|---|
| 94 |
|
|---|
| 95 | inline G4double GetInverseCurve( const G4double Momentum, const G4double Bmag );
|
|---|
| 96 | // Evaluate Inverse of Curvature of Track
|
|---|
| 97 |
|
|---|
| 98 | // Store and use the parameters of track :
|
|---|
| 99 | // Radius of curve, Stepping angle, Radius of projected helix
|
|---|
| 100 | inline void SetAngCurve(const G4double Ang);
|
|---|
| 101 | inline G4double GetAngCurve()const;
|
|---|
| 102 |
|
|---|
| 103 | inline void SetCurve(const G4double Curve);
|
|---|
| 104 | inline G4double GetCurve()const;
|
|---|
| 105 |
|
|---|
| 106 | inline void SetRadHelix(const G4double Rad);
|
|---|
| 107 | inline G4double GetRadHelix()const;
|
|---|
| 108 |
|
|---|
| 109 |
|
|---|
| 110 | protected: // without description
|
|---|
| 111 |
|
|---|
| 112 | // void MagFieldEvaluate( const G4double y[], G4double B[] )
|
|---|
| 113 | // { GetEquationOfMotion()-> GetFieldValue(y, B); }
|
|---|
| 114 |
|
|---|
| 115 | private:
|
|---|
| 116 |
|
|---|
| 117 | G4MagHelicalStepper(const G4MagHelicalStepper&);
|
|---|
| 118 | G4MagHelicalStepper& operator=(const G4MagHelicalStepper&);
|
|---|
| 119 | // Private copy constructor and assignment operator.
|
|---|
| 120 |
|
|---|
| 121 | static const G4double fUnitConstant; // As in G4Mag_EqRhs.hh/cc where it is not used.
|
|---|
| 122 | private:
|
|---|
| 123 |
|
|---|
| 124 | G4Mag_EqRhs* fPtrMagEqOfMot;
|
|---|
| 125 |
|
|---|
| 126 | // Data stored in order to find the chord.
|
|---|
| 127 | G4double fAngCurve;
|
|---|
| 128 | G4double frCurve;
|
|---|
| 129 | G4double frHelix;
|
|---|
| 130 | // Data stored in order to find the chord.
|
|---|
| 131 | G4ThreeVector yInitial, yMidPoint, yFinal;
|
|---|
| 132 |
|
|---|
| 133 |
|
|---|
| 134 | };
|
|---|
| 135 |
|
|---|
| 136 | #include "G4MagHelicalStepper.icc"
|
|---|
| 137 |
|
|---|
| 138 | #endif /* G4MagHelicalStepper_hh */
|
|---|