|
ATLAS Offline Software
|
Go to the documentation of this file.
27 #include "CLHEP/Units/SystemOfUnits.h"
32 m_H8MapFilename(
"MagneticFieldMaps/mbps1-all-id-800-mbps2-muons-800x4.data"),
57 return StatusCode::SUCCESS;
63 return readMap( m_H8MapFilename );
69 return StatusCode::SUCCESS;
76 if ( resolvedMapFile.empty() ) {
77 ATH_MSG_ERROR(
"Field map file " << mapFile <<
" not found" );
78 return StatusCode::FAILURE;
81 std::ifstream
input( resolvedMapFile.c_str() );
82 if ( !
input.good() ) {
83 ATH_MSG_ERROR(
"Failed to open the field map " << resolvedMapFile );
84 return StatusCode::FAILURE;
99 }
else if (igrid == 1) {
124 ATH_MSG_INFO(
" - min (mm) " << its_min[0] <<
", " << its_min[1] <<
", " << its_min[2]);
125 ATH_MSG_INFO(
" - max (mm) " << its_max[0] <<
", " << its_max[1] <<
", " << its_max[2]);
126 ATH_MSG_INFO(
" - offset (mm) " << its_d[0] <<
", " << its_d[1] <<
", " << its_d[2]);
127 m_grid.push_back( grid );
133 ATH_MSG_INFO(
"Initialized the field map from " << resolvedMapFile );
134 return StatusCode::SUCCESS;
139 for (
unsigned i = 0;
i < m_grid.size();
i++ ) {
142 m_grid[
i].getB(
xyz, B, deriv );
147 B[0] = B[1] = B[2] = 0.0;
148 if ( deriv !=
nullptr ) {
149 for (
int j = 0; j < 9; j++ ) deriv[j] = 0.0;
155 getField(
xyz, B, deriv );
virtual void getFieldZR(const double *xyz, double *bxyz, double *deriv=nullptr) const
getFieldZR simply calls getField
virtual ~H8FieldSvc()
Destructor.
This file defines the class for a collection of AttributeLists where each one is associated with a ch...
static std::string find_file(const std::string &logical_file_name, const std::string &search_path, SearchType search_type=LocalSearch)
std::string m_H8MapFilename
Data members.
StatusCode readMap(const std::string &mapFile)
void getBounds(double *out_min, double *out_max, double *out_d) const
StatusCode initialize()
Athena algorithm's interface methods.
H8FieldSvc(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
::StatusCode StatusCode
StatusCode definition for legacy code.
AthROOTErrorHandlerSvc * svc
void readMap(std::istream &input)
virtual void getField(const double *xyz, double *bxyz, double *deriv=nullptr) const
get B field value at given position
void setOffset(const double *dxyz)