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 override
 
 BranchMapReaderStrategyV17 (TFile *file, int fileVersion)
 
virtual edm::BranchID productToBranchID (edm::ProductID const &pid) override
 
virtual bool updateEvent (Long_t eventEntry) override
 
virtual bool updateFile (TFile *file) override
 
virtual bool updateLuminosityBlock (Long_t luminosityBlockEntry) override
 
virtual bool updateMap () override
 
virtual bool updateRun (Long_t runEntry) override
 
- Public Member Functions inherited from fwlite::internal::Strategy
virtual std::vector
< edm::BranchDescription >
const & 
getBranchDescriptions () override
 
TBranch * getBranchRegistry (edm::ProductRegistry **pReg)
 
virtual edm::BranchDescription
const & 
productToBranch (edm::ProductID const &pid) override
 
 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 421 of file BranchMapReader.cc.

Constructor & Destructor Documentation

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

Definition at line 438 of file BranchMapReader.cc.

References updateFile().

Member Function Documentation

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

Implements fwlite::internal::BMRStrategy.

Definition at line 430 of file BranchMapReader.cc.

References branchListIndexes_.

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

Reimplemented from fwlite::internal::Strategy.

Definition at line 531 of file BranchMapReader.cc.

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

531  {
532  updateMap();
534  }
std::auto_ptr< edm::BranchIDLists > branchIDLists_
BranchID productIDToBranchID(ProductID const &pid, BranchIDLists const &lists, BranchListIndexes const &indexes)
tuple pid
Definition: sysUtil.py:22
bool fwlite::internal::BranchMapReaderStrategyV17::updateEvent ( Long_t  eventEntry)
overridevirtual

Reimplemented from fwlite::internal::Strategy.

Definition at line 443 of file BranchMapReader.cc.

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

443  {
444 // std::cout << "v11 updateevent " << newevent << std::endl;
445  if(newevent != eventEntry_) {
446  eventEntry_ = newevent;
447  mapperFilled_ = false;
448  }
449  return true;
450  }
bool fwlite::internal::BranchMapReaderStrategyV17::updateFile ( TFile *  file)
overridevirtual

Reimplemented from fwlite::internal::Strategy.

Definition at line 468 of file BranchMapReader.cc.

References b, fwlite::internal::Strategy::bDesc_, beamvalidation::br, fwlite::internal::Strategy::branchDescriptionMap_, edm::BranchDescription::branchID(), edm::poolNames::branchIDListBranchName(), branchIDLists_, edm::BranchDescription::branchType(), fwlite::internal::BMRStrategy::currentFile_, edm::errors::EventCorruption, eventsTree_, edm::poolNames::eventTreeName(), edm::hlt::Exception, fwlite::internal::Strategy::getBranchRegistry(), edm::InEvent, edm::BranchDescription::init(), fwlite::internal::Strategy::mapperFilled_, edm::poolNames::metaDataTreeName(), parseEventContent::prod, edm::ProductRegistry::productListUpdator(), edm::ProductRegistry::setFrozen(), and fwlite::internal::Strategy::updateFile().

Referenced by BranchMapReaderStrategyV17().

468  {
470  mapperFilled_ = false;
471  TTree* metaDataTree = dynamic_cast<TTree*>(currentFile_->Get(edm::poolNames::metaDataTreeName().c_str()));
472  if(0==metaDataTree) {
474  }
476  edm::BranchIDLists* branchIDListsPtr = branchIDLists_.get();
477  if(metaDataTree->FindBranch(edm::poolNames::branchIDListBranchName().c_str()) != 0) {
478  TBranch* b = metaDataTree->GetBranch(edm::poolNames::branchIDListBranchName().c_str());
479  b->SetAddress(&branchIDListsPtr);
480  b->GetEntry(0);
481 // std::cout << "--> " << branchIDLists_->size() << std::endl;
482  } else {
484  << "FindBranch of branchIDList failed";
485  return false;
486  }
487 
488  eventsTree_ = dynamic_cast<TTree*>(currentFile_->Get(edm::poolNames::eventTreeName().c_str()));
489 
490  branchDescriptionMap_.clear();
491  bDesc_.clear();
492 
494  edm::ProductRegistry* pReg = &reg;
495  TBranch *br = getBranchRegistry(&pReg);
496 
497  if(0 != br) {
499 
500  for(auto& item : prodList) {
501  edm::BranchDescription& prod = item.second;
502  if(edm::InEvent == prod.branchType()) {
503  // call to regenerate branchName
504  prod.init();
506 // std::cout << "v11 updatefile " << prod.branchID() << std::endl;
507  }
508  }
509  }
510  reg.setFrozen(false);
511  return 0 != br;
512  }
BranchType const & branchType() const
std::vector< BranchIDList > BranchIDLists
Definition: BranchIDList.h:19
std::auto_ptr< edm::BranchIDLists > branchIDLists_
std::map< BranchKey, BranchDescription > ProductList
virtual bool updateFile(TFile *file) override
std::vector< edm::BranchDescription > bDesc_
TBranch * getBranchRegistry(edm::ProductRegistry **pReg)
BranchID const & branchID() const
std::string const & metaDataTreeName()
Definition: BranchType.cc:167
void setFrozen(bool initializeLookupInfo=true)
Container::value_type value_type
double b
Definition: hdecay.h:120
ProductList & productListUpdator()
std::string const & eventTreeName()
Definition: BranchType.cc:254
std::string const & branchIDListBranchName()
Definition: BranchType.cc:207
bool fwlite::internal::BranchMapReaderStrategyV17::updateLuminosityBlock ( Long_t  luminosityBlockEntry)
overridevirtual

Reimplemented from fwlite::internal::Strategy.

Definition at line 452 of file BranchMapReader.cc.

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

452  {
453  if(newlumi != luminosityBlockEntry_) {
454  luminosityBlockEntry_ = newlumi;
455  mapperFilled_ = false;
456  }
457  return true;
458  }
bool fwlite::internal::BranchMapReaderStrategyV17::updateMap ( )
overridevirtual

Reimplemented from fwlite::internal::Strategy.

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

514  {
515  if(!mapperFilled_) {
516  TBranch* branchListIndexesBranch = eventsTree_->GetBranch(edm::poolNames::branchListIndexesBranchName().c_str());
517  if(!branchListIndexesBranch) {
519  << "Failed to find branch list indexes branch in event tree";
520  return false;
521  }
522  // yes, SetAddress really does need to be called every time...
523  branchListIndexesBranch->SetAddress(&pBranchListIndexes_);
524  branchListIndexesBranch->GetEntry(eventEntry_);
525  mapperFilled_ = true;
526  }
527  return true;
528  }
std::string const & branchListIndexesBranchName()
Definition: BranchType.cc:241
bool fwlite::internal::BranchMapReaderStrategyV17::updateRun ( Long_t  runEntry)
overridevirtual

Reimplemented from fwlite::internal::Strategy.

Definition at line 460 of file BranchMapReader.cc.

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

460  {
461  if(newRun != runEntry_) {
462  runEntry_ = newRun;
463  mapperFilled_ = false;
464  }
465  return true;
466  }

Member Data Documentation

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

Definition at line 432 of file BranchMapReader.cc.

Referenced by productToBranchID(), and updateFile().

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

Definition at line 434 of file BranchMapReader.cc.

Referenced by branchListIndexes(), and productToBranchID().

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

Definition at line 433 of file BranchMapReader.cc.

Referenced by updateFile(), and updateMap().

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

Definition at line 435 of file BranchMapReader.cc.

Referenced by updateMap().