[819] | 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: G4SynchrotronRadiation.hh,v 1.4 2006/06/29 19:55:43 gunter Exp $ |
---|
[1228] | 28 | // GEANT4 tag $Name: geant4-09-03 $ |
---|
[819] | 29 | // |
---|
| 30 | // ------------------------------------------------------------ |
---|
| 31 | // GEANT 4 class header file |
---|
| 32 | // CERN Geneva Switzerland |
---|
| 33 | // |
---|
| 34 | // |
---|
| 35 | // History: |
---|
| 36 | // 21-5-98 1 version , V. Grichine |
---|
| 37 | // 28-05-01, V.Ivanchenko minor changes to provide ANSI -wall compilation |
---|
| 38 | // 23-05-06, H. Burkhardt: Energy spectrum from function rather than table |
---|
| 39 | // |
---|
| 40 | // |
---|
| 41 | // ------------------------------------------------------------ |
---|
| 42 | |
---|
| 43 | #ifndef G4SynchrotronRadiation_h |
---|
| 44 | #define G4SynchrotronRadiation_h 1 |
---|
| 45 | |
---|
| 46 | #include "G4ios.hh" |
---|
| 47 | #include "globals.hh" |
---|
| 48 | #include "Randomize.hh" |
---|
| 49 | #include "G4VDiscreteProcess.hh" |
---|
| 50 | #include "G4TransportationManager.hh" |
---|
| 51 | #include "G4FieldManager.hh" |
---|
| 52 | #include "G4Field.hh" |
---|
| 53 | #include "G4ThreeVector.hh" |
---|
| 54 | #include "G4PropagatorInField.hh" |
---|
| 55 | |
---|
| 56 | #include "G4Track.hh" |
---|
| 57 | #include "G4Step.hh" |
---|
| 58 | |
---|
| 59 | #include "G4Gamma.hh" |
---|
| 60 | #include "G4Electron.hh" |
---|
| 61 | #include "G4Positron.hh" |
---|
| 62 | |
---|
| 63 | |
---|
| 64 | class G4SynchrotronRadiation : public G4VDiscreteProcess |
---|
| 65 | { |
---|
| 66 | public: |
---|
| 67 | |
---|
| 68 | G4SynchrotronRadiation(const G4String& pName = "SynRad", |
---|
| 69 | G4ProcessType type = fElectromagnetic); |
---|
| 70 | |
---|
| 71 | virtual ~G4SynchrotronRadiation(); |
---|
| 72 | |
---|
| 73 | G4double GetMeanFreePath( const G4Track& track, |
---|
| 74 | G4double previousStepSize, |
---|
| 75 | G4ForceCondition* condition ); |
---|
| 76 | |
---|
| 77 | G4VParticleChange *PostStepDoIt( const G4Track& track, |
---|
| 78 | const G4Step& Step ); |
---|
| 79 | |
---|
| 80 | G4double GetPhotonEnergy( const G4Track& trackData, |
---|
| 81 | const G4Step& stepData ); |
---|
| 82 | |
---|
| 83 | G4double GetRandomEnergySR( G4double, G4double ); |
---|
| 84 | |
---|
| 85 | G4double InvSynFracInt(G4double x); |
---|
| 86 | G4double Chebyshev(G4double a,G4double b,const G4double c[],G4int m,G4double x); |
---|
| 87 | G4bool IsApplicable(const G4ParticleDefinition&); |
---|
| 88 | void BuildPhysicsTable(const G4ParticleDefinition& ); |
---|
| 89 | void PrintInfoDefinition(); |
---|
| 90 | |
---|
| 91 | private: |
---|
| 92 | |
---|
| 93 | G4SynchrotronRadiation & operator=(const G4SynchrotronRadiation &right); |
---|
| 94 | G4SynchrotronRadiation(const G4SynchrotronRadiation&); |
---|
| 95 | |
---|
| 96 | G4ParticleDefinition* theGamma; |
---|
| 97 | const G4ParticleDefinition* theElectron; |
---|
| 98 | const G4ParticleDefinition* thePositron; |
---|
| 99 | |
---|
| 100 | G4double fLambdaConst; |
---|
| 101 | G4double fEnergyConst; |
---|
| 102 | |
---|
| 103 | G4PropagatorInField* fFieldPropagator; |
---|
| 104 | |
---|
| 105 | }; |
---|
| 106 | |
---|
| 107 | ////////////////////////// INLINE METHODS ///////////////////////////// |
---|
| 108 | inline G4bool |
---|
| 109 | G4SynchrotronRadiation::IsApplicable( const G4ParticleDefinition& particle ) |
---|
| 110 | { |
---|
| 111 | |
---|
| 112 | return ( ( &particle == (const G4ParticleDefinition *)theElectron ) || |
---|
| 113 | ( &particle == (const G4ParticleDefinition *)thePositron ) ); |
---|
| 114 | |
---|
| 115 | // return ( particle.GetPDGCharge() != 0.0 ); |
---|
| 116 | } |
---|
| 117 | |
---|
| 118 | inline G4double G4SynchrotronRadiation::Chebyshev(G4double a,G4double b,const G4double c[],G4int m,G4double x) |
---|
| 119 | { |
---|
| 120 | G4double y; |
---|
| 121 | G4double y2=2.0*(y=(2.0*x-a-b)/(b-a)); // Change of variable. |
---|
| 122 | G4double d=0,dd=0; |
---|
| 123 | for (G4int j=m-1;j>=1;j--) // Clenshaw's recurrence. |
---|
| 124 | { G4double sv=d; |
---|
| 125 | d=y2*d-dd+c[j]; |
---|
| 126 | dd=sv; |
---|
| 127 | } |
---|
| 128 | return y*d-dd+0.5*c[0]; |
---|
| 129 | } |
---|
| 130 | |
---|
| 131 | #endif // end of G4SynchrotronRadiation.hh |
---|
| 132 | |
---|