CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
void beginJob(void) override
DumpFWTGeoRecoGeometry(const edm::ParameterSet &config)
~DumpFWTGeoRecoGeometry(void) override
const edm::ESGetToken< FWTGeoRecoGeometry, FWTGeoRecoGeometryRecord > m_geomToken
tuple config
parse the configuration file
ESTransientHandle< T > getTransientHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:162
void analyze(const edm::Event &event, const edm::EventSetup &eventSetup) override
ESGetTokenH3DDVariant esConsumes(std::string const &Reccord, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283