28 ISvcLocator* pSvcLocator)
37 return StatusCode::FAILURE;
44 m_tree =
new TTree(treeName.c_str(),
"Magnetic field in the solenoid");
48 "dBxdx/D:dBxdy/D:dBxdz/D:dBydx/D:dBydy/D:dBydz/"
49 "D:dBzdx/D:dBzdy/D:dBzdz/D");
52 "dBxdx2/D:dBxdy2/D:dBxdz2/D:dBydx2/D:dBydy2/D:dBydz2/"
53 "D:dBzdx2/D:dBzdy2/D:dBzdz2/D");
57 return StatusCode::FAILURE;
60 return StatusCode::SUCCESS;
65 Gaudi::Hive::currentContext()};
67 if (fieldCondObj ==
nullptr) {
68 ATH_MSG_ERROR(
"Failed to retrieve AtlasFieldCacheCondObj with key "
70 return StatusCode::FAILURE;
94 <<
" with xyz: " <<
m_xyzt[0] <<
", "
96 <<
" with value " <<
m_field[0] <<
", "
105 return StatusCode::SUCCESS;
Scalar deltaPhi(const MatrixBase< Derived > &vec) const
Scalar deltaR(const MatrixBase< Derived > &vec) const
Scalar phi() const
phi method
#define ATH_CHECK
Evaluate an expression and check for errors.
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
void getInitializedCache(MagField::AtlasFieldCache &cache) const
get B field cache for evaluation as a function of 2-d or 3-d position.
Local cache for magnetic field (based on MagFieldServices/AtlasFieldSvcTLS.h)
void getField(const double *ATH_RESTRICT xyz, double *ATH_RESTRICT bxyz, double *ATH_RESTRICT deriv=nullptr)
get B field value at given position xyz[3] is in mm, bxyz[3] is in kT if deriv[9] is given,...
void getFieldZR(const double *ATH_RESTRICT xyz, double *ATH_RESTRICT bxyz, double *ATH_RESTRICT deriv=nullptr)
get B field valaue on the z-r plane at given position works only inside the solenoid.
virtual StatusCode initialize() override final
Gaudi::Property< double > m_minR
TTree * m_tree
the ROOT tree containing the output
Gaudi::Property< int > m_stepsZ
Gaudi::Property< double > m_minZ
SolenoidTest(const std::string &name, ISvcLocator *pSvcLocator)
std::atomic< long int > m_eventsSeen
event counter
double m_derivZR[9]
stores derivatives
double m_xyzt[4]
Variable to write out.
Gaudi::Property< int > m_event
Gaudi::Property< double > m_maxZ
Gaudi::Property< std::string > m_treeName
Gaudi::Property< double > m_maxR
double m_deriv[9]
stores derivatives
ServiceHandle< ITHistSvc > m_thistSvc
Histogram Service.
Gaudi::Property< std::string > m_histStream
Gaudi::Property< int > m_stepsR
Gaudi::Property< int > m_stepsPhi
double m_field[3]
stores the field components
double m_fieldZR[3]
stores the 2d field components
virtual StatusCode execute() override final
SG::ReadCondHandleKey< AtlasFieldCacheCondObj > m_fieldCacheKey