ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Simulation
G4Atlas
G4AtlasServices
src
G4MagFieldSvcBase.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
G4MagFieldSvcBase.h
"
6
7
#include <memory>
8
9
// Geant4 includes
10
#include "G4MagneticField.hh"
11
12
//-----------------------------------------------------------------------------
13
// Implementation file for class : G4MagFieldSvcBase
14
//
15
// 2015-11-17: Andrea Dell'Acqua
16
//-----------------------------------------------------------------------------
17
18
19
//=============================================================================
20
// Standard constructor, initializes variables
21
//=============================================================================
22
G4MagFieldSvcBase::G4MagFieldSvcBase
(
const
std::string& name,
23
ISvcLocator* pSvcLocator)
24
: base_class(name, pSvcLocator)
25
{
26
}
27
28
//=============================================================================
29
// Retrieve a G4 mag field object
30
//=============================================================================
31
G4MagneticField*
G4MagFieldSvcBase::getField
()
32
{
33
ATH_MSG_DEBUG
(
"G4MagFieldSvcBase::getField"
);
34
35
// create a thread-local magnetic field instance
36
static
thread_local
std::unique_ptr<G4MagneticField> field{
makeField
()};
37
38
return
field.get();
39
}
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
G4MagFieldSvcBase.h
G4MagFieldSvcBase::G4MagFieldSvcBase
G4MagFieldSvcBase(const std::string &name, ISvcLocator *pSvcLocator)
Standard constructor.
Definition
G4MagFieldSvcBase.cxx:22
G4MagFieldSvcBase::getField
G4MagneticField * getField() override final
Retrieve a G4 magnetic field object.
Definition
G4MagFieldSvcBase.cxx:31
G4MagFieldSvcBase::makeField
virtual G4MagneticField * makeField()=0
This method must be overridden by concrete tools to create a new field.
Generated on
for ATLAS Offline Software by
1.17.0