CMS 3D CMS Logo

XMLIdealMagneticFieldGeometryESProducer.cc
Go to the documentation of this file.
3 
6 
12 
17 
22 
23 #include <memory>
24 
26 {
27 public:
30 
31  typedef std::unique_ptr<DDCompactView> ReturnType;
32 
33  ReturnType produce( const IdealMagneticFieldRecord& );
34 
35 private:
36  std::string rootDDName_; // this must be the form namespace:name
38 
44 };
45 
47  : rootDDName_(iConfig.getParameter<std::string>( "rootDDName" )),
48  label_(iConfig.getParameter<std::string>( "label" ))
49 {
50  setWhatProduced( this );
51 }
52 
53 
55 {}
56 
59 {
60  using namespace edm::es;
61 
63  iRecord.getRecord<MFGeometryFileRcd>().get( label_, gdd );
64 
65  DDName ddName(rootDDName_);
66  DDLogicalPart rootNode(ddName);
67  DDRootDef::instance().set(rootNode);
68  ReturnType returnValue(new DDCompactView(rootNode));
69  DDLParser parser(*returnValue);
70  parser.getDDLSAX2FileHandler()->setUserNS(true);
71  parser.clearFiles();
72 
73  std::unique_ptr<std::vector<unsigned char> > tb = (*gdd).getUncompressedBlob();
74 
75  parser.parse(*tb, tb->size());
76 
77  returnValue->lockdown();
78 
79  return returnValue ;
80 }
81 
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:116
int parse(const DDLDocumentProvider &dp)
Parse all files. Return is meaningless.
Definition: DDLParser.cc:149
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
Compact representation of the geometrical detector hierarchy.
Definition: DDCompactView.h:80
static value_type & instance()
virtual void setUserNS(bool userns)
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
Definition: DDLogicalPart.h:93
void clearFiles()
Clear the file list - see Warning!
Definition: DDLParser.cc:245
DDLSAX2FileHandler * getDDLSAX2FileHandler()
To get the parent this class allows access to the handler.
Definition: DDLParser.cc:62
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 &)