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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 /track/include/G4ParticleChange.hh (Version 11.3.0) and /track/include/G4ParticleChange.hh (Version 7.0.p1)


  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 // G4ParticleChange                            << 
 27 //                                                 23 //
 28 // Class description:                          <<  24 // $Id: G4ParticleChange.hh,v 1.11 2004/10/19 00:51:29 kurasige Exp $
                                                   >>  25 // GEANT4 tag $Name: geant4-07-00-patch-01 $
 29 //                                                 26 //
 30 // Concrete class for ParticleChange containin <<  27 // 
 31 // invocation of a physics process.            <<  28 // ------------------------------------------------------------
 32 // This includes final states of parent partic <<  29 //  GEANT 4 class header file 
 33 // etc) and secondary particles generated by t << 
 34 // The tracking assumes that all the values of << 
 35 // are in global reference system, therefore a << 
 36 // transformations must have been already comp << 
 37 // data-members of this class.                 << 
 38 //                                                 30 //
 39 // IMPORTANT NOTE: Despite the name, what this <<  31 // 
 40 // through its methods, are the "FINAL" values <<  32 // ------------------------------------------------------------
 41 // Momentum, etc.                              <<  33 //   Implemented for the new scheme                 23 Mar. 1998  H.Kurahige
 42                                                <<  34 //
 43 // Author: Hisaya Kurashige, 23 March 1998     <<  35 // Class Description
 44 // ------------------------------------------- <<  36 //  This class is a concrete class for ParticleChange which
 45 #ifndef G4ParticleChange_hh                    <<  37 //  has all functionality in old scheme.
 46 #define G4ParticleChange_hh 1                  <<  38 //-
                                                   >>  39 //  This class contains the results after invocation of a physics process.
                                                   >>  40 //  This includes final states of parent particle (momentum, energy,
                                                   >>  41 //  etc) and secondary particles generated by the interaction.
                                                   >>  42 //  The tracking assumes that all the values of energy and
                                                   >>  43 //  momentum are in global reference system, therefore all the
                                                   >>  44 //  needed Lorentz transformations must have been already Done
                                                   >>  45 //  when filling the data-members of this class.
                                                   >>  46 //-
                                                   >>  47 //  ---------------------------------------------------------------
                                                   >>  48 //  IMPORTANT NOTE: Although the name of the class and methods are
                                                   >>  49 //   "Change", what it stores (and returns in get) are the "FINAL" 
                                                   >>  50 //   values of the Position, Momentum, etc.
                                                   >>  51 // 
                                                   >>  52 //  ------------------------------------------------------------
                                                   >>  53 //  modify AddSecondary methods for "GoodForTracking" flag 
                                                   >>  54 //                                                 8 June 1998 H.Kurashige
                                                   >>  55 //   Add Track weight                              12 Nov. 1998  H.Kurashige
                                                   >>  56 //   Add Get/SetMomentumDirectionChange             6 Feb. 1999 H.Kurashige 
                                                   >>  57 //   Add get/SetDynamicMass                        5 Oct. 1999 H.Kurashige
                                                   >>  58 //   Add get/SetDynamicCharge                       5 Oct. 1999 H.Kurashige
                                                   >>  59 // -------------------------------------------------------------
                                                   >>  60  
                                                   >>  61 #ifndef G4ParticleChange_h
                                                   >>  62 #define G4ParticleChange_h 1
 47                                                    63 
 48 #include "globals.hh"                              64 #include "globals.hh"
 49 #include "G4ios.hh"                                65 #include "G4ios.hh"
 50 #include "G4ThreeVector.hh"                        66 #include "G4ThreeVector.hh"
 51 #include "G4VParticleChange.hh"                <<  67 #include "G4ThreeVector.hh"
 52                                                << 
 53 class G4DynamicParticle;                           68 class G4DynamicParticle;
                                                   >>  69 #include "G4VParticleChange.hh"
 54                                                    70 
 55 class G4ParticleChange : public G4VParticleCha <<  71 class G4ParticleChange: public G4VParticleChange
 56 {                                              <<  72 { 
 57   public:                                          73   public:
 58                                                <<  74     // default constructor
 59     G4ParticleChange();                            75     G4ParticleChange();
 60       // Default constructor                   <<  76 //    G4ParticleChange(G4bool useEB);
                                                   >>  77 
                                                   >>  78     // destructor
                                                   >>  79     virtual ~G4ParticleChange();
                                                   >>  80 
                                                   >>  81   protected:
                                                   >>  82     // hide copy constructor and assignment operaor as protected
                                                   >>  83     G4ParticleChange(const G4ParticleChange &right);
                                                   >>  84     G4ParticleChange & operator=(const G4ParticleChange &right);
 61                                                    85 
 62     ~G4ParticleChange() override = default;    <<  86   public:
 63       // Destructor                            <<  87     // equal/unequal operator
                                                   >>  88     G4bool operator==(const G4ParticleChange &right) const;
                                                   >>  89     G4bool operator!=(const G4ParticleChange &right) const;
                                                   >>  90 
                                                   >>  91   public: // with description
                                                   >>  92     // ----------------------------------------------------
                                                   >>  93     // --- the following methods are for updating G4Step -----   
                                                   >>  94     // Return the pointer to the G4Step after updating the Step information
                                                   >>  95     // by using final state information of the track given by a physics
                                                   >>  96     // process    
                                                   >>  97     virtual G4Step* UpdateStepForAlongStep(G4Step* Step);
                                                   >>  98     // A physics process gives the final state of the particle 
                                                   >>  99     // relative to the initial state at the beginning of the Step,
                                                   >> 100     // i.e., based on information of G4Track (or equivalently 
                                                   >> 101     // the PreStepPoint)
                                                   >> 102     // In this method, the differences (delta) between these two states 
                                                   >> 103     // are calculated, and are accumulated in PostStepPoint.
                                                   >> 104     // Take note that the return type of GetMomentumChange is a
                                                   >> 105     // pointer to G4ParticleMometum. Also it is a normalized 
                                                   >> 106     // momentum vector.
                                                   >> 107     virtual G4Step* UpdateStepForAtRest(G4Step* Step);
                                                   >> 108     virtual G4Step* UpdateStepForPostStep(G4Step* Step);
                                                   >> 109     // A physics process gives the final state of the particle 
                                                   >> 110     // based on information of G4Track (or equivalently the PreStepPoint)
                                                   >> 111  
                                                   >> 112     virtual void Initialize(const G4Track&);
                                                   >> 113     // Initialize all propoerties by using G4Track information
 64                                                   114 
 65     G4ParticleChange(const G4ParticleChange& r << 115   protected: // with description
 66     G4ParticleChange& operator=(const G4Partic << 116     G4Step* UpdateStepInfo(G4Step* Step);
                                                   >> 117     //  Update the G4Step specific attributes 
                                                   >> 118     //  (i.e. SteppingControl, LocalEnergyDeposit, and TrueStepLength)
 67                                                   119 
 68   // --- the following methods are for updatin << 120   public:     // with description
 69   // Return the pointer to G4Step after updati << 121     
 70   // by using final state of the track given b << 122     // ----------------------------------------------------
 71                                                << 123     //--- methods to keep information of the final state--
 72     G4Step* UpdateStepForAlongStep(G4Step* Ste << 124     //  IMPORTANT NOTE: 
 73       // A physics process gives the final sta << 125     //  These ProposeXXX methods stores (and returns in GetXXX methods) 
 74       // relative to the initial state at the  << 126     //   the "FINAL" values of the Position, Momentum, etc.
 75       // i.e., based on information of G4Track << 127 
 76       // the PreStepPoint).                    << 128     const G4ThreeVector* GetMomentumDirection() const;
 77       // In this method, the differences (delt << 129     void ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz);
 78       // are calculated, and are accumulated i << 130     void ProposeMomentumDirection(const G4ThreeVector& Pfinal);
 79       // Take note that the return type of Get << 131     // Get/Propose the MomentumDirection vector: it is the final momentum direction.
 80       // pointer to G4ParticleMomentum. Also i << 132 
 81       // momentum vector                       << 133     const G4ThreeVector* GetPolarization() const;
 82                                                << 134     void  ProposePolarization(G4double Px, G4double Py, G4double Pz);
 83     G4Step* UpdateStepForAtRest(G4Step* Step)  << 135     void  ProposePolarization(const G4ThreeVector& finalPoralization);
 84     G4Step* UpdateStepForPostStep(G4Step* Step << 136     // Get/Propose the final Polarization vector.
 85       // A physics process gives the final sta << 137 
 86       // based on information of G4Track (or e << 138     G4double GetEnergy() const;
 87                                                << 139     void ProposeEnergy(G4double finalEnergy);
 88     void Initialize(const G4Track&) override;  << 140     // Get/Propose the final kinetic energy of the current particle.
 89       // Initialize all propoerties by using G << 141 
 90                                                << 142     G4double GetProperTime() const;
 91   // --- methods to keep information of the fi << 143     void ProposeProperTime(G4double finalProperTime);
 92   //                                           << 144     //  Get/Propose th final eProperTime 
 93   //  The ProposeXXX methods store (and return << 145 
 94   //  the "FINAL" values of the Position, Mome << 146     const G4ThreeVector* GetPosition() const;
 95                                                << 147     void ProposePosition(G4double x, G4double y, G4double z);
 96     inline const G4ThreeVector* GetMomentumDir << 148     void ProposePosition(const G4ThreeVector& finalPosition);
 97     inline void ProposeMomentumDirection(G4dou << 149     //  Get/Propose the final position of the current particle.
 98     inline void ProposeMomentumDirection(const << 150 
 99       // Get/Propose the MomentumDirection vec << 151     G4double GetGlobalTime() const;
100       // direction                             << 152     void ProposeGlobalTime(G4double finalGlobalTime);
101                                                << 153     //  Get/Propose the final GlobalTime
102     inline const G4ThreeVector* GetPolarizatio << 154  
103     inline void ProposePolarization(G4double P << 155     G4double GetMass() const;
104     inline void ProposePolarization(const G4Th << 156     void ProposeMass(G4double finalMass);
105       // Get/Propose the final Polarization ve << 157     //   Get/Propose the final dynamical Mass in G4DynamicParticle
106                                                << 158 
107     inline G4double GetEnergy() const;         << 159     G4double GetCharge() const;
108     inline void ProposeEnergy(G4double finalEn << 160     void ProposeCharge(G4double finalCharge);
109       // Get/Propose the final kinetic energy  << 161     //   Get/Propose the final dynamical Charge in G4DynamicParticl
110                                                << 162   
111     inline G4double GetVelocity() const;       << 163     G4double GetWeight() const;
112     inline void ProposeVelocity(G4double final << 164     void ProposeWeight(G4double finalWeight);
113       // Get/Propose the final velocity of the << 165     //   Get/Propose the final Weight of the current particle 
114                                                << 166 
115     inline G4double GetProperTime() const;     << 167     //  -- Utility functions --
116     inline void ProposeProperTime(G4double fin << 168     G4ThreeVector GetGlobalPosition(const G4ThreeVector& displacement) const;
117       // Get/Propose the final ProperTime      << 169     //  Convert the position displacement to the global position.
118                                                << 170 
119     inline const G4ThreeVector* GetPosition()  << 171     G4double GetGlobalTime(G4double timeDelay) const;
120     inline void ProposePosition(G4double x, G4 << 172     //  Convert the time delay to the global time.
121     inline void ProposePosition(const G4ThreeV << 173 
122       // Get/Propose the final position of the << 174     G4ThreeVector CalcMomentum(G4double           energy,
123                                                << 175              G4ThreeVector direction,
124     inline void ProposeGlobalTime(G4double t); << 176              G4double           mass      ) const;
125     inline void ProposeLocalTime(G4double t);  << 177     //  Calculate momentum by using Energy, Momentum Direction, and Mass 
126       // Get/Propose the final global/local Ti << 178     // ----------------------------------------------------
127       // NOTE: DO NOT INVOKE both methods in a << 
128       //       Each method affects both local  << 
129                                                << 
130     inline G4double GetGlobalTime(G4double tim << 
131     inline G4double GetLocalTime(G4double time << 
132       // Convert the time delay to the glocbal << 
133       // Can get the final global/local time w << 
134                                                << 
135     inline G4double GetMass() const;           << 
136     inline void ProposeMass(G4double finalMass << 
137       // Get/Propose the final dynamical mass  << 
138                                                << 
139     inline G4double GetCharge() const;         << 
140     inline void ProposeCharge(G4double finalCh << 
141       // Get/Propose the final dynamical charg << 
142                                                << 
143     inline G4double GetMagneticMoment() const; << 
144     inline void ProposeMagneticMoment(G4double << 
145       // Get/Propose the final MagneticMoment  << 
146                                                << 
147     inline G4ThreeVector                       << 
148     GetGlobalPosition(const G4ThreeVector& dis << 
149       // Convert the position displacement to  << 
150                                                << 
151     inline G4ThreeVector CalcMomentum(G4double << 
152                                       G4double << 
153       // Calculate momentum by using Energy, M << 
154                                                   179 
155   // --- methods for adding secondaries ---    << 
156                                                   180 
                                                   >> 181     // ----------------------------------------------------
                                                   >> 182     // --- methods for adding secondaries
157     void AddSecondary(G4Track* aSecondary);       183     void AddSecondary(G4Track* aSecondary);
158       // Add a secondary particle to theListOf << 184     //  Add a secondary particle to theListOfSecondaries.
159                                                   185 
160     void AddSecondary(G4DynamicParticle* aSeco    186     void AddSecondary(G4DynamicParticle* aSecondary,
161                       G4bool IsGoodForTracking << 187           G4bool             IsGoodForTracking = false );
162       // Add a secondary particle to theListOf << 188     //  Add a secondary particle to theListOfSecondaries.
163       // Position and time are same as thePosi << 189     //  position and time are same as thePositionChange and theTimeChange 
164                                                << 190 
165     void AddSecondary(G4DynamicParticle* aSeco << 191     void AddSecondary(G4DynamicParticle* aSecondary, 
166                       G4bool IsGoodForTracking << 192           G4ThreeVector      position,
167       // Add a secondary particle to theListOf << 193           G4bool             IsGoodForTracking = false   );
168       // Global time are same as theTimeChange << 194     //  Add a secondary particle to theListOfSecondaries.
169                                                << 195     //  global time are same as theTimeChange and theTimeChange 
170     void AddSecondary(G4DynamicParticle* aSeco << 196 
171                       G4bool IsGoodForTracking << 197     void AddSecondary(G4DynamicParticle* aSecondary, 
172       // Add a secondary particle to theListOf << 198           G4double           time,
173       // Position and are same as thePositionC << 199           G4bool             IsGoodForTracking = false );
174                                                << 200     //  Add a secondary particle to theListOfSecondaries.
175   // --- Dump and debug methods ---            << 201     //  position and are same as thePositionChange  
                                                   >> 202     // ----------------------------------------------------
176                                                   203 
177     void DumpInfo() const override;            << 204   public:
                                                   >> 205     virtual void DumpInfo() const;
178                                                   206 
179   protected:                                      207   protected:
180                                                << 
181     G4Step* UpdateStepInfo(G4Step* Step);      << 
182       // Update the G4Step specific attributes << 
183       // (i.e. SteppingControl, LocalEnergyDep << 
184                                                << 
185     G4ThreeVector theMomentumDirectionChange;     208     G4ThreeVector theMomentumDirectionChange;
186       // It is the vector containing the final << 209     //  It is the vector containing the final momentum direction
187       // after the invoked process. The applic << 210     //  after the invoked process. The application of the change
188       // of the momentum direction of the part << 211     //  of the momentum direction of the particle is not Done here.
189       // The responsibility to apply the chang << 212     //  The responsibility to apply the change is up the entity
190       // which invoked the process             << 213     //  which invoked the process.
191                                                   214 
192     G4ThreeVector thePolarizationChange;          215     G4ThreeVector thePolarizationChange;
193       // The changed (final) polarization of a << 216     //  The changed (final) polarization of a given track
                                                   >> 217     
                                                   >> 218     G4double theEnergyChange;
                                                   >> 219     //  The final kinetic energy of the current track
                                                   >> 220     
                                                   >> 221     G4ThreeVector thePositionChange;
                                                   >> 222     //  The changed (final) position of a given track
                                                   >> 223     
                                                   >> 224     G4double theTimeChange;
                                                   >> 225     //  The changed (final) global time of a given track
                                                   >> 226     
                                                   >> 227     G4double theProperTimeChange;
                                                   >> 228     //  The changed (final) proper time of a given track
                                                   >> 229     
                                                   >> 230     G4double theWeightChange;
                                                   >> 231     //  The Changed (final) weight of a given track
                                                   >> 232 
                                                   >> 233     G4double theMassChange;
                                                   >> 234     //  The Changed (final) mass of a given track
                                                   >> 235 
                                                   >> 236     G4double theChargeChange;
                                                   >> 237     //  The Changed (final) charge of a given track
                                                   >> 238   
                                                   >> 239     const G4Track* theCurrentTrack;
                                                   >> 240     
                                                   >> 241   public:
                                                   >> 242     // for Debug 
                                                   >> 243     virtual G4bool CheckIt(const G4Track&);
                                                   >> 244 };
                                                   >> 245 
                                                   >> 246 #include "G4ParticleChange.icc"
                                                   >> 247 
                                                   >> 248 #endif
                                                   >> 249 
                                                   >> 250 
                                                   >> 251 
                                                   >> 252 
                                                   >> 253 
194                                                   254 
195     G4double theEnergyChange = 0.0;            << 
196       // The final kinetic energy of the curre << 
197                                                   255 
198     G4double theVelocityChange = 0.0;          << 
199     G4bool isVelocityChanged = false;          << 
200       // The final velocity of the current tra << 
201                                                   256 
202     G4ThreeVector thePositionChange;           << 
203       // The changed (final) position of a giv << 
204                                                   257 
205     G4double theGlobalTime0 = 0.0;             << 
206       // The global time at Initial            << 
207     G4double theLocalTime0 = 0.0;              << 
208       // The local time at Initial             << 
209                                                   258 
210     G4double theTimeChange = 0.0;              << 
211       // The change of local time of a given p << 
212                                                   259 
213     G4double theProperTimeChange = 0.0;        << 
214       // The changed (final) proper time of a  << 
215                                                   260 
216     G4double theMassChange = 0.0;              << 
217       // The Changed (final) mass of a given t << 
218                                                   261 
219     G4double theChargeChange = 0.0;            << 
220      // The Changed (final) charge of a given  << 
221                                                   262 
222     G4double theMagneticMomentChange = 0.0;    << 
223      // The Changed (final) MagneticMoment of  << 
224 };                                             << 
225                                                   263 
226 #include "G4ParticleChange.icc"                << 
227                                                   264 
228 #endif                                         << 
229                                                   265