#include <PoolSource.h>
Definition at line 29 of file PoolSource.h.
edm::PoolSource::PoolSource | ( | ParameterSet const & | pset, |
InputSourceDescription const & | desc | ||
) | [explicit] |
Definition at line 56 of file PoolSource.cc.
References begin, relativeConstraints::empty, end, HDQMDatabaseProducer::fullList, i, edm::InEvent, edm::InLumi, edm::InRun, edm::NumBranchTypes, and findQualityFiles::size.
: InputType::SecondarySource)), secondaryFileSequence_(catalog(1).empty() ? 0 : new RootInputFileSequence(pset, *this, catalog(1), InputType::SecondaryFile)), secondaryRunPrincipal_(), secondaryLumiPrincipal_(), secondaryEventPrincipal_(secondaryFileSequence_ ? new EventPrincipal(secondaryFileSequence_->fileProductRegistry(), secondaryFileSequence_->fileBranchIDListHelper(), processConfiguration()) : 0), branchIDsToReplace_() { if(secondaryFileSequence_) { assert(primary()); std::array<std::set<BranchID>, NumBranchTypes> idsToReplace; ProductRegistry::ProductList const& secondary = secondaryFileSequence_->fileProductRegistry()->productList(); ProductRegistry::ProductList const& primary = primaryFileSequence_->fileProductRegistry()->productList(); typedef ProductRegistry::ProductList::const_iterator const_iterator; typedef ProductRegistry::ProductList::iterator iterator; //this is the registry used by the 'outside' world and only has the primary file information in it at present ProductRegistry::ProductList& fullList = productRegistryUpdate().productListUpdator(); for(const_iterator it = secondary.begin(), itEnd = secondary.end(); it != itEnd; ++it) { if(it->second.present()) { idsToReplace[it->second.branchType()].insert(it->second.branchID()); //now make sure this is marked as not dropped else the product will not be 'get'table from the Event iterator itFound = fullList.find(it->first); if(itFound != fullList.end()) { itFound->second.dropped()=false; } } } for(const_iterator it = primary.begin(), itEnd = primary.end(); it != itEnd; ++it) { if(it->second.present()) idsToReplace[it->second.branchType()].erase(it->second.branchID()); } if(idsToReplace[InEvent].empty() && idsToReplace[InLumi].empty() && idsToReplace[InRun].empty()) { secondaryFileSequence_.reset(); } else { for(int i = InEvent; i < NumBranchTypes; ++i) { branchIDsToReplace_[i].reserve(idsToReplace[i].size()); for(std::set<BranchID>::const_iterator it = idsToReplace[i].begin(), itEnd = idsToReplace[i].end(); it != itEnd; ++it) { branchIDsToReplace_[i].push_back(*it); } } } } } PoolSource::~PoolSource() {}
edm::PoolSource::~PoolSource | ( | ) | [virtual] |
Definition at line 103 of file PoolSource.cc.
References secondaryFileSequence_.
void edm::PoolSource::closeFile_ | ( | ) | [private, virtual] |
Reimplemented from edm::InputSource.
Definition at line 121 of file PoolSource.cc.
void edm::PoolSource::dropUnwantedBranches_ | ( | std::vector< std::string > const & | wantedBranches | ) | [private, virtual] |
Implements edm::VectorInputSource.
Definition at line 268 of file PoolSource.cc.
void edm::PoolSource::endJob | ( | void | ) | [private, virtual] |
Reimplemented from edm::InputSource.
Definition at line 106 of file PoolSource.cc.
void edm::PoolSource::fillDescriptions | ( | ConfigurationDescriptions & | descriptions | ) | [static] |
Reimplemented from edm::InputSource.
Definition at line 274 of file PoolSource.cc.
ProcessingController::ForwardState edm::PoolSource::forwardState_ | ( | ) | const [private, virtual] |
Reimplemented from edm::InputSource.
Definition at line 291 of file PoolSource.cc.
InputSource::ItemType edm::PoolSource::getNextItemType | ( | ) | [private, virtual] |
Implements edm::InputSource.
Definition at line 211 of file PoolSource.cc.
bool edm::PoolSource::goToEvent_ | ( | EventID const & | eventID | ) | [private, virtual] |
Reimplemented from edm::InputSource.
Definition at line 233 of file PoolSource.cc.
void edm::PoolSource::preForkReleaseResources | ( | ) | [private, virtual] |
Reimplemented from edm::InputSource.
Definition at line 216 of file PoolSource.cc.
bool edm::PoolSource::randomAccess_ | ( | ) | const [private, virtual] |
Reimplemented from edm::InputSource.
Definition at line 286 of file PoolSource.cc.
EventPrincipal * edm::PoolSource::readEvent_ | ( | EventPrincipal & | eventPrincipal | ) | [private, virtual] |
Implements edm::InputSource.
Definition at line 181 of file PoolSource.cc.
References branchIDsToReplace_, edm::EventID::event(), Exception, edm::EventPrincipal::id(), edm::InEvent, edm::EventPrincipal::luminosityBlock(), edm::EventPrincipal::mergeMappers(), edm::errors::MismatchedInputFiles, edm::Principal::recombine(), edm::EventPrincipal::run(), secondaryEventPrincipal_, and secondaryFileSequence_.
{ bool found = secondaryFileSequence_->skipToItem(primaryPrincipal->run(), primaryPrincipal->luminosityBlock(), primaryPrincipal->id().event()); if(found) { EventPrincipal* secondaryPrincipal = secondaryFileSequence_->readEvent(*secondaryEventPrincipal_); checkConsistency(*primaryPrincipal, *secondaryPrincipal); checkHistoryConsistency(*primaryPrincipal, *secondaryPrincipal); primaryPrincipal->recombine(*secondaryPrincipal, branchIDsToReplace_[InEvent]); primaryPrincipal->mergeMappers(*secondaryPrincipal); secondaryEventPrincipal_->clearPrincipal(); } else { throw Exception(errors::MismatchedInputFiles, "PoolSource::readEvent_") << primaryPrincipal->id() << " is not found in the secondary input files\n"; } } return primaryPrincipal; } EventPrincipal*
boost::shared_ptr< FileBlock > edm::PoolSource::readFile_ | ( | ) | [private, virtual] |
Reimplemented from edm::InputSource.
Definition at line 113 of file PoolSource.cc.
References edm::FileBlock::HasSecondaryFileSequence.
{ fb->setNotFastClonable(FileBlock::HasSecondaryFileSequence); } return fb; } void PoolSource::closeFile_() {
EventPrincipal * edm::PoolSource::readIt | ( | EventID const & | id, |
EventPrincipal & | eventPrincipal | ||
) | [private, virtual] |
Reimplemented from edm::InputSource.
Definition at line 204 of file PoolSource.cc.
boost::shared_ptr< LuminosityBlockPrincipal > edm::PoolSource::readLuminosityBlock_ | ( | boost::shared_ptr< LuminosityBlockPrincipal > | lumiPrincipal | ) | [private, virtual] |
Reimplemented from edm::InputSource.
Definition at line 158 of file PoolSource.cc.
References branchIDsToReplace_, edm::InLumi, edm::InputSource::processConfiguration(), secondaryFileSequence_, and secondaryLumiPrincipal_.
{ boost::shared_ptr<LuminosityBlockAuxiliary> secondaryAuxiliary = secondaryFileSequence_->readLuminosityBlockAuxiliary_(); checkConsistency(primaryPrincipal->aux(), *secondaryAuxiliary); boost::shared_ptr<LuminosityBlockPrincipal> lbp(new LuminosityBlockPrincipal(secondaryAuxiliary, secondaryFileSequence_->fileProductRegistry(), processConfiguration())); secondaryLumiPrincipal_ = secondaryFileSequence_->readLuminosityBlock_(lbp); checkHistoryConsistency(*primaryPrincipal, *secondaryLumiPrincipal_); primaryPrincipal->recombine(*secondaryLumiPrincipal_, branchIDsToReplace_[InLumi]); } else { throw Exception(errors::MismatchedInputFiles, "PoolSource::readLuminosityBlock_") << " Run " << primaryPrincipal->run() << " LuminosityBlock " << primaryPrincipal->luminosityBlock() << " is not found in the secondary input files\n"; } return primaryPrincipal; } return primaryFileSequence_->readLuminosityBlock_(lumiPrincipal); } EventPrincipal*
boost::shared_ptr< LuminosityBlockAuxiliary > edm::PoolSource::readLuminosityBlockAuxiliary_ | ( | ) | [private, virtual] |
Implements edm::InputSource.
Definition at line 131 of file PoolSource.cc.
EventPrincipal * edm::PoolSource::readOneRandom | ( | ) | [private, virtual] |
Implements edm::VectorInputSource.
Definition at line 238 of file PoolSource.cc.
EventPrincipal * edm::PoolSource::readOneRandomWithID | ( | LuminosityBlockID const & | lumiID | ) | [private, virtual] |
Implements edm::VectorInputSource.
Definition at line 244 of file PoolSource.cc.
EventPrincipal * edm::PoolSource::readOneSequential | ( | ) | [private, virtual] |
Implements edm::VectorInputSource.
Definition at line 250 of file PoolSource.cc.
EventPrincipal * edm::PoolSource::readOneSequentialWithID | ( | LuminosityBlockID const & | lumiID | ) | [private, virtual] |
Implements edm::VectorInputSource.
Definition at line 256 of file PoolSource.cc.
EventPrincipal * edm::PoolSource::readOneSpecified | ( | EventID const & | id | ) | [private, virtual] |
Implements edm::VectorInputSource.
Definition at line 262 of file PoolSource.cc.
boost::shared_ptr< RunPrincipal > edm::PoolSource::readRun_ | ( | boost::shared_ptr< RunPrincipal > | runPrincipal | ) | [private, virtual] |
Reimplemented from edm::InputSource.
Definition at line 136 of file PoolSource.cc.
References branchIDsToReplace_, edm::InRun, edm::InputSource::processConfiguration(), secondaryFileSequence_, and secondaryRunPrincipal_.
{ boost::shared_ptr<RunAuxiliary> secondaryAuxiliary = secondaryFileSequence_->readRunAuxiliary_(); checkConsistency(primaryPrincipal->aux(), *secondaryAuxiliary); boost::shared_ptr<RunPrincipal> rp(new RunPrincipal(secondaryAuxiliary, secondaryFileSequence_->fileProductRegistry(), processConfiguration())); secondaryRunPrincipal_ = secondaryFileSequence_->readRun_(rp); checkHistoryConsistency(*primaryPrincipal, *secondaryRunPrincipal_); primaryPrincipal->recombine(*secondaryRunPrincipal_, branchIDsToReplace_[InRun]); } else { throw Exception(errors::MismatchedInputFiles, "PoolSource::readRun_") << " Run " << primaryPrincipal->run() << " is not found in the secondary input files\n"; } return primaryPrincipal; } return primaryFileSequence_->readRun_(runPrincipal); } boost::shared_ptr<LuminosityBlockPrincipal>
boost::shared_ptr< RunAuxiliary > edm::PoolSource::readRunAuxiliary_ | ( | ) | [private, virtual] |
Implements edm::InputSource.
Definition at line 126 of file PoolSource.cc.
ProcessingController::ReverseState edm::PoolSource::reverseState_ | ( | ) | const [private, virtual] |
Reimplemented from edm::InputSource.
Definition at line 296 of file PoolSource.cc.
void edm::PoolSource::rewind_ | ( | ) | [private, virtual] |
Reimplemented from edm::InputSource.
Definition at line 222 of file PoolSource.cc.
void edm::PoolSource::skip | ( | int | offset | ) | [private, virtual] |
Reimplemented from edm::InputSource.
Definition at line 228 of file PoolSource.cc.
std::array<std::vector<BranchID>, NumBranchTypes> edm::PoolSource::branchIDsToReplace_ [private] |
Definition at line 68 of file PoolSource.h.
Referenced by readEvent_(), readLuminosityBlock_(), and readRun_().
std::unique_ptr<RootInputFileSequence> edm::PoolSource::primaryFileSequence_ [private] |
Definition at line 63 of file PoolSource.h.
Definition at line 62 of file PoolSource.h.
std::unique_ptr<EventPrincipal> edm::PoolSource::secondaryEventPrincipal_ [private] |
Definition at line 67 of file PoolSource.h.
Referenced by readEvent_().
std::unique_ptr<RootInputFileSequence> edm::PoolSource::secondaryFileSequence_ [private] |
Definition at line 64 of file PoolSource.h.
Referenced by readEvent_(), readLuminosityBlock_(), readRun_(), and ~PoolSource().
boost::shared_ptr<LuminosityBlockPrincipal> edm::PoolSource::secondaryLumiPrincipal_ [private] |
Definition at line 66 of file PoolSource.h.
Referenced by readLuminosityBlock_().
boost::shared_ptr<RunPrincipal> edm::PoolSource::secondaryRunPrincipal_ [private] |
Definition at line 65 of file PoolSource.h.
Referenced by readRun_().