CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
edm::root::FWLiteDelayedReader Class Reference
Inheritance diagram for edm::root::FWLiteDelayedReader:
edm::DelayedReader

Public Member Functions

 FWLiteDelayedReader ()
 
void set (boost::shared_ptr< ProductRegistry const > iReg)
 
void setEntry (Long64_t iEntry)
 
void setTree (TTree *iTree)
 
- Public Member Functions inherited from edm::DelayedReader
WrapperOwningHolder getProduct (BranchKey const &k, WrapperInterfaceBase const *interface, EDProductGetter const *ep)
 
void mergeReaders (DelayedReader *other)
 
void reset ()
 
SharedResourcesAcquirersharedResources () const
 
virtual ~DelayedReader ()
 

Private Member Functions

 boost::shared_ptr (reg_)
 
virtual WrapperOwningHolder getProduct_ (BranchKey const &k, WrapperInterfaceBase const *interface, EDProductGetter const *ep) const override
 
virtual std::auto_ptr
< EventEntryDescription
getProvenance_ (BranchKey const &) const
 
WrapperOwningHolder getTheProduct (BranchKey const &k) const
 
virtual void mergeReaders_ (DelayedReader *) override
 
virtual void reset_ () override
 

Private Attributes

Long64_t entry_
 
TTree * eventTree_
 

Detailed Description

Definition at line 57 of file TFWLiteSelectorBasic.cc.

Constructor & Destructor Documentation

edm::root::FWLiteDelayedReader::FWLiteDelayedReader ( )
inline

Definition at line 59 of file TFWLiteSelectorBasic.cc.

Member Function Documentation

edm::root::FWLiteDelayedReader::boost::shared_ptr ( reg_  )
private
WrapperOwningHolder edm::root::FWLiteDelayedReader::getProduct_ ( BranchKey const &  k,
WrapperInterfaceBase const *  interface,
EDProductGetter const *  ep 
) const
overrideprivatevirtual

Implements edm::DelayedReader.

Definition at line 77 of file TFWLiteSelectorBasic.cc.

References getTheProduct().

77  {
78  return getTheProduct(k);
79  }
WrapperOwningHolder getTheProduct(BranchKey const &k) const
int k[5][pyjets_maxn]
virtual std::auto_ptr<EventEntryDescription> edm::root::FWLiteDelayedReader::getProvenance_ ( BranchKey const &  ) const
inlineprivatevirtual

Definition at line 66 of file TFWLiteSelectorBasic.cc.

66  {
67  return std::auto_ptr<EventEntryDescription>();
68  }
WrapperOwningHolder edm::root::FWLiteDelayedReader::getTheProduct ( BranchKey const &  k) const
private

Definition at line 82 of file TFWLiteSelectorBasic.cc.

References edm::BranchDescription::branchName(), edm::TypeWithDict::byName(), edm::BranchDescription::className(), entry_, eventTree_, edm::hlt::Exception, newFWLiteAna::fullName, edm::BranchDescription::getInterface(), gen::k, edm::errors::ProductNotFound, AlCaHLTBitMon_QueryRunRegistry::string, and edm::wrappedClassName().

Referenced by getProduct_().

82  {
83  ProductRegistry::ProductList::const_iterator itFind= reg_->productList().find(k);
84  if(itFind == reg_->productList().end()) {
85  throw Exception(errors::ProductNotFound) << "could not find entry for product " << k;
86  }
87  BranchDescription const& bDesc = itFind->second;
88 
89  TBranch* branch= eventTree_->GetBranch(bDesc.branchName().c_str());
90  if(nullptr == branch) {
91  throw cms::Exception("MissingBranch")
92  << "could not find branch named '" << bDesc.branchName() << "'"
93  << "\n Perhaps the data being requested was not saved in this file?";
94  }
95  //find the class type
96  std::string const fullName = wrappedClassName(bDesc.className());
97  TypeWithDict classType = TypeWithDict::byName(fullName);
98  if(!bool(classType)) {
99  throw cms::Exception("MissingDictionary")
100  << "could not find dictionary for type '" << fullName << "'"
101  << "\n Please make sure all the necessary libraries are available.";
102  }
103 
104  //create an instance of it
105  void const* address = classType.construct().address();
106  if(nullptr == address) {
107  throw cms::Exception("FailedToCreate") << "could not create an instance of '" << fullName << "'";
108  }
109  branch->SetAddress(&address);
110 
111  branch->GetEntry(entry_);
112  return WrapperOwningHolder(address, bDesc.getInterface());
113  }
static TypeWithDict byName(std::string const &className)
int k[5][pyjets_maxn]
string fullName
std::string wrappedClassName(std::string const &iFullName)
virtual void edm::root::FWLiteDelayedReader::mergeReaders_ ( DelayedReader )
inlineoverrideprivatevirtual

Implements edm::DelayedReader.

Definition at line 69 of file TFWLiteSelectorBasic.cc.

69 {}
virtual void edm::root::FWLiteDelayedReader::reset_ ( )
inlineoverrideprivatevirtual

Implements edm::DelayedReader.

Definition at line 70 of file TFWLiteSelectorBasic.cc.

70 {}
void edm::root::FWLiteDelayedReader::set ( boost::shared_ptr< ProductRegistry const >  iReg)
inline

Definition at line 62 of file TFWLiteSelectorBasic.cc.

Referenced by betterConfigParser.BetterConfigParser::getGeneral().

62 { reg_ = iReg;}
void edm::root::FWLiteDelayedReader::setEntry ( Long64_t  iEntry)
inline

Definition at line 60 of file TFWLiteSelectorBasic.cc.

References entry_.

60 { entry_ = iEntry; }
void edm::root::FWLiteDelayedReader::setTree ( TTree *  iTree)
inline

Definition at line 61 of file TFWLiteSelectorBasic.cc.

References eventTree_.

Member Data Documentation

Long64_t edm::root::FWLiteDelayedReader::entry_
private

Definition at line 71 of file TFWLiteSelectorBasic.cc.

Referenced by getTheProduct(), and setEntry().

TTree* edm::root::FWLiteDelayedReader::eventTree_
private

Definition at line 72 of file TFWLiteSelectorBasic.cc.

Referenced by getTheProduct(), and setTree().