CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
edm::PoolSource Class Reference

#include <PoolSource.h>

Inheritance diagram for edm::PoolSource:
edm::InputSource edm::OneLumiPoolSource

Public Member Functions

bool bypassVersionCheck () const
 
bool dropDescendants () const
 
bool labelRawDataLikeMC () const
 
unsigned int nStreams () const
 
 PoolSource (ParameterSet const &pset, InputSourceDescription const &desc)
 
ProcessHistoryRegistryprocessHistoryRegistryForUpdate ()
 
ProductRegistryproductRegistryUpdate ()
 
ProductSelectorRules const & productSelectorRules () const
 
RunHelperBaserunHelper ()
 
bool skipBadFiles () const
 
int treeMaxVirtualSize () const
 
 ~PoolSource () override
 
- Public Member Functions inherited from edm::InputSource
std::shared_ptr< ActivityRegistryactReg () const
 Accessor for Activity Registry. More...
 
std::shared_ptr< BranchIDListHelper > & branchIDListHelper ()
 
std::shared_ptr< BranchIDListHelper const > branchIDListHelper () const
 Accessors for branchIDListHelper. More...
 
void closeFile (FileBlock *, bool cleaningUpAfterException)
 close current file More...
 
void doBeginJob ()
 Called by framework at beginning of job. More...
 
virtual void doBeginLumi (LuminosityBlockPrincipal &lbp, ProcessContext const *)
 Called by framework at beginning of lumi block. More...
 
virtual void doBeginRun (RunPrincipal &rp, ProcessContext const *)
 Called by framework at beginning of run. More...
 
void doEndJob ()
 Called by framework at end of job. More...
 
void fillProcessBlockHelper ()
 Fill the ProcessBlockHelper with info for the current file. More...
 
ProcessingController::ForwardState forwardState () const
 
bool goToEvent (EventID const &eventID)
 
 InputSource (InputSource const &)=delete
 
 InputSource (ParameterSet const &, InputSourceDescription const &)
 Constructor. More...
 
void issueReports (EventID const &eventID, StreamID streamID)
 issue an event report More...
 
LuminosityBlockNumber_t luminosityBlock () const
 Accessor for current luminosity block number. More...
 
std::shared_ptr< LuminosityBlockAuxiliaryluminosityBlockAuxiliary () const
 Called by the framework to merge or insert lumi in principal cache. More...
 
int maxEvents () const
 
int maxLuminosityBlocks () const
 
ModuleDescription const & moduleDescription () const
 Accessor for 'module' description. More...
 
ItemType nextItemType ()
 Advances the source to the next item. More...
 
bool nextProcessBlock (ProcessBlockPrincipal &)
 Next process block, return false if there is none, sets the processName in the principal. More...
 
InputSourceoperator= (InputSource const &)=delete
 
std::shared_ptr< ProcessBlockHelper > & processBlockHelper ()
 
std::shared_ptr< ProcessBlockHelper const > processBlockHelper () const
 Accessors for processBlockHelper. More...
 
ProcessConfiguration const & processConfiguration () const
 Accessor for Process Configuration. More...
 
std::string const & processGUID () const
 Accessor for global process identifier. More...
 
ProcessHistoryRegistryprocessHistoryRegistry ()
 
ProcessHistoryRegistry const & processHistoryRegistry () const
 Accessors for process history registry. More...
 
ProcessingMode processingMode () const
 RunsLumisAndEvents (default), RunsAndLumis, or Runs. More...
 
std::shared_ptr< ProductRegistry > & productRegistry ()
 
std::shared_ptr< ProductRegistry const > productRegistry () const
 Accessors for product registry. More...
 
bool randomAccess () const
 
void readAndMergeLumi (LuminosityBlockPrincipal &lbp)
 Read next luminosity block (same as a prior lumi) More...
 
void readAndMergeRun (RunPrincipal &rp)
 Read next run (same as a prior run) More...
 
bool readEvent (EventPrincipal &ep, EventID const &, StreamContext &)
 Read a specific event. More...
 
void readEvent (EventPrincipal &ep, StreamContext &)
 Read next event. More...
 
std::shared_ptr< FileBlockreadFile ()
 Read next file. More...
 
void readLuminosityBlock (LuminosityBlockPrincipal &lumiPrincipal, HistoryAppender &historyAppender)
 Read next luminosity block (new lumi) More...
 
std::shared_ptr< LuminosityBlockAuxiliaryreadLuminosityBlockAuxiliary ()
 Read next luminosity block Auxilary. More...
 
void readProcessBlock (ProcessBlockPrincipal &)
 Read next process block. More...
 
void readRun (RunPrincipal &runPrincipal, HistoryAppender &historyAppender)
 Read next run (new run) More...
 
std::shared_ptr< RunAuxiliaryreadRunAuxiliary ()
 Read next run Auxiliary. More...
 
ProcessHistoryID const & reducedProcessHistoryID () const
 
virtual void registerProducts ()
 Register any produced products. More...
 
int remainingEvents () const
 
int remainingLuminosityBlocks () const
 
void repeat ()
 Reset the remaining number of events/lumis to the maximum number. More...
 
std::pair< SharedResourcesAcquirer *, std::recursive_mutex * > resourceSharedWithDelayedReader ()
 Returns nullptr if no resource shared between the Source and a DelayedReader. More...
 
ProcessingController::ReverseState reverseState () const
 
void rewind ()
 Begin again at the first event. More...
 
RunNumber_t run () const
 Accessor for current run number. More...
 
std::shared_ptr< RunAuxiliaryrunAuxiliary () const
 Called by the framework to merge or insert run in principal cache. More...
 
void setLuminosityBlockNumber_t (LuminosityBlockNumber_t lb)
 Set the luminosity block ID. More...
 
void setRunNumber (RunNumber_t r)
 Set the run number. More...
 
void skipEvents (int offset)
 
std::shared_ptr< ThinnedAssociationsHelper > & thinnedAssociationsHelper ()
 
std::shared_ptr< ThinnedAssociationsHelper const > thinnedAssociationsHelper () const
 Accessors for thinnedAssociationsHelper. More...
 
Timestamp const & timestamp () const
 Accessor for the current time, as seen by the input source. More...
 
virtual ~InputSource () noexcept(false)
 Destructor. More...
 

Static Public Member Functions

static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::InputSource
static const std::string & baseType ()
 
static void fillDescription (ParameterSetDescription &desc)
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 

Protected Member Functions

ItemType getNextItemType () override
 
void readEvent_ (EventPrincipal &eventPrincipal) override
 
void readLuminosityBlock_ (LuminosityBlockPrincipal &lumiPrincipal) override
 
std::shared_ptr< LuminosityBlockAuxiliaryreadLuminosityBlockAuxiliary_ () override
 
- Protected Member Functions inherited from edm::InputSource
virtual void beginJob ()
 Begin protected makes it easier to do template programming. More...
 
void decreaseRemainingEventsBy (int iSkipped)
 
bool eventCached () const
 
bool newLumi () const
 
bool newRun () const
 
ProcessHistoryRegistryprocessHistoryRegistryForUpdate ()
 
ProductRegistryproductRegistryUpdate ()
 
void reset () const
 
void resetEventCached ()
 
void resetLuminosityBlockAuxiliary (bool isNewLumi=true) const
 
void resetNewLumi ()
 
void resetNewRun ()
 
void resetRunAuxiliary (bool isNewRun=true) const
 
void setEventCached ()
 Called by the framework to merge or ached() const {return eventCached_;}. More...
 
void setLuminosityBlockAuxiliary (LuminosityBlockAuxiliary *lbp)
 
void setNewLumi ()
 
void setNewRun ()
 
void setRunAuxiliary (RunAuxiliary *rp)
 
void setTimestamp (Timestamp const &theTime)
 To set the current time, as seen by the input source. More...
 
ItemType state () const
 

Private Member Functions

void closeFile_ () override
 
void endJob () override
 
void fillProcessBlockHelper_ () override
 
ProcessingController::ForwardState forwardState_ () const override
 
bool goToEvent_ (EventID const &eventID) override
 
bool nextProcessBlock_ (ProcessBlockPrincipal &) override
 
bool randomAccess_ () const override
 
std::shared_ptr< FileBlockreadFile_ () override
 
bool readIt (EventID const &id, EventPrincipal &eventPrincipal, StreamContext &streamContext) override
 
void readProcessBlock_ (ProcessBlockPrincipal &) override
 
void readRun_ (RunPrincipal &runPrincipal) override
 
std::shared_ptr< RunAuxiliaryreadRunAuxiliary_ () override
 
std::pair< SharedResourcesAcquirer *, std::recursive_mutex * > resourceSharedWithDelayedReader_ () override
 
ProcessingController::ReverseState reverseState_ () const override
 
void rewind_ () override
 
void skip (int offset) override
 

Private Attributes

std::array< std::vector< BranchID >, NumBranchTypesbranchIDsToReplace_
 
bool bypassVersionCheck_
 
InputFileCatalog catalog_
 
bool delayReadingEventProducts_
 
bool dropDescendants_
 
bool labelRawDataLikeMC_
 
std::shared_ptr< std::recursive_mutex > mutexSharedWithDelayedReader_
 
unsigned int nStreams_
 
edm::propagate_const< std::unique_ptr< RootPrimaryFileSequence > > primaryFileSequence_
 
ProductSelectorRules productSelectorRules_
 
std::unique_ptr< SharedResourcesAcquirerresourceSharedWithDelayedReaderPtr_
 
RootServiceChecker rootServiceChecker_
 
edm::propagate_const< std::unique_ptr< RunHelperBase > > runHelper_
 
InputFileCatalog secondaryCatalog_
 
std::vector< edm::propagate_const< std::unique_ptr< EventPrincipal > > > secondaryEventPrincipals_
 
edm::propagate_const< std::unique_ptr< RootSecondaryFileSequence > > secondaryFileSequence_
 
edm::propagate_const< std::shared_ptr< LuminosityBlockPrincipal > > secondaryLumiPrincipal_
 
edm::propagate_const< std::shared_ptr< RunPrincipal > > secondaryRunPrincipal_
 
bool skipBadFiles_
 
const int treeMaxVirtualSize_
 

Additional Inherited Members

- Public Types inherited from edm::InputSource
enum  ItemType {
  IsInvalid, IsStop, IsFile, IsRun,
  IsLumi, IsEvent, IsRepeat, IsSynchronize
}
 
enum  ProcessingMode { Runs, RunsAndLumis, RunsLumisAndEvents }
 
- Public Attributes inherited from edm::InputSource
signalslot::Signal< void(StreamContext const &, ModuleCallingContext const &)> postEventReadFromSourceSignal_
 
signalslot::Signal< void(StreamContext const &, ModuleCallingContext const &)> preEventReadFromSourceSignal_
 

Detailed Description

Definition at line 32 of file PoolSource.h.

Constructor & Destructor Documentation

◆ PoolSource()

edm::PoolSource::PoolSource ( ParameterSet const &  pset,
InputSourceDescription const &  desc 
)
explicit

Definition at line 65 of file PoolSource.cc.

66  : InputSource(pset, desc),
68  catalog_(pset.getUntrackedParameter<std::vector<std::string> >("fileNames"),
69  pset.getUntrackedParameter<std::string>("overrideCatalog", std::string())),
71  pset.getUntrackedParameter<std::vector<std::string> >("secondaryFileNames", std::vector<std::string>()),
72  pset.getUntrackedParameter<std::string>("overrideCatalog", std::string())),
77  nStreams_(desc.allocations_->numberOfStreams()),
78  skipBadFiles_(pset.getUntrackedParameter<bool>("skipBadFiles")),
79  bypassVersionCheck_(pset.getUntrackedParameter<bool>("bypassVersionCheck")),
80  treeMaxVirtualSize_(pset.getUntrackedParameter<int>("treeMaxVirtualSize")),
81  productSelectorRules_(pset, "inputCommands", "InputSource"),
82  dropDescendants_(pset.getUntrackedParameter<bool>("dropDescendantsOfDroppedBranches")),
83  labelRawDataLikeMC_(pset.getUntrackedParameter<bool>("labelRawDataLikeMC")),
84  delayReadingEventProducts_(pset.getUntrackedParameter<bool>("delayReadingEventProducts")),
87  // Note: primaryFileSequence_ and secondaryFileSequence_ need to be initialized last, because they use data members
88  // initialized previously in their own initialization.
89  primaryFileSequence_(new RootPrimaryFileSequence(pset, *this, catalog_)),
91  secondaryCatalog_.empty() ? nullptr : new RootSecondaryFileSequence(pset, *this, secondaryCatalog_)) {
93  resourceSharedWithDelayedReaderPtr_ = std::make_unique<SharedResourcesAcquirer>(std::move(resources.first));
95 
96  if (secondaryCatalog_.empty() && pset.getUntrackedParameter<bool>("needSecondaryFileNames", false)) {
97  throw Exception(errors::Configuration, "PoolSource") << "'secondaryFileNames' must be specified\n";
98  }
101  for (unsigned int index = 0; index < nStreams_; ++index) {
102  secondaryEventPrincipals_.emplace_back(new EventPrincipal(secondaryFileSequence_->fileProductRegistry(),
103  secondaryFileSequence_->fileBranchIDListHelper(),
104  std::make_shared<ThinnedAssociationsHelper const>(),
106  nullptr,
107  index));
108  }
109  std::array<std::set<BranchID>, NumBranchTypes> idsToReplace;
110  ProductRegistry::ProductList const& secondary = secondaryFileSequence_->fileProductRegistry()->productList();
111  ProductRegistry::ProductList const& primary = primaryFileSequence_->fileProductRegistry()->productList();
112  std::set<BranchID> associationsFromSecondary;
113  //this is the registry used by the 'outside' world and only has the primary file information in it at present
115  for (auto const& item : secondary) {
116  if (item.second.present()) {
117  idsToReplace[item.second.branchType()].insert(item.second.branchID());
118  if (item.second.branchType() == InEvent && item.second.unwrappedType() == typeid(ThinnedAssociation)) {
119  associationsFromSecondary.insert(item.second.branchID());
120  }
121  //now make sure this is marked as not dropped else the product will not be 'get'table from the Event
122  auto itFound = fullList.find(item.first);
123  if (itFound != fullList.end()) {
124  itFound->second.setDropped(false);
125  }
126  }
127  }
128  for (auto const& item : primary) {
129  if (item.second.present()) {
130  idsToReplace[item.second.branchType()].erase(item.second.branchID());
131  associationsFromSecondary.erase(item.second.branchID());
132  }
133  }
134  if (idsToReplace[InEvent].empty() && idsToReplace[InLumi].empty() && idsToReplace[InRun].empty()) {
135  secondaryFileSequence_ = nullptr; // propagate_const<T> has no reset() function
136  } else {
137  for (int i = InEvent; i < NumBranchTypes; ++i) {
138  branchIDsToReplace_[i].reserve(idsToReplace[i].size());
139  for (auto const& id : idsToReplace[i]) {
140  branchIDsToReplace_[i].push_back(id);
141  }
142  }
143  secondaryFileSequence_->initAssociationsFromSecondary(associationsFromSecondary);
144  }
145  }
146  }

References branchIDsToReplace_, edm::errors::Configuration, edm::SharedResourcesRegistry::createAcquirerForSourceDelayedReader(), edm::InputFileCatalog::empty(), relativeConstraints::empty, Exception, mps_fire::i, edm::InEvent, edm::InLumi, edm::InRun, edm::SharedResourcesRegistry::instance(), B2GTnPMonitor_cfi::item, eostools::move(), mutexSharedWithDelayedReader_, nStreams_, edm::NumBranchTypes, primaryFileSequence_, edm::InputSource::processConfiguration(), edm::ProductRegistry::productListUpdator(), edm::InputSource::productRegistryUpdate(), muonDTDigis_cfi::pset, mps_fire::resources, resourceSharedWithDelayedReaderPtr_, secondaryCatalog_, secondaryEventPrincipals_, secondaryFileSequence_, and findQualityFiles::size.

◆ ~PoolSource()

edm::PoolSource::~PoolSource ( )
override

Definition at line 148 of file PoolSource.cc.

148 {}

Member Function Documentation

◆ bypassVersionCheck()

bool edm::PoolSource::bypassVersionCheck ( ) const
inline

◆ closeFile_()

void edm::PoolSource::closeFile_ ( )
overrideprivatevirtual

Reimplemented from edm::InputSource.

Definition at line 165 of file PoolSource.cc.

165 { primaryFileSequence_->closeFile_(); }

References primaryFileSequence_.

◆ dropDescendants()

bool edm::PoolSource::dropDescendants ( ) const
inline

◆ endJob()

void edm::PoolSource::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::InputSource.

Definition at line 150 of file PoolSource.cc.

150  {
152  secondaryFileSequence_->endJob();
153  primaryFileSequence_->endJob();
155  }

References primaryFileSequence_, edm::InputFile::reportReadBranches(), and secondaryFileSequence_.

◆ fillDescriptions()

void edm::PoolSource::fillDescriptions ( ConfigurationDescriptions descriptions)
static

Definition at line 288 of file PoolSource.cc.

288  {
290 
291  std::vector<std::string> defaultStrings;
292  desc.setComment("Reads EDM/Root files.");
293  desc.addUntracked<std::vector<std::string> >("fileNames")->setComment("Names of files to be processed.");
294  desc.addUntracked<std::vector<std::string> >("secondaryFileNames", defaultStrings)
295  ->setComment("Names of secondary files to be processed.");
296  desc.addUntracked<bool>("needSecondaryFileNames", false)
297  ->setComment("If True, 'secondaryFileNames' must be specified and be non-empty.");
298  desc.addUntracked<std::string>("overrideCatalog", std::string());
299  desc.addUntracked<bool>("skipBadFiles", false)
300  ->setComment(
301  "True: Ignore any missing or unopenable input file.\n"
302  "False: Throw exception if missing or unopenable input file.");
303  desc.addUntracked<bool>("bypassVersionCheck", false)
304  ->setComment(
305  "True: Bypass release version check.\n"
306  "False: Throw exception if reading file in a release prior to the release in which the file was written.");
307  desc.addUntracked<int>("treeMaxVirtualSize", -1)
308  ->setComment("Size of ROOT TTree TBasket cache. Affects performance.");
309  desc.addUntracked<bool>("dropDescendantsOfDroppedBranches", true)
310  ->setComment("If True, also drop on input any descendent of any branch dropped on input.");
311  desc.addUntracked<bool>("labelRawDataLikeMC", true)
312  ->setComment("If True: replace module label for raw data to match MC. Also use 'LHC' as process.");
313  desc.addUntracked<bool>("delayReadingEventProducts", true)
314  ->setComment(
315  "If True: do not read a data product from the file until it is requested. If False: all event data "
316  "products are read upfront.");
321 
322  descriptions.add("source", desc);
323  }

References edm::ConfigurationDescriptions::add(), submitPVResolutionJobs::desc, edm::RunHelperBase::fillDescription(), edm::ProductSelectorRules::fillDescription(), edm::RootPrimaryFileSequence::fillDescription(), edm::InputSource::fillDescription(), and AlCaHLTBitMon_QueryRunRegistry::string.

◆ fillProcessBlockHelper_()

void edm::PoolSource::fillProcessBlockHelper_ ( )
overrideprivatevirtual

Reimplemented from edm::InputSource.

Definition at line 173 of file PoolSource.cc.

173 { primaryFileSequence_->fillProcessBlockHelper_(); }

References primaryFileSequence_.

◆ forwardState_()

ProcessingController::ForwardState edm::PoolSource::forwardState_ ( ) const
overrideprivatevirtual

Reimplemented from edm::InputSource.

Definition at line 327 of file PoolSource.cc.

327 { return primaryFileSequence_->forwardState(); }

References primaryFileSequence_.

◆ getNextItemType()

InputSource::ItemType edm::PoolSource::getNextItemType ( )
overrideprotectedvirtual

◆ goToEvent_()

bool edm::PoolSource::goToEvent_ ( EventID const &  eventID)
overrideprivatevirtual

Reimplemented from edm::InputSource.

Definition at line 286 of file PoolSource.cc.

286 { return primaryFileSequence_->goToEvent(eventID); }

References primaryFileSequence_.

◆ labelRawDataLikeMC()

bool edm::PoolSource::labelRawDataLikeMC ( ) const
inline

◆ nextProcessBlock_()

bool edm::PoolSource::nextProcessBlock_ ( ProcessBlockPrincipal processBlockPrincipal)
overrideprivatevirtual

Reimplemented from edm::InputSource.

Definition at line 175 of file PoolSource.cc.

175  {
176  return primaryFileSequence_->nextProcessBlock_(processBlockPrincipal);
177  }

References primaryFileSequence_.

◆ nStreams()

unsigned int edm::PoolSource::nStreams ( ) const
inline

Definition at line 44 of file PoolSource.h.

44 { return nStreams_; }

References nStreams_.

Referenced by edm::RootSecondaryFileSequence::makeRootFile(), and edm::RootPrimaryFileSequence::makeRootFile().

◆ processHistoryRegistryForUpdate()

ProcessHistoryRegistry& edm::InputSource::processHistoryRegistryForUpdate
inline

◆ productRegistryUpdate()

ProductRegistry& edm::InputSource::productRegistryUpdate
inline

◆ productSelectorRules()

ProductSelectorRules const& edm::PoolSource::productSelectorRules ( ) const
inline

◆ randomAccess_()

bool edm::PoolSource::randomAccess_ ( ) const
overrideprivatevirtual

Reimplemented from edm::InputSource.

Definition at line 325 of file PoolSource.cc.

325 { return true; }

◆ readEvent_()

void edm::PoolSource::readEvent_ ( EventPrincipal eventPrincipal)
overrideprotectedvirtual

Implements edm::InputSource.

Definition at line 227 of file PoolSource.cc.

227  {
228  bool readEventSucceeded = primaryFileSequence_->readEvent(eventPrincipal);
229  assert(readEventSucceeded);
231  bool found = secondaryFileSequence_->skipToItem(
232  eventPrincipal.run(), eventPrincipal.luminosityBlock(), eventPrincipal.id().event());
233  if (found) {
234  EventPrincipal& secondaryEventPrincipal = *secondaryEventPrincipals_[eventPrincipal.streamID().value()];
235  bool readEventSucceeded = secondaryFileSequence_->readEvent(secondaryEventPrincipal);
236  checkConsistency(eventPrincipal, secondaryEventPrincipal);
237  checkHistoryConsistency(eventPrincipal, secondaryEventPrincipal);
238  assert(readEventSucceeded);
239  eventPrincipal.recombine(secondaryEventPrincipal, branchIDsToReplace_[InEvent]);
240  eventPrincipal.mergeProvenanceRetrievers(secondaryEventPrincipal);
241  secondaryEventPrincipal.clearPrincipal();
242  } else {
243  throw Exception(errors::MismatchedInputFiles, "PoolSource::readEvent_")
244  << eventPrincipal.id() << " is not found in the secondary input files\n";
245  }
246  }
247  if (not delayReadingEventProducts_) {
248  eventPrincipal.readAllFromSourceAndMergeImmediately();
249  }
250  }

References cms::cuda::assert(), branchIDsToReplace_, edm::Principal::clearPrincipal(), delayReadingEventProducts_, relativeConstraints::empty, edm::EventID::event(), Exception, newFWLiteAna::found, edm::EventPrincipal::id(), edm::InEvent, edm::EventPrincipal::luminosityBlock(), edm::EventPrincipal::mergeProvenanceRetrievers(), edm::errors::MismatchedInputFiles, primaryFileSequence_, edm::Principal::readAllFromSourceAndMergeImmediately(), edm::Principal::recombine(), edm::EventPrincipal::run(), secondaryEventPrincipals_, secondaryFileSequence_, edm::EventPrincipal::streamID(), and edm::StreamID::value().

Referenced by edm::OneLumiPoolSource::readEvent_(), and readIt().

◆ readFile_()

std::shared_ptr< FileBlock > edm::PoolSource::readFile_ ( )
overrideprivatevirtual

Reimplemented from edm::InputSource.

Definition at line 157 of file PoolSource.cc.

157  {
158  std::shared_ptr<FileBlock> fb = primaryFileSequence_->readFile_();
160  fb->setNotFastClonable(FileBlock::HasSecondaryFileSequence);
161  }
162  return fb;
163  }

References edm::FileBlock::HasSecondaryFileSequence, primaryFileSequence_, and secondaryFileSequence_.

◆ readIt()

bool edm::PoolSource::readIt ( EventID const &  id,
EventPrincipal eventPrincipal,
StreamContext streamContext 
)
overrideprivatevirtual

Reimplemented from edm::InputSource.

Definition at line 252 of file PoolSource.cc.

252  {
253  bool found = primaryFileSequence_->skipToItem(id.run(), id.luminosityBlock(), id.event());
254  if (!found)
255  return false;
256  EventSourceSentry sentry(*this, streamContext);
257  readEvent_(eventPrincipal);
258  return true;
259  }

References edmPickEvents::event, newFWLiteAna::found, edm::InputSource::luminosityBlock(), primaryFileSequence_, readEvent_(), and edm::InputSource::run().

◆ readLuminosityBlock_()

void edm::PoolSource::readLuminosityBlock_ ( LuminosityBlockPrincipal lumiPrincipal)
overrideprotectedvirtual

Reimplemented from edm::InputSource.

Definition at line 205 of file PoolSource.cc.

205  {
206  primaryFileSequence_->readLuminosityBlock_(lumiPrincipal);
208  bool found = secondaryFileSequence_->skipToItem(lumiPrincipal.run(), lumiPrincipal.luminosityBlock(), 0U);
209  if (found) {
210  std::shared_ptr<LuminosityBlockAuxiliary> secondaryAuxiliary =
211  secondaryFileSequence_->readLuminosityBlockAuxiliary_();
212  checkConsistency(lumiPrincipal.aux(), *secondaryAuxiliary);
213  secondaryLumiPrincipal_ = std::make_shared<LuminosityBlockPrincipal>(
214  secondaryFileSequence_->fileProductRegistry(), processConfiguration(), nullptr, lumiPrincipal.index());
215  secondaryLumiPrincipal_->setAux(*secondaryAuxiliary);
216  secondaryFileSequence_->readLuminosityBlock_(*secondaryLumiPrincipal_);
217  checkHistoryConsistency(lumiPrincipal, *secondaryLumiPrincipal_);
218  lumiPrincipal.recombine(*secondaryLumiPrincipal_, branchIDsToReplace_[InLumi]);
219  } else {
220  throw Exception(errors::MismatchedInputFiles, "PoolSource::readLuminosityBlock_")
221  << " Run " << lumiPrincipal.run() << " LuminosityBlock " << lumiPrincipal.luminosityBlock()
222  << " is not found in the secondary input files\n";
223  }
224  }
225  }

References edm::LuminosityBlockPrincipal::aux(), branchIDsToReplace_, relativeConstraints::empty, Exception, newFWLiteAna::found, edm::LuminosityBlockPrincipal::index(), edm::InLumi, edm::LuminosityBlockPrincipal::luminosityBlock(), edm::errors::MismatchedInputFiles, primaryFileSequence_, edm::InputSource::processConfiguration(), edm::Principal::recombine(), edm::LuminosityBlockPrincipal::run(), secondaryFileSequence_, secondaryLumiPrincipal_, and mitigatedMETSequence_cff::U.

Referenced by edm::OneLumiPoolSource::getNextItemType().

◆ readLuminosityBlockAuxiliary_()

std::shared_ptr< LuminosityBlockAuxiliary > edm::PoolSource::readLuminosityBlockAuxiliary_ ( )
overrideprotectedvirtual

Implements edm::InputSource.

Definition at line 169 of file PoolSource.cc.

169  {
170  return primaryFileSequence_->readLuminosityBlockAuxiliary_();
171  }

References primaryFileSequence_.

Referenced by edm::OneLumiPoolSource::readLuminosityBlockAuxiliary_().

◆ readProcessBlock_()

void edm::PoolSource::readProcessBlock_ ( ProcessBlockPrincipal processBlockPrincipal)
overrideprivatevirtual

Reimplemented from edm::InputSource.

Definition at line 179 of file PoolSource.cc.

179  {
180  primaryFileSequence_->readProcessBlock_(processBlockPrincipal);
181  }

References primaryFileSequence_.

◆ readRun_()

void edm::PoolSource::readRun_ ( RunPrincipal runPrincipal)
overrideprivatevirtual

Reimplemented from edm::InputSource.

Definition at line 183 of file PoolSource.cc.

183  {
184  primaryFileSequence_->readRun_(runPrincipal);
186  bool found = secondaryFileSequence_->skipToItem(runPrincipal.run(), 0U, 0U);
187  if (found) {
188  std::shared_ptr<RunAuxiliary> secondaryAuxiliary = secondaryFileSequence_->readRunAuxiliary_();
189  checkConsistency(runPrincipal.aux(), *secondaryAuxiliary);
190  secondaryRunPrincipal_ = std::make_shared<RunPrincipal>(secondaryAuxiliary,
191  secondaryFileSequence_->fileProductRegistry(),
193  nullptr,
194  runPrincipal.index());
196  checkHistoryConsistency(runPrincipal, *secondaryRunPrincipal_);
197  runPrincipal.recombine(*secondaryRunPrincipal_, branchIDsToReplace_[InRun]);
198  } else {
199  throw Exception(errors::MismatchedInputFiles, "PoolSource::readRun_")
200  << " Run " << runPrincipal.run() << " is not found in the secondary input files\n";
201  }
202  }
203  }

References edm::RunPrincipal::aux(), branchIDsToReplace_, relativeConstraints::empty, Exception, newFWLiteAna::found, edm::RunPrincipal::index(), edm::InRun, edm::errors::MismatchedInputFiles, primaryFileSequence_, edm::InputSource::processConfiguration(), edm::Principal::recombine(), edm::RunPrincipal::run(), secondaryFileSequence_, secondaryRunPrincipal_, and mitigatedMETSequence_cff::U.

◆ readRunAuxiliary_()

std::shared_ptr< RunAuxiliary > edm::PoolSource::readRunAuxiliary_ ( )
overrideprivatevirtual

Implements edm::InputSource.

Definition at line 167 of file PoolSource.cc.

167 { return primaryFileSequence_->readRunAuxiliary_(); }

References primaryFileSequence_.

◆ resourceSharedWithDelayedReader_()

std::pair< SharedResourcesAcquirer *, std::recursive_mutex * > edm::PoolSource::resourceSharedWithDelayedReader_ ( )
overrideprivatevirtual

Reimplemented from edm::InputSource.

Definition at line 276 of file PoolSource.cc.

276  {
277  return std::make_pair(resourceSharedWithDelayedReaderPtr_.get(), mutexSharedWithDelayedReader_.get());
278  }

References mutexSharedWithDelayedReader_, and resourceSharedWithDelayedReaderPtr_.

◆ reverseState_()

ProcessingController::ReverseState edm::PoolSource::reverseState_ ( ) const
overrideprivatevirtual

Reimplemented from edm::InputSource.

Definition at line 329 of file PoolSource.cc.

329 { return primaryFileSequence_->reverseState(); }

References primaryFileSequence_.

◆ rewind_()

void edm::PoolSource::rewind_ ( )
overrideprivatevirtual

Reimplemented from edm::InputSource.

Definition at line 281 of file PoolSource.cc.

281 { primaryFileSequence_->rewind_(); }

References primaryFileSequence_.

◆ runHelper()

RunHelperBase* edm::PoolSource::runHelper ( )
inline

Definition at line 47 of file PoolSource.h.

47 { return runHelper_.get(); }

References runHelper_.

Referenced by edm::RootSecondaryFileSequence::makeRootFile(), and edm::RootPrimaryFileSequence::makeRootFile().

◆ skip()

void edm::PoolSource::skip ( int  offset)
overrideprivatevirtual

Reimplemented from edm::InputSource.

Definition at line 284 of file PoolSource.cc.

284 { primaryFileSequence_->skipEvents(offset); }

References hltrates_dqm_sourceclient-live_cfg::offset, and primaryFileSequence_.

◆ skipBadFiles()

bool edm::PoolSource::skipBadFiles ( ) const
inline

◆ treeMaxVirtualSize()

int edm::PoolSource::treeMaxVirtualSize ( ) const
inline

Member Data Documentation

◆ branchIDsToReplace_

std::array<std::vector<BranchID>, NumBranchTypes> edm::PoolSource::branchIDsToReplace_
private

Definition at line 82 of file PoolSource.h.

Referenced by PoolSource(), readEvent_(), readLuminosityBlock_(), and readRun_().

◆ bypassVersionCheck_

bool edm::PoolSource::bypassVersionCheck_
private

Definition at line 86 of file PoolSource.h.

Referenced by bypassVersionCheck().

◆ catalog_

InputFileCatalog edm::PoolSource::catalog_
private

Definition at line 77 of file PoolSource.h.

◆ delayReadingEventProducts_

bool edm::PoolSource::delayReadingEventProducts_
private

Definition at line 91 of file PoolSource.h.

Referenced by readEvent_().

◆ dropDescendants_

bool edm::PoolSource::dropDescendants_
private

Definition at line 89 of file PoolSource.h.

Referenced by dropDescendants().

◆ labelRawDataLikeMC_

bool edm::PoolSource::labelRawDataLikeMC_
private

Definition at line 90 of file PoolSource.h.

Referenced by labelRawDataLikeMC().

◆ mutexSharedWithDelayedReader_

std::shared_ptr<std::recursive_mutex> edm::PoolSource::mutexSharedWithDelayedReader_
private

Definition at line 96 of file PoolSource.h.

Referenced by PoolSource(), and resourceSharedWithDelayedReader_().

◆ nStreams_

unsigned int edm::PoolSource::nStreams_
private

Definition at line 84 of file PoolSource.h.

Referenced by nStreams(), and PoolSource().

◆ primaryFileSequence_

edm::propagate_const<std::unique_ptr<RootPrimaryFileSequence> > edm::PoolSource::primaryFileSequence_
private

◆ productSelectorRules_

ProductSelectorRules edm::PoolSource::productSelectorRules_
private

Definition at line 88 of file PoolSource.h.

Referenced by productSelectorRules().

◆ resourceSharedWithDelayedReaderPtr_

std::unique_ptr<SharedResourcesAcquirer> edm::PoolSource::resourceSharedWithDelayedReaderPtr_
private

Definition at line 95 of file PoolSource.h.

Referenced by PoolSource(), and resourceSharedWithDelayedReader_().

◆ rootServiceChecker_

RootServiceChecker edm::PoolSource::rootServiceChecker_
private

Definition at line 76 of file PoolSource.h.

◆ runHelper_

edm::propagate_const<std::unique_ptr<RunHelperBase> > edm::PoolSource::runHelper_
private

Definition at line 93 of file PoolSource.h.

Referenced by getNextItemType(), and runHelper().

◆ secondaryCatalog_

InputFileCatalog edm::PoolSource::secondaryCatalog_
private

Definition at line 78 of file PoolSource.h.

Referenced by PoolSource().

◆ secondaryEventPrincipals_

std::vector<edm::propagate_const<std::unique_ptr<EventPrincipal> > > edm::PoolSource::secondaryEventPrincipals_
private

Definition at line 81 of file PoolSource.h.

Referenced by PoolSource(), and readEvent_().

◆ secondaryFileSequence_

edm::propagate_const<std::unique_ptr<RootSecondaryFileSequence> > edm::PoolSource::secondaryFileSequence_
private

◆ secondaryLumiPrincipal_

edm::propagate_const<std::shared_ptr<LuminosityBlockPrincipal> > edm::PoolSource::secondaryLumiPrincipal_
private

Definition at line 80 of file PoolSource.h.

Referenced by readLuminosityBlock_().

◆ secondaryRunPrincipal_

edm::propagate_const<std::shared_ptr<RunPrincipal> > edm::PoolSource::secondaryRunPrincipal_
private

Definition at line 79 of file PoolSource.h.

Referenced by readRun_().

◆ skipBadFiles_

bool edm::PoolSource::skipBadFiles_
private

Definition at line 85 of file PoolSource.h.

Referenced by skipBadFiles().

◆ treeMaxVirtualSize_

const int edm::PoolSource::treeMaxVirtualSize_
private

Definition at line 87 of file PoolSource.h.

Referenced by treeMaxVirtualSize().

edm::PoolSource::primaryFileSequence_
edm::propagate_const< std::unique_ptr< RootPrimaryFileSequence > > primaryFileSequence_
Definition: PoolSource.h:97
edm::RunNumber_t
unsigned int RunNumber_t
Definition: RunLumiEventNumber.h:14
edm::PoolSource::secondaryRunPrincipal_
edm::propagate_const< std::shared_ptr< RunPrincipal > > secondaryRunPrincipal_
Definition: PoolSource.h:79
edm::errors::MismatchedInputFiles
Definition: EDMException.h:52
mps_fire.i
i
Definition: mps_fire.py:428
edm::PoolSource::dropDescendants_
bool dropDescendants_
Definition: PoolSource.h:89
edm::InputSource::productRegistry_
edm::propagate_const< std::shared_ptr< ProductRegistry > > productRegistry_
Definition: InputSource.h:424
edm::PoolSource::bypassVersionCheck_
bool bypassVersionCheck_
Definition: PoolSource.h:86
cms::cuda::assert
assert(be >=bs)
edm::PoolSource::runHelper_
edm::propagate_const< std::unique_ptr< RunHelperBase > > runHelper_
Definition: PoolSource.h:93
edm::SharedResourcesRegistry::createAcquirerForSourceDelayedReader
std::pair< SharedResourcesAcquirer, std::shared_ptr< std::recursive_mutex > > createAcquirerForSourceDelayedReader()
Definition: SharedResourcesRegistry.cc:64
edm::PoolSource::resourceSharedWithDelayedReaderPtr_
std::unique_ptr< SharedResourcesAcquirer > resourceSharedWithDelayedReaderPtr_
Definition: PoolSource.h:95
edm::PoolSource::secondaryEventPrincipals_
std::vector< edm::propagate_const< std::unique_ptr< EventPrincipal > > > secondaryEventPrincipals_
Definition: PoolSource.h:81
edm::InputFileCatalog::empty
bool empty() const
Definition: InputFileCatalog.h:42
newFWLiteAna.found
found
Definition: newFWLiteAna.py:118
edm::LuminosityBlockNumber_t
unsigned int LuminosityBlockNumber_t
Definition: RunLumiEventNumber.h:13
edm::InRun
Definition: BranchType.h:11
edm::InputSource::state
ItemType state() const
Definition: InputSource.h:332
edm::NumBranchTypes
Definition: BranchType.h:11
edm::RunHelperBase::fillDescription
static void fillDescription(ParameterSetDescription &desc)
Definition: RunHelper.cc:240
edm::InputSource::IsRun
Definition: InputSource.h:54
edm::InputSource::processHistoryRegistry_
edm::propagate_const< std::unique_ptr< ProcessHistoryRegistry > > processHistoryRegistry_
Definition: InputSource.h:425
edm::InputFile::reportReadBranches
static void reportReadBranches()
Definition: InputFile.cc:106
edm::PoolSource::labelRawDataLikeMC_
bool labelRawDataLikeMC_
Definition: PoolSource.h:90
edm::InputSource::fillDescription
static void fillDescription(ParameterSetDescription &desc)
Definition: InputSource.cc:117
edm::ProductRegistry::productListUpdator
ProductList & productListUpdator()
Definition: ProductRegistry.h:81
edm::makeRunHelper
std::unique_ptr< RunHelperBase > makeRunHelper(ParameterSet const &pset)
Definition: RunHelper.cc:12
edm::InputSource::IsSynchronize
Definition: InputSource.h:54
edm::PoolSource::delayReadingEventProducts_
bool delayReadingEventProducts_
Definition: PoolSource.h:91
edm::EventNumber_t
unsigned long long EventNumber_t
Definition: RunLumiEventNumber.h:12
edm::InEvent
Definition: BranchType.h:11
edm::PoolSource::nStreams_
unsigned int nStreams_
Definition: PoolSource.h:84
edm::IndexIntoFile::invalidLumi
static constexpr LuminosityBlockNumber_t invalidLumi
Definition: IndexIntoFile.h:234
edm::PoolSource::secondaryCatalog_
InputFileCatalog secondaryCatalog_
Definition: PoolSource.h:78
mitigatedMETSequence_cff.U
U
Definition: mitigatedMETSequence_cff.py:36
edm::InputSource::InputSource
InputSource(ParameterSet const &, InputSourceDescription const &)
Constructor.
Definition: InputSource.cc:47
edm::SharedResourcesRegistry::instance
static SharedResourcesRegistry * instance()
Definition: SharedResourcesRegistry.cc:25
edm::ProductRegistry::ProductList
std::map< BranchKey, BranchDescription > ProductList
Definition: ProductRegistry.h:39
edm::IndexIntoFile::invalidEvent
static constexpr EventNumber_t invalidEvent
Definition: IndexIntoFile.h:235
edm::PoolSource::treeMaxVirtualSize_
const int treeMaxVirtualSize_
Definition: PoolSource.h:87
edm::InputSource::productRegistryUpdate
ProductRegistry & productRegistryUpdate()
Definition: InputSource.h:330
edm::InLumi
Definition: BranchType.h:11
edm::ProductSelectorRules::fillDescription
static void fillDescription(ParameterSetDescription &desc, char const *parameterName, std::vector< std::string > const &defaultStrings=defaultSelectionStrings())
Definition: ProductSelectorRules.cc:202
edm::InputSource::IsLumi
Definition: InputSource.h:54
edm::PoolSource::readEvent_
void readEvent_(EventPrincipal &eventPrincipal) override
Definition: PoolSource.cc:227
edmPickEvents.event
event
Definition: edmPickEvents.py:273
edm::PoolSource::skipBadFiles_
bool skipBadFiles_
Definition: PoolSource.h:85
edm::FileBlock::HasSecondaryFileSequence
Definition: FileBlock.h:32
edm::InputSource::luminosityBlock
LuminosityBlockNumber_t luminosityBlock() const
Accessor for current luminosity block number.
Definition: InputSource.cc:462
B2GTnPMonitor_cfi.item
item
Definition: B2GTnPMonitor_cfi.py:147
edm::PoolSource::mutexSharedWithDelayedReader_
std::shared_ptr< std::recursive_mutex > mutexSharedWithDelayedReader_
Definition: PoolSource.h:96
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::InputSource::ItemType
ItemType
Definition: InputSource.h:54
edm::InputSource::processConfiguration
ProcessConfiguration const & processConfiguration() const
Accessor for Process Configuration.
Definition: InputSource.h:192
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
eostools.move
def move(src, dest)
Definition: eostools.py:511
edm::PoolSource::productSelectorRules_
ProductSelectorRules productSelectorRules_
Definition: PoolSource.h:88
relativeConstraints.empty
bool empty
Definition: relativeConstraints.py:46
Exception
Definition: hltDiff.cc:245
mps_fire.resources
resources
Definition: mps_fire.py:263
ParameterSetDescription
edm::PoolSource::rootServiceChecker_
RootServiceChecker rootServiceChecker_
Definition: PoolSource.h:76
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
edm::RootPrimaryFileSequence::fillDescription
static void fillDescription(ParameterSetDescription &desc)
Definition: RootPrimaryFileSequence.cc:403
edm::PoolSource::branchIDsToReplace_
std::array< std::vector< BranchID >, NumBranchTypes > branchIDsToReplace_
Definition: PoolSource.h:82
edm::InputSource::IsEvent
Definition: InputSource.h:54
edm::PoolSource::catalog_
InputFileCatalog catalog_
Definition: PoolSource.h:77
event
Definition: event.py:1
hltrates_dqm_sourceclient-live_cfg.offset
offset
Definition: hltrates_dqm_sourceclient-live_cfg.py:82
lumi
Definition: LumiSectionData.h:20
edm::errors::Configuration
Definition: EDMException.h:36
edm::PoolSource::secondaryLumiPrincipal_
edm::propagate_const< std::shared_ptr< LuminosityBlockPrincipal > > secondaryLumiPrincipal_
Definition: PoolSource.h:80
edm::PoolSource::secondaryFileSequence_
edm::propagate_const< std::unique_ptr< RootSecondaryFileSequence > > secondaryFileSequence_
Definition: PoolSource.h:98
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
edm::IndexIntoFile::invalidRun
static constexpr RunNumber_t invalidRun
Definition: IndexIntoFile.h:233
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443
edm::InputSource::run
RunNumber_t run() const
Accessor for current run number.
Definition: InputSource.cc:457