Public Member Functions | |
virtual edm::BranchListIndexes const & | branchListIndexes () const |
BranchMapReaderStrategyV11 (TFile *file, int fileVersion) | |
virtual edm::BranchID | productToBranchID (edm::ProductID const &pid) |
virtual bool | updateEvent (Long_t eventEntry) |
virtual bool | updateFile (TFile *file) |
virtual bool | updateLuminosityBlock (Long_t luminosityBlockEntry) |
virtual bool | updateMap () |
virtual bool | updateRun (Long_t runEntry) |
Private Attributes | |
std::auto_ptr< edm::BranchIDLists > | branchIDLists_ |
TTree * | eventHistoryTree_ |
edm::History | history_ |
edm::History * | pHistory_ |
Definition at line 299 of file BranchMapReader.cc.
fwlite::internal::BranchMapReaderStrategyV11::BranchMapReaderStrategyV11 | ( | TFile * | file, |
int | fileVersion | ||
) |
Definition at line 316 of file BranchMapReader.cc.
References updateFile().
: Strategy(file, fileVersion), eventHistoryTree_(0), pHistory_(&history_) { updateFile(file); }
virtual edm::BranchListIndexes const& fwlite::internal::BranchMapReaderStrategyV11::branchListIndexes | ( | ) | const [inline, virtual] |
Implements fwlite::internal::BMRStrategy.
Definition at line 308 of file BranchMapReader.cc.
References edm::History::branchListIndexes(), and history_.
{return history_.branchListIndexes();}
edm::BranchID fwlite::internal::BranchMapReaderStrategyV11::productToBranchID | ( | edm::ProductID const & | pid | ) | [virtual] |
Reimplemented from fwlite::internal::Strategy.
Definition at line 409 of file BranchMapReader.cc.
References branchIDLists_, edm::History::branchListIndexes(), history_, edm::productIDToBranchID(), and updateMap().
{ updateMap(); return edm::productIDToBranchID(pid, *branchIDLists_, history_.branchListIndexes()); }
bool fwlite::internal::BranchMapReaderStrategyV11::updateEvent | ( | Long_t | eventEntry | ) | [virtual] |
Reimplemented from fwlite::internal::Strategy.
Definition at line 321 of file BranchMapReader.cc.
References fwlite::internal::BMRStrategy::eventEntry_, and fwlite::internal::Strategy::mapperFilled_.
{ // std::cout << "v11 updateevent " << newevent << std::endl; if(newevent != eventEntry_) { eventEntry_ = newevent; mapperFilled_ = false; } return true; }
bool fwlite::internal::BranchMapReaderStrategyV11::updateFile | ( | TFile * | file | ) | [virtual] |
Reimplemented from fwlite::internal::Strategy.
Definition at line 346 of file BranchMapReader.cc.
References b, fwlite::internal::Strategy::bDesc_, beamvalidation::br, fwlite::internal::Strategy::branchDescriptionMap_, edm::poolNames::branchIDListBranchName(), branchIDLists_, fwlite::internal::BMRStrategy::currentFile_, edm::errors::EventCorruption, eventHistoryTree_, edm::poolNames::eventHistoryTreeName(), Exception, fwlite::internal::Strategy::getBranchRegistry(), edm::InEvent, fwlite::internal::Strategy::mapperFilled_, edm::poolNames::metaDataTreeName(), and edm::ProductRegistry::productList().
Referenced by BranchMapReaderStrategyV11().
{ Strategy::updateFile(file); mapperFilled_ = false; TTree* metaDataTree = dynamic_cast<TTree*>(currentFile_->Get(edm::poolNames::metaDataTreeName().c_str())); if(0 == metaDataTree) { throw edm::Exception(edm::errors::EventCorruption) <<"No "<<edm::poolNames::metaDataTreeName()<<" TTree in file"; } branchIDLists_.reset(new edm::BranchIDLists); edm::BranchIDLists* branchIDListsPtr = branchIDLists_.get(); if(metaDataTree->FindBranch(edm::poolNames::branchIDListBranchName().c_str()) != 0) { TBranch* b = metaDataTree->GetBranch(edm::poolNames::branchIDListBranchName().c_str()); b->SetAddress(&branchIDListsPtr); b->GetEntry(0); // std::cout << "--> " << branchIDLists_->size() << std::endl; } else { throw edm::Exception(edm::errors::EventCorruption) << "FindBranch of branchIDList failed"; return false; } eventHistoryTree_ = dynamic_cast<TTree*>(currentFile_->Get(edm::poolNames::eventHistoryTreeName().c_str())); branchDescriptionMap_.clear(); bDesc_.clear(); edm::ProductRegistry reg; edm::ProductRegistry* pReg = ® TBranch *br = getBranchRegistry(&pReg); if(0 != br) { edm::ProductRegistry::ProductList const& prodList = reg.productList(); for(edm::ProductRegistry::ProductList::const_iterator it = prodList.begin(), itEnd = prodList.end(); it != itEnd; ++it) { if(edm::InEvent == it->second.branchType()) { // call to regenerate branchName it->second.init(); branchDescriptionMap_.insert(bidToDesc::value_type(it->second.branchID(), it->second)); // std::cout << "v11 updatefile " << it->second.branchID() << std::endl; } } } return 0 != br; }
bool fwlite::internal::BranchMapReaderStrategyV11::updateLuminosityBlock | ( | Long_t | luminosityBlockEntry | ) | [virtual] |
Reimplemented from fwlite::internal::Strategy.
Definition at line 330 of file BranchMapReader.cc.
References fwlite::internal::BMRStrategy::luminosityBlockEntry_, and fwlite::internal::Strategy::mapperFilled_.
{ if(newlumi != luminosityBlockEntry_) { luminosityBlockEntry_ = newlumi; mapperFilled_ = false; } return true; }
bool fwlite::internal::BranchMapReaderStrategyV11::updateMap | ( | ) | [virtual] |
Reimplemented from fwlite::internal::Strategy.
Definition at line 392 of file BranchMapReader.cc.
References edm::errors::EventCorruption, fwlite::internal::BMRStrategy::eventEntry_, edm::poolNames::eventHistoryBranchName(), eventHistoryTree_, Exception, fwlite::internal::Strategy::mapperFilled_, and pHistory_.
Referenced by productToBranchID().
{ if(!mapperFilled_) { TBranch* eventHistoryBranch = eventHistoryTree_->GetBranch(edm::poolNames::eventHistoryBranchName().c_str()); if(!eventHistoryBranch) { throw edm::Exception(edm::errors::EventCorruption) << "Failed to find history branch in event history tree"; return false; } // yes, SetAddress really does need to be called every time... eventHistoryBranch->SetAddress(&pHistory_); eventHistoryTree_->GetEntry(eventEntry_); mapperFilled_ = true; } return true; }
bool fwlite::internal::BranchMapReaderStrategyV11::updateRun | ( | Long_t | runEntry | ) | [virtual] |
Reimplemented from fwlite::internal::Strategy.
Definition at line 338 of file BranchMapReader.cc.
References fwlite::internal::Strategy::mapperFilled_, and fwlite::internal::BMRStrategy::runEntry_.
{ if(newRun != runEntry_) { runEntry_ = newRun; mapperFilled_ = false; } return true; }
std::auto_ptr<edm::BranchIDLists> fwlite::internal::BranchMapReaderStrategyV11::branchIDLists_ [private] |
Definition at line 310 of file BranchMapReader.cc.
Referenced by productToBranchID(), and updateFile().
TTree* fwlite::internal::BranchMapReaderStrategyV11::eventHistoryTree_ [private] |
Definition at line 311 of file BranchMapReader.cc.
Referenced by updateFile(), and updateMap().
Definition at line 312 of file BranchMapReader.cc.
Referenced by branchListIndexes(), and productToBranchID().
Definition at line 313 of file BranchMapReader.cc.
Referenced by updateMap().