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 Attributes
fwlite::internal::BranchMapReaderStrategyV17 Class Reference
Inheritance diagram for fwlite::internal::BranchMapReaderStrategyV17:
fwlite::internal::Strategy fwlite::internal::BMRStrategy

Public Member Functions

 BranchMapReaderStrategyV17 (TFile *file, int fileVersion)
 
virtual edm::BranchID productToBranchID (const edm::ProductID &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)
 
- Public Member Functions inherited from fwlite::internal::Strategy
virtual const std::vector
< edm::BranchDescription > & 
getBranchDescriptions ()
 
TBranch * getBranchRegistry (edm::ProductRegistry **pReg)
 
virtual const
edm::BranchDescription 
productToBranch (const edm::ProductID &pid)
 
 Strategy (TFile *file, int fileVersion)
 
virtual ~Strategy ()
 
- Public Member Functions inherited from fwlite::internal::BMRStrategy
 BMRStrategy (TFile *file, int fileVersion)
 
virtual ~BMRStrategy ()
 

Private Attributes

std::auto_ptr< edm::BranchIDListsbranchIDLists_
 
edm::BranchListIndexes branchListIndexes_
 
TTree * eventsTree_
 
edm::BranchListIndexespBranchListIndexes_
 

Additional Inherited Members

- Public Types inherited from fwlite::internal::Strategy
typedef std::map
< edm::BranchID,
edm::BranchDescription
bidToDesc
 
- Public Attributes inherited from fwlite::internal::Strategy
std::vector
< edm::BranchDescription
bDesc_
 
bidToDesc branchDescriptionMap_
 
bool mapperFilled_
 
- Public Attributes inherited from fwlite::internal::BMRStrategy
TFile * currentFile_
 
Long_t eventEntry_
 
TTree * eventTree_
 
TUUID fileUUID_
 
int fileVersion_
 
Long_t luminosityBlockEntry_
 
TTree * luminosityBlockTree_
 
Long_t runEntry_
 
TTree * runTree_
 

Detailed Description

Definition at line 403 of file BranchMapReader.cc.

Constructor & Destructor Documentation

fwlite::internal::BranchMapReaderStrategyV17::BranchMapReaderStrategyV17 ( TFile *  file,
int  fileVersion 
)

Definition at line 419 of file BranchMapReader.cc.

References updateFile().

Member Function Documentation

edm::BranchID fwlite::internal::BranchMapReaderStrategyV17::productToBranchID ( const edm::ProductID pid)
virtual

Reimplemented from fwlite::internal::Strategy.

Definition at line 510 of file BranchMapReader.cc.

References branchIDLists_, branchListIndexes_, edm::productIDToBranchID(), and updateMap().

510  {
511  updateMap();
513  }
std::auto_ptr< edm::BranchIDLists > branchIDLists_
BranchID productIDToBranchID(ProductID const &pid, BranchIDLists const &lists, BranchListIndexes const &indexes)
bool fwlite::internal::BranchMapReaderStrategyV17::updateEvent ( Long_t  eventEntry)
virtual

Reimplemented from fwlite::internal::Strategy.

Definition at line 424 of file BranchMapReader.cc.

References fwlite::internal::BMRStrategy::eventEntry_, and fwlite::internal::Strategy::mapperFilled_.

424  {
425 // std::cout << "v11 updateevent " << newevent << std::endl;
426  if (newevent != eventEntry_) {
427  eventEntry_ = newevent;
428  mapperFilled_ = false;
429  }
430  return true;
431  }
bool fwlite::internal::BranchMapReaderStrategyV17::updateFile ( TFile *  file)
virtual

Reimplemented from fwlite::internal::Strategy.

Definition at line 449 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, eventsTree_, edm::poolNames::eventTreeName(), edm::hlt::Exception, fwlite::internal::Strategy::getBranchRegistry(), edm::InEvent, fwlite::internal::Strategy::mapperFilled_, edm::poolNames::metaDataTreeName(), edm::ProductRegistry::productList(), and fwlite::internal::Strategy::updateFile().

Referenced by BranchMapReaderStrategyV17().

449  {
451  mapperFilled_ = false;
452  TTree* metaDataTree = dynamic_cast<TTree*>(currentFile_->Get(edm::poolNames::metaDataTreeName().c_str()));
453  if(0==metaDataTree) {
455  }
457  edm::BranchIDLists* branchIDListsPtr = branchIDLists_.get();
458  if (metaDataTree->FindBranch(edm::poolNames::branchIDListBranchName().c_str()) != 0) {
459  TBranch* b = metaDataTree->GetBranch(edm::poolNames::branchIDListBranchName().c_str());
460  b->SetAddress(&branchIDListsPtr);
461  b->GetEntry(0);
462 // std::cout << "--> " << branchIDLists_->size() << std::endl;
463  } else {
465  << "FindBranch of branchIDList failed";
466  return false;
467  }
468 
469  eventsTree_ = dynamic_cast<TTree*>(currentFile_->Get(edm::poolNames::eventTreeName().c_str()));
470 
471  branchDescriptionMap_.clear();
472  bDesc_.clear();
473 
475  edm::ProductRegistry* pReg = &reg;
476  TBranch *br = getBranchRegistry(&pReg);
477 
478  if (0 != br) {
479  const edm::ProductRegistry::ProductList& prodList = reg.productList();
480 
481  for(edm::ProductRegistry::ProductList::const_iterator it = prodList.begin(), itEnd = prodList.end(); it != itEnd; ++it) {
482  if (edm::InEvent == it->second.branchType()) {
483  // call to regenerate branchName
484  it->second.init();
485  branchDescriptionMap_.insert(bidToDesc::value_type(it->second.branchID(), it->second));
486 // std::cout << "v11 updatefile " << it->second.branchID() << std::endl;
487  }
488  }
489  }
490  return 0 != br;
491  }
std::auto_ptr< edm::BranchIDLists > branchIDLists_
std::vector< BranchIDList > BranchIDLists
Definition: BranchIDList.h:19
list file
Definition: dbtoweb.py:253
std::map< BranchKey, BranchDescription > ProductList
Container::value_type value_type
std::vector< edm::BranchDescription > bDesc_
ProductList const & productList() const
TBranch * getBranchRegistry(edm::ProductRegistry **pReg)
std::string const & metaDataTreeName()
Definition: BranchType.cc:157
double b
Definition: hdecay.h:120
virtual bool updateFile(TFile *file)
author Stefano ARGIRO author Bill Tanenbaum
std::string const & eventTreeName()
Definition: BranchType.cc:244
std::string const & branchIDListBranchName()
Definition: BranchType.cc:197
bool fwlite::internal::BranchMapReaderStrategyV17::updateLuminosityBlock ( Long_t  luminosityBlockEntry)
virtual

Reimplemented from fwlite::internal::Strategy.

Definition at line 433 of file BranchMapReader.cc.

References fwlite::internal::BMRStrategy::luminosityBlockEntry_, and fwlite::internal::Strategy::mapperFilled_.

433  {
434  if (newlumi != luminosityBlockEntry_) {
435  luminosityBlockEntry_ = newlumi;
436  mapperFilled_ = false;
437  }
438  return true;
439  }
bool fwlite::internal::BranchMapReaderStrategyV17::updateMap ( )
virtual

Reimplemented from fwlite::internal::Strategy.

Definition at line 493 of file BranchMapReader.cc.

References edm::poolNames::branchListIndexesBranchName(), edm::errors::EventCorruption, fwlite::internal::BMRStrategy::eventEntry_, eventsTree_, edm::hlt::Exception, fwlite::internal::Strategy::mapperFilled_, and pBranchListIndexes_.

Referenced by productToBranchID().

493  {
494  if (!mapperFilled_) {
495  TBranch* branchListIndexesBranch = eventsTree_->GetBranch(edm::poolNames::branchListIndexesBranchName().c_str());
496  if (!branchListIndexesBranch) {
498  << "Failed to find history branch in event history tree";
499  return false;
500  }
501  // yes, SetAddress really does need to be called every time...
502  branchListIndexesBranch->SetAddress(&pBranchListIndexes_);
503  branchListIndexesBranch->GetEntry(eventEntry_);
504  mapperFilled_ = true;
505  }
506  return true;
507  }
std::string const & branchListIndexesBranchName()
Definition: BranchType.cc:231
bool fwlite::internal::BranchMapReaderStrategyV17::updateRun ( Long_t  runEntry)
virtual

Reimplemented from fwlite::internal::Strategy.

Definition at line 441 of file BranchMapReader.cc.

References fwlite::internal::Strategy::mapperFilled_, and fwlite::internal::BMRStrategy::runEntry_.

441  {
442  if (newRun != runEntry_) {
443  runEntry_ = newRun;
444  mapperFilled_ = false;
445  }
446  return true;
447  }

Member Data Documentation

std::auto_ptr<edm::BranchIDLists> fwlite::internal::BranchMapReaderStrategyV17::branchIDLists_
private

Definition at line 413 of file BranchMapReader.cc.

Referenced by productToBranchID(), and updateFile().

edm::BranchListIndexes fwlite::internal::BranchMapReaderStrategyV17::branchListIndexes_
private

Definition at line 415 of file BranchMapReader.cc.

Referenced by productToBranchID().

TTree* fwlite::internal::BranchMapReaderStrategyV17::eventsTree_
private

Definition at line 414 of file BranchMapReader.cc.

Referenced by updateFile(), and updateMap().

edm::BranchListIndexes* fwlite::internal::BranchMapReaderStrategyV17::pBranchListIndexes_
private

Definition at line 416 of file BranchMapReader.cc.

Referenced by updateMap().