Description: <one line="" class="" summary>="">
Usage: <usage>
Definition at line 36 of file BareRootProductGetter.h.
Implements edm::EDProductGetter.
Definition at line 68 of file BareRootProductGetter.cc.
References BareRootProductGetter::Buffer::address_, BareRootProductGetter::Buffer::branch_, branchMap_, BareRootProductGetter::Buffer::class_, createNewBuffer(), BareRootProductGetter::Buffer::eventEntry_, edm::poolNames::eventTreeName(), edm::hlt::Exception, fwlite::BranchMapReader::getEventTree(), fwlite::BranchMapReader::getFile(), idToBuffers_, edm::WrapperHolder::interface(), edm::WrapperHolder::isValid(), parseEventContent::prod, BareRootProductGetter::Buffer::product_, fwlite::BranchMapReader::updateEvent(), fwlite::BranchMapReader::updateFile(), and edm::WrapperHolder::wrapper().
70 TFile* currentFile =
dynamic_cast<TFile*
>(gROOT->GetListOfFiles()->Last());
71 if(0 == currentFile) {
73 <<
"unable to find the TFile '" << gROOT->GetListOfFiles()->Last() <<
"'\n"
74 <<
"retrieved by calling 'gROOT->GetListOfFiles()->Last()'\n"
75 <<
"Please check the list of files.";
86 <<
"'\n Please check that the file is a standard CMS ROOT format.\n"
87 <<
"If the above is not the file you expect then please open your data file after all other files.";
89 Long_t eventEntry = eventTree->GetReadEntry();
94 <<
"please call GetEntry for the 'Events' TTree for each event in order to make edm::Ref's work."
95 <<
"\n Also be sure to call 'SetAddress' for all Branches after calling the GetEntry."
100 IdToBuffers::iterator itBuffer =
idToBuffers_.find(iID);
109 buffer = &(itBuffer->second);
113 <<
"Found a null buffer which is supposed to hold the data item."
114 <<
"\n Please contact developers since this message should not happen.";
116 if(0 == buffer->branch_) {
118 <<
"The TBranch which should hold the data item is null."
119 <<
"\n Please contact the developers since this message should not happen.";
121 if(buffer->eventEntry_ != eventEntry) {
127 void* address = buffer->class_->New();
132 <<
"failed to convert a '" << buffer->class_->GetName()
133 <<
"' to a edm::WrapperHolder."
134 <<
"Please contact developers since something is very wrong.";
136 buffer->address_ = address;
137 buffer->product_ =
prod;
140 address = &(buffer->address_);
141 buffer->branch_->SetAddress(address);
143 buffer->branch_->GetEntry(eventEntry);
144 buffer->eventEntry_ = eventEntry;
146 if(!buffer->product_.isValid()) {
148 <<
"Calling GetEntry with index " << eventEntry
149 <<
"for branch " << buffer->branch_->GetName() <<
" failed.";
bool updateEvent(Long_t eventEntry)
bool updateFile(TFile *file)
TTree * getEventTree() const
Buffer * createNewBuffer(edm::ProductID const &) const
std::string const & eventTreeName()
fwlite::BranchMapReader branchMap_