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 // >> 23 // $Id: G4VMultipleScattering.hh,v 1.29 2005/10/27 11:33:26 vnivanch Exp $ >> 24 // GEANT4 tag $Name: geant4-08-00 $ 26 // 25 // 27 // ------------------------------------------- 26 // ------------------------------------------------------------------- 28 // 27 // 29 // GEANT4 Class header file 28 // GEANT4 Class header file 30 // 29 // 31 // 30 // 32 // File name: G4VMultipleScattering 31 // File name: G4VMultipleScattering 33 // 32 // 34 // Author: Vladimir Ivanchenko on base 33 // Author: Vladimir Ivanchenko on base of Laszlo Urban code 35 // 34 // 36 // Creation date: 12.03.2002 35 // Creation date: 12.03.2002 37 // 36 // 38 // Modifications: 37 // Modifications: 39 // 38 // 40 // 16-07-03 Update GetRange interface (V.Ivanc 39 // 16-07-03 Update GetRange interface (V.Ivanchenko) >> 40 // >> 41 // >> 42 // Class Description: >> 43 // >> 44 // It is the generic process of multiple scattering it includes common >> 45 // part of calculations for all charged particles >> 46 // 41 // 26-11-03 bugfix in AlongStepDoIt (L.Urban) 47 // 26-11-03 bugfix in AlongStepDoIt (L.Urban) 42 // 25-05-04 add protection against case when r << 48 // 25-05-04 add protection against case when range is less than steplimit (V.Ivanchenko) >> 49 // 30-06-04 make destructor virtual (V.Ivanchenko) 43 // 27-08-04 Add InitialiseForRun method (V.Iva 50 // 27-08-04 Add InitialiseForRun method (V.Ivanchneko) 44 // 08-11-04 Migration to new interface of Stor 51 // 08-11-04 Migration to new interface of Store/Retrieve tables (V.Ivanchenko) >> 52 // 15-04-05 optimize internal interfaces (V.Ivanchenko) 45 // 15-04-05 remove boundary flag (V.Ivanchenko 53 // 15-04-05 remove boundary flag (V.Ivanchenko) 46 // 07-10-05 error in a protection in GetContin 54 // 07-10-05 error in a protection in GetContinuousStepLimit corrected (L.Urban) 47 // 27-10-05 introduce virtual function MscStep 55 // 27-10-05 introduce virtual function MscStepLimitation() (V.Ivanchenko) 48 // 26-01-06 Rename GetRange -> GetRangeFromRes << 49 // 17-02-06 Save table of transport cross sect << 50 // 07-03-06 Move step limit calculation to mod << 51 // 13-05-06 Add method to access model by inde << 52 // 12-02-07 Add get/set skin (V.Ivanchenko) << 53 // 27-10-07 Virtual functions moved to source << 54 // 15-07-08 Reorder class members for further << 55 // 07-04-09 Moved msc methods from G4VEmModel << 56 // << 57 // Class Description: << 58 // << 59 // It is the generic process of multiple scatt << 60 // part of calculations for all charged partic << 61 56 62 // ------------------------------------------- 57 // ------------------------------------------------------------------- 63 // 58 // 64 59 65 #ifndef G4VMultipleScattering_h 60 #ifndef G4VMultipleScattering_h 66 #define G4VMultipleScattering_h 1 61 #define G4VMultipleScattering_h 1 67 62 68 #include "G4VContinuousDiscreteProcess.hh" 63 #include "G4VContinuousDiscreteProcess.hh" >> 64 #include "G4LossTableManager.hh" 69 #include "globals.hh" 65 #include "globals.hh" 70 #include "G4Material.hh" 66 #include "G4Material.hh" >> 67 #include "G4MaterialCutsCouple.hh" 71 #include "G4ParticleChangeForMSC.hh" 68 #include "G4ParticleChangeForMSC.hh" 72 #include "G4Track.hh" 69 #include "G4Track.hh" 73 #include "G4Step.hh" 70 #include "G4Step.hh" 74 #include "G4EmModelManager.hh" 71 #include "G4EmModelManager.hh" 75 #include "G4VMscModel.hh" << 72 #include "G4VEmModel.hh" 76 #include "G4EmParameters.hh" << 77 #include "G4MscStepLimitType.hh" << 78 73 79 class G4ParticleDefinition; 74 class G4ParticleDefinition; 80 class G4VEnergyLossProcess; << 75 class G4DataVector; 81 class G4LossTableManager; << 76 class G4PhysicsTable; 82 class G4SafetyHelper; << 77 class G4PhysicsVector; 83 78 84 //....oooOO0OOooo........oooOO0OOooo........oo 79 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 85 80 86 class G4VMultipleScattering : public G4VContin 81 class G4VMultipleScattering : public G4VContinuousDiscreteProcess 87 { 82 { 88 public: 83 public: 89 84 90 explicit G4VMultipleScattering(const G4Strin << 85 G4VMultipleScattering(const G4String& name = "msc", 91 G4ProcessType << 86 G4ProcessType type = fElectromagnetic); 92 87 93 ~G4VMultipleScattering() override; << 88 virtual ~G4VMultipleScattering(); 94 89 95 //------------------------------------------ 90 //------------------------------------------------------------------------ 96 // Virtual methods to be implemented for the 91 // Virtual methods to be implemented for the concrete model 97 //------------------------------------------ 92 //------------------------------------------------------------------------ 98 93 99 void ProcessDescription(std::ostream& outFil << 94 virtual G4bool IsApplicable(const G4ParticleDefinition& p) = 0; >> 95 // True for all charged particles 100 96 101 virtual void InitialiseProcess(const G4Parti << 97 virtual G4double TruePathLengthLimit(const G4Track& track, >> 98 G4double& lambda, >> 99 G4double currentMinimalStep) = 0; 102 100 103 // Print out of generic class parameters << 101 virtual void PrintInfo() = 0; 104 void StreamInfo(std::ostream& outFile, const << 105 G4bool rst = false) const; << 106 102 107 protected: 103 protected: 108 104 109 virtual void StreamProcessInfo(std::ostream& << 105 virtual void InitialiseProcess(const G4ParticleDefinition*) = 0; 110 106 >> 107 //------------------------------------------------------------------------ >> 108 // Methods with standard implementation; may be overwritten if needed >> 109 //------------------------------------------------------------------------ 111 public: 110 public: 112 111 >> 112 // Initialise for build of tables >> 113 virtual void PreparePhysicsTable(const G4ParticleDefinition&); >> 114 >> 115 // Build physics table during initialisation >> 116 virtual void BuildPhysicsTable(const G4ParticleDefinition&); >> 117 >> 118 // set boolean flag steppingAlgorithm >> 119 // ( true/false : standard or 7.1 style process) >> 120 virtual void MscStepLimitation(G4bool algorithm, G4double factor = -1.); >> 121 113 //------------------------------------------ 122 //------------------------------------------------------------------------ 114 // Generic methods common to all ContinuousD << 123 // Generic methods common to all models 115 //------------------------------------------ 124 //------------------------------------------------------------------------ 116 125 117 // Initialise for build of tables << 126 G4VParticleChange* AlongStepDoIt(const G4Track&, const G4Step&); 118 void PreparePhysicsTable(const G4ParticleDef << 119 127 120 // Build physics table during initialisation << 128 G4VParticleChange* PostStepDoIt(const G4Track&, const G4Step&); 121 void BuildPhysicsTable(const G4ParticleDefin << 129 >> 130 // The function overloads the corresponding function of the base >> 131 // class.It limits the step near to boundaries only >> 132 // and invokes the method GetContinuousStepLimit at every step. >> 133 G4double AlongStepGetPhysicalInteractionLength( >> 134 const G4Track&, >> 135 G4double previousStepSize, >> 136 G4double currentMinimalStep, >> 137 G4double& currentSafety, >> 138 G4GPILSelection* selection); >> 139 >> 140 // Print out of generic class parameters >> 141 void PrintInfoDefinition(); >> 142 >> 143 void SetBinning(G4int nbins); >> 144 G4int Binning() const; >> 145 // Print out of the class parameters >> 146 >> 147 void SetMinKinEnergy(G4double e); >> 148 G4double MinKinEnergy() const; >> 149 // Print out of the class parameters >> 150 >> 151 void SetMaxKinEnergy(G4double e); >> 152 G4double MaxKinEnergy() const; >> 153 >> 154 // Build empty Physics Vector >> 155 G4PhysicsVector* PhysicsVector(const G4MaterialCutsCouple*); 122 156 123 // Store PhysicsTable in a file. 157 // Store PhysicsTable in a file. 124 // Return false in case of failure at I/O 158 // Return false in case of failure at I/O 125 G4bool StorePhysicsTable(const G4ParticleDef 159 G4bool StorePhysicsTable(const G4ParticleDefinition*, 126 const G4String& dir 160 const G4String& directory, 127 G4bool ascii = fals << 161 G4bool ascii = false); 128 162 129 // Retrieve Physics from a file. 163 // Retrieve Physics from a file. 130 // (return true if the Physics Table can be 164 // (return true if the Physics Table can be build by using file) 131 // (return false if the process has no funct 165 // (return false if the process has no functionality or in case of failure) 132 // File name should is constructed as proces 166 // File name should is constructed as processName+particleName and the 133 // should be placed under the directory spec << 167 // should be placed under the directory specifed by the argument. 134 G4bool RetrievePhysicsTable(const G4Particle 168 G4bool RetrievePhysicsTable(const G4ParticleDefinition*, 135 const G4String& 169 const G4String& directory, 136 G4bool ascii) ov << 170 G4bool ascii); 137 171 138 // This is called in the beginning of tracki << 172 void AddEmModel(G4int, G4VEmModel*, const G4Region* region = 0); 139 void StartTracking(G4Track*) override; << 140 << 141 // The function overloads the corresponding << 142 // class.It limits the step near to boundari << 143 // and invokes the method GetMscContinuousSt << 144 G4double AlongStepGetPhysicalInteractionLeng << 145 const << 146 G4doub << 147 G4doub << 148 G4doub << 149 G4GPIL << 150 << 151 // The function overloads the corresponding << 152 // class. << 153 G4double PostStepGetPhysicalInteractionLengt << 154 const G4 << 155 G4double << 156 G4ForceC << 157 << 158 // Along step actions << 159 G4VParticleChange* AlongStepDoIt(const G4Tra << 160 173 161 // This method does not used for tracking, i 174 // This method does not used for tracking, it is intended only for tests 162 G4double ContinuousStepLimit(const G4Track& 175 G4double ContinuousStepLimit(const G4Track& track, 163 G4double previo << 176 G4double previousStepSize, 164 G4double curren << 177 G4double currentMinimalStep, 165 G4double& curre << 178 G4double& currentSafety); 166 << 167 // hide assignment operator << 168 G4VMultipleScattering(G4VMultipleScattering << 169 G4VMultipleScattering & operator=(const G4VM << 170 179 171 //------------------------------------------ << 180 G4bool LateralDisplasmentFlag() const; 172 // Specific methods to set, access, modify m << 181 void SetLateralDisplasmentFlag(G4bool val); 173 //------------------------------------------ << 182 // lateral displacement to be/not to be computed 174 183 175 // Select model in run time << 184 void SetBuildLambdaTable(G4bool val); 176 inline G4VEmModel* SelectModel(G4double kinE << 177 185 178 public: << 186 const G4PhysicsTable* LambdaTable() const; 179 187 180 // Add model for region, smaller value of or << 188 G4VEmModel* SelectModelForMaterial(G4double kinEnergy, size_t& idxRegion) const; 181 // model will be selected for a given energy << 189 182 void AddEmModel(G4int order, G4VMscModel*, c << 190 // Define particle definition 183 << 191 const G4ParticleDefinition* Particle() const; 184 // Assign a model to a process local list, t << 192 void SetParticle(const G4ParticleDefinition*); 185 // the derived process should execute AddEmM << 186 void SetEmModel(G4VMscModel*, G4int idx = 0) << 187 << 188 // return a model from the local list << 189 inline G4VMscModel* EmModel(size_t index = 0 << 190 193 191 // Access to run time models << 194 protected: 192 inline G4int NumberOfModels() const; << 193 195 194 inline G4VMscModel* GetModelByIndex(G4int id << 196 // This method is used for tracking, it returns mean free path value >> 197 G4double GetMeanFreePath(const G4Track& track, >> 198 G4double, >> 199 G4ForceCondition* condition); 195 200 196 //------------------------------------------ << 201 G4double GetLambda(const G4ParticleDefinition* p, G4double& kineticEnergy); 197 // Get/Set parameters for simulation of mult << 198 //------------------------------------------ << 199 202 200 inline G4bool LateralDisplasmentFlag() const << 203 // This method is used for tracking, it returns step limit 201 << 204 G4double GetContinuousStepLimit(const G4Track& track, 202 inline G4double Skin() const; << 205 G4double previousStepSize, 203 << 206 G4double currentMinimalStep, 204 inline G4double RangeFactor() const; << 207 G4double& currentSafety); 205 << 206 inline G4double GeomFactor() const; << 207 << 208 inline G4double PolarAngleLimit() const; << 209 << 210 inline G4bool UseBaseMaterial() const; << 211 << 212 inline G4MscStepLimitType StepLimitType() co << 213 inline void SetStepLimitType(G4MscStepLimitT << 214 208 215 inline G4double LowestKinEnergy() const; << 209 void SelectModel(G4double& kinEnergy); 216 inline void SetLowestKinEnergy(G4double val) << 210 // Select concrete model 217 211 218 inline const G4ParticleDefinition* FirstPart << 212 size_t CurrentMaterialCutsCoupleIndex() const {return currentMaterialIndex;}; >> 213 // Return current index 219 214 220 //------------------------------------------ << 215 G4double CurrentRange() const {return currentRange;}; 221 // Run time methods << 222 //------------------------------------------ << 223 216 224 protected: << 217 private: 225 218 226 // This method is not used for tracking, it << 219 void DefineMaterial(const G4MaterialCutsCouple* couple); 227 G4double GetMeanFreePath(const G4Track& trac << 220 // define current material 228 G4double, << 229 G4ForceCondition* c << 230 221 231 // This method is not used for tracking, it << 222 // hide assignment operator 232 G4double GetContinuousStepLimit(const G4Trac << 233 G4double pre << 234 G4double cur << 235 G4double& cu << 236 223 237 private: << 224 G4VMultipleScattering(G4VMultipleScattering &); >> 225 G4VMultipleScattering & operator=(const G4VMultipleScattering &right); 238 226 239 // ======== Parameters of the class fixed at << 227 // ===================================================================== 240 228 >> 229 G4ParticleChangeForMSC fParticleChange; 241 G4EmModelManager* modelManager; 230 G4EmModelManager* modelManager; 242 G4LossTableManager* emManager; << 231 G4VEmModel* currentModel; 243 G4EmParameters* theParameters; << 244 232 245 // ======== Parameters of the class fixed at << 233 // tables and vectors >> 234 G4PhysicsTable* theLambdaTable; 246 235 247 G4SafetyHelper* safetyHelper = n << 236 // cash 248 const G4ParticleDefinition* firstParticle = << 237 const G4ParticleDefinition* firstParticle; 249 const G4ParticleDefinition* currParticle = n << 238 const G4ParticleDefinition* currentParticle; 250 << 239 const G4MaterialCutsCouple* currentCouple; 251 std::vector<G4VMscModel*> mscModels; << 240 size_t currentMaterialIndex; >> 241 >> 242 G4int nBins; >> 243 >> 244 G4double minKinEnergy; >> 245 G4double maxKinEnergy; >> 246 >> 247 G4double trueStepLength; >> 248 G4double truePathLength; >> 249 G4double geomPathLength; >> 250 G4double lambda0; >> 251 G4double currentRange; >> 252 >> 253 G4GPILSelection valueGPILSelectionMSC; >> 254 G4bool latDisplasment; >> 255 G4bool buildLambdaTable; >> 256 }; 252 257 253 G4double facrange = 0.04; << 258 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 254 G4double lowestKinEnergy; << 259 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 255 260 256 // ======== Cached values - may be state dep << 261 inline void G4VMultipleScattering::DefineMaterial(const G4MaterialCutsCouple* couple) >> 262 { >> 263 if(couple != currentCouple) { >> 264 currentCouple = couple; >> 265 currentMaterialIndex = couple->GetIndex(); >> 266 } >> 267 } 257 268 258 protected: << 269 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 259 270 260 G4ParticleChangeForMSC fParticleChange; << 271 inline G4double G4VMultipleScattering::GetMeanFreePath(const G4Track&, >> 272 G4double, >> 273 G4ForceCondition* cond) >> 274 { >> 275 *cond = Forced; >> 276 return DBL_MAX; >> 277 } 261 278 262 private: << 279 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 263 280 264 G4ThreeVector fNewPosition; << 281 inline G4double G4VMultipleScattering::AlongStepGetPhysicalInteractionLength( 265 G4ThreeVector fNewDirection; << 282 const G4Track& track, >> 283 G4double previousStepSize, >> 284 G4double currentMinimalStep, >> 285 G4double& currentSafety, >> 286 G4GPILSelection* selection) >> 287 { >> 288 // get Step limit proposed by the process >> 289 valueGPILSelectionMSC = NotCandidateForSelection; >> 290 G4double steplength = GetContinuousStepLimit(track,previousStepSize, >> 291 currentMinimalStep,currentSafety); >> 292 // set return value for G4GPILSelection >> 293 *selection = valueGPILSelectionMSC; >> 294 return steplength; >> 295 } 266 296 267 G4VMscModel* currentModel = n << 297 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 268 G4VEnergyLossProcess* fIonisation = nu << 269 298 270 G4double geomMin; << 299 inline G4double G4VMultipleScattering::GetContinuousStepLimit( 271 G4double minDisplacement2 << 300 const G4Track& track, 272 G4double physStepLimit = << 301 G4double, 273 G4double tPathLength = 0. << 302 G4double currentMinimalStep, 274 G4double gPathLength = 0. << 303 G4double&) 275 << 304 { 276 G4MscStepLimitType stepLimit = fUse << 305 DefineMaterial(track.GetMaterialCutsCouple()); 277 G4int numberOfModels = << 306 G4double e = track.GetKineticEnergy(); 278 << 307 SelectModel(e); 279 G4bool latDisplacement << 308 const G4ParticleDefinition* p = track.GetDefinition(); 280 G4bool isIon = false; << 309 lambda0 = GetLambda(p, e); 281 G4bool fPositionChanged << 310 currentRange = G4LossTableManager::Instance()->GetTrancatedRange(p,e,currentCouple); 282 G4bool isActive = false << 311 // the next line was in error 283 G4bool baseMat = false; << 312 // if(currentRange < currentMinimalStep) currentRange = currentMinimalStep; 284 }; << 313 // the condition/protection correctly should be >> 314 if(currentRange < currentMinimalStep) currentMinimalStep = currentRange; >> 315 truePathLength = TruePathLengthLimit(track,lambda0,currentMinimalStep); >> 316 //G4cout << "StepLimit: tpl= " << truePathLength << " lambda0= " >> 317 // << lambda0 << " range= " << currentRange >> 318 // << " currentMinStep= " << currentMinimalStep << G4endl; >> 319 if (truePathLength < currentMinimalStep) valueGPILSelectionMSC = CandidateForSelection; >> 320 geomPathLength = currentModel->GeomPathLength(theLambdaTable,currentCouple, >> 321 p,e,lambda0,currentRange,truePathLength); >> 322 if(geomPathLength > lambda0) geomPathLength = lambda0; >> 323 return geomPathLength; >> 324 } 285 325 286 // ======== Run time inline methods ========== << 287 326 288 //....oooOO0OOooo........oooOO0OOooo........oo 327 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 289 328 290 inline G4VEmModel* << 329 inline G4double G4VMultipleScattering::ContinuousStepLimit( 291 G4VMultipleScattering::SelectModel(G4double ki << 330 const G4Track& track, >> 331 G4double previousStepSize, >> 332 G4double currentMinimalStep, >> 333 G4double& currentSafety) 292 { 334 { 293 return modelManager->SelectModel(kinEnergy, << 335 return GetContinuousStepLimit(track,previousStepSize,currentMinimalStep, >> 336 currentSafety); 294 } 337 } 295 338 296 //....oooOO0OOooo........oooOO0OOooo........oo 339 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 297 340 298 inline G4bool G4VMultipleScattering::LateralD << 341 inline G4double G4VMultipleScattering::GetLambda(const G4ParticleDefinition* p, G4double& e) 299 { 342 { 300 return latDisplacement; << 343 G4double x; >> 344 if(theLambdaTable) { >> 345 G4bool b; >> 346 x = ((*theLambdaTable)[currentMaterialIndex])->GetValue(e, b); >> 347 >> 348 } else { >> 349 x = currentModel->CrossSection(currentCouple,p,e); >> 350 } >> 351 return x; 301 } 352 } 302 353 303 //....oooOO0OOooo........oooOO0OOooo........oo 354 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 304 355 305 inline G4double G4VMultipleScattering::Skin() << 356 inline G4VParticleChange* G4VMultipleScattering::AlongStepDoIt( >> 357 const G4Track&, >> 358 const G4Step& step) 306 { 359 { 307 return theParameters->MscSkin(); << 360 G4double geomStepLength = step.GetStepLength(); >> 361 if((geomStepLength == geomPathLength) && (truePathLength <= currentRange)) >> 362 trueStepLength = truePathLength; >> 363 else >> 364 trueStepLength = currentModel->TrueStepLength(geomStepLength); >> 365 fParticleChange.ProposeTrueStepLength(trueStepLength); >> 366 return &fParticleChange; 308 } 367 } 309 368 310 //....oooOO0OOooo........oooOO0OOooo........oo 369 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 311 370 312 inline G4double G4VMultipleScattering::RangeF << 371 inline G4VParticleChange* G4VMultipleScattering::PostStepDoIt(const G4Track& track, >> 372 const G4Step& step) 313 { 373 { 314 return facrange; << 374 fParticleChange.Initialize(track); >> 375 currentModel->SampleSecondaries(currentCouple,track.GetDynamicParticle(), >> 376 step.GetStepLength(),step.GetPostStepPoint()->GetSafety()); >> 377 return &fParticleChange; 315 } 378 } 316 379 317 //....oooOO0OOooo........oooOO0OOooo........oo 380 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 318 381 319 inline G4double G4VMultipleScattering::GeomFa << 382 inline void G4VMultipleScattering::SelectModel(G4double& kinEnergy) 320 { 383 { 321 return theParameters->MscGeomFactor(); << 384 currentModel = modelManager->SelectModel(kinEnergy, currentMaterialIndex); 322 } 385 } 323 386 324 //....oooOO0OOooo........oooOO0OOooo........oo 387 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 325 388 326 inline G4double G4VMultipleScattering::PolarA << 389 inline G4VEmModel* G4VMultipleScattering::SelectModelForMaterial( >> 390 G4double kinEnergy, size_t& idxRegion) const 327 { 391 { 328 return theParameters->MscThetaLimit(); << 392 return modelManager->SelectModel(kinEnergy, idxRegion); 329 } 393 } 330 394 331 //....oooOO0OOooo........oooOO0OOooo........oo 395 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 332 396 333 inline G4MscStepLimitType G4VMultipleScatterin << 397 inline void G4VMultipleScattering::SetBinning(G4int nbins) 334 { 398 { 335 return stepLimit; << 399 nBins = nbins; 336 } 400 } 337 401 338 //....oooOO0OOooo........oooOO0OOooo........oo 402 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 339 403 340 inline void G4VMultipleScattering::SetStepLimi << 404 inline G4int G4VMultipleScattering::Binning() const 341 { 405 { 342 theParameters->SetMscStepLimitType(val); << 406 return nBins; 343 } 407 } 344 408 345 //....oooOO0OOooo........oooOO0OOooo........oo 409 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 346 410 347 inline G4double G4VMultipleScattering::LowestK << 411 inline void G4VMultipleScattering::SetMinKinEnergy(G4double e) 348 { 412 { 349 return lowestKinEnergy; << 413 minKinEnergy = e; 350 } 414 } 351 415 352 //....oooOO0OOooo........oooOO0OOooo........oo 416 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 353 417 354 inline void G4VMultipleScattering::SetLowestKi << 418 inline G4double G4VMultipleScattering::MinKinEnergy() const 355 { 419 { 356 lowestKinEnergy = val; << 420 return minKinEnergy; 357 } 421 } 358 422 359 //....oooOO0OOooo........oooOO0OOooo........oo 423 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 360 424 361 inline const G4ParticleDefinition* G4VMultiple << 425 inline void G4VMultipleScattering::SetMaxKinEnergy(G4double e) >> 426 { >> 427 maxKinEnergy = e; >> 428 } >> 429 >> 430 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... >> 431 >> 432 inline G4double G4VMultipleScattering::MaxKinEnergy() const >> 433 { >> 434 return maxKinEnergy; >> 435 } >> 436 >> 437 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... >> 438 >> 439 inline G4bool G4VMultipleScattering::LateralDisplasmentFlag() const 362 { 440 { 363 return firstParticle; << 441 return latDisplasment; 364 } 442 } 365 443 366 //....oooOO0OOooo........oooOO0OOooo........oo 444 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 367 445 368 inline G4VMscModel* G4VMultipleScattering::EmM << 446 inline void G4VMultipleScattering::SetLateralDisplasmentFlag(G4bool val) 369 { 447 { 370 return (index < mscModels.size()) ? mscModel << 448 latDisplasment = val; 371 } 449 } 372 450 373 //....oooOO0OOooo........oooOO0OOooo........oo 451 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 374 452 375 inline G4int G4VMultipleScattering::NumberOfMo << 453 inline void G4VMultipleScattering::SetBuildLambdaTable(G4bool val) 376 { 454 { 377 return numberOfModels; << 455 buildLambdaTable = val; 378 } 456 } 379 457 380 //....oooOO0OOooo........oooOO0OOooo........oo 458 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 381 459 382 inline G4VMscModel* << 460 inline const G4ParticleDefinition* G4VMultipleScattering::Particle() const 383 G4VMultipleScattering::GetModelByIndex(G4int i << 384 { 461 { 385 // static cast is possible inside this class << 462 return currentParticle; 386 return static_cast<G4VMscModel*>(modelManage << 387 } 463 } 388 464 389 //....oooOO0OOooo........oooOO0OOooo........oo 465 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 390 466 391 inline G4bool G4VMultipleScattering::UseBaseMa << 467 inline const G4PhysicsTable* G4VMultipleScattering::LambdaTable() const 392 { 468 { 393 return baseMat; << 469 return theLambdaTable; 394 } 470 } 395 471 396 //....oooOO0OOooo........oooOO0OOooo........oo 472 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 397 473 398 #endif 474 #endif 399 475