CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
edm::RepeatingCachedRootSource Class Reference
Inheritance diagram for edm::RepeatingCachedRootSource:
edm::InputSource

Classes

class  RCDelayedReader
 
class  RCProductGetter
 

Public Member Functions

std::shared_ptr< WrapperBasegetProduct (unsigned int iStreamIndex, BranchID const &k, EDProductGetter const *ep) const
 
 RepeatingCachedRootSource (ParameterSet const &pset, InputSourceDescription const &desc)
 
- Public Member Functions inherited from edm::InputSource
std::shared_ptr< ActivityRegistryactReg () const
 Accessor for Activity Registry. More...
 
std::shared_ptr< BranchIDListHelper const > branchIDListHelper () const
 Accessors for branchIDListHelper. More...
 
std::shared_ptr< BranchIDListHelper > & branchIDListHelper ()
 
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 (ParameterSet const &, InputSourceDescription const &)
 Constructor. More...
 
 InputSource (InputSource const &)=delete
 
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 const > processBlockHelper () const
 Accessors for processBlockHelper. More...
 
std::shared_ptr< ProcessBlockHelper > & processBlockHelper ()
 
ProcessConfiguration const & processConfiguration () const
 Accessor for Process Configuration. More...
 
std::string const & processGUID () const
 Accessor for global process identifier. More...
 
ProcessHistoryRegistry const & processHistoryRegistry () const
 Accessors for process history registry. More...
 
ProcessHistoryRegistryprocessHistoryRegistry ()
 
ProcessingMode processingMode () const
 RunsLumisAndEvents (default), RunsAndLumis, or Runs. More...
 
std::shared_ptr< ProductRegistry const > productRegistry () const
 Accessors for product registry. More...
 
std::shared_ptr< ProductRegistry > & productRegistry ()
 
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...
 
void readEvent (EventPrincipal &ep, StreamContext &)
 Read next event. More...
 
bool readEvent (EventPrincipal &ep, EventID const &, StreamContext &)
 Read a specific 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 const > thinnedAssociationsHelper () const
 Accessors for thinnedAssociationsHelper. More...
 
std::shared_ptr< ThinnedAssociationsHelper > & thinnedAssociationsHelper ()
 
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
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 beginJob () override
 Begin protected makes it easier to do template programming. More...
 
void fillProcessBlockHelper_ () override
 
bool goToEvent_ (EventID const &eventID) override
 
std::unique_ptr< RootFilemakeRootFile (std::string const &logicalFileName, std::string const &pName, bool isSkipping, std::shared_ptr< InputFile > filePtr, std::shared_ptr< EventSkipperByID > skipper, std::shared_ptr< DuplicateChecker > duplicateChecker, std::vector< std::shared_ptr< IndexIntoFile >> &indexesIntoFiles)
 
bool nextProcessBlock_ (ProcessBlockPrincipal &) 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
 
void skip (int offset) override
 

Private Attributes

std::map< edm::BranchID, size_t > branchIDToWrapperIndex_
 
BranchListIndexes branchListIndexes_
 
std::vector< std::vector< std::shared_ptr< edm::WrapperBase > > > cachedWrappers_
 
std::vector< RCDelayedReaderdelayedReaders_
 
std::vector< EventAuxiliaryeventAuxs_
 
unsigned long long eventIndex_ = 0
 
std::vector< RCProductGettergetters_
 
size_t nextEventIndex_ = 0
 
std::vector< ProcessHistoryIDorderedProcessHistoryIDs_
 
ItemType presentState_ = IsFile
 
std::map< edm::ProductID, size_t > productIDToWrapperIndex_
 
ProductProvenanceRetriever provRetriever_
 
std::unique_ptr< RootFilerootFile_
 
RootServiceChecker rootServiceChecker_
 
edm::propagate_const< std::unique_ptr< RunHelperBase > > runHelper_
 
EventSelectionIDVector selectionIDs_
 
ProductSelectorRules selectorRules_
 
std::vector< size_t > streamToCacheIndex_
 

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 49 of file RepeatingCachedRootSource.cc.

Constructor & Destructor Documentation

◆ RepeatingCachedRootSource()

RepeatingCachedRootSource::RepeatingCachedRootSource ( ParameterSet const &  pset,
InputSourceDescription const &  desc 
)

Definition at line 173 of file RepeatingCachedRootSource.cc.

References branchIDToWrapperIndex_, utilities::cache(), cachedWrappers_, getEcalConditions_orcoffint2r_cff::catalog, edm::EventSkipperByID::create(), delayedReaders_, getters_, edm::InEvent, input, makeRootFile(), edm::Primary, dumpMFGeometry_cfg::prod, productIDToWrapperIndex_, edm::InputSource::productRegistryUpdate(), muonDTDigis_cfi::pset, fetchall_from_DQM_v2::release, rootFile_, AlCaHLTBitMon_QueryRunRegistry::string, mitigatedMETSequence_cff::U, and edm::ProductRegistry::updateFromInput().

174  : InputSource(pset, desc),
175  selectorRules_(pset, "inputCommands", "InputSource"),
176  runHelper_(std::make_unique<DefaultRunHelper>()),
177  cachedWrappers_(pset.getUntrackedParameter<unsigned int>("repeatNEvents")),
178  eventAuxs_(cachedWrappers_.size()),
179  provRetriever_(0),
180  delayedReaders_(desc.allocations_->numberOfStreams()),
181  streamToCacheIndex_(desc.allocations_->numberOfStreams(), 0) {
182  {
183  getters_.reserve(cachedWrappers_.size());
184  for (auto& cw : cachedWrappers_) {
185  getters_.emplace_back(&productIDToWrapperIndex_, &cw);
186  }
187 
188  int index = 0;
189  std::for_each(delayedReaders_.begin(), delayedReaders_.end(), [&index, this](auto& iR) {
190  iR.m_streamIndex = index++;
191  iR.m_source = this;
192  });
193  }
194  auto logicalFileName = pset.getUntrackedParameter<std::string>("fileName");
195  InputFileCatalog catalog(std::vector<std::string>(1U, logicalFileName), "");
196  auto const& physicalFileName = catalog.fileCatalogItems().front().fileNames().front();
197  auto const nEventsToSkip = pset.getUntrackedParameter<unsigned int>("skipEvents");
198  std::shared_ptr<EventSkipperByID> skipper(EventSkipperByID::create(pset).release());
199 
200  auto duplicateChecker = std::make_shared<DuplicateChecker>(pset);
201 
202  std::vector<std::shared_ptr<IndexIntoFile>> indexesIntoFiles(1);
203 
204  auto input =
205  std::make_shared<InputFile>(physicalFileName.c_str(), " Initiating request to open file ", InputType::Primary);
207  logicalFileName, physicalFileName, 0 != nEventsToSkip, input, skipper, duplicateChecker, indexesIntoFiles);
208  rootFile_->reportOpened("repeating");
209 
210  auto const& prodList = rootFile_->productRegistry()->productList();
212 
213  //setup caching
214  auto nProdsInEvent =
215  std::count_if(prodList.begin(), prodList.end(), [](auto&& iV) { return iV.second.branchType() == edm::InEvent; });
216  {
217  size_t index = 0;
218  for (auto& prod : prodList) {
219  if (prod.second.branchType() == edm::InEvent) {
220  branchIDToWrapperIndex_[prod.second.branchID()] = index++;
221  }
222  }
223  }
224  for (auto& cache : cachedWrappers_) {
225  cache.resize(nProdsInEvent);
226  }
227 }
std::vector< RCDelayedReader > delayedReaders_
std::map< edm::ProductID, size_t > productIDToWrapperIndex_
ProductRegistry & productRegistryUpdate()
Definition: InputSource.h:328
std::map< edm::BranchID, size_t > branchIDToWrapperIndex_
static std::unique_ptr< EventSkipperByID > create(ParameterSet const &pset)
std::unique_ptr< RootFile > rootFile_
std::vector< RCProductGetter > getters_
static std::string const input
Definition: EdmProvDump.cc:47
ProductProvenanceRetriever provRetriever_
edm::propagate_const< std::unique_ptr< RunHelperBase > > runHelper_
std::vector< std::vector< std::shared_ptr< edm::WrapperBase > > > cachedWrappers_
def cache(function)
Definition: utilities.py:3
void updateFromInput(ProductList const &other)
std::unique_ptr< RootFile > makeRootFile(std::string const &logicalFileName, std::string const &pName, bool isSkipping, std::shared_ptr< InputFile > filePtr, std::shared_ptr< EventSkipperByID > skipper, std::shared_ptr< DuplicateChecker > duplicateChecker, std::vector< std::shared_ptr< IndexIntoFile >> &indexesIntoFiles)
std::vector< EventAuxiliary > eventAuxs_
InputSource(ParameterSet const &, InputSourceDescription const &)
Constructor.
Definition: InputSource.cc:47

Member Function Documentation

◆ beginJob()

void RepeatingCachedRootSource::beginJob ( void  )
overrideprivatevirtual

Begin protected makes it easier to do template programming.

Reimplemented from edm::InputSource.

Definition at line 229 of file RepeatingCachedRootSource.cc.

References printConversionInfo::aux, edm::EventPrincipal::aux(), edm::InputSource::branchIDListHelper(), edm::EventPrincipal::branchIDToProductID(), branchIDToWrapperIndex_, edm::EventPrincipal::branchListIndexes(), branchListIndexes_, utilities::cache(), cachedWrappers_, edm::ParameterSet::emptyParameterSetID(), eventAuxs_, edm::EventPrincipal::eventSelectionIDs(), Exception, getters_, edm::InputSource::processConfiguration(), productIDToWrapperIndex_, edm::InputSource::productRegistry(), DQM::reader, edm::Principal::reader(), rootFile_, edm::InputSource::run(), selectionIDs_, edm::ProcessConfiguration::setParameterSetID(), and edm::ProcessConfiguration::setProcessConfigurationID().

229  {
233 
234  //Thinned collection associations are not supported at this time
235  EventPrincipal eventPrincipal(productRegistry(),
237  std::make_shared<ThinnedAssociationsHelper>(),
239  nullptr);
240  {
241  RunNumber_t run = 0;
243  auto itAux = eventAuxs_.begin();
244  auto itGetter = getters_.begin();
245  for (auto& cache : cachedWrappers_) {
246  rootFile_->nextEventEntry();
247  rootFile_->readCurrentEvent(eventPrincipal);
248  auto const& aux = eventPrincipal.aux();
249  *(itAux++) = aux;
250  if (0 == run) {
251  run = aux.run();
252  lumi = aux.luminosityBlock();
253  } else {
254  if (run != aux.run()) {
255  throw cms::Exception("EventsWithDifferentRuns") << "The requested events to cache are from different Runs";
256  }
257  if (lumi != aux.luminosityBlock()) {
258  throw cms::Exception("EventsWithDifferentLuminosityBlocks")
259  << "The requested events to cache are from different LuminosityBlocks";
260  }
261  }
262  selectionIDs_ = eventPrincipal.eventSelectionIDs();
263  branchListIndexes_ = eventPrincipal.branchListIndexes();
264  {
265  auto reader = eventPrincipal.reader();
266  auto& getter = *(itGetter++);
267  for (auto const& branchToIndex : branchIDToWrapperIndex_) {
268  cache[branchToIndex.second] = reader->getProduct(branchToIndex.first, &getter);
269  }
270  }
271  }
272  for (auto const& branchToIndex : branchIDToWrapperIndex_) {
273  auto pid = eventPrincipal.branchIDToProductID(branchToIndex.first);
274  productIDToWrapperIndex_[pid] = branchToIndex.second;
275  }
276  rootFile_->rewind();
277  }
278 }
std::map< edm::ProductID, size_t > productIDToWrapperIndex_
ProcessConfigurationID setProcessConfigurationID()
std::map< edm::BranchID, size_t > branchIDToWrapperIndex_
RunNumber_t run() const
Accessor for current run number.
Definition: InputSource.cc:457
std::unique_ptr< RootFile > rootFile_
void setParameterSetID(ParameterSetID const &pSetID)
reader
Definition: DQM.py:105
unsigned int LuminosityBlockNumber_t
std::vector< RCProductGetter > getters_
std::shared_ptr< BranchIDListHelper const > branchIDListHelper() const
Accessors for branchIDListHelper.
Definition: InputSource.h:144
ProcessConfiguration const & processConfiguration() const
Accessor for Process Configuration.
Definition: InputSource.h:192
std::vector< std::vector< std::shared_ptr< edm::WrapperBase > > > cachedWrappers_
std::shared_ptr< ProductRegistry const > productRegistry() const
Accessors for product registry.
Definition: InputSource.h:136
def cache(function)
Definition: utilities.py:3
unsigned int RunNumber_t
std::vector< EventAuxiliary > eventAuxs_
static ParameterSetID emptyParameterSetID()
Definition: ParameterSet.cc:94

◆ fillDescriptions()

void RepeatingCachedRootSource::fillDescriptions ( ConfigurationDescriptions descriptions)
static

Definition at line 280 of file RepeatingCachedRootSource.cc.

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

280  {
282  desc.setComment(
283  "Read only a few Events from one EDM/Root file, and repeat them in sequence. The Events are required to be from "
284  "the same Run and LuminosityBlock.");
285  desc.addUntracked<std::string>("fileName")->setComment("Name of file to be processed.");
286  desc.addUntracked<unsigned int>("repeatNEvents", 10U)
287  ->setComment("Number of events to read from file and then repeat in sequence.");
288  desc.addUntracked<unsigned int>("skipEvents", 0);
291 
292  descriptions.add("source", desc);
293 }
static void fillDescription(ParameterSetDescription &desc, char const *parameterName, std::vector< std::string > const &defaultStrings=defaultSelectionStrings())
void add(std::string const &label, ParameterSetDescription const &psetDescription)
static void fillDescription(ParameterSetDescription &desc)
Definition: InputSource.cc:117

◆ fillProcessBlockHelper_()

void RepeatingCachedRootSource::fillProcessBlockHelper_ ( )
overrideprivatevirtual

Reimplemented from edm::InputSource.

Definition at line 408 of file RepeatingCachedRootSource.cc.

References rootFile_.

408 { rootFile_->fillProcessBlockHelper_(); }
std::unique_ptr< RootFile > rootFile_

◆ getNextItemType()

RepeatingCachedRootSource::ItemType RepeatingCachedRootSource::getNextItemType ( )
overrideprotectedvirtual

Implements edm::InputSource.

Definition at line 347 of file RepeatingCachedRootSource.cc.

References edm::InputSource::IsEvent, edm::InputSource::IsFile, edm::InputSource::IsLumi, edm::InputSource::IsRun, presentState_, and findQualityFiles::v.

347  {
348  auto v = presentState_;
349  switch (presentState_) {
350  case IsFile:
352  break;
353  case IsRun:
355  break;
356  case IsLumi:
358  break;
359  default:
360  break;
361  }
362  return v;
363 }

◆ getProduct()

std::shared_ptr< WrapperBase > RepeatingCachedRootSource::getProduct ( unsigned int  iStreamIndex,
BranchID const &  k,
EDProductGetter const *  ep 
) const

Definition at line 341 of file RepeatingCachedRootSource.cc.

References branchIDToWrapperIndex_, cachedWrappers_, dqmdumpme::k, and streamToCacheIndex_.

Referenced by edm::RepeatingCachedRootSource::RCDelayedReader::getProduct_().

343  {
344  return cachedWrappers_[streamToCacheIndex_[iStreamIndex]][branchIDToWrapperIndex_.find(k)->second];
345 }
std::map< edm::BranchID, size_t > branchIDToWrapperIndex_
std::vector< std::vector< std::shared_ptr< edm::WrapperBase > > > cachedWrappers_

◆ goToEvent_()

bool RepeatingCachedRootSource::goToEvent_ ( EventID const &  eventID)
overrideprivatevirtual

Reimplemented from edm::InputSource.

Definition at line 406 of file RepeatingCachedRootSource.cc.

406 { return false; }

◆ makeRootFile()

std::unique_ptr< RootFile > RepeatingCachedRootSource::makeRootFile ( std::string const &  logicalFileName,
std::string const &  pName,
bool  isSkipping,
std::shared_ptr< InputFile filePtr,
std::shared_ptr< EventSkipperByID skipper,
std::shared_ptr< DuplicateChecker duplicateChecker,
std::vector< std::shared_ptr< IndexIntoFile >> &  indexesIntoFiles 
)
private

Definition at line 299 of file RepeatingCachedRootSource.cc.

References edm::InputSource::branchIDListHelper(), edm::roottree::defaultCacheSize, orderedProcessHistoryIDs_, edm::Primary, edm::InputSource::processBlockHelper(), edm::InputSource::processConfiguration(), edm::InputSource::processHistoryRegistryForUpdate(), edm::InputSource::processingMode(), edm::InputSource::remainingEvents(), edm::InputSource::remainingLuminosityBlocks(), runHelper_, selectorRules_, and edm::InputSource::thinnedAssociationsHelper().

Referenced by RepeatingCachedRootSource().

306  {
307  return std::make_unique<RootFile>(pName,
309  logicalFileName,
310  filePtr,
311  skipper,
312  isSkipping,
313  remainingEvents(),
315  1,
316  roottree::defaultCacheSize, //treeCacheSize_,
317  -1, //treeMaxVirtualSize(),
318  processingMode(),
319  runHelper_,
320  false, //noRunLumiSort_
321  true, //noEventSort_,
325  processBlockHelper().get(),
327  nullptr, // associationsFromSecondary
328  duplicateChecker,
329  false, //dropDescendants(),
331  indexesIntoFiles,
332  0, //currentIndexIntoFile,
334  false, //bypassVersionCheck(),
335  true, //labelRawDataLikeMC(),
336  false, //usingGoToEvent_,
337  true, //enablePrefetching_,
338  false); //enforceGUIDInFileName_);
339 }
int remainingEvents() const
Definition: InputSource.h:178
std::shared_ptr< ProcessBlockHelper const > processBlockHelper() const
Accessors for processBlockHelper.
Definition: InputSource.h:150
unsigned int const defaultCacheSize
Definition: RootTree.h:38
std::shared_ptr< ThinnedAssociationsHelper const > thinnedAssociationsHelper() const
Accessors for thinnedAssociationsHelper.
Definition: InputSource.h:156
std::vector< ProcessHistoryID > orderedProcessHistoryIDs_
std::shared_ptr< BranchIDListHelper const > branchIDListHelper() const
Accessors for branchIDListHelper.
Definition: InputSource.h:144
ProcessConfiguration const & processConfiguration() const
Accessor for Process Configuration.
Definition: InputSource.h:192
edm::propagate_const< std::unique_ptr< RunHelperBase > > runHelper_
ProcessHistoryRegistry & processHistoryRegistryForUpdate()
Definition: InputSource.h:329
int remainingLuminosityBlocks() const
Definition: InputSource.h:186
ProcessingMode processingMode() const
RunsLumisAndEvents (default), RunsAndLumis, or Runs.
Definition: InputSource.h:224

◆ nextProcessBlock_()

bool RepeatingCachedRootSource::nextProcessBlock_ ( ProcessBlockPrincipal processBlockPrincipal)
overrideprivatevirtual

Reimplemented from edm::InputSource.

Definition at line 410 of file RepeatingCachedRootSource.cc.

References rootFile_.

410  {
411  return rootFile_->nextProcessBlock_(processBlockPrincipal);
412 }
std::unique_ptr< RootFile > rootFile_

◆ readEvent_()

void RepeatingCachedRootSource::readEvent_ ( EventPrincipal eventPrincipal)
overrideprotectedvirtual

Implements edm::InputSource.

Definition at line 372 of file RepeatingCachedRootSource.cc.

References printConversionInfo::aux, branchListIndexes_, cachedWrappers_, delayedReaders_, eventAuxs_, eventIndex_, edm::EventPrincipal::fillEventPrincipal(), edm::ProcessHistoryRegistry::getMapped(), edm::InputSource::processHistoryRegistry(), provRetriever_, selectionIDs_, edm::EventPrincipal::streamID(), streamToCacheIndex_, and edm::StreamID::value().

372  {
373  auto index = eventIndex_++;
374 
375  auto repeatedIndex = index % cachedWrappers_.size();
376 
377  auto const& aux = eventAuxs_[repeatedIndex];
378 
379  auto history = processHistoryRegistry().getMapped(aux.processHistoryID());
380 
381  streamToCacheIndex_[eventPrincipal.streamID().value()] = repeatedIndex;
382  eventPrincipal.fillEventPrincipal(aux,
383  history,
388  &delayedReaders_[eventPrincipal.streamID().value()]);
389 }
std::vector< RCDelayedReader > delayedReaders_
StreamID streamID() const
ProductProvenanceRetriever provRetriever_
ProcessHistoryRegistry const & processHistoryRegistry() const
Accessors for process history registry.
Definition: InputSource.h:140
std::vector< std::vector< std::shared_ptr< edm::WrapperBase > > > cachedWrappers_
bool getMapped(ProcessHistoryID const &key, ProcessHistory &value) const
void fillEventPrincipal(EventAuxiliary const &aux, ProcessHistory const *processHistory, DelayedReader *reader=nullptr)
unsigned int value() const
Definition: StreamID.h:43
std::vector< EventAuxiliary > eventAuxs_

◆ readIt()

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

Reimplemented from edm::InputSource.

Definition at line 398 of file RepeatingCachedRootSource.cc.

400  {
401  return false;
402 }

◆ readLuminosityBlock_()

void RepeatingCachedRootSource::readLuminosityBlock_ ( LuminosityBlockPrincipal lumiPrincipal)
overrideprotectedvirtual

Reimplemented from edm::InputSource.

Definition at line 365 of file RepeatingCachedRootSource.cc.

References rootFile_.

365  {
366  rootFile_->readLuminosityBlock_(lumiPrincipal);
367 }
std::unique_ptr< RootFile > rootFile_

◆ readLuminosityBlockAuxiliary_()

std::shared_ptr< LuminosityBlockAuxiliary > RepeatingCachedRootSource::readLuminosityBlockAuxiliary_ ( )
overrideprotectedvirtual

Implements edm::InputSource.

Definition at line 369 of file RepeatingCachedRootSource.cc.

References rootFile_.

369  {
370  return rootFile_->readLuminosityBlockAuxiliary_();
371 }
std::unique_ptr< RootFile > rootFile_

◆ readProcessBlock_()

void RepeatingCachedRootSource::readProcessBlock_ ( ProcessBlockPrincipal processBlockPrincipal)
overrideprivatevirtual

Reimplemented from edm::InputSource.

Definition at line 414 of file RepeatingCachedRootSource.cc.

References rootFile_.

414  {
415  rootFile_->readProcessBlock_(processBlockPrincipal);
416 }
std::unique_ptr< RootFile > rootFile_

◆ readRun_()

void RepeatingCachedRootSource::readRun_ ( RunPrincipal runPrincipal)
overrideprivatevirtual

Reimplemented from edm::InputSource.

Definition at line 396 of file RepeatingCachedRootSource.cc.

References rootFile_.

396 { rootFile_->readRun_(runPrincipal); }
std::unique_ptr< RootFile > rootFile_

◆ readRunAuxiliary_()

std::shared_ptr< RunAuxiliary > RepeatingCachedRootSource::readRunAuxiliary_ ( )
overrideprivatevirtual

Implements edm::InputSource.

Definition at line 391 of file RepeatingCachedRootSource.cc.

References rootFile_.

391  {
392  return rootFile_->readRunAuxiliary_();
393  ;
394 }
std::unique_ptr< RootFile > rootFile_

◆ skip()

void RepeatingCachedRootSource::skip ( int  offset)
overrideprivatevirtual

Reimplemented from edm::InputSource.

Definition at line 404 of file RepeatingCachedRootSource.cc.

404 {}

Member Data Documentation

◆ branchIDToWrapperIndex_

std::map<edm::BranchID, size_t> edm::RepeatingCachedRootSource::branchIDToWrapperIndex_
private

Definition at line 152 of file RepeatingCachedRootSource.cc.

Referenced by beginJob(), getProduct(), and RepeatingCachedRootSource().

◆ branchListIndexes_

BranchListIndexes edm::RepeatingCachedRootSource::branchListIndexes_
private

Definition at line 149 of file RepeatingCachedRootSource.cc.

Referenced by beginJob(), and readEvent_().

◆ cachedWrappers_

std::vector<std::vector<std::shared_ptr<edm::WrapperBase> > > edm::RepeatingCachedRootSource::cachedWrappers_
private

◆ delayedReaders_

std::vector<RCDelayedReader> edm::RepeatingCachedRootSource::delayedReaders_
private

Definition at line 151 of file RepeatingCachedRootSource.cc.

Referenced by readEvent_(), and RepeatingCachedRootSource().

◆ eventAuxs_

std::vector<EventAuxiliary> edm::RepeatingCachedRootSource::eventAuxs_
private

Definition at line 147 of file RepeatingCachedRootSource.cc.

Referenced by beginJob(), and readEvent_().

◆ eventIndex_

unsigned long long edm::RepeatingCachedRootSource::eventIndex_ = 0
private

Definition at line 157 of file RepeatingCachedRootSource.cc.

Referenced by readEvent_().

◆ getters_

std::vector<RCProductGetter> edm::RepeatingCachedRootSource::getters_
private

Definition at line 146 of file RepeatingCachedRootSource.cc.

Referenced by beginJob(), and RepeatingCachedRootSource().

◆ nextEventIndex_

size_t edm::RepeatingCachedRootSource::nextEventIndex_ = 0
private

Definition at line 155 of file RepeatingCachedRootSource.cc.

◆ orderedProcessHistoryIDs_

std::vector<ProcessHistoryID> edm::RepeatingCachedRootSource::orderedProcessHistoryIDs_
private

Definition at line 144 of file RepeatingCachedRootSource.cc.

Referenced by makeRootFile().

◆ presentState_

ItemType edm::RepeatingCachedRootSource::presentState_ = IsFile
private

Definition at line 156 of file RepeatingCachedRootSource.cc.

Referenced by getNextItemType().

◆ productIDToWrapperIndex_

std::map<edm::ProductID, size_t> edm::RepeatingCachedRootSource::productIDToWrapperIndex_
private

Definition at line 153 of file RepeatingCachedRootSource.cc.

Referenced by beginJob(), and RepeatingCachedRootSource().

◆ provRetriever_

ProductProvenanceRetriever edm::RepeatingCachedRootSource::provRetriever_
private

Definition at line 150 of file RepeatingCachedRootSource.cc.

Referenced by readEvent_().

◆ rootFile_

std::unique_ptr<RootFile> edm::RepeatingCachedRootSource::rootFile_
private

◆ rootServiceChecker_

RootServiceChecker edm::RepeatingCachedRootSource::rootServiceChecker_
private

Definition at line 140 of file RepeatingCachedRootSource.cc.

◆ runHelper_

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

Definition at line 142 of file RepeatingCachedRootSource.cc.

Referenced by makeRootFile().

◆ selectionIDs_

EventSelectionIDVector edm::RepeatingCachedRootSource::selectionIDs_
private

Definition at line 148 of file RepeatingCachedRootSource.cc.

Referenced by beginJob(), and readEvent_().

◆ selectorRules_

ProductSelectorRules edm::RepeatingCachedRootSource::selectorRules_
private

Definition at line 141 of file RepeatingCachedRootSource.cc.

Referenced by makeRootFile().

◆ streamToCacheIndex_

std::vector<size_t> edm::RepeatingCachedRootSource::streamToCacheIndex_
private

Definition at line 154 of file RepeatingCachedRootSource.cc.

Referenced by getProduct(), and readEvent_().