CMS 3D CMS Logo

Functions
StandaloneTrackerTopology Namespace Reference

Functions

TrackerTopology fromTrackerParametersXMLFile (const std::string &xmlFileName)
 
TrackerTopology fromTrackerParametersXMLString (const std::string &xmlContent)
 

Function Documentation

TrackerTopology StandaloneTrackerTopology::fromTrackerParametersXMLFile ( const std::string &  xmlFileName)

Construct a TrackerTopology from a trackerParameters.xml file, from the name of the file

WARNING: this method has been introduced to construct a TrackerTopology object only for the rare cases where it cannot be retrieved from an edm::EventSetup (e.g. ROOT macros).

Definition at line 170 of file StandaloneTrackerTopology.cc.

References Exception, and AlCaHLTBitMon_QueryRunRegistry::string.

170  {
171  TiXmlDocument xmlDoc;
172  if ( xmlDoc.LoadFile(xmlFileName) ) {
173  TrackerTopologyExtractor extr{};
174  xmlDoc.Accept(&extr);
175  return extr.getTrackerTopology();
176  } else {
177  throw cms::Exception("StandaloneTrackerTopology", std::string{"Failed to parse file "}+xmlFileName+": "+xmlDoc.ErrorDesc());
178  }
179 }
TrackerTopology StandaloneTrackerTopology::fromTrackerParametersXMLString ( const std::string &  xmlContent)

Construct a TrackerTopology from a trackerParameters.xml file, from the contents read into a std::string

WARNING: this method has been introduced to construct a TrackerTopology object only for the rare cases where it cannot be retrieved from an edm::EventSetup (e.g. ROOT macros).

Definition at line 180 of file StandaloneTrackerTopology.cc.

References Exception, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by FWGeometry::loadMap().

180  {
181  TiXmlDocument xmlDoc;
182  xmlDoc.Parse(xmlContent.c_str());
183  if ( ! xmlDoc.Error() ) {
184  TrackerTopologyExtractor extr{};
185  xmlDoc.Accept(&extr);
186  return extr.getTrackerTopology();
187  } else {
188  throw cms::Exception("StandaloneTrackerTopology", std::string{"Error while parsing XML: "}+xmlDoc.ErrorDesc());
189  }
190 }