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] [ 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 ]

Diff markup

Differences between /particles/management/include/G4ParticleWithCuts.hh (Version 11.3.0) and /particles/management/include/G4ParticleWithCuts.hh (Version 1.1)


                                                   >>   1 // This code implementation is the intellectual property of
                                                   >>   2 // the GEANT4 collaboration.
  1 //                                                  3 //
  2 // ******************************************* <<   4 // By copying, distributing or modifying the Program (or any work
  3 // * License and Disclaimer                    <<   5 // based on the Program) you indicate your acceptance of this statement,
  4 // *                                           <<   6 // and all its terms.
  5 // * The  Geant4 software  is  copyright of th << 
  6 // * the Geant4 Collaboration.  It is provided << 
  7 // * conditions of the Geant4 Software License << 
  8 // * LICENSE and available at  http://cern.ch/ << 
  9 // * include a list of copyright holders.      << 
 10 // *                                           << 
 11 // * Neither the authors of this software syst << 
 12 // * institutes,nor the agencies providing fin << 
 13 // * work  make  any representation or  warran << 
 14 // * regarding  this  software system or assum << 
 15 // * use.  Please see the license in the file  << 
 16 // * for the full disclaimer and the limitatio << 
 17 // *                                           << 
 18 // * This  code  implementation is the result  << 
 19 // * technical work of the GEANT4 collaboratio << 
 20 // * By using,  copying,  modifying or  distri << 
 21 // * any work based  on the software)  you  ag << 
 22 // * use  in  resulting  scientific  publicati << 
 23 // * acceptance of all terms of the Geant4 Sof << 
 24 // ******************************************* << 
 25 //                                                  7 //
 26 // G4ParticleWithCuts                          <<   8 // $Id: G4ParticleWithCuts.hh,v 1.4.4.1.2.1 1999/12/08 17:34:08 gunter Exp $
                                                   >>   9 // GEANT4 tag $Name: geant4-01-01 $
                                                   >>  10 //
                                                   >>  11 // 
                                                   >>  12 // ------------------------------------------------------------
                                                   >>  13 //      GEANT 4 class header file
                                                   >>  14 //
                                                   >>  15 //      For information related to this code contact:
                                                   >>  16 //      CERN, IT Division, ASD group
                                                   >>  17 //      History: first implementation, based on object model of
                                                   >>  18 //      Hisaya Kurashige, 21 Oct 1996
                                                   >>  19 //      Calculation of Range Table is based on 
                                                   >>  20 //      implementeation for Muon by L.Urban, 10 May 1996
                                                   >>  21 // ----------------------------------------------------------------
                                                   >>  22 //      modified by Hisaya Kurashige, 04 Jan 1997
                                                   >>  23 //      added verboseLevel by Hisaya Kurashige 13 Nov 1997
                                                   >>  24 //      added ReCalcCuts() and ResetCuts  H.Kurashige 15 Nov.1996
                                                   >>  25 //      BuildPhysicsTable() becomes dummy H.Kurashige 06 June 1998
                                                   >>  26 //      added  GetEnergyThreshold  H.Kurashige 08 June 1998
                                                   >>  27 //      change Lowest/HighestEnergy as static H.Kurashige 18 June 1998 
                                                   >>  28 // ----------------------------------------------------------------
                                                   >>  29 // Class Description
                                                   >>  30 // "theCutInMaxInteractionLength", for charged particles, is
                                                   >>  31 //    coincident with a cut in stopping range; for neutral
                                                   >>  32 //    particles it corresponds to the distance allowed by
                                                   >>  33 //    the total cross section.
                                                   >>  34 // "theKineticEnergyCuts" is the vector of cuts in kinetic
                                                   >>  35 //    energy (a value per material); it is allocated/computed
                                                   >>  36 //    in the specific SetCuts method.  
                                                   >>  37 // void SetCuts(G4double aCut):
                                                   >>  38 //    Sets the cuts values relative to this particle type in stopping
                                                   >>  39 //    range (or absorption length) and converts those cuts into energy cuts
                                                   >>  40 //    for all the materials defined in the Material table.
                                                   >>  41 //    [in protected method of CalcEnergyCuts(G4double aCut) ;
                                                   >>  42 //    It also triggers the recomputation of the physics tables of the
                                                   >>  43 // void ReCalcCuts():
                                                   >>  44 //    Re calculate energy cut values with the previous cut value in range
                                                   >>  45 // void ResetCuts():
                                                   >>  46 //    Reset alll cut values in energy, though theCutInMaxInteractionLength
                                                   >>  47 //    remains unchanged
                                                   >>  48 // G4double GetCuts():
                                                   >>  49 //    Returns value of the cut in interaction length for all the
                                                   >>  50 //    processes of this particle type.
                                                   >>  51 // const G4double* GetCutsInEnergy();
                                                   >>  52 //    Returns vector of energy cuts (ordered per material)
                                                   >>  53 //    corresponding to the current stopping range or absorption length
 27 //                                                 54 //
 28 // Dummy class for G4ParticleDefinition        << 
 29                                                    55 
 30 // Author: H.Kurashige, 9 March 2001           << 
 31 // ------------------------------------------- << 
 32 #ifndef G4ParticleWithCuts_h                       56 #ifndef G4ParticleWithCuts_h
 33 #define G4ParticleWithCuts_h 1                     57 #define G4ParticleWithCuts_h 1
 34                                                    58 
                                                   >>  59 #include "globals.hh"
                                                   >>  60 #include "G4ios.hh"
 35 #include "G4ParticleDefinition.hh"                 61 #include "G4ParticleDefinition.hh"
 36                                                    62 
 37 using G4ParticleWithCuts = G4ParticleDefinitio <<  63 #include "G4PhysicsTable.hh"
                                                   >>  64 #include "G4Element.hh"
                                                   >>  65 #include "G4Material.hh"
                                                   >>  66 class G4PhysicsLogVector;
                                                   >>  67 
                                                   >>  68 
                                                   >>  69 class G4ParticleWithCuts : public G4ParticleDefinition
                                                   >>  70 {
                                                   >>  71   public:
                                                   >>  72      G4ParticleWithCuts(const G4String&  aName,  
                                                   >>  73                 G4double         mass,     
                                                   >>  74                 G4double         width,
                                                   >>  75                 G4double         charge,   
                                                   >>  76                 G4int            iSpin,
                                                   >>  77                 G4int            iParity,
                                                   >>  78                 G4int            iConjugation,
                                                   >>  79                 G4int            iIsospin,   
                                                   >>  80                 G4int            iIsospinZ, 
                                                   >>  81                 G4int            gParity,
                                                   >>  82                 const G4String&  pType,
                                                   >>  83                 G4int            lepton,
                                                   >>  84                 G4int            baryon,
                                                   >>  85                 G4int            encoding,
                                                   >>  86                 G4bool           stable,
                                                   >>  87                 G4double         lifetime,
                                                   >>  88                 G4DecayTable     *decaytable,
                                                   >>  89     G4bool           resonance = false);
                                                   >>  90       virtual ~G4ParticleWithCuts();
                                                   >>  91    
                                                   >>  92   //--------------for SetCuts-------------------------------------------
                                                   >>  93   protected:
                                                   >>  94     G4double  theCutInMaxInteractionLength;
                                                   >>  95     G4double* theKineticEnergyCuts;
                                                   >>  96 
                                                   >>  97   public:  // With Description
                                                   >>  98    // virtual methods derived from G4ParticleDefinition
                                                   >>  99    virtual void          ResetCuts();
                                                   >> 100    // Reset alll cut values in energy 
                                                   >> 101    // but theCutInMaxInteractionLength remain unchanged
                                                   >> 102    virtual void          ReCalcCuts();
                                                   >> 103    // Set cut values in energy derived from theCutInMaxInteractionLength
                                                   >> 104    virtual void          SetCuts(G4double aCut);
                                                   >> 105    // Set cut values in energy derived from the cut range of aCut
                                                   >> 106 
                                                   >> 107    virtual G4double         GetLengthCuts() const;
                                                   >> 108    virtual G4double*          GetEnergyCuts() const;
                                                   >> 109   
                                                   >> 110    virtual G4double       GetEnergyThreshold(const G4Material* aMaterial) const;
                                                   >> 111    static  void           SetEnergyRange(G4double, G4double);
                                                   >> 112 
                                                   >> 113  protected:
                                                   >> 114     virtual   void  CalcEnergyCuts(G4double aCut);
                                                   >> 115 
                                                   >> 116     // BuildPhysicsTable is defined as a dummy routine
                                                   >> 117     void  BuildPhysicsTable() {};
                                                   >> 118 
                                                   >> 119   //-------------- Loss Table ------------------------------------------
                                                   >> 120   // theLossTable is a collection of loss vectors for all elements.
                                                   >> 121   // Each loss vector has energy loss values (cross section values 
                                                   >> 122   // for neutral particles) which are calculated by  
                                                   >> 123   // ComputeLoss(G4double AtomicNumber,G4double KineticEnergy).
                                                   >> 124 
                                                   >> 125   protected:
                                                   >> 126     typedef G4PhysicsTable     G4LossTable;
                                                   >> 127     G4LossTable*               theLossTable;
                                                   >> 128     G4int                      NumberOfElements;
                                                   >> 129 
                                                   >> 130     typedef G4PhysicsLogVector G4LossVector;
                                                   >> 131     static G4double            LowestEnergy, HighestEnergy;
                                                   >> 132     G4int                      TotBin;
                                                   >> 133 
                                                   >> 134   protected:  
                                                   >> 135     virtual void BuildLossTable();
                                                   >> 136     virtual G4double ComputeLoss(G4double AtomicNumber,
                                                   >> 137                                  G4double KineticEnergy
                                                   >> 138                                 ) const;
                                                   >> 139 //-------------- Range Table ------------------------------------------
                                                   >> 140   protected:
                                                   >> 141     typedef G4PhysicsLogVector G4RangeVector;
                                                   >> 142     virtual void BuildRangeVector(const G4Material* aMaterial,
                                                   >> 143           const G4LossTable* aLossTable,
                                                   >> 144           G4double       maxEnergy,     
                                                   >> 145           G4double       aMass,
                                                   >> 146                                   G4RangeVector* rangeVector);
                                                   >> 147 
                                                   >> 148   protected:  
                                                   >> 149     G4double ConvertCutToKineticEnergy(
                                                   >> 150                             G4RangeVector* theRangeVector
                                                   >> 151                           ) const;
                                                   >> 152 
                                                   >> 153     static G4double RangeLinSimpson(
                                                   >> 154           const G4ElementVector* elementVector,
                                                   >> 155                             const G4double* atomicNumDensityVector,
                                                   >> 156                             const G4LossTable* aLossTable,
                                                   >> 157                             G4double aMass,   
                                                   >> 158           G4double taulow, G4double tauhigh,
                                                   >> 159                             G4int nbin, G4int NumEl
                                                   >> 160                           );
                                                   >> 161    static G4double RangeLogSimpson(
                                                   >> 162           const G4ElementVector* elementVector,
                                                   >> 163                             const G4double* atomicNumDensityVector,
                                                   >> 164                             const G4LossTable* aLossTable,
                                                   >> 165                             G4double aMass,   
                                                   >> 166           G4double ltaulow, G4double ltauhigh,
                                                   >> 167                             G4int nbin, G4int NumEl
                                                   >> 168                           );
                                                   >> 169 };
                                                   >> 170 
                                                   >> 171 inline G4double G4ParticleWithCuts::GetLengthCuts() const 
                                                   >> 172 {
                                                   >> 173   return theCutInMaxInteractionLength;
                                                   >> 174 }
 38                                                   175 
                                                   >> 176 inline G4double*  G4ParticleWithCuts::GetEnergyCuts() const 
                                                   >> 177 {
                                                   >> 178   return theKineticEnergyCuts;
                                                   >> 179 }
                                                   >> 180   
                                                   >> 181 inline void G4ParticleWithCuts::ResetCuts()
                                                   >> 182 {
                                                   >> 183    if(theKineticEnergyCuts) delete [] theKineticEnergyCuts;
                                                   >> 184    theKineticEnergyCuts = 0;
                                                   >> 185 }
                                                   >> 186 
                                                   >> 187 inline void G4ParticleWithCuts::ReCalcCuts()
                                                   >> 188 {
                                                   >> 189   if (theCutInMaxInteractionLength>0.0) {
                                                   >> 190     CalcEnergyCuts(theCutInMaxInteractionLength);
                                                   >> 191   } else {
                                                   >> 192     if (GetVerboseLevel()>0) {
                                                   >> 193       G4cout << "G4ParticleWithCuts::ReCalcCuts() :";
                                                   >> 194       G4cout << "theCutInMaxInteractionLength is not defined " << G4endl; 
                                                   >> 195     }
                                                   >> 196   }
                                                   >> 197 }
                                                   >> 198 
                                                   >> 199 inline void G4ParticleWithCuts::SetCuts(G4double aCut)
                                                   >> 200 {
                                                   >> 201   CalcEnergyCuts(aCut);
                                                   >> 202 }
                                                   >> 203 
                                                   >> 204 inline 
                                                   >> 205  void G4ParticleWithCuts::SetEnergyRange(G4double lowedge, G4double highedge)
                                                   >> 206 {
                                                   >> 207   LowestEnergy = lowedge;
                                                   >> 208   HighestEnergy = highedge;
                                                   >> 209 }
                                                   >> 210 
                                                   >> 211 #include "G4Material.hh"
                                                   >> 212 
                                                   >> 213 inline 
                                                   >> 214  G4double  G4ParticleWithCuts::GetEnergyThreshold(const G4Material* aMaterial) const
                                                   >> 215 {
                                                   >> 216    return theKineticEnergyCuts[aMaterial->GetIndex()]; 
                                                   >> 217 }
 39 #endif                                            218 #endif
                                                   >> 219 
                                                   >> 220 
                                                   >> 221 
                                                   >> 222 
                                                   >> 223 
                                                   >> 224 
                                                   >> 225 
                                                   >> 226 
                                                   >> 227 
 40                                                   228