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/TestEm11/src/StepMax << 23 // $Id: StepMax.cc,v 1.1 2005/06/03 15:20:32 maire Exp $ 27 /// \brief Implementation of the StepMax class << 24 // GEANT4 tag $Name: geant4-07-01 $ 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, type) << 35 : G4VDiscreteProcess(processName),MaxChargedStep(DBL_MAX) 41 { 36 { 42 fMaxStep1 = fMaxStep2 = DBL_MAX; << 37 pMess = new StepMaxMessenger(this); 43 fApplyMaxStep2 = true; << 44 fMess = new StepMaxMessenger(this); << 45 } 38 } 46 39 47 //....oooOO0OOooo........oooOO0OOooo........oo 40 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 48 41 49 StepMax::~StepMax() << 42 StepMax::~StepMax() { delete pMess; } 50 { << 51 delete fMess; << 52 } << 53 43 54 //....oooOO0OOooo........oooOO0OOooo........oo 44 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 55 45 56 G4bool StepMax::IsApplicable(const G4ParticleD 46 G4bool StepMax::IsApplicable(const G4ParticleDefinition& particle) 57 { 47 { 58 return (particle.GetPDGCharge() != 0. && !pa 48 return (particle.GetPDGCharge() != 0. && !particle.IsShortLived()); 59 } 49 } 60 50 61 //....oooOO0OOooo........oooOO0OOooo........oo 51 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 62 52 63 void StepMax::SetMaxStep1(G4double step) << 53 void StepMax::SetMaxStep(G4double step) {MaxChargedStep = step;} 64 { << 65 fMaxStep1 = step; << 66 } << 67 << 68 //....oooOO0OOooo........oooOO0OOooo........oo << 69 << 70 void StepMax::SetMaxStep2(G4double step) << 71 { << 72 fMaxStep2 = step; << 73 } << 74 54 75 //....oooOO0OOooo........oooOO0OOooo........oo 55 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 76 56 77 void StepMax::ApplyMaxStep2(G4bool value) << 57 G4double StepMax::PostStepGetPhysicalInteractionLength( const G4Track&, 78 { << 58 G4double, 79 fApplyMaxStep2 = value; << 59 G4ForceCondition* condition ) 80 } << 81 << 82 //....oooOO0OOooo........oooOO0OOooo........oo << 83 << 84 G4double StepMax::PostStepGetPhysicalInteracti << 85 << 86 { 60 { 87 // condition is set to "Not Forced" 61 // condition is set to "Not Forced" 88 *condition = NotForced; 62 *condition = NotForced; 89 63 90 if (fApplyMaxStep2) << 64 return MaxChargedStep; 91 return fMaxStep2; << 92 else << 93 return fMaxStep1; << 94 } 65 } 95 66 96 //....oooOO0OOooo........oooOO0OOooo........oo 67 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 97 68 98 G4VParticleChange* StepMax::PostStepDoIt(const 69 G4VParticleChange* StepMax::PostStepDoIt(const G4Track& aTrack, const G4Step&) 99 { 70 { 100 // do nothing << 71 // do nothing 101 aParticleChange.Initialize(aTrack); << 72 aParticleChange.Initialize(aTrack); 102 return &aParticleChange; << 73 return &aParticleChange; 103 } 74 } 104 75 105 //....oooOO0OOooo........oooOO0OOooo........oo 76 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... >> 77 >> 78 106 79