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 // $Id: G4AdjointhMultipleScattering.cc 69844 2013-05-16 09:19:33Z gcosmo $ 00027 // 00028 00029 // 00030 // GEANT4 Class file 00031 // 00032 // File name: G4AdjointhMultipleScattering 00033 // 00034 // Author: Desorgher Laurent 00035 // 00036 // Creation date: 03.06.2009 cloned from G4hMultipleScattering by U.Laszlo with slight modification for adjoint_ion. 00037 // 00038 // ----------------------------------------------------------------------------- 00039 // 00040 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 00041 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 00042 00043 #include "G4AdjointhMultipleScattering.hh" 00044 #include "G4SystemOfUnits.hh" 00045 #include "G4UrbanMscModel95.hh" 00046 #include "G4MscStepLimitType.hh" 00047 00048 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 00049 00050 using namespace std; 00051 00052 G4AdjointhMultipleScattering::G4AdjointhMultipleScattering(const G4String& processName) 00053 : G4VMultipleScattering(processName) 00054 { 00055 isInitialized = false; 00056 isIon = false; 00057 SetStepLimitType(fMinimal); 00058 00059 dtrl=0.; 00060 lambdalimit=0.; 00061 samplez=0.; 00062 } 00063 00064 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 00065 00066 G4AdjointhMultipleScattering::~G4AdjointhMultipleScattering() 00067 {} 00068 00069 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 00070 00071 G4bool G4AdjointhMultipleScattering::IsApplicable (const G4ParticleDefinition& p) 00072 { 00073 return (p.GetPDGCharge() != 0.0 && !p.IsShortLived()); 00074 } 00075 00076 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 00077 00078 void G4AdjointhMultipleScattering::InitialiseProcess(const G4ParticleDefinition* p) 00079 { 00080 // Modification of parameters between runs 00081 if(isInitialized) { 00082 if (p->GetParticleType() != "adjoint_nucleus" && p->GetPDGMass() < GeV) { 00083 mscUrban->SetStepLimitType(StepLimitType()); 00084 mscUrban->SetLateralDisplasmentFlag(LateralDisplasmentFlag()); 00085 mscUrban->SetSkin(Skin()); 00086 mscUrban->SetRangeFactor(RangeFactor()); 00087 mscUrban->SetGeomFactor(GeomFactor()); 00088 } 00089 return; 00090 } 00091 00092 // defaults for ions, which cannot be overwritten 00093 if (p->GetParticleType() == "adjoint_nucleus" || p->GetPDGMass() > GeV) { 00094 SetStepLimitType(fMinimal); 00095 SetLateralDisplasmentFlag(false); 00096 //SetBuildLambdaTable(false); 00097 if(p->GetParticleType() == "adjoint_nucleus") isIon = true; 00098 } 00099 00100 // initialisation of parameters 00101 G4String part_name = p->GetParticleName(); 00102 mscUrban = new G4UrbanMscModel95(); 00103 00104 mscUrban->SetStepLimitType(StepLimitType()); 00105 mscUrban->SetLateralDisplasmentFlag(LateralDisplasmentFlag()); 00106 mscUrban->SetSkin(Skin()); 00107 mscUrban->SetRangeFactor(RangeFactor()); 00108 mscUrban->SetGeomFactor(GeomFactor()); 00109 00110 AddEmModel(1,mscUrban); 00111 isInitialized = true; 00112 } 00113 00114 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 00115 00116 void G4AdjointhMultipleScattering::PrintInfo() 00117 { 00118 G4cout << " RangeFactor= " << RangeFactor() 00119 << ", step limit type: " << StepLimitType() 00120 << ", lateralDisplacement: " << LateralDisplasmentFlag() 00121 << ", skin= " << Skin() 00122 // << ", geomFactor= " << GeomFactor() 00123 << G4endl; 00124 } 00125 00126 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 00127 00128 /*G4double G4AdjointhMultipleScattering::AlongStepGetPhysicalInteractionLength( 00129 const G4Track& track, 00130 double, 00131 G4double currentMinimalStep, 00132 G4double& currentSafety, 00133 G4GPILSelection* selection) 00134 { 00135 // get Step limit proposed by the process 00136 valueGPILSelectionMSC = NotCandidateForSelection; 00137 00138 G4double escaled = track.GetKineticEnergy(); 00139 if(isIon) escaled *= track.GetDynamicParticle()->GetMass()/proton_mass_c2; 00140 00141 G4double steplength = GetMscContinuousStepLimit(track, 00142 escaled, 00143 currentMinimalStep, 00144 currentSafety); 00145 // G4cout << "StepLimit= " << steplength << G4endl; 00146 // set return value for G4GPILSelection 00147 *selection = valueGPILSelectionMSC; 00148 return steplength; 00149 } 00150 */ 00151 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......