19 #include "Reflex/Type.h"
74 TFile* currentFile =
dynamic_cast<TFile*
>(gROOT->GetListOfFiles()->Last());
85 <<
"'\n Please check that the file is a standard CMS ROOT format.\n"
86 <<
"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();
92 if( eventEntry < 0 ) {
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."
101 IdToBuffers::iterator itBuffer =
idToBuffers_.find(iID);
110 buffer = &(itBuffer->second);
114 <<
"Found a null buffer which is supposed to hold the data item."
115 <<
"\n Please contact developers since this message should not happen.";
120 <<
"The TBranch which should hold the data item is null."
121 <<
"\n Please contact the developers since this message should not happen.";
131 static TClass* edproductTClass = TClass::GetClass(
typeid(
edm::EDProduct));
135 <<
"failed to convert a '"<<buffer->
class_->GetName()
136 <<
"' to a edm::EDProduct."
137 <<
"Please contact developers since something is very wrong.";
140 buffer->
product_ = boost::shared_ptr<edm::EDProduct const>(
prod);
144 buffer->
branch_->SetAddress( address );
146 buffer->
branch_->GetEntry( eventEntry );
151 <<
"Calling GetEntry with index "<<eventEntry
152 <<
"for branch "<<buffer->
branch_->GetName()<<
" failed.";
171 Reflex::Type classType = Reflex::Type::ByName(fullName);
174 <<
"could not find dictionary for type '"<<fullName<<
"'"
175 <<
"\n Please make sure all the necessary libraries are available.";
192 TClass* rootClassType=TClass::GetClass(classType.TypeInfo());
193 if( 0 == rootClassType) {
195 <<
"could not find a ROOT dictionary for type '"<<fullName<<
"'"
196 <<
"\n Please make sure all the necessary libraries are available.";
199 void*
address = rootClassType->New();
201 static TClass* edproductTClass = TClass::GetClass(
typeid(
edm::EDProduct));
205 <<
"failed to convert a '"<<fullName
206 <<
"' to a edm::EDProduct."
207 <<
"Please contact developers since something is very wrong.";
212 Buffer b(prod, branch,address,rootClassType);
218 branch->SetAddress( address );
std::string & branchName() const
Buffer * createNewBuffer(const edm::ProductID &) const
bool updateEvent(Long_t eventEntry)
bool updateFile(TFile *file)
const edm::BranchDescription productToBranch(const edm::ProductID &pid)
virtual edm::EDProduct const * getIt(edm::ProductID const &) const
TTree * getEventTree() const
std::string const & className() const
boost::shared_ptr< edm::EDProduct const > product_
std::string wrappedClassName(std::string const &iFullName)
std::string const & eventTreeName()
fwlite::BranchMapReader branchMap_
virtual ~BareRootProductGetter()