G4VITRestProcess.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 // $Id: G4VITRestProcess.hh 64057 2012-10-30 15:04:49Z gcosmo $
00027 //
00029 //
00030 // WARNING : This class is released as a prototype.
00031 // It might strongly evolve or even disapear in the next releases.
00032 //
00033 // Author: Mathieu Karamitros (kara (AT) cenbg . in2p3 . fr) 
00034 //
00035 // History:
00036 // -----------
00037 // 10 Oct 2011 M.Karamitros created
00038 //
00039 // -------------------------------------------------------------------
00040 
00041 
00042 #ifndef G4VITRestProcess_h
00043 #define G4VITRestProcess_h 1
00044 
00045 #include <CLHEP/Units/SystemOfUnits.h>
00046 
00047 #include "G4VITProcess.hh"
00048 
00053 class G4VITRestProcess : public G4VITProcess
00054 {
00055   //  Abstract class which defines the public behavior of
00056   //  physics interactions at rest.
00057 
00058   public:
00059       G4VITRestProcess(const G4String&  ,
00060                      G4ProcessType   aType = fNotDefined );
00061       G4VITRestProcess(const G4VITRestProcess& );
00062 
00063       virtual ~G4VITRestProcess();
00064 
00065   public:   //  with description
00066       virtual G4double AtRestGetPhysicalInteractionLength(
00067                              const G4Track& track,
00068                              G4ForceCondition* condition
00069                             );
00070 
00071       virtual G4VParticleChange* AtRestDoIt(
00072                              const G4Track& ,
00073                              const G4Step&
00074                             );
00075 
00076      //  no operation in  PostStepDoIt and  AlongStepDoIt
00077       virtual G4double AlongStepGetPhysicalInteractionLength(
00078                              const G4Track&,
00079                              G4double  ,
00080                              G4double  ,
00081                              G4double& ,
00082                              G4GPILSelection*
00083                            ){ return -1.0; }
00084 
00085       virtual G4double PostStepGetPhysicalInteractionLength(
00086                              const G4Track& ,
00087                              G4double   ,
00088                              G4ForceCondition*
00089                             ) { return -1.0; }
00090 
00091      //  no operation in  PostStepDoIt and  AlongStepDoIt
00092       virtual G4VParticleChange* PostStepDoIt(
00093                              const G4Track& ,
00094                              const G4Step&
00095                             ) {return 0;}
00096 
00097       virtual G4VParticleChange* AlongStepDoIt(
00098                              const G4Track& ,
00099                              const G4Step&
00100                             ) {return 0;}
00101 
00102   protected: //  with description
00103 
00104       virtual G4double GetMeanLifeTime(const G4Track& aTrack,G4ForceCondition* condition)=0;
00105       //  Calculates the mean life-time (i.e. for decays) of the
00106       //  particle at rest due to the occurence of the given process,
00107       //  or converts the probability of interaction (i.e. for
00108       //  annihilation) into the life-time of the particle for the
00109       //  occurence of the given process.
00110 
00111  protected:
00112   // hide default constructor and assignment operator as private
00113       G4VITRestProcess();
00114       G4VITRestProcess & operator=(const G4VITRestProcess &right);
00115 };
00116 
00117 // -----------------------------------------
00118 //  inlined function members implementation
00119 // -----------------------------------------
00120 inline G4double G4VITRestProcess::AtRestGetPhysicalInteractionLength(
00121                              const G4Track& track,
00122                              G4ForceCondition* condition
00123                             )
00124 {
00125   // beggining of tracking
00126   ResetNumberOfInteractionLengthLeft();
00127 
00128   // condition is set to "Not Forced"
00129   *condition = NotForced;
00130 
00131   // get mean life time
00132   fpState->currentInteractionLength = GetMeanLifeTime(track, condition);
00133 
00134 #ifdef G4VERBOSE
00135  if ((fpState->currentInteractionLength <0.0) || (verboseLevel>2)){
00136     G4cout << "G4VITRestProcess::AtRestGetPhysicalInteractionLength ";
00137     G4cout << "[ " << GetProcessName() << "]" <<G4endl;
00138     track.GetDynamicParticle()->DumpInfo();
00139     G4cout << " in Material  " << track.GetMaterial()->GetName() <<G4endl;
00140     G4cout << "MeanLifeTime = " << fpState->currentInteractionLength/CLHEP::ns << "[ns]" <<G4endl;
00141   }
00142 #endif
00143 
00144   return (fpState->theNumberOfInteractionLengthLeft) * (fpState->currentInteractionLength);
00145 }
00146 
00147 
00148 inline G4VParticleChange* G4VITRestProcess::AtRestDoIt(
00149                              const G4Track&,
00150                              const G4Step&
00151                             )
00152 {
00153 //  clear NumberOfInteractionLengthLeft
00154     ClearNumberOfInteractionLengthLeft();
00155 
00156     return pParticleChange;
00157 }
00158 
00159 
00160 #endif
00161 
00162 
00163 
00164 

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