CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
XMLIdealMagneticFieldGeometryESProducer.cc
Go to the documentation of this file.
3 
6 
8 
14 
19 
24 
25 #include <memory>
26 
28 public:
31 
32  typedef std::unique_ptr<DDCompactView> ReturnType;
33 
35 
36 private:
37  std::string rootDDName_; // this must be the form namespace:name
39 
45 };
46 
48  : rootDDName_(iConfig.getParameter<std::string>("rootDDName")), label_(iConfig.getParameter<std::string>("label")) {
50  setWhatProduced(this);
51 }
52 
54 
56  const IdealMagneticFieldRecord& iRecord) {
57  using namespace edm::es;
58 
60  iRecord.getRecord<MFGeometryFileRcd>().get(label_, gdd);
61 
62  DDName ddName(rootDDName_);
63  DDLogicalPart rootNode(ddName);
64  DDRootDef::instance().set(rootNode);
65  ReturnType returnValue(new DDCompactView(rootNode));
66  DDLParser parser(*returnValue);
67  parser.getDDLSAX2FileHandler()->setUserNS(true);
68  parser.clearFiles();
69 
70  std::unique_ptr<std::vector<unsigned char> > tb = (*gdd).getUncompressedBlob();
71 
72  parser.parse(*tb, tb->size());
73 
74  returnValue->lockdown();
75 
76  return returnValue;
77 }
78 
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:163
int parse(const DDLDocumentProvider &dp)
Parse all files. Return is meaningless.
Definition: DDLParser.cc:123
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:17
Compact representation of the geometrical detector hierarchy.
Definition: DDCompactView.h:81
void usesResources(std::vector< std::string > const &)
static value_type & instance()
virtual void setUserNS(bool userns)
static const std::string kDDGeometry
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
Definition: DDLogicalPart.h:93
void clearFiles()
Clear the file list - see Warning!
Definition: DDLParser.cc:208
DDLSAX2FileHandler * getDDLSAX2FileHandler()
To get the parent this class allows access to the handler.
Definition: DDLParser.cc:53
DDLParser is the main class of Detector Description Language Parser.
Definition: DDLParser.h:63
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
ReturnType produce(const IdealMagneticFieldRecord &)