- Timestamp:
- Jun 18, 2010, 11:42:07 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/processes/electromagnetic/utils/src/G4VMultipleScattering.cc
r1228 r1315 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4VMultipleScattering.cc,v 1. 77 2009/10/29 18:07:08vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-0 3$26 // $Id: G4VMultipleScattering.cc,v 1.82 2010/04/12 11:45:03 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-04-beta-cand-01 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 95 95 firstParticle(0), 96 96 stepLimit(fUseSafety), 97 skin( 3.0),97 skin(1.0), 98 98 facrange(0.04), 99 99 facgeom(2.5), … … 144 144 G4VEmFluctuationModel* fm = 0; 145 145 modelManager->AddEmModel(order, p, fm, region); 146 if(p) p->SetParticleChange(pParticleChange);146 if(p) { p->SetParticleChange(pParticleChange); } 147 147 } 148 148 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... … … 170 170 { 171 171 return modelManager->GetModel(idx, ver); 172 }173 174 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....175 176 void G4VMultipleScattering::BuildPhysicsTable(const G4ParticleDefinition& part)177 {178 G4String num = part.GetParticleName();179 if(1 < verboseLevel) {180 G4cout << "### G4VMultipleScattering::BuildPhysicsTable() for "181 << GetProcessName()182 << " and particle " << num183 << G4endl;184 }185 186 if (buildLambdaTable && firstParticle == &part) {187 188 const G4ProductionCutsTable* theCoupleTable=189 G4ProductionCutsTable::GetProductionCutsTable();190 size_t numOfCouples = theCoupleTable->GetTableSize();191 192 G4bool splineFlag = (G4LossTableManager::Instance())->SplineFlag();193 194 G4PhysicsLogVector* aVector = 0;195 G4PhysicsLogVector* bVector = 0;196 197 for (size_t i=0; i<numOfCouples; ++i) {198 199 if (theLambdaTable->GetFlag(i)) {200 // create physics vector and fill it201 const G4MaterialCutsCouple* couple =202 theCoupleTable->GetMaterialCutsCouple(i);203 if(!bVector) {204 aVector = static_cast<G4PhysicsLogVector*>(PhysicsVector(couple));205 bVector = aVector;206 } else {207 aVector = new G4PhysicsLogVector(*bVector);208 }209 //G4PhysicsVector* aVector = PhysicsVector(couple);210 aVector->SetSpline(splineFlag);211 modelManager->FillLambdaVector(aVector, couple, false);212 if(splineFlag) aVector->FillSecondDerivatives();213 G4PhysicsTableHelper::SetPhysicsVector(theLambdaTable, i, aVector);214 }215 }216 217 if(1 < verboseLevel) {218 G4cout << "Lambda table is built for "219 << num220 << G4endl;221 }222 }223 if(verboseLevel>0 && ( num == "e-" || num == "mu+" ||224 num == "proton" || num == "pi-" ||225 num == "GenericIon")) {226 PrintInfoDefinition();227 if(2 < verboseLevel && theLambdaTable) G4cout << *theLambdaTable << G4endl;228 }229 230 if(1 < verboseLevel) {231 G4cout << "### G4VMultipleScattering::BuildPhysicsTable() done for "232 << GetProcessName()233 << " and particle " << num234 << G4endl;235 }236 172 } 237 173 … … 260 196 } 261 197 198 (G4LossTableManager::Instance())->PreparePhysicsTable(&part, this); 199 262 200 if(1 < verboseLevel) { 263 201 G4cout << "### G4VMultipleScattering::PrepearPhysicsTable() for " … … 267 205 << G4endl; 268 206 } 269 270 (G4LossTableManager::Instance())->EmConfigurator()->AddModels();271 207 272 208 if(firstParticle == &part) { … … 307 243 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 308 244 245 void G4VMultipleScattering::BuildPhysicsTable(const G4ParticleDefinition& part) 246 { 247 G4String num = part.GetParticleName(); 248 if(1 < verboseLevel) { 249 G4cout << "### G4VMultipleScattering::BuildPhysicsTable() for " 250 << GetProcessName() 251 << " and particle " << num 252 << G4endl; 253 } 254 255 (G4LossTableManager::Instance())->BuildPhysicsTable(firstParticle); 256 257 if (buildLambdaTable && firstParticle == &part) { 258 259 const G4ProductionCutsTable* theCoupleTable= 260 G4ProductionCutsTable::GetProductionCutsTable(); 261 size_t numOfCouples = theCoupleTable->GetTableSize(); 262 263 G4bool splineFlag = (G4LossTableManager::Instance())->SplineFlag(); 264 265 G4PhysicsLogVector* aVector = 0; 266 G4PhysicsLogVector* bVector = 0; 267 268 for (size_t i=0; i<numOfCouples; ++i) { 269 270 if (theLambdaTable->GetFlag(i)) { 271 // create physics vector and fill it 272 const G4MaterialCutsCouple* couple = 273 theCoupleTable->GetMaterialCutsCouple(i); 274 if(!bVector) { 275 aVector = static_cast<G4PhysicsLogVector*>(PhysicsVector(couple)); 276 bVector = aVector; 277 } else { 278 aVector = new G4PhysicsLogVector(*bVector); 279 } 280 //G4PhysicsVector* aVector = PhysicsVector(couple); 281 aVector->SetSpline(splineFlag); 282 modelManager->FillLambdaVector(aVector, couple, false); 283 if(splineFlag) aVector->FillSecondDerivatives(); 284 G4PhysicsTableHelper::SetPhysicsVector(theLambdaTable, i, aVector); 285 } 286 } 287 288 if(1 < verboseLevel) { 289 G4cout << "Lambda table is built for " 290 << num 291 << G4endl; 292 } 293 } 294 if(verboseLevel>0 && ( num == "e-" || num == "mu+" || 295 num == "proton" || num == "pi-" || 296 num == "GenericIon")) { 297 PrintInfoDefinition(); 298 if(2 < verboseLevel && theLambdaTable) G4cout << *theLambdaTable << G4endl; 299 } 300 301 if(1 < verboseLevel) { 302 G4cout << "### G4VMultipleScattering::BuildPhysicsTable() done for " 303 << GetProcessName() 304 << " and particle " << num 305 << G4endl; 306 } 307 } 308 309 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 310 309 311 void G4VMultipleScattering::PrintInfoDefinition() 310 312 { … … 362 364 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 363 365 366 G4double 367 G4VMultipleScattering::PostStepGetPhysicalInteractionLength( 368 const G4Track&, G4double, G4ForceCondition* condition) 369 { 370 *condition = Forced; 371 return DBL_MAX; 372 } 373 374 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 375 376 G4VParticleChange* 377 G4VMultipleScattering::AlongStepDoIt(const G4Track& track, const G4Step& step) 378 { 379 if(currentModel->IsActive(track.GetKineticEnergy())) { 380 fParticleChange.ProposeTrueStepLength(currentModel->ComputeTrueStepLength(step.GetStepLength())); 381 } 382 return &fParticleChange; 383 } 384 385 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 386 387 G4VParticleChange* 388 G4VMultipleScattering::PostStepDoIt(const G4Track& track, const G4Step& step) 389 { 390 fParticleChange.Initialize(track); 391 if(currentModel->IsActive(track.GetKineticEnergy())) { 392 currentModel->SampleScattering(track.GetDynamicParticle(), 393 step.GetPostStepPoint()->GetSafety()); 394 } 395 return &fParticleChange; 396 } 397 398 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 399 364 400 G4double G4VMultipleScattering::GetContinuousStepLimit( 365 401 const G4Track& track, … … 371 407 return AlongStepGetPhysicalInteractionLength(track,previousStepSize,currentMinimalStep, 372 408 currentSafety, selection); 409 } 410 411 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 412 413 G4double G4VMultipleScattering::ContinuousStepLimit( 414 const G4Track& track, 415 G4double previousStepSize, 416 G4double currentMinimalStep, 417 G4double& currentSafety) 418 { 419 return GetContinuousStepLimit(track,previousStepSize,currentMinimalStep, 420 currentSafety); 373 421 } 374 422
Note: See TracChangeset
for help on using the changeset viewer.