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

virtual edm::BranchListIndexes
const & 
branchListIndexes () const
 
 BranchMapReaderStrategyV17 (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)
 
- Public Member Functions inherited from fwlite::internal::Strategy
virtual std::vector
< edm::BranchDescription >
const & 
getBranchDescriptions ()
 
TBranch * getBranchRegistry (edm::ProductRegistry **pReg)
 
virtual edm::BranchDescription
const & 
productToBranch (edm::ProductID const &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 414 of file BranchMapReader.cc.

Constructor & Destructor Documentation

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

Member Function Documentation

virtual edm::BranchListIndexes const& fwlite::internal::BranchMapReaderStrategyV17::branchListIndexes ( ) const
inlinevirtual

Implements fwlite::internal::BMRStrategy.

Definition at line 423 of file BranchMapReader.cc.

References branchListIndexes_.

423 {return branchListIndexes_;}
edm::BranchID fwlite::internal::BranchMapReaderStrategyV17::productToBranchID ( edm::ProductID const &  pid)
virtual

Reimplemented from fwlite::internal::Strategy.

Definition at line 522 of file BranchMapReader.cc.

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

522  {
523  updateMap();
525  }
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 436 of file BranchMapReader.cc.

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

436  {
437 // std::cout << "v11 updateevent " << newevent << std::endl;
438  if(newevent != eventEntry_) {
439  eventEntry_ = newevent;
440  mapperFilled_ = false;
441  }
442  return true;
443  }
bool fwlite::internal::BranchMapReaderStrategyV17::updateFile ( TFile *  file)
virtual

Reimplemented from fwlite::internal::Strategy.

Definition at line 461 of file BranchMapReader.cc.

References b, fwlite::internal::Strategy::bDesc_, scaleCards::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().

461  {
463  mapperFilled_ = false;
464  TTree* metaDataTree = dynamic_cast<TTree*>(currentFile_->Get(edm::poolNames::metaDataTreeName().c_str()));
465  if(0==metaDataTree) {
467  }
469  edm::BranchIDLists* branchIDListsPtr = branchIDLists_.get();
470  if(metaDataTree->FindBranch(edm::poolNames::branchIDListBranchName().c_str()) != 0) {
471  TBranch* b = metaDataTree->GetBranch(edm::poolNames::branchIDListBranchName().c_str());
472  b->SetAddress(&branchIDListsPtr);
473  b->GetEntry(0);
474 // std::cout << "--> " << branchIDLists_->size() << std::endl;
475  } else {
477  << "FindBranch of branchIDList failed";
478  return false;
479  }
480 
481  eventsTree_ = dynamic_cast<TTree*>(currentFile_->Get(edm::poolNames::eventTreeName().c_str()));
482 
483  branchDescriptionMap_.clear();
484  bDesc_.clear();
485 
487  edm::ProductRegistry* pReg = &reg;
488  TBranch *br = getBranchRegistry(&pReg);
489 
490  if(0 != br) {
491  edm::ProductRegistry::ProductList const& prodList = reg.productList();
492 
493  for(edm::ProductRegistry::ProductList::const_iterator it = prodList.begin(), itEnd = prodList.end(); it != itEnd; ++it) {
494  if(edm::InEvent == it->second.branchType()) {
495  // call to regenerate branchName
496  it->second.init();
497  branchDescriptionMap_.insert(bidToDesc::value_type(it->second.branchID(), it->second));
498 // std::cout << "v11 updatefile " << it->second.branchID() << std::endl;
499  }
500  }
501  }
502  return 0 != br;
503  }
std::auto_ptr< edm::BranchIDLists > branchIDLists_
std::vector< BranchIDList > BranchIDLists
Definition: BranchIDList.h:19
std::map< BranchKey, BranchDescription > ProductList
std::vector< edm::BranchDescription > bDesc_
ProductList const & productList() const
tuple br
Definition: scaleCards.py:54
TBranch * getBranchRegistry(edm::ProductRegistry **pReg)
std::string const & metaDataTreeName()
Definition: BranchType.cc:167
Container::value_type value_type
double b
Definition: hdecay.h:120
virtual bool updateFile(TFile *file)
author Stefano ARGIRO author Bill Tanenbaum
std::string const & eventTreeName()
Definition: BranchType.cc:254
std::string const & branchIDListBranchName()
Definition: BranchType.cc:207
bool fwlite::internal::BranchMapReaderStrategyV17::updateLuminosityBlock ( Long_t  luminosityBlockEntry)
virtual

Reimplemented from fwlite::internal::Strategy.

Definition at line 445 of file BranchMapReader.cc.

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

445  {
446  if(newlumi != luminosityBlockEntry_) {
447  luminosityBlockEntry_ = newlumi;
448  mapperFilled_ = false;
449  }
450  return true;
451  }
bool fwlite::internal::BranchMapReaderStrategyV17::updateMap ( )
virtual

Reimplemented from fwlite::internal::Strategy.

Definition at line 505 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().

505  {
506  if(!mapperFilled_) {
507  TBranch* branchListIndexesBranch = eventsTree_->GetBranch(edm::poolNames::branchListIndexesBranchName().c_str());
508  if(!branchListIndexesBranch) {
510  << "Failed to find branch list indexes branch in event tree";
511  return false;
512  }
513  // yes, SetAddress really does need to be called every time...
514  branchListIndexesBranch->SetAddress(&pBranchListIndexes_);
515  branchListIndexesBranch->GetEntry(eventEntry_);
516  mapperFilled_ = true;
517  }
518  return true;
519  }
std::string const & branchListIndexesBranchName()
Definition: BranchType.cc:241
bool fwlite::internal::BranchMapReaderStrategyV17::updateRun ( Long_t  runEntry)
virtual

Reimplemented from fwlite::internal::Strategy.

Definition at line 453 of file BranchMapReader.cc.

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

453  {
454  if(newRun != runEntry_) {
455  runEntry_ = newRun;
456  mapperFilled_ = false;
457  }
458  return true;
459  }

Member Data Documentation

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

Definition at line 425 of file BranchMapReader.cc.

Referenced by productToBranchID(), and updateFile().

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

Definition at line 427 of file BranchMapReader.cc.

Referenced by branchListIndexes(), and productToBranchID().

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

Definition at line 426 of file BranchMapReader.cc.

Referenced by updateFile(), and updateMap().

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

Definition at line 428 of file BranchMapReader.cc.

Referenced by updateMap().