Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer << 3 // * DISCLAIMER * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th << 5 // * The following disclaimer summarizes all the specific disclaimers * 6 // * the Geant4 Collaboration. It is provided << 6 // * of contributors to this software. The specific disclaimers,which * 7 // * conditions of the Geant4 Software License << 7 // * govern, are listed with their locations in: * 8 // * LICENSE and available at http://cern.ch/ << 8 // * http://cern.ch/geant4/license * 9 // * include a list of copyright holders. << 10 // * 9 // * * 11 // * Neither the authors of this software syst 10 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 11 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 12 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 13 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file << 14 // * use. * 16 // * for the full disclaimer and the limitatio << 17 // * 15 // * * 18 // * This code implementation is the result << 16 // * This code implementation is the intellectual property of the * 19 // * technical work of the GEANT4 collaboratio << 17 // * GEANT4 collaboration. * 20 // * By using, copying, modifying or distri << 18 // * By copying, distributing or modifying the Program (or any work * 21 // * any work based on the software) you ag << 19 // * based on the Program) you indicate your acceptance of this * 22 // * use in resulting scientific publicati << 20 // * statement, and all its terms. * 23 // * acceptance of all terms of the Geant4 Sof << 24 // ******************************************* 21 // ******************************************************************** 25 // 22 // 26 /// \file electromagnetic/TestEm7/src/StepMax. << 23 // $Id: StepMax.cc,v 1.4 2003/06/14 16:01:19 vnivanch Exp $ 27 /// \brief Implementation of the StepMax class << 24 // GEANT4 tag $Name: geant4-08-00 $ 28 // << 29 // 25 // 30 //....oooOO0OOooo........oooOO0OOooo........oo 26 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 31 //....oooOO0OOooo........oooOO0OOooo........oo 27 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 32 28 33 #include "StepMax.hh" 29 #include "StepMax.hh" 34 << 35 #include "StepMaxMessenger.hh" 30 #include "StepMaxMessenger.hh" 36 31 37 //....oooOO0OOooo........oooOO0OOooo........oo 32 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 38 33 39 StepMax::StepMax(const G4String& processName) 34 StepMax::StepMax(const G4String& processName) 40 : G4VDiscreteProcess(processName), fMaxCharg << 35 : G4VDiscreteProcess(processName),MaxChargedStep(DBL_MAX) 41 { 36 { 42 fMess = new StepMaxMessenger(this); << 37 pMess = new StepMaxMessenger(this); 43 } 38 } 44 39 45 //....oooOO0OOooo........oooOO0OOooo........oo 40 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 46 41 47 StepMax::~StepMax() << 42 StepMax::~StepMax() { delete pMess; } 48 { << 49 delete fMess; << 50 } << 51 43 52 //....oooOO0OOooo........oooOO0OOooo........oo 44 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 53 45 54 G4bool StepMax::IsApplicable(const G4ParticleD 46 G4bool StepMax::IsApplicable(const G4ParticleDefinition& particle) 55 { 47 { 56 return (particle.GetPDGCharge() != 0. && !pa 48 return (particle.GetPDGCharge() != 0. && !particle.IsShortLived()); 57 } 49 } 58 50 59 //....oooOO0OOooo........oooOO0OOooo........oo 51 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 60 52 61 void StepMax::SetMaxStep(G4double step) << 53 void StepMax::SetMaxStep(G4double step) {MaxChargedStep = step;} 62 { << 63 fMaxChargedStep = step; << 64 } << 65 54 66 //....oooOO0OOooo........oooOO0OOooo........oo 55 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 67 56 68 G4double StepMax::PostStepGetPhysicalInteracti << 57 G4double StepMax::PostStepGetPhysicalInteractionLength( 69 << 58 const G4Track& aTrack, >> 59 G4double, >> 60 G4ForceCondition* condition ) 70 { 61 { 71 // condition is set to "Not Forced" 62 // condition is set to "Not Forced" 72 *condition = NotForced; 63 *condition = NotForced; 73 << 64 74 G4double ProposedStep = DBL_MAX; 65 G4double ProposedStep = DBL_MAX; 75 66 76 if ((fMaxChargedStep > 0.) && (aTrack.GetVol << 67 if((MaxChargedStep > 0.) && 77 && (aTrack.GetVolume()->GetName() != "Wo << 68 (aTrack.GetVolume() != NULL) && 78 ProposedStep = fMaxChargedStep; << 69 (aTrack.GetVolume()->GetName() != "World")) >> 70 ProposedStep = MaxChargedStep; 79 71 80 return ProposedStep; 72 return ProposedStep; 81 } 73 } 82 74 83 //....oooOO0OOooo........oooOO0OOooo........oo 75 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 84 76 85 G4VParticleChange* StepMax::PostStepDoIt(const 77 G4VParticleChange* StepMax::PostStepDoIt(const G4Track& aTrack, const G4Step&) 86 { 78 { 87 // do nothing << 79 // do nothing 88 aParticleChange.Initialize(aTrack); << 80 aParticleChange.Initialize(aTrack); 89 return &aParticleChange; << 81 return &aParticleChange; 90 } 82 } 91 83 92 //....oooOO0OOooo........oooOO0OOooo........oo 84 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... >> 85 >> 86 93 87