CMS 3D CMS Logo

DumpFWTGeoRecoGeometry.cc
Go to the documentation of this file.
8 
9 #include "TGeoManager.h"
10 #include "TFile.h"
11 #include "TTree.h"
12 #include "TError.h"
13 #include "TSystem.h"
14 
16 public:
18  ~DumpFWTGeoRecoGeometry(void) override {}
19 
20 private:
21  void analyze(const edm::Event& event, const edm::EventSetup& eventSetup) override;
22  void beginJob(void) override;
23  void endJob(void) override;
24 
28 };
29 
31  : m_tag(config.getUntrackedParameter<std::string>("tagInfo", "unknown")),
32  m_outputFileName(config.getUntrackedParameter<std::string>("outputFileName", "cmsTGeoReco.root")),
33  m_geomToken(esConsumes()) {}
34 
36  using namespace edm;
37 
39  TGeoManager* geom = geoh.product()->manager(); //const_cast<TGeoManager*>( geoh.product()->manager());
40 
41  TFile file(m_outputFileName.c_str(), "RECREATE");
42  file.WriteTObject(&*geom);
43  file.WriteTObject(new TNamed("CMSSW_VERSION", gSystem->Getenv("CMSSW_VERSION")));
44  file.WriteTObject(new TNamed("tag", m_tag.c_str()));
45  file.Close();
46 }
47 
49 
51 
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
void beginJob(void) override
Definition: config.py:1
DumpFWTGeoRecoGeometry(const edm::ParameterSet &config)
~DumpFWTGeoRecoGeometry(void) override
T const * product() const
const edm::ESGetToken< FWTGeoRecoGeometry, FWTGeoRecoGeometryRecord > m_geomToken
HLT enums.
void analyze(const edm::Event &event, const edm::EventSetup &eventSetup) override
TGeoManager * manager(void) const
Definition: event.py:1