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, InputType inputType)
 
 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
 
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 override
 
virtual void mergeReaders_ (DelayedReader *other)
 
virtual void reset_ ()
 

Private Attributes

boost::shared_ptr< InputFilefilePtr_
 
InputType inputType_
 
DelayedReadernextReader_
 
RootTree const & tree_
 

Detailed Description

Definition at line 27 of file RootDelayedReader.h.

Member Typedef Documentation

Definition at line 29 of file RootDelayedReader.h.

Definition at line 30 of file RootDelayedReader.h.

Definition at line 32 of file RootDelayedReader.h.

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

Definition at line 31 of file RootDelayedReader.h.

Constructor & Destructor Documentation

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

Definition at line 18 of file RootDelayedReader.cc.

21  :
22  tree_(tree),
23  filePtr_(filePtr),
24  nextReader_(),
25  inputType_(inputType) {
26  }
RootTree const & tree_
DelayedReader * nextReader_
boost::shared_ptr< InputFile > filePtr_
edm::RootDelayedReader::~RootDelayedReader ( )
virtual

Definition at line 28 of file RootDelayedReader.cc.

28  {
29  }
edm::RootDelayedReader::RootDelayedReader ( RootDelayedReader const &  )
delete

Member Function Documentation

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

Definition at line 49 of file RootDelayedReader.h.

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

Referenced by branchIter(), and found().

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

Definition at line 50 of file RootDelayedReader.h.

References branches().

Referenced by getProduct_().

50 {return branches().find(k);}
int k[5][pyjets_maxn]
BranchMap const & branches() const
bool edm::RootDelayedReader::found ( iterator const &  iter) const
inlineprivate
BranchInfo const& edm::RootDelayedReader::getBranchInfo ( iterator const &  iter) const
inlineprivate

Definition at line 52 of file RootDelayedReader.h.

Referenced by getProduct_().

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

Implements edm::DelayedReader.

Definition at line 32 of file RootDelayedReader.cc.

References beamvalidation::br, edm::roottree::BranchInfo::branchDescription_, branchIter(), edm::RootTree::branchType(), edm::roottree::BranchInfo::classCache_, CommonMethods::cp(), edm::RootTree::entryNumberForIndex(), found(), getBranchInfo(), edm::RootTree::getEntry(), edm::DelayedReader::getProduct(), edm::InEvent, inputType_, nextReader_, AlCaHLTBitMon_ParallelJobs::p, edm::roottree::BranchInfo::productBranch_, edm::InputFile::reportReadBranch(), edm::setRefCoreStreamer(), AlCaHLTBitMon_QueryRunRegistry::string, edm::EDProductGetter::transitionIndex(), tree_, and edm::BranchDescription::wrappedName().

32  {
33  iterator iter = branchIter(k);
34  if (!found(iter)) {
35  if (nextReader_) {
36  return nextReader_->getProduct(k, interface, ep);
37  } else {
38  return WrapperOwningHolder();
39  }
40  }
41  roottree::BranchInfo const& branchInfo = getBranchInfo(iter);
42  TBranch* br = branchInfo.productBranch_;
43  if (br == nullptr) {
44  if (nextReader_) {
45  return nextReader_->getProduct(k, interface, ep);
46  } else {
47  return WrapperOwningHolder();
48  }
49  }
50 
52  TClass* cp = branchInfo.classCache_;
53  if(nullptr == cp) {
54  branchInfo.classCache_ = gROOT->GetClass(branchInfo.branchDescription_.wrappedName().c_str());
55  cp = branchInfo.classCache_;
56  }
57  void* p = cp->New();
58  br->SetAddress(&p);
59  tree_.getEntry(br, tree_.entryNumberForIndex(ep->transitionIndex()));
60  if(tree_.branchType() == InEvent) {
61  // CMS-THREADING For the primary input source calls to this function need to be serialized
63  }
64  setRefCoreStreamer(false);
65  WrapperOwningHolder edp(p, interface);
66  return edp;
67  }
WrapperOwningHolder getProduct(BranchKey const &k, WrapperInterfaceBase const *interface, EDProductGetter const *ep)
Definition: DelayedReader.h:22
RootTree const & tree_
void setRefCoreStreamer(bool resetAll=false)
static void reportReadBranch(InputType inputType, std::string const &branchname)
Definition: InputFile.cc:108
BranchInfo const & getBranchInfo(iterator const &iter) const
DelayedReader * nextReader_
BranchType branchType() const
Definition: RootTree.h:151
roottree::BranchMap::const_iterator iterator
int k[5][pyjets_maxn]
EntryNumber const & entryNumberForIndex(unsigned int index) const
Definition: RootTree.cc:91
bool found(iterator const &iter) const
void getEntry(TBranch *branch, EntryNumber entry) const
Definition: RootTree.cc:354
iterator branchIter(BranchKey const &k) const
virtual void edm::RootDelayedReader::mergeReaders_ ( DelayedReader other)
inlineprivatevirtual

Implements edm::DelayedReader.

Definition at line 47 of file RootDelayedReader.h.

References nextReader_.

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

Implements edm::DelayedReader.

Definition at line 48 of file RootDelayedReader.h.

References nextReader_.

48 {nextReader_ = 0;}
DelayedReader * nextReader_

Member Data Documentation

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

Definition at line 56 of file RootDelayedReader.h.

InputType edm::RootDelayedReader::inputType_
private

Definition at line 58 of file RootDelayedReader.h.

Referenced by getProduct_().

DelayedReader* edm::RootDelayedReader::nextReader_
private

Definition at line 57 of file RootDelayedReader.h.

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

RootTree const& edm::RootDelayedReader::tree_
private

Definition at line 55 of file RootDelayedReader.h.

Referenced by branches(), and getProduct_().