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.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/G4VContinuousDiscreteProcess.hh (Version 11.3.0) and /processes/management/include/G4VContinuousDiscreteProcess.hh (Version 5.0)


  1 //                                                  1 //
  2 // *******************************************      2 // ********************************************************************
  3 // * License and Disclaimer                    <<   3 // * DISCLAIMER                                                       *
  4 // *                                                4 // *                                                                  *
  5 // * The  Geant4 software  is  copyright of th <<   5 // * The following disclaimer summarizes all the specific disclaimers *
  6 // * the Geant4 Collaboration.  It is provided <<   6 // * of contributors to this software. The specific disclaimers,which *
  7 // * conditions of the Geant4 Software License <<   7 // * govern, are listed with their locations in:                      *
  8 // * LICENSE and available at  http://cern.ch/ <<   8 // *   http://cern.ch/geant4/license                                  *
  9 // * include a list of copyright holders.      << 
 10 // *                                                9 // *                                                                  *
 11 // * Neither the authors of this software syst     10 // * Neither the authors of this software system, nor their employing *
 12 // * institutes,nor the agencies providing fin     11 // * institutes,nor the agencies providing financial support for this *
 13 // * work  make  any representation or  warran     12 // * work  make  any representation or  warranty, express or implied, *
 14 // * regarding  this  software system or assum     13 // * regarding  this  software system or assume any liability for its *
 15 // * use.  Please see the license in the file  <<  14 // * use.                                                             *
 16 // * for the full disclaimer and the limitatio << 
 17 // *                                               15 // *                                                                  *
 18 // * This  code  implementation is the result  <<  16 // * This  code  implementation is the  intellectual property  of the *
 19 // * technical work of the GEANT4 collaboratio <<  17 // * GEANT4 collaboration.                                            *
 20 // * By using,  copying,  modifying or  distri <<  18 // * By copying,  distributing  or modifying the Program (or any work *
 21 // * any work based  on the software)  you  ag <<  19 // * based  on  the Program)  you indicate  your  acceptance of  this *
 22 // * use  in  resulting  scientific  publicati <<  20 // * statement, and all its terms.                                    *
 23 // * acceptance of all terms of the Geant4 Sof << 
 24 // *******************************************     21 // ********************************************************************
 25 //                                                 22 //
 26 // G4VContinuousDiscreteProcess                << 
 27 //                                                 23 //
 28 // Class description:                          <<  24 // $Id: G4VContinuousDiscreteProcess.hh,v 1.6 2002/04/15 04:29:57 kurasige Exp $
                                                   >>  25 // GEANT4 tag $Name: geant4-05-00 $
                                                   >>  26 //
                                                   >>  27 // 
                                                   >>  28 // ------------------------------------------------------------
                                                   >>  29 //  GEANT 4 class header file 
                                                   >>  30 //
                                                   >>  31 //  Abstract class which defines the public behavior of
 29 //                                                 32 // 
 30 // Abstract class which defines the public beh <<  33 // Class Description 
 31 // discrete physics interactions.              <<  34 //  discrete physics interactions.
                                                   >>  35 //
                                                   >>  36 // ------------------------------------------------------------
                                                   >>  37 //   New Physics scheme            8  Mar. 1997  H.Kurahige
                                                   >>  38 // ------------------------------------------------------------
                                                   >>  39 //   fix bugs in GetGPILSelection() 24 Jan. 1998 H.Kurashige
                                                   >>  40 //   modified for new ParticleChange 12 Mar. 1998  H.Kurashige
                                                   >>  41 //   Fixed a bug in PostStepGetPhysicalInteractionLength  
                                                   >>  42 //                                15 Apr. 2002 H.Kurashige 
                                                   >>  43 //
 32                                                    44 
 33 // Authors:                                    <<  45 #ifndef G4VContinuousDiscreteProcess_h
 34 // - 2 December 1995, G.Cosmo - First implemen <<  46 #define G4VContinuousDiscreteProcess_h 1
 35 // - 8 January 1997, H.Kurashige - New Physics << 
 36 // ------------------------------------------- << 
 37 #ifndef G4VContinuousDiscreteProcess_hh        << 
 38 #define G4VContinuousDiscreteProcess_hh 1      << 
 39                                                    47 
 40 #include "globals.hh"                              48 #include "globals.hh"
 41 #include "G4ios.hh"                                49 #include "G4ios.hh"
 42                                                    50 
 43 #include "G4VProcess.hh"                           51 #include "G4VProcess.hh"
 44                                                    52 
 45 class G4VContinuousDiscreteProcess : public G4     53 class G4VContinuousDiscreteProcess : public G4VProcess 
 46 {                                                  54 {
                                                   >>  55   //  Abstract class which defines the public behavior of
                                                   >>  56   //  discrete physics interactions.
 47   public:                                          57   public:     
 48                                                    58 
 49     G4VContinuousDiscreteProcess(const G4Strin <<  59       G4VContinuousDiscreteProcess(const G4String& ,
 50                                  G4ProcessType <<  60            G4ProcessType   aType = fNotDefined );
 51     G4VContinuousDiscreteProcess(G4VContinuous <<  61       G4VContinuousDiscreteProcess(G4VContinuousDiscreteProcess &);
 52                                                    62 
 53     virtual ~G4VContinuousDiscreteProcess();   <<  63       virtual ~G4VContinuousDiscreteProcess();
 54                                                    64 
 55     G4VContinuousDiscreteProcess& operator=(co <<  65   public :// with description
 56                                                <<  66       virtual G4double PostStepGetPhysicalInteractionLength(
 57     virtual G4double PostStepGetPhysicalIntera << 
 58                              const G4Track& tr     67                              const G4Track& track,
 59                              G4double   previo <<  68            G4double   previousStepSize,
 60                              G4ForceCondition* <<  69            G4ForceCondition* condition
 61                             );                 <<  70           );
 62                                                <<  71 
 63     virtual G4VParticleChange* PostStepDoIt(   <<  72       virtual G4VParticleChange* PostStepDoIt(
 64                              const G4Track& ,  <<  73            const G4Track& ,
 65                              const G4Step&     <<  74            const G4Step& 
 66                             );                 <<  75           );
 67                                                    76 
 68     virtual G4double AlongStepGetPhysicalInter <<  77       virtual G4double AlongStepGetPhysicalInteractionLength(
 69                              const G4Track&,       78                              const G4Track&,
 70                              G4double  previou     79                              G4double  previousStepSize,
 71                              G4double  current     80                              G4double  currentMinimumStep,
 72                              G4double& current <<  81            G4double& currentSafety,
 73                              G4GPILSelection*      82                              G4GPILSelection* selection
 74                             );                 <<  83           );
 75                                                    84 
 76     virtual G4VParticleChange* AlongStepDoIt(  <<  85       virtual G4VParticleChange* AlongStepDoIt(
 77                              const G4Track& ,  <<  86            const G4Track& ,
 78                              const G4Step&     <<  87            const G4Step& 
 79                             );                 <<  88           );
 80                                                    89  
 81     virtual G4double AtRestGetPhysicalInteract <<  90      //  no operation in  AtRestDoIt
                                                   >>  91       virtual G4double AtRestGetPhysicalInteractionLength(
 82                              const G4Track& ,      92                              const G4Track& ,
 83                              G4ForceCondition* <<  93            G4ForceCondition* 
 84                             ) { return -1.0; } <<  94           ) { return -1.0; };
 85       // No operation in AtRestDoIt            << 
 86                                                    95 
 87     virtual G4VParticleChange* AtRestDoIt(     <<  96      //  no operation in  AtRestDoIt
 88                              const G4Track& ,  <<  97       virtual G4VParticleChange* AtRestDoIt(
 89                              const G4Step&     <<  98            const G4Track& ,
 90                             ) { return 0; }    <<  99            const G4Step&
 91       // No operation in AtRestDoIt            << 100           ) {return 0;};
 92                                                   101  
 93   protected:                                   << 102  protected:// with description
 94                                                << 103      virtual G4double GetMeanFreePath(const G4Track& aTrack,
 95     virtual G4double GetMeanFreePath(const G4T << 104                              G4double   previousStepSize,
 96                              G4double previous << 105                              G4ForceCondition* condition
 97                              G4ForceCondition* << 106                                                                )=0;
 98       // Calculates from the macroscopic cross << 107       //  Calculates from the macroscopic cross section a mean
 99       // free path, the value is returned in u << 108       //  free path, the value is returned in units of distance.
100                                                   109 
                                                   >> 110   protected:// with description
101     virtual G4double GetContinuousStepLimit(co    111     virtual G4double GetContinuousStepLimit(const G4Track& aTrack,
102                              G4double  previou    112                              G4double  previousStepSize,
103                              G4double  current    113                              G4double  currentMinimumStep,
104                              G4double& current << 114            G4double& currentSafety
                                                   >> 115                                                              )=0;
                                                   >> 116   private:
                                                   >> 117     // this is the returnd value of  G4GPILSelection in 
                                                   >> 118     // the arguments of AlongStepGPIL()
                                                   >> 119     G4GPILSelection  valueGPILSelection;
                                                   >> 120 
                                                   >> 121   protected:// with description
                                                   >> 122     // these two methods are set/get methods for valueGPILSelection
                                                   >> 123     void SetGPILSelection(G4GPILSelection selection)
                                                   >> 124     { valueGPILSelection = selection;};
                                                   >> 125 
                                                   >> 126     G4GPILSelection GetGPILSelection() const{return valueGPILSelection;};
                                                   >> 127 
                                                   >> 128    private:
                                                   >> 129   // hide default constructor and assignment operator as private 
                                                   >> 130       G4VContinuousDiscreteProcess();
                                                   >> 131       G4VContinuousDiscreteProcess & operator=(const G4VContinuousDiscreteProcess &right);
105                                                   132 
106     inline void SetGPILSelection(G4GPILSelecti << 133 };
107       { valueGPILSelection = selection; }      << 134 // -----------------------------------------
                                                   >> 135 //  inlined function members implementation
                                                   >> 136 // -----------------------------------------
                                                   >> 137 #include "G4Step.hh"
                                                   >> 138 #include "G4Track.hh"
                                                   >> 139 #include "G4MaterialTable.hh"
                                                   >> 140 #include "G4VParticleChange.hh"
108                                                   141 
109     inline G4GPILSelection GetGPILSelection()  << 142 inline G4double G4VContinuousDiscreteProcess::PostStepGetPhysicalInteractionLength(
110       { return valueGPILSelection; }           << 143                              const G4Track& track,
                                                   >> 144            G4double   previousStepSize,
                                                   >> 145            G4ForceCondition* condition
                                                   >> 146           )
                                                   >> 147 {
                                                   >> 148   if ( (previousStepSize <=0.0) || (theNumberOfInteractionLengthLeft<=0.0)) {
                                                   >> 149     // beggining of tracking (or just after DoIt of this process)
                                                   >> 150     ResetNumberOfInteractionLengthLeft();
                                                   >> 151   } else {
                                                   >> 152     // subtract NumberOfInteractionLengthLeft 
                                                   >> 153     SubtractNumberOfInteractionLengthLeft(previousStepSize);
                                                   >> 154     if(theNumberOfInteractionLengthLeft<perMillion)
                                                   >> 155        theNumberOfInteractionLengthLeft=0.;        
                                                   >> 156   }
                                                   >> 157 
                                                   >> 158   // condition is set to "Not Forced"
                                                   >> 159   *condition = NotForced;
                                                   >> 160 
                                                   >> 161   // get mean free path
                                                   >> 162   currentInteractionLength = GetMeanFreePath(track, previousStepSize, condition);
                                                   >> 163 
                                                   >> 164 #ifdef G4VERBOSE
                                                   >> 165   if ((currentInteractionLength <=0.0) || (verboseLevel>2)){
                                                   >> 166     G4cout << "G4VContinuousDiscreteProcess::PostStepGetPhysicalInteractionLength ";
                                                   >> 167     G4cout << "[ " << GetProcessName() << "]" <<G4endl;
                                                   >> 168     track.GetDynamicParticle()->DumpInfo();
                                                   >> 169     G4cout << " in Material  " << track.GetMaterial()->GetName() <<G4endl;
                                                   >> 170     G4cout << "MeanFreePath = " << currentInteractionLength/cm << "[cm]" <<G4endl;
                                                   >> 171   }
                                                   >> 172 #endif
111                                                   173 
112   private:                                     << 174   G4double value;
                                                   >> 175   if (currentInteractionLength <DBL_MAX) {
                                                   >> 176     value = theNumberOfInteractionLengthLeft * currentInteractionLength;
                                                   >> 177   } else {
                                                   >> 178     value = DBL_MAX;
                                                   >> 179   }
                                                   >> 180 #ifdef G4VERBOSE
                                                   >> 181   if (verboseLevel>1){
                                                   >> 182     G4cout << "G4VContinuousDiscreteProcess::PostStepGetPhysicalInteractionLength ";
                                                   >> 183     G4cout << "[ " << GetProcessName() << "]" <<G4endl;
                                                   >> 184     track.GetDynamicParticle()->DumpInfo();
                                                   >> 185     G4cout << " in Material  " <<  track.GetMaterial()->GetName() <<G4endl;
                                                   >> 186     G4cout << "InteractionLength= " << value/cm <<"[cm] " <<G4endl;
                                                   >> 187   }
                                                   >> 188 #endif
                                                   >> 189   return value;
                                                   >> 190 }
113                                                   191 
114     G4VContinuousDiscreteProcess();            << 
115       // Hidden default constructor            << 
116                                                   192 
117     G4GPILSelection valueGPILSelection = Candi << 193 inline G4VParticleChange* G4VContinuousDiscreteProcess::PostStepDoIt(
118       // This is the returned value of G4GPILS << 194            const G4Track& ,
119       // the arguments of AlongStepGPIL()      << 195            const G4Step&
120 };                                             << 196           )
                                                   >> 197 { 
                                                   >> 198 //  clear  NumberOfInteractionLengthLeft
                                                   >> 199     ClearNumberOfInteractionLengthLeft();
                                                   >> 200     return pParticleChange;
                                                   >> 201 }
                                                   >> 202 
                                                   >> 203 inline G4VParticleChange* G4VContinuousDiscreteProcess::AlongStepDoIt(
                                                   >> 204            const G4Track& ,
                                                   >> 205            const G4Step&
                                                   >> 206           )
                                                   >> 207 { 
                                                   >> 208 //  clear  NumberOfInteractionLengthLeft
                                                   >> 209     ClearNumberOfInteractionLengthLeft();
                                                   >> 210     return pParticleChange;
                                                   >> 211 }
                                                   >> 212 
                                                   >> 213 inline G4double G4VContinuousDiscreteProcess::AlongStepGetPhysicalInteractionLength(
                                                   >> 214                              const G4Track& track,
                                                   >> 215            G4double previousStepSize,
                                                   >> 216            G4double currentMinimumStep,
                                                   >> 217            G4double& currentSafety,
                                                   >> 218                              G4GPILSelection* selection
                                                   >> 219           )
                                                   >> 220 {
                                                   >> 221   // GPILSelection is set to defaule value of CandidateForSelection
                                                   >> 222   valueGPILSelection = CandidateForSelection;
                                                   >> 223 
                                                   >> 224   // get Step limit proposed by the process
                                                   >> 225   G4double steplength = GetContinuousStepLimit(track,previousStepSize,currentMinimumStep, currentSafety);
                                                   >> 226 
                                                   >> 227   // set return value for G4GPILSelection
                                                   >> 228   *selection = valueGPILSelection;
                                                   >> 229 
                                                   >> 230 #ifdef G4VERBOSE
                                                   >> 231    if (verboseLevel>1){
                                                   >> 232     G4cout << "G4VContinuousDiscreteProcess::AlongStepGetPhysicalInteractionLength ";
                                                   >> 233     G4cout << "[ " << GetProcessName() << "]" <<G4endl;
                                                   >> 234     track.GetDynamicParticle()->DumpInfo();
                                                   >> 235     G4cout << " in Material  " <<  track.GetMaterial()->GetName() <<G4endl;
                                                   >> 236     G4cout << "IntractionLength= " << steplength/cm <<"[cm] " <<G4endl;
                                                   >> 237   }
                                                   >> 238 #endif
                                                   >> 239   return  steplength ;
                                                   >> 240 }
121                                                   241 
122 #endif                                            242 #endif
                                                   >> 243 
                                                   >> 244 
                                                   >> 245 
                                                   >> 246 
                                                   >> 247 
                                                   >> 248 
123                                                   249