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

Public Member Functions

 BranchMapReaderStrategyV8 (TFile *file, int fileVersion)
 
virtual bool updateEvent (Long_t eventEntry)
 
virtual bool updateFile (TFile *file)
 
virtual bool updateLuminosityBlock (Long_t luminosityBlockEntry)
 
virtual bool updateMap ()
 
virtual bool updateRun (Long_t runEntry)
 
- Public Member Functions inherited from fwlite::internal::Strategy
virtual const std::vector
< edm::BranchDescription > & 
getBranchDescriptions ()
 
TBranch * getBranchRegistry (edm::ProductRegistry **pReg)
 
virtual const
edm::BranchDescription 
productToBranch (const edm::ProductID &pid)
 
virtual edm::BranchID productToBranchID (const edm::ProductID &pid)
 
 Strategy (TFile *file, int fileVersion)
 
virtual ~Strategy ()
 
- Public Member Functions inherited from fwlite::internal::BMRStrategy
 BMRStrategy (TFile *file, int fileVersion)
 
virtual ~BMRStrategy ()
 

Private Attributes

TBranch * entryInfoBranch_
 
edm::EventEntryInfoVector eventEntryInfoVector_
 
edm::EventEntryInfoVectorpEventEntryInfoVector_
 

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

Constructor & Destructor Documentation

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

Definition at line 205 of file BranchMapReader.cc.

References updateFile().

206  : Strategy(file, fileVersion),
208  updateFile(file);
209  }
list file
Definition: dbtoweb.py:253
edm::EventEntryInfoVector eventEntryInfoVector_
Strategy(TFile *file, int fileVersion)
edm::EventEntryInfoVector * pEventEntryInfoVector_

Member Function Documentation

bool fwlite::internal::BranchMapReaderStrategyV8::updateEvent ( Long_t  eventEntry)
virtual

Reimplemented from fwlite::internal::Strategy.

Definition at line 211 of file BranchMapReader.cc.

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

211  {
212  // std::cout << "v8 updateevent " << newevent << std::endl;
213  if (newevent != eventEntry_) {
214  eventEntry_ = newevent;
215  mapperFilled_ = false;
216  }
217  return true;
218  }
bool fwlite::internal::BranchMapReaderStrategyV8::updateFile ( TFile *  file)
virtual

Reimplemented from fwlite::internal::Strategy.

Definition at line 236 of file BranchMapReader.cc.

References fwlite::internal::Strategy::bDesc_, beamvalidation::br, fwlite::internal::Strategy::branchDescriptionMap_, edm::BranchTypeToBranchEntryInfoBranchName(), fwlite::internal::BMRStrategy::currentFile_, entryInfoBranch_, eventEntryInfoVector_, edm::poolNames::eventMetaDataTreeName(), fwlite::internal::Strategy::getBranchRegistry(), edm::InEvent, fwlite::internal::Strategy::mapperFilled_, pEventEntryInfoVector_, edm::ProductRegistry::productList(), and fwlite::internal::Strategy::updateFile().

Referenced by BranchMapReaderStrategyV8().

236  {
238  mapperFilled_ = false;
239  entryInfoBranch_ = 0;
240  TTree* metaDataTree = dynamic_cast<TTree*>(currentFile_->Get(edm::poolNames::eventMetaDataTreeName().c_str()));
241  if (0 != metaDataTree) {
242  entryInfoBranch_ = metaDataTree->GetBranch(BranchTypeToBranchEntryInfoBranchName(edm::InEvent).c_str());
243 // std::cout << "entryInfoBranch for " << BranchTypeToBranchEntryInfoBranchName(edm::InEvent) << " " << entryInfoBranch_ << std::endl;
244  } else {
245  return false;
246  }
249 
250  branchDescriptionMap_.clear();
251  bDesc_.clear();
252 
254  edm::ProductRegistry* pReg = &reg;
255  TBranch *br = getBranchRegistry(&pReg);
256 
257  if (0 != br) {
258  const edm::ProductRegistry::ProductList& prodList = reg.productList();
259 
260  for(edm::ProductRegistry::ProductList::const_iterator it = prodList.begin(), itEnd = prodList.end(); it != itEnd; ++it) {
261  if (edm::InEvent == it->second.branchType()) {
262  // call to regenerate branchName
263  it->second.init();
264  branchDescriptionMap_.insert(bidToDesc::value_type(it->second.branchID(), it->second));
265  }
266  }
267  }
268  return 0 != br;
269  }
list file
Definition: dbtoweb.py:253
std::map< BranchKey, BranchDescription > ProductList
Container::value_type value_type
std::vector< edm::BranchDescription > bDesc_
ProductList const & productList() const
edm::EventEntryInfoVector eventEntryInfoVector_
TBranch * getBranchRegistry(edm::ProductRegistry **pReg)
std::string const & BranchTypeToBranchEntryInfoBranchName(BranchType const &branchType)
Definition: BranchType.cc:120
std::string const & eventMetaDataTreeName()
Definition: BranchType.cc:248
virtual bool updateFile(TFile *file)
author Stefano ARGIRO author Bill Tanenbaum
edm::EventEntryInfoVector * pEventEntryInfoVector_
bool fwlite::internal::BranchMapReaderStrategyV8::updateLuminosityBlock ( Long_t  luminosityBlockEntry)
virtual

Reimplemented from fwlite::internal::Strategy.

Definition at line 220 of file BranchMapReader.cc.

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

220  {
221  if (newLumi != luminosityBlockEntry_) {
222  luminosityBlockEntry_ = newLumi;
223  mapperFilled_ = false;
224  }
225  return true;
226  }
bool fwlite::internal::BranchMapReaderStrategyV8::updateMap ( )
virtual

Reimplemented from fwlite::internal::Strategy.

Definition at line 271 of file BranchMapReader.cc.

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

271  {
272  if (mapperFilled_) {
273  return true;
274  }
275 
276  assert (entryInfoBranch_);
277 
278  entryInfoBranch_->GetEntry(eventEntry_);
279 
280  for (std::vector<edm::EventEntryInfo>::const_iterator it = pEventEntryInfoVector_->begin(),
281  itEnd = pEventEntryInfoVector_->end();
282  it != itEnd; ++it) {
283 // eventInfoMap_.insert(*it);
284  }
285  mapperFilled_ = true;
286  return true;
287  }
edm::EventEntryInfoVector * pEventEntryInfoVector_
bool fwlite::internal::BranchMapReaderStrategyV8::updateRun ( Long_t  runEntry)
virtual

Reimplemented from fwlite::internal::Strategy.

Definition at line 228 of file BranchMapReader.cc.

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

228  {
229  if (newRun != runEntry_) {
230  runEntry_ = newRun;
231  mapperFilled_ = false;
232  }
233  return true;
234  }

Member Data Documentation

TBranch* fwlite::internal::BranchMapReaderStrategyV8::entryInfoBranch_
private

Definition at line 200 of file BranchMapReader.cc.

Referenced by updateFile(), and updateMap().

edm::EventEntryInfoVector fwlite::internal::BranchMapReaderStrategyV8::eventEntryInfoVector_
private

Definition at line 201 of file BranchMapReader.cc.

Referenced by updateFile().

edm::EventEntryInfoVector* fwlite::internal::BranchMapReaderStrategyV8::pEventEntryInfoVector_
private

Definition at line 202 of file BranchMapReader.cc.

Referenced by updateFile(), and updateMap().