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<>
const OutputModuleoperator= (const OutputModule &)=delete
 
 OutputModule (const OutputModule &)=delete
 
 OutputModule (edm::ParameterSet const &iPSet)
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
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 (OutputModuleBase const &)=delete
 
 OutputModuleBase (ParameterSet const &pset)
 
OutputProcessBlockHelper const & outputProcessBlockHelper () const
 
std::string const & processName () const
 
int remainingEvents () const
 
bool selected (BranchDescription const &desc) const
 
void selectProducts (ProductRegistry const &preg, ThinnedAssociationsHelper const &, ProcessBlockHelperBase 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 &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
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::array< std::vector< ModuleDescription const * > *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
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 doAccessInputProcessBlock (ProcessBlockPrincipal const &, ModuleCallingContext const *)
 
void doAcquire (EventTransitionInfo const &, ActivityRegistry *, ModuleCallingContext const *, WaitingTaskWithArenaHolder &)
 
void doBeginJob ()
 
bool doBeginLuminosityBlock (LumiTransitionInfo const &, ModuleCallingContext const *)
 
void doBeginProcessBlock (ProcessBlockPrincipal const &, ModuleCallingContext const *)
 
bool doBeginRun (RunTransitionInfo const &, ModuleCallingContext const *)
 
void doBeginStream (StreamID id)
 
void doEndJob ()
 
bool doEndLuminosityBlock (LumiTransitionInfo const &, ModuleCallingContext const *)
 
void doEndProcessBlock (ProcessBlockPrincipal const &, ModuleCallingContext const *)
 
bool doEndRun (RunTransitionInfo const &, ModuleCallingContext const *)
 
void doEndStream (StreamID id)
 
bool doEvent (EventTransitionInfo const &, ActivityRegistry *, ModuleCallingContext const *)
 
void doPreallocate (PreallocationConfiguration const &)
 
std::map< BranchID::value_type, BranchID::value_type > const & droppedBranchIDToKeptBranchID ()
 
void preActionBeforeRunEventAsync (WaitingTaskHolder 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
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
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<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

Definition at line 25 of file AsciiOutputModule.cc.

Constructor & Destructor Documentation

◆ AsciiOutputModule()

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

Definition at line 41 of file AsciiOutputModule.cc.

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)
48  prescale_ = 1;
49  }

References prescale_.

◆ ~AsciiOutputModule()

edm::AsciiOutputModule::~AsciiOutputModule ( )
override

Definition at line 51 of file AsciiOutputModule.cc.

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

References counter_.

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 111 of file AsciiOutputModule.cc.

111  {
113  desc.setComment("Outputs event information into text file.");
114  desc.addUntracked("prescale", 1U)->setComment("prescale factor");
115  desc.addUntracked("verbosity", 1U)
116  ->setComment(
117  "0: no output\n"
118  "1: event ID and timestamp only\n"
119  "2: provenance for each kept product\n"
120  ">2: PSet and provenance for each kept product");
121  OutputModule::fillDescription(desc);
122  descriptions.add("asciiOutput", desc);
123  }

References edm::ConfigurationDescriptions::add(), submitPVResolutionJobs::desc, and mitigatedMETSequence_cff::U.

◆ write()

void edm::AsciiOutputModule::write ( EventForOutput const &  e)
overrideprivatevirtual

Implements edm::global::OutputModuleBase.

Definition at line 55 of file AsciiOutputModule.cc.

55  {
56  if ((++counter_ % prescale_) != 0 || verbosity_ <= 0)
57  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)
63  return;
64 
65  // Write out non-EDProduct contents...
66 
67  // ... list of process-names
68  for (auto const& process : e.processHistory()) {
69  LogAbsolute("AsciiOut") << process.processName() << " ";
70  }
71 
72  // ... collision id
73  LogAbsolute("AsciiOut") << '\n' << e.id() << '\n';
74 
75  // Loop over products, and write some output for each...
77  for (auto const& prod : reg->productList()) {
78  BranchDescription const& desc = prod.second;
79  if (selected(desc)) {
80  if (desc.isAlias()) {
81  LogAbsolute("AsciiOut") << "ModuleLabel " << desc.moduleLabel() << " is an alias for";
82  }
83 
84  auto const& prov = e.getProvenance(desc.originalBranchID());
85  LogAbsolute("AsciiOut") << prov;
86 
87  if (verbosity_ > 2) {
88  BranchDescription const& desc2 = prov.branchDescription();
89  std::string const& process = desc2.processName();
90  std::string const& label = desc2.moduleLabel();
91  ProcessHistory const& processHistory = e.processHistory();
92 
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  }

References counter_, submitPVResolutionJobs::desc, MillePedeFileConverter_cfg::e, edm::pset::Registry::getMapped(), edm::ParameterSet::getParameterSet(), edm::pset::Registry::instance(), label, edm::BranchDescription::moduleLabel(), prescale_, LaserDQM_cfg::process, edm::BranchDescription::processName(), dumpMFGeometry_cfg::prod, edm::global::OutputModuleBase::selected(), AlCaHLTBitMon_QueryRunRegistry::string, and verbosity_.

Referenced by pkg.AbstractPkg::generate().

◆ writeLuminosityBlock()

void edm::AsciiOutputModule::writeLuminosityBlock ( LuminosityBlockForOutput const &  )
inlineoverrideprivatevirtual

Implements edm::global::OutputModuleBase.

Definition at line 34 of file AsciiOutputModule.cc.

34 {}

◆ writeRun()

void edm::AsciiOutputModule::writeRun ( RunForOutput const &  )
inlineoverrideprivatevirtual

Implements edm::global::OutputModuleBase.

Definition at line 35 of file AsciiOutputModule.cc.

35 {}

Member Data Documentation

◆ counter_

int edm::AsciiOutputModule::counter_
private

Definition at line 38 of file AsciiOutputModule.cc.

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

◆ prescale_

int edm::AsciiOutputModule::prescale_
private

Definition at line 36 of file AsciiOutputModule.cc.

Referenced by AsciiOutputModule(), and write().

◆ verbosity_

int edm::AsciiOutputModule::verbosity_
private

Definition at line 37 of file AsciiOutputModule.cc.

Referenced by write().

edm::ParameterSetID
Hash< ParameterSetType > ParameterSetID
Definition: ParameterSetID.h:21
edm::pset::Registry::instance
static Registry * instance()
Definition: Registry.cc:12
ProducerES_cfi.ProcessHistory
ProcessHistory
Definition: ProducerES_cfi.py:14
edm::AsciiOutputModule::verbosity_
int verbosity_
Definition: AsciiOutputModule.cc:37
dumpMFGeometry_cfg.prod
prod
Definition: dumpMFGeometry_cfg.py:24
Service
edm::AsciiOutputModule::prescale_
int prescale_
Definition: AsciiOutputModule.cc:36
mitigatedMETSequence_cff.U
U
Definition: mitigatedMETSequence_cff.py:36
edm::AsciiOutputModule::counter_
int counter_
Definition: AsciiOutputModule.cc:38
ParameterSet
Definition: Functions.h:16
LaserDQM_cfg.process
process
Definition: LaserDQM_cfg.py:3
edm::LogAbsolute
Log< level::System, true > LogAbsolute
Definition: MessageLogger.h:134
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
ParameterSetDescription
edm::global::OutputModuleBase::selected
bool selected(BranchDescription const &desc) const
Definition: OutputModuleBase.cc:369
label
const char * label
Definition: PFTauDecayModeTools.cc:11
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37