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

168  {
169  tinyxml2::XMLDocument xmlDoc;
170  xmlDoc.LoadFile(xmlFileName.c_str());
171  if (!xmlDoc.Error()) {
172  TrackerTopologyExtractor extr{};
173  xmlDoc.Accept(&extr);
174  return extr.getTrackerTopology();
175  } else {
176  throw cms::Exception("StandaloneTrackerTopology",
177  std::string{"Failed to parse file "} + xmlFileName + ": " + xmlDoc.ErrorStr());
178  }
179  }

References Exception, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by DMRChecker::endJob(), gainCalibHelper::SiPixelGainCalibrationValuesPerRegion< isBarrel, myType, PayloadType >::fill(), and gainCalibHelper::SiPixelGainCalibrationMap< myType, PayloadType, myDetType >::SiPixelGainCalibrationMap().

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

180  {
181  tinyxml2::XMLDocument 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.ErrorStr());
189  }
190  }

References Exception, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by FWGeometry::loadMap().

AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
Exception
Definition: hltDiff.cc:245