61 #include <unordered_map>
70 void set(std::shared_ptr<std::unordered_map<unsigned int, BranchDescription const*>> iMap) {
78 return std::unique_ptr<EventEntryDescription>();
94 std::shared_ptr<std::unordered_map<unsigned int, BranchDescription const*>>
bidToDesc_;
111 <<
"\n Perhaps the data being requested was not saved in this file?";
116 if (!
bool(classType)) {
118 <<
"\n Please make sure all the necessary libraries are available.";
123 if (
nullptr == wrapperObj.
address()) {
126 void* address = wrapperObj.
address();
127 branch->SetAddress(&address);
132 if (
nullptr ==
prod) {
133 throw cms::Exception(
"FailedConversion") <<
"failed to convert a '" <<
fullName <<
"' to a edm::WrapperBase."
134 <<
"Please contact developers since something is very wrong.";
137 return std::unique_ptr<WrapperBase>(
prod);
189 std::vector<EventEntryDescription>
prov_;
247 if (iTree ==
nullptr)
256 if (
nullptr ==
m_->tree_) {
260 TFile*
file =
m_->tree_->GetCurrentFile();
261 if (
nullptr ==
file) {
263 TChain*
chain = dynamic_cast<TChain*>(
m_->tree());
264 if (
nullptr ==
chain) {
269 if (
nullptr ==
file) {
292 std::unique_ptr<edm::EventAuxiliary> eaux = std::make_unique<edm::EventAuxiliary>();
297 branch->SetAddress(&pAux);
310 if (!eventSelectionsBranch) {
313 eventSelectionsBranch->SetAddress(&pEventSelectionIDVector);
314 eventSelectionsBranch->GetEntry(iEntry);
319 if (!branchListIndexBranch) {
322 branchListIndexBranch->SetAddress(&pBranchListIndexes);
323 branchListIndexBranch->GetEntry(iEntry);
324 m_->branchIDListHelper_->fixBranchListIndexes(branchListIndexes);
327 m_->reader_->setEntry(iEntry);
328 auto runAux = std::make_shared<edm::RunAuxiliary>(
aux.run(),
aux.time(),
aux.time());
329 auto rp = std::make_shared<edm::RunPrincipal>(runAux,
m_->reg(),
m_->pc_,
nullptr, 0);
330 auto lbp = std::make_shared<edm::LuminosityBlockPrincipal>(
m_->reg(),
m_->pc_,
nullptr, 0);
332 auto history =
m_->phreg_->getMapped(eaux->processHistoryID());
333 m_->ep_->fillEventPrincipal(*eaux,
337 *(
m_->provRetriever_),
339 lbp->setRunPrincipal(rp);
340 m_->ep_->setLuminosityBlockPrincipal(lbp.get());
341 m_->processNames_ =
m_->ep_->processHistory();
346 Operate sentry(
m_->ep_->prodGetter());
349 std::cout <<
"While processing entry " << iEntry <<
" the following exception was caught \n"
350 << iEx.what() << std::endl;
352 std::cout <<
"While processing entry " << iEntry <<
" an unknown exception was caught" << std::endl;
381 typedef std::map<edm::ParameterSetID, edm::ParameterSetBlob> PsetMap;
383 PsetMap* psetMapPtr = &psetMap;
388 if (
nullptr == psetTree) {
392 typedef std::pair<edm::ParameterSetID, edm::ParameterSetBlob> IdToBlobs;
394 IdToBlobs* pIdToBlob = &idToBlob;
396 for (
long long i = 0;
i != psetTree->GetEntries(); ++
i) {
397 psetTree->GetEntry(
i);
398 psetMap.insert(idToBlob);
414 auto branchIDListsHelper = std::make_shared<edm::BranchIDListHelper>();
420 metaDataTree->GetEntry(0);
422 for (
auto&
prod :
m_->reg_->productListUpdator()) {
429 for (
auto const&
entry : psetMap) {
435 for (
auto const& ph : pHistVector) {
436 m_->phreg_->registerProcessHistory(ph);
439 m_->pointerToBranchBuffer_.erase(
m_->pointerToBranchBuffer_.begin(),
m_->pointerToBranchBuffer_.end());
441 std::unique_ptr<edm::ProductRegistry> newReg = std::make_unique<edm::ProductRegistry>();
445 for (
auto&
item : prodList) {
449 if (newFriendlyName ==
prod.friendlyClassName()) {
450 newReg->copyProduct(
prod);
452 if (
m_->fileFormatVersion_.splitProductIDs()) {
454 <<
"Cannot change friendly class name algorithm without more development work\n"
455 <<
"to update BranchIDLists. Contact the framework group.\n";
459 newReg->copyProduct(newBD);
464 m_->reg().reset(newReg.release());
470 m_->pointerToBranchBuffer_.reserve(prodList2.size());
472 for (
auto&
item : prodList2) {
477 if (
m_->tree_->GetBranch(
prod.branchName().c_str()) ==
nullptr) {
478 prod.setDropped(
true);
489 m_->branchIDListHelper_->updateFromInput(*branchIDListsPtr);
490 m_->reg_->setFrozen();
491 m_->bidToDesc_->clear();
492 for (
auto const&
p :
m_->reg_->productList()) {
493 m_->bidToDesc_->emplace(
p.second.branchID().id(), &
p.second);
495 m_->ep_ = std::make_shared<edm::EventPrincipal>(
496 m_->reg(),
m_->branchIDListHelper(),
m_->thinnedAssociationsHelper(),
m_->pc_,
nullptr);