CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
XMLIdealMagneticFieldGeometryESProducer.cc
Go to the documentation of this file.
1 #include "boost/shared_ptr.hpp"
2 
5 
8 
15 
20 
25 
26 #include <memory>
27 
29 {
30 public:
33 
34  typedef std::auto_ptr<DDCompactView> ReturnType;
35 
37 
38 private:
39  std::string rootDDName_; // this must be the form namespace:name
41 
47 };
48 
50  : rootDDName_(iConfig.getParameter<std::string>( "rootDDName" )),
51  label_(iConfig.getParameter<std::string>( "label" ))
52 {
53  setWhatProduced( this );
54 }
55 
56 
58 {}
59 
62 {
63  using namespace edm::es;
64 
66  iRecord.getRecord<GeometryFileRcd>().get( label_, gdd );
67 
68  DDName ddName(rootDDName_);
69  DDLogicalPart rootNode(ddName);
70  DDRootDef::instance().set(rootNode);
71  ReturnType returnValue(new DDCompactView(rootNode));
72  DDLParser parser(*returnValue);
73  parser.getDDLSAX2FileHandler()->setUserNS(true);
74  parser.clearFiles();
75 
76  std::unique_ptr<std::vector<unsigned char> > tb = (*gdd).getUncompressedBlob();
77 
78  parser.parse(*tb, tb->size());
79 
80  returnValue->lockdown();
81 
82  return returnValue ;
83 }
84 
int parse(const DDLDocumentProvider &dp)
Parse all files. Return is meaningless.
Definition: DDLParser.cc:204
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:18
type of data representation of DDCompactView
Definition: DDCompactView.h:77
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
static value_type & instance()
virtual void setUserNS(bool userns)
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
Definition: DDLogicalPart.h:88
void clearFiles()
Clear the file list - see Warning!
Definition: DDLParser.cc:373
DDLSAX2FileHandler * getDDLSAX2FileHandler()
To get the parent this class allows access to the handler.
Definition: DDLParser.cc:73
DDLParser is the main class of Detector Description Language Parser.
Definition: DDLParser.h:64
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
ReturnType produce(const IdealMagneticFieldRecord &)