CMS 3D CMS Logo

XMLIdealGeometryESProducer.cc
Go to the documentation of this file.
11 
12 #include <memory>
13 
15 {
16 public:
18 
19  using ReturnType = std::unique_ptr<DDCompactView>;
20 
22 
23 private:
24 
25  std::string rootDDName_; // this must be the form namespace:name
27 };
28 
30  : rootDDName_( iConfig.getParameter<std::string>( "rootDDName" )),
31  label_( iConfig.getParameter<std::string>( "label" ))
32 {
33  setWhatProduced( this );
34 }
35 
38 {
40  iRecord.getRecord<GeometryFileRcd>().get( label_, gdd );
41  auto cpv = std::make_unique<DDCompactView>( DDName( rootDDName_ ));
42  DDLParser parser( *cpv );
43  parser.getDDLSAX2FileHandler()->setUserNS( true );
44  parser.clearFiles();
45 
46  std::unique_ptr<std::vector<unsigned char> > tb = (*gdd).getUncompressedBlob();
47 
48  parser.parse( *tb, tb->size());
49 
50  cpv->lockdown();
51 
52  return cpv;
53 }
54 
55 //define this as a plug-in
std::unique_ptr< DDCompactView > ReturnType
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
XMLIdealGeometryESProducer(const edm::ParameterSet &)
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
ReturnType produce(const IdealGeometryRecord &)
DDLParser is the main class of Detector Description Language Parser.
Definition: DDLParser.h:63
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60