1 #include "gearxml/ZPlanarParametersXML.h"
3 #include "gearxml/XMLHandlerMgr.h"
4 #include "gearxml/GearParametersXML.h"
6 #include "gearxml/tinyxml.h"
7 #include "gearimpl/ZPlanarParametersImpl.h"
9 #include "gear/GearMgr.h"
26 throw Exception(
"ZPlanarParametersXML::toXML given parameters not of correct type. "
27 "needs to be gear::ZPlanarParameters." ) ;
38 case ( ZPlanarParameters::CCD ) :
42 case ( ZPlanarParameters::CMOS ) :
46 case ( ZPlanarParameters::HYBRID ) :
81 for(
int i=0 ; i < layout.
getNLayers() ; i++ ) {
143 if( type ==
"CCD" ) {
144 intType = ZPlanarParameters::CCD ;
146 else if( type ==
"CMOS" ) {
147 intType = ZPlanarParameters::CMOS ;
149 else if( type ==
"HYBRID" ) {
150 intType = ZPlanarParameters::HYBRID ;
153 throw Exception(
"ZPlanarParametersXML::fromXML technology of vxdType not known: " + type +
154 " - Needs to be 'CCD', 'CMOS' or 'HYBRID'." ) ;
159 double shellHalfLength = atof(
getXMLAttribute( shell ,
"halfLength" ) .c_str() ) ;
161 double shellInnerR = atof(
getXMLAttribute( shell ,
"innerRadius" ) .c_str() ) ;
162 double shellOuterR = atof(
getXMLAttribute( shell ,
"outerRadius" ) .c_str() ) ;
163 double shellRadLen = atof(
getXMLAttribute( shell ,
"radLength" ) .c_str() ) ;
172 while( ( xmlLayer = xmlLayers->
IterateChildren(
"layer" , xmlLayer ) ) != 0 ) {
174 int nLadders = atoi(
getXMLAttribute( xmlLayer ,
"nLadders" ).c_str() ) ;
180 double lDist = atof(
getXMLAttribute( xmlLad ,
"distance" ).c_str() ) ;
181 double lThick = atof(
getXMLAttribute( xmlLad ,
"thickness" ).c_str() ) ;
183 double lLength = atof(
getXMLAttribute( xmlLad ,
"length" ).c_str() ) ;
184 double lOffset = atof(
getXMLAttribute( xmlLad ,
"offset" ).c_str() ) ;
185 double lRadLen = atof(
getXMLAttribute( xmlLad ,
"radLength" ).c_str() ) ;
187 double sDist = atof(
getXMLAttribute( xmlSen ,
"distance" ).c_str() ) ;
188 double sThick = atof(
getXMLAttribute( xmlSen ,
"thickness" ).c_str() ) ;
190 double sLength = atof(
getXMLAttribute( xmlSen ,
"length" ).c_str() ) ;
191 double sOffset = atof(
getXMLAttribute( xmlSen ,
"offset" ).c_str() ) ;
192 double sRadLen = atof(
getXMLAttribute( xmlSen ,
"radLength" ).c_str() ) ;
195 lDist, lOffset, lThick, lLength, lWidth, lRadLen,
196 sDist, sOffset, sThick, sLength, sWidth, sRadLen ) ;
211 std::transform( detName.begin() , detName.end() ,
212 detName.begin(), tolower ) ;
215 if( detName.find(
"vxd") != std::string::npos ){
219 else if( detName.find(
"sit") != std::string::npos ){
223 else if( detName.find(
"set") != std::string::npos ){
virtual double getShellOuterRadius() const =0
The outer radius of the support shell in mm.
Geometry properties of a vertex detector needed for reconstruction code.
virtual double getShellInnerRadius() const =0
The inner radius of the support shell in mm.
virtual double getPhi0(int layerIndex) const =0
Azimuthal angle of the (outward pointing) normal of the first ladder.
virtual double getLadderOffset(int layerIndex) const =0
The offset of the ladder in mm defines the shift of the ladder in the direction of increasing phi per...
Base exception class for GEAR - all other exceptions extend this.
virtual double getSensitiveOffset(int layerIndex) const =0
Same as getLadderOffset() except for the sensitive part of the ladder.
virtual void setVXDParameters(ZPlanarParameters *vxdParameters)=0
Set the VXDParameters.
virtual void setSETParameters(ZPlanarParameters *setParameters)=0
Set the SETParameters.
virtual double getShellGap() const =0
The length of the gap in mm (gap position at z=0)
virtual double getLadderDistance(int layerIndex) const =0
The distance of ladders in layer layerIndex from the IP - layer indexing starts at 0 for the layer cl...
virtual double getLadderThickness(int layerIndex) const =0
The thickness in mm of the ladders in layerIndex - layer indexing starting at 0 for the layer closest...
virtual double getSensitiveRadLength(int layerIndex) const =0
The radiation length in sensitive volumes in layer layerIndex - layer indexing starts at 0 for the la...
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...
virtual double getSensitiveWidth(int layerIndex) const =0
The width of the sensitive area in ladders in layer layerIndex in mm.
virtual int getType() const =0
The type of detector - to be defined by users...
virtual double getLadderRadLength(int layerIndex) const =0
The radiation length in the support structure ladders of layer layerIndex - layer indexing starts at ...
Abstract description of layers in a Vertex detector.
static void getXMLForParameters(TiXmlElement *xmlElement, const GearParameters *gearParams)
Static helper function that can be used by other subclass handlers to create XML for parameters...
The parent class for everything in the Document Object Model.
std::string getXMLAttribute(const TiXmlNode *node, const std::string &name)
Helper method used for parsing XML.
virtual void setSITParameters(ZPlanarParameters *sitParameters)=0
Set the SITParameters.
virtual int getNLayers() const =0
The total number of layers.
virtual double getSensitiveThickness(int layerIndex) const =0
The thickness in mm of the sensitive area in ladders in layer layerIndex.
virtual double getShellRadLength() const =0
The radiation length in the support shell.
virtual double getLadderWidth(int layerIndex) const =0
The width of the ladder in layer in mm for ladders in layer layerIndex - layer indexing starting at 0...
Geometry properties of a planar detector (parallel to z-axis) needed for reconstruction code...
The element is a container class.
virtual double getSensitiveLength(int layerIndex) const =0
The length of the sensitive area in ladders in z direction in mm for ladders in layer layerIndex...
TiXmlNode * InsertEndChild(const TiXmlNode &addThis)
Add a new node related to this.
virtual GearParameters * fromXML(const TiXmlElement *xmlElement, GearMgr *gearMgr=0) const
Creates the appropriate GearParameters subclass from the given XML element (node) ...
void SetDoubleAttribute(const char *name, double value)
Sets an attribute of name to a given value.
virtual TiXmlElement toXML(const GearParameters ¶meters) const
Creates an XML node for the given parameters.
virtual double getShellHalfLength() const =0
The half length (z) of the support shell in mm (w/o gap).
Abstract interface for a manager class that returns the Gear classes for the relevant subdetectors...
virtual double getSensitiveDistance(int layerIndex) const =0
The distance of sensitive area in ladders in layer layerIndex from the IP.
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 void addLayer(int nLadders, double phi0, double ladderDistance, double ladderOffset, double ladderThickness, double ladderLength, double ladderWidth, double ladderRadLength, double sensitiveDistance, double sensitiveOffset, double sensitiveThickness, double sensitiveLength, double sensitiveWidth, double sensitiveRadLength)
adding a Layer to the vertex one layer consiste of a number of ladders and sensitive areas (nLadders)...
virtual const ZPlanarLayerLayout & getZPlanarLayerLayout() const =0
The layer layout in the detector.
const TiXmlElement * FirstChildElement() const
Convenience function to get through elements.
virtual double getLadderLength(int layerIndex) const =0
The (half) length of the ladder in z direction in mm for ladders in layer layerIndex - layer indexing...
virtual int getNLadders(int layerIndex) const =0
The number of ladders in the layer layerIndex - layer indexing starts at 0 for the layer closest to I...