GEAR  1.9.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Friends Pages
SiPlanesParametersXML.cc
1 #include "gearxml/SiPlanesParametersXML.h"
2 
3 #include "gearxml/XMLHandlerMgr.h"
4 #include "gearxml/GearParametersXML.h"
5 
6 #include "gearxml/tinyxml.h"
7 #include "gearimpl/SiPlanesParametersImpl.h"
8 
9 #include "gear/GearMgr.h"
10 
11 #include <vector>
12 #include <string>
13 
14 
15 #include <cstring>
16 
24 namespace gear {
25 
27 
28 
29  // check whether parameter is valid SiPlanesParameter
30  const SiPlanesParameters* param = dynamic_cast<const SiPlanesParameters*> ( &parameters ) ;
31 
32  if( param == 0 ) {
33 
34  throw Exception( "SiPlanesParametersXML::toXML given parameters not of correct type. "
35  "needs to be gear::SiPlanesParameters." ) ;
36  }
37 
38  // Set up Beam TelescopeWithDUT or TelescopeWithoutDUT as Element
39  TiXmlElement det("detector") ;
40 
41  TiXmlElement setup_id( "siplanesID" ) ;
42  setup_id.SetAttribute("ID", param->getSiPlanesID()) ;
43  det.InsertEndChild( setup_id ) ;
44 
45  //type
46  TiXmlElement type( "siplanesType" ) ;
47  std::string strType ;
48  switch( param->getSiPlanesType() ) {
49  case ( SiPlanesParameters::TelescopeWithDUT ) :
50  strType = "TelescopeWithDUT" ;
51  break ;
52  case ( SiPlanesParameters::TelescopeWithoutDUT ) :
53  strType = "TelescopeWithoutDUT" ;
54  break ;
55  default :
56  strType = "Unknown" ;
57  }
58 
59  type.SetAttribute( "type", strType ) ;
60  det.InsertEndChild( type ) ;
61 
62 
63 
64  TiXmlElement nplanes( "siplanesNumber" ) ;
65  nplanes.SetAttribute("number", param->getSiPlanesNumber()) ;
66  det.InsertEndChild( nplanes ) ;
67 
68  // layerLayout
69  const SiPlanesLayerLayout& siplanesLayers = param->getSiPlanesLayerLayout() ;
70 
71  if (strType == "TelescopeWithDUT"){
72 
73  TiXmlElement dut("dut" ) ;
74 
75  TiXmlElement dutladder("dut_ladder") ;
76  dutladder.SetAttribute( "ID" , siplanesLayers.getDUTID() ) ;
77  dutladder.SetDoubleAttribute( "positionX" , siplanesLayers.getDUTPositionX() ) ;
78  dutladder.SetDoubleAttribute( "positionY" , siplanesLayers.getDUTPositionY() ) ;
79  dutladder.SetDoubleAttribute( "positionZ" , siplanesLayers.getDUTPositionZ() ) ;
80  dutladder.SetDoubleAttribute( "sizeX" , siplanesLayers.getDUTSizeX() ) ;
81  dutladder.SetDoubleAttribute( "sizeY" , siplanesLayers.getDUTSizeY() ) ;
82  dutladder.SetDoubleAttribute( "thickness" , siplanesLayers.getDUTThickness() ) ;
83  dutladder.SetDoubleAttribute( "radLength" , siplanesLayers.getDUTRadLength() ) ;
84 
85  TiXmlElement dutsens("dut_sensitive" ) ;
86  dutsens.SetAttribute( "ID" , siplanesLayers.getDUTSensitiveID() ) ;
87  dutsens.SetDoubleAttribute( "positionX" , siplanesLayers.getDUTSensitivePositionX() ) ;
88  dutsens.SetDoubleAttribute( "positionY" , siplanesLayers.getDUTSensitivePositionY() ) ;
89  dutsens.SetDoubleAttribute( "positionZ" , siplanesLayers.getDUTSensitivePositionZ() ) ;
90  dutsens.SetDoubleAttribute( "sizeX" , siplanesLayers.getDUTSensitiveSizeX() ) ;
91  dutsens.SetDoubleAttribute( "sizeY" , siplanesLayers.getDUTSensitiveSizeY() ) ;
92  dutsens.SetDoubleAttribute( "thickness" , siplanesLayers.getDUTSensitiveThickness() ) ;
93  dutsens.SetAttribute( "npixelX" , siplanesLayers.getDUTSensitiveNpixelX() ) ;
94  dutsens.SetAttribute( "npixelY" , siplanesLayers.getDUTSensitiveNpixelY() ) ;
95  dutsens.SetDoubleAttribute( "pitchX" , siplanesLayers.getDUTSensitivePitchX() ) ;
96  dutsens.SetDoubleAttribute( "pitchY" , siplanesLayers.getDUTSensitivePitchY() ) ;
97  dutsens.SetDoubleAttribute( "resolution" , siplanesLayers.getDUTSensitiveResolution() ) ;
98  dutsens.SetDoubleAttribute( "rotation1" , siplanesLayers.getDUTSensitiveRotation1() ) ;
99  dutsens.SetDoubleAttribute( "rotation2" , siplanesLayers.getDUTSensitiveRotation2() ) ;
100  dutsens.SetDoubleAttribute( "rotation3" , siplanesLayers.getDUTSensitiveRotation3() ) ;
101  dutsens.SetDoubleAttribute( "rotation4" , siplanesLayers.getDUTSensitiveRotation4() ) ;
102  dutsens.SetDoubleAttribute( "radLength" , siplanesLayers.getDUTSensitiveRadLength() ) ;
103 
104  // assemble dut
105  dut.InsertEndChild(dutladder) ;
106  dut.InsertEndChild(dutsens) ;
107  det.InsertEndChild(dut) ;
108 
109  }
110 
111  TiXmlElement layers("layers") ;
112 
113  for( int i=0 ; i < siplanesLayers.getNLayers() ; i++ ) {
114 
115 
116  TiXmlElement layer("layer" ) ;
117 
118  TiXmlElement ladder("ladder") ;
119  ladder.SetAttribute( "ID" , siplanesLayers.getID( i ) ) ;
120  ladder.SetDoubleAttribute( "positionX" , siplanesLayers.getLayerPositionX( i ) ) ;
121  ladder.SetDoubleAttribute( "positionY" , siplanesLayers.getLayerPositionY( i ) ) ;
122  ladder.SetDoubleAttribute( "positionZ" , siplanesLayers.getLayerPositionZ( i ) ) ;
123  ladder.SetDoubleAttribute( "rotationXY" , siplanesLayers.getLayerRotationXY( i ) ) ;
124  ladder.SetDoubleAttribute( "rotationZX" , siplanesLayers.getLayerRotationZX( i ) ) ;
125  ladder.SetDoubleAttribute( "rotationZY" , siplanesLayers.getLayerRotationZY( i ) ) ;
126  ladder.SetDoubleAttribute( "sizeX" , siplanesLayers.getLayerSizeX( i ) ) ;
127  ladder.SetDoubleAttribute( "sizeY" , siplanesLayers.getLayerSizeY( i ) ) ;
128  ladder.SetDoubleAttribute( "thickness" , siplanesLayers.getLayerThickness( i ) ) ;
129  ladder.SetDoubleAttribute( "radLength" , siplanesLayers.getLayerRadLength( i ) ) ;
130 
131  TiXmlElement sens("sensitive" ) ;
132  sens.SetAttribute( "ID" , siplanesLayers.getSensitiveID( i ) ) ;
133  sens.SetDoubleAttribute( "positionX" , siplanesLayers.getSensitivePositionX( i ) ) ;
134  sens.SetDoubleAttribute( "positionY" , siplanesLayers.getSensitivePositionY( i ) ) ;
135  sens.SetDoubleAttribute( "positionZ" , siplanesLayers.getSensitivePositionZ( i ) ) ;
136  sens.SetDoubleAttribute( "sizeX" , siplanesLayers.getSensitiveSizeX( i ) ) ;
137  sens.SetDoubleAttribute( "sizeY" , siplanesLayers.getSensitiveSizeY( i ) ) ;
138  sens.SetDoubleAttribute( "thickness" , siplanesLayers.getSensitiveThickness( i ) ) ;
139  sens.SetAttribute( "npixelX" , siplanesLayers.getSensitiveNpixelX( i ) ) ;
140  sens.SetAttribute( "npixelY" , siplanesLayers.getSensitiveNpixelY( i ) ) ;
141  sens.SetDoubleAttribute( "pitchX" , siplanesLayers.getSensitivePitchX( i ) ) ;
142  sens.SetDoubleAttribute( "pitchY" , siplanesLayers.getSensitivePitchY( i ) ) ;
143  sens.SetDoubleAttribute( "resolution" , siplanesLayers.getSensitiveResolution( i ) ) ;
144  sens.SetDoubleAttribute( "rotation1" , siplanesLayers.getSensitiveRotation1( i ) ) ;
145  sens.SetDoubleAttribute( "rotation2" , siplanesLayers.getSensitiveRotation2( i ) ) ;
146  sens.SetDoubleAttribute( "rotation3" , siplanesLayers.getSensitiveRotation3( i ) ) ;
147  sens.SetDoubleAttribute( "rotation4" , siplanesLayers.getSensitiveRotation4( i ) ) ;
148  sens.SetDoubleAttribute( "radLength" , siplanesLayers.getSensitiveRadLength( i ) ) ;
149 
150  // assemble layer
151  layer.InsertEndChild(ladder) ;
152  layer.InsertEndChild(sens) ;
153  layers.InsertEndChild(layer);
154 
155  }
156 
157  det.InsertEndChild(layers) ;
158 
159  // Assemble Detector
160  GearParametersXML::getXMLForParameters( &det , &parameters ) ;
161 
162  return det ;
163 
164  }
165 
166  GearParameters* SiPlanesParametersXML::fromXML( const TiXmlElement* xmlElement, GearMgr* gearMgr) const {
167 
168  // setup ID
169 
170  const TiXmlElement* siplanesID = xmlElement->FirstChildElement( "siplanesID" ) ;
171  int setupID = atoi( getXMLAttribute( siplanesID , "ID" ).c_str() ) ;
172 
173 
174  // type
175 
176  const TiXmlElement* siplanesType = xmlElement->FirstChildElement( "siplanesType" ) ;
177  int intType = 0 ;
178  std::string strType = getXMLAttribute( siplanesType , "type" ) ;
179 
180 
181  if( strType == "TelescopeWithDUT" ) {
182 
183  intType = SiPlanesParameters::TelescopeWithDUT ;
184 
185  } else if( strType == "TelescopeWithoutDUT" ) {
186 
187  intType = SiPlanesParameters::TelescopeWithoutDUT ;
188 
189  } else {
190  throw Exception( "SiPlanesParametersXML::fromXML type of SiPlanes not known."
191  "Needs to be 'TelescopeWithDUT' or 'TelescopeWithoutDUT'." ) ;
192  }
193 
194  // number of telescope planes
195 
196  const TiXmlElement* siplanesNumber = xmlElement->FirstChildElement( "siplanesNumber" ) ;
197  int nplanes = atoi( getXMLAttribute( siplanesNumber , "number" ).c_str() ) ;
198 
199 
200  // create SiPlanesParameters
201  SiPlanesParametersImpl* siplanesParam = new SiPlanesParametersImpl( setupID, intType , nplanes) ;
202 
203  if (intType == SiPlanesParameters::TelescopeWithDUT) {
204  const TiXmlNode* xmlDUT = xmlElement->FirstChildElement( "dut" ) ;
205  const TiXmlNode* xmlDUTLad = xmlDUT->FirstChildElement( "dut_ladder" ) ;
206  const TiXmlNode* xmlDUTSen = xmlDUT->FirstChildElement( "dut_sensitive" ) ;
207 
208  int ldutID = atoi(getXMLAttribute( xmlDUTLad , "ID" ).c_str() );
209  double ldutPosX = atof(getXMLAttribute( xmlDUTLad , "positionX" ).c_str() ) ;
210  double ldutPosY = atof(getXMLAttribute( xmlDUTLad , "positionY" ).c_str() ) ;
211  double ldutPosZ = atof(getXMLAttribute( xmlDUTLad , "positionZ" ).c_str() ) ;
212  double ldutSizX = atof(getXMLAttribute( xmlDUTLad , "sizeX" ).c_str() ) ;
213  double ldutSizY = atof(getXMLAttribute( xmlDUTLad , "sizeY" ).c_str() ) ;
214  double ldutThick = atof(getXMLAttribute( xmlDUTLad , "thickness" ).c_str() ) ;
215  double ldutRadLen = atof(getXMLAttribute( xmlDUTLad , "radLength" ).c_str() ) ;
216 
217  int sdutID = atoi(getXMLAttribute( xmlDUTSen , "ID" ).c_str() );
218  double sdutPosX = atof(getXMLAttribute( xmlDUTSen , "positionX" ).c_str() ) ;
219  double sdutPosY = atof(getXMLAttribute( xmlDUTSen , "positionY" ).c_str() ) ;
220  double sdutPosZ = atof(getXMLAttribute( xmlDUTSen , "positionZ" ).c_str() ) ;
221  double sdutSizX = atof(getXMLAttribute( xmlDUTSen , "sizeX" ).c_str() ) ;
222  double sdutSizY = atof(getXMLAttribute( xmlDUTSen , "sizeY" ).c_str() ) ;
223  double sdutThick = atof(getXMLAttribute( xmlDUTSen , "thickness" ).c_str() ) ;
224  int sdutNPixX = atoi(getXMLAttribute( xmlDUTSen , "npixelX" ).c_str() ) ;
225  int sdutNPixY = atoi(getXMLAttribute( xmlDUTSen , "npixelY" ).c_str() ) ;
226  double sdutPitX = atof(getXMLAttribute( xmlDUTSen , "pitchX" ).c_str() ) ;
227  double sdutPitY = atof(getXMLAttribute( xmlDUTSen , "pitchY" ).c_str() ) ;
228  double sdutResol = atof(getXMLAttribute( xmlDUTSen , "resolution" ).c_str() ) ;
229  double sdutRotat1 = atof(getOptionalXMLAttribute( xmlDUTSen , "rotation1", "1.0" ).c_str() ) ;
230  double sdutRotat2 = atof(getOptionalXMLAttribute( xmlDUTSen , "rotation2", "0.0" ).c_str() ) ;
231  double sdutRotat3 = atof(getOptionalXMLAttribute( xmlDUTSen , "rotation3", "0.0" ).c_str() ) ;
232  double sdutRotat4 = atof(getOptionalXMLAttribute( xmlDUTSen , "rotation4", "1.0" ).c_str() ) ;
233  double sdutRadLen = atof(getXMLAttribute( xmlDUTSen , "radLength" ).c_str() ) ;
234 
235  siplanesParam->addDUT(ldutID, ldutPosX, ldutPosY, ldutPosZ, ldutSizX, ldutSizY, ldutThick, ldutRadLen, sdutID, sdutPosX, sdutPosY, sdutPosZ, sdutSizX, sdutSizY, sdutThick, sdutNPixX, sdutNPixY, sdutPitX, sdutPitY, sdutResol, sdutRotat1, sdutRotat2,sdutRotat3,sdutRotat4, sdutRadLen) ;
236  }
237 
238  // layers
239  const TiXmlNode* xmlLayers = xmlElement->FirstChildElement( "layers" ) ;
240 
241  const TiXmlNode* xmlLayer = 0 ;
242  while( ( xmlLayer = xmlLayers->IterateChildren( "layer" , xmlLayer ) ) != 0 ) {
243 
244  const TiXmlNode* xmlLad = xmlLayer->FirstChildElement( "ladder" ) ;
245  const TiXmlNode* xmlSen = xmlLayer->FirstChildElement( "sensitive" ) ;
246 
247  int lID = atoi( getXMLAttribute( xmlLad , "ID" ).c_str() ) ;
248  double lPosX = atof( getXMLAttribute( xmlLad , "positionX" ).c_str() ) ;
249  double lPosY = atof( getXMLAttribute( xmlLad , "positionY" ).c_str() ) ;
250  double lPosZ = atof( getXMLAttribute( xmlLad , "positionZ" ).c_str() ) ;
251  double lRotXY = atof( getOptionalXMLAttribute( xmlLad , "rotationXY", "0." ).c_str() ) ;
252  double lRotZX = atof( getOptionalXMLAttribute( xmlLad , "rotationZX", "0." ).c_str() ) ;
253  double lRotZY = atof( getOptionalXMLAttribute( xmlLad , "rotationZY", "0." ).c_str() ) ;
254  double lSizX = atof( getXMLAttribute( xmlLad , "sizeX" ).c_str() ) ;
255  double lSizY = atof( getXMLAttribute( xmlLad , "sizeY" ).c_str() ) ;
256  double lThick = atof( getXMLAttribute( xmlLad , "thickness" ).c_str() ) ;
257  double lRadLen = atof( getXMLAttribute( xmlLad , "radLength" ).c_str() ) ;
258 
259  int sID = atoi( getXMLAttribute( xmlSen , "ID" ).c_str() ) ;
260  double sPosX = atof( getXMLAttribute( xmlSen , "positionX" ).c_str() ) ;
261  double sPosY = atof( getXMLAttribute( xmlSen , "positionY" ).c_str() ) ;
262  double sPosZ = atof( getXMLAttribute( xmlSen , "positionZ" ).c_str() ) ;
263  double sRotXY = atof( getOptionalXMLAttribute( xmlSen , "rotationXY", "0." ).c_str() ) ;
264  double sRotZX = atof( getOptionalXMLAttribute( xmlSen , "rotationZX", "0." ).c_str() ) ;
265  double sRotZY = atof( getOptionalXMLAttribute( xmlSen , "rotationZY", "0." ).c_str() ) ;
266  double sSizX = atof( getXMLAttribute( xmlSen , "sizeX" ).c_str() ) ;
267  double sSizY = atof( getXMLAttribute( xmlSen , "sizeY" ).c_str() ) ;
268  double sThick = atof( getXMLAttribute( xmlSen , "thickness" ).c_str() ) ;
269  int sNPixX = atoi(getXMLAttribute( xmlSen , "npixelX" ).c_str() ) ;
270  int sNPixY = atoi(getXMLAttribute( xmlSen , "npixelY" ).c_str() ) ;
271  double sPitX = atof(getXMLAttribute( xmlSen , "pitchX" ).c_str() ) ;
272  double sPitY = atof(getXMLAttribute( xmlSen , "pitchY" ).c_str() ) ;
273  double sResol = atof(getXMLAttribute( xmlSen , "resolution" ).c_str() ) ;
274  double sResolX = atof(getOptionalXMLAttribute( xmlSen , "resolutionX", "-1.0" ).c_str() ) ;
275  double sResolY = atof(getOptionalXMLAttribute( xmlSen , "resolutionY"," -1.0" ).c_str() ) ;
276  if( sResolX < 0 ) sResolX = sResol;
277  if( sResolY < 0 ) sResolY = sResol;
278  double sRotat1 = atof(getOptionalXMLAttribute( xmlSen , "rotation1", "1.0" ).c_str() ) ;
279  double sRotat2 = atof(getOptionalXMLAttribute( xmlSen , "rotation2", "0.0" ).c_str() ) ;
280  double sRotat3 = atof(getOptionalXMLAttribute( xmlSen , "rotation3", "0.0" ).c_str() ) ;
281  double sRotat4 = atof(getOptionalXMLAttribute( xmlSen , "rotation4", "1.0" ).c_str() ) ;
282  double sRadLen = atof( getXMLAttribute( xmlSen , "radLength" ).c_str() ) ;
283 
284  siplanesParam->addLayer(lID, lPosX, lPosY, lPosZ, lRotXY, lRotZX, lRotZY, lSizX, lSizY, lThick, lRadLen,
285  sID, sPosX, sPosY, sPosZ, sRotXY, sRotZX, sRotZY, sSizX, sSizY, sThick, sNPixX, sNPixY, sPitX, sPitY, sResol, sResolX, sResolY, sRotat1, sRotat2, sRotat3, sRotat4, sRadLen) ;
286 
287  } // end loop
288 
289 
290 
291  // now read the generic parameters
292  GearParametersXML::setParametersFromXML( xmlElement, siplanesParam ) ;
293 
294  // ------- add to GearMgr ----
295  if( gearMgr != 0 ) {
296 
297  gearMgr->setSiPlanesParameters( siplanesParam ) ;
298 
299  }
300 
301  return siplanesParam ;
302 
303  } // fromXML
304 
305 } // namespace
306 
307 
virtual double getSensitiveRadLength(int layerIndex) const =0
The radiation length of sensitive volume of layer layerIndex - layer indexing starts at 0 for the lay...
virtual int getSiPlanesType() const =0
The type of SiPlanes detector: SiPlanesParameters.TelescopeWithDUT, SiPlanesParameters.TelescopeWithoutDUT.
virtual double getDUTSensitiveRotation3() const =0
Third element (sin(theta)) of rotation matrix of sensitive volume of the DUT.
virtual double getSensitiveRotation1(int layerIndex) const =0
First element (cos(theta)) of rotation matrix of sensitive volume of layer layerIndex - layer indexin...
virtual int getSensitiveNpixelX(int layerIndex) const =0
Number of pixels in x direction in sensitive volume of layer layerIndex - layer indexing starts at 0 ...
virtual double getLayerRotationZX(int layerIndex) const =0
rotation angles according to Euler implmentation scheme (in ZX plane -&gt; around axis Y: beta ) ...
virtual int getNLayers() const =0
The total number of layers.
virtual double getLayerRotationXY(int layerIndex) const =0
rotation angles according to Euler implementation scheme (in XY plane -&gt; around axis Z: gamma ) ...
virtual double getDUTThickness() const =0
Thickness of nonsensitive layer of the DUT.
virtual double getDUTSensitivePitchY() const =0
Pitch size in y direction of sensitive volume of the DUT.
virtual GearParameters * fromXML(const TiXmlElement *xmlElement, GearMgr *gearMgr=0) const
Creates the appropriate GearParameters subclass from the given XML element (node) ...
virtual double getSensitiveSizeX(int layerIndex) const =0
Size in x direction of sensitive volume of layer layerIndex - layer indexing starts at 0 for the laye...
virtual double getDUTSensitiveRotation4() const =0
Fourth element (cos(theta)) of rotation matrix of sensitive volume of the DUT.
virtual int getSensitiveNpixelY(int layerIndex) const =0
Number of pixels in y direction in sensitive volume of layer layerIndex - layer indexing starts at 0 ...
std::string getOptionalXMLAttribute(const TiXmlNode *node, const std::string &name, const std::string &defaultValue)
Helper method used for parsing XML.
virtual double getSensitiveRotation2(int layerIndex) const =0
Second element (-sin(theta)) of rotation matrix of sensitive volume of layer layerIndex - layer index...
virtual double getDUTSensitiveThickness() const =0
Thickness of sensitive volume of the DUT.
virtual int getSiPlanesNumber() const =0
Number of telescope planes of SiPlanes detector.
Base exception class for GEAR - all other exceptions extend this.
Definition: GEAR.h:41
virtual int getDUTID() const =0
ID of nonsensitive volume of the DUT.
virtual double getLayerSizeX(int layerIndex) const =0
Size in x direction of nonsensitive volume of layer layerIndex - layer indexing starts at 0 for the l...
virtual const SiPlanesLayerLayout & getSiPlanesLayerLayout() const =0
The layer layout of pixel beam telescope.
virtual double getSensitivePositionY(int layerIndex) const =0
y position of the center of sensitive volume of layer layerIndex - layer indexing starts at 0 for the...
virtual double getDUTSensitiveRotation1() const =0
First element (cos(theta)) of rotation matrix of sensitive volume of the DUT.
virtual double getDUTSensitivePositionX() const =0
x position of the center of sensitive volume of the DUT.
virtual void setSiPlanesParameters(SiPlanesParameters *siplanesParameters)=0
Set the SiPlanesParameters.
virtual double getDUTPositionZ() const =0
z position of the center of nonsensitive volume of the DUT.
static void setParametersFromXML(const TiXmlElement *xmlElement, GearParametersImpl *gearParams)
Static helper function that can be used by other subclass handlers to read parameters.
virtual double getLayerRotationZY(int layerIndex) const =0
rotation angles according to Euler implmentation scheme (in ZY plane -&gt; around axis X: alfa ) ...
virtual double getLayerThickness(int layerIndex) const =0
Thickness of nonsensitive volume of layer layerIndex - layer indexing starts at 0 for the layer close...
virtual int getSensitiveID(int layerIndex) const =0
ID of sensitive volume of layer layerIndex - layer indexing starts at 0 for the layer closest to the ...
Abstract interface for a set of parameters that can be used to describe the geometrical properties of...
virtual double getLayerPositionX(int layerIndex) const =0
x position of the center of nonsensitive volume of layer layerIndex - layer indexing starts at 0 for ...
virtual int getSiPlanesID() const =0
ID of telescope setup.
virtual double getSensitiveSizeY(int layerIndex) const =0
Size in y direction of sensitive volume of layer layerIndex - layer indexing starts at 0 for the laye...
virtual double getLayerPositionY(int layerIndex) const =0
y position of the center of nonsensitive volume of layer layerIndex - layer indexing starts at 0 for ...
virtual void addDUT(int dutID, double dutPositionX, double dutPositionY, double dutPositionZ, double dutSizeX, double dutSizeY, double dutThickness, double dutRadLength, int dutsensitiveID, double dutsensitivePositionX, double dutsensitivePositionY, double dutsensitivePositionZ, double dutsensitiveSizeX, double dutsensitiveSizeY, double dutsensitiveThickness, int dutsensitiveNpixelX, int dutsensitiveNpixelY, double dutsensitivePitchX, double dutsensitivePitchY, double dutsensitiveResolution, double dutsensitiveRotation1, double dutsensitiveRotation2, double dutsensitiveRotation3, double dutsensitiveRotation4, double dutsensitiveRadLength)
Adding DUT to the SiPlanes 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...
Abstract description of layers in a pixel beam telescope.
virtual double getSensitivePitchX(int layerIndex) const =0
Pitch size in x direction in sensitive volume of layer layerIndex - layer indexing starts at 0 for th...
The parent class for everything in the Document Object Model.
Definition: tinyxml.h:370
virtual double getLayerPositionZ(int layerIndex) const =0
z position of the center of nonsensitive volume of layer layerIndex - layer indexing starts at 0 for ...
virtual double getDUTSensitiveRadLength() const =0
The radiation length of sensitive volume of the DUT.
virtual int getDUTSensitiveNpixelY() const =0
Number of pixels in y direction of sensitive volume of the DUT.
virtual double getSensitivePositionX(int layerIndex) const =0
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 getSensitivePitchY(int layerIndex) const =0
Pitch size in y direction in sensitive volume of layer layerIndex - layer indexing starts at 0 for th...
virtual double getDUTPositionY() const =0
y position of the center of nonsensitive volume of the DUT.
virtual TiXmlElement toXML(const GearParameters &parameters) const
Creates an XML node for the given parameters.
virtual int getDUTSensitiveNpixelX() const =0
Number of pixels in x direction of sensitive volume of the DUT.
virtual double getDUTSensitiveSizeX() const =0
Size in x direction of sensitive volume of the DUT.
virtual double getDUTPositionX() const =0
x position of the center of nonsensitive volume of the DUT.
virtual double getLayerRadLength(int layerIndex) const =0
The radiation length of nonsensitive volume of layer layerIndex - layer indexing starts at 0 for the ...
virtual double getDUTSensitivePitchX() const =0
Pitch size in x direction of sensitive volume of the DUT.
The element is a container class.
Definition: tinyxml.h:827
virtual double getSensitiveRotation4(int layerIndex) const =0
Fourth element (cos(theta)) of rotation matrix of sensitive volume of layer layerIndex - layer indexi...
TiXmlNode * InsertEndChild(const TiXmlNode &addThis)
Add a new node related to this.
Definition: tinyxml.cc:218
virtual double getSensitiveResolution(int layerIndex) const =0
Intrinsic resolution of layer layerIndex - layer indexing starts at 0 for the layer closest to the be...
virtual double getSensitiveThickness(int layerIndex) const =0
Thickness of sensitive volume of layer layerIndex - layer indexing starts at 0 for the layer closest ...
void SetDoubleAttribute(const char *name, double value)
Sets an attribute of name to a given value.
Definition: tinyxml.cc:738
virtual double getDUTSensitiveRotation2() const =0
Second element (-sin(theta)) of rotation matrix of sensitive volume of the DUT.
virtual double getDUTSensitivePositionY() const =0
y position of the center of sensitive volume of the DUT.
virtual int getID(int layerIndex) const =0
Layer ID of nonsensitive volume of layer layerIndex - layer indexing starts at 0 for the layer closes...
Abstract interface for a manager class that returns the Gear classes for the relevant subdetectors...
Definition: GearMgr.h:36
const TiXmlNode * IterateChildren(const TiXmlNode *previous) const
An alternate way to walk the children of a node.
Definition: tinyxml.cc:376
virtual double getSensitivePositionZ(int layerIndex) const =0
z position of the center of sensitive volume of layer layerIndex - layer indexing starts at 0 for the...
void SetAttribute(const char *name, const char *value)
Sets an attribute of name to a given value.
Definition: tinyxml.cc:746
Geometry properties of a pixel beam telescope needed for reconstruction code.
virtual double getSensitiveRotation3(int layerIndex) const =0
Third element (sin(theta)) of rotation matrix of sensitive volume of layer layerIndex - layer indexin...
virtual double getDUTSensitivePositionZ() const =0
z position of the center of sensitive volume of the DUT.
virtual double getDUTSensitiveResolution() const =0
Intrinsic resolution of the DUT, not relevant.
virtual double getLayerSizeY(int layerIndex) const =0
Size in y direction of nonsensitive volume of layer layerIndex - layer indexing starts at 0 for the l...
virtual int getDUTSensitiveID() const =0
ID of sensitive volume of the DUT.
virtual double getDUTRadLength() const =0
The radiation length of nonsensitive volume of the DUT.
Abstract description of layers in pixel beam telescope with or without DUT.
const TiXmlElement * FirstChildElement() const
Convenience function to get through elements.
Definition: tinyxml.cc:482
virtual double getDUTSizeX() const =0
Size in x direction of nonsensitive volume of the DUT.
virtual double getDUTSensitiveSizeY() const =0
Size in y direction of sensitive volume of the DUT.
virtual double getDUTSizeY() const =0
Size in y direction of nonsensitive volume of the DUT.
virtual void addLayer(int layerID, double layerPositionX, double layerPositionY, double layerPositionZ, double layerRotationXY, double layerRotationZX, double layerRotationZY, double layerSizeX, double layerSizeY, double layerThickness, double layerRadLength, int sensitiveID, double sensitivePositionX, double sensitivePositionY, double sensitivePositionZ, double sensitiveRotationXY, double sensitiveRotationZX, double sensitiveRotationZY, double sensitiveSizeX, double sensitiveSizeY, double sensitiveThickness, int sensitiveNpixelX, int sensitiveNpixelY, double sensitivePitchX, double sensitivePitchY, double sensitiveResolution, double sensitiveResolutionX, double sensitiveResolutionY, double sensitiveRotation1, double sensitiveRotation2, double sensitiveRotation3, double sensitiveRotation4, double sensitiveRadLength)
Adding a Layer to the SiPlanes detector.