CMS 3D CMS Logo

edm::XMLOutputModule Class Reference

#include <FWCore/Modules/src/XMLOutputModule.h>

Inheritance diagram for edm::XMLOutputModule:

edm::OutputModule

List of all members.

Public Member Functions

 XMLOutputModule (edm::ParameterSet const &)
virtual ~XMLOutputModule ()

Private Member Functions

const XMLOutputModuleoperator= (XMLOutputModule const &)
virtual void write (EventPrincipal const &e)
virtual void writeLuminosityBlock (LuminosityBlockPrincipal const &)
virtual void writeRun (RunPrincipal const &)
 XMLOutputModule (XMLOutputModule const &)

Private Attributes

std::string indentation_
std::ofstream stream_


Detailed Description

Definition at line 33 of file XMLOutputModule.h.


Constructor & Destructor Documentation

XMLOutputModule::XMLOutputModule ( edm::ParameterSet const &  iPSet  ) 

Definition at line 416 of file XMLOutputModule.cc.

References edm::errors::Configuration, lat::endl(), edm::ParameterSet::getUntrackedParameter(), and stream_.

00416                                                           :
00417 OutputModule(iPSet),
00418 stream_(iPSet.getUntrackedParameter<std::string>("fileName").c_str()),
00419 indentation_("  ")
00420 {
00421   if(!stream_){
00422     throw edm::Exception(errors::Configuration)<<"failed to open file "<<iPSet.getUntrackedParameter<std::string>("fileName");
00423   }
00424   stream_<<"<cmsdata>"<<std::endl;
00425 }

XMLOutputModule::~XMLOutputModule (  )  [virtual]

Definition at line 432 of file XMLOutputModule.cc.

References lat::endl(), and stream_.

00433 {
00434   stream_<<"</cmsdata>"<<std::endl;
00435 }

edm::XMLOutputModule::XMLOutputModule ( XMLOutputModule const &   )  [private]


Member Function Documentation

const XMLOutputModule& edm::XMLOutputModule::operator= ( XMLOutputModule const &   )  [private]

void XMLOutputModule::write ( EventPrincipal const &  e  )  [private, virtual]

Implements edm::OutputModule.

Definition at line 453 of file XMLOutputModule.cc.

References begin, end, lat::endl(), edm::event, indentation_, edm::InEvent, edm::OutputModule::keptProducts(), printObject(), and stream_.

00454 {
00455   ModuleDescription desc;
00456   edm::Event event(const_cast<EventPrincipal&>(iEP),desc);
00457   stream_ <<"<event run=\""<< event.id().run()<< "\" number=\""<< event.id().event()<<"\" >\n";
00458   std::string startIndent = indentation_;
00459   for(Selections::const_iterator itBD = keptProducts()[InEvent].begin(), itBDEnd = keptProducts()[InEvent].end();
00460       itBD != itBDEnd;
00461       ++itBD) {
00462     stream_<<"<product type=\""<<(*itBD)->friendlyClassName()
00463            <<"\" module=\""<<(*itBD)->moduleLabel()
00464     <<"\" productInstance=\""<<(*itBD)->productInstanceName()<<"\">\n";
00465     printObject(stream_,
00466                  event,
00467                 (*itBD)->className(),
00468                 (*itBD)->moduleLabel(),
00469                 (*itBD)->productInstanceName(),
00470                 startIndent,
00471                 indentation_);
00472     stream_<<"</product>\n";
00473   }
00474   stream_<<"</event>"<<std::endl;
00475 }

virtual void edm::XMLOutputModule::writeLuminosityBlock ( LuminosityBlockPrincipal const &   )  [inline, private, virtual]

Implements edm::OutputModule.

Definition at line 47 of file XMLOutputModule.h.

00047 {}

virtual void edm::XMLOutputModule::writeRun ( RunPrincipal const &   )  [inline, private, virtual]

Implements edm::OutputModule.

Definition at line 48 of file XMLOutputModule.h.

00048 {}


Member Data Documentation

std::string edm::XMLOutputModule::indentation_ [private]

Definition at line 56 of file XMLOutputModule.h.

Referenced by write().

std::ofstream edm::XMLOutputModule::stream_ [private]

Definition at line 55 of file XMLOutputModule.h.

Referenced by write(), XMLOutputModule(), and ~XMLOutputModule().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:44:49 2009 for CMSSW by  doxygen 1.5.4