CMS 3D CMS Logo

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::global::OutputModule<> edm::global::OutputModuleBase edm::EDConsumerBase

Public Member Functions

 AsciiOutputModule (ParameterSet const &pset)
 
 ~AsciiOutputModule () override
 
- Public Member Functions inherited from edm::global::OutputModule<>
 OutputModule (edm::ParameterSet const &iPSet)
 
bool wantsStreamLuminosityBlocks () const final
 
bool wantsStreamRuns () const final
 
- Public Member Functions inherited from edm::global::OutputModuleBase
BranchIDLists const * branchIDLists () const
 
std::array< bool, NumBranchTypes > const & hasNewlyDroppedBranch () const
 
SelectedProductsForBranchType const & keptProducts () const
 
int maxEvents () const
 
const ModuleDescriptionmoduleDescription () const
 
OutputModuleBaseoperator= (OutputModuleBase const &)=delete
 
 OutputModuleBase (ParameterSet const &pset)
 
 OutputModuleBase (OutputModuleBase const &)=delete
 
std::string const & processName () const
 
int remainingEvents () const
 
bool selected (BranchDescription const &desc) const
 
void selectProducts (ProductRegistry const &preg, ThinnedAssociationsHelper const &)
 
ThinnedAssociationsHelper const * thinnedAssociationsHelper () const
 
bool wantAllEvents () const
 
bool wantsGlobalLuminosityBlocks () const
 
bool wantsGlobalRuns () const
 
 ~OutputModuleBase () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

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

Private Member Functions

void write (EventForOutput const &e) override
 
void writeLuminosityBlock (LuminosityBlockForOutput const &) override
 
void writeRun (RunForOutput const &) override
 

Private Attributes

int counter_
 
int prescale_
 
int verbosity_
 

Additional Inherited Members

- Public Types inherited from edm::global::OutputModuleBase
typedef OutputModuleBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::global::OutputModuleBase
void configure (OutputModuleDescription const &desc)
 
ModuleDescription const & description () const
 
void doBeginJob ()
 
bool doBeginLuminosityBlock (LuminosityBlockPrincipal const &lbp, EventSetup const &c, ModuleCallingContext const *)
 
bool doBeginRun (RunPrincipal const &rp, EventSetup const &c, ModuleCallingContext const *)
 
void doBeginStream (StreamID id)
 
void doEndJob ()
 
bool doEndLuminosityBlock (LuminosityBlockPrincipal const &lbp, EventSetup const &c, ModuleCallingContext const *)
 
bool doEndRun (RunPrincipal const &rp, EventSetup const &c, ModuleCallingContext const *)
 
void doEndStream (StreamID id)
 
bool doEvent (EventPrincipal const &ep, EventSetup const &c, ActivityRegistry *, ModuleCallingContext const *)
 
void doPreallocate (PreallocationConfiguration const &)
 
void doStreamBeginLuminosityBlock (StreamID id, LuminosityBlockPrincipal &ep, EventSetup const &c, ModuleCallingContext const *)
 
void doStreamBeginRun (StreamID id, RunPrincipal &ep, EventSetup const &c, ModuleCallingContext const *)
 
void doStreamEndLuminosityBlock (StreamID id, LuminosityBlockPrincipal &ep, EventSetup const &c, ModuleCallingContext const *)
 
void doStreamEndRun (StreamID id, RunPrincipal &ep, EventSetup const &c, ModuleCallingContext const *)
 
std::map< BranchID::value_type, BranchID::value_type > const & droppedBranchIDToKeptBranchID ()
 
void preActionBeforeRunEventAsync (WaitingTask *iTask, ModuleCallingContext const &iModuleCallingContext, Principal const &iPrincipal) 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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<typename ESProduct , Transition Tr = Transition::Event>
auto esConsumes (eventsetup::EventSetupRecordKey const &, ESInputTag const &tag)
 
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 25 of file AsciiOutputModule.cc.

Constructor & Destructor Documentation

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

Definition at line 41 of file AsciiOutputModule.cc.

References prescale_.

41  :
42  global::OutputModuleBase(pset),
43  global::OutputModule<>(pset),
44  prescale_(pset.getUntrackedParameter<unsigned int>("prescale")),
45  verbosity_(pset.getUntrackedParameter<unsigned int>("verbosity")),
46  counter_(0) {
47  if (prescale_ == 0) prescale_ = 1;
48  }
edm::AsciiOutputModule::~AsciiOutputModule ( )
override

Definition at line 50 of file AsciiOutputModule.cc.

References counter_.

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

Member Function Documentation

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

Definition at line 113 of file AsciiOutputModule.cc.

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

113  {
115  desc.setComment("Outputs event information into text file.");
116  desc.addUntracked("prescale", 1U)
117  ->setComment("prescale factor");
118  desc.addUntracked("verbosity", 1U)
119  ->setComment("0: no output\n"
120  "1: event ID and timestamp only\n"
121  "2: provenance for each kept product\n"
122  ">2: PSet and provenance for each kept product");
124  descriptions.add("asciiOutput", desc);
125  }
static void fillDescription(ParameterSetDescription &desc, std::vector< std::string > const &iDefaultOutputCommands=ProductSelectorRules::defaultSelectionStrings())
void edm::AsciiOutputModule::write ( EventForOutput const &  e)
overrideprivatevirtual

Implements edm::global::OutputModuleBase.

Definition at line 55 of file AsciiOutputModule.cc.

References counter_, edm::pset::Registry::getMapped(), edm::ParameterSet::getParameterSet(), edm::OccurrenceForOutput::getProvenance(), edm::EventForOutput::id(), edm::pset::Registry::instance(), edm::BranchDescription::isAlias(), label, edm::BranchDescription::moduleLabel(), edm::BranchDescription::originalBranchID(), prescale_, LaserDQM_cfg::process, edm::OccurrenceForOutput::processHistory(), edm::BranchDescription::processName(), parseEventContent::prod, edm::global::OutputModuleBase::selected(), AlCaHLTBitMon_QueryRunRegistry::string, edm::EventForOutput::time(), edm::Timestamp::value(), and verbosity_.

Referenced by pkg.AbstractPkg::generate().

55  {
56 
57  if ((++counter_ % prescale_) != 0 || verbosity_ <= 0) return;
58 
59  // RunForOutput const& run = evt.getRun(); // this is still unused
60  LogAbsolute("AsciiOut")<< ">>> processing event # " << e.id() << " time " << e.time().value() << std::endl;
61 
62  if (verbosity_ <= 1) return;
63 
64  // Write out non-EDProduct contents...
65 
66  // ... list of process-names
67  for (auto const& process : e.processHistory()) {
68  LogAbsolute("AsciiOut") << process.processName() << " ";
69  }
70 
71  // ... collision id
72  LogAbsolute("AsciiOut") << '\n' << e.id() << '\n';
73 
74  // Loop over products, and write some output for each...
76  for(auto const& prod: reg->productList()) {
77  BranchDescription const& desc = prod.second;
78  if(selected(desc)) {
79  if(desc.isAlias()) {
80  LogAbsolute("AsciiOut") << "ModuleLabel " << desc.moduleLabel() << " is an alias for";
81  }
82 
83  auto const& prov = e.getProvenance(desc.originalBranchID());
84  LogAbsolute("AsciiOut") << prov;
85 
86  if(verbosity_ > 2) {
87  BranchDescription const& desc2 = prov.branchDescription();
88  std::string const& process = desc2.processName();
89  std::string const& label = desc2.moduleLabel();
90  ProcessHistory const* processHistory = prov.processHistoryPtr();
91 
92  if (processHistory) {
93  for (ProcessConfiguration const& pc : *processHistory) {
94  if (pc.processName() == process) {
95  ParameterSetID const& psetID = pc.parameterSetID();
96  pset::Registry const* psetRegistry = pset::Registry::instance();
97  ParameterSet const* processPset = psetRegistry->getMapped(psetID);
98  if (processPset) {
99  if(desc.isAlias()) {
100  LogAbsolute("AsciiOut") << "Alias PSet\n" << processPset->getParameterSet(desc.moduleLabel());
101  }
102  LogAbsolute("AsciiOut") << processPset->getParameterSet(label) << "\n";
103  }
104  }
105  }
106  }
107  }
108  }
109  }
110  }
char const * label
bool selected(BranchDescription const &desc) const
Hash< ParameterSetType > ParameterSetID
static Registry * instance()
Definition: Registry.cc:13
void edm::AsciiOutputModule::writeLuminosityBlock ( LuminosityBlockForOutput const &  )
inlineoverrideprivatevirtual

Implements edm::global::OutputModuleBase.

Definition at line 34 of file AsciiOutputModule.cc.

34 {}
void edm::AsciiOutputModule::writeRun ( RunForOutput const &  )
inlineoverrideprivatevirtual

Implements edm::global::OutputModuleBase.

Definition at line 35 of file AsciiOutputModule.cc.

35 {}

Member Data Documentation

int edm::AsciiOutputModule::counter_
private

Definition at line 38 of file AsciiOutputModule.cc.

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

int edm::AsciiOutputModule::prescale_
private

Definition at line 36 of file AsciiOutputModule.cc.

Referenced by AsciiOutputModule(), and write().

int edm::AsciiOutputModule::verbosity_
private

Definition at line 37 of file AsciiOutputModule.cc.

Referenced by write().