G4UnknownDecay.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 #ifndef G4UnknownDecay_h
00035 #define G4UnknownDecay_h 1
00036 
00037 #include <CLHEP/Units/PhysicalConstants.h>
00038 
00039 #include "G4ios.hh"
00040 #include "globals.hh"
00041 #include "G4VDiscreteProcess.hh"
00042 #include "G4ParticleChangeForDecay.hh"
00043 
00044 class G4UnknownDecay : public G4VDiscreteProcess 
00045 {
00046  // Class Description
00047   //  This class is a decay process for "unknown" particle.
00048 
00049   public:
00050     //  Constructors 
00051     G4UnknownDecay(const G4String& processName ="UnknownDecay");
00052 
00053     //  Destructor
00054     virtual ~G4UnknownDecay();
00055 
00056   private:
00057     //  copy constructor
00058       G4UnknownDecay(const G4UnknownDecay &right);
00059 
00060     //  Assignment Operation (generated)
00061       G4UnknownDecay & operator=(const G4UnknownDecay &right);
00062 
00063   public: //With Description
00064   
00065      virtual G4VParticleChange *PostStepDoIt(
00066                              const G4Track& aTrack,
00067                              const G4Step& aStep
00068                             );
00069 
00070      virtual void BuildPhysicsTable(const G4ParticleDefinition&); 
00071      // In G4UnknownDecay, thePhysicsTable stores values of
00072     //    beta * std::sqrt( 1 - beta*beta) 
00073     //  as a function of normalized kinetic enregy (=Ekin/mass),
00074     //  becasuse this table is universal for all particle types,
00075 
00076 
00077     virtual G4bool IsApplicable(const G4ParticleDefinition&);
00078     // returns "true" if the decay process can be applied to
00079     // the particle type. 
00080  
00081   protected: // With Description
00082     virtual G4VParticleChange* DecayIt(
00083                              const G4Track& aTrack,
00084                              const G4Step&  aStep
00085                             );
00086     // The DecayIt() method returns by pointer a particle-change object,
00087     // which has information of daughter particles.
00088 
00089   public:
00090 
00091     virtual G4double PostStepGetPhysicalInteractionLength(
00092                              const G4Track& track,
00093                              G4double   previousStepSize,
00094                              G4ForceCondition* condition
00095                             );
00096 
00097 
00098   protected: // With Description
00099     // GetMeanFreePath returns ctau*beta*gamma for decay in flight 
00100     virtual G4double GetMeanFreePath(const G4Track& aTrack,
00101                               G4double   previousStepSize,
00102                               G4ForceCondition* condition
00103                              );
00104 
00105   public:
00106      void  SetVerboseLevel(G4int value);
00107      G4int GetVerboseLevel() const;
00108 
00109   private:
00110      G4int verboseLevel;
00111      // controle flag for output message
00112      //  0: Silent
00113      //  1: Warning message
00114      //  2: More
00115 
00116   private:
00117     // HighestValue.
00118     const G4double HighestValue;
00119  
00120     // ParticleChange for decay process
00121     G4ParticleChangeForDecay fParticleChangeForDecay;
00122     
00123 };
00124 
00125 inline 
00126  G4double G4UnknownDecay::PostStepGetPhysicalInteractionLength(
00127                              const G4Track& track,
00128                              G4double   /*previousStepSize*/,
00129                              G4ForceCondition* condition
00130                             )
00131 {
00132   // pre-assigned UnknownDecay time
00133   G4double pTime = track.GetDynamicParticle()->GetPreAssignedDecayProperTime();
00134 
00135   if (pTime < 0.) pTime = DBL_MIN;
00136 
00137   // condition is set to "Not Forced"
00138   *condition = NotForced;
00139   
00140   // reminder proper time
00141   G4double remainder = pTime - track.GetProperTime();
00142   if (remainder <= 0.0) remainder = DBL_MIN;
00143   
00144   // use pre-assigned Decay time to determine PIL
00145   //return GetMeanFreePath(track, previousStepSize, condition);
00146   return remainder*CLHEP::c_light;
00147 
00148 }
00149 
00150 inline
00151  void  G4UnknownDecay::SetVerboseLevel(G4int value){ verboseLevel = value; }
00152 
00153 inline
00154  G4int G4UnknownDecay::GetVerboseLevel() const { return verboseLevel; }
00155 
00156 inline  
00157   G4VParticleChange* G4UnknownDecay::PostStepDoIt(
00158                              const G4Track& aTrack,
00159                              const G4Step&  aStep
00160                             )
00161 {
00162   return DecayIt(aTrack, aStep);
00163 }
00164 
00165 #endif
00166 
00167 
00168 
00169 
00170 
00171 
00172 
00173 
00174 
00175 

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