1 #include "gearxml/TrackerPlanesParametersXML.h"
3 #include "gearxml/XMLHandlerMgr.h"
4 #include "gearxml/GearParametersXML.h"
6 #include "gearxml/tinyxml.h"
7 #include "gearimpl/TrackerPlanesParametersImpl.h"
9 #include "gear/GearMgr.h"
36 throw Exception(
"TrackerPlanesParametersXML::toXML given parameters not of correct type. "
37 "needs to be gear::TrackerPlanesParameters." ) ;
57 for(
int il=0 ; il < trackerplanesLayerLayout.
getNLayers() ; il++ ) {
61 if( layer == 0 )
continue;
67 for(
unsigned i=0 ; i < material.size() ; i++ ) {
88 for(
unsigned i=0 ; i < sensitive.size() ; i++ ) {
129 int setupID = atoi(
getXMLAttribute( trackerplanesID ,
"ID" ).c_str() ) ;
134 int nplanes = atoi(
getXMLAttribute( trackerplanesNumber ,
"number" ).c_str() ) ;
144 while( ( xmlLayer = xmlLayers->
IterateChildren(
"layer" , xmlLayer ) ) != 0 ) {
149 std::cout <<
" layer ID " << layerID << std::endl;
150 layerImpl->
setID( layerID ) ;
153 std::cout <<
" layer Info " << infoLayer << std::endl;
154 layerImpl->
setInfo( infoLayer ) ;
157 while( ( xmlLad = xmlLayer->
IterateChildren(
"ladder" , xmlLad ) ) != 0 ) {
172 std::cout <<
" material layer ID " << lID << std::endl;
174 layerImpl->
addMaterialLayer( lID, lInfo, lPosX, lPosY, lPosZ, lRotXY, lRotZX, lRotZY, lSizX, lSizY, lThick, lRadLen);
178 while( ( xmlSen = xmlLayer->
IterateChildren(
"sensitive" , xmlSen ) ) != 0 ) {
199 std::cout <<
" sensitive layer ID " << sID << std::endl;
201 layerImpl->
addSensitiveLayer( sID, sInfo, sPosX, sPosY, sPosZ, sRotXY, sRotZX, sRotZY, sSizX, sSizY, sThick, sRadLen, sNPixX, sNPixY, sPitX, sPitY, sResolX, sResolY);
204 trackerplanesParam->
addLayer( layerImpl ) ;
220 return trackerplanesParam ;
virtual int getID() const
ID of sensitive volume of layer layerIndex - layer indexing starts at 0 for the layer closest to the ...
virtual GearParameters * fromXML(const TiXmlElement *xmlElement, GearMgr *gearMgr=0) const
Creates the appropriate GearParameters subclass from the given XML element (node) ...
virtual double getRotationXY() const
rotation angles according to Euler implementation scheme (in XY plane -> around axis Z: gamma ) ...
virtual double getResolutionY() const
Intrinsic resolution of layer layerIndex - layer indexing starts at 0 for the layer closest to the be...
std::string getOptionalXMLAttribute(const TiXmlNode *node, const std::string &name, const std::string &defaultValue)
Helper method used for parsing XML.
virtual const TrackerPlanesLayerLayout & getTrackerPlanesLayerLayout() const =0
The layer layout of pixel beam telescope.
virtual int getNpixelX() const
Number of pixels in x direction in sensitive volume of layer layerIndex - layer indexing starts at 0 ...
Base exception class for GEAR - all other exceptions extend this.
virtual double getRotationZX() const
rotation angles according to Euler implmentation scheme (in ZX plane -> around axis Y: beta ) ...
virtual const TrackerPlanesLayerImpl * getLayer(unsigned int ID) const =0
a free parameter string field
virtual double getSizeY() const
Size in y direction of sensitive volume of layer layerIndex - layer indexing starts at 0 for the laye...
virtual double getPositionZ() const
z position of the center of sensitive volume of layer layerIndex - layer indexing starts at 0 for the...
virtual double getRotationZY() const
rotation angles according to Euler implmentation scheme (in ZY plane -> around axis X: alfa ) ...
virtual double getSizeX() const
Size in x direction of sensitive volume of layer layerIndex - layer indexing starts at 0 for the laye...
virtual double getSizeY() const
Size in y direction of nonsensitive volume of layer layerIndex - layer indexing starts at 0 for the l...
virtual double getPositionY() const
y position of the center of nonsensitive volume of layer layerIndex - layer indexing starts at 0 for ...
virtual void addMaterialLayer(int ID, std::string info, double PositionX, double PositionY, double PositionZ, double RotationXY, double RotationZX, double RotationZY, double SizeX, double SizeY, double Thickness, double RadLength)
add methods
static void setParametersFromXML(const TiXmlElement *xmlElement, GearParametersImpl *gearParams)
Static helper function that can be used by other subclass handlers to read parameters.
virtual void setTrackerPlanesParameters(TrackerPlanesParameters *trackerplanesParameters)=0
Set the TrackerPlanesParameters.
virtual double getThickness() const
Thickness of nonsensitive volume of layer layerIndex - layer indexing starts at 0 for the layer close...
Abstract interface for a set of parameters that can be used to describe the geometrical properties of...
virtual int getLayoutID() const =0
ID of telescope setup.
Abstract description of layers in pixel beam telescope.
virtual double getPositionZ() const
z position of the center of nonsensitive volume of layer layerIndex - layer indexing starts at 0 for ...
static void getXMLForParameters(TiXmlElement *xmlElement, const GearParameters *gearParams)
Static helper function that can be used by other subclass handlers to create XML for parameters...
virtual double getRotationZX() const
rotation angles according to Euler implmentation scheme (in ZX plane -> around axis Y: beta ) ...
The parent class for everything in the Document Object Model.
virtual void setInfo(std::string value)
get methods
virtual double getPositionX() const
x position of the center of sensitive volume of layer layerIndex - layer indexing starts at 0 for the...
std::string getXMLAttribute(const TiXmlNode *node, const std::string &name)
Helper method used for parsing XML.
virtual double getResolutionX() const
Intrinsic resolution of layer layerIndex - layer indexing starts at 0 for the layer closest to the be...
TrackerPlanesSensitiveLayerImplVec & getSensitiveLayerVec()
get methods
virtual int getNpixelY() const
Number of pixels in y direction in sensitive volume of layer layerIndex - layer indexing starts at 0 ...
virtual void addSensitiveLayer(int ID, std::string info, double PositionX, double PositionY, double PositionZ, double RotationXY, double RotationZX, double RotationZY, double SizeX, double SizeY, double Thickness, double RadLength, int NpixelX, int NpixelY, double PitchX, double PitchY, double ResolutionX, double ResolutionY)
add methods
virtual double getRotationZY() const
rotation angles according to Euler implmentation scheme (in ZY plane -> around axis X: alfa ) ...
The element is a container class.
virtual double getPositionY() const
y position of the center of sensitive volume of layer layerIndex - layer indexing starts at 0 for the...
virtual double getSizeX() const
Size in x direction of nonsensitive volume of layer layerIndex - layer indexing starts at 0 for the l...
TiXmlNode * InsertEndChild(const TiXmlNode &addThis)
Add a new node related to this.
virtual double getRadLength() const
The radiation length of sensitive volume of layer layerIndex - layer indexing starts at 0 for the lay...
virtual double getPositionX() const
x position of the center of nonsensitive volume of layer layerIndex - layer indexing starts at 0 for ...
virtual int getLayoutNumberOfLayers() const =0
Number of telescope planes of TrackerPlanes detector.
virtual double getRotationXY() const
rotation angles according to Euler implementation scheme (in XY plane -> around axis Z: gamma ) ...
virtual int getNLayers() const =0
The total number of layers.
Abstract description of layers in pixel beam telescope.
void SetDoubleAttribute(const char *name, double value)
Sets an attribute of name to a given value.
virtual double getPitchY() const
Pitch size in y direction in sensitive volume of layer layerIndex - layer indexing starts at 0 for th...
Abstract interface for a manager class that returns the Gear classes for the relevant subdetectors...
const TiXmlNode * IterateChildren(const TiXmlNode *previous) const
An alternate way to walk the children of a node.
virtual void addLayer(TrackerPlanesLayerImpl *_layer)
Adding a Layer to the TrackerPlanes detector (without parameters for layer rotation) ...
void SetAttribute(const char *name, const char *value)
Sets an attribute of name to a given value.
Geometry properties of a pixel beam telescope needed for reconstruction code.
virtual double getRadLength() const
The radiation length of nonsensitive volume of layer layerIndex - layer indexing starts at 0 for the ...
virtual double getPitchX() const
Pitch size in x direction in sensitive volume of layer layerIndex - layer indexing starts at 0 for th...
const TiXmlElement * FirstChildElement() const
Convenience function to get through elements.
virtual void setID(int value)
set methods
TrackerPlanesMaterialLayerImplVec & getMaterialLayerVec()
get methods
virtual double getThickness() const
Thickness of sensitive volume of layer layerIndex - layer indexing starts at 0 for the layer closest ...
virtual TiXmlElement toXML(const GearParameters ¶meters) const
Creates an XML node for the given parameters.