|
40 | 40 | #include "G4ChordFinder.hh"
|
41 | 41 | #include "G4PropagatorInField.hh"
|
42 | 42 | #include "G4TransportationManager.hh"
|
43 |
| - |
| 43 | +#include "G4MagIntegratorDriver.hh" |
44 | 44 |
|
45 | 45 | // Constant for determining unit conversion when using normal as integrand.
|
46 | 46 | //
|
@@ -187,21 +187,14 @@ G4MagHelicalStepper::AdvanceHelix( const G4double yIn[],
|
187 | 187 | G4ChordFinder *cf = G4TransportationManager::GetTransportationManager()->
|
188 | 188 | GetPropagatorInField()->
|
189 | 189 | GetChordFinder();
|
190 |
| - //G4double flast = cf->GetFractionLast(); |
191 |
| - //G4double fnext = cf->GetFractionNextEstimate(); |
192 |
| - //static G4double fnext_saved = 0.98; |
193 |
| - if (GetAngCurve() > 2*M_PI && 2*GetRadHelix() > cf->GetDeltaChord()) { |
194 |
| - G4cerr << "Warning in G4MagHelicalStepper::AdvanceHelix - " |
195 |
| - << "low-energy particle spiralling in strong magnetic field " |
196 |
| - << G4endl; |
197 |
| - G4cerr << "needs to limit the step, but hooks to do so were removed " |
198 |
| - << "from G4ChordFinder in v4.10.06 -- complain to R.T. Jones!" |
199 |
| - << G4endl; |
200 |
| - //cf->SetFractions_Last_Next(flast, 2*M_PI / GetAngCurve()); |
| 190 | + if (GetAngCurve() > M_PI && 2*GetRadHelix() > cf->GetDeltaChord()) { |
| 191 | + G4MagInt_Driver *driver = |
| 192 | + dynamic_cast<G4MagInt_Driver*>(cf->GetIntegrationDriver()); |
| 193 | + if (driver) |
| 194 | + driver->SetFractions_Last_Next(-1, M_PI / GetAngCurve()); |
| 195 | + else |
| 196 | + driver->SetFractions_Last_Next(-1, -1); |
201 | 197 | }
|
202 |
| - //else if (fnext != fnext_saved) { |
203 |
| - // cf->SetFractions_Last_Next(flast, fnext_saved); |
204 |
| - //} |
205 | 198 | }
|
206 | 199 |
|
207 | 200 | // Use the midpoint method to get an error estimate and correction
|
|
0 commit comments