CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
DDTestDumpFile Class Reference
Inheritance diagram for DDTestDumpFile:

Public Member Functions

void analyze (Event const &iEvent, EventSetup const &) override
 
void beginJob () override
 
 DDTestDumpFile (const ParameterSet &)
 
void endJob () override
 

Private Attributes

const ESInputTag m_label
 
const string m_outputFileName
 
const string m_tag
 

Detailed Description

Definition at line 23 of file DDTestDumpFile.cc.

Constructor & Destructor Documentation

DDTestDumpFile::DDTestDumpFile ( const ParameterSet iConfig)
explicit

Definition at line 37 of file DDTestDumpFile.cc.

38  : m_tag(iConfig.getUntrackedParameter<string>("tag", "unknown")),
39  m_outputFileName(iConfig.getUntrackedParameter<string>("outputFileName", "cmsDD4HepGeom.root")),
40  m_label(iConfig.getParameter<ESInputTag>("DDDetector"))
41 {}
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
const string m_tag
const ESInputTag m_label
const string m_outputFileName

Member Function Documentation

void DDTestDumpFile::analyze ( Event const &  iEvent,
EventSetup const &   
)
override

Definition at line 44 of file DDTestDumpFile.cc.

References DEFINE_FWK_MODULE, cms::DDDetector::description(), FrontierConditions_GlobalTag_cff::file, relativeConstraints::geom, edm::EventSetup::get(), hcalDigis_cfi::level, m_label, m_outputFileName, m_tag, and edm::ESInputTag::module().

45 {
46  LogVerbatim("Geometry") << "DDTestDumpFile::analyze: " << m_label;
48  iEventSetup.get<GeometryFileRcd>().get(m_label.module(), det);
49 
50  TGeoManager& geom = det->description()->manager();
51 
52  int level = 1 + geom.GetTopVolume()->CountNodes( 100, 3 );
53 
54  LogVerbatim("Geometry") << "In the DDTestDumpFile::analyze method...obtained main geometry, level="
55  << level;
56 
57  TFile file(m_outputFileName.c_str(), "RECREATE");
58  file.WriteTObject(&geom );
59  file.WriteTObject(new TNamed("CMSSW_VERSION", gSystem->Getenv("CMSSW_VERSION")));
60  file.WriteTObject(new TNamed("tag", m_tag.c_str()));
61  file.Close();
62 }
const string m_tag
const ESInputTag m_label
const string m_outputFileName
const std::string & module() const
Definition: ESInputTag.h:99
Detector const * description() const
Definition: DDDetector.h:24
void DDTestDumpFile::beginJob ( void  )
inlineoverride

Definition at line 27 of file DDTestDumpFile.cc.

References analyze(), and iEvent.

27 {}
void DDTestDumpFile::endJob ( void  )
inlineoverride

Definition at line 29 of file DDTestDumpFile.cc.

29 {}

Member Data Documentation

const ESInputTag DDTestDumpFile::m_label
private

Definition at line 34 of file DDTestDumpFile.cc.

Referenced by analyze().

const string DDTestDumpFile::m_outputFileName
private

Definition at line 33 of file DDTestDumpFile.cc.

Referenced by analyze().

const string DDTestDumpFile::m_tag
private

Definition at line 32 of file DDTestDumpFile.cc.

Referenced by analyze().