CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Public Attributes
fwlite::internal::Strategy Class Reference
Inheritance diagram for fwlite::internal::Strategy:
fwlite::internal::BMRStrategy fwlite::internal::BranchMapReaderStrategyV1 fwlite::internal::BranchMapReaderStrategyV11 fwlite::internal::BranchMapReaderStrategyV17 fwlite::internal::BranchMapReaderStrategyV8 fwlite::internal::BranchMapReaderStrategyV7

Public Types

typedef std::map< edm::BranchID, edm::BranchDescriptionbidToDesc
 

Public Member Functions

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
 
virtual edm::BranchID productToBranchID (edm::ProductID const &pid) override
 
 Strategy (TFile *file, int fileVersion)
 
virtual edm::ThinnedAssociationsHelper const & thinnedAssociationsHelper () const 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
 
virtual ~Strategy ()
 
- Public Member Functions inherited from fwlite::internal::BMRStrategy
 BMRStrategy (TFile *file, int fileVersion)
 
virtual const edm::BranchDescriptionbranchIDToBranch (const edm::BranchID &bid) const =0
 
virtual const edm::BranchListIndexesbranchListIndexes () const =0
 
virtual const edm::BranchDescriptionproductToBranch (const edm::ProductID &pid)=0
 
virtual edm::BranchID productToBranchID (const edm::ProductID &pid)=0
 
virtual ~BMRStrategy ()
 

Public Attributes

std::vector< edm::BranchDescriptionbDesc_
 
bidToDesc branchDescriptionMap_
 
bool mapperFilled_
 
edm::propagate_const< std::unique_ptr< edm::ThinnedAssociationsHelper > > thinnedAssociationsHelper_
 
- Public Attributes inherited from fwlite::internal::BMRStrategy
edm::propagate_const< TFile * > currentFile_
 
Long_t eventEntry_
 
edm::propagate_const< TTree * > eventTree_
 
TUUID fileUUID_
 
int fileVersion_
 
Long_t luminosityBlockEntry_
 
edm::propagate_const< TTree * > luminosityBlockTree_
 
Long_t runEntry_
 
edm::propagate_const< TTree * > runTree_
 

Detailed Description

Definition at line 52 of file BranchMapReader.cc.

Member Typedef Documentation

Definition at line 54 of file BranchMapReader.cc.

Constructor & Destructor Documentation

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

Definition at line 83 of file BranchMapReader.cc.

85  // do in derived obects
86  // updateFile(file);
87  }
BMRStrategy(TFile *file, int fileVersion)
edm::propagate_const< std::unique_ptr< edm::ThinnedAssociationsHelper > > thinnedAssociationsHelper_
fwlite::internal::Strategy::~Strategy ( )
virtual

Definition at line 89 of file BranchMapReader.cc.

89  {
90  // probably need to clean up something here...
91  }

Member Function Documentation

edm::BranchDescription const & fwlite::internal::Strategy::branchIDToBranch ( edm::BranchID const &  bid) const
overridevirtual

Definition at line 142 of file BranchMapReader.cc.

References branchDescriptionMap_, and fwlite::internal::kDefaultBranchDescription.

142  {
143  bidToDesc::const_iterator bdi = branchDescriptionMap_.find(bid);
144  if(branchDescriptionMap_.end() == bdi) {
146  }
147  return bdi->second;
148  }
static const edm::BranchDescription kDefaultBranchDescription
std::vector< edm::BranchDescription > const & fwlite::internal::Strategy::getBranchDescriptions ( )
overridevirtual

Implements fwlite::internal::BMRStrategy.

Definition at line 117 of file BranchMapReader.cc.

References bDesc_, and branchDescriptionMap_.

117  {
118  if(bDesc_.empty()) {
119  for(auto const& item : branchDescriptionMap_) {
120  bDesc_.push_back(item.second);
121  }
122  }
123  return bDesc_;
124  }
std::vector< edm::BranchDescription > bDesc_
TBranch * fwlite::internal::Strategy::getBranchRegistry ( edm::ProductRegistry **  pReg)

Definition at line 104 of file BranchMapReader.cc.

References fwlite::internal::BMRStrategy::currentFile_, edm::poolNames::metaDataTreeName(), and edm::poolNames::productDescriptionBranchName().

Referenced by fwlite::internal::BranchMapReaderStrategyV8::updateFile(), fwlite::internal::BranchMapReaderStrategyV11::updateFile(), fwlite::internal::BranchMapReaderStrategyV17::updateFile(), and fwlite::internal::BranchMapReaderStrategyV1::updateMap().

104  {
105  TBranch* bReg(nullptr);
106 
107  TTree* metaDataTree = dynamic_cast<TTree*>(currentFile_->Get(edm::poolNames::metaDataTreeName().c_str()));
108  if(nullptr != metaDataTree) {
109  bReg = metaDataTree->GetBranch(edm::poolNames::productDescriptionBranchName().c_str());
110  bReg->SetAddress(ppReg);
111  bReg->GetEntry(0);
112  }
113  return bReg;
114  }
edm::propagate_const< TFile * > currentFile_
std::string const & metaDataTreeName()
Definition: BranchType.cc:168
std::string const & productDescriptionBranchName()
Definition: BranchType.cc:173
edm::BranchDescription const & fwlite::internal::Strategy::productToBranch ( edm::ProductID const &  pid)
overridevirtual

Definition at line 132 of file BranchMapReader.cc.

References branchDescriptionMap_, fwlite::internal::kDefaultBranchDescription, and productToBranchID().

132  {
134  bidToDesc::const_iterator bdi = branchDescriptionMap_.find(bid);
135  if(branchDescriptionMap_.end() == bdi) {
137  }
138  return bdi->second;
139  }
virtual edm::BranchID productToBranchID(edm::ProductID const &pid) override
static const edm::BranchDescription kDefaultBranchDescription
edm::BranchID fwlite::internal::Strategy::productToBranchID ( edm::ProductID const &  pid)
overridevirtual
virtual edm::ThinnedAssociationsHelper const& fwlite::internal::Strategy::thinnedAssociationsHelper ( ) const
inlineoverridevirtual

Implements fwlite::internal::BMRStrategy.

Definition at line 73 of file BranchMapReader.cc.

73 { return *thinnedAssociationsHelper_; }
edm::propagate_const< std::unique_ptr< edm::ThinnedAssociationsHelper > > thinnedAssociationsHelper_
virtual bool fwlite::internal::Strategy::updateEvent ( Long_t  eventEntry)
inlineoverridevirtual
bool fwlite::internal::Strategy::updateFile ( TFile *  file)
overridevirtual

Implements fwlite::internal::BMRStrategy.

Reimplemented in fwlite::internal::BranchMapReaderStrategyV17, fwlite::internal::BranchMapReaderStrategyV11, fwlite::internal::BranchMapReaderStrategyV8, and fwlite::internal::BranchMapReaderStrategyV1.

Definition at line 93 of file BranchMapReader.cc.

References bDesc_, branchDescriptionMap_, fwlite::internal::BMRStrategy::currentFile_, fwlite::internal::BMRStrategy::eventTree_, edm::poolNames::eventTreeName(), FrontierConditions_GlobalTag_cff::file, fwlite::internal::BMRStrategy::fileUUID_, fwlite::internal::BMRStrategy::luminosityBlockTree_, edm::poolNames::luminosityBlockTreeName(), fwlite::internal::BMRStrategy::runTree_, and edm::poolNames::runTreeName().

Referenced by fwlite::internal::BranchMapReaderStrategyV1::updateFile(), fwlite::internal::BranchMapReaderStrategyV8::updateFile(), fwlite::internal::BranchMapReaderStrategyV11::updateFile(), and fwlite::internal::BranchMapReaderStrategyV17::updateFile().

93  {
95  eventTree_ = dynamic_cast<TTree*>(currentFile_->Get(edm::poolNames::eventTreeName().c_str()));
96  luminosityBlockTree_ = dynamic_cast<TTree*>(currentFile_->Get(edm::poolNames::luminosityBlockTreeName().c_str()));
97  runTree_ = dynamic_cast<TTree*>(currentFile_->Get(edm::poolNames::runTreeName().c_str()));
98  fileUUID_ = currentFile_->GetUUID();
99  branchDescriptionMap_.clear();
100  bDesc_.clear();
101  return nullptr != eventTree_;
102  }
edm::propagate_const< TFile * > currentFile_
std::string const & luminosityBlockTreeName()
Definition: BranchType.cc:271
std::vector< edm::BranchDescription > bDesc_
edm::propagate_const< TTree * > eventTree_
edm::propagate_const< TTree * > luminosityBlockTree_
std::string const & runTreeName()
Definition: BranchType.cc:274
edm::propagate_const< TTree * > runTree_
std::string const & eventTreeName()
Definition: BranchType.cc:260
virtual bool fwlite::internal::Strategy::updateLuminosityBlock ( Long_t  luminosityBlockEntry)
inlineoverridevirtual
virtual bool fwlite::internal::Strategy::updateMap ( )
inlineoverridevirtual
virtual bool fwlite::internal::Strategy::updateRun ( Long_t  runEntry)
inlineoverridevirtual

Member Data Documentation

std::vector<edm::BranchDescription> fwlite::internal::Strategy::bDesc_
bidToDesc fwlite::internal::Strategy::branchDescriptionMap_
bool fwlite::internal::Strategy::mapperFilled_
edm::propagate_const<std::unique_ptr<edm::ThinnedAssociationsHelper> > fwlite::internal::Strategy::thinnedAssociationsHelper_