CMS 3D CMS Logo

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
40 
46 };
47 
49  : rootDDName_(iConfig.getParameter<std::string>("rootDDName")), label_(iConfig.getParameter<std::string>("label")) {
51 
52  auto cc = setWhatProduced(this);
54 }
55 
57 
59  const IdealMagneticFieldRecord& iRecord) {
60  using namespace edm::es;
61 
63 
64  DDName ddName(rootDDName_);
65  DDLogicalPart rootNode(ddName);
66  DDRootDef::instance().set(rootNode);
67  ReturnType returnValue(new DDCompactView(rootNode));
68  DDLParser parser(*returnValue);
69  parser.getDDLSAX2FileHandler()->setUserNS(true);
70  parser.clearFiles();
71 
72  std::unique_ptr<std::vector<unsigned char> > tb = (*gdd).getUncompressedBlob();
73 
74  parser.parse(*tb, tb->size());
75 
76  returnValue->lockdown();
77 
78  return returnValue;
79 }
80 
ESTransientHandle< ProductT > getTransientHandle(ESGetToken< ProductT, DepRecordT > const &iToken) const
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:163
edm::ESGetToken< FileBlob, MFGeometryFileRcd > geomToken_
uint32_t cc[maxCellsPerHit]
Definition: gpuFishbone.h:49
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 &)
Definition: ESProducer.cc:117
static value_type & instance()
static const std::string kDDGeometry
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
Definition: DDLogicalPart.h:93
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:61
DDLParser is the main class of Detector Description Language Parser.
Definition: DDLParser.h:63
ReturnType produce(const IdealMagneticFieldRecord &)