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 
39  eventSetup.get<FWTGeoRecoGeometryRecord>().get(geoh);
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:28
FWTGeoRecoGeometryRecord
Definition: FWTGeoRecoGeometryRecord.h:9
config
Definition: config.py:1
MakerMacros.h
edm::EventSetup::get
T get() const
Definition: EventSetup.h:87
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
relativeConstraints.geom
geom
Definition: relativeConstraints.py:72
geometryDiff.file
file
Definition: geometryDiff.py:13
edm::ParameterSet
Definition: ParameterSet.h:47
edm::EventSetup
Definition: EventSetup.h:58
get
#define get
DumpFWTGeoRecoGeometry::endJob
void endJob(void) override
Definition: DumpFWTGeoRecoGeometry.cc:51
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ESTransientHandle
Definition: ESTransientHandle.h:41
std
Definition: JetResolutionObject.h:76
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