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)
 
static void prevalidate (ConfigurationDescriptions &)
 

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
 
void doBeginJob ()
 
bool doBeginLuminosityBlock (LuminosityBlockPrincipal const &lbp, EventSetup const &c, CurrentProcessingContext const *cpc)
 
bool doBeginRun (RunPrincipal const &rp, EventSetup const &c, CurrentProcessingContext const *cpc)
 
void doEndJob ()
 
bool doEndLuminosityBlock (LuminosityBlockPrincipal const &lbp, EventSetup const &c, CurrentProcessingContext const *cpc)
 
bool doEndRun (RunPrincipal const &rp, EventSetup const &c, CurrentProcessingContext const *cpc)
 
bool doEvent (EventPrincipal const &ep, EventSetup const &c, CurrentProcessingContext const *cpc)
 
Trig getTriggerResults (Event const &ep) const
 
Trig getTriggerResults (EventPrincipal const &ep) const
 
ParameterSetID selectorConfig () const
 
void setEventSelectionInfo (std::map< std::string, std::vector< std::pair< std::string, int > > > const &outputModulePathPositions, bool anyProductProduced)
 

Detailed Description

Definition at line 44 of file XMLOutputModule.cc.

Constructor & Destructor Documentation

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

Definition at line 501 of file XMLOutputModule.cc.

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

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

Definition at line 516 of file XMLOutputModule.cc.

References stream_.

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

Member Function Documentation

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

Definition at line 560 of file XMLOutputModule.cc.

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

560  {
562  desc.setComment("Prints event information into a file in XML format.");
563  desc.addUntracked<std::string>("fileName");
565  descriptions.add("XMLoutput", desc);
566  }
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 536 of file XMLOutputModule.cc.

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

536  {
537  ModuleDescription desc;
538  Event event(const_cast<EventPrincipal&>(iEP), desc);
539  stream_ << "<event run=\"" << event.id().run() << "\" number=\"" << event.id().event() << "\" >\n";
540  std::string startIndent = indentation_;
541  for(Selections::const_iterator itBD = keptProducts()[InEvent].begin(), itBDEnd = keptProducts()[InEvent].end();
542  itBD != itBDEnd;
543  ++itBD) {
544  stream_ << "<product type=\"" << (*itBD)->friendlyClassName()
545  << "\" module=\"" << (*itBD)->moduleLabel()
546  << "\" productInstance=\"" << (*itBD)->productInstanceName() << "\">\n";
547  printObject(stream_,
548  event,
549  (*itBD)->className(),
550  (*itBD)->moduleLabel(),
551  (*itBD)->productInstanceName(),
552  startIndent,
553  indentation_);
554  stream_ << "</product>\n";
555  }
556  stream_ << "</event>" << std::endl;
557  }
SelectionsArray const & keptProducts() const
Definition: OutputModule.h:56
#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().