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::AsciiOutputModule Class Reference
Inheritance diagram for edm::AsciiOutputModule:
edm::OutputModule

Public Member Functions

 AsciiOutputModule (ParameterSet const &pset)
 
virtual ~AsciiOutputModule ()
 
- 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

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

Private Attributes

int counter_
 
int prescale_
 
int verbosity_
 

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 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_.

35  :
36  OutputModule(pset),
37  prescale_(pset.getUntrackedParameter<unsigned int>("prescale")),
38  verbosity_(pset.getUntrackedParameter<unsigned int>("verbosity")),
39  counter_(0) {
40  if (prescale_ == 0) prescale_ = 1;
41  }
OutputModule(ParameterSet const &pset)
edm::AsciiOutputModule::~AsciiOutputModule ( )
virtual

Definition at line 43 of file AsciiOutputModule.cc.

References counter_.

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

Member Function Documentation

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

Definition at line 84 of file AsciiOutputModule.cc.

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

84  {
86  desc.setComment("Outputs event information into text file.");
87  desc.addUntracked("prescale", 1U)
88  ->setComment("prescale factor");
89  desc.addUntracked("verbosity", 1U)
90  ->setComment("0: no output\n"
91  "1: event ID and timestamp only\n"
92  ">1: full output");
94  descriptions.add("asciiOutput", desc);
95  }
static void fillDescription(ParameterSetDescription &desc)
void edm::AsciiOutputModule::write ( EventPrincipal const &  e)
privatevirtual

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_.

48  {
49 
50  if ((++counter_ % prescale_) != 0 || verbosity_ <= 0) return;
51 
52  // Run const& run = evt.getRun(); // this is still unused
53  LogAbsolute("AsciiOut")<< ">>> processing event # " << e.id() << " time " << e.time().value() << std::endl;
54 
55  if (verbosity_ <= 1) return;
56 
57  // Write out non-EDProduct contents...
58 
59  // ... list of process-names
60  for (ProcessHistory::const_iterator it = e.processHistory().begin(), itEnd = e.processHistory().end();
61  it != itEnd; ++it) {
62  LogAbsolute("AsciiOut") << it->processName() << " ";
63  }
64 
65  // ... collision id
66  LogAbsolute("AsciiOut") << '\n' << e.id() << '\n';
67 
68  // Loop over products, and write some output for each...
69 
70  std::vector<Provenance const*> provs;
71  e.getAllProvenance(provs);
72  for(std::vector<Provenance const*>::const_iterator i = provs.begin(),
73  iEnd = provs.end();
74  i != iEnd;
75  ++i) {
76  BranchDescription const& desc = (*i)->product();
77  if (selected(desc)) {
78  LogAbsolute("AsciiOut") << **i << '\n';
79  }
80  }
81  }
collection_type::const_iterator const_iterator
int i
Definition: DBlmapReader.cc:9
bool selected(BranchDescription const &desc) const
virtual void edm::AsciiOutputModule::writeLuminosityBlock ( LuminosityBlockPrincipal const &  )
inlineprivatevirtual

Implements edm::OutputModule.

Definition at line 28 of file AsciiOutputModule.cc.

28 {}
virtual void edm::AsciiOutputModule::writeRun ( RunPrincipal const &  )
inlineprivatevirtual

Implements edm::OutputModule.

Definition at line 29 of file AsciiOutputModule.cc.

29 {}

Member Data Documentation

int edm::AsciiOutputModule::counter_
private

Definition at line 32 of file AsciiOutputModule.cc.

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

int edm::AsciiOutputModule::prescale_
private

Definition at line 30 of file AsciiOutputModule.cc.

Referenced by AsciiOutputModule(), and write().

int edm::AsciiOutputModule::verbosity_
private

Definition at line 31 of file AsciiOutputModule.cc.

Referenced by write().