G4SynchrotronRadiation.hh

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 //      GEANT 4 class header file
00031 //      CERN Geneva Switzerland
00032 //
00033 //
00034 //      History:
00035 //      21-5-98  1 version , V. Grichine
00036 //      28-05-01, V.Ivanchenko minor changes to provide ANSI -wall compilation
00037 //      23-05-06, H. Burkhardt: Energy spectrum from function rather than table
00038 //
00039 //
00040 // ------------------------------------------------------------
00041 
00042 #ifndef G4SynchrotronRadiation_h
00043 #define G4SynchrotronRadiation_h 1
00044 
00045 #include "G4ios.hh"
00046 #include "globals.hh"
00047 #include "Randomize.hh"
00048 #include "G4VDiscreteProcess.hh"
00049 #include "G4TransportationManager.hh"
00050 #include "G4FieldManager.hh"
00051 #include "G4Field.hh"
00052 #include "G4ThreeVector.hh"
00053 #include "G4PropagatorInField.hh"
00054 
00055 #include "G4Track.hh"
00056 #include "G4Step.hh"
00057 
00058 #include "G4Gamma.hh"
00059 #include "G4Electron.hh"
00060 #include "G4Positron.hh"
00061 
00062 
00063 class G4SynchrotronRadiation : public G4VDiscreteProcess
00064 {
00065 public:
00066 
00067   G4SynchrotronRadiation(const G4String& pName = "SynRad",
00068                          G4ProcessType type = fElectromagnetic);
00069 
00070   virtual ~G4SynchrotronRadiation();
00071 
00072   G4double GetMeanFreePath( const G4Track& track,
00073                                      G4double previousStepSize,
00074                                      G4ForceCondition* condition );
00075 
00076   G4VParticleChange *PostStepDoIt( const G4Track& track,
00077                                       const G4Step& Step    );
00078 
00079   G4double GetPhotonEnergy( const G4Track& trackData,
00080                                const G4Step&  stepData      );
00081 
00082   G4double GetRandomEnergySR( G4double, G4double );
00083 
00084   G4double InvSynFracInt(G4double x);
00085   G4double Chebyshev(G4double a,G4double b,const G4double c[],
00086                      G4int n, G4double x);
00087   G4bool IsApplicable(const G4ParticleDefinition&);
00088   void BuildPhysicsTable(const G4ParticleDefinition& );
00089   void PrintInfoDefinition();
00090 
00091 private:
00092 
00093   G4SynchrotronRadiation & operator=(const G4SynchrotronRadiation &right);
00094   G4SynchrotronRadiation(const G4SynchrotronRadiation&);
00095 
00096   G4ParticleDefinition*       theGamma;
00097   const G4ParticleDefinition* theElectron;
00098   const G4ParticleDefinition* thePositron;
00099 
00100   G4double fLambdaConst;
00101   G4double fEnergyConst;
00102 
00103   G4PropagatorInField* fFieldPropagator;
00104 
00105 };
00106 
00108 inline G4bool
00109 G4SynchrotronRadiation::IsApplicable( const G4ParticleDefinition& particle )
00110 {
00111 
00112   return ( ( &particle == (const G4ParticleDefinition *)theElectron ) ||
00113            ( &particle == (const G4ParticleDefinition *)thePositron )    );
00114 }
00115 
00116 inline G4double 
00117 G4SynchrotronRadiation::Chebyshev(G4double a, G4double b, const G4double c[],
00118                                   G4int n, G4double x)
00119 {
00120   G4double y;
00121   G4double y2=2.0*(y=(2.0*x-a-b)/(b-a)); // Change of variable.
00122   G4double d=0,dd=0;
00123   for (G4int j=n-1;j>=1;--j) // Clenshaw's recurrence.
00124   { G4double sv=d;
00125         d=y2*d-dd+c[j];
00126         dd=sv;
00127   }
00128   return y*d-dd+0.5*c[0];
00129 }
00130 
00131 #endif  // end of G4SynchrotronRadiation.hh
00132 

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