Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-10-25 09:50:16

0001 // -*- C++ -*-
0002 //
0003 // Package:    TestIdealGeometryESProducer
0004 // Class:      TestIdealGeometryESProducer
0005 //
0006 /**\class TestIdealGeometryESProducer TestIdealGeometryESProducer.cc test/TestIdealGeometryESProducer/src/TestIdealGeometryESProducer.cc
0007 
0008  Description: <one line class summary>
0009 
0010  Implementation:
0011      <Notes on implementation>
0012 */
0013 //
0014 // Original Author:  Michael Case
0015 //         Created:  Tue Jan 16 2009
0016 //
0017 //
0018 
0019 #include <memory>
0020 #include <iostream>
0021 #include <fstream>
0022 
0023 #include "FWCore/Framework/interface/Frameworkfwd.h"
0024 #include "FWCore/Framework/interface/one/EDAnalyzer.h"
0025 
0026 #include "FWCore/Framework/interface/Event.h"
0027 #include "FWCore/Framework/interface/EventSetup.h"
0028 #include "FWCore/Framework/interface/ESTransientHandle.h"
0029 #include "FWCore/Framework/interface/MakerMacros.h"
0030 
0031 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0032 #include "DetectorDescription/Core/interface/DDCompactView.h"
0033 #include "DetectorDescription/Core/interface/DDRoot.h"
0034 #include "DetectorDescription/Parser/interface/DDLParser.h"
0035 #include "Geometry/Records/interface/IdealGeometryRecord.h"
0036 #include "DetectorDescription/OfflineDBLoader/interface/GeometryInfoDump.h"
0037 
0038 #include "MagneticField/Records/interface/IdealMagneticFieldRecord.h"
0039 
0040 #include "CondFormats/Common/interface/FileBlob.h"
0041 #include "Geometry/Records/interface/GeometryFileRcd.h"
0042 
0043 class TestIdealGeometryESProducer : public edm::one::EDAnalyzer<> {
0044 public:
0045   explicit TestIdealGeometryESProducer(const edm::ParameterSet&);
0046   ~TestIdealGeometryESProducer() override;
0047 
0048   void beginJob() override {}
0049   void analyze(edm::Event const&, edm::EventSetup const&) override;
0050   void endJob() override {}
0051 
0052 private:
0053   const edm::ESGetToken<DDCompactView, IdealGeometryRecord> ddToken_;
0054 };
0055 
0056 TestIdealGeometryESProducer::TestIdealGeometryESProducer(const edm::ParameterSet& iConfig)
0057     : ddToken_(esConsumes<DDCompactView, IdealGeometryRecord>()) {}
0058 
0059 TestIdealGeometryESProducer::~TestIdealGeometryESProducer() {}
0060 
0061 void TestIdealGeometryESProducer::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) {
0062   using namespace edm;
0063 
0064   std::cout << "Here I am " << std::endl;
0065   edm::ESTransientHandle<DDCompactView> pDD = iSetup.getTransientHandle(ddToken_);
0066 
0067   GeometryInfoDump gidump;
0068   gidump.dumpInfo(true, true, true, *pDD);
0069   std::cout << "finished" << std::endl;
0070 }
0071 
0072 DEFINE_FWK_MODULE(TestIdealGeometryESProducer);