Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
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
// $Id: DumpSimGeometry.cc,v 1.2 2010/08/24 16:49:50 matevz Exp $
17
//
18
//
19
20
// system include files
21
#include <memory>
22
#include <iostream>
23
24
// user include files
25
#include "
FWCore/Framework/interface/Frameworkfwd.h
"
26
#include "
FWCore/Framework/interface/EDAnalyzer.h
"
27
28
#include "
FWCore/Framework/interface/Event.h
"
29
#include "
FWCore/Framework/interface/MakerMacros.h
"
30
31
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
32
33
#include "
FWCore/Framework/interface/ESHandle.h
"
34
#include "
FWCore/Framework/interface/EventSetup.h
"
35
#include "
FWCore/Framework/interface/ESTransientHandle.h
"
36
37
#include "
Fireworks/Geometry/interface/DisplayGeomRecord.h
"
38
39
#include "TGeoManager.h"
40
#include "TGeoMatrix.h"
41
42
#include "TFile.h"
43
#include "TError.h"
44
45
//
46
// class declaration
47
//
48
49
class
DumpSimGeometry
:
public
edm::EDAnalyzer
50
{
51
public
:
52
explicit
DumpSimGeometry
(
const
edm::ParameterSet
&);
53
~DumpSimGeometry
();
54
55
private
:
56
// virtual void beginJob();
57
// virtual void endJob();
58
59
virtual
void
analyze
(
const
edm::Event
&,
const
edm::EventSetup
&);
60
};
61
62
63
//
64
// constructors and destructor
65
//
66
DumpSimGeometry::DumpSimGeometry
(
const
edm::ParameterSet
&)
67
{
68
// now do what ever initialization is needed
69
}
70
71
72
DumpSimGeometry::~DumpSimGeometry
()
73
{
74
// do anything here that needs to be done at desctruction time
75
// (e.g. close files, deallocate resources etc.)
76
}
77
78
79
// ------------ method called to for each event ------------
80
void
81
DumpSimGeometry::analyze
(
const
edm::Event
&
iEvent
,
const
edm::EventSetup
& iSetup)
82
{
83
std::cout
<<
"In the DumpSimGeometry::analyze method..."
<< std::endl;
84
using namespace
edm;
85
86
ESTransientHandle<TGeoManager>
geoh;
87
iSetup.
get
<
DisplayGeomRecord
>().
get
(geoh);
88
TGeoManager *
geom
=
const_cast<
TGeoManager*
>
(geoh.product());
89
90
int
level
= 1 +
geom
->GetTopVolume()->CountNodes(100, 3);
91
92
std::cout
<<
"In the DumpSimGeometry::analyze method...obtained main geometry, level="
93
<<
level
<< std::endl;
94
95
TFile
f
(TString::Format(
"cmsSimGeom-%d.root"
,
level
),
"RECREATE"
);
96
f.WriteTObject(
geom
);
97
f.Close();
98
}
99
100
//define this as a plug-in
101
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:49
Frameworkfwd.h
ParameterSet.h
DumpSimGeometry::~DumpSimGeometry
~DumpSimGeometry()
Definition:
DumpSimGeometry.cc:72
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:80
edm::EventSetup
Definition:
EventSetup.h:44
DumpSimGeometry::analyze
virtual void analyze(const edm::Event &, const edm::EventSetup &)
Definition:
DumpSimGeometry.cc:81
edm::EDAnalyzer
Definition:
EDAnalyzer.h:14
EDAnalyzer.h
DisplayGeomRecord
Definition:
DisplayGeomRecord.h:25
edm::EventSetup::get
const T & get() const
Definition:
EventSetup.h:55
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:66
edm::Event
Definition:
Event.h:50
DisplayGeomRecord.h
Generated for CMSSW Reference Manual by
1.8.5