ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
TightMuonElseNoFieldManager Class Reference

G4FieldManager that sets tight stepping for muons; disables magnetic field for other particles. More...

#include <TightMuonElseNoFieldManager.h>

Inheritance diagram for TightMuonElseNoFieldManager:
Collaboration diagram for TightMuonElseNoFieldManager:

Public Member Functions

 TightMuonElseNoFieldManager (G4Field *detectorField=0, G4ChordFinder *pChordFinder=0, G4bool b=true)
 Constructor. More...
 
 TightMuonElseNoFieldManager (G4MagneticField *detectorMagneticField)
 Simple constructor. More...
 
virtual ~TightMuonElseNoFieldManager ()
 Simple destructor. More...
 
virtual void ConfigureForTrack (const G4Track *) override final
 The one interesting method. More...
 

Private Attributes

G4Field * m_globalField
 Parameters of the stepper. More...
 

Detailed Description

G4FieldManager that sets tight stepping for muons; disables magnetic field for other particles.

Author
Zach Marshall
Date
2016-06-01

Definition at line 23 of file TightMuonElseNoFieldManager.h.

Constructor & Destructor Documentation

◆ TightMuonElseNoFieldManager() [1/2]

TightMuonElseNoFieldManager::TightMuonElseNoFieldManager ( G4Field *  detectorField = 0,
G4ChordFinder *  pChordFinder = 0,
G4bool  b = true 
)

Constructor.

Normal constructor.

Definition at line 12 of file TightMuonElseNoFieldManager.cxx.

13  : G4FieldManager(detectorField,pChordFinder,b)
14  , m_globalField(nullptr)
15 {}

◆ TightMuonElseNoFieldManager() [2/2]

TightMuonElseNoFieldManager::TightMuonElseNoFieldManager ( G4MagneticField *  detectorMagneticField)

Simple constructor.

Definition at line 18 of file TightMuonElseNoFieldManager.cxx.

19  : G4FieldManager(detectorMagneticField)
20  , m_globalField(nullptr)
21 {}

◆ ~TightMuonElseNoFieldManager()

virtual TightMuonElseNoFieldManager::~TightMuonElseNoFieldManager ( )
inlinevirtual

Simple destructor.

Definition at line 33 of file TightMuonElseNoFieldManager.h.

33 {}

Member Function Documentation

◆ ConfigureForTrack()

void TightMuonElseNoFieldManager::ConfigureForTrack ( const G4Track *  track)
finaloverridevirtual

The one interesting method.

Definition at line 24 of file TightMuonElseNoFieldManager.cxx.

25 {
26  // If they have not been set yet, get the settings for the global field manager
27  if (nullptr==m_globalField){
28  // Ok, we're just holding it and giving it back to the base class,
29  // and this method is not const.
30  // But the G4 base class interface makes this impossible to avoid
31  // (We could avoid it if G4FieldManager also had a non-const
32  // GetDetectorField.)
33  G4Field* field_nc ATLAS_THREAD_SAFE = const_cast<G4Field*>(GetDetectorField());
34  m_globalField = field_nc;
35  }
36 
37  // If this is a muon, move it in the magnetic field; otherwise turn off the stepping
38  if (track->GetDefinition()==G4MuonPlus::Definition() ||
39  track->GetDefinition()==G4MuonMinus::Definition() ){
40  SetDetectorField(m_globalField);
41  } else {
42  SetDetectorField(nullptr);
43  }
44 
45 }

Member Data Documentation

◆ m_globalField

G4Field* TightMuonElseNoFieldManager::m_globalField
private

Parameters of the stepper.

This is to cache the global ones; the muon ones will be hard-coded

Definition at line 40 of file TightMuonElseNoFieldManager.h.


The documentation for this class was generated from the following files:
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
TightMuonElseNoFieldManager::m_globalField
G4Field * m_globalField
Parameters of the stepper.
Definition: TightMuonElseNoFieldManager.h:40
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
ATLAS_THREAD_SAFE
#define ATLAS_THREAD_SAFE
Definition: checker_macros.h:211