CMS 3D CMS Logo

XMLIdealGeometryESProducer.cc
Go to the documentation of this file.
11 
12 #include <memory>
13 
15 public:
17 
18  using ReturnType = std::unique_ptr<DDCompactView>;
19 
21 
22  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
23 
24 private:
25  const std::string rootDDName_; // this must be the form namespace:name
27 };
28 
30  : rootDDName_(iConfig.getParameter<std::string>("rootDDName")) {
31  setWhatProduced(this).setConsumes(blobToken_, edm::ESInputTag("", iConfig.getParameter<std::string>("label")));
32 }
33 
36  auto cpv = std::make_unique<DDCompactView>(DDName(rootDDName_));
37  DDLParser parser(*cpv);
38  parser.getDDLSAX2FileHandler()->setUserNS(true);
39  parser.clearFiles();
40 
41  std::unique_ptr<std::vector<unsigned char> > tb = (*gdd).getUncompressedBlob();
42 
43  parser.parse(*tb, tb->size());
44 
45  cpv->lockdown();
46 
47  return cpv;
48 }
49 
52  desc.add<std::string>("rootDDName")->setComment("The value must be of the form 'namespace:name'");
53  desc.add<std::string>("label")->setComment("product label used to get the FileBlob");
54 
55  descriptions.addDefault(desc);
56 }
57 
58 //define this as a plug-in
T getParameter(std::string const &) const
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:138
std::unique_ptr< DDCompactView > ReturnType
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
ESTransientHandle< ProductT > getTransientHandle(ESGetToken< ProductT, DepRecordT > const &iToken) const
XMLIdealGeometryESProducer(const edm::ParameterSet &)
ReturnType produce(const IdealGeometryRecord &)
void addDefault(ParameterSetDescription const &psetDescription)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
DDLParser is the main class of Detector Description Language Parser.
Definition: DDLParser.h:63
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
edm::ESGetToken< FileBlob, GeometryFileRcd > blobToken_