CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Friends
edm::OccurrenceForOutput Class Reference

#include <OccurrenceForOutput.h>

Inheritance diagram for edm::OccurrenceForOutput:
edm::EventForOutput edm::LuminosityBlockForOutput edm::RunForOutput

Public Member Functions

void getAllProvenance (std::vector< Provenance const * > &provenances) const
 
void getAllStableProvenance (std::vector< StableProvenance const * > &provenances) const
 
bool getByToken (EDGetToken token, TypeID const &typeID, BasicHandle &result) const
 
template<typename PROD >
bool getByToken (EDGetToken token, Handle< PROD > &result) const
 
template<typename PROD >
bool getByToken (EDGetTokenT< PROD > token, Handle< PROD > &result) const
 
Provenance getProvenance (BranchID const &theID) const
 
 OccurrenceForOutput (Principal const &ep, ModuleDescription const &md, ModuleCallingContext const *, bool isAtEnd)
 
virtual ProcessHistory const & processHistory () const
 
ProcessHistoryID const & processHistoryID () const
 
void setConsumer (EDConsumerBase const *iConsumer)
 
size_t size () const
 
virtual ~OccurrenceForOutput ()
 

Protected Member Functions

Principal const & principal () const
 

Private Member Functions

ModuleCallingContext const * moduleCallingContext () const
 

Private Attributes

ModuleCallingContext const * moduleCallingContext_
 
PrincipalGetAdapter provRecorder_
 

Friends

class edmtest::TestOutputModule
 

Detailed Description

Definition at line 45 of file OccurrenceForOutput.h.

Constructor & Destructor Documentation

OccurrenceForOutput::OccurrenceForOutput ( Principal const &  ep,
ModuleDescription const &  md,
ModuleCallingContext const *  moduleCallingContext,
bool  isAtEnd 
)

Definition at line 15 of file OccurrenceForOutput.cc.

15  :
16  provRecorder_(p, md, isAtEnd),
18  {
19  }
ModuleCallingContext const * moduleCallingContext() const
ModuleCallingContext const * moduleCallingContext_
PrincipalGetAdapter provRecorder_
OccurrenceForOutput::~OccurrenceForOutput ( )
virtual

Definition at line 21 of file OccurrenceForOutput.cc.

21  {
22  }

Member Function Documentation

void OccurrenceForOutput::getAllProvenance ( std::vector< Provenance const * > &  provenances) const

Definition at line 45 of file OccurrenceForOutput.cc.

References edm::Principal::getAllProvenance(), edm::PrincipalGetAdapter::principal(), and provRecorder_.

Referenced by edm::AsciiOutputModule::write().

45  {
47  }
Principal const & principal() const
void getAllProvenance(std::vector< Provenance const * > &provenances) const
Definition: Principal.cc:816
PrincipalGetAdapter provRecorder_
void OccurrenceForOutput::getAllStableProvenance ( std::vector< StableProvenance const * > &  provenances) const

Definition at line 50 of file OccurrenceForOutput.cc.

References edm::Principal::getAllStableProvenance(), edm::PrincipalGetAdapter::principal(), and provRecorder_.

50  {
52  }
Principal const & principal() const
void getAllStableProvenance(std::vector< StableProvenance const * > &provenances) const
Definition: Principal.cc:833
PrincipalGetAdapter provRecorder_
bool OccurrenceForOutput::getByToken ( EDGetToken  token,
TypeID const &  typeID,
BasicHandle result 
) const

Definition at line 65 of file OccurrenceForOutput.cc.

References edm::BasicHandle::clear(), edm::BasicHandle::failedToGet(), edm::PrincipalGetAdapter::getByToken_(), edm::PrincipalGetAdapter::isComplete(), edm::WrapperBase::isMergeable(), moduleCallingContext_, edm::PRODUCT_TYPE, provRecorder_, edm::principal_get_adapter_detail::throwOnPrematureRead(), and edm::BasicHandle::wrapper().

Referenced by SummaryTableOutputBranches::fill(), TriggerOutputBranches::fill(), TableOutputBranches::fill(), edm::RootOutputFile::fillBranches(), edm::StreamerOutputModuleBase::getTriggerResults(), edm::OutputModule::getTriggerResults(), edm::detail::TriggerResultsBasedEventSelector::wantEvent(), RawEventOutputModuleForBU< Consumer >::write(), edm::ProvenanceCheckerOutputModule::write(), and NanoAODOutputModule::writeRun().

65  {
66  result.clear();
68  if (result.failedToGet()) {
69  return false;
70  }
71  if(!provRecorder_.isComplete() && result.wrapper()->isMergeable()) {
72  principal_get_adapter_detail::throwOnPrematureRead("RunOrLumi", typeID, token);
73  }
74  return true;
75  }
BasicHandle getByToken_(TypeID const &id, KindOfType kindOfType, EDGetToken token, ModuleCallingContext const *mcc) const
ModuleCallingContext const * moduleCallingContext_
void throwOnPrematureRead(char const *principalType, TypeID const &productType, std::string const &moduleLabel, std::string const &productInstanceName)
PrincipalGetAdapter provRecorder_
template<typename PROD >
bool OccurrenceForOutput::getByToken ( EDGetToken  token,
Handle< PROD > &  result 
) const

Definition at line 96 of file OccurrenceForOutput.h.

References edm::HandleBase::clear(), edm::convert_handle(), edm::HandleBase::failedToGet(), eostools::move(), PROD, edm::PRODUCT_TYPE, and edm::principal_get_adapter_detail::throwOnPrematureRead().

96  {
98  principal_get_adapter_detail::throwOnPrematureRead("RunOrLumi", TypeID(typeid(PROD)), token);
99  }
100  result.clear();
101  BasicHandle bh = provRecorder_.getByToken_(TypeID(typeid(PROD)),PRODUCT_TYPE, token, moduleCallingContext_);
102  convert_handle(std::move(bh), result); // throws on conversion error
103  if (result.failedToGet()) {
104  return false;
105  }
106  return true;
107  }
BasicHandle getByToken_(TypeID const &id, KindOfType kindOfType, EDGetToken token, ModuleCallingContext const *mcc) const
void convert_handle(BasicHandle &&bh, Handle< T > &result)
Definition: ConvertHandle.h:20
ModuleCallingContext const * moduleCallingContext_
#define PROD(A, B)
void throwOnPrematureRead(char const *principalType, TypeID const &productType, std::string const &moduleLabel, std::string const &productInstanceName)
def move(src, dest)
Definition: eostools.py:510
PrincipalGetAdapter provRecorder_
template<typename PROD >
bool OccurrenceForOutput::getByToken ( EDGetTokenT< PROD token,
Handle< PROD > &  result 
) const

Definition at line 111 of file OccurrenceForOutput.h.

References edm::HandleBase::clear(), edm::convert_handle(), edm::HandleBase::failedToGet(), eostools::move(), PROD, edm::PRODUCT_TYPE, and edm::principal_get_adapter_detail::throwOnPrematureRead().

111  {
113  principal_get_adapter_detail::throwOnPrematureRead("RunOrLumi", TypeID(typeid(PROD)), token);
114  }
115  result.clear();
116  BasicHandle bh = provRecorder_.getByToken_(TypeID(typeid(PROD)),PRODUCT_TYPE, token, moduleCallingContext_);
117  convert_handle(std::move(bh), result); // throws on conversion error
118  if (result.failedToGet()) {
119  return false;
120  }
121  return true;
122  }
BasicHandle getByToken_(TypeID const &id, KindOfType kindOfType, EDGetToken token, ModuleCallingContext const *mcc) const
void convert_handle(BasicHandle &&bh, Handle< T > &result)
Definition: ConvertHandle.h:20
ModuleCallingContext const * moduleCallingContext_
#define PROD(A, B)
void throwOnPrematureRead(char const *principalType, TypeID const &productType, std::string const &moduleLabel, std::string const &productInstanceName)
def move(src, dest)
Definition: eostools.py:510
PrincipalGetAdapter provRecorder_
Provenance OccurrenceForOutput::getProvenance ( BranchID const &  theID) const

Definition at line 40 of file OccurrenceForOutput.cc.

References edm::Principal::getProvenance(), moduleCallingContext_, edm::PrincipalGetAdapter::principal(), and provRecorder_.

Referenced by edm::ProvenanceCheckerOutputModule::write(), and edm::ProvenanceCheckerOutputModule::~ProvenanceCheckerOutputModule().

40  {
42  }
Principal const & principal() const
Provenance getProvenance(BranchID const &bid, ModuleCallingContext const *mcc) const
Definition: Principal.cc:797
ModuleCallingContext const * moduleCallingContext_
PrincipalGetAdapter provRecorder_
ModuleCallingContext const* edm::OccurrenceForOutput::moduleCallingContext ( ) const
inlineprivate

Definition at line 87 of file OccurrenceForOutput.h.

87 { return moduleCallingContext_; }
ModuleCallingContext const * moduleCallingContext_
Principal const & OccurrenceForOutput::principal ( ) const
protected
ProcessHistory const & OccurrenceForOutput::processHistory ( ) const
virtual
ProcessHistoryID const & OccurrenceForOutput::processHistoryID ( ) const
void OccurrenceForOutput::setConsumer ( EDConsumerBase const *  iConsumer)

Definition at line 25 of file OccurrenceForOutput.cc.

References provRecorder_, and edm::PrincipalGetAdapter::setConsumer().

Referenced by edm::OutputModule::doBeginLuminosityBlock(), edm::one::OutputModuleBase::doBeginLuminosityBlock(), edm::global::OutputModuleBase::doBeginLuminosityBlock(), edm::limited::OutputModuleBase::doBeginLuminosityBlock(), edm::OutputModule::doBeginRun(), edm::one::OutputModuleBase::doBeginRun(), edm::global::OutputModuleBase::doBeginRun(), edm::limited::OutputModuleBase::doBeginRun(), edm::OutputModule::doEndLuminosityBlock(), edm::one::OutputModuleBase::doEndLuminosityBlock(), edm::global::OutputModuleBase::doEndLuminosityBlock(), edm::limited::OutputModuleBase::doEndLuminosityBlock(), edm::OutputModule::doEndRun(), edm::one::OutputModuleBase::doEndRun(), edm::global::OutputModuleBase::doEndRun(), edm::limited::OutputModuleBase::doEndRun(), edm::OutputModule::doEvent(), edm::one::OutputModuleBase::doEvent(), edm::global::OutputModuleBase::doEvent(), edm::limited::OutputModuleBase::doEvent(), edm::SubProcess::doEventAsync(), edm::OutputModule::doWriteLuminosityBlock(), edm::one::OutputModuleBase::doWriteLuminosityBlock(), edm::global::OutputModuleBase::doWriteLuminosityBlock(), edm::limited::OutputModuleBase::doWriteLuminosityBlock(), edm::OutputModule::doWriteRun(), edm::one::OutputModuleBase::doWriteRun(), edm::global::OutputModuleBase::doWriteRun(), edm::limited::OutputModuleBase::doWriteRun(), edm::OutputModule::prePrefetchSelection(), edm::one::OutputModuleBase::prePrefetchSelection(), edm::global::OutputModuleBase::prePrefetchSelection(), and edm::limited::OutputModuleBase::prePrefetchSelection().

25  {
26  provRecorder_.setConsumer(iConsumer);
27  }
void setConsumer(EDConsumerBase const *iConsumer)
PrincipalGetAdapter provRecorder_
size_t OccurrenceForOutput::size ( void  ) const

Friends And Related Function Documentation

friend class edmtest::TestOutputModule
friend

Definition at line 86 of file OccurrenceForOutput.h.

Member Data Documentation

ModuleCallingContext const* edm::OccurrenceForOutput::moduleCallingContext_
private

Definition at line 91 of file OccurrenceForOutput.h.

Referenced by getByToken(), and getProvenance().

PrincipalGetAdapter edm::OccurrenceForOutput::provRecorder_
private