CMS 3D CMS Logo

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