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.p3 ] [ 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 //
 27 //
 28 // 3.4.2000 Veronique Lefebure:
 29 //          Move utils/include/G4VEnergyLoss.hh to 
 30 //               lowenergy/include/G4RDVeLowEnergyLoss.hh
 31 // 
 32 // ------------------------------------------------------------
 33 //  GEANT 4 class header file 
 34 //
 35 // 
 36 // Class Description 
 37 //
 38 //  General service class for the energy loss classes
 39 //  
 40 //  It contains code needed to compute the range tables,
 41 //  time tables, the inverse range tables and some auxiliary
 42 //  tables.
 43 //  The energy loss fluctuation code is here,too.
 44 //
 45 //  All the EnergyLoss classes are inherited from G4RDVeLowEnergyLoss
 46 //  class.
 47 //
 48 //  -----------------------------------------------------------
 49 //  created  on 28 January 2000  by L. Urban
 50 //  -----------------------------------------------------------
 51 //
 52 //  Modifications:
 53 // 20/09/00 V.Ivanchenko update fluctuations
 54 // 23/11/01 V.Ivanchenko Move static member-functions from header to source
 55 // 22/01/03 V.Ivanchenko Cut per range
 56 //
 57 // Class description:
 58 // Abstract class for Low Energy Electromagnetic electron energy loss
 59 // Further documentation available from http://www.ge.infn.it/geant4/lowE
 60 
 61 //  -----------------------------------------------------------
 62 
 63 #ifndef G4RDVeLowEnergyLoss_h
 64 #define G4RDVeLowEnergyLoss_h 1
 65 
 66 #include "globals.hh"
 67 #include "G4ios.hh"
 68 #include "Randomize.hh"
 69 #include "G4Poisson.hh"
 70 #include "G4Electron.hh"
 71 #include "G4VContinuousDiscreteProcess.hh"
 72 #include "G4PhysicsLogVector.hh"
 73 #include "G4PhysicsLinearVector.hh"
 74 #include "G4MaterialCutsCouple.hh"
 75 
 76 class G4RDVeLowEnergyLoss : public G4VContinuousDiscreteProcess
 77 {
 78   public:
 79 
 80       G4RDVeLowEnergyLoss(const G4String& ,
 81            G4ProcessType   aType = fNotDefined );
 82       G4RDVeLowEnergyLoss(G4RDVeLowEnergyLoss &);
 83 
 84       virtual ~G4RDVeLowEnergyLoss();
 85 
 86       virtual G4double GetContinuousStepLimit(const G4Track& track,
 87                                     G4double previousStepSize,
 88                                     G4double currentMinimumStep,
 89                                     G4double& currentSafety) = 0 ;
 90 
 91       virtual G4VParticleChange* AlongStepDoIt(const G4Track& track,
 92                                      const G4Step& Step) = 0 ;
 93 
 94       virtual G4double GetMeanFreePath(const G4Track& track,
 95                                      G4double previousStepSize,
 96                                      G4ForceCondition* condition) = 0;
 97 
 98       virtual G4VParticleChange* PostStepDoIt(const G4Track& track,
 99                                             const G4Step& Step) = 0;
100 
101 
102 
103   protected:// with description
104 
105     // code for the energy loss fluctuation
106 
107     G4double GetLossWithFluct(const G4DynamicParticle* aParticle,
108                               const G4MaterialCutsCouple* couple,
109                               G4double  MeanLoss,
110                               G4double  step);
111 
112 
113    private:
114 
115   // hide default constructor and assignment operator as private
116       G4RDVeLowEnergyLoss();
117       G4RDVeLowEnergyLoss & operator=(const G4RDVeLowEnergyLoss &right);
118 
119   protected:
120 
121     // data members to speed up the fluctuation calculation
122     const G4Material* lastMaterial;
123     G4int imat;
124     G4double f1Fluct,f2Fluct,e1Fluct,e2Fluct,rateFluct,ipotFluct;
125     G4double e1LogFluct,e2LogFluct,ipotLogFluct;
126 
127     const G4int nmaxCont1,nmaxCont2 ;
128 
129   // static part of the class
130 
131   public:  // With description
132 
133     static void SetRndmStep     (G4bool   value);
134     // use / do not use randomisation in energy loss steplimit
135     // ( default = no randomisation)
136 
137     static void SetEnlossFluc   (G4bool   value);
138     // compute energy loss with/without fluctuation
139     // ( default : with fluctuation)
140 
141     static void SetStepFunction (G4double c1, G4double c2);
142     // sets values for data members used to compute the step limit:
143     //   dRoverRange : max. relative range change in one step,
144     //   finalRange  : if range <= finalRange --> last step for the particle.
145 
146 
147   protected: // With description
148 
149     // Build range table starting from the DEDXtable
150     static G4PhysicsTable*
151      BuildRangeTable(G4PhysicsTable* theDEDXTable,
152                      G4PhysicsTable* theRangeTable,
153                      G4double Tmin,G4double Tmax,G4int nbin);
154 
155     // Build time tables starting from the DEDXtable
156     static G4PhysicsTable*
157      BuildLabTimeTable(G4PhysicsTable* theDEDXTable,
158                        G4PhysicsTable* theLabTimeTable,
159                        G4double Tmin,G4double Tmax,G4int nbin);
160 
161     static G4PhysicsTable*
162      BuildProperTimeTable(G4PhysicsTable* theDEDXTable,
163                        G4PhysicsTable* ProperTimeTable,
164                        G4double Tmin,G4double Tmax,G4int nbin);
165 
166     // Build tables of coefficients needed for inverting the range table 
167     static G4PhysicsTable*
168      BuildRangeCoeffATable(G4PhysicsTable* theRangeTable,
169                            G4PhysicsTable* theCoeffATable,
170                            G4double Tmin,G4double Tmax,G4int nbin);
171     static G4PhysicsTable*
172      BuildRangeCoeffBTable(G4PhysicsTable* theRangeTable,
173                            G4PhysicsTable* theCoeffBTable,
174                            G4double Tmin,G4double Tmax,G4int nbin);
175     static G4PhysicsTable*
176      BuildRangeCoeffCTable(G4PhysicsTable* theRangeTable,
177                            G4PhysicsTable* theCoeffCTable,
178                            G4double Tmin,G4double Tmax,G4int nbin);
179 
180     // Invert range table
181     static G4PhysicsTable*
182      BuildInverseRangeTable(G4PhysicsTable* theRangeTable,
183                             G4PhysicsTable* theRangeCoeffATable,
184                             G4PhysicsTable* theRangeCoeffBTable,
185                             G4PhysicsTable* theRangeCoeffCTable,
186                             G4PhysicsTable* theInverseRangeTable,
187                             G4double Tmin,G4double Tmax,G4int nbin);
188 
189   private:
190 
191     static void BuildRangeVector(G4PhysicsTable* theDEDXTable,
192                         G4double Tmin,G4double Tmax,G4int nbin,
193                         G4int materialIndex,G4PhysicsLogVector* rangeVector);
194 
195     static void BuildRangeVectorNew(const G4PhysicsTable*,G4int,
196                                           G4int,G4PhysicsLogVector*);
197 
198     static G4double RangeIntLin(G4PhysicsVector* physicsVector
199                                                         ,G4int nbin);
200 
201     static G4double RangeIntLog(G4PhysicsVector* physicsVector
202                                                         ,G4int nbin);
203 
204     static void BuildLabTimeVector(G4PhysicsTable* theDEDXTable,
205                         G4double Tmin,G4double Tmax,G4int nbin,
206                         G4int materialIndex,G4PhysicsLogVector* rangeVector);
207 
208     static void BuildProperTimeVector(G4PhysicsTable* theDEDXTable,
209                         G4double Tmin,G4double Tmax,G4int nbin,
210                         G4int materialIndex,G4PhysicsLogVector* rangeVector);
211 
212     static G4double LabTimeIntLog(G4PhysicsVector* physicsVector
213                                                         ,G4int nbin);
214 
215     static G4double ProperTimeIntLog(G4PhysicsVector* physicsVector,
216                                                          G4int nbin);
217 
218     static void InvertRangeVector(G4PhysicsTable* theRangeTable,
219                                   G4PhysicsTable* theRangeCoeffATable,
220                                   G4PhysicsTable* theRangeCoeffBTable,
221                                   G4PhysicsTable* theRangeCoeffCTable,
222                                   G4double Tmin,G4double Tmax,G4int nbin,
223                        G4int materialIndex,G4PhysicsLogVector* rangeVector);
224 
225 
226   // data members
227   protected:
228 
229    // variables for the integration routines
230    static G4double ParticleMass,taulow,tauhigh,ltaulow,ltauhigh;
231 
232 
233    static G4double dRoverRange;     // dRoverRange is the maximum allowed
234                                      // deltarange/range in one Step
235    static G4double finalRange;      // final step before stopping
236    static G4double c1lim,c2lim,c3lim ; // coeffs for computing steplimit
237 
238    static G4bool   rndmStepFlag;    // control the randomization of the step
239    static G4bool   EnlossFlucFlag;  // control the energy loss fluctuation
240 
241 
242 };
243 
244 #endif
245 
246 
247 
248