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
edm::ESInputTag
Definition: ESInputTag.h:87
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
ESTransientHandle.h
ESHandle.h
DDName
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
XMLIdealGeometryESProducer::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: XMLIdealGeometryESProducer.cc:50
XMLIdealGeometryESProducer::ReturnType
std::unique_ptr< DDCompactView > ReturnType
Definition: XMLIdealGeometryESProducer.cc:18
edm::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:138
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
ESProducer.h
XMLIdealGeometryESProducer::blobToken_
edm::ESGetToken< FileBlob, GeometryFileRcd > blobToken_
Definition: XMLIdealGeometryESProducer.cc:26
writedatasetfile.parser
parser
Definition: writedatasetfile.py:7
DDLParser.h
FileBlob.h
DDCompactView.h
GeometryFileRcd.h
edm::eventsetup::DependentRecordImplementation::getTransientHandle
ESTransientHandle< ProductT > getTransientHandle(ESGetToken< ProductT, DepRecordT > const &iToken) const
Definition: DependentRecordImplementation.h:99
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet
Definition: ParameterSet.h:36
XMLIdealGeometryESProducer::rootDDName_
const std::string rootDDName_
Definition: XMLIdealGeometryESProducer.cc:25
DDLParser
DDLParser is the main class of Detector Description Language Parser.
Definition: DDLParser.h:63
IdealGeometryRecord.h
edm::ESGetToken< FileBlob, GeometryFileRcd >
edm::ESTransientHandle
Definition: ESTransientHandle.h:41
XMLIdealGeometryESProducer::XMLIdealGeometryESProducer
XMLIdealGeometryESProducer(const edm::ParameterSet &)
Definition: XMLIdealGeometryESProducer.cc:29
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
ModuleFactory.h
std
Definition: JetResolutionObject.h:76
XMLIdealGeometryESProducer
Definition: XMLIdealGeometryESProducer.cc:14
DDRoot.h
XMLIdealGeometryESProducer::produce
ReturnType produce(const IdealGeometryRecord &)
Definition: XMLIdealGeometryESProducer.cc:34
DEFINE_FWK_EVENTSETUP_MODULE
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
edm::ESProducer
Definition: ESProducer.h:101
edm::ConfigurationDescriptions::addDefault
void addDefault(ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:99
IdealGeometryRecord
Definition: IdealGeometryRecord.h:27