Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:12:11

0001 #include "FWCore/Framework/interface/FileBlock.h"
0002 
0003 #include <algorithm>
0004 
0005 namespace edm {
0006   void FileBlock::updateTTreePointers(TTree* ev,
0007                                       TTree* meta,
0008                                       TTree* lumi,
0009                                       TTree* lumiMeta,
0010                                       TTree* run,
0011                                       TTree* runMeta,
0012                                       std::vector<TTree*> processBlockTrees,
0013                                       std::vector<std::string> processesWithProcessBlockTrees) {
0014     tree_ = ev;
0015     metaTree_ = meta;
0016     lumiTree_ = lumi;
0017     lumiMetaTree_ = lumiMeta;
0018     runTree_ = run;
0019     runMetaTree_ = runMeta;
0020     processBlockTrees_ = std::move(processBlockTrees);
0021     processesWithProcessBlockTrees_ = std::move(processesWithProcessBlockTrees);
0022   }
0023 
0024   TTree* FileBlock::processBlockTree(std::string const& processName) const {
0025     auto it = std::find(processesWithProcessBlockTrees_.begin(), processesWithProcessBlockTrees_.end(), processName);
0026     if (it != processesWithProcessBlockTrees_.end()) {
0027       auto index = std::distance(processesWithProcessBlockTrees_.begin(), it);
0028       return processBlockTrees_[index];
0029     }
0030     return nullptr;
0031   }
0032 
0033   void FileBlock::close() {
0034     runMetaTree_ = lumiMetaTree_ = metaTree_ = runTree_ = lumiTree_ = tree_ = nullptr;
0035     std::fill(processBlockTrees_.begin(), processBlockTrees_.end(), nullptr);
0036   }
0037 
0038 }  // namespace edm