2 #include "gearxml/FTDParametersXML.h"
4 #include "gearxml/XMLHandlerMgr.h"
5 #include "gearxml/GearParametersXML.h"
7 #include "gearxml/tinyxml.h"
8 #include "gearimpl/FTDParametersImpl.h"
10 #include "gear/GearMgr.h"
26 throw Exception(
"FTDParametersXML::toXML given parameters not of correct type. "
27 "needs to be gear::FTDParameters." ) ;
38 for(
int i=0 ; i < ftdLayers.
getNLayers() ; i++ )
48 case ( FTDParameters::PIXEL ) :
51 case ( FTDParameters::STRIP ) :
109 while( ( xmlLayer = xmlLayers->
IterateChildren(
"layer" , xmlLayer ) ) != 0 )
112 int nSensors = atoi(
getXMLAttribute( xmlLayer ,
"nSensors" ).c_str() );
113 bool isDoubleSided = atoi(
getXMLAttribute( xmlLayer ,
"isDoubleSided" ).c_str() );
116 if( type ==
"PIXEL" )
118 sensorType = FTDParameters::PIXEL ;
120 else if( type ==
"STRIP" )
122 sensorType = FTDParameters::STRIP;
126 throw Exception(
"FTDParametersXML::fromXML technology of sensorType not known: " + type +
127 " - Needs to be 'PIXEL' or 'STRIP'." ) ;
129 double petalOpAngle = atof(
getXMLAttribute( xmlLayer ,
"petalOpenningAngle" ).c_str() );
132 double zposition = atof(
getXMLAttribute( xmlLayer ,
"zposition" ).c_str() );
133 double zoffset = atof(
getXMLAttribute( xmlLayer ,
"zoffset" ).c_str() );
134 double zsign0 = atof(
getXMLAttribute( xmlLayer ,
"zsign0" ).c_str() );
140 double lThick = atof(
getXMLAttribute( xmlLad ,
"thickness" ).c_str() );
142 double lLengthMin = atof(
getXMLAttribute( xmlLad ,
"lengthMin" ).c_str() ) ;
143 double lLengthMax = atof(
getXMLAttribute( xmlLad ,
"lengthMax" ).c_str() ) ;
144 double lRinner = atof(
getXMLAttribute( xmlLad ,
"rInner" ).c_str() ) ;
145 double lRadLen = atof(
getXMLAttribute( xmlLad ,
"radLength" ).c_str() ) ;
148 double sThick = atof(
getXMLAttribute( xmlSen ,
"thickness" ).c_str() ) ;
150 double sLengthMin = atof(
getXMLAttribute( xmlSen ,
"lengthMin" ).c_str() ) ;
151 double sLengthMax = atof(
getXMLAttribute( xmlSen ,
"lengthMax" ).c_str() ) ;
152 double sRinner = atof(
getXMLAttribute( xmlSen ,
"rInner" ).c_str() ) ;
153 double sRadLen = atof(
getXMLAttribute( xmlSen ,
"radLength" ).c_str() ) ;
155 ftdParam->
addLayer( nPetals, nSensors, isDoubleSided, sensorType, petalOpAngle, phi0 ,alpha, zposition, zoffset, zsign0,
157 lRinner, lThick, lLengthMin, lLengthMax, lWidth, lRadLen,
159 sRinner, sThick, sLengthMin, sLengthMax, sWidth, sRadLen ) ;
virtual double getSupportLengthMax(int layerIndex) const =0
The length (x-direction) of the largest edge of the trapezoid support in layer layerIndex - layer ind...
virtual double getZoffsetSign0(const int &layerIndex) const =0
Z-offset sign of the petal 0 in a staggered setup - the z position of the petals is zposition + zsign...
virtual double getSensitiveThickness(int layerIndex) const =0
The thickness in mm of the sensitive area in petals in layer layerIndex.
virtual double getSupportRinner(int layerIndex) const =0
The R-min of the support petals in the XY-plane in mm, for the layer layerIndex - layer indexing star...
Base exception class for GEAR - all other exceptions extend this.
virtual double getPhi0(const int &layerIndex) const =0
Azimuthal angle of the first petal (angle between petal centroid and x-axis for the petal indexed as ...
virtual double getSupportLengthMin(int layerIndex) const =0
The length (x-direction) of the smallest edge of the trapezoid support in layer layerIndex - layer in...
virtual double getZposition(const int &layerIndex) const =0
The z-position of the centroid of the disk structure.
virtual int getNSensors(int layerIndex) const =0
The number of sensors per petal on a specific layer - Sensor indexing is defined as follows: (illustr...
virtual double getSupportThickness(int layerIndex) const =0
The thickness in mm of the supports in layerIndex - layer indexing starting at 0 for the layer closes...
static void setParametersFromXML(const TiXmlElement *xmlElement, GearParametersImpl *gearParams)
Static helper function that can be used by other subclass handlers to read parameters.
virtual int getSensorType(int layerIndex) const =0
The sensor type of the disk: pixel or micro-strip The return value corresponds to the following value...
virtual double getPhiHalfDistance(int layerIndex) const =0
Angular half-width of the petals of a layer - half of the opening angle of the trapezoid.
virtual int getNPetals(int layerIndex) const =0
The number of petals in the layer layerIndex - layer indexing starts at 0 for the layer closest to IP...
Abstract interface for a set of parameters that can be used to describe the geometrical properties of...
Abstract description of layers in a FTD detector.
virtual void addLayer(int nPetals, int nSensors, bool isDoubleSided, int sensorType, double petalOpAngle, double phi0, double alpha, double zposition, double zoffset, double zsign0, double supportRinner, double supportThickness, double supportLengthMin, double supportLengthMax, double supportWidth, double supportRadLength, double sensitiveRinner, double sensitiveThickness, double sensitiveLengthMin, double sensitiveLengthMax, double sensitiveWidth, double sensitiveRadLength)
adding a Layer to the vertex one layer consists of a number of petals and sensitive areas (nPetals) t...
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 getZoffset(const int &layerIndex) const =0
Z-offset of the petals in a staggered setup - the z position of the even numbered petals is getZposit...
virtual void setFTDParameters(FTDParameters *ftdParameters)=0
Set the FTDParameters.
The parent class for everything in the Document Object Model.
virtual const FTDLayerLayout & getFTDLayerLayout() const =0
The layer layout in the Vertex.
virtual double getSensitiveLengthMax(int layerIndex) const =0
Same as getPetalLengthMax() except for the sensitive part of the petal.
virtual double getSensitiveLengthMin(int layerIndex) const =0
Same as getPetalLengthMin() except for the sensitive part of the petal.
std::string getXMLAttribute(const TiXmlNode *node, const std::string &name)
Helper method used for parsing XML.
virtual double getSensitiveRadLength(int layerIndex) const =0
The radiation length in sensitive volumes in layer layerIndex - layer indexing starts at 0 for the la...
virtual double getAlpha(int layerIndex) const =0
Angle of rotation in the own plane of a petal in a tilted configuration.
Geometry properties of a FTD detector needed for reconstruction code.
Geometry properties of a FTD detector needed for reconstruction code.
The element is a container class.
TiXmlNode * InsertEndChild(const TiXmlNode &addThis)
Add a new node related to this.
virtual double getSupportWidth(int layerIndex) const =0
The width of the support in layer in mm for petals in layer layerIndex - layer indexing starting at 0...
void SetDoubleAttribute(const char *name, double value)
Sets an attribute of name to a given value.
virtual int getNLayers() const =0
The total number of layers.
virtual TiXmlElement toXML(const GearParameters ¶meters) const
Creates an XML node for the given parameters.
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.
void SetAttribute(const char *name, const char *value)
Sets an attribute of name to a given value.
virtual double getSensitiveWidth(int layerIndex) const =0
The width of the sensitive area in petals in layer layerIndex in mm.
virtual double getSensitiveRinner(int layerIndex) const =0
The R-min of the petal in the XY-plane in mm for sensors in layer layerIndex - layer indexing starts ...
virtual bool isDoubleSided(int layerIndex) const =0
Whether the petals on a layer have sensors in front and back.
virtual GearParameters * fromXML(const TiXmlElement *xmlElement, GearMgr *gearMgr=0) const
Creates the appropriate GearParameters subclass from the given XML element (node) ...
const TiXmlElement * FirstChildElement() const
Convenience function to get through elements.
virtual double getSupportRadLength(int layerIndex) const =0
The radiation length in the support structure petals of layer layerIndex - layer indexing starts at 0...