CMS 3D CMS Logo

Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes

edm::AsciiOutputModule Class Reference

Inheritance diagram for edm::AsciiOutputModule:
edm::OutputModule

List of all members.

Public Member Functions

 AsciiOutputModule (ParameterSet const &pset)
virtual ~AsciiOutputModule ()

Static Public Member Functions

static void fillDescriptions (ConfigurationDescriptions &descriptions)

Private Member Functions

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

Private Attributes

int counter_
int prescale_
int verbosity_

Detailed Description

Definition at line 19 of file AsciiOutputModule.cc.


Constructor & Destructor Documentation

edm::AsciiOutputModule::AsciiOutputModule ( ParameterSet const &  pset) [explicit]

Definition at line 35 of file AsciiOutputModule.cc.

References prescale_.

                                                               :
    OutputModule(pset),
    prescale_(pset.getUntrackedParameter<unsigned int>("prescale")),
    verbosity_(pset.getUntrackedParameter<unsigned int>("verbosity")),
    counter_(0) {
     if (prescale_ == 0) prescale_ = 1;
  }
edm::AsciiOutputModule::~AsciiOutputModule ( ) [virtual]

Definition at line 43 of file AsciiOutputModule.cc.

References counter_.

                                        {
    LogAbsolute("AsciiOut") << ">>> processed " << counter_ << " events" << std::endl;
  }

Member Function Documentation

void edm::AsciiOutputModule::fillDescriptions ( ConfigurationDescriptions descriptions) [static]

Reimplemented from edm::OutputModule.

Definition at line 84 of file AsciiOutputModule.cc.

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

                                                                             {
    ParameterSetDescription desc;
    desc.setComment("Outputs event information into text file.");
    desc.addUntracked("prescale", 1U)
        ->setComment("prescale factor");
    desc.addUntracked("verbosity", 1U)
        ->setComment("0: no output\n"
                     "1: event ID and timestamp only\n"
                     ">1: full output");
    OutputModule::fillDescription(desc);
    descriptions.add("asciiOutput", desc);
  }
void edm::AsciiOutputModule::write ( EventPrincipal const &  e) [private, virtual]

Implements edm::OutputModule.

Definition at line 48 of file AsciiOutputModule.cc.

References edm::ProcessHistory::begin(), counter_, edm::ProcessHistory::end(), edm::Principal::getAllProvenance(), i, edm::EventPrincipal::id(), prescale_, edm::Principal::processHistory(), edm::OutputModule::selected(), edm::EventPrincipal::time(), edm::Timestamp::value(), and verbosity_.

                                                  {

    if ((++counter_ % prescale_) != 0 || verbosity_ <= 0) return;

    // Run const& run = evt.getRun(); // this is still unused
    LogAbsolute("AsciiOut")<< ">>> processing event # " << e.id() << " time " << e.time().value() << std::endl;

    if (verbosity_ <= 1) return;

    // Write out non-EDProduct contents...

    // ... list of process-names
    for (ProcessHistory::const_iterator it = e.processHistory().begin(), itEnd = e.processHistory().end();
        it != itEnd; ++it) {
      LogAbsolute("AsciiOut") << it->processName() << " ";
    }

    // ... collision id
    LogAbsolute("AsciiOut") << '\n' << e.id() << '\n';

    // Loop over products, and write some output for each...

    std::vector<Provenance const*> provs;
    e.getAllProvenance(provs);
    for(std::vector<Provenance const*>::const_iterator i = provs.begin(),
         iEnd = provs.end();
         i != iEnd;
         ++i) {
      BranchDescription const& desc = (*i)->product();
      if (selected(desc)) {
        LogAbsolute("AsciiOut") << **i << '\n';
      }
    }
  }
virtual void edm::AsciiOutputModule::writeLuminosityBlock ( LuminosityBlockPrincipal const &  ) [inline, private, virtual]

Implements edm::OutputModule.

Definition at line 28 of file AsciiOutputModule.cc.

{}
virtual void edm::AsciiOutputModule::writeRun ( RunPrincipal const &  ) [inline, private, virtual]

Implements edm::OutputModule.

Definition at line 29 of file AsciiOutputModule.cc.

{}

Member Data Documentation

Definition at line 32 of file AsciiOutputModule.cc.

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

Definition at line 30 of file AsciiOutputModule.cc.

Referenced by AsciiOutputModule(), and write().

Definition at line 31 of file AsciiOutputModule.cc.

Referenced by write().