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.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/decay/include/G4Decay.hh (Version 11.3.0) and /processes/decay/include/G4Decay.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 << 
  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 //                                             << 
 26 //                                                  7 //
                                                   >>   8 // $Id: G4Decay.hh,v 1.6 2001/02/22 13:29:26 kurasige Exp $
                                                   >>   9 // GEANT4 tag $Name: geant4-03-01 $
 27 //                                                 10 //
 28 //                                                 11 //
 29 // -------------------------------------------     12 // ------------------------------------------------------------
 30 //      GEANT 4 class header file                  13 //      GEANT 4 class header file
 31 //                                                 14 //
                                                   >>  15 //      For information related to this code contact:
                                                   >>  16 //      CERN, CN Division, ASD group
 32 //      History: first implementation, based o     17 //      History: first implementation, based on object model of
 33 //      7 July 1996 H.Kurashige                    18 //      7 July 1996 H.Kurashige
 34 // -------------------------------------------     19 // ------------------------------------------------------------
 35 //  New Physics scheme           18 Jan. 1997      20 //  New Physics scheme           18 Jan. 1997  H.Kurahige
 36 // -------------------------------------------     21 // ------------------------------------------------------------
 37 //   modified                     4  Feb. 1997     22 //   modified                     4  Feb. 1997  H.Kurahige
 38 //   modified                     8  Sep. 1997     23 //   modified                     8  Sep. 1997  H.Kurahige
 39 //   remove BuildPhysicsTable()   27 Nov. 1997     24 //   remove BuildPhysicsTable()   27 Nov. 1997   H.Kurashige
 40 //   modified for new ParticleChange 12 Mar. 1     25 //   modified for new ParticleChange 12 Mar. 1998  H.Kurashige
 41 //   added aPhysicsTable          2  Aug. 1998     26 //   added aPhysicsTable          2  Aug. 1998 H.Kurashige
 42 //   PreAssignedDecayTime         18 Jan. 2001     27 //   PreAssignedDecayTime         18 Jan. 2001 H.Kurashige
 43 //   Add External Decayer         23 Feb. 2001     28 //   Add External Decayer         23 Feb. 2001  H.Kurashige
 44 //   Remove PhysicsTable          12 Feb. 2002 <<  29 //
 45 //   Fixed bug in PostStepGPIL                 << 
 46 //    in case of stopping during AlongStepDoIt << 
 47 //   Add GetRemainderLifeTime  10 Aug/2004 H.K << 
 48 //   Add DaughterPolarization     23 July 2008 << 
 49                                                << 
 50                                                << 
 51 #ifndef G4Decay_h                                  30 #ifndef G4Decay_h
 52 #define G4Decay_h 1                                31 #define G4Decay_h 1
 53                                                    32 
 54 #include "G4ios.hh"                                33 #include "G4ios.hh"
 55 #include "globals.hh"                              34 #include "globals.hh"
 56 #include "G4VRestDiscreteProcess.hh"               35 #include "G4VRestDiscreteProcess.hh"
 57 #include "G4ParticleChangeForDecay.hh"             36 #include "G4ParticleChangeForDecay.hh"
 58 #include "G4DecayProcessType.hh"               << 
 59                                                << 
 60 class G4VExtDecayer;                               37 class G4VExtDecayer;
 61                                                    38 
 62 class G4Decay : public G4VRestDiscreteProcess      39 class G4Decay : public G4VRestDiscreteProcess 
 63 {                                                  40 {
 64  // Class Description                              41  // Class Description
 65   //  This class is a decay process                42   //  This class is a decay process
 66                                                    43 
 67   public:                                          44   public:
 68     //  Constructors                               45     //  Constructors 
 69     G4Decay(const G4String& processName ="Deca     46     G4Decay(const G4String& processName ="Decay");
 70                                                    47 
 71     //  Destructor                                 48     //  Destructor
 72     virtual ~G4Decay();                            49     virtual ~G4Decay();
 73                                                    50 
 74   private:                                         51   private:
 75     //  copy constructor                           52     //  copy constructor
 76       G4Decay(const G4Decay &right);               53       G4Decay(const G4Decay &right);
 77                                                    54 
 78     //  Assignment Operation (generated)           55     //  Assignment Operation (generated)
 79       G4Decay & operator=(const G4Decay &right     56       G4Decay & operator=(const G4Decay &right);
 80                                                    57 
 81   public: //With Description                       58   public: //With Description
 82      // G4Decay Process has both                   59      // G4Decay Process has both 
 83      // PostStepDoIt (for decay in flight)         60      // PostStepDoIt (for decay in flight) 
 84      //   and                                      61      //   and 
 85      // AtRestDoIt (for decay at rest)             62      // AtRestDoIt (for decay at rest)
 86                                                    63   
 87      virtual G4VParticleChange *PostStepDoIt(      64      virtual G4VParticleChange *PostStepDoIt(
 88            const G4Track& aTrack,                  65            const G4Track& aTrack,
 89                              const G4Step& aSt     66                              const G4Step& aStep
 90                             ) override;        <<  67                             );
 91                                                    68 
 92      virtual G4VParticleChange* AtRestDoIt(        69      virtual G4VParticleChange* AtRestDoIt(
 93            const G4Track& aTrack,                  70            const G4Track& aTrack,
 94            const G4Step&  aStep                    71            const G4Step&  aStep
 95           ) override;                          <<  72           );
 96                                                    73 
 97      virtual void BuildPhysicsTable(const G4Pa <<  74      virtual void BuildPhysicsTable(const G4ParticleDefinition&); 
 98      // In G4Decay, thePhysicsTable stores val     75      // In G4Decay, thePhysicsTable stores values of
 99     //    beta * std::sqrt( 1 - beta*beta)     <<  76     //    beta * sqrt( 1 - beta*beta) 
100     //  as a function of normalized kinetic en     77     //  as a function of normalized kinetic enregy (=Ekin/mass),
101     //  becasuse this table is universal for a     78     //  becasuse this table is universal for all particle types,
102                                                    79 
103                                                    80 
104     virtual G4bool IsApplicable(const G4Partic <<  81     virtual G4bool IsApplicable(const G4ParticleDefinition&);
105     // returns "true" if the decay process can     82     // returns "true" if the decay process can be applied to
106     // the particle type.                          83     // the particle type. 
107                                                    84  
108   protected: // With Description                   85   protected: // With Description
109     virtual G4VParticleChange* DecayIt(            86     virtual G4VParticleChange* DecayIt(
110            const G4Track& aTrack,                  87            const G4Track& aTrack,
111            const G4Step&  aStep                    88            const G4Step&  aStep
112           );                                       89           );
113     // The DecayIt() method returns by pointer     90     // The DecayIt() method returns by pointer a particle-change object,
114     // which has information of daughter parti     91     // which has information of daughter particles.
115                                                    92 
116     // Set daughter polarization               <<  93   public:
117     //  NO OPERATION in the base class of G4De << 
118     virtual void DaughterPolarization(const G4 << 
119             G4DecayProducts* products);        << 
120                                                << 
121  public:                                       << 
122     virtual G4double AtRestGetPhysicalInteract     94     virtual G4double AtRestGetPhysicalInteractionLength(
123                              const G4Track& tr     95                              const G4Track& track,
124                              G4ForceCondition*     96                              G4ForceCondition* condition
125                             ) override;        <<  97                             );
126                                                    98 
127     virtual G4double PostStepGetPhysicalIntera     99     virtual G4double PostStepGetPhysicalInteractionLength(
128                              const G4Track& tr    100                              const G4Track& track,
129                              G4double   previo    101                              G4double   previousStepSize,
130                              G4ForceCondition*    102                              G4ForceCondition* condition
131                             ) override;        << 103                             );
                                                   >> 104 
132                                                   105 
133   protected: // With Description                  106   protected: // With Description
134     // GetMeanFreePath returns ctau*beta*gamma    107     // GetMeanFreePath returns ctau*beta*gamma for decay in flight 
135     // GetMeanLifeTime returns ctau for decay     108     // GetMeanLifeTime returns ctau for decay at rest
136     virtual G4double GetMeanFreePath(const G4T    109     virtual G4double GetMeanFreePath(const G4Track& aTrack,
137                               G4double   previ    110                               G4double   previousStepSize,
138                               G4ForceCondition    111                               G4ForceCondition* condition
139                              ) override;       << 112                              );
140                                                   113 
141     virtual G4double GetMeanLifeTime(const G4T    114     virtual G4double GetMeanLifeTime(const G4Track& aTrack,
142                               G4ForceCondition    115                               G4ForceCondition* condition
143                             ) override;        << 116                             );
144                                                << 
145    public: //With Description                  << 
146      virtual void StartTracking(G4Track*) over << 
147      virtual void EndTracking() override;      << 
148       // inform Start/End of tracking for each << 
149                                                   117 
150    public: //With Description                  << 118   public: //With Description
151      void SetExtDecayer(G4VExtDecayer*);          119      void SetExtDecayer(G4VExtDecayer*);
152      const G4VExtDecayer* GetExtDecayer() cons    120      const G4VExtDecayer* GetExtDecayer() const;
153      // Set/Get External Decayer                  121      // Set/Get External Decayer
154                                                << 122     
155     G4double GetRemainderLifeTime() const;     << 123   public:
156     //Get Remainder of life time at rest decay << 124      void  SetVerboseLevel(G4int value);
157                                                << 125      G4int GetVerboseLevel() const;
158     virtual void ProcessDescription(std::ostre << 
159     //                                         << 
160                                                   126 
161   protected:                                   << 127   private:
162      G4int verboseLevel;                          128      G4int verboseLevel;
163      // controle flag for output message          129      // controle flag for output message
164      //  0: Silent                                130      //  0: Silent
165      //  1: Warning message                       131      //  1: Warning message
166      //  2: More                                  132      //  2: More
167                                                   133 
168   protected:                                   << 134   private:
169     // HighestValue.                           << 135     // In G4Decay, thePhysicsTable stores values of
170     const G4double HighestValue;               << 136     //    beta * sqrt( 1 - beta*beta) 
                                                   >> 137     //  as a function of normalized kinetic enregy (=Ekin/mass)
                                                   >> 138     // TotBin = number of bins in thePhysicsTable
                                                   >> 139     // The PhysicsTable is created for the range of  
                                                   >> 140     // from LowestBinValue to HighestBinValue.
                                                   >> 141     const G4double LowestBinValue;
                                                   >> 142     const G4double HighestBinValue;
                                                   >> 143     const G4int    TotBin;
                                                   >> 144     
                                                   >> 145     G4PhysicsTable* aPhysicsTable;
171                                                   146  
172     // Remainder of life time at rest             147     // Remainder of life time at rest
173     G4double                 fRemainderLifeTim    148     G4double                 fRemainderLifeTime;
174                                                << 149  
175     // ParticleChange for decay process           150     // ParticleChange for decay process
176     G4ParticleChangeForDecay fParticleChangeFo    151     G4ParticleChangeForDecay fParticleChangeForDecay;
177                                                   152     
178     // External Decayer                           153     // External Decayer
179     G4VExtDecayer*    pExtDecayer;                154     G4VExtDecayer*    pExtDecayer;
180 };                                                155 };
181                                                   156 
                                                   >> 157 inline G4double G4Decay::PostStepGetPhysicalInteractionLength(
                                                   >> 158                              const G4Track& track,
                                                   >> 159                              G4double   previousStepSize,
                                                   >> 160                              G4ForceCondition* condition
                                                   >> 161                             )
                                                   >> 162 {
                                                   >> 163   // pre-assigned Decay time
                                                   >> 164   G4double pTime = track.GetDynamicParticle()->GetPreAssignedDecayProperTime();
                                                   >> 165 
                                                   >> 166   if (pTime < 0.) {
                                                   >> 167     // normal case 
                                                   >> 168     return G4VRestDiscreteProcess::PostStepGetPhysicalInteractionLength(track, previousStepSize, condition);
                                                   >> 169   }
                                                   >> 170 
                                                   >> 171   // condition is set to "Not Forced"
                                                   >> 172   *condition = NotForced;
                                                   >> 173   
                                                   >> 174   // reminder proper time
                                                   >> 175   fRemainderLifeTime = pTime - track.GetProperTime();
                                                   >> 176   if (fRemainderLifeTime <= 0.0) fRemainderLifeTime = DBL_MIN;
                                                   >> 177   
                                                   >> 178   // use pre-assigned Decay time to determine PIL
                                                   >> 179   G4double tau = track.GetDefinition()->GetPDGLifeTime();
                                                   >> 180   return (fRemainderLifeTime/tau)*GetMeanFreePath(track, previousStepSize, condition);
                                                   >> 181 
                                                   >> 182 }
                                                   >> 183 inline
                                                   >> 184   G4double G4Decay::AtRestGetPhysicalInteractionLength(
                                                   >> 185                              const G4Track& track,
                                                   >> 186                              G4ForceCondition* condition
                                                   >> 187                             )
                                                   >> 188 {
                                                   >> 189   G4double pTime = track.GetDynamicParticle()->GetPreAssignedDecayProperTime();
                                                   >> 190   if (pTime >= 0.) {
                                                   >> 191     fRemainderLifeTime = pTime - track.GetProperTime();
                                                   >> 192     if (fRemainderLifeTime <= 0.0) fRemainderLifeTime = DBL_MIN;
                                                   >> 193   } else {
                                                   >> 194     fRemainderLifeTime = 
                                                   >> 195       G4VRestDiscreteProcess::AtRestGetPhysicalInteractionLength(track, condition );
                                                   >> 196   }
                                                   >> 197   return fRemainderLifeTime;
                                                   >> 198 }
                                                   >> 199 
                                                   >> 200 inline
                                                   >> 201  void  G4Decay::SetVerboseLevel(G4int value){ verboseLevel = value; }
                                                   >> 202 
                                                   >> 203 inline
                                                   >> 204  G4int G4Decay::GetVerboseLevel() const { return verboseLevel; }
                                                   >> 205 
182 inline                                            206 inline  
183   G4VParticleChange* G4Decay::AtRestDoIt(         207   G4VParticleChange* G4Decay::AtRestDoIt(
184            const G4Track& aTrack,                 208            const G4Track& aTrack,
185            const G4Step&  aStep                   209            const G4Step&  aStep
186           )                                       210           )
187 {                                                 211 {
188   return DecayIt(aTrack, aStep);                  212   return DecayIt(aTrack, aStep);
189 }                                                 213 }
190                                                   214 
                                                   >> 215 inline  
                                                   >> 216   G4VParticleChange* G4Decay::PostStepDoIt(
                                                   >> 217            const G4Track& aTrack,
                                                   >> 218            const G4Step&  aStep
                                                   >> 219           )
                                                   >> 220 {
                                                   >> 221   return DecayIt(aTrack, aStep);
                                                   >> 222 }
191                                                   223 
192 inline                                            224 inline
193  const G4VExtDecayer* G4Decay::GetExtDecayer() << 225  void G4Decay::SetExtDecayer(G4VExtDecayer* val)
194 {                                                 226 {
195   return pExtDecayer;                          << 227   pExtDecayer = val;
196 }                                                 228 }
197                                                   229 
198 inline                                            230 inline
199  G4double G4Decay::GetRemainderLifeTime() cons << 231  const G4VExtDecayer* G4Decay::GetExtDecayer() const
200 {                                                 232 {
201   return fRemainderLifeTime;                   << 233   return pExtDecayer;
202 }                                                 234 }
203                                                   235 
204 #endif                                            236 #endif
205                                                   237 
206                                                   238 
207                                                   239 
208                                                   240 
209                                                   241 
210                                                   242 
211                                                   243 
212                                                   244 
213                                                   245 
214                                                   246 
215                                                   247