G4ParticleChangeForLoss.hh

Go to the documentation of this file.
00001 //
00002 // ********************************************************************
00003 // * License and Disclaimer                                           *
00004 // *                                                                  *
00005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
00006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
00007 // * conditions of the Geant4 Software License,  included in the file *
00008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
00009 // * include a list of copyright holders.                             *
00010 // *                                                                  *
00011 // * Neither the authors of this software system, nor their employing *
00012 // * institutes,nor the agencies providing financial support for this *
00013 // * work  make  any representation or  warranty, express or implied, *
00014 // * regarding  this  software system or assume any liability for its *
00015 // * use.  Please see the license in the file  LICENSE  and URL above *
00016 // * for the full disclaimer and the limitation of liability.         *
00017 // *                                                                  *
00018 // * This  code  implementation is the result of  the  scientific and *
00019 // * technical work of the GEANT4 collaboration.                      *
00020 // * By using,  copying,  modifying or  distributing the software (or *
00021 // * any work based  on the software)  you  agree  to acknowledge its *
00022 // * use  in  resulting  scientific  publications,  and indicate your *
00023 // * acceptance of all terms of the Geant4 Software license.          *
00024 // ********************************************************************
00025 //
00026 //
00027 // $Id$
00028 //
00029 //
00030 // ------------------------------------------------------------
00031 //      GEANT 4 class header file
00032 //
00033 //
00034 // ------------------------------------------------------------
00035 //   Implemented for the new scheme                 23 Mar. 1998  H.Kurahige
00036 //
00037 //   Modified:
00038 //   16.01.04 V.Ivanchenko update for model variant of energy loss
00039 //   15.04.05 V.Ivanchenko inline update methods
00040 //   30.01.06 V.Ivanchenko add ProposedMomentumDirection for AlongStep
00041 //                         and ProposeWeight for PostStep
00042 //   07.06.06 V.Ivanchenko RemoveProposedMomentumDirection from AlongStep
00043 //   28.08.06 V.Ivanchenko Added access to current track and polarizaion
00044 //   17.06.09 V.Ivanchenko Added SetLowEnergyLimit method 
00045 //
00046 // ------------------------------------------------------------
00047 //
00048 //  Class Description
00049 //  This class is a concrete class for ParticleChange for EnergyLoss
00050 //
00051 #ifndef G4ParticleChangeForLoss_h
00052 #define G4ParticleChangeForLoss_h 1
00053 
00054 #include "globals.hh"
00055 #include "G4ios.hh"
00056 #include "G4VParticleChange.hh"
00057 
00058 class G4DynamicParticle;
00059 
00060 class G4ParticleChangeForLoss: public G4VParticleChange
00061 {
00062 public:
00063   // default constructor
00064   G4ParticleChangeForLoss();
00065 
00066   // destructor
00067   virtual ~G4ParticleChangeForLoss();
00068 
00069   // with description
00070   // ----------------------------------------------------
00071   // --- the following methods are for updating G4Step -----
00072 
00073   G4Step* UpdateStepForAlongStep(G4Step* Step);
00074   G4Step* UpdateStepForPostStep(G4Step* Step);
00075   // A physics process gives the final state of the particle
00076   // based on information of G4Track
00077 
00078   void InitializeForAlongStep(const G4Track&);
00079   void InitializeForPostStep(const G4Track&);
00080   //Initialize all propoerties by using G4Track information
00081 
00082   void AddSecondary(G4DynamicParticle* aParticle);
00083   // Add next secondary
00084 
00085   G4double GetProposedCharge() const;
00086   void SetProposedCharge(G4double theCharge);
00087   //   Get/Set theCharge
00088 
00089   G4double GetCharge() const;
00090   void ProposeCharge(G4double finalCharge);
00091   //   Get/Propose the final dynamical Charge in G4DynamicParticle
00092 
00093   G4double GetProposedKineticEnergy() const;
00094   void SetProposedKineticEnergy(G4double proposedKinEnergy);
00095   // Get/Set the final kinetic energy of the current particle.
00096 
00097   const G4ThreeVector& GetProposedMomentumDirection() const;
00098   void SetProposedMomentumDirection(const G4ThreeVector& dir);
00099   const G4ThreeVector& GetMomentumDirection() const;
00100   void ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz);
00101   void ProposeMomentumDirection(const G4ThreeVector& Pfinal);
00102   // Get/Propose the MomentumDirection vector: it is the final momentum direction.
00103 
00104   const G4ThreeVector& GetProposedPolarization() const;
00105   void ProposePolarization(const G4ThreeVector& dir);
00106   void ProposePolarization(G4double Px, G4double Py, G4double Pz);
00107 
00108   const G4Track* GetCurrentTrack() const;
00109 
00110   void SetLowEnergyLimit(G4double elimit);
00111 
00112   virtual void DumpInfo() const;
00113 
00114   // for Debug
00115   virtual G4bool CheckIt(const G4Track&);
00116 
00117 protected:
00118   // hide copy constructor and assignment operaor as protected
00119   G4ParticleChangeForLoss(const G4ParticleChangeForLoss &right);
00120   G4ParticleChangeForLoss & operator=(const G4ParticleChangeForLoss &right);
00121 
00122 private:
00123 
00124   const G4Track* currentTrack;
00125   // The pointer to G4Track
00126 
00127   G4double proposedKinEnergy;
00128   //  The final kinetic energy of the current particle.
00129 
00130   G4double lowEnergyLimit;
00131   //  The limit kinetic energy below which particle is stopped
00132 
00133   G4double currentCharge;
00134   //  The final charge of the current particle.
00135 
00136   G4ThreeVector proposedMomentumDirection;
00137   //  The final momentum direction of the current particle.
00138 
00139   G4ThreeVector proposedPolarization;
00140   //  The final polarization of the current particle.
00141 };
00142 
00143 // ------------------------------------------------------------
00144 
00145 inline G4double G4ParticleChangeForLoss::GetProposedKineticEnergy() const
00146 {
00147   return proposedKinEnergy;
00148 }
00149 
00150 inline void G4ParticleChangeForLoss::SetProposedKineticEnergy(G4double energy)
00151 {
00152   proposedKinEnergy = energy;
00153 }
00154 
00155 inline G4double G4ParticleChangeForLoss::GetProposedCharge() const
00156 {
00157   return currentCharge;
00158 }
00159 
00160 inline G4double G4ParticleChangeForLoss::GetCharge() const
00161 {
00162   return currentCharge;
00163 }
00164 
00165 inline void G4ParticleChangeForLoss::SetProposedCharge(G4double theCharge)
00166 {
00167   currentCharge = theCharge;
00168 }
00169 
00170 inline void G4ParticleChangeForLoss::ProposeCharge(G4double theCharge)
00171 {
00172   currentCharge = theCharge;
00173 }
00174 
00175 inline
00176  const G4ThreeVector& G4ParticleChangeForLoss::GetProposedMomentumDirection() const
00177 {
00178   return proposedMomentumDirection;
00179 }
00180 
00181 inline
00182  const G4ThreeVector& G4ParticleChangeForLoss::GetMomentumDirection() const
00183 {
00184   return proposedMomentumDirection;
00185 }
00186 
00187 inline
00188  void G4ParticleChangeForLoss::ProposeMomentumDirection(const G4ThreeVector& dir)
00189 {
00190   proposedMomentumDirection = dir;
00191 }
00192 
00193 inline
00194  void G4ParticleChangeForLoss::SetProposedMomentumDirection(const G4ThreeVector& dir)
00195 {
00196   proposedMomentumDirection = dir;
00197 }
00198 
00199 inline
00200  void G4ParticleChangeForLoss::ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz)
00201 {
00202   proposedMomentumDirection.setX(Px);
00203   proposedMomentumDirection.setY(Py);
00204   proposedMomentumDirection.setZ(Pz);
00205 }
00206 
00207 inline const G4Track* G4ParticleChangeForLoss::GetCurrentTrack() const
00208 {
00209   return currentTrack;
00210 }
00211 
00212 inline
00213  const G4ThreeVector& G4ParticleChangeForLoss::GetProposedPolarization() const
00214 {
00215   return proposedPolarization;
00216 }
00217 
00218 inline
00219  void G4ParticleChangeForLoss::ProposePolarization(const G4ThreeVector& dir)
00220 {
00221   proposedPolarization = dir;
00222 }
00223 
00224 inline
00225  void G4ParticleChangeForLoss::ProposePolarization(G4double Px, G4double Py, G4double Pz)
00226 {
00227   proposedPolarization.setX(Px);
00228   proposedPolarization.setY(Py);
00229   proposedPolarization.setZ(Pz);
00230 }
00231 
00232 inline void G4ParticleChangeForLoss::InitializeForAlongStep(const G4Track& track)
00233 {
00234   theStatusChange = track.GetTrackStatus();
00235   theLocalEnergyDeposit = 0.0;
00236   theNonIonizingEnergyDeposit = 0.0;
00237   InitializeSecondaries(track);
00238   theParentWeight = track.GetWeight();
00239   isParentWeightProposed = false;
00240   proposedKinEnergy = track.GetKineticEnergy();
00241   currentCharge = track.GetDynamicParticle()->GetCharge();
00242 }
00243 
00244 inline void G4ParticleChangeForLoss::InitializeForPostStep(const G4Track& track)
00245 {
00246   theStatusChange = track.GetTrackStatus();
00247   theLocalEnergyDeposit = 0.0;
00248   theNonIonizingEnergyDeposit = 0.0;
00249   InitializeSecondaries(track);
00250   theParentWeight = track.GetWeight();
00251   isParentWeightProposed = false;
00252   proposedKinEnergy = track.GetKineticEnergy();
00253   currentCharge = track.GetDynamicParticle()->GetCharge();
00254   proposedMomentumDirection = track.GetMomentumDirection();
00255   proposedPolarization = track.GetPolarization();
00256   currentTrack = &track;
00257 }
00258 
00259 
00260 inline void G4ParticleChangeForLoss::AddSecondary(G4DynamicParticle* aParticle)
00261 {
00262   //  create track
00263   G4Track* aTrack = new G4Track(aParticle, currentTrack->GetGlobalTime(),
00264                                            currentTrack->GetPosition());
00265 
00266   //   Touchable handle is copied to keep the pointer
00267   aTrack->SetTouchableHandle(currentTrack->GetTouchableHandle());
00268 
00269   //  add a secondary
00270   G4VParticleChange::AddSecondary(aTrack);
00271 }
00272 
00273 inline void G4ParticleChangeForLoss::SetLowEnergyLimit(G4double elimit)
00274 {
00275   lowEnergyLimit = elimit;
00276 }
00277 
00278 #endif
00279 

Generated on Mon May 27 17:49:15 2013 for Geant4 by  doxygen 1.4.7