Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:49:17

0001 #include "GeometryReaders/XMLIdealGeometryESSource/interface/GeometryConfiguration.h"
0002 
0003 #include "FWCore/ParameterSet/interface/FileInPath.h"
0004 
0005 #include "DetectorDescription/Parser/interface/DDLParser.h"
0006 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0007 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0008 
0009 #include <string>
0010 #include <vector>
0011 
0012 GeometryConfiguration::GeometryConfiguration(const edm::ParameterSet& pset) : dummyLocation_("") {
0013   relFiles_ = pset.getParameter<std::vector<std::string> >("geomXMLFiles");
0014   for (std::vector<std::string>::const_iterator rit = relFiles_.begin(), ritEnd = relFiles_.end(); rit != ritEnd;
0015        ++rit) {
0016     edm::FileInPath fp(*rit);
0017     files_.emplace_back(fp.fullPath());
0018     emptyStrings_.emplace_back("");
0019   }
0020 }
0021 
0022 GeometryConfiguration::~GeometryConfiguration() {}
0023 
0024 /// Return the Schema Location.
0025 std::string GeometryConfiguration::getSchemaLocation() const {
0026   edm::LogError("GeometryConfiguration") << " This sub-class of DDLDocumentProvider does not USE XML parsing!!!"
0027                                          << std::endl;
0028   return dummyLocation_;
0029 }
0030 
0031 /// Return a flag whether to do xml validation or not.
0032 bool GeometryConfiguration::doValidation() const {
0033   LogDebug("GeometryConfiguration") << " the doValidation() method not valid for this DDLDocumentProvider" << std::endl;
0034   return false;
0035 }
0036 
0037 /// Return a list of files as a vector of strings.
0038 const std::vector<std::string>& GeometryConfiguration::getFileList(void) const { return files_; }
0039 
0040 /// Return a list of urls as a vector of strings.
0041 /**
0042    The EDM should not allow URLs because of provenance.
0043    This vector will always be empty.
0044 **/
0045 const std::vector<std::string>& GeometryConfiguration::getURLList(void) const {
0046   LogDebug("GeometryConfiguration") << " the getURLList of this DDLDocumentProvider empty strings" << std::endl;
0047   //  return relFiles_;
0048   return emptyStrings_;
0049 }
0050 
0051 /// Print out the list of files.
0052 void GeometryConfiguration::dumpFileList(void) const {
0053   std::cout << "File List:" << std::endl;
0054   std::cout << "  number of files=" << files_.size() << std::endl;
0055   for (const auto& file : files_)
0056     std::cout << file << std::endl;
0057 }
0058 
0059 int GeometryConfiguration::readConfig(const std::string& fname) {
0060   edm::LogWarning("GeometryConfiguration") << " The readConfig of this DDLDocumentProvider is not valid!" << std::endl;
0061   return 0;
0062 }