G4IVRestDiscreteProcess.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 // $Id: 
00030 // ------------------------------------------------------------
00031 //      GEANT 4 class header file 
00032 //
00033 //
00034 // Class Description  
00035 //  Abstract class which defines the public behavior of
00036 //  rest + discrete physics interactions.
00037 //
00038 // ------------------------------------------------------------
00039 //   New Physics scheme           8  Mar. 1997  H.Kurahige
00040 // ------------------------------------------------------------
00041 
00042 
00043 #ifndef G4IVRestDiscreteProcess_h
00044 #define G4IVRestDiscreteProcess_h 1
00045 
00046 #include <CLHEP/Units/SystemOfUnits.h>
00047 
00048 #include "globals.hh"
00049 #include "G4ios.hh"
00050 #include "Randomize.hh"              
00051 
00052 #include "G4VProcess.hh"
00053 
00054 #include "G4Step.hh"
00055 #include "G4Track.hh"
00056 #include "G4MaterialTable.hh"
00057 #include "G4VParticleChange.hh"
00058 
00059 class G4IVRestDiscreteProcess : public G4VProcess 
00060 {
00061   //  Abstract class which defines the public behavior of
00062   //  rest + discrete physics interactions.
00063 
00064   public: // with description    
00065 
00066     // constructors 
00067      G4IVRestDiscreteProcess(const G4String& ,
00068                             G4ProcessType   aType = fNotDefined );
00069      G4IVRestDiscreteProcess(G4IVRestDiscreteProcess &);
00070 
00071   public:
00072      virtual ~G4IVRestDiscreteProcess();
00073 
00074   public: // with description    
00075      // GPIL and DoIt methods derived from G4VProcess
00076      virtual G4double PostStepGetPhysicalInteractionLength(
00077                              const G4Track& track,
00078                              G4double   previousStepSize,
00079                              G4ForceCondition* condition
00080                             );
00081 
00082      virtual G4VParticleChange* PostStepDoIt(
00083                              const G4Track& ,
00084                              const G4Step& 
00085                             );
00086 
00087      virtual G4double AtRestGetPhysicalInteractionLength(
00088                              const G4Track& ,
00089                              G4ForceCondition* 
00090                             );
00091       
00092      G4VParticleChange* AtRestDoIt(
00093                              const G4Track& ,
00094                              const G4Step&
00095                             );
00096 
00097      //  no operation in  AlongStepDoIt
00098      virtual G4double AlongStepGetPhysicalInteractionLength(
00099                              const G4Track&,
00100                              G4double  ,
00101                              G4double  ,
00102                              G4double& ,
00103                              G4GPILSelection*
00104                             ){ return -1.0; }
00105 
00106      //  no operation in  AlongStepDoIt
00107      virtual G4VParticleChange* AlongStepDoIt(
00108                              const G4Track& ,
00109                              const G4Step& 
00110                             ) {return 0;}
00111  
00112   protected:// with description    
00113      virtual void SubtractNumberOfInteractionLengthLeft(
00114                              G4double previousStepSize) ;
00115 
00116      virtual G4double GetMeanLifeTime(const G4Track& aTrack,G4ForceCondition* condition)=0;
00117       //  Calculates the mean life-time (i.e. for decays) of the
00118       //  particle at rest due to the occurence of the given process,
00119       //  or converts the probability of interaction (i.e. for
00120       //  annihilation) into the life-time of the particle for the
00121       //  occurence of the given process.
00122 
00123   private:
00124   // hide default constructor and assignment operator as private 
00125       G4IVRestDiscreteProcess();
00126       G4IVRestDiscreteProcess & operator=(const G4IVRestDiscreteProcess &right);
00127 
00128 
00129    protected:
00130       G4PhysicsTable* theNlambdaTable ;
00131       G4PhysicsTable* theInverseNlambdaTable ;
00132 
00133       const G4double BIGSTEP;
00134 };
00135 
00136 // -----------------------------------------
00137 //  inlined function members implementation
00138 // -----------------------------------------
00139 
00140 inline 
00141  void     G4IVRestDiscreteProcess::SubtractNumberOfInteractionLengthLeft(
00142                              G4double )
00143  {
00144   // dummy routine
00145    ;
00146  }    
00147 
00148 inline G4VParticleChange* G4IVRestDiscreteProcess::PostStepDoIt(
00149                              const G4Track& ,
00150                              const G4Step& 
00151                             )
00152 { 
00153 //  reset NumberOfInteractionLengthLeft
00154     ClearNumberOfInteractionLengthLeft();
00155 
00156     return pParticleChange;
00157 }
00158 
00159 inline G4double G4IVRestDiscreteProcess::AtRestGetPhysicalInteractionLength(
00160                              const G4Track& track,
00161                              G4ForceCondition* condition
00162                             )
00163 {
00164   // beggining of tracking 
00165   ResetNumberOfInteractionLengthLeft();
00166 
00167   // condition is set to "Not Forced"
00168   *condition = NotForced;
00169 
00170   // get mean life time
00171   currentInteractionLength = GetMeanLifeTime(track, condition);
00172 
00173 #ifdef G4VERBOSE
00174   if ((currentInteractionLength <0.0) || (verboseLevel>2)){
00175     G4cout << "G4IVRestDiscreteProcess::AtRestGetPhysicalInteractionLength ";
00176     G4cout << "[ " << GetProcessName() << "]" <<G4endl;
00177     track.GetDynamicParticle()->DumpInfo();
00178     G4cout << " in Material  " << track.GetMaterial()->GetName() <<G4endl;
00179     G4cout << "MeanLifeTime = " << currentInteractionLength/CLHEP::ns << "[ns]" <<G4endl;
00180   }
00181 #endif
00182 
00183   return theNumberOfInteractionLengthLeft * currentInteractionLength;
00184 }
00185 
00186 
00187 inline G4VParticleChange* G4IVRestDiscreteProcess::AtRestDoIt( 
00188                              const G4Track&,
00189                              const G4Step& 
00190                             )
00191 {
00192 //  clear NumberOfInteractionLengthLeft
00193     ClearNumberOfInteractionLengthLeft();
00194 
00195     return pParticleChange;
00196 }
00197 
00198 #endif

Generated on Mon May 27 17:48:42 2013 for Geant4 by  doxygen 1.4.7