ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4ParticleChange.hh
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file G4ParticleChange.hh
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 //
27 //
28 //
29 // ------------------------------------------------------------
30 // GEANT 4 class header file
31 //
32 //
33 // ------------------------------------------------------------
34 // Implemented for the new scheme 23 Mar. 1998 H.Kurahige
35 //
36 // Class Description
37 // This class is a concrete class for ParticleChange which
38 // has all functionality in old scheme.
39 //-
40 // This class contains the results after invocation of a physics process.
41 // This includes final states of parent particle (momentum, energy,
42 // etc) and secondary particles generated by the interaction.
43 // The tracking assumes that all the values of energy and
44 // momentum are in global reference system, therefore all the
45 // needed Lorentz transformations must have been already Done
46 // when filling the data-members of this class.
47 //-
48 // ---------------------------------------------------------------
49 // IMPORTANT NOTE: Although the name of the class and methods are
50 // "Change", what it stores (and returns in get) are the "FINAL"
51 // values of the Position, Momentum, etc.
52 //
53 // ------------------------------------------------------------
54 // modify AddSecondary methods for "GoodForTracking" flag
55 // 8 June 1998 H.Kurashige
56 // Add Track weight 12 Nov. 1998 H.Kurashige
57 // Add Get/SetMomentumDirectionChange 6 Feb. 1999 H.Kurashige
58 // Add Get/SetDynamicMass 5 Oct. 1999 H.Kurashige
59 // Add Get/SetDynamicCharge 5 Oct. 1999 H.Kurashige
60 // Rename SetXXX methods to ProposeXXX DynamicCharge Oct. 2005 H.Kurashige
61 // Add get/ProposeMagneticMoment Mar 2007 H.Kurashige
62 // Fix treatment of weight Mar 2007 H.Kurashige
63 // Add Get/ProposeVelocity Apr 2011 H.Kurashige
64 // -------------------------------------------------------------
65 
66 #ifndef G4ParticleChange_h
67 #define G4ParticleChange_h 1
68 
69 #include "globals.hh"
70 #include "G4ios.hh"
71 #include "G4ThreeVector.hh"
72 #include "G4ThreeVector.hh"
73 class G4DynamicParticle;
74 #include "G4VParticleChange.hh"
75 
77 {
78  public:
79  // default constructor
81 // G4ParticleChange(G4bool useEB);
82 
83  // destructor
84  virtual ~G4ParticleChange();
85 
86  protected:
87  // hide copy constructor and assignment operaor as protected
90 
91  public:
92  // equal/unequal operator
93  G4bool operator==(const G4ParticleChange &right) const;
94  G4bool operator!=(const G4ParticleChange &right) const;
95 
96  public: // with description
97  // ----------------------------------------------------
98  // --- the following methods are for updating G4Step -----
99  // Return the pointer to the G4Step after updating the Step information
100  // by using final state information of the track given by a physics
101  // process
102  virtual G4Step* UpdateStepForAlongStep(G4Step* Step);
103  // A physics process gives the final state of the particle
104  // relative to the initial state at the beginning of the Step,
105  // i.e., based on information of G4Track (or equivalently
106  // the PreStepPoint)
107  // In this method, the differences (delta) between these two states
108  // are calculated, and are accumulated in PostStepPoint.
109  // Take note that the return type of GetMomentumChange is a
110  // pointer to G4ParticleMometum. Also it is a normalized
111  // momentum vector.
112  virtual G4Step* UpdateStepForAtRest(G4Step* Step);
113  virtual G4Step* UpdateStepForPostStep(G4Step* Step);
114  // A physics process gives the final state of the particle
115  // based on information of G4Track (or equivalently the PreStepPoint)
116 
117  virtual void Initialize(const G4Track&);
118  // Initialize all propoerties by using G4Track information
119 
120  protected: // with description
121  G4Step* UpdateStepInfo(G4Step* Step);
122  // Update the G4Step specific attributes
123  // (i.e. SteppingControl, LocalEnergyDeposit, and TrueStepLength)
124 
125  public: // with description
126 
127  // ----------------------------------------------------
128  //--- methods to keep information of the final state--
129  // IMPORTANT NOTE:
130  // These ProposeXXX methods stores (and returns in GetXXX methods)
131  // the "FINAL" values of the Position, Momentum, etc.
132 
133  const G4ThreeVector* GetMomentumDirection() const;
135  void ProposeMomentumDirection(const G4ThreeVector& Pfinal);
136  // Get/Propose the MomentumDirection vector: it is the final momentum direction.
137 
138  const G4ThreeVector* GetPolarization() const;
140  void ProposePolarization(const G4ThreeVector& finalPoralization);
141  // Get/Propose the final Polarization vector.
142 
143  G4double GetEnergy() const;
144  void ProposeEnergy(G4double finalEnergy);
145  // Get/Propose the final kinetic energy of the current particle.
146 
147  G4double GetVelocity() const;
148  void ProposeVelocity(G4double finalVelocity);
149  // Get/Propose the final velocity of the current particle.
150 
151  G4double GetProperTime() const;
152  void ProposeProperTime(G4double finalProperTime);
153  // Get/Propose th final ProperTime
154 
155  const G4ThreeVector* GetPosition() const;
157  void ProposePosition(const G4ThreeVector& finalPosition);
158  // Get/Propose the final position of the current particle.
159 
161  void ProposeLocalTime(G4double t);
162  // Get/Propose the final global/local Time
163  // NOTE: DO NOT INVOKE both methods in a step
164  // Each method affects both local and global time
165 
166  G4double GetGlobalTime(G4double timeDelay=0.0) const;
167  G4double GetLocalTime(G4double timeDelay=0.0) const;
168  // Convert the time delay to the glocbal/local time.
169  // Can get the final global/local Time without argument
170 
171  G4double GetMass() const;
172  void ProposeMass(G4double finalMass);
173  // Get/Propose the final dynamical Mass in G4DynamicParticle
174 
175  G4double GetCharge() const;
176  void ProposeCharge(G4double finalCharge);
177  // Get/Propose the final dynamical Charge in G4DynamicParticle
178 
179  G4double GetMagneticMoment() const;
180  void ProposeMagneticMoment(G4double finalMagneticMoment);
181  // Get/Propose the final MagneticMoment in G4DynamicParticle
182 
183  G4ThreeVector GetGlobalPosition(const G4ThreeVector& displacement) const;
184  // Convert the position displacement to the global position.
185 
187  G4ThreeVector direction,
188  G4double mass ) const;
189  // Calculate momentum by using Energy, Momentum Direction, and Mass
190 
191 
192 
193  // ----------------------------------------------------
194  // --- methods for adding secondaries
195  void AddSecondary(G4Track* aSecondary);
196  // Add a secondary particle to theListOfSecondaries.
197 
198  void AddSecondary(G4DynamicParticle* aSecondary,
199  G4bool IsGoodForTracking = false );
200  // Add a secondary particle to theListOfSecondaries.
201  // position and time are same as thePositionChange and theTimeChange
202 
203  void AddSecondary(G4DynamicParticle* aSecondary,
205  G4bool IsGoodForTracking = false );
206  // Add a secondary particle to theListOfSecondaries.
207  // global time are same as theTimeChange and theTimeChange
208 
209  void AddSecondary(G4DynamicParticle* aSecondary,
210  G4double time,
211  G4bool IsGoodForTracking = false );
212  // Add a secondary particle to theListOfSecondaries.
213  // position and are same as thePositionChange
214  // ----------------------------------------------------
215 
216  public:
217  virtual void DumpInfo() const;
218 
219  protected:
221  // It is the vector containing the final momentum direction
222  // after the invoked process. The application of the change
223  // of the momentum direction of the particle is not Done here.
224  // The responsibility to apply the change is up the entity
225  // which invoked the process.
226 
228  // The changed (final) polarization of a given track
229 
231  // The final kinetic energy of the current track
232 
235  // The final velocity of the current track
236 
238  // The changed (final) position of a given track
239 
241  // The global time at Initial.
243  // The local time at Initial.
244 
246  // The change of local time of a given particle.
247 
249  // The changed (final) proper time of a given track
250 
252  // The Changed (final) mass of a given track
253 
255  // The Changed (final) charge of a given track
256 
258  // The Changed (final) MagneticMoment of a given track
259 
261 
262  public:
263  // for Debug
264  virtual G4bool CheckIt(const G4Track&);
265 };
266 
267 #include "G4ParticleChange.icc"
268 
269 #endif
270 
271 
272 
273 
274 
275 
276 
277 
278 
279 
280 
281 
282 
283 
284 
285