5 #include "G4ThreeVector.hh"
9 #include "G4ChordFinder.hh"
12 #include "G4MuonPlus.hh"
13 #include "G4MuonMinus.hh"
14 #include "G4ChargedGeantino.hh"
19 : G4FieldManager( detectorField ),
20 m_savedField( detectorField )
31 || GetDetectorField() ==
nullptr );
36 const bool isMuonTrack = (
track->GetDefinition()==G4MuonPlus::Definition() ||
37 track->GetDefinition()==G4MuonMinus::Definition() ||
38 track->GetDefinition()==G4ChargedGeantino::ChargedGeantinoDefinition());
40 const G4ThreeVector position =
track->GetPosition();
41 const G4double r2XY = position.x()*position.x() + position.y()*position.y();
42 const G4double
Z = position.z();
46 const bool inSide = (r2XY > r2Min) && (r2XY < r2Max) && (fabs(
Z) <
m_Zmax -
m_offset);
48 if ( inSide && DoesFieldExist() && !isMuonTrack )
49 ChangeDetectorField(
nullptr );
50 else if ( !inSide && !DoesFieldExist() )
59 clone->SetMinimumEpsilonStep( this->GetMinimumEpsilonStep() );
60 clone->SetMaximumEpsilonStep( this->GetMaximumEpsilonStep() );
61 clone->SetDeltaOneStep( this->GetDeltaOneStep() );
62 clone->SetDeltaIntersection( this->GetDeltaIntersection() );
64 clone->GetChordFinder()->SetDeltaChord( this->GetChordFinder()->GetDeltaChord() );