- Timestamp:
- Dec 22, 2010, 3:52:27 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/geometry/navigation/src/G4PropagatorInField.cc
r1315 r1347 36 36 // 17.03.97 John Apostolakis, renaming new set functions being added 37 37 // 38 // $Id: G4PropagatorInField.cc,v 1.5 1 2010/03/08 13:57:34gcosmo Exp $38 // $Id: G4PropagatorInField.cc,v 1.52 2010/07/13 15:59:42 gcosmo Exp $ 39 39 // GEANT4 tag $ Name: $ 40 40 // --------------------------------------------------------------------------- … … 470 470 G4VPhysicalVolume* startVolume) 471 471 { 472 const G4int verboseLevel= 472 const G4int verboseLevel=fVerboseLevel; 473 473 const G4ThreeVector StartPosition = StartFT.GetPosition(); 474 474 const G4ThreeVector StartUnitVelocity = StartFT.GetMomentumDir(); … … 477 477 478 478 G4double step_len = CurrentFT.GetCurveLength() - StartFT.GetCurveLength(); 479 480 G4int oldprec; // cout/cerr precision settings 479 481 480 if( ((stepNo == 0) && (verboseLevel <3)) 481 || (verboseLevel >= 3) ) 482 { 483 static G4int noPrecision= 4; 484 G4cout.precision(noPrecision); 485 // G4cout.setf(ios_base::fixed,ios_base::floatfield); 482 if( ((stepNo == 0) && (verboseLevel <3)) || (verboseLevel >= 3) ) 483 { 484 oldprec = G4cout.precision(4); 486 485 G4cout << std::setw( 6) << " " 487 486 << std::setw( 25) << " Current Position and Direction" << " " … … 495 494 << std::setw( 7) << " N_y " << " " 496 495 << std::setw( 7) << " N_z " << " " ; 497 // << G4endl; 498 G4cout // << " >>> " 499 << std::setw( 7) << " Delta|N|" << " " 500 // << std::setw( 7) << " Delta(N_z) " << " " 496 G4cout << std::setw( 7) << " Delta|N|" << " " 501 497 << std::setw( 9) << "StepLen" << " " 502 498 << std::setw(12) << "StartSafety" << " " 503 499 << std::setw( 9) << "PhsStep" << " "; 504 if( startVolume ) {505 G4cout << std::setw(18) << "NextVolume" << " ";506 }500 if( startVolume ) 501 { G4cout << std::setw(18) << "NextVolume" << " "; } 502 G4cout.precision(oldprec); 507 503 G4cout << G4endl; 508 504 } 509 if((stepNo == 0) && (verboseLevel <=3)){ 510 // Recurse to print the start values 511 // 512 printStatus( StartFT, StartFT, -1.0, safety, -1, startVolume); 513 } 514 if( verboseLevel <= 3 ) 515 { 516 if( stepNo >= 0) 517 G4cout << std::setw( 4) << stepNo << " "; 518 else 519 G4cout << std::setw( 5) << "Start" ; 520 G4cout.precision(8); 521 G4cout << std::setw(10) << CurrentFT.GetCurveLength() << " "; 522 G4cout.precision(8); 523 G4cout << std::setw(10) << CurrentPosition.x() << " " 524 << std::setw(10) << CurrentPosition.y() << " " 525 << std::setw(10) << CurrentPosition.z() << " "; 526 G4cout.precision(4); 527 G4cout << std::setw( 7) << CurrentUnitVelocity.x() << " " 528 << std::setw( 7) << CurrentUnitVelocity.y() << " " 529 << std::setw( 7) << CurrentUnitVelocity.z() << " "; 530 // G4cout << G4endl; 531 // G4cout << " >>> " ; 532 G4cout.precision(3); 533 G4cout << std::setw( 7) << CurrentFT.GetMomentum().mag()- StartFT.GetMomentum().mag() << " "; 534 // << std::setw( 7) << CurrentUnitVelocity.z() - InitialUnitVelocity.z() << " "; 535 G4cout << std::setw( 9) << step_len << " "; 536 G4cout << std::setw(12) << safety << " "; 537 if( requestStep != -1.0 ) 538 G4cout << std::setw( 9) << requestStep << " "; 539 else 540 G4cout << std::setw( 9) << "Init/NotKnown" << " "; 541 542 if( startVolume != 0) 543 { 544 G4cout << std::setw(12) << startVolume->GetName() << " "; 545 } 546 #if 0 547 else 548 { 549 if( step_len != -1 ) 550 G4cout << std::setw(12) << "OutOfWorld" << " "; 551 else 552 G4cout << std::setw(12) << "NotGiven" << " "; 553 } 554 #endif 555 556 G4cout << G4endl; 557 } 558 else // if( verboseLevel > 3 ) 559 { 560 // Multi-line output 561 562 G4cout << "Step taken was " << step_len 563 << " out of PhysicalStep = " << requestStep << G4endl; 564 G4cout << "Final safety is: " << safety << G4endl; 565 566 G4cout << "Chord length = " << (CurrentPosition-StartPosition).mag() 567 << G4endl; 568 G4cout << G4endl; 569 } 505 if((stepNo == 0) && (verboseLevel <=3)) 506 { 507 // Recurse to print the start values 508 // 509 printStatus( StartFT, StartFT, -1.0, safety, -1, startVolume); 510 } 511 if( verboseLevel <= 3 ) 512 { 513 if( stepNo >= 0) 514 { G4cout << std::setw( 4) << stepNo << " "; } 515 else 516 { G4cout << std::setw( 5) << "Start" ; } 517 oldprec = G4cout.precision(8); 518 G4cout << std::setw(10) << CurrentFT.GetCurveLength() << " "; 519 G4cout.precision(8); 520 G4cout << std::setw(10) << CurrentPosition.x() << " " 521 << std::setw(10) << CurrentPosition.y() << " " 522 << std::setw(10) << CurrentPosition.z() << " "; 523 G4cout.precision(4); 524 G4cout << std::setw( 7) << CurrentUnitVelocity.x() << " " 525 << std::setw( 7) << CurrentUnitVelocity.y() << " " 526 << std::setw( 7) << CurrentUnitVelocity.z() << " "; 527 G4cout.precision(3); 528 G4cout << std::setw( 7) 529 << CurrentFT.GetMomentum().mag()-StartFT.GetMomentum().mag() << " "; 530 G4cout << std::setw( 9) << step_len << " "; 531 G4cout << std::setw(12) << safety << " "; 532 if( requestStep != -1.0 ) 533 { G4cout << std::setw( 9) << requestStep << " "; } 534 else 535 { G4cout << std::setw( 9) << "Init/NotKnown" << " "; } 536 if( startVolume != 0) 537 { G4cout << std::setw(12) << startVolume->GetName() << " "; } 538 G4cout.precision(oldprec); 539 G4cout << G4endl; 540 } 541 else // if( verboseLevel > 3 ) 542 { 543 // Multi-line output 544 545 G4cout << "Step taken was " << step_len 546 << " out of PhysicalStep = " << requestStep << G4endl; 547 G4cout << "Final safety is: " << safety << G4endl; 548 G4cout << "Chord length = " << (CurrentPosition-StartPosition).mag() 549 << G4endl; 550 G4cout << G4endl; 551 } 570 552 } 571 553
Note: See TracChangeset
for help on using the changeset viewer.