CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
edm::RootDelayedReader Class Reference

#include <RootDelayedReader.h>

Inheritance diagram for edm::RootDelayedReader:
edm::DelayedReader

Public Types

typedef roottree::BranchInfo BranchInfo
 
typedef roottree::BranchMap BranchMap
 
typedef roottree::EntryNumber EntryNumber
 
typedef
roottree::BranchMap::const_iterator 
iterator
 

Public Member Functions

RootDelayedReaderoperator= (RootDelayedReader const &)=delete
 
 RootDelayedReader (RootTree const &tree, boost::shared_ptr< InputFile > filePtr)
 
 RootDelayedReader (RootDelayedReader const &)=delete
 
virtual ~RootDelayedReader ()
 
- Public Member Functions inherited from edm::DelayedReader
WrapperOwningHolder getProduct (BranchKey const &k, WrapperInterfaceBase const *interface, EDProductGetter const *ep)
 
void mergeReaders (DelayedReader *other)
 
void reset ()
 
virtual ~DelayedReader ()
 

Private Member Functions

BranchMap const & branches () const
 
iterator branchIter (BranchKey const &k) const
 
EntryNumber const & entryNumber () const
 
bool found (iterator const &iter) const
 
BranchInfo const & getBranchInfo (iterator const &iter) const
 
virtual WrapperOwningHolder getProduct_ (BranchKey const &k, WrapperInterfaceBase const *interface, EDProductGetter const *ep) const
 
virtual void mergeReaders_ (DelayedReader *other)
 
virtual void reset_ ()
 

Private Attributes

boost::shared_ptr< InputFilefilePtr_
 
DelayedReadernextReader_
 
RootTree const & tree_
 

Detailed Description

Definition at line 26 of file RootDelayedReader.h.

Member Typedef Documentation

Definition at line 28 of file RootDelayedReader.h.

Definition at line 29 of file RootDelayedReader.h.

Definition at line 31 of file RootDelayedReader.h.

typedef roottree::BranchMap::const_iterator edm::RootDelayedReader::iterator

Definition at line 30 of file RootDelayedReader.h.

Constructor & Destructor Documentation

edm::RootDelayedReader::RootDelayedReader ( RootTree const &  tree,
boost::shared_ptr< InputFile filePtr 
)

Definition at line 15 of file RootDelayedReader.cc.

17  :
18  tree_(tree),
19  filePtr_(filePtr),
20  nextReader_() {
21  }
RootTree const & tree_
DelayedReader * nextReader_
boost::shared_ptr< InputFile > filePtr_
edm::RootDelayedReader::~RootDelayedReader ( )
virtual

Definition at line 23 of file RootDelayedReader.cc.

23  {
24  }
edm::RootDelayedReader::RootDelayedReader ( RootDelayedReader const &  )
delete

Member Function Documentation

BranchMap const& edm::RootDelayedReader::branches ( ) const
inlineprivate

Definition at line 45 of file RootDelayedReader.h.

References edm::RootTree::branches(), and tree_.

Referenced by branchIter(), and found().

45 {return tree_.branches();}
RootTree const & tree_
BranchMap const & branches() const
Definition: RootTree.cc:138
iterator edm::RootDelayedReader::branchIter ( BranchKey const &  k) const
inlineprivate

Definition at line 47 of file RootDelayedReader.h.

References branches().

Referenced by getProduct_().

47 {return branches().find(k);}
int k[5][pyjets_maxn]
BranchMap const & branches() const
EntryNumber const& edm::RootDelayedReader::entryNumber ( ) const
inlineprivate

Definition at line 46 of file RootDelayedReader.h.

References edm::RootTree::entryNumber(), and tree_.

Referenced by getProduct_().

46 {return tree_.entryNumber();}
RootTree const & tree_
EntryNumber const & entryNumber() const
Definition: RootTree.h:84
bool edm::RootDelayedReader::found ( iterator const &  iter) const
inlineprivate
BranchInfo const& edm::RootDelayedReader::getBranchInfo ( iterator const &  iter) const
inlineprivate

Definition at line 49 of file RootDelayedReader.h.

Referenced by getProduct_().

49 {return iter->second; }
WrapperOwningHolder edm::RootDelayedReader::getProduct_ ( BranchKey const &  k,
WrapperInterfaceBase const *  interface,
EDProductGetter const *  ep 
) const
privatevirtual

Implements edm::DelayedReader.

Definition at line 27 of file RootDelayedReader.cc.

References scaleCards::br, edm::roottree::BranchInfo::branchDescription_, branchIter(), edm::RootTree::branchType(), edm::roottree::BranchInfo::classCache_, CommonMethods::cp(), entryNumber(), found(), getBranchInfo(), edm::RootTree::getEntry(), edm::DelayedReader::getProduct(), edm::InEvent, nextReader_, AlCaHLTBitMon_ParallelJobs::p, edm::roottree::BranchInfo::productBranch_, edm::InputFile::reportReadBranch(), edm::setRefCoreStreamer(), tree_, and edm::ConstBranchDescription::wrappedName().

27  {
28  iterator iter = branchIter(k);
29  if (!found(iter)) {
30  if (nextReader_) {
31  return nextReader_->getProduct(k, interface, ep);
32  } else {
33  return WrapperOwningHolder();
34  }
35  }
36  roottree::BranchInfo const& branchInfo = getBranchInfo(iter);
37  TBranch* br = branchInfo.productBranch_;
38  if (br == 0) {
39  if (nextReader_) {
40  return nextReader_->getProduct(k, interface, ep);
41  } else {
42  return WrapperOwningHolder();
43  }
44  }
46  TClass* cp = branchInfo.classCache_;
47  if(0 == cp) {
48  branchInfo.classCache_ = gROOT->GetClass(branchInfo.branchDescription_.wrappedName().c_str());
49  cp = branchInfo.classCache_;
50  }
51  void* p = cp->New();
52  br->SetAddress(&p);
53  tree_.getEntry(br, entryNumber());
54  if(tree_.branchType() == InEvent) {
55  InputFile::reportReadBranch(std::string(br->GetName()));
56  }
57  setRefCoreStreamer(false);
58  WrapperOwningHolder edp(p, interface);
59  return edp;
60  }
WrapperOwningHolder getProduct(BranchKey const &k, WrapperInterfaceBase const *interface, EDProductGetter const *ep)
Definition: DelayedReader.h:22
RootTree const & tree_
void setRefCoreStreamer(bool resetAll=false)
BranchInfo const & getBranchInfo(iterator const &iter) const
DelayedReader * nextReader_
tuple br
Definition: scaleCards.py:54
BranchType branchType() const
Definition: RootTree.h:122
roottree::BranchMap::const_iterator iterator
int k[5][pyjets_maxn]
bool found(iterator const &iter) const
void getEntry(TBranch *branch, EntryNumber entry) const
Definition: RootTree.cc:182
static void reportReadBranch(std::string const &branchname)
Definition: InputFile.cc:106
EntryNumber const & entryNumber() const
iterator branchIter(BranchKey const &k) const
virtual void edm::RootDelayedReader::mergeReaders_ ( DelayedReader other)
inlineprivatevirtual

Implements edm::DelayedReader.

Definition at line 43 of file RootDelayedReader.h.

References nextReader_.

43 {nextReader_ = other;}
DelayedReader * nextReader_
RootDelayedReader& edm::RootDelayedReader::operator= ( RootDelayedReader const &  )
delete
virtual void edm::RootDelayedReader::reset_ ( )
inlineprivatevirtual

Implements edm::DelayedReader.

Definition at line 44 of file RootDelayedReader.h.

References nextReader_.

44 {nextReader_ = 0;}
DelayedReader * nextReader_

Member Data Documentation

boost::shared_ptr<InputFile> edm::RootDelayedReader::filePtr_
private

Definition at line 53 of file RootDelayedReader.h.

DelayedReader* edm::RootDelayedReader::nextReader_
private

Definition at line 54 of file RootDelayedReader.h.

Referenced by getProduct_(), mergeReaders_(), and reset_().

RootTree const& edm::RootDelayedReader::tree_
private

Definition at line 52 of file RootDelayedReader.h.

Referenced by branches(), entryNumber(), and getProduct_().