![]() |
![]() |
Public Member Functions | |
FWLiteDelayedReader () | |
void | set (boost::shared_ptr< ProductRegistry const > iReg) |
void | setEntry (Long64_t iEntry) |
void | setTree (TTree *iTree) |
Private Member Functions | |
boost::shared_ptr (reg_) | |
virtual std::auto_ptr< EDProduct > | getProduct_ (BranchKey const &k, EDProductGetter const *ep) const |
virtual std::auto_ptr < EventEntryDescription > | getProvenance_ (BranchKey const &) const |
Private Attributes | |
Long64_t | entry_ |
TTree * | eventTree_ |
Definition at line 57 of file TFWLiteSelectorBasic.cc.
edm::root::FWLiteDelayedReader::FWLiteDelayedReader | ( | ) | [inline] |
Definition at line 59 of file TFWLiteSelectorBasic.cc.
: entry_(-1),eventTree_(0),reg_() {}
edm::root::FWLiteDelayedReader::boost::shared_ptr | ( | reg_ | ) | [private] |
std::auto_ptr< EDProduct > edm::root::FWLiteDelayedReader::getProduct_ | ( | BranchKey const & | k, |
EDProductGetter const * | ep | ||
) | const [private, virtual] |
Implements edm::DelayedReader.
Definition at line 74 of file TFWLiteSelectorBasic.cc.
References edm::BranchDescription::branchName(), edm::BranchDescription::className(), entry_, eventTree_, Exception, newFWLiteAna::fullName, gen::k, parseEventContent::prod, edm::errors::ProductNotFound, and edm::wrappedClassName().
{ ProductRegistry::ProductList::const_iterator itFind= reg_->productList().find(k); if(itFind == reg_->productList().end()) { throw Exception(errors::ProductNotFound)<<"could not find entry for product "<<k; } BranchDescription const& bDesc = itFind->second; TBranch* branch= eventTree_->GetBranch(bDesc.branchName().c_str()); if(0 == branch) { throw cms::Exception("MissingBranch") <<"could not find branch named '"<<bDesc.branchName()<<"'" <<"\n Perhaps the data being requested was not saved in this file?"; } //find the class type std::string const fullName = wrappedClassName(bDesc.className()); Reflex::Type classType = Reflex::Type::ByName(fullName); if(classType == Reflex::Type()) { throw cms::Exception("MissingDictionary") <<"could not find dictionary for type '"<<fullName<<"'" <<"\n Please make sure all the necessary libraries are available."; return std::auto_ptr<EDProduct>(); } //use reflex to create an instance of it Reflex::Object wrapperObj = classType.Construct(); if(0 == wrapperObj.Address()) { throw cms::Exception("FailedToCreate") <<"could not create an instance of '"<<fullName<<"'"; } void* address = wrapperObj.Address(); branch->SetAddress(&address); Reflex::Object edProdObj = wrapperObj.CastObject(Reflex::Type::ByName("edm::EDProduct")); EDProduct* prod = reinterpret_cast<EDProduct*>(edProdObj.Address()); if(0 == prod) { throw cms::Exception("FailedConversion") << "failed to convert a '" << fullName << "' to a edm::EDProduct." << "Please contact developers since something is very wrong."; } branch->GetEntry(entry_); return std::auto_ptr<EDProduct>(prod); }
virtual std::auto_ptr<EventEntryDescription> edm::root::FWLiteDelayedReader::getProvenance_ | ( | BranchKey const & | ) | const [inline, private, virtual] |
Definition at line 65 of file TFWLiteSelectorBasic.cc.
{
return std::auto_ptr<EventEntryDescription>();
}
void edm::root::FWLiteDelayedReader::set | ( | boost::shared_ptr< ProductRegistry const > | iReg | ) | [inline] |
Definition at line 62 of file TFWLiteSelectorBasic.cc.
{ reg_ = iReg;}
void edm::root::FWLiteDelayedReader::setEntry | ( | Long64_t | iEntry | ) | [inline] |
void edm::root::FWLiteDelayedReader::setTree | ( | TTree * | iTree | ) | [inline] |
Long64_t edm::root::FWLiteDelayedReader::entry_ [private] |
Definition at line 68 of file TFWLiteSelectorBasic.cc.
Referenced by getProduct_(), and setEntry().
TTree* edm::root::FWLiteDelayedReader::eventTree_ [private] |
Definition at line 69 of file TFWLiteSelectorBasic.cc.
Referenced by getProduct_(), and setTree().