Main Page
Namespaces
Classes
Package Documentation
GIT Directory
WorkBook
Offline Guide
Release schedule
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
src
Fireworks
Geometry
plugins
DumpSimGeometry.cc
Go to the documentation of this file.
1
// -*- C++ -*-
2
//
3
// Package: DumpSimGeometry
4
// Class: DumpSimGeometry
5
//
13
//
14
// Original Author: Chris D Jones
15
// Created: Wed Sep 26 08:27:23 EDT 2007
16
//
17
//
18
19
// system include files
20
#include <memory>
21
#include <iostream>
22
23
// user include files
24
#include "
FWCore/Framework/interface/Frameworkfwd.h
"
25
#include "
FWCore/Framework/interface/EDAnalyzer.h
"
26
27
#include "
FWCore/Framework/interface/Event.h
"
28
#include "
FWCore/Framework/interface/MakerMacros.h
"
29
30
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
31
32
#include "
FWCore/Framework/interface/ESHandle.h
"
33
#include "
FWCore/Framework/interface/EventSetup.h
"
34
#include "
FWCore/Framework/interface/ESTransientHandle.h
"
35
36
#include "
Fireworks/Geometry/interface/DisplayGeomRecord.h
"
37
38
#include "TGeoManager.h"
39
#include "TGeoMatrix.h"
40
41
#include "TFile.h"
42
#include "TError.h"
43
44
//
45
// class declaration
46
//
47
48
class
DumpSimGeometry
:
public
edm::EDAnalyzer
49
{
50
public
:
51
explicit
DumpSimGeometry
(
const
edm::ParameterSet
&);
52
~DumpSimGeometry
();
53
54
private
:
55
// virtual void beginJob();
56
// virtual void endJob();
57
58
virtual
void
analyze
(
const
edm::Event
&,
const
edm::EventSetup
&)
override
;
59
};
60
61
62
//
63
// constructors and destructor
64
//
65
DumpSimGeometry::DumpSimGeometry
(
const
edm::ParameterSet
&)
66
{
67
// now do what ever initialization is needed
68
}
69
70
71
DumpSimGeometry::~DumpSimGeometry
()
72
{
73
// do anything here that needs to be done at desctruction time
74
// (e.g. close files, deallocate resources etc.)
75
}
76
77
78
// ------------ method called to for each event ------------
79
void
80
DumpSimGeometry::analyze
(
const
edm::Event
&
iEvent
,
const
edm::EventSetup
& iSetup)
81
{
82
std::cout
<<
"In the DumpSimGeometry::analyze method..."
<< std::endl;
83
using namespace
edm;
84
85
ESTransientHandle<TGeoManager>
geoh;
86
iSetup.
get
<
DisplayGeomRecord
>().
get
(geoh);
87
const
TGeoManager *
geom
= geoh.product();
// const_cast<TGeoManager*>(geoh.product());
88
89
int
level
= 1 +
geom
->GetTopVolume()->CountNodes(100, 3);
90
91
std::cout
<<
"In the DumpSimGeometry::analyze method...obtained main geometry, level="
92
<<
level
<< std::endl;
93
94
TFile
f
(TString::Format(
"cmsSimGeom-%d.root"
,
level
),
"RECREATE"
);
95
f.WriteTObject(
geom
);
96
f.Close();
97
}
98
99
//define this as a plug-in
100
DEFINE_FWK_MODULE
(
DumpSimGeometry
);
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition:
MakerMacros.h:17
Event.h
MakerMacros.h
EventSetup.h
DumpSimGeometry
Definition:
DumpSimGeometry.cc:48
Frameworkfwd.h
ParameterSet.h
DumpSimGeometry::~DumpSimGeometry
~DumpSimGeometry()
Definition:
DumpSimGeometry.cc:71
iEvent
int iEvent
Definition:
GenABIO.cc:243
relativeConstraints.geom
list geom
Definition:
relativeConstraints.py:71
ESHandle.h
f
double f[11][100]
Definition:
MuScleFitUtils.cc:77
edm::EventSetup
Definition:
EventSetup.h:44
edm::EDAnalyzer
Definition:
EDAnalyzer.h:22
EDAnalyzer.h
DisplayGeomRecord
Definition:
DisplayGeomRecord.h:24
edm::EventSetup::get
const T & get() const
Definition:
EventSetup.h:55
DumpSimGeometry::analyze
virtual void analyze(const edm::Event &, const edm::EventSetup &) override
Definition:
DumpSimGeometry.cc:80
ESTransientHandle.h
edm::ParameterSet
Definition:
ParameterSet.h:35
edm::ESTransientHandle
Definition:
ESTransientHandle.h:39
gather_cfg.cout
tuple cout
Definition:
gather_cfg.py:121
testEve_cfg.level
tuple level
Definition:
testEve_cfg.py:34
DumpSimGeometry::DumpSimGeometry
DumpSimGeometry(const edm::ParameterSet &)
Definition:
DumpSimGeometry.cc:65
edm::Event
Definition:
Event.h:62
DisplayGeomRecord.h
Generated for CMSSW Reference Manual by
1.8.5