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

Public Member Functions

virtual edm::BranchListIndexes
const & 
branchListIndexes () const override
 
 BranchMapReaderStrategyV11 (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_
 
TTree * eventHistoryTree_
 
edm::History history_
 
edm::HistorypHistory_
 

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 317 of file BranchMapReader.cc.

Constructor & Destructor Documentation

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

Member Function Documentation

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

Implements fwlite::internal::BMRStrategy.

Definition at line 326 of file BranchMapReader.cc.

References edm::History::branchListIndexes(), and history_.

326 {return history_.branchListIndexes();}
BranchListIndexes const & branchListIndexes() const
Definition: History.h:50
edm::BranchID fwlite::internal::BranchMapReaderStrategyV11::productToBranchID ( edm::ProductID const &  pid)
overridevirtual

Reimplemented from fwlite::internal::Strategy.

Definition at line 429 of file BranchMapReader.cc.

References branchIDLists_, edm::History::branchListIndexes(), history_, edm::productIDToBranchID(), and updateMap().

429  {
430  updateMap();
432  }
BranchID productIDToBranchID(ProductID const &pid, BranchIDLists const &lists, BranchListIndexes const &indexes)
std::auto_ptr< edm::BranchIDLists > branchIDLists_
BranchListIndexes const & branchListIndexes() const
Definition: History.h:50
tuple pid
Definition: sysUtil.py:22
bool fwlite::internal::BranchMapReaderStrategyV11::updateEvent ( Long_t  eventEntry)
overridevirtual

Reimplemented from fwlite::internal::Strategy.

Definition at line 339 of file BranchMapReader.cc.

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

339  {
340 // std::cout << "v11 updateevent " << newevent << std::endl;
341  if(newevent != eventEntry_) {
342  eventEntry_ = newevent;
343  mapperFilled_ = false;
344  }
345  return true;
346  }
bool fwlite::internal::BranchMapReaderStrategyV11::updateFile ( TFile *  file)
overridevirtual

Reimplemented from fwlite::internal::Strategy.

Definition at line 364 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, eventHistoryTree_, edm::poolNames::eventHistoryTreeName(), 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 BranchMapReaderStrategyV11().

364  {
366  mapperFilled_ = false;
367  TTree* metaDataTree = dynamic_cast<TTree*>(currentFile_->Get(edm::poolNames::metaDataTreeName().c_str()));
368 
369  if(0 == metaDataTree) {
371  <<"No "<<edm::poolNames::metaDataTreeName()<<" TTree in file";
372  }
374  edm::BranchIDLists* branchIDListsPtr = branchIDLists_.get();
375  if(metaDataTree->FindBranch(edm::poolNames::branchIDListBranchName().c_str()) != 0) {
376  TBranch* b = metaDataTree->GetBranch(edm::poolNames::branchIDListBranchName().c_str());
377  b->SetAddress(&branchIDListsPtr);
378  b->GetEntry(0);
379 // std::cout << "--> " << branchIDLists_->size() << std::endl;
380  } else {
382  << "FindBranch of branchIDList failed";
383  return false;
384  }
385 
386  eventHistoryTree_ = dynamic_cast<TTree*>(currentFile_->Get(edm::poolNames::eventHistoryTreeName().c_str()));
387 
388  branchDescriptionMap_.clear();
389  bDesc_.clear();
390 
392  edm::ProductRegistry* pReg = &reg;
393  TBranch *br = getBranchRegistry(&pReg);
394 
395  if(0 != br) {
397 
398  for(auto& item : prodList) {
399  edm::BranchDescription& prod = item.second;
400  if(edm::InEvent == prod.branchType()) {
401  // call to regenerate branchName
402  prod.init();
404 // std::cout << "v11 updatefile " << prod.branchID() << std::endl;
405  }
406  }
407  }
408  reg.setFrozen(false);
409  return 0 != br;
410  }
BranchType const & branchType() const
std::vector< BranchIDList > BranchIDLists
Definition: BranchIDList.h:19
std::map< BranchKey, BranchDescription > ProductList
virtual bool updateFile(TFile *file) override
std::vector< edm::BranchDescription > bDesc_
std::auto_ptr< edm::BranchIDLists > branchIDLists_
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 & branchIDListBranchName()
Definition: BranchType.cc:208
std::string const & eventHistoryTreeName()
Definition: BranchType.cc:268
bool fwlite::internal::BranchMapReaderStrategyV11::updateLuminosityBlock ( Long_t  luminosityBlockEntry)
overridevirtual

Reimplemented from fwlite::internal::Strategy.

Definition at line 348 of file BranchMapReader.cc.

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

348  {
349  if(newlumi != luminosityBlockEntry_) {
350  luminosityBlockEntry_ = newlumi;
351  mapperFilled_ = false;
352  }
353  return true;
354  }
bool fwlite::internal::BranchMapReaderStrategyV11::updateMap ( )
overridevirtual

Reimplemented from fwlite::internal::Strategy.

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

412  {
413  if(!mapperFilled_) {
414  TBranch* eventHistoryBranch = eventHistoryTree_->GetBranch(edm::poolNames::eventHistoryBranchName().c_str());
415  if(!eventHistoryBranch) {
417  << "Failed to find history branch in event history tree";
418  return false;
419  }
420  // yes, SetAddress really does need to be called every time...
421  eventHistoryBranch->SetAddress(&pHistory_);
422  eventHistoryTree_->GetEntry(eventEntry_);
423  mapperFilled_ = true;
424  }
425  return true;
426  }
std::string const & eventHistoryBranchName()
Definition: BranchType.cc:238
bool fwlite::internal::BranchMapReaderStrategyV11::updateRun ( Long_t  runEntry)
overridevirtual

Reimplemented from fwlite::internal::Strategy.

Definition at line 356 of file BranchMapReader.cc.

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

356  {
357  if(newRun != runEntry_) {
358  runEntry_ = newRun;
359  mapperFilled_ = false;
360  }
361  return true;
362  }

Member Data Documentation

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

Definition at line 328 of file BranchMapReader.cc.

Referenced by productToBranchID(), and updateFile().

TTree* fwlite::internal::BranchMapReaderStrategyV11::eventHistoryTree_
private

Definition at line 329 of file BranchMapReader.cc.

Referenced by updateFile(), and updateMap().

edm::History fwlite::internal::BranchMapReaderStrategyV11::history_
private

Definition at line 330 of file BranchMapReader.cc.

Referenced by branchListIndexes(), and productToBranchID().

edm::History* fwlite::internal::BranchMapReaderStrategyV11::pHistory_
private

Definition at line 331 of file BranchMapReader.cc.

Referenced by updateMap().