00001 /* BDSIM code. Version 1.0 00002 Author: Grahame A. Blair, Royal Holloway, Univ. of London. 00003 Last modified 3.11.2002 00004 Copyright (c) 2002 by G.A.Blair. ALL RIGHTS RESERVED. 00005 */ 00006 // 00007 // ******************************************************************** 00008 // * DISCLAIMER * 00009 // * * 00010 // * The following disclaimer summarizes all the specific disclaimers * 00011 // * of contributors to this software. The specific disclaimers,which * 00012 // * govern, are listed with their locations in: * 00013 // * http://cern.ch/geant4/license * 00014 // * * 00015 // * Neither the authors of this software system, nor their employing * 00016 // * institutes,nor the agencies providing financial support for this * 00017 // * work make any representation or warranty, express or implied, * 00018 // * regarding this software system or assume any liability for its * 00019 // * use. * 00020 // * * 00021 // * This code implementation is the intellectual property of the * 00022 // * GEANT4 collaboration. * 00023 // * By copying, distributing or modifying the Program (or any work * 00024 // * based on the Program) you indicate your acceptance of this * 00025 // * statement, and all its terms. * 00026 // ******************************************************************** 00027 // 00028 // 00029 // $Id: BDSConvParticleChange.hh,v 1.1 2005/01/22 17:05:30 agapov Exp $ 00030 // GEANT4 tag $Name: $ 00031 // 00032 // 00033 // ------------------------------------------------------------ 00034 // GEANT 4 class header file 00035 // 00036 // 00037 // ------------------------------------------------------------ 00038 // Implemented for the new scheme 23 Mar. 1998 H.Kurahige 00039 // 00040 // Class Description 00041 // This class is a concrete class for ParticleChange which 00042 // has all functionality in old scheme. 00043 //- 00044 // This class contains the results after invocation of a physics process. 00045 // This includes final states of parent particle (momentum, energy, 00046 // etc) and secondary particles generated by the interaction. 00047 // The tracking assumes that all the values of energy and 00048 // momentum are in global reference system, therefore all the 00049 // needed Lorentz transformations must have been already Done 00050 // when filling the data-members of this class. 00051 //- 00052 // --------------------------------------------------------------- 00053 // IMPORTANT NOTE: Although the name of the class and methods are 00054 // "Change", what it stores (and returns in get) are the "FINAL" 00055 // values of the Position, Momentum, etc. 00056 // 00057 // ------------------------------------------------------------ 00058 // modify AddSecondary methods for "GoodForTracking" flag 00059 // 8 June 1998 H.Kurashige 00060 // Add Track weight 12 Nov. 1998 H.Kurashige 00061 // Add Get/SetMomentumDirectionChange 6 Feb. 1999 H.Kurashige 00062 // Add get/SetDynamicMass 5 Oct. 1999 H.Kurashige 00063 // Add get/SetDynamicCharge 5 Oct. 1999 H.Kurashige 00064 // ------------------------------------------------------------- 00065 00066 #ifndef BDSConvParticleChange_h 00067 #define BDSConvParticleChange_h 1 00068 00069 #include "globals.hh" 00070 #include "G4ios.hh" 00071 #include "G4ThreeVector.hh" 00072 #include "G4ThreeVector.hh" 00073 class G4DynamicParticle; 00074 #include "G4VParticleChange.hh" 00075 00076 class BDSConvParticleChange: public G4VParticleChange 00077 { 00078 public: 00079 // default constructor 00080 BDSConvParticleChange(); 00081 // BDSConvParticleChange(G4bool useEB); 00082 00083 // destructor 00084 virtual ~BDSConvParticleChange(); 00085 00086 protected: 00087 // hide copy constructor and assignment operaor as protected 00088 BDSConvParticleChange(const BDSConvParticleChange &right); 00089 BDSConvParticleChange & operator=(const BDSConvParticleChange &right); 00090 00091 public: 00092 // equal/unequal operator 00093 G4bool operator==(const BDSConvParticleChange &right) const; 00094 G4bool operator!=(const BDSConvParticleChange &right) const; 00095 00096 public: // with description 00097 // ---------------------------------------------------- 00098 // --- the following methods are for updating G4Step ----- 00099 // Return the pointer to the G4Step after updating the Step information 00100 // by using final state information of the track given by a physics 00101 // process 00102 virtual G4Step* UpdateStepForAlongStep(G4Step* Step); 00103 // A physics process gives the final state of the particle 00104 // relative to the initial state at the beginning of the Step, 00105 // i.e., based on information of G4Track (or equivalently 00106 // the PreStepPoint) 00107 // In this method, the differences (delta) between these two states 00108 // are calculated, and are accumulated in PostStepPoint. 00109 // Take note that the return type of GetMomentumChange is a 00110 // pointer to G4ParticleMometum. Also it is a normalized 00111 // momentum vector. 00112 virtual G4Step* UpdateStepForAtRest(G4Step* Step); 00113 virtual G4Step* UpdateStepForPostStep(G4Step* Step); 00114 // A physics process gives the final state of the particle 00115 // based on information of G4Track (or equivalently the PreStepPoint) 00116 00117 virtual void Initialize(const G4Track&); 00118 // Initialize all propoerties by using G4Track information 00119 00120 00121 void SetMuonWeight(G4double aMuonWeight); 00122 00123 protected: // with description 00124 G4Step* UpdateStepInfo(G4Step* Step); 00125 // Update the G4Step specific attributes 00126 // (i.e. SteppingControl, LocalEnergyDeposit, and TrueStepLength) 00127 00128 public: // with description 00129 00130 // ---------------------------------------------------- 00131 //--- methods to keep information of the final state-- 00132 // IMPORTANT NOTE: Although the name of the class and methods are 00133 // "Change", what it stores (and returns in get) are the "FINAL" 00134 // values of the Position, Momentum, etc. 00135 00136 const G4ThreeVector* GetMomentumDirectionChange() const; 00137 void SetMomentumDirectionChange(G4double Px, G4double Py, G4double Pz); 00138 void SetMomentumDirectionChange(const G4ThreeVector& Pfinal); 00139 const G4ThreeVector* GetMomentumChange() const; 00140 void SetMomentumChange(G4double Px, G4double Py, G4double Pz); 00141 void SetMomentumChange(const G4ThreeVector& Pfinal); 00142 // Get/Set theMomentumDirectionChange vector: it is the final momentum direction. 00143 00144 const G4ThreeVector* GetPolarizationChange() const; 00145 void SetPolarizationChange(G4double Px, G4double Py, G4double Pz); 00146 void SetPolarizationChange(const G4ThreeVector& finalPoralization); 00147 // Get/Set thePolarizationChange vector. 00148 00149 G4double GetEnergyChange() const; 00150 void SetEnergyChange(G4double theEnergyChange); 00151 // Get/Set the final kinetic energy of the current particle. 00152 00153 G4double GetProperTimeChange() const; 00154 void SetProperTimeChange(G4double t); 00155 // Get/Set theProperTimeChange vector 00156 00157 const G4ThreeVector* GetPositionChange() const; 00158 void SetPositionChange(G4double x, G4double y, G4double z); 00159 void SetPositionChange(const G4ThreeVector& finalPosition); 00160 // Get/Set the final position of the current particle. 00161 00162 G4double GetTimeChange() const; 00163 void SetTimeChange(G4double t); 00164 // Get/Set theTimeChange vector. 00165 00166 G4double GetMassChange() const; 00167 void SetMassChange(G4double mass); 00168 // Get/Set theMassChange 00169 00170 G4double GetChargeChange() const; 00171 void SetChargeChange(G4double mass); 00172 // Get/Set theChargeChange 00173 00174 G4double GetWeightChange() const; 00175 void SetWeightChange(G4double w); 00176 // Get/Set theWeightChange 00177 00178 // -- Utility functions -- 00179 G4ThreeVector GetGlobalPosition(const G4ThreeVector& displacement) const; 00180 // Convert the position displacement to the global position. 00181 00182 G4double GetGlobalTime(G4double timeDelay) const; 00183 // Convert the time delay to the global time. 00184 00185 G4ThreeVector CalcMomentum(G4double energy, 00186 G4ThreeVector direction, 00187 G4double mass ) const; 00188 // Calculate momentum by using Energy, Momentum Direction, and Mass 00189 // ---------------------------------------------------- 00190 00191 00192 // ---------------------------------------------------- 00193 // --- methods for adding secondaries 00194 void AddSecondary(G4Track* aSecondary); 00195 // Add a secondary particle to theListOfSecondaries. 00196 00197 void AddSecondary(G4DynamicParticle* aSecondary, 00198 G4bool IsGoodForTracking = false ); 00199 // Add a secondary particle to theListOfSecondaries. 00200 // position and time are same as thePositionChange and theTimeChange 00201 00202 void AddSecondary(G4DynamicParticle* aSecondary, 00203 G4ThreeVector position, 00204 G4bool IsGoodForTracking = false ); 00205 // Add a secondary particle to theListOfSecondaries. 00206 // global time are same as theTimeChange and theTimeChange 00207 00208 void AddSecondary(G4DynamicParticle* aSecondary, 00209 G4double time, 00210 G4bool IsGoodForTracking = false ); 00211 // Add a secondary particle to theListOfSecondaries. 00212 // position and are same as thePositionChange 00213 // ---------------------------------------------------- 00214 00215 public: 00216 virtual void DumpInfo() const; 00217 00218 protected: 00219 G4ThreeVector theMomentumDirectionChange; 00220 // It is the vector containing the final momentum direction 00221 // after the invoked process. The application of the change 00222 // of the momentum direction of the particle is not Done here. 00223 // The responsibility to apply the change is up the entity 00224 // which invoked the process. 00225 00226 G4ThreeVector thePolarizationChange; 00227 // The changed (final) polarization of a given track 00228 00229 G4double theEnergyChange; 00230 // The final kinetic energy of the current track 00231 00232 G4ThreeVector thePositionChange; 00233 // The changed (final) position of a given track 00234 00235 G4double theTimeChange; 00236 // The changed (final) global time of a given track 00237 00238 G4double theProperTimeChange; 00239 // The changed (final) proper time of a given track 00240 00241 G4double theWeightChange; 00242 // The Changed (final) weight of a given track 00243 00244 G4double theMassChange; 00245 // The Changed (final) mass of a given track 00246 00247 G4double theChargeChange; 00248 // The Changed (final) charge of a given track 00249 00250 const G4Track* theCurrentTrack; 00251 00252 G4double theMuonWeight; 00253 00254 public: 00255 // these methods is used for switch on/off EB in all ParticleChange objects 00256 // static void SwOnAllEB(); 00257 // static void SwOffAllEB(); 00258 00259 private: 00260 // static G4bool fUseEBForAll; 00261 00262 public: 00263 // for Debug 00264 virtual G4bool CheckIt(const G4Track&); 00265 }; 00266 00267 #include "BDSConvParticleChange.icc" 00268 00269 #endif 00270 00271 00272 00273 00274 00275 00276 00277 00278 00279 00280 00281 00282 00283 00284 00285