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  tinyxml2::XMLDocument xmlDoc;
172  xmlDoc.LoadFile(xmlFileName.c_str());
173  if ( ! xmlDoc.Error() ) {
174  TrackerTopologyExtractor extr{};
175  xmlDoc.Accept(&extr);
176  return extr.getTrackerTopology();
177  } else {
178  throw cms::Exception("StandaloneTrackerTopology", std::string{"Failed to parse file "}+xmlFileName+": "+xmlDoc.ErrorStr());
179  }
180 }
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 181 of file StandaloneTrackerTopology.cc.

References Exception, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by FWGeometry::loadMap().

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