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 {
17 public:
19  ~DumpFWTGeoRecoGeometry( void ) override {}
20 
21 private:
22  void analyze( const edm::Event& event, const edm::EventSetup& eventSetup ) override;
23  void beginJob( void ) override;
24  void endJob( void ) override;
25 
28 };
29 
31  :m_tag( config.getUntrackedParameter<std::string>( "tagInfo", "unknown" )),
32  m_outputFileName( config.getUntrackedParameter<std::string>( "outputFileName", "cmsTGeoReco.root" ))
33 
34 {}
35 
36 void
38 {
39  using namespace edm;
40 
42  eventSetup.get<FWTGeoRecoGeometryRecord>().get( geoh );
43  TGeoManager *geom = geoh.product()->manager();//const_cast<TGeoManager*>( geoh.product()->manager());
44 
45  TFile file( m_outputFileName.c_str(), "RECREATE" );
46  file.WriteTObject( &*geom );
47  file.WriteTObject(new TNamed("CMSSW_VERSION", gSystem->Getenv( "CMSSW_VERSION" )));
48  file.WriteTObject(new TNamed("tag", m_tag.c_str()));
49  file.Close();
50 }
51 
52 void
54 {}
55 
56 void
58 {}
59 
void beginJob(void) override
Definition: config.py:1
TGeoManager * manager(void) const
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
DumpFWTGeoRecoGeometry(const edm::ParameterSet &config)
~DumpFWTGeoRecoGeometry(void) override
T const * product() const
HLT enums.
T get() const
Definition: EventSetup.h:71
void analyze(const edm::Event &event, const edm::EventSetup &eventSetup) override
Definition: event.py:1