GEAR  1.9.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Friends Pages
GearXML.cc
1 
2 #include "gearxml/GearXML.h"
3 #include "gearxml/tinyxml.h"
4 #include "gearxml/XMLHandlerMgr.h"
5 #include "gearxml/GearParametersXML.h"
6 #include "gearxml/TPCParametersXML.h"
7 #include "gearxml/CalorimeterParametersXML.h"
8 #include "gearxml/ZPlanarParametersXML.h"
9 #include "gearxml/FTDParametersXML.h"
10 #include "gearxml/ConstantBFieldXML.h"
11 #include "gearxml/TrackerPlanesParametersXML.h"
12 #include "gearxml/SiPlanesParametersXML.h"
13 #include "gearxml/SimpleMaterialXML.h"
14 #include "gearimpl/GearMgrImpl.h"
15 
16 #include "gear/GEAR.h"
17 #include "gear/CalorimeterParameters.h"
18 #include "gear/ZPlanarParameters.h"
19 #include "gear/FTDParameters.h"
20 #include "gear/TrackerPlanesParameters.h"
21 #include "gear/SiPlanesParameters.h"
22 
23 // #ifdef GEAR_TGEO
24 // #include "geartgeo/TGeoGeometryInitializer.h"
25 // #include "geartgeo/TGeoGearPointProperties.h"
26 // #include "geartgeo/TGeoGearDistanceProperties.h"
27 // #endif
28 #include "gear/GearMaterialProperties.h"
29 
30 //#include <algorithm>
31 #include <sstream>
32 #include <iostream>
33 #include <dlfcn.h>
34 
35 namespace gear{
36 
37 
38  GearXML::GearXML( const std::string& fileName ) :
39  _fileName( fileName ),
40  _gearMgr(0) {
41 
42  }
43 
44  GearXML::~GearXML(){
45 // cant delete this as GearXML is used as a factory by Marlin ....
46 // if( _gearMgr != 0 )
47 // delete _gearMgr ;
48  }
49 
50  void GearXML::createXMLFile( GearMgr* mgr, const std::string& fileName ) {
51 
52  if( mgr == 0 ){
53  throw Exception("GearXML::createXMLFile: GearMgr dosn't exist");
54  }
55 
56  TiXmlDocument doc( fileName ) ;
57 
58  TiXmlElement root("gear") ;
59 
60  TiXmlElement detectors("detectors") ;
61 
62  TiXmlElement materials("materials") ;
63 
64  TiXmlElement global("global") ;
65 
66 
67  std::string detName("Unknown") ;
68 
69  try{ detName = mgr->getDetectorName() ;
70  }
71  catch( UnknownParameterException ){}
72 
73  global.SetAttribute( "detectorName" , detName ) ;
74 
75  root.InsertEndChild( global ) ;
76 
77 
78  TiXmlComment rootComment ;
79  rootComment.SetValue( "Gear XML file automatically created with GearXML::createXMLFile ...." ) ;
80  root.InsertEndChild ( rootComment) ;
81 
82  // --- the BField ------------
83 
84  try{
85 
86  ConstantBFieldXML handler ; //FIXME : need full field map ...
87 
88  TiXmlElement field = handler.toXML( mgr->getBField() ) ;
89 
90  root.InsertEndChild( field ) ;
91 
92  }
93  catch( UnknownParameterException& e){
94  }
95 
96 
97 
98  // --------- add TPC parameters -------------------
99 
100  try{
101 
102  TPCParametersXML handler ;
103 
104  TiXmlElement detector = handler.toXML( mgr->getTPCParameters() ) ;
105 
106  detector.SetAttribute( "name" , "TPC" ) ;
107  detector.SetAttribute( "geartype" , GEAR::TPCPARAMETERS ) ;
108 
109  detectors.InsertEndChild( detector ) ;
110 
111  }
112  catch( UnknownParameterException& e){
113  }
114 
115 
116  // --------- add EcalBarrel parameters -------------------
117  try{
118 
119  CalorimeterParametersXML handler ;
120 
121  TiXmlElement detector = handler.toXML( mgr->getEcalBarrelParameters() ) ;
122 
123  detector.SetAttribute( "name" , "EcalBarrel" ) ;
124  detector.SetAttribute( "geartype" , GEAR::CALORIMETERPARAMETERS ) ;
125 
126  detectors.InsertEndChild( detector ) ;
127 
128  }
129  catch( UnknownParameterException& e){
130  }
131 
132  // --------- add EcalEndcap parameters -------------------
133  try{
134 
135  CalorimeterParametersXML handler ;
136 
137  TiXmlElement detector = handler.toXML( mgr->getEcalEndcapParameters() ) ;
138 
139  detector.SetAttribute( "name" , "EcalEndcap" ) ;
140  detector.SetAttribute( "geartype" , GEAR::CALORIMETERPARAMETERS ) ;
141 
142  detectors.InsertEndChild( detector ) ;
143 
144  }
145  catch( UnknownParameterException& e){
146  }
147 
148  // --------- add EcalPlug parameters -------------------
149  try{
150 
151  CalorimeterParametersXML handler ;
152 
153  TiXmlElement detector = handler.toXML( mgr->getEcalPlugParameters() ) ;
154 
155  detector.SetAttribute( "name" , "EcalPlug" ) ;
156  detector.SetAttribute( "geartype" , GEAR::CALORIMETERPARAMETERS ) ;
157 
158  detectors.InsertEndChild( detector ) ;
159 
160  }
161  catch( UnknownParameterException& e){
162  }
163 
164  // --------- add YokeBarrel parameters -------------------
165  try{
166 
167  CalorimeterParametersXML handler ;
168 
169  TiXmlElement detector = handler.toXML( mgr->getYokeBarrelParameters() ) ;
170 
171  detector.SetAttribute( "name" , "YokeBarrel" ) ;
172  detector.SetAttribute( "geartype" , GEAR::CALORIMETERPARAMETERS ) ;
173 
174  detectors.InsertEndChild( detector ) ;
175 
176  }
177  catch( UnknownParameterException& e){
178  }
179 
180  // --------- add YokeEndcap parameters -------------------
181  try{
182 
183  CalorimeterParametersXML handler ;
184 
185  TiXmlElement detector = handler.toXML( mgr->getYokeEndcapParameters() ) ;
186 
187  detector.SetAttribute( "name" , "YokeEndcap" ) ;
188  detector.SetAttribute( "geartype" , GEAR::CALORIMETERPARAMETERS ) ;
189 
190  detectors.InsertEndChild( detector ) ;
191 
192  }
193  catch( UnknownParameterException& e){
194  }
195 
196  // --------- add YokePlug parameters -------------------
197  try{
198 
199  CalorimeterParametersXML handler ;
200 
201  TiXmlElement detector = handler.toXML( mgr->getYokePlugParameters() ) ;
202 
203  detector.SetAttribute( "name" , "YokePlug" ) ;
204  detector.SetAttribute( "geartype" , GEAR::CALORIMETERPARAMETERS ) ;
205 
206  detectors.InsertEndChild( detector ) ;
207 
208  }
209  catch( UnknownParameterException& e){
210  }
211 
212  // --------- add HcalBarrel parameters -------------------
213  try{
214 
215  CalorimeterParametersXML handler ;
216 
217  TiXmlElement detector = handler.toXML( mgr->getHcalBarrelParameters() ) ;
218 
219  detector.SetAttribute( "name" , "HcalBarrel" ) ;
220  detector.SetAttribute( "geartype" , GEAR::CALORIMETERPARAMETERS ) ;
221 
222  detectors.InsertEndChild( detector ) ;
223 
224  }
225  catch( UnknownParameterException& e){
226  }
227 
228  // --------- add HcalEndcap parameters -------------------
229  try{
230 
231  CalorimeterParametersXML handler ;
232 
233  TiXmlElement detector = handler.toXML( mgr->getHcalEndcapParameters() ) ;
234 
235  detector.SetAttribute( "name" , "HcalEndcap" ) ;
236  detector.SetAttribute( "geartype" , GEAR::CALORIMETERPARAMETERS ) ;
237 
238  detectors.InsertEndChild( detector ) ;
239 
240  }
241  catch( UnknownParameterException& e){
242  }
243 
244  // --------- add HcalRing parameters -------------------
245  try{
246 
247  CalorimeterParametersXML handler ;
248 
249  TiXmlElement detector = handler.toXML( mgr->getHcalRingParameters() ) ;
250 
251  detector.SetAttribute( "name" , "HcalRing" ) ;
252  detector.SetAttribute( "geartype" , GEAR::CALORIMETERPARAMETERS ) ;
253 
254  detectors.InsertEndChild( detector ) ;
255 
256  }
257  catch( UnknownParameterException& e){
258  }
259 
260  // --------- add Lcal parameters -------------------
261  try{
262 
263  CalorimeterParametersXML handler ;
264 
265  TiXmlElement detector = handler.toXML( mgr->getLcalParameters() ) ;
266 
267  detector.SetAttribute( "name" , "Lcal" ) ;
268  detector.SetAttribute( "geartype" , GEAR::CALORIMETERPARAMETERS ) ;
269 
270  detectors.InsertEndChild( detector ) ;
271 
272  }
273  catch( UnknownParameterException& e){
274  }
275 
276  // --------- add LHcal parameters -------------------
277  try{
278 
279  CalorimeterParametersXML handler ;
280 
281  TiXmlElement detector = handler.toXML( mgr->getLHcalParameters() ) ;
282 
283  detector.SetAttribute( "name" , "LHcal" ) ;
284  detector.SetAttribute( "geartype" , GEAR::CALORIMETERPARAMETERS ) ;
285 
286  detectors.InsertEndChild( detector ) ;
287 
288  }
289  catch( UnknownParameterException& e){
290  }
291 
292  // --------- add BeamCal parameters -------------------
293  try{
294 
295  CalorimeterParametersXML handler ;
296 
297  TiXmlElement detector = handler.toXML( mgr->getBeamCalParameters() ) ;
298 
299  detector.SetAttribute( "name" , "BeamCal" ) ;
300  detector.SetAttribute( "geartype" , GEAR::CALORIMETERPARAMETERS ) ;
301 
302  detectors.InsertEndChild( detector ) ;
303 
304  }
305  catch( UnknownParameterException& e){
306  }
307 
308 
309 
310  // ------- add VXD parameters ----------------------------
311  try{
312 
313  ZPlanarParametersXML handler ;
314 
315  TiXmlElement detector = handler.toXML( mgr->getVXDParameters() ) ;
316 
317  // debugging
318  //std::cout << "VXD called." << std::endl ;
319 
320  detector.SetAttribute( "name" , "VXD" ) ;
321  detector.SetAttribute( "geartype" , GEAR::ZPLANARPARAMETERS ) ;
322 
323  detectors.InsertEndChild( detector ) ;
324  }
325  catch( UnknownParameterException& e) {
326  }
327 
328  // ------- add FTD parameters ----------------------------
329  try{
330 
331  FTDParametersXML handler ;
332 
333  TiXmlElement detector = handler.toXML( mgr->getFTDParameters() ) ;
334 
335  // debugging
336  //std::cout << "FTD called." << std::endl ;
337 
338  detector.SetAttribute( "name" , "FTD" ) ;
339  detector.SetAttribute( "geartype" , GEAR::FTDPARAMETERS ) ;
340 
341  detectors.InsertEndChild( detector ) ;
342  }
343  catch( UnknownParameterException& e) {
344  }
345 
346  // ------- add SIT parameters ----------------------------
347  try{
348 
349  ZPlanarParametersXML handler ;
350 
351  TiXmlElement detector = handler.toXML( mgr->getSITParameters() ) ;
352 
353  // debugging
354  //std::cout << "SIT called." << std::endl ;
355 
356  detector.SetAttribute( "name" , "SIT" ) ;
357  detector.SetAttribute( "geartype" , GEAR::ZPLANARPARAMETERS ) ;
358 
359  detectors.InsertEndChild( detector ) ;
360  }
361  catch( UnknownParameterException& e) {
362  }
363 
364  // ------- add SET parameters ----------------------------
365  try{
366 
367  ZPlanarParametersXML handler ;
368 
369  TiXmlElement detector = handler.toXML( mgr->getSETParameters() ) ;
370 
371  // debugging
372  //std::cout << "SET called." << std::endl ;
373 
374  detector.SetAttribute( "name" , "SET" ) ;
375  detector.SetAttribute( "geartype" , GEAR::ZPLANARPARAMETERS ) ;
376 
377  detectors.InsertEndChild( detector ) ;
378  }
379  catch( UnknownParameterException& e) {
380  }
381 
382  // ------- add TrackerPlanes parameters ----------------------------
383  try{
384 
386 
387  TiXmlElement detector = handler.toXML( mgr->getTrackerPlanesParameters() ) ;
388 
389  // debugging
390  // std::cout << "TrackerPlanes called." << std::endl ;
391 
392  detector.SetAttribute( "name" , "TrackerPlanes" ) ;
393  detector.SetAttribute( "geartype" , GEAR::TRACKERPLANESPARAMETERS ) ;
394  detectors.InsertEndChild( detector ) ;
395  }
396  catch( UnknownParameterException& e) {
397  }
398 
399 
400  // ------- add SiPlanes parameters ----------------------------
401  try{
402 
403  SiPlanesParametersXML handler ;
404 
405  TiXmlElement detector = handler.toXML( mgr->getSiPlanesParameters() ) ;
406 
407  // debugging
408  // std::cout << "SiPlanes called." << std::endl ;
409 
410  detector.SetAttribute( "name" , "SiPlanes" ) ;
411  detector.SetAttribute( "geartype" , GEAR::SIPLANESPARAMETERS ) ;
412  detectors.InsertEndChild( detector ) ;
413  }
414  catch( UnknownParameterException& e) {
415  }
416 
417 
418  // ------- generic/user detector parameters -----------
419 
420  const std::vector<std::string>& keys = mgr->getGearParameterKeys() ;
421 
422 
423  for( unsigned int i=0; i<keys.size(); i++ ){
424 
425 
426  GearParametersXML handler ;
427 
428  TiXmlElement detector = handler.toXML( mgr->getGearParameters( keys[i] ) ) ;
429 
430  detector.SetAttribute( "name" , keys[i] ) ;
431  detector.SetAttribute( "geartype" , GEAR::GEARPARAMETERS ) ;
432 
433  detectors.InsertEndChild( detector ) ;
434 
435  }
436 
437  // ------- add materials -----------
438 
439  const std::vector<std::string>& mNames = mgr->getMaterialNames() ;
440 
441 
442  for( unsigned int i=0; i< mNames.size(); i++ ){
443 
444 
445  SimpleMaterialXML handler ;
446 
447  TiXmlElement material = handler.toXML( mgr->getSimpleMaterial( mNames[i] ) ) ;
448 
449  // material.SetAttribute( "name" , mNames[i] ) ;
450  // material.SetAttribute( "geartype" , GEAR::GEARPARAMETERS ) ;
451 
452  materials.InsertEndChild( material ) ;
453 
454  }
455 
456 
457 
458  // ---- now put everything together -------------
459 
460  root.InsertEndChild ( detectors ) ;
461 
462  root.InsertEndChild( materials ) ;
463 
464  doc.InsertEndChild ( root ) ;
465 
466  doc.SaveFile() ;
467 
468  }
469 
470 
471 
472 
474 
475  if( _gearMgr != 0 ){
476 
477  return _gearMgr ;
478 
479  } else {
480 
481  _gearMgr = new GearMgrImpl ;
482 
483  }
484 
485 
486  // parse the XML file
487 
488  // TiXmlDocument* doc = new TiXmlDocument ;
489  TiXmlDocument doc ;
490  // TiXmlDocument* doc = &xmldoc ;
491 
492  bool loadOkay = doc.LoadFile( _fileName ) ;
493 
494  if( !loadOkay ) {
495 
496  std::stringstream str ;
497 
498  str << "GearXML::createGearMgr error in file [" << _fileName
499  << ", row: " << doc.ErrorRow() << ", col: " << doc.ErrorCol() << "] : "
500  << doc.ErrorDesc() ;
501 
502  throw ParseException( str.str() ) ;
503  }
504 
505 // TiXmlHandle docHandle( &doc );
506 
507  TiXmlElement* root = doc.RootElement();
508 
509  if( root == 0 ){
510  throw ParseException( std::string( "GearXML::createGearMgr : no root tag found in ")
511  + _fileName ) ;
512  }
513 
514 
515  TiXmlNode* global = root->FirstChild("global") ;
516  if( global != 0 ){
517  std::string detName = getXMLAttribute( global, "detectorName" ) ;
518  _gearMgr->setDetectorName( detName ) ;
519  }
520 
521  TiXmlNode* detectors = root->FirstChild("detectors") ;
522  if( detectors == 0 ){
523  throw ParseException( std::string( "GearXML::createGearMgr : no detectors tag found in ")
524  + _fileName ) ;
525  }
526 
527 // // --- the BField ------------
528  TiXmlNode* field = root->FirstChild("BField") ;
529  if( field != 0 ){
530  ConstantBFieldXML handler ;
531  handler.fromXML( field->ToElement() , _gearMgr ) ;
532  }
533 
534 //-----GDML File ---------------
535  TiXmlNode* gdmlfile = root->FirstChild("GDMLFile") ;
536 
537  if( gdmlfile != 0 ){
538 
539  std::string gdmlname = getXMLAttribute( gdmlfile, "name" ) ;
540 
541 
542  // TGeoGeometryInitializer *tgeoini=TGeoGeometryInitializer::getTGeoGeometryInitializer(gdmlname);
543  // TGeoGearPointProperties *tgeopoint=new TGeoGearPointProperties(tgeoini->getGeoManager());
544  // TGeoGearDistanceProperties *tgeodist=new TGeoGearDistanceProperties(tgeoini->getGeoManager());
545 
546 #ifdef __APPLE__
547  std::string libName = "libgeartgeo.dylib" ;
548 #else
549  std::string libName = "libgeartgeo.so" ;
550 #endif
551 
552 
553  // now we need to dynamically load the libgearTGeo ....
554  void* libPointer = dlopen( libName.c_str() , RTLD_LAZY | RTLD_GLOBAL) ;
555 
556  if( libPointer != 0 && GearMaterialPropertiesFactory::instance() != 0 ) {
557 
559  mProp->config()["GDMLFileName"] = gdmlname ;
560  mProp->initialize() ;
561 
562  GearPointProperties* tgeopoint = mProp->getGearPointProperties() ;
564 
565  _gearMgr->setPointProperties( tgeopoint );
566  _gearMgr->setDistanceProperties( tgeodist );
567 
568  } else {
569 
570  std::cout << " WARNING: GearXML::createGearMgr: GDML file specified " << std::endl
571  << " but failed to load library " << libName << " ! " << std::endl
572  << " Check your dynamic library search path ($(DY)LD_LIBRARY_PATH )... " << std::endl
573  << std::endl ;
574 
575  }
576  }
577 
578 
579 
580  TiXmlNode* det = 0 ;
581  while( ( det = detectors->IterateChildren( "detector", det ) ) != 0 ){
582 
583  std::string name = getXMLAttribute( det, "name" ) ;
584 
585  std::string type("UNKOWN") ;
586 
587  try {
588 
589  type = getXMLAttribute( det, "geartype" ) ;
590 
591 // std::cout << "GearXML::createGearMgr: reading detector " << name
592 // << " with \"geartype\" " << type << std::endl ;
593 
594  // backward compatibility
595  if( type==std::string("VXDParameters") ){
596  type = "ZPlanarParameters" ;
597  }
598 
599 
600  } catch( ParseException& e){
601 
602  std::cout << "GearXML::createGearMgr: igoring detector " << name
603  << " with missing attribute \"geartype\" " << std::endl ;
604 
605  continue ;
606  }
607 
608  const XMLHandler* handler = XMLHandlerMgr::instance()->getHandler( type ) ;
609 
610  if( handler == 0 ) {
611 
612  throw ParseException( std::string( "GearXML::createGearMgr : unknown geartype \"")
613  + type + "\" in file " + _fileName ) ;
614  }
615 
616  // GearParameters* gp =
617 
618  handler->fromXML( det->ToElement() , _gearMgr ) ;
619 
620  }
621 
622 
623  //----------------------
624 
625  TiXmlNode* materials = root->FirstChild("materials") ;
626 
627  if( materials != 0 ){
628 
629  SimpleMaterialXML handler ;
630 
631  TiXmlNode* mat = 0 ;
632  while( ( mat = materials->IterateChildren( "material", mat ) ) != 0 ){
633 
634  handler.fromXML( mat->ToElement() , _gearMgr ) ;
635  }
636 
637  }
638 
639 
640 
641 
642 
643 
644  return _gearMgr ;
645  }
646 
647 
648 
649 }
bool SaveFile() const
Save a file using the current document value. Returns true if successful.
Definition: tinyxml.cc:933
virtual void setPointProperties(GearPointProperties *pointProperties)
Set the point properties object.
Definition: GearMgrImpl.cc:557
XML handler for ZPlanarParameters.
virtual GearParameters * fromXML(const TiXmlElement *xmlElement, GearMgr *gearMgr=0) const
Creates the appropriate GearParameters subclass from the given XML element (node) ...
int ErrorRow()
Returns the location (if known) of the error.
Definition: tinyxml.h:1232
Abstract interface for a class that returns the (material) properties along a given distance between ...
virtual const TPCParameters & getTPCParameters() const =0
Get the TPCParameters.
void SetValue(const char *_value)
Changes the value of the node.
Definition: tinyxml.h:448
XML handler for SimpleMaterial.
bool LoadFile(TiXmlEncoding encoding=TIXML_DEFAULT_ENCODING)
Load a file using the current document value.
Definition: tinyxml.cc:921
static const GearMaterialPropertiesFactory * instance()
The instance.
virtual const CalorimeterParameters & getHcalEndcapParameters() const =0
Get the Hcal endcap parameters.
virtual const FTDParameters & getFTDParameters() const =0
Get the FTD parameters.
GearMgr * createGearMgr()
Creates an instance of GearMgr from the data given in the XML file.
Definition: GearXML.cc:473
virtual GearDistanceProperties * getGearDistanceProperties() const =0
Get an instance of the GearDistanceProperties - 0 if not initialized.
XML handler for ConstantBField.
virtual const ZPlanarParameters & getVXDParameters() const =0
Get the VXD parameters.
Base exception class for GEAR - all other exceptions extend this.
Definition: GEAR.h:41
virtual GearParameters * fromXML(const TiXmlElement *xmlElement, GearMgr *gearMgr=0) const =0
Creates the approprtiate GearParameters subclass from the given XML element (node) and adss it to the...
virtual const SiPlanesParameters & getSiPlanesParameters() const =0
Get the SiPlanes parameters.
Interface for XML handlers of GEAR classes.
Definition: XMLHandler.h:17
XML handler for SiPlanesParameters.
XML handler for CalorimeterParameters.
Manager class that returns the Gear classes for the relevant subdetectors.
Definition: GearMgrImpl.h:23
virtual const CalorimeterParameters & getBeamCalParameters() const =0
Get the BeamCal parameters.
const char * ErrorDesc() const
Contains a textual (english) description of the error if one occurs.
Definition: tinyxml.h:1218
Abstract XML handler for TPCParameters.
virtual const BField & getBField() const =0
Get the B field map.
virtual GearMaterialProperties * create() const =0
Create a new object of the GearMaterialProperties.
virtual const CalorimeterParameters & getYokeBarrelParameters() const =0
Get the Yoke barrel parameters.
int ErrorCol()
The column where the error occured. See ErrorRow()
Definition: tinyxml.h:1233
virtual const ZPlanarParameters & getSITParameters() const =0
Get the SIT parameters.
XML handler for GearParameters.
Always the top level node.
Definition: tinyxml.h:1154
XML handler for FTDParameters.
virtual const GearParameters & getGearParameters(const std::string &key) const =0
Get named parameters for key.
virtual const CalorimeterParameters & getLHcalParameters() const =0
Get the LHcal parameters.
UnknownParameterException call Processor::end().
Definition: GEAR.h:99
static void createXMLFile(GearMgr *mgr, const std::string &fileName)
Write an XML file to disk from the given GearMgr object.
Definition: GearXML.cc:50
XML handler for TrackerPlanesParameters.
The parent class for everything in the Document Object Model.
Definition: tinyxml.h:370
virtual const SimpleMaterial & getSimpleMaterial(const std::string name) const =0
Return the SimpleMaterial for the given name throws UnknownParameterException if no material is unkno...
virtual GearPointProperties * getGearPointProperties() const =0
Get an instance of the GearPointProperties - 0 if not initialized.
virtual const TrackerPlanesParameters & getTrackerPlanesParameters() const =0
Get the TrackerPlanes parameters.
virtual const std::vector< std::string > & getGearParameterKeys() const =0
Keys of all GearParameters.
ParseException used for parse errors, e.g.
Definition: GEAR.h:65
std::string getXMLAttribute(const TiXmlNode *node, const std::string &name)
Helper method used for parsing XML.
virtual const std::vector< std::string > & getMaterialNames() const =0
Names of registered materials.
virtual const std::string & getDetectorName() const =0
The unique detector name - typically the model name used in the simulation program.
const TiXmlElement * ToElement() const
Cast to a more defined type. Will return null not of the requested type.
Definition: tinyxml.h:617
virtual TiXmlElement toXML(const GearParameters &parameters) const
Creates an XML node for the given parameters.
const TiXmlElement * RootElement() const
Get the root element – the only top level element – of the document.
Definition: tinyxml.h:1207
virtual const CalorimeterParameters & getEcalPlugParameters() const =0
Get the Ecal plug parameters.
virtual const CalorimeterParameters & getEcalBarrelParameters() const =0
Get the Ecal barrel parameters.
An XML comment.
Definition: tinyxml.h:969
The element is a container class.
Definition: tinyxml.h:827
virtual const CalorimeterParameters & getYokePlugParameters() const =0
Get the Yoke plug parameters.
virtual const ZPlanarParameters & getSETParameters() const =0
Get the SET parameters.
TiXmlNode * InsertEndChild(const TiXmlNode &addThis)
Add a new node related to this.
Definition: tinyxml.cc:218
virtual TiXmlElement toXML(const GearParameters &parameters) const
Creates an XML node for the given parameters.
virtual SimpleMaterial * fromXML(const TiXmlElement *xmlElement, GearMgr *gearMgr=0) const
Creates a SimpleMaterial from the XML element (node)
virtual const CalorimeterParameters & getLcalParameters() const =0
Get the Lcal parameters.
virtual const CalorimeterParameters & getYokeEndcapParameters() const =0
Get the Yoke endcap parameters.
virtual TiXmlElement toXML(const GearParameters &parameters) const
Creates an XML node for the given parameters.
virtual TiXmlElement toXML(const SimpleMaterial &material) const
Creates an XML node for the given material.
virtual const CalorimeterParameters & getHcalRingParameters() const =0
Get the Hcal ring parameters.
virtual void setDistanceProperties(GearDistanceProperties *distanceProperties)
Set the distance properties object.
Definition: GearMgrImpl.cc:562
virtual TiXmlElement toXML(const GearParameters &parameters) const
Creates an XML node for the given parameters.
const TiXmlNode * FirstChild() const
The first child of this node. Will be null if there are no children.
Definition: tinyxml.h:466
virtual TiXmlElement toXML(const GearParameters &parameters) const
Creates an XML node for the given parameters.
virtual const CalorimeterParameters & getHcalBarrelParameters() const =0
Get the Hcal barrel parameters.
Abstract base class for implemenations of the GearPointPtoperties and GearDistanceProperties.
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 const CalorimeterParameters & getEcalEndcapParameters() const =0
Get the Ecal endcap parameters.
void SetAttribute(const char *name, const char *value)
Sets an attribute of name to a given value.
Definition: tinyxml.cc:746
virtual TiXmlElement toXML(const GearParameters &modularTPC) const
Creates an XML node for the given TPCParameters.
virtual TiXmlElement toXML(const GearParameters &parameters) const
Creates an XML node for the given parameters.
virtual void initialize()=0
Initialize a concrete implemetaiton of the detailed material properties - after the configuration...
Abstract interface for a class that returns the (material) properties of a given point in in world co...
virtual void setDetectorName(const std::string &name)
Set detector name.
Definition: GearMgrImpl.h:229
virtual TiXmlElement toXML(const GearParameters &parameters) const
Creates an XML node for the given parameters.
ConfigMap & config()
Use to configure an instance of the material properties, e.g.