#include <FWCore/Modules/src/XMLOutputModule.h>
Public Member Functions | |
XMLOutputModule (edm::ParameterSet const &) | |
virtual | ~XMLOutputModule () |
Private Member Functions | |
const XMLOutputModule & | operator= (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_ |
Definition at line 33 of file XMLOutputModule.h.
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] |
edm::XMLOutputModule::XMLOutputModule | ( | XMLOutputModule const & | ) | [private] |
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] |
virtual void edm::XMLOutputModule::writeRun | ( | RunPrincipal const & | ) | [inline, private, virtual] |
std::string edm::XMLOutputModule::indentation_ [private] |
std::ofstream edm::XMLOutputModule::stream_ [private] |
Definition at line 55 of file XMLOutputModule.h.
Referenced by write(), XMLOutputModule(), and ~XMLOutputModule().