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 edm::EDConsumerBase

Public Member Functions

 AsciiOutputModule (ParameterSet const &pset)
 
virtual ~AsciiOutputModule ()
 
- Public Member Functions inherited from edm::OutputModule
BranchChildren const & branchChildren () const
 
BranchIDLists const * branchIDLists () const
 
std::array< bool,
NumBranchTypes > const & 
hasNewlyDroppedBranch () const
 
SelectedProductsForBranchType
const & 
keptProducts () const
 
int maxEvents () const
 
OutputModuleoperator= (OutputModule const &)=delete
 
 OutputModule (ParameterSet const &pset)
 
 OutputModule (OutputModule const &)=delete
 
std::string const & processName () const
 
int remainingEvents () const
 
bool selected (BranchDescription const &desc) const
 
void selectProducts (ProductRegistry const &preg)
 
bool wantAllEvents () const
 
virtual ~OutputModule ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

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, ModuleCallingContext const *) override
 
virtual void writeLuminosityBlock (LuminosityBlockPrincipal const &, ModuleCallingContext const *) override
 
virtual void writeRun (RunPrincipal const &, ModuleCallingContext const *) override
 

Private Attributes

int counter_
 
int prescale_
 
int verbosity_
 

Additional Inherited Members

- Public Types inherited from edm::OutputModule
typedef OutputModule ModuleType
 
- Protected Member Functions inherited from edm::OutputModule
void configure (OutputModuleDescription const &desc)
 
ModuleDescription const & description () const
 
void doBeginJob ()
 
bool doBeginLuminosityBlock (LuminosityBlockPrincipal const &lbp, EventSetup const &c, ModuleCallingContext const *mcc)
 
bool doBeginRun (RunPrincipal const &rp, EventSetup const &c, ModuleCallingContext const *mcc)
 
void doEndJob ()
 
bool doEndLuminosityBlock (LuminosityBlockPrincipal const &lbp, EventSetup const &c, ModuleCallingContext const *mcc)
 
bool doEndRun (RunPrincipal const &rp, EventSetup const &c, ModuleCallingContext const *mcc)
 
bool doEvent (EventPrincipal const &ep, EventSetup const &c, ActivityRegistry *act, ModuleCallingContext const *mcc)
 
void doPreallocate (PreallocationConfiguration const &)
 
std::map< BranchID::value_type,
BranchID::value_type > const & 
droppedBranchIDToKeptBranchID ()
 
Trig getTriggerResults (EventPrincipal const &ep, ModuleCallingContext const *) const
 
ModuleDescription const & moduleDescription () const
 
ParameterSetID selectorConfig () const
 
void setEventSelectionInfo (std::map< std::string, std::vector< std::pair< std::string, int > > > const &outputModulePathPositions, bool anyProductProduced)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 22 of file AsciiOutputModule.cc.

Constructor & Destructor Documentation

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

Definition at line 38 of file AsciiOutputModule.cc.

References prescale_.

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

Definition at line 46 of file AsciiOutputModule.cc.

References counter_.

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

Member Function Documentation

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

Definition at line 87 of file AsciiOutputModule.cc.

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

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

Implements edm::OutputModule.

Definition at line 51 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_.

Referenced by pkg.AbstractPkg::generate().

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

Implements edm::OutputModule.

Definition at line 31 of file AsciiOutputModule.cc.

31 {}
virtual void edm::AsciiOutputModule::writeRun ( RunPrincipal const &  ,
ModuleCallingContext const *   
)
inlineoverrideprivatevirtual

Implements edm::OutputModule.

Definition at line 32 of file AsciiOutputModule.cc.

32 {}

Member Data Documentation

int edm::AsciiOutputModule::counter_
private

Definition at line 35 of file AsciiOutputModule.cc.

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

int edm::AsciiOutputModule::prescale_
private

Definition at line 33 of file AsciiOutputModule.cc.

Referenced by AsciiOutputModule(), and write().

int edm::AsciiOutputModule::verbosity_
private

Definition at line 34 of file AsciiOutputModule.cc.

Referenced by write().