Fireworks
Geometry
plugins
DumpFWTGeoRecoGeometry.cc
Go to the documentation of this file.
1
#include "
FWCore/Framework/interface/EDAnalyzer.h
"
2
#include "
FWCore/Framework/interface/MakerMacros.h
"
3
#include "
FWCore/Framework/interface/ESTransientHandle.h
"
4
#include "
FWCore/Framework/interface/ESHandle.h
"
5
#include "
FWCore/Framework/interface/EventSetup.h
"
6
#include "
Fireworks/Geometry/interface/FWTGeoRecoGeometry.h
"
7
#include "
Fireworks/Geometry/interface/FWTGeoRecoGeometryRecord.h
"
8
9
#include "TGeoManager.h"
10
#include "TFile.h"
11
#include "TTree.h"
12
#include "TError.h"
13
#include "TSystem.h"
14
15
class
DumpFWTGeoRecoGeometry
:
public
edm::EDAnalyzer
{
16
public
:
17
explicit
DumpFWTGeoRecoGeometry
(
const
edm::ParameterSet
&
config
);
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
25
std::string
m_tag
;
26
std::string
m_outputFileName
;
27
};
28
29
DumpFWTGeoRecoGeometry::DumpFWTGeoRecoGeometry
(
const
edm::ParameterSet
&
config
)
30
: m_tag(
config
.getUntrackedParameter<
std
::
string
>(
"tagInfo"
,
"unknown"
)),
31
m_outputFileName(
config
.getUntrackedParameter<
std
::
string
>(
"outputFileName"
,
"cmsTGeoReco.root"
))
32
33
{}
34
35
void
DumpFWTGeoRecoGeometry::analyze
(
const
edm::Event
&
event
,
const
edm::EventSetup
& eventSetup) {
36
using namespace
edm
;
37
38
ESTransientHandle<FWTGeoRecoGeometry>
geoh;
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
49
void
DumpFWTGeoRecoGeometry::beginJob
(
void
) {}
50
51
void
DumpFWTGeoRecoGeometry::endJob
(
void
) {}
52
53
DEFINE_FWK_MODULE
(
DumpFWTGeoRecoGeometry
);
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
Generated for CMSSW Reference Manual by
1.8.16