Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Class Members | File Members

MJProcessesMinEkineCuts.cc

Go to the documentation of this file.
00001 //---------------------------------------------------------------------------//
00002 //bb0nubb0nubb0nubb0nubb0nubb0nubb0nubb0nubb0nubb0nubb0nubb0nubb0nubb0nubb0nu//
00003 //                                                                           //
00004 //                         MAJORANA Simulation                               //
00005 //                                                                           //
00006 //      This code implementation is the intellectual property of the         //
00007 //      MAJORANA Collaboration. It is based on Geant4, an intellectual       //
00008 //      property of the RD44 GEANT4 collaboration.                           //
00009 //                                                                           //
00010 //                        *********************                              //
00011 //                                                                           //
00012 //    Neither the authors of this software system, nor their employing       //
00013 //    institutes, nor the agencies providing financial support for this      //
00014 //    work  make  any representation or  warranty, express or implied,       //
00015 //    regarding this software system or assume any liability for its use.    //
00016 //    By copying, distributing or modifying the Program (or any work based   //
00017 //    on on the Program) you indicate your acceptance of this statement,     //
00018 //    and all its terms.                                                     //
00019 //                                                                           //
00020 //bb0nubb0nubb0nubb0nubb0nubb0nubb0nubb0nubb0nubb0nubb0nubb0nubb0nubb0nubb0nu//
00021 //---------------------------------------------------------------------------//
00022 //                                                          
00023 // $Id: MJProcessesMinEkineCuts.cc,v 1.2 2004/11/09 13:42:39 xliu Exp $ 
00024 //      
00025 // CLASS IMPLEMENTATION:  MJProcessesMinEkineCuts.cc
00026 //
00027 //---------------------------------------------------------------------------//
00033 // 
00034 //---------------------------------------------------------------------------//
00045 //---------------------------------------------------------------------------//
00046 //
00047 
00048 //  GEANT4 headers
00049 #include "G4Step.hh"
00050 #include "G4UserLimits.hh"
00051 #include "G4VParticleChange.hh"
00052 #include "G4EnergyLossTables.hh"
00053 
00054 //---------------------------------------------------------------------------//
00055 
00056 //  MJ headers
00057 #include "processes/MJProcessesMinEkineCuts.hh"      //Present MJ Class Headers 
00058 
00059 //---------------------------------------------------------------------------//
00060 
00061 MJProcessesMinEkineCuts::MJProcessesMinEkineCuts( const G4String& aName ) : MJProcessesSpecialCuts(aName) {
00062    if (verboseLevel>1) {
00063      G4cout << GetProcessName() << " is created "<< G4endl;
00064    }
00065    SetProcessType(fUserDefined);
00066 }
00067 
00068 //MJProcessesMinEkineCuts::MJProcessesMinEkineCuts(const MJProcessesMinEkineCuts & other) {}
00069 
00070 MJProcessesMinEkineCuts::~MJProcessesMinEkineCuts() {;}
00071 
00072 MJProcessesMinEkineCuts::MJProcessesMinEkineCuts(MJProcessesMinEkineCuts&) : MJProcessesSpecialCuts() {}
00073 
00074 G4double MJProcessesMinEkineCuts::PostStepGetPhysicalInteractionLength( const G4Track& aTrack, G4double, G4ForceCondition* condition ) {
00075         // condition is set to "Not Forced"
00076         *condition = NotForced;
00077 
00078         G4double     proposedStep = DBL_MAX;
00079         // get the pointer to UserLimits
00080         G4UserLimits* pUserLimits = aTrack.GetVolume()->GetLogicalVolume()->GetUserLimits();
00081         const G4DynamicParticle* aParticle = aTrack.GetDynamicParticle();
00082         G4ParticleDefinition* aParticleDef = aTrack.GetDefinition();
00083 
00084         if (pUserLimits && aParticleDef->GetPDGCharge() != 0.0) {
00085                 //min kinetic energy
00086                 G4double temp = DBL_MAX;
00087                 G4double eKine = aParticle->GetKineticEnergy();
00088                 const G4MaterialCutsCouple* couple = aTrack.GetMaterialCutsCouple();
00089                 G4double eMin = pUserLimits->GetUserMinEkine(aTrack);
00090 
00091                 G4double rangeNow = DBL_MAX;
00092 
00093                 rangeNow = G4EnergyLossTables::GetRange(aParticleDef,eKine,couple);
00094 
00095                 if (eKine < eMin ) {
00096                         proposedStep = 0.;
00097                 } else {
00098                         // charged particles only
00099                         G4double rangeMin = G4EnergyLossTables::GetRange(aParticleDef,eMin,couple);
00100                         temp = rangeNow - rangeMin;
00101                         if (proposedStep > temp) proposedStep = temp;
00102                 }
00103         }
00104         return proposedStep;
00105 }

Generated on Mon Nov 29 16:58:53 2004 for Majorana Simulation by  doxygen 1.3.9.1