ATLAS Offline Software
Loading...
Searching...
No Matches
IMagFieldSvc.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
6// IMagFieldSvc.h, (c) ATLAS Detector software
8#ifndef G4ATLASINTERFACES_IMAGFIELDSVC_H
9#define G4ATLASINTERFACES_IMAGFIELDSVC_H
10
11// Framework includes
12#include "GaudiKernel/IInterface.h"
13
14namespace MagField {
15
20 class IMagFieldSvc: virtual public IInterface {
21
23 // Public methods:
25 public:
26
29
32
36 virtual void getField(const double *xyz, double *bxyz, double *deriv = nullptr) const = 0;
37
42 virtual void getFieldZR(const double *xyz, double *bxyz, double *deriv = nullptr) const = 0;
43
45 bool solenoidOn() const { return solenoidCurrent() > 0.0; }
46 bool toroidOn() const { return toroidCurrent() > 0.0; }
47 float solenoidCurrent() const { return m_solenoidCurrent; }
48 float toroidCurrent() const { return m_toroidCurrent; }
49
50 protected:
51 void setSolenoidCurrent(float current) { m_solenoidCurrent = current; }
52 void setToroidCurrent (float current) { m_toroidCurrent = current; }
53
54 private:
55 float m_solenoidCurrent; // solenoid current in ampere
56 float m_toroidCurrent; // toroid current in ampere
57 };
58}
59
60#endif //> !MAGFIELDINTERFACES_IMAGFIELDSVC_H
#define xyz
bool solenoidOn() const
status of the magnets
float solenoidCurrent() const
void setToroidCurrent(float current)
virtual void getField(const double *xyz, double *bxyz, double *deriv=nullptr) const =0
get B field value at given position
void setSolenoidCurrent(float current)
DeclareInterfaceID(IMagFieldSvc, 1, 0)
Creates the InterfaceID and interfaceID() method.
float toroidCurrent() const
virtual void getFieldZR(const double *xyz, double *bxyz, double *deriv=nullptr) const =0
get B field value on the z-r plane at given position
IMagFieldSvc()
constructor
Local cache for magnetic field (based on MagFieldServices/AtlasFieldSvcTLS.h)