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
XMLIdealGeometryESProducer::blobToken_
const edm::ESGetToken< FileBlob, GeometryFileRcd > blobToken_
Definition: XMLIdealGeometryESProducer.cc:27
ESTransientHandle.h
ESHandle.h
ESInputTag
DDName
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
edm
HLT enums.
Definition: AlignableModifier.h:19
XMLIdealGeometryESProducer::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: XMLIdealGeometryESProducer.cc:52
XMLIdealGeometryESProducer::ReturnType
std::unique_ptr< DDCompactView > ReturnType
Definition: XMLIdealGeometryESProducer.cc:19
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
ESProducer.h
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:92
edm::ESProducer::usesResources
void usesResources(std::vector< std::string > const &)
Definition: ESProducer.cc:117
SharedResourceNames.h
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet
Definition: ParameterSet.h:47
XMLIdealGeometryESProducer::rootDDName_
const std::string rootDDName_
Definition: XMLIdealGeometryESProducer.cc:26
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:30
edm::ESSharedResourceNames::kDDGeometry
static const std::string kDDGeometry
Definition: SharedResourceNames.h:37
ModuleFactory.h
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
std
Definition: JetResolutionObject.h:76
XMLIdealGeometryESProducer
Definition: XMLIdealGeometryESProducer.cc:15
DDRoot.h
XMLIdealGeometryESProducer::produce
ReturnType produce(const IdealGeometryRecord &)
Definition: XMLIdealGeometryESProducer.cc:36
DEFINE_FWK_EVENTSETUP_MODULE
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
edm::ESProducer
Definition: ESProducer.h:104
edm::ConfigurationDescriptions::addDefault
void addDefault(ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:99
IdealGeometryRecord
Definition: IdealGeometryRecord.h:25