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 edm::BranchDescription
const & 
branchIDToBranch (edm::BranchID const &bid) const override
 
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
edm::ThinnedAssociationsHelper
const & 
thinnedAssociationsHelper () const override
 
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_
 
std::unique_ptr
< edm::ThinnedAssociationsHelper
thinnedAssociationsHelper_
 
- 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 434 of file BranchMapReader.cc.

Constructor & Destructor Documentation

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

Definition at line 451 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 443 of file BranchMapReader.cc.

References branchListIndexes_.

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

Reimplemented from fwlite::internal::Strategy.

Definition at line 553 of file BranchMapReader.cc.

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

553  {
554  updateMap();
556  }
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 456 of file BranchMapReader.cc.

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

456  {
457 // std::cout << "v11 updateevent " << newevent << std::endl;
458  if(newevent != eventEntry_) {
459  eventEntry_ = newevent;
460  mapperFilled_ = false;
461  }
462  return true;
463  }
bool fwlite::internal::BranchMapReaderStrategyV17::updateFile ( TFile *  file)
overridevirtual

Reimplemented from fwlite::internal::Strategy.

Definition at line 481 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(), fwlite::internal::Strategy::thinnedAssociationsHelper_, edm::poolNames::thinnedAssociationsHelperBranchName(), and fwlite::internal::Strategy::updateFile().

Referenced by BranchMapReaderStrategyV17().

481  {
483  mapperFilled_ = false;
484  TTree* metaDataTree = dynamic_cast<TTree*>(currentFile_->Get(edm::poolNames::metaDataTreeName().c_str()));
485  if(0==metaDataTree) {
487  }
488 
490  edm::ThinnedAssociationsHelper* thinnedAssociationsHelperPtr = thinnedAssociationsHelper_.get();
491  if(metaDataTree->FindBranch(edm::poolNames::thinnedAssociationsHelperBranchName().c_str()) != nullptr) {
492  TBranch* b = metaDataTree->GetBranch(edm::poolNames::thinnedAssociationsHelperBranchName().c_str());
493  b->SetAddress(&thinnedAssociationsHelperPtr);
494  b->GetEntry(0);
495  }
496 
498  edm::BranchIDLists* branchIDListsPtr = branchIDLists_.get();
499  if(metaDataTree->FindBranch(edm::poolNames::branchIDListBranchName().c_str()) != 0) {
500  TBranch* b = metaDataTree->GetBranch(edm::poolNames::branchIDListBranchName().c_str());
501  b->SetAddress(&branchIDListsPtr);
502  b->GetEntry(0);
503 // std::cout << "--> " << branchIDLists_->size() << std::endl;
504  } else {
506  << "FindBranch of branchIDList failed";
507  return false;
508  }
509 
510  eventsTree_ = dynamic_cast<TTree*>(currentFile_->Get(edm::poolNames::eventTreeName().c_str()));
511 
512  branchDescriptionMap_.clear();
513  bDesc_.clear();
514 
516  edm::ProductRegistry* pReg = &reg;
517  TBranch *br = getBranchRegistry(&pReg);
518 
519  if(0 != br) {
521 
522  for(auto& item : prodList) {
523  edm::BranchDescription& prod = item.second;
524  if(edm::InEvent == prod.branchType()) {
525  // call to regenerate branchName
526  prod.init();
528 // std::cout << "v11 updatefile " << prod.branchID() << std::endl;
529  }
530  }
531  }
532  reg.setFrozen(false);
533  return 0 != br;
534  }
BranchType const & branchType() const
std::vector< BranchIDList > BranchIDLists
Definition: BranchIDList.h:19
std::unique_ptr< edm::ThinnedAssociationsHelper > thinnedAssociationsHelper_
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:168
void setFrozen(bool initializeLookupInfo=true)
Container::value_type value_type
double b
Definition: hdecay.h:120
ProductList & productListUpdator()
std::string const & thinnedAssociationsHelperBranchName()
Definition: BranchType.cc:213
std::string const & eventTreeName()
Definition: BranchType.cc:260
std::string const & branchIDListBranchName()
Definition: BranchType.cc:208
bool fwlite::internal::BranchMapReaderStrategyV17::updateLuminosityBlock ( Long_t  luminosityBlockEntry)
overridevirtual

Reimplemented from fwlite::internal::Strategy.

Definition at line 465 of file BranchMapReader.cc.

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

465  {
466  if(newlumi != luminosityBlockEntry_) {
467  luminosityBlockEntry_ = newlumi;
468  mapperFilled_ = false;
469  }
470  return true;
471  }
bool fwlite::internal::BranchMapReaderStrategyV17::updateMap ( )
overridevirtual

Reimplemented from fwlite::internal::Strategy.

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

536  {
537  if(!mapperFilled_) {
538  TBranch* branchListIndexesBranch = eventsTree_->GetBranch(edm::poolNames::branchListIndexesBranchName().c_str());
539  if(!branchListIndexesBranch) {
541  << "Failed to find branch list indexes branch in event tree";
542  return false;
543  }
544  // yes, SetAddress really does need to be called every time...
545  branchListIndexesBranch->SetAddress(&pBranchListIndexes_);
546  branchListIndexesBranch->GetEntry(eventEntry_);
547  mapperFilled_ = true;
548  }
549  return true;
550  }
std::string const & branchListIndexesBranchName()
Definition: BranchType.cc:247
bool fwlite::internal::BranchMapReaderStrategyV17::updateRun ( Long_t  runEntry)
overridevirtual

Reimplemented from fwlite::internal::Strategy.

Definition at line 473 of file BranchMapReader.cc.

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

473  {
474  if(newRun != runEntry_) {
475  runEntry_ = newRun;
476  mapperFilled_ = false;
477  }
478  return true;
479  }

Member Data Documentation

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

Definition at line 445 of file BranchMapReader.cc.

Referenced by productToBranchID(), and updateFile().

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

Definition at line 447 of file BranchMapReader.cc.

Referenced by branchListIndexes(), and productToBranchID().

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

Definition at line 446 of file BranchMapReader.cc.

Referenced by updateFile(), and updateMap().

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

Definition at line 448 of file BranchMapReader.cc.

Referenced by updateMap().