test
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 
14 
19 
24 
25 #include <memory>
26 
28 {
29 public:
32 
33  typedef std::auto_ptr<DDCompactView> ReturnType;
34 
36 
37 private:
38  std::string rootDDName_; // this must be the form namespace:name
40 
46 };
47 
49  : rootDDName_(iConfig.getParameter<std::string>( "rootDDName" )),
50  label_(iConfig.getParameter<std::string>( "label" ))
51 {
52  setWhatProduced( this );
53 }
54 
55 
57 {}
58 
61 {
62  using namespace edm::es;
63 
65  iRecord.getRecord<MFGeometryFileRcd>().get( label_, gdd );
66 
67  DDName ddName(rootDDName_);
68  DDLogicalPart rootNode(ddName);
69  DDRootDef::instance().set(rootNode);
70  ReturnType returnValue(new DDCompactView(rootNode));
71  DDLParser parser(*returnValue);
72  parser.getDDLSAX2FileHandler()->setUserNS(true);
73  parser.clearFiles();
74 
75  std::unique_ptr<std::vector<unsigned char> > tb = (*gdd).getUncompressedBlob();
76 
77  parser.parse(*tb, tb->size());
78 
79  returnValue->lockdown();
80 
81  return returnValue ;
82 }
83 
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:14
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 &)