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: MJProcessesMaxTimeCuts.cc,v 1.2 2004/11/09 13:42:39 xliu Exp $ 00024 // 00025 // CLASS IMPLEMENTATION: MJProcessesMaxTimeCuts.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/MJProcessesMaxTimeCuts.hh" //Present MJ Class Headers 00058 00059 //---------------------------------------------------------------------------// 00060 00061 MJProcessesMaxTimeCuts::MJProcessesMaxTimeCuts(const G4String& aName) : MJProcessesSpecialCuts(aName) { 00062 if (verboseLevel>1) { 00063 G4cout << GetProcessName() << " is created "<< G4endl; 00064 } 00065 SetProcessType(fUserDefined); 00066 } 00067 00068 00069 //MJProcessesMaxTimeCuts::MJProcessesMaxTimeCuts(const MJProcessesMaxTimeCuts & other) 00070 //{ 00071 // 00072 //} 00073 00074 MJProcessesMaxTimeCuts::~MJProcessesMaxTimeCuts() {;} 00075 00076 MJProcessesMaxTimeCuts::MJProcessesMaxTimeCuts(MJProcessesMaxTimeCuts&) : MJProcessesSpecialCuts() {} 00077 00078 G4double MJProcessesMaxTimeCuts::PostStepGetPhysicalInteractionLength( const G4Track& aTrack, G4double, G4ForceCondition* condition ) { 00079 // condition is set to "Not Forced" 00080 *condition = NotForced; 00081 00082 G4double proposedStep = DBL_MAX; 00083 // get the pointer to UserLimits 00084 G4UserLimits* pUserLimits = aTrack.GetVolume()->GetLogicalVolume()->GetUserLimits(); 00085 const G4DynamicParticle* aParticle = aTrack.GetDynamicParticle(); 00086 00087 // can apply cuts for specific particles - use if(particleDef): 00088 // G4ParticleDefinition* aParticleDef = aTrack.GetDefinition(); 00089 00090 // G4cout << " Time: " << pUserLimits->GetUserMaxTime(aTrack) << G4endl; 00091 00092 if (pUserLimits) { 00093 G4double temp = DBL_MAX; 00094 //max time limit 00095 G4double dTime= (pUserLimits->GetUserMaxTime(aTrack) - aTrack.GetGlobalTime()); 00096 if (dTime < 0. ) { 00097 proposedStep = 0.; 00098 } else { 00099 G4double beta = (aParticle->GetTotalMomentum())/(aParticle->GetTotalEnergy()); 00100 temp = beta*c_light*dTime; 00101 if (proposedStep > temp) proposedStep = temp; 00102 } 00103 } 00104 return proposedStep; 00105 }