5 #include "G4ThreeVector.hh"
10 #include "G4ChordFinder.hh"
13 #include "G4MuonPlus.hh"
14 #include "G4MuonMinus.hh"
15 #include "G4ChargedGeantino.hh"
20 : G4FieldManager( detectorField ),
21 m_savedField( detectorField )
32 || GetDetectorField() ==
nullptr );
37 const bool isMuonTrack = (
track->GetDefinition()==G4MuonPlus::Definition() ||
38 track->GetDefinition()==G4MuonMinus::Definition() ||
39 track->GetDefinition()==G4ChargedGeantino::ChargedGeantinoDefinition());
41 const G4ThreeVector position =
track->GetPosition();
42 const G4double r2XY = position.x()*position.x() + position.y()*position.y();
43 const G4double
Z = position.z();
47 const bool inSide = (r2XY > r2Min) && (r2XY < r2Max) && (fabs(
Z) <
m_Zmax -
m_offset);
49 if ( inSide && DoesFieldExist() && !isMuonTrack )
50 ChangeDetectorField(
nullptr );
51 else if ( !inSide && !DoesFieldExist() )
61 clone->SetDeltaOneStep( this->GetDeltaOneStep() );
62 clone->SetDeltaIntersection( this->GetDeltaIntersection() );
64 clone->GetChordFinder()->SetDeltaChord( this->GetChordFinder()->GetDeltaChord() );