Skip to content
Snippets Groups Projects
Commit 52d17121 authored by lintao@ihep.ac.cn's avatar lintao@ihep.ac.cn
Browse files

WIP: add the factory for Generic B-Field Map.

parent 087ab6fd
No related branches found
No related tags found
No related merge requests found
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
gaudi_add_module(MagneticFieldMap gaudi_add_module(MagneticFieldMap
SOURCES src/GenericBFieldMapBrBz.cpp SOURCES src/GenericBFieldMapBrBz.cpp
src/GenericBFieldMapBrBzFactory.cpp
LINK Gaudi::GaudiKernel LINK Gaudi::GaudiKernel
${DD4hep_COMPONENT_LIBRARIES} ${DD4hep_COMPONENT_LIBRARIES}
${ROOT_LIBRARIES} ${ROOT_LIBRARIES}
......
/*
* In this file, the xml is parsed and the GenericBFieldMapBrBz object is created and configured.
*
* -- Tao Lin <lintao AT ihep.ac.cn>
*/
#include "GenericBFieldMapBrBz.h"
#include <DD4hep/Version.h>
#if DD4HEP_VERSION_GE(0,24)
#include <DD4hep/detail/Handle.inl>
#else
#include <DD4hep/Handle.inl>
#endif
#include <DD4hep/FieldTypes.h>
#include <DD4hep/DetFactoryHelper.h>
#include <XML/Utilities.h>
static dd4hep::Ref_t create_GenericBFieldMapBrBz(dd4hep::Detector& ,
dd4hep::xml::Handle_t handle ) {
// 1. retrieve the parameters from xml
dd4hep::xml::Component xmlParameter(handle);
// 2. create the CartesianField
dd4hep::CartesianField obj;
GenericBFieldMapBrBz* ptr = new GenericBFieldMapBrBz();
obj.assign(ptr, xmlParameter.nameStr(), xmlParameter.typeStr());
return obj;
}
DECLARE_XMLELEMENT(GenericBFieldMapBrBz,create_GenericBFieldMapBrBz)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment