ATLAS Offline Software
Loading...
Searching...
No Matches
ConstantFieldSvc.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 "ConstantFieldSvc.h"
6
7// Geant4 includes
8#include "G4UniformMagField.hh"
9
10ConstantFieldSvc::ConstantFieldSvc(const std::string& name, ISvcLocator* pSvcLocator)
11 : G4MagFieldSvcBase(name, pSvcLocator)
12{
13}
14
16{
17 ATH_MSG_DEBUG( "Initializing " << name() );
18 return StatusCode::SUCCESS;
19}
20
22{
23 ATH_MSG_VERBOSE( "ConstantFieldSvc::makeField" );
24 const G4ThreeVector fieldVec(m_fieldX, m_fieldY, m_fieldZ);
25 return new G4UniformMagField(fieldVec);
26}
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_DEBUG(x)
ConstantFieldSvc(const std::string &name, ISvcLocator *pSvcLocator)
Basic constructor and destructor.
Gaudi::Property< double > m_fieldX
Gaudi::Property< double > m_fieldZ
StatusCode initialize() override final
Athena method.
G4MagneticField * makeField() override final
Create the field object.
Gaudi::Property< double > m_fieldY
G4MagFieldSvcBase(const std::string &name, ISvcLocator *pSvcLocator)
Standard constructor.