CMS 3D CMS Logo

Functions
StandaloneTrackerTopology Namespace Reference

Functions

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

Function Documentation

◆ fromTrackerParametersXMLFile()

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 186 of file StandaloneTrackerTopology.cc.

References Exception, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by DMRChecker::endJob(), gainCalibHelper::SiPixelGainCalibrationValuesPerRegion< isBarrel, myType, PayloadType >::fill(), gainCalibHelper::SiPixelGainCalibrationValuesComparisonPerRegion< isBarrel, myType, nIOVs, ntags, PayloadType >::fill(), gainCalibHelper::SiPixelGainCalibrationByRegionComparisonBase< myType, PayloadType, nIOVs, ntags >::fill(), SiPixelFakeLorentzAngleESSource::produce(), and gainCalibHelper::SiPixelGainCalibrationMap< myType, PayloadType, myDetType >::SiPixelGainCalibrationMap().

186  {
187  tinyxml2::XMLDocument xmlDoc;
188  xmlDoc.LoadFile(xmlFileName.c_str());
189  if (!xmlDoc.Error()) {
190  TrackerTopologyExtractor extr{};
191  xmlDoc.Accept(&extr);
192  return extr.getTrackerTopology();
193  } else {
194  throw cms::Exception("StandaloneTrackerTopology",
195  std::string{"Failed to parse file "} + xmlFileName + ": " + xmlDoc.ErrorStr());
196  }
197  }

◆ fromTrackerParametersXMLString()

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 198 of file StandaloneTrackerTopology.cc.

References Exception, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by FWGeometry::loadMap().

198  {
199  tinyxml2::XMLDocument xmlDoc;
200  xmlDoc.Parse(xmlContent.c_str());
201  if (!xmlDoc.Error()) {
202  TrackerTopologyExtractor extr{};
203  xmlDoc.Accept(&extr);
204  return extr.getTrackerTopology();
205  } else {
206  throw cms::Exception("StandaloneTrackerTopology", std::string{"Error while parsing XML: "} + xmlDoc.ErrorStr());
207  }
208  }