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

Diff markup

Differences between /processes/management/include/G4VRestContinuousDiscreteProcess.hh (Version 11.3.0) and /processes/management/include/G4VRestContinuousDiscreteProcess.hh (Version 3.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 <<   7 //
  6 // * the Geant4 Collaboration.  It is provided <<   8 // $Id: G4VRestContinuousDiscreteProcess.hh,v 1.4 1999/12/15 14:53:42 gunter Exp $
  7 // * conditions of the Geant4 Software License <<   9 // GEANT4 tag $Name: geant4-03-01 $
  8 // * LICENSE and available at  http://cern.ch/ <<  10 //
  9 // * include a list of copyright holders.      <<  11 // 
 10 // *                                           <<  12 // ------------------------------------------------------------
 11 // * Neither the authors of this software syst <<  13 //  GEANT 4 class header file 
 12 // * institutes,nor the agencies providing fin <<  14 //
 13 // * work  make  any representation or  warran <<  15 //  For information related to this code contact:
 14 // * regarding  this  software system or assum <<  16 //  CERN, CN Division, ASD group
 15 // * use.  Please see the license in the file  <<  17 //
 16 // * for the full disclaimer and the limitatio <<  18 // Class Description  
 17 // *                                           <<  19 //  Abstract class which defines the public behavior of
 18 // * This  code  implementation is the result  <<  20 //  continuous and discrete physics interactions.
 19 // * technical work of the GEANT4 collaboratio <<  21 //
 20 // * By using,  copying,  modifying or  distri <<  22 // ------------------------------------------------------------
 21 // * any work based  on the software)  you  ag <<  23 //   New Physics scheme            8  Mar. 1997  H.Kurahige
 22 // * use  in  resulting  scientific  publicati <<  24 // ------------------------------------------------------------
 23 // * acceptance of all terms of the Geant4 Sof <<  25 //   modified                     26  Mar. 1997  H.Kurahige
 24 // ******************************************* <<  26 //   modified                     16  Apr. 1997  L.Urban    
 25 //                                             <<  27 //   modified AlongStepGPIL etc.  17 Dec. 1997 H.Kurashige
 26 // G4VRestContinuousDiscreteProcess            <<  28 //   fix bugs in GetGPILSelection() 24 Jan. 1998 H.Kurashige
 27 //                                             <<  29 //   modified for new ParticleChange 12 Mar. 1998  H.Kurashige
 28 // Class description:                          <<  30 
 29 //                                             <<  31 
 30 // Abstract class which defines the public beh <<  32 #ifndef G4VRestContinuousDiscreteProcess_h
 31 // continuous and discrete physics interaction <<  33 #define G4VRestContinuousDiscreteProcess_h 1
 32                                                << 
 33 // Authors:                                    << 
 34 // - 2 December 1995, G.Cosmo - First implemen << 
 35 // - 8 January 1997, H.Kurashige - New Physics << 
 36 // ------------------------------------------- << 
 37 #ifndef G4VRestContinuousDiscreteProcess_hh    << 
 38 #define G4VRestContinuousDiscreteProcess_hh 1  << 
 39                                                    34 
 40 #include "globals.hh"                              35 #include "globals.hh"
 41 #include "G4ios.hh"                                36 #include "G4ios.hh"
 42                                                    37 
 43 #include "G4VProcess.hh"                           38 #include "G4VProcess.hh"
 44                                                    39 
 45 class G4VRestContinuousDiscreteProcess : publi     40 class G4VRestContinuousDiscreteProcess : public G4VProcess 
 46 {                                                  41 {
                                                   >>  42   //  Abstract class which defines the public behavior of
                                                   >>  43   //  discrete physics interactions.
 47   public:                                          44   public:     
 48                                                    45 
 49     G4VRestContinuousDiscreteProcess(const G4S <<  46       G4VRestContinuousDiscreteProcess(const G4String& ,
 50                                      G4Process <<  47                G4ProcessType   aType = fNotDefined );
 51     G4VRestContinuousDiscreteProcess(G4VRestCo <<  48       G4VRestContinuousDiscreteProcess(G4VRestContinuousDiscreteProcess &);
                                                   >>  49 
                                                   >>  50       virtual  ~G4VRestContinuousDiscreteProcess();
 52                                                    51 
 53     virtual ~G4VRestContinuousDiscreteProcess( << 
 54                                                    52 
 55     G4VRestContinuousDiscreteProcess& operator <<  53   public :// with description
                                                   >>  54       virtual  G4double PostStepGetPhysicalInteractionLength(
                                                   >>  55                              const G4Track& track,
                                                   >>  56            G4double   previousStepSize,
                                                   >>  57            G4ForceCondition* condition
                                                   >>  58           );
                                                   >>  59 
                                                   >>  60       virtual  G4VParticleChange* PostStepDoIt(
                                                   >>  61            const G4Track& ,
                                                   >>  62            const G4Step& 
                                                   >>  63           );
 56                                                    64 
 57     virtual G4double PostStepGetPhysicalIntera <<  65       virtual  G4double AlongStepGetPhysicalInteractionLength(
 58                              const G4Track& tr     66                              const G4Track& track,
                                                   >>  67            G4double previousStepSize,
                                                   >>  68            G4double currentMinimumStep,
                                                   >>  69            G4double& currentSafety,
                                                   >>  70                              G4GPILSelection* selection
                                                   >>  71           );
                                                   >>  72 
                                                   >>  73       virtual  G4VParticleChange* AlongStepDoIt(
                                                   >>  74            const G4Track& ,
                                                   >>  75            const G4Step& 
                                                   >>  76           );
                                                   >>  77  
                                                   >>  78       virtual  G4double AtRestGetPhysicalInteractionLength(
                                                   >>  79                              const G4Track& ,
                                                   >>  80            G4ForceCondition* 
                                                   >>  81           );
                                                   >>  82 
                                                   >>  83       virtual  G4VParticleChange* AtRestDoIt(
                                                   >>  84            const G4Track& ,
                                                   >>  85            const G4Step&
                                                   >>  86           );
                                                   >>  87 
                                                   >>  88   protected: // with description
                                                   >>  89       virtual G4double GetMeanLifeTime(const G4Track& aTrack,G4ForceCondition* condition)=0;
                                                   >>  90       //  Calculates the mean life-time (i.e. for decays) of the
                                                   >>  91       //  particle at rest due to the occurence of the given process,
                                                   >>  92       //  or converts the probability of interaction (i.e. for
                                                   >>  93       //  annihilation) into the life-time of the particle for the
                                                   >>  94       //  occurence of the given process.
                                                   >>  95 
                                                   >>  96     virtual G4double GetContinuousStepLimit(const G4Track& aTrack,
                                                   >>  97                              G4double  previousStepSize,
                                                   >>  98                              G4double  currentMinimumStep,
                                                   >>  99            G4double& currentSafety
                                                   >> 100                                                              )=0;
                                                   >> 101   private:
                                                   >> 102     // this is the returnd value of  G4GPILSelection in 
                                                   >> 103     // the arguments of AlongStepGPIL()
                                                   >> 104     G4GPILSelection  valueGPILSelection;
                                                   >> 105 
                                                   >> 106   protected: // with description
                                                   >> 107     // these two methods are set/get methods for valueGPILSelection
                                                   >> 108      void SetGPILSelection(G4GPILSelection selection)
                                                   >> 109     { valueGPILSelection = selection;};
                                                   >> 110 
                                                   >> 111     G4GPILSelection GetGPILSelection() const{return valueGPILSelection;};
                                                   >> 112 
                                                   >> 113   protected: // with description
                                                   >> 114      virtual G4double GetMeanFreePath(const G4Track& aTrack,
 59                              G4double   previo    115                              G4double   previousStepSize,
 60                              G4ForceCondition*    116                              G4ForceCondition* condition
 61                             );                 << 117                                                                )=0;
                                                   >> 118       //  Calculates from the macroscopic cross section a mean
                                                   >> 119       //  free path, the value is returned in units of distance.
                                                   >> 120 
                                                   >> 121  private:
                                                   >> 122   // hide default constructor and assignment operator as private 
                                                   >> 123       G4VRestContinuousDiscreteProcess();
                                                   >> 124       G4VRestContinuousDiscreteProcess & operator=(const G4VRestContinuousDiscreteProcess &right);
 62                                                   125 
 63     virtual G4VParticleChange* PostStepDoIt(   << 126 };
 64                              const G4Track& ,  << 127 
 65                              const G4Step&     << 128 // -----------------------------------------
 66                             );                 << 129 //  inlined function members implementation
                                                   >> 130 // -----------------------------------------
                                                   >> 131 #include "G4Step.hh"
                                                   >> 132 #include "G4Track.hh"
                                                   >> 133 #include "G4MaterialTable.hh"
                                                   >> 134 #include "G4VParticleChange.hh"
 67                                                   135 
 68     virtual G4double AlongStepGetPhysicalInter << 136 inline G4double G4VRestContinuousDiscreteProcess::AtRestGetPhysicalInteractionLength(
 69                              const G4Track& tr    137                              const G4Track& track,
 70                              G4double previous << 138            G4ForceCondition* condition
 71                              G4double currentM << 139           )
 72                              G4double& current << 140 {
                                                   >> 141   // beggining of tracking 
                                                   >> 142   ResetNumberOfInteractionLengthLeft();
                                                   >> 143 
                                                   >> 144   // condition is set to "Not Forced"
                                                   >> 145   *condition = NotForced;
                                                   >> 146 
                                                   >> 147   // get mean life time
                                                   >> 148   currentInteractionLength = GetMeanLifeTime(track, condition);
                                                   >> 149 
                                                   >> 150 #ifdef G4VERBOSE
                                                   >> 151    if ((currentInteractionLength <0.0) || (verboseLevel>2)){
                                                   >> 152     G4cout << "G4VRestContinuousDiscreteProcess::AtRestGetPhysicalInteractionLength ";
                                                   >> 153     G4cout << "[ " << GetProcessName() << "]" <<G4endl;
                                                   >> 154     track.GetDynamicParticle()->DumpInfo();
                                                   >> 155     G4cout << " in Material  " << track.GetMaterial()->GetName() <<G4endl;
                                                   >> 156     G4cout << "MeanLifeTime = " << currentInteractionLength/ns << "[ns]" <<G4endl;
                                                   >> 157   }
                                                   >> 158 #endif
                                                   >> 159 
                                                   >> 160   return theNumberOfInteractionLengthLeft * currentInteractionLength;
                                                   >> 161 }
                                                   >> 162 
                                                   >> 163 
                                                   >> 164 inline G4VParticleChange* G4VRestContinuousDiscreteProcess::AtRestDoIt( 
                                                   >> 165            const G4Track&,
                                                   >> 166            const G4Step& 
                                                   >> 167           )
                                                   >> 168 {
                                                   >> 169 //  clear NumberOfInteractionLengthLeft
                                                   >> 170     ClearNumberOfInteractionLengthLeft();
                                                   >> 171 
                                                   >> 172     return pParticleChange;
                                                   >> 173 }
                                                   >> 174 
                                                   >> 175 inline G4double G4VRestContinuousDiscreteProcess::AlongStepGetPhysicalInteractionLength(
                                                   >> 176                              const G4Track& track,
                                                   >> 177            G4double previousStepSize,
                                                   >> 178            G4double currentMinimumStep,
                                                   >> 179            G4double& currentSafety,
 73                              G4GPILSelection*     180                              G4GPILSelection* selection
 74                             );                 << 181           )
                                                   >> 182 {
                                                   >> 183   // GPILSelection is set to defaule value of CandidateForSelection
                                                   >> 184   valueGPILSelection = CandidateForSelection;
 75                                                   185 
 76     virtual G4VParticleChange* AlongStepDoIt(  << 186   // get Step limit proposed by the process
 77                              const G4Track& ,  << 187   G4double steplength = GetContinuousStepLimit(track,previousStepSize,currentMinimumStep, currentSafety);
 78                              const G4Step&     << 
 79                             );                 << 
 80                                                << 
 81     virtual G4double AtRestGetPhysicalInteract << 
 82                              const G4Track& ,  << 
 83                              G4ForceCondition* << 
 84                             );                 << 
 85                                                   188 
 86     virtual G4VParticleChange* AtRestDoIt(     << 189   // set return value for G4GPILSelection
 87                              const G4Track& ,  << 190   *selection = valueGPILSelection;
 88                              const G4Step&     << 
 89                             );                 << 
 90                                                   191 
 91   protected:                                   << 192 #ifdef G4VERBOSE
                                                   >> 193   if (verboseLevel>1){
                                                   >> 194     G4cout << "G4VRestContinuousDiscreteProcess::AlongStepGetPhysicalInteractionLength ";
                                                   >> 195     G4cout << "[ " << GetProcessName() << "]" <<G4endl;
                                                   >> 196     track.GetDynamicParticle()->DumpInfo();
                                                   >> 197     G4cout << " in Material  " <<  track.GetMaterial()->GetName() <<G4endl;
                                                   >> 198     G4cout << "IntractionLength= " << steplength/cm <<"[cm] " <<G4endl;
                                                   >> 199   }
                                                   >> 200 #endif
                                                   >> 201   return  steplength ;
                                                   >> 202 }
 92                                                   203 
 93     virtual G4double GetMeanLifeTime( const G4 << 204 inline G4VParticleChange* G4VRestContinuousDiscreteProcess::AlongStepDoIt(
 94                                       G4ForceC << 205            const G4Track& ,
 95       // Calculates the mean life-time (i.e. f << 206            const G4Step& 
 96       // particle at rest due to the occurrenc << 207           )
 97       // or converts the probability of intera << 208 { 
 98       // annihilation) into the life-time of t << 209     return pParticleChange;
 99       // occurrence of the given process       << 210 }
100                                                << 
101     virtual G4double GetContinuousStepLimit( c << 
102                                              G << 
103                                              G << 
104                                              G << 
105                                                << 
106     virtual G4double GetMeanFreePath( const G4 << 
107                                       G4double << 
108                                       G4ForceC << 
109       // Calculates from the macroscopic cross << 
110       // free path, the value is returned in u << 
111                                                   211 
112     inline void SetGPILSelection(G4GPILSelecti << 212 inline G4double G4VRestContinuousDiscreteProcess::PostStepGetPhysicalInteractionLength(
113       { valueGPILSelection = selection; }      << 213                              const G4Track& track,
                                                   >> 214            G4double   previousStepSize,
                                                   >> 215            G4ForceCondition* condition
                                                   >> 216           )
                                                   >> 217 {
                                                   >> 218   if ( (previousStepSize <=0.0) || (theNumberOfInteractionLengthLeft<=0.0)) {
                                                   >> 219     // beggining of tracking (or just after DoIt of this process)
                                                   >> 220     ResetNumberOfInteractionLengthLeft();
                                                   >> 221   } else {
                                                   >> 222     // subtract NumberOfInteractionLengthLeft 
                                                   >> 223     SubtractNumberOfInteractionLengthLeft(previousStepSize);
                                                   >> 224     if(theNumberOfInteractionLengthLeft<perMillion)
                                                   >> 225        theNumberOfInteractionLengthLeft=0.;         
                                                   >> 226   }
                                                   >> 227 
                                                   >> 228   // condition is set to "Not Forced"
                                                   >> 229   *condition = NotForced;
                                                   >> 230 
                                                   >> 231   // get mean free path
                                                   >> 232   currentInteractionLength = GetMeanFreePath(track, previousStepSize, condition);
                                                   >> 233 
                                                   >> 234 #ifdef G4VERBOSE
                                                   >> 235    if ((currentInteractionLength <=0.0) || (verboseLevel>2)){
                                                   >> 236     G4cout << "G4VRestContinuousDiscreteProcess::PostStepGetPhysicalInteractionLength ";
                                                   >> 237     G4cout << "[ " << GetProcessName() << "]" <<G4endl;
                                                   >> 238     track.GetDynamicParticle()->DumpInfo();
                                                   >> 239     G4cout << " in Material  " << track.GetMaterial()->GetName() <<G4endl;
                                                   >> 240     G4cout << "MeanFreePath = " << currentInteractionLength/cm << "[cm]" <<G4endl;
                                                   >> 241   }
                                                   >> 242 #endif
114                                                   243 
115     inline G4GPILSelection GetGPILSelection()  << 244   G4double value = theNumberOfInteractionLengthLeft * currentInteractionLength;
116       { return valueGPILSelection; }           << 245 #ifdef G4VERBOSE
                                                   >> 246    if (verboseLevel>1){
                                                   >> 247     G4cout << "G4VRestContinuousDiscreteProcess::PostStepGetPhysicalInteractionLength ";
                                                   >> 248     G4cout << "[ " << GetProcessName() << "]" <<G4endl;
                                                   >> 249     track.GetDynamicParticle()->DumpInfo();
                                                   >> 250     G4cout << " in Material  " <<  track.GetMaterial()->GetName() <<G4endl;
                                                   >> 251     G4cout << "InteractionLength= " << value/cm <<"[cm] " <<G4endl;
                                                   >> 252   }
                                                   >> 253 #endif
                                                   >> 254   return value;
                                                   >> 255 }
117                                                   256 
118   private:                                     << 257 inline G4VParticleChange* G4VRestContinuousDiscreteProcess::PostStepDoIt(
                                                   >> 258            const G4Track& ,
                                                   >> 259            const G4Step& 
                                                   >> 260           )
                                                   >> 261 { 
                                                   >> 262 //  clear NumberOfInteractionLengthLeft
                                                   >> 263     ClearNumberOfInteractionLengthLeft();
119                                                   264 
120     G4VRestContinuousDiscreteProcess();        << 265     return pParticleChange;
121       // Hidden default constructor            << 266 }
122                                                   267 
123     G4GPILSelection valueGPILSelection = Candi << 
124       // This is the returned value of G4GPILS << 
125       // the arguments of AlongStepGPIL()      << 
126 };                                             << 
127                                                   268 
128 #endif                                            269 #endif
                                                   >> 270 
129                                                   271