CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
edm::XMLOutputModule Class Reference
Inheritance diagram for edm::XMLOutputModule:
edm::OutputModule

Public Member Functions

 XMLOutputModule (ParameterSet const &)
 
virtual ~XMLOutputModule ()
 
- Public Member Functions inherited from edm::OutputModule
BranchChildren const & branchChildren () const
 
boost::array< bool,
NumBranchTypes > const & 
hasNewlyDroppedBranch () const
 
SelectionsArray const & keptProducts () const
 
int maxEvents () const
 
 OutputModule (ParameterSet const &pset)
 
std::string const & processName () const
 
int remainingEvents () const
 
bool selected (BranchDescription const &desc) const
 
void selectProducts ()
 
bool wantAllEvents () const
 
virtual ~OutputModule ()
 

Static Public Member Functions

static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::OutputModule
static const std::string & baseType ()
 
static void fillDescription (ParameterSetDescription &desc)
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 

Private Member Functions

XMLOutputModule const & 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_
 

Additional Inherited Members

- Public Types inherited from edm::OutputModule
typedef OutputModule ModuleType
 
typedef OutputWorker WorkerType
 
- Protected Member Functions inherited from edm::OutputModule
CurrentProcessingContext const * currentContext () const
 
ModuleDescription const & description () const
 
Trig getTriggerResults (Event const &ep) const
 
Trig getTriggerResults (EventPrincipal const &ep) const
 
ParameterSetID selectorConfig () const
 

Detailed Description

Definition at line 44 of file XMLOutputModule.cc.

Constructor & Destructor Documentation

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

Definition at line 500 of file XMLOutputModule.cc.

References edm::errors::Configuration, edm::hlt::Exception, edm::ParameterSet::getUntrackedParameter(), and stream_.

500  :
501  OutputModule(iPSet),
502  stream_(iPSet.getUntrackedParameter<std::string>("fileName").c_str()),
503  indentation_(" ") {
504  if(!stream_){
505  throw edm::Exception(errors::Configuration) << "failed to open file " << iPSet.getUntrackedParameter<std::string>("fileName");
506  }
507  stream_ << "<cmsdata>" << std::endl;
508  }
OutputModule(ParameterSet const &pset)
edm::XMLOutputModule::~XMLOutputModule ( )
virtual

Definition at line 515 of file XMLOutputModule.cc.

References stream_.

515  {
516  stream_ << "</cmsdata>" << std::endl;
517  }
edm::XMLOutputModule::XMLOutputModule ( XMLOutputModule const &  )
private

Member Function Documentation

void edm::XMLOutputModule::fillDescriptions ( ConfigurationDescriptions descriptions)
static

Definition at line 559 of file XMLOutputModule.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::addUntracked(), edm::OutputModule::fillDescription(), and edm::ParameterSetDescription::setComment().

559  {
561  desc.setComment("Prints event information into a file in XML format.");
562  desc.addUntracked<std::string>("fileName");
564  descriptions.add("XMLoutput", desc);
565  }
static void fillDescription(ParameterSetDescription &desc)
XMLOutputModule const& edm::XMLOutputModule::operator= ( XMLOutputModule const &  )
private
void edm::XMLOutputModule::write ( EventPrincipal const &  e)
privatevirtual

Implements edm::OutputModule.

Definition at line 535 of file XMLOutputModule.cc.

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

535  {
536  ModuleDescription desc;
537  Event event(const_cast<EventPrincipal&>(iEP), desc);
538  stream_ << "<event run=\"" << event.id().run() << "\" number=\"" << event.id().event() << "\" >\n";
539  std::string startIndent = indentation_;
540  for(Selections::const_iterator itBD = keptProducts()[InEvent].begin(), itBDEnd = keptProducts()[InEvent].end();
541  itBD != itBDEnd;
542  ++itBD) {
543  stream_ << "<product type=\"" << (*itBD)->friendlyClassName()
544  << "\" module=\"" << (*itBD)->moduleLabel()
545  << "\" productInstance=\"" << (*itBD)->productInstanceName() << "\">\n";
546  printObject(stream_,
547  event,
548  (*itBD)->className(),
549  (*itBD)->moduleLabel(),
550  (*itBD)->productInstanceName(),
551  startIndent,
552  indentation_);
553  stream_ << "</product>\n";
554  }
555  stream_ << "</event>" << std::endl;
556  }
SelectionsArray const & keptProducts() const
Definition: OutputModule.h:57
#define end
Definition: vmac.h:38
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
#define begin
Definition: vmac.h:31
virtual void edm::XMLOutputModule::writeLuminosityBlock ( LuminosityBlockPrincipal const &  )
inlineprivatevirtual

Implements edm::OutputModule.

Definition at line 59 of file XMLOutputModule.cc.

59 {}
virtual void edm::XMLOutputModule::writeRun ( RunPrincipal const &  )
inlineprivatevirtual

Implements edm::OutputModule.

Definition at line 60 of file XMLOutputModule.cc.

60 {}

Member Data Documentation

std::string edm::XMLOutputModule::indentation_
private

Definition at line 68 of file XMLOutputModule.cc.

Referenced by write().

std::ofstream edm::XMLOutputModule::stream_
private

Definition at line 67 of file XMLOutputModule.cc.

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