ATLAS Offline Software
Loading...
Searching...
No Matches
Simulation
G4Atlas
G4AtlasTools
src
TightMuonElseNoFieldManager.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
TightMuonElseNoFieldManager.h
"
6
#include "
CxxUtils/checker_macros.h
"
7
#include "G4Track.hh"
8
#include "G4MuonPlus.hh"
9
#include "G4MuonMinus.hh"
10
12
TightMuonElseNoFieldManager::TightMuonElseNoFieldManager
(G4Field *detectorField, G4ChordFinder *pChordFinder, G4bool b)
13
: G4FieldManager(detectorField,pChordFinder,b)
14
,
m_globalField
(nullptr)
15
{}
16
18
TightMuonElseNoFieldManager::TightMuonElseNoFieldManager
(G4MagneticField *detectorMagneticField)
19
: G4FieldManager(detectorMagneticField)
20
,
m_globalField
(nullptr)
21
{}
22
24
void
TightMuonElseNoFieldManager::ConfigureForTrack
(
const
G4Track * track)
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
}
TightMuonElseNoFieldManager.h
checker_macros.h
Define macros for attributes used to control the static checker.
ATLAS_THREAD_SAFE
#define ATLAS_THREAD_SAFE
Definition
checker_macros.h:211
TightMuonElseNoFieldManager::m_globalField
G4Field * m_globalField
Parameters of the stepper.
Definition
TightMuonElseNoFieldManager.h:40
TightMuonElseNoFieldManager::ConfigureForTrack
virtual void ConfigureForTrack(const G4Track *) override final
The one interesting method.
Definition
TightMuonElseNoFieldManager.cxx:24
TightMuonElseNoFieldManager::TightMuonElseNoFieldManager
TightMuonElseNoFieldManager(G4Field *detectorField=0, G4ChordFinder *pChordFinder=0, G4bool b=true)
Constructor.
Definition
TightMuonElseNoFieldManager.cxx:12
Generated on
for ATLAS Offline Software by
1.14.0