44 eventEntry_(-1), luminosityBlockEntry_(-1), runEntry_(-1), fileVersion_(fileVersion) {
54 typedef std::map<edm::BranchID, edm::BranchDescription>
bidToDesc;
78 std::vector<edm::BranchDescription>
bDesc_;
84 :
BMRStrategy(file, fileVersion), mapperFilled_(
false), thinnedAssociationsHelper_(new
edm::ThinnedAssociationsHelper) {
105 TBranch* bReg(
nullptr);
108 if(
nullptr != metaDataTree) {
110 bReg->SetAddress(ppReg);
116 std::vector<edm::BranchDescription>
const&
120 bDesc_.push_back(item.second);
153 virtual bool updateFile(TFile* file)
override;
188 for(
auto& item : prodList) {
199 return nullptr !=
br;
219 virtual bool updateFile(TFile* file)
override;
220 virtual bool updateEvent(Long_t eventEntry)
override;
222 virtual bool updateRun(Long_t runEntry)
override;
234 eventEntryInfoVector_(), pEventEntryInfoVector_(&eventEntryInfoVector_) {
268 if(
nullptr != metaDataTree) {
287 for(
auto& item : prodList) {
297 return nullptr !=
br;
319 virtual bool updateFile(TFile* file)
override;
320 virtual bool updateEvent(Long_t eventEntry)
override;
322 virtual bool updateRun(Long_t runEntry)
override;
334 :
Strategy(file, fileVersion), eventHistoryTree_(
nullptr), pHistory_(&history_) {
368 if(
nullptr == metaDataTree) {
376 b->SetAddress(&branchIDListsPtr);
381 <<
"FindBranch of branchIDList failed";
397 for(
auto& item : prodList) {
408 return nullptr !=
br;
414 if(!eventHistoryBranch) {
416 <<
"Failed to find history branch in event history tree";
420 eventHistoryBranch->SetAddress(&
pHistory_);
436 virtual bool updateFile(TFile* file)
override;
437 virtual bool updateEvent(Long_t eventEntry)
override;
439 virtual bool updateRun(Long_t runEntry)
override;
451 :
Strategy(file, fileVersion), eventsTree_(
nullptr), pBranchListIndexes_(&branchListIndexes_) {
484 if(
nullptr == metaDataTree) {
492 b->SetAddress(&thinnedAssociationsHelperPtr);
500 b->SetAddress(&branchIDListsPtr);
505 <<
"FindBranch of branchIDList failed";
521 for(
auto& item : prodList) {
532 return nullptr !=
br;
538 if(!branchListIndexesBranch) {
540 <<
"Failed to find branch list indexes branch in event tree";
572 if(
nullptr == file) {
584 if(
nullptr == metaDataTree) {
591 bVer->SetAddress(&pV);
602 return strategy_->updateLuminosityBlock(newlumi);
615 TFile* currentFile(
strategy_->currentFile_);
616 bool isNew(file != currentFile);
623 isNew = eventTreeTemp !=
strategy_->eventTree_ ||
strategy_->fileUUID_ != currentFile->GetUUID();
627 if(fileVersion !=
strategy_->fileVersion_) {
641 std::vector<edm::BranchDescription>
const&
643 return strategy_->getBranchDescriptions();
647 std::unique_ptr<internal::BMRStrategy>
649 std::unique_ptr<internal::BMRStrategy>
s;
651 if(fileVersion >= 17) {
652 s = std::make_unique<internal::BranchMapReaderStrategyV17>(
file, fileVersion);
653 }
else if(fileVersion >= 11) {
654 s = std::make_unique<internal::BranchMapReaderStrategyV11>(
file, fileVersion);
655 }
else if(fileVersion >= 8) {
656 s = std::make_unique<internal::BranchMapReaderStrategyV8>(
file, fileVersion);
657 }
else if(fileVersion >= 7) {
658 s = std::make_unique<internal::BranchMapReaderStrategyV7>(
file, fileVersion);
660 s = std::make_unique<internal::BranchMapReaderStrategyV1>(
file, fileVersion);
virtual bool updateFile(TFile *file) override
virtual bool updateFile(TFile *file)=0
BranchType const & branchType() const
virtual bool updateFile(TFile *file) override
std::vector< BranchIDList > BranchIDLists
std::unique_ptr< internal::BMRStrategy > newStrategy(TFile *file, int fileVersion)
virtual const std::vector< edm::BranchDescription > & getBranchDescriptions()=0
edm::propagate_const< TFile * > currentFile_
BMRStrategy(TFile *file, int fileVersion)
std::unique_ptr< internal::BMRStrategy > strategy_
bool updateEvent(Long_t eventEntry)
virtual edm::BranchListIndexes const & branchListIndexes() const override
std::map< BranchKey, BranchDescription > ProductList
edm::EventEntryInfoVector const * pEventEntryInfoVector_
bool updateFile(TFile *file)
virtual bool updateFile(TFile *file) override
virtual edm::BranchListIndexes const & branchListIndexes() const override
virtual bool updateRun(Long_t runEntry) override
std::string const & fileFormatVersionBranchName()
BranchMapReaderStrategyV7(TFile *file, int fileVersion)
std::vector< EventEntryInfo > EventEntryInfoVector
edm::propagate_const< std::unique_ptr< edm::BranchIDLists > > branchIDLists_
edm::History const * pHistory_
virtual std::vector< edm::BranchDescription > const & getBranchDescriptions() override
virtual edm::BranchListIndexes const & branchListIndexes() const override
std::string const & luminosityBlockTreeName()
virtual const edm::BranchDescription & branchIDToBranch(const edm::BranchID &bid) const =0
bidToDesc branchDescriptionMap_
edm::BranchListIndexes dummyBranchListIndexes_
std::vector< edm::BranchDescription > bDesc_
bool updateLuminosityBlock(Long_t luminosityBlockEntry)
edm::propagate_const< TTree * > eventTree_
virtual bool updateEvent(Long_t eventEntry) override
virtual edm::BranchListIndexes const & branchListIndexes() const override
virtual bool updateFile(TFile *file) override
edm::BranchListIndexes dummyBranchListIndexes_
std::vector< BranchListIndex > BranchListIndexes
edm::EventEntryInfoVector eventEntryInfoVector_
Container::value_type value_type
BranchID productIDToBranchID(ProductID const &pid, BranchIDLists const &lists, BranchListIndexes const &indexes)
Strategy(TFile *file, int fileVersion)
std::string const & eventHistoryBranchName()
edm::propagate_const< edm::BranchListIndexes * > pBranchListIndexes_
edm::propagate_const< TTree * > eventHistoryTree_
virtual bool updateEvent(Long_t eventEntry) override
virtual edm::BranchID productToBranchID(edm::ProductID const &pid) override
virtual bool updateRun(Long_t runEntry) override
Long_t luminosityBlockEntry_
TBranch * getBranchRegistry(edm::ProductRegistry **pReg)
const edm::BranchDescription & productToBranch(const edm::ProductID &pid)
edm::propagate_const< TTree * > luminosityBlockTree_
virtual bool updateLuminosityBlock(Long_t luminosityBlockEntry) override
std::string const & BranchTypeToBranchEntryInfoBranchName(BranchType const &branchType)
BranchID const & branchID() const
edm::BranchListIndexes dummyBranchListIndexes_
std::string const & metaDataTreeName()
void setFrozen(bool initializeLookupInfo=true)
virtual bool updateFile(TFile *file) override
std::string const & runTreeName()
BranchListIndexes const & branchListIndexes() const
element_type const * get() const
virtual const edm::BranchDescription & productToBranch(const edm::ProductID &pid)=0
BranchMapReaderStrategyV1(TFile *file, int fileVersion)
virtual edm::ThinnedAssociationsHelper const & thinnedAssociationsHelper() const override
virtual edm::BranchID productToBranchID(const edm::ProductID &pid)=0
virtual edm::BranchID productToBranchID(edm::ProductID const &pid) override
std::string const & eventMetaDataTreeName()
static const edm::BranchDescription kDefaultBranchDescription
virtual bool updateEvent(Long_t eventEntry) override
virtual bool updateMap() override
ProductList & productListUpdator()
edm::propagate_const< TTree * > runTree_
edm::propagate_const< std::unique_ptr< edm::BranchIDLists > > branchIDLists_
std::string const & productDescriptionBranchName()
edm::propagate_const< std::unique_ptr< edm::ThinnedAssociationsHelper > > thinnedAssociationsHelper_
BranchMapReaderStrategyV8(TFile *file, int fileVersion)
BranchMapReaderStrategyV17(TFile *file, int fileVersion)
edm::propagate_const< TTree * > eventsTree_
virtual bool updateEvent(Long_t eventEntry) override
virtual bool updateLuminosityBlock(Long_t luminosityBlockEntry) override
edm::BranchListIndexes branchListIndexes_
virtual bool updateMap() override
BranchMapReaderStrategyV11(TFile *file, int fileVersion)
int getFileVersion() const
std::string const & thinnedAssociationsHelperBranchName()
std::string const & eventTreeName()
bool updateRun(Long_t runEntry)
std::string const & branchIDListBranchName()
std::string const & branchListIndexesBranchName()
virtual bool updateMap() override
std::map< edm::BranchID, edm::BranchDescription > bidToDesc
edm::propagate_const< TBranch * > entryInfoBranch_
std::string const & eventHistoryTreeName()
virtual edm::BranchID productToBranchID(edm::ProductID const &pid) override
virtual edm::BranchDescription const & branchIDToBranch(edm::BranchID const &bid) const override
virtual edm::BranchListIndexes const & branchListIndexes() const override
virtual edm::BranchDescription const & productToBranch(edm::ProductID const &pid) override
virtual bool updateLuminosityBlock(Long_t luminosityBlockEntry) override
const std::vector< edm::BranchDescription > & getBranchDescriptions()
virtual bool updateMap() override
virtual bool updateMap() override
virtual bool updateLuminosityBlock(Long_t luminosityBlockEntry) override
virtual bool updateRun(Long_t runEntry) override
virtual bool updateRun(Long_t runEntry) override