1 #include "gearxml/ConstantBFieldXML.h"
3 #include "gearxml/XMLHandlerMgr.h"
4 #include "gearxml/GearParametersXML.h"
6 #include "gearxml/tinyxml.h"
7 #include "gearimpl/ConstantBField.h"
9 #include "gear/GearMgr.h"
21 throw Exception(
"ConstantBFieldXML::toXML given parmeters not of correct type. "
22 "needs to be gear::ConstantBField." );
virtual GearParameters * fromXML(const TiXmlElement *xmlElement, GearMgr *gearMgr=0) const
Creates the appropriate GearParameters subclass from the given XML element (node) ...
virtual void setBField(BField *bField)=0
Set the BField.
Base exception class for GEAR - all other exceptions extend this.
static void setParametersFromXML(const TiXmlElement *xmlElement, GearParametersImpl *gearParams)
Static helper function that can be used by other subclass handlers to read parameters.
Abstract interface for a set of parameters that can be used to describe the geometrical properties of...
Simple three dimensional vector providing the components for cartesian, cylindrical and spherical coo...
static void getXMLForParameters(TiXmlElement *xmlElement, const GearParameters *gearParams)
Static helper function that can be used by other subclass handlers to create XML for parameters...
double x() const
Cartesian x coordinate.
double y() const
Cartesian y coordinate.
double z()
Cartesian cartesian z coordinate.
std::string getXMLAttribute(const TiXmlNode *node, const std::string &name)
Helper method used for parsing XML.
Global B field map implementation with constant field.
The element is a container class.
void SetDoubleAttribute(const char *name, double value)
Sets an attribute of name to a given value.
Abstract interface for a manager class that returns the Gear classes for the relevant subdetectors...
void SetAttribute(const char *name, const char *value)
Sets an attribute of name to a given value.
virtual Vector3D at(Vector3D) const
Returns the B field vector in Tesla at given point.
virtual TiXmlElement toXML(const GearParameters ¶meters) const
Creates an XML node for the given parameters.