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 
27 {
28 public:
31 
32  typedef std::auto_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" )),
49  label_(iConfig.getParameter<std::string>( "label" ))
50 {
51  setWhatProduced( this );
52 }
53 
54 
56 {}
57 
60 {
61  using namespace edm::es;
62 
64  iRecord.getRecord<GeometryFileRcd>().get( label_, gdd );
65 
66  DDName ddName(rootDDName_);
67  DDLogicalPart rootNode(ddName);
68  DDRootDef::instance().set(rootNode);
69  ReturnType returnValue(new DDCompactView(rootNode));
70  DDLParser parser(*returnValue);
71  parser.getDDLSAX2FileHandler()->setUserNS(true);
72  parser.clearFiles();
73 
74  std::vector<unsigned char>* tb = (*gdd).getUncompressedBlob();
75 
76  parser.parse(*tb, tb->size());
77 
78  delete tb;
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:374
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 &)