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 
27 };
28 
30  : m_tag(config.getUntrackedParameter<std::string>("tagInfo", "unknown")),
31  m_outputFileName(config.getUntrackedParameter<std::string>("outputFileName", "cmsTGeoReco.root"))
32 
33 {}
34 
36  using namespace edm;
37 
40  TGeoManager* geom = geoh.product()->manager(); //const_cast<TGeoManager*>( geoh.product()->manager());
41 
42  TFile file(m_outputFileName.c_str(), "RECREATE");
43  file.WriteTObject(&*geom);
44  file.WriteTObject(new TNamed("CMSSW_VERSION", gSystem->Getenv("CMSSW_VERSION")));
45  file.WriteTObject(new TNamed("tag", m_tag.c_str()));
46  file.Close();
47 }
48 
50 
52 
FWTGeoRecoGeometry.h
ESTransientHandle.h
edm::ESTransientHandle::product
T const * product() const
Definition: ESTransientHandle.h:51
ESHandle.h
FWTGeoRecoGeometryRecord.h
FWTGeoRecoGeometry::manager
TGeoManager * manager(void) const
Definition: FWTGeoRecoGeometry.h:47
DumpFWTGeoRecoGeometry::DumpFWTGeoRecoGeometry
DumpFWTGeoRecoGeometry(const edm::ParameterSet &config)
Definition: DumpFWTGeoRecoGeometry.cc:29
edm
HLT enums.
Definition: AlignableModifier.h:19
DumpFWTGeoRecoGeometry::m_outputFileName
std::string m_outputFileName
Definition: DumpFWTGeoRecoGeometry.cc:26
EDAnalyzer.h
DumpFWTGeoRecoGeometry::analyze
void analyze(const edm::Event &event, const edm::EventSetup &eventSetup) override
Definition: DumpFWTGeoRecoGeometry.cc:35
edm::EDAnalyzer
Definition: EDAnalyzer.h:29
FWTGeoRecoGeometryRecord
Definition: FWTGeoRecoGeometryRecord.h:9
config
Definition: config.py:1
MakerMacros.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
relativeConstraints.geom
geom
Definition: relativeConstraints.py:72
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet
Definition: ParameterSet.h:36
FrontierConditions_GlobalTag_cff.file
file
Definition: FrontierConditions_GlobalTag_cff.py:13
edm::EventSetup
Definition: EventSetup.h:57
get
#define get
DumpFWTGeoRecoGeometry::endJob
void endJob(void) override
Definition: DumpFWTGeoRecoGeometry.cc:51
edm::ESTransientHandle
Definition: ESTransientHandle.h:41
std
Definition: JetResolutionObject.h:76
options_cfi.eventSetup
eventSetup
Definition: options_cfi.py:12
EventSetup.h
DumpFWTGeoRecoGeometry
Definition: DumpFWTGeoRecoGeometry.cc:15
DumpFWTGeoRecoGeometry::m_tag
std::string m_tag
Definition: DumpFWTGeoRecoGeometry.cc:25
DumpFWTGeoRecoGeometry::~DumpFWTGeoRecoGeometry
~DumpFWTGeoRecoGeometry(void) override
Definition: DumpFWTGeoRecoGeometry.cc:18
event
Definition: event.py:1
edm::Event
Definition: Event.h:73
DumpFWTGeoRecoGeometry::beginJob
void beginJob(void) override
Definition: DumpFWTGeoRecoGeometry.cc:49