CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
edm::VectorInputSource Class Referenceabstract

#include <VectorInputSource.h>

Inheritance diagram for edm::VectorInputSource:
edm::EmbeddedRootSource

Public Member Functions

void doBeginJob ()
 Called at beginning of job. More...
 
void doEndJob ()
 Called at end of job. More...
 
void dropUnwantedBranches (std::vector< std::string > const &wantedBranches)
 
template<typename T >
size_t loopOverEvents (EventPrincipal &cache, size_t &fileNameHash, size_t number, T eventOperator, CLHEP::HepRandomEngine *=nullptr, EventID const *id=nullptr)
 
template<typename T , typename Iterator >
size_t loopSpecified (EventPrincipal &cache, size_t &fileNameHash, Iterator const &begin, Iterator const &end, T eventOperator)
 
ProcessHistoryRegistry const & processHistoryRegistry () const
 
ProcessHistoryRegistryprocessHistoryRegistryForUpdate ()
 
std::shared_ptr< ProductRegistry const > productRegistry () const
 
std::shared_ptr< ProductRegistry > & productRegistry ()
 
ProductRegistryproductRegistryUpdate ()
 
 VectorInputSource (ParameterSet const &pset, VectorInputSourceDescription const &desc)
 
virtual ~VectorInputSource ()
 

Private Member Functions

virtual void beginJob ()=0
 
void clearEventPrincipal (EventPrincipal &cache)
 
virtual void dropUnwantedBranches_ (std::vector< std::string > const &wantedBranches)=0
 
virtual void endJob ()=0
 
virtual bool readOneEvent (EventPrincipal &cache, size_t &fileNameHash, CLHEP::HepRandomEngine *, EventID const *id)=0
 
virtual void readOneSpecified (EventPrincipal &cache, size_t &fileNameHash, SecondaryEventIDAndFileInfo const &event)=0
 
void readOneSpecified (EventPrincipal &cache, size_t &fileNameHash, EventID const &event)
 

Private Attributes

edm::propagate_const< std::unique_ptr< ProcessHistoryRegistry > > processHistoryRegistry_
 
edm::propagate_const< std::shared_ptr< ProductRegistry > > productRegistry_
 

Detailed Description

Definition at line 27 of file VectorInputSource.h.

Constructor & Destructor Documentation

edm::VectorInputSource::VectorInputSource ( ParameterSet const &  pset,
VectorInputSourceDescription const &  desc 
)
explicit

Definition at line 11 of file VectorInputSource.cc.

11  :
12  productRegistry_(desc.productRegistry_),
13  processHistoryRegistry_(new ProcessHistoryRegistry) {
14  }
edm::propagate_const< std::unique_ptr< ProcessHistoryRegistry > > processHistoryRegistry_
edm::propagate_const< std::shared_ptr< ProductRegistry > > productRegistry_
edm::VectorInputSource::~VectorInputSource ( )
virtual

Definition at line 16 of file VectorInputSource.cc.

16 {}

Member Function Documentation

virtual void edm::VectorInputSource::beginJob ( )
privatepure virtual

Implemented in edm::EmbeddedRootSource.

Referenced by doBeginJob().

void edm::VectorInputSource::clearEventPrincipal ( EventPrincipal cache)
private

Definition at line 24 of file VectorInputSource.cc.

References edm::EventPrincipal::clearEventPrincipal().

24  {
25  cache.clearEventPrincipal();
26  }
def cache(function)
void edm::VectorInputSource::doBeginJob ( )

Called at beginning of job.

Definition at line 29 of file VectorInputSource.cc.

References beginJob().

29  {
30  this->beginJob();
31  }
virtual void beginJob()=0
void edm::VectorInputSource::doEndJob ( )

Called at end of job.

Definition at line 34 of file VectorInputSource.cc.

References endJob().

34  {
35  this->endJob();
36  }
virtual void endJob()=0
void edm::VectorInputSource::dropUnwantedBranches ( std::vector< std::string > const &  wantedBranches)

Definition at line 19 of file VectorInputSource.cc.

References dropUnwantedBranches_().

19  {
20  this->dropUnwantedBranches_(wantedBranches);
21  }
virtual void dropUnwantedBranches_(std::vector< std::string > const &wantedBranches)=0
virtual void edm::VectorInputSource::dropUnwantedBranches_ ( std::vector< std::string > const &  wantedBranches)
privatepure virtual

Implemented in edm::EmbeddedRootSource.

Referenced by dropUnwantedBranches().

virtual void edm::VectorInputSource::endJob ( )
privatepure virtual

Implemented in edm::EmbeddedRootSource.

Referenced by doEndJob().

template<typename T >
size_t edm::VectorInputSource::loopOverEvents ( EventPrincipal cache,
size_t &  fileNameHash,
size_t  number,
T  eventOperator,
CLHEP::HepRandomEngine *  engine = nullptr,
EventID const *  id = nullptr 
)

Definition at line 73 of file VectorInputSource.h.

References runEdmFileComparison::found, mps_fire::i, and mitigatedMETSequence_cff::U.

73  {
74  size_t i = 0U;
75  for(; i < number; ++i) {
77  bool found = readOneEvent(cache, fileNameHash, engine, id);
78  if(!found) break;
79  eventOperator(cache, fileNameHash);
80  }
81  return i;
82  }
void clearEventPrincipal(EventPrincipal &cache)
def cache(function)
virtual bool readOneEvent(EventPrincipal &cache, size_t &fileNameHash, CLHEP::HepRandomEngine *, EventID const *id)=0
template<typename T , typename Iterator >
size_t edm::VectorInputSource::loopSpecified ( EventPrincipal cache,
size_t &  fileNameHash,
Iterator const &  begin,
Iterator const &  end,
T  eventOperator 
)

Definition at line 85 of file VectorInputSource.h.

References end, mps_fire::i, and mitigatedMETSequence_cff::U.

85  {
86  size_t i = 0U;
87  for(Iterator iter = begin; iter != end; ++iter) {
89  readOneSpecified(cache, fileNameHash, *iter);
90  eventOperator(cache, fileNameHash);
91  ++i;
92  }
93  return i;
94  }
void clearEventPrincipal(EventPrincipal &cache)
#define end
Definition: vmac.h:37
def cache(function)
#define begin
Definition: vmac.h:30
virtual void readOneSpecified(EventPrincipal &cache, size_t &fileNameHash, SecondaryEventIDAndFileInfo const &event)=0
ProcessHistoryRegistry const& edm::VectorInputSource::processHistoryRegistry ( ) const
inline

Definition at line 49 of file VectorInputSource.h.

49 {return *processHistoryRegistry_;}
edm::propagate_const< std::unique_ptr< ProcessHistoryRegistry > > processHistoryRegistry_
ProcessHistoryRegistry& edm::VectorInputSource::processHistoryRegistryForUpdate ( )
inline

Definition at line 50 of file VectorInputSource.h.

Referenced by edm::RootEmbeddedFileSequence::makeRootFile().

50 {return *processHistoryRegistry_;}
edm::propagate_const< std::unique_ptr< ProcessHistoryRegistry > > processHistoryRegistry_
std::shared_ptr<ProductRegistry const> edm::VectorInputSource::productRegistry ( ) const
inline

Definition at line 46 of file VectorInputSource.h.

References edm::get_underlying_safe().

std::shared_ptr< T > & get_underlying_safe(propagate_const< std::shared_ptr< T >> &iP)
edm::propagate_const< std::shared_ptr< ProductRegistry > > productRegistry_
std::shared_ptr<ProductRegistry>& edm::VectorInputSource::productRegistry ( )
inline

Definition at line 47 of file VectorInputSource.h.

References edm::get_underlying_safe().

std::shared_ptr< T > & get_underlying_safe(propagate_const< std::shared_ptr< T >> &iP)
edm::propagate_const< std::shared_ptr< ProductRegistry > > productRegistry_
ProductRegistry& edm::VectorInputSource::productRegistryUpdate ( )
inline

Definition at line 48 of file VectorInputSource.h.

Referenced by edm::RootEmbeddedFileSequence::RootEmbeddedFileSequence().

48 {return *productRegistry_;}
edm::propagate_const< std::shared_ptr< ProductRegistry > > productRegistry_
virtual bool edm::VectorInputSource::readOneEvent ( EventPrincipal cache,
size_t &  fileNameHash,
CLHEP::HepRandomEngine *  ,
EventID const *  id 
)
privatepure virtual

Implemented in edm::EmbeddedRootSource.

virtual void edm::VectorInputSource::readOneSpecified ( EventPrincipal cache,
size_t &  fileNameHash,
SecondaryEventIDAndFileInfo const &  event 
)
privatepure virtual

Implemented in edm::EmbeddedRootSource.

void edm::VectorInputSource::readOneSpecified ( EventPrincipal cache,
size_t &  fileNameHash,
EventID const &  event 
)
inlineprivate

Definition at line 59 of file VectorInputSource.h.

References bk::beginJob(), and info().

59  {
60  SecondaryEventIDAndFileInfo info(event, fileNameHash);
61  readOneSpecified(cache, fileNameHash, info);
62  }
static const TGPicture * info(bool iBackgroundIsBlack)
def cache(function)
Definition: event.py:1
virtual void readOneSpecified(EventPrincipal &cache, size_t &fileNameHash, SecondaryEventIDAndFileInfo const &event)=0

Member Data Documentation

edm::propagate_const<std::unique_ptr<ProcessHistoryRegistry> > edm::VectorInputSource::processHistoryRegistry_
private

Definition at line 69 of file VectorInputSource.h.

edm::propagate_const<std::shared_ptr<ProductRegistry> > edm::VectorInputSource::productRegistry_
private

Definition at line 68 of file VectorInputSource.h.