CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
 

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
< LuminosityBlockAuxiliary
luminosityBlockAuxiliary () 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
< LuminosityBlockAuxiliary
readLuminosityBlockAuxiliary ()
 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
< LuminosityBlockAuxiliary
readLuminosityBlockAuxiliary_ () 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
 
size_t nextEventIndex_ = 0
 
std::vector< ProcessHistoryIDorderedProcessHistoryIDs_
 
ItemType presentState_ = IsFile
 
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 ( ParameterSet const &  pset,
InputSourceDescription const &  desc 
)

Definition at line 137 of file RepeatingCachedRootSource.cc.

References branchIDToWrapperIndex_, utilities::cache(), cachedWrappers_, validate_alignment_devdb10_cfg::catalog, edm::EventSkipperByID::create(), delayedReaders_, edm::ParameterSet::getUntrackedParameter(), edm::InEvent, input, makeRootFile(), edm::Primary, edm::InputSource::productRegistryUpdate(), TrackValidation_cff::pset, fetchall_from_DQM_v2::release, rootFile_, AlCaHLTBitMon_QueryRunRegistry::string, and edm::ProductRegistry::updateFromInput().

138  : InputSource(pset, desc),
139  selectorRules_(pset, "inputCommands", "InputSource"),
140  runHelper_(std::make_unique<DefaultRunHelper>()),
141  cachedWrappers_(pset.getUntrackedParameter<unsigned int>("repeatNEvents")),
142  eventAuxs_(cachedWrappers_.size()),
143  provRetriever_(0),
144  delayedReaders_(desc.allocations_->numberOfStreams()),
145  streamToCacheIndex_(desc.allocations_->numberOfStreams(), 0) {
146  {
147  int index = 0;
148  std::for_each(delayedReaders_.begin(), delayedReaders_.end(), [&index, this](auto& iR) {
149  iR.m_streamIndex = index++;
150  iR.m_source = this;
151  });
152  }
153  auto logicalFileName = pset.getUntrackedParameter<std::string>("fileName");
154  InputFileCatalog catalog(std::vector<std::string>(1U, logicalFileName), "");
155  auto const& physicalFileName = catalog.fileCatalogItems().front().fileNames().front();
156  auto const nEventsToSkip = pset.getUntrackedParameter<unsigned int>("skipEvents");
157  std::shared_ptr<EventSkipperByID> skipper(EventSkipperByID::create(pset).release());
158 
159  auto duplicateChecker = std::make_shared<DuplicateChecker>(pset);
160 
161  std::vector<std::shared_ptr<IndexIntoFile>> indexesIntoFiles(1);
162 
163  auto input =
164  std::make_shared<InputFile>(physicalFileName.c_str(), " Initiating request to open file ", InputType::Primary);
166  logicalFileName, physicalFileName, 0 != nEventsToSkip, input, skipper, duplicateChecker, indexesIntoFiles);
167  rootFile_->reportOpened("repeating");
168 
169  auto const& prodList = rootFile_->productRegistry()->productList();
171 
172  //setup caching
173  auto nProdsInEvent =
174  std::count_if(prodList.begin(), prodList.end(), [](auto&& iV) { return iV.second.branchType() == edm::InEvent; });
175  {
176  size_t index = 0;
177  for (auto& prod : prodList) {
178  if (prod.second.branchType() == edm::InEvent) {
179  branchIDToWrapperIndex_[prod.second.branchID()] = index++;
180  }
181  }
182  }
183  for (auto& cache : cachedWrappers_) {
184  cache.resize(nProdsInEvent);
185  }
186 }
std::vector< RCDelayedReader > delayedReaders_
ProductRegistry & productRegistryUpdate()
Definition: InputSource.h:330
std::map< edm::BranchID, size_t > branchIDToWrapperIndex_
static std::unique_ptr< EventSkipperByID > create(ParameterSet const &pset)
std::unique_ptr< RootFile > rootFile_
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_
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
def cache
Definition: utilities.py:3

Member Function Documentation

void RepeatingCachedRootSource::beginJob ( void  )
overrideprivatevirtual

Begin protected makes it easier to do template programming.

Reimplemented from edm::InputSource.

Definition at line 188 of file RepeatingCachedRootSource.cc.

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

188  {
191  processConfiguration.setProcessConfigurationID();
192 
193  //TODO: to make edm::Ref work we need to find a way to pass in a different EDProductGetter
194  EventPrincipal eventPrincipal(productRegistry(),
195  std::make_shared<BranchIDListHelper>(),
196  std::make_shared<ThinnedAssociationsHelper>(),
197  processConfiguration,
198  nullptr);
199 
200  {
201  RunNumber_t run = 0;
203  auto itAux = eventAuxs_.begin();
204  for (auto& cache : cachedWrappers_) {
205  rootFile_->nextEventEntry();
206  rootFile_->readCurrentEvent(eventPrincipal);
207  auto const& aux = eventPrincipal.aux();
208  *(itAux++) = aux;
209  if (0 == run) {
210  run = aux.run();
211  lumi = aux.luminosityBlock();
212  } else {
213  if (run != aux.run()) {
214  throw cms::Exception("EventsWithDifferentRuns") << "The requested events to cache are from different Runs";
215  }
216  if (lumi != aux.luminosityBlock()) {
217  throw cms::Exception("EventsWithDifferentLuminosityBlocks")
218  << "The requested events to cache are from different LuminosityBlocks";
219  }
220  }
221  selectionIDs_ = eventPrincipal.eventSelectionIDs();
222  branchListIndexes_ = eventPrincipal.branchListIndexes();
223  {
224  auto reader = eventPrincipal.reader();
225  for (auto const& branchToIndex : branchIDToWrapperIndex_) {
226  cache[branchToIndex.second] = reader->getProduct(branchToIndex.first, &eventPrincipal);
227  }
228  }
229  }
230  rootFile_->rewind();
231  }
232 }
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)
unsigned int LuminosityBlockNumber_t
tuple reader
Definition: DQM.py:105
list lumi
Definition: dqmdumpme.py:53
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
unsigned int RunNumber_t
std::vector< EventAuxiliary > eventAuxs_
ProcessConfiguration const & processConfiguration() const
Accessor for Process Configuration.
Definition: InputSource.h:192
static ParameterSetID emptyParameterSetID()
Definition: ParameterSet.cc:94
def cache
Definition: utilities.py:3
void RepeatingCachedRootSource::fillDescriptions ( ConfigurationDescriptions descriptions)
static

Definition at line 234 of file RepeatingCachedRootSource.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::addUntracked(), submitPVResolutionJobs::desc, edm::ProductSelectorRules::fillDescription(), edm::InputSource::fillDescription(), edm::ParameterSetDescription::setComment(), and AlCaHLTBitMon_QueryRunRegistry::string.

234  {
236  desc.setComment(
237  "Read only a few Events from one EDM/Root file, and repeat them in sequence. The Events are required to be from "
238  "the same Run and LuminosityBlock.");
239  desc.addUntracked<std::string>("fileName")->setComment("Name of file to be processed.");
240  desc.addUntracked<unsigned int>("repeatNEvents", 10U)
241  ->setComment("Number of events to read from file and then repeat in sequence.");
242  desc.addUntracked<unsigned int>("skipEvents", 0);
243  ProductSelectorRules::fillDescription(desc, "inputCommands");
245 
246  descriptions.add("source", desc);
247 }
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
static void fillDescription(ParameterSetDescription &desc, char const *parameterName, std::vector< std::string > const &defaultStrings=defaultSelectionStrings())
void setComment(std::string const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
static void fillDescription(ParameterSetDescription &desc)
Definition: InputSource.cc:117
void RepeatingCachedRootSource::fillProcessBlockHelper_ ( )
overrideprivatevirtual

Reimplemented from edm::InputSource.

Definition at line 362 of file RepeatingCachedRootSource.cc.

References rootFile_.

362 { rootFile_->fillProcessBlockHelper_(); }
std::unique_ptr< RootFile > rootFile_
RepeatingCachedRootSource::ItemType RepeatingCachedRootSource::getNextItemType ( )
overrideprotectedvirtual

Implements edm::InputSource.

Definition at line 301 of file RepeatingCachedRootSource.cc.

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

301  {
302  auto v = presentState_;
303  switch (presentState_) {
304  case IsFile:
306  break;
307  case IsRun:
309  break;
310  case IsLumi:
312  break;
313  default:
314  break;
315  }
316  return v;
317 }
std::shared_ptr< WrapperBase > RepeatingCachedRootSource::getProduct ( unsigned int  iStreamIndex,
BranchID const &  k,
EDProductGetter const *  ep 
) const

Definition at line 295 of file RepeatingCachedRootSource.cc.

References branchIDToWrapperIndex_, cachedWrappers_, and streamToCacheIndex_.

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

297  {
298  return cachedWrappers_[streamToCacheIndex_[iStreamIndex]][branchIDToWrapperIndex_.find(k)->second];
299 }
std::map< edm::BranchID, size_t > branchIDToWrapperIndex_
std::vector< std::vector< std::shared_ptr< edm::WrapperBase > > > cachedWrappers_
bool RepeatingCachedRootSource::goToEvent_ ( EventID const &  eventID)
overrideprivatevirtual

Reimplemented from edm::InputSource.

Definition at line 360 of file RepeatingCachedRootSource.cc.

360 { return false; }
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 253 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().

260  {
261  return std::make_unique<RootFile>(pName,
263  logicalFileName,
264  filePtr,
265  skipper,
266  isSkipping,
267  remainingEvents(),
269  1,
270  roottree::defaultCacheSize, //treeCacheSize_,
271  -1, //treeMaxVirtualSize(),
272  processingMode(),
273  runHelper_,
274  false, //noRunLumiSort_
275  true, //noEventSort_,
279  processBlockHelper().get(),
281  nullptr, // associationsFromSecondary
282  duplicateChecker,
283  false, //dropDescendants(),
285  indexesIntoFiles,
286  0, //currentIndexIntoFile,
288  false, //bypassVersionCheck(),
289  true, //labelRawDataLikeMC(),
290  false, //usingGoToEvent_,
291  true, //enablePrefetching_,
292  false); //enforceGUIDInFileName_);
293 }
std::shared_ptr< ProcessBlockHelper const > processBlockHelper() const
Accessors for processBlockHelper.
Definition: InputSource.h:150
ProcessingMode processingMode() const
RunsLumisAndEvents (default), RunsAndLumis, or Runs.
Definition: InputSource.h:224
unsigned int const defaultCacheSize
Definition: RootTree.h:38
int remainingEvents() const
Definition: InputSource.h:178
std::vector< ProcessHistoryID > orderedProcessHistoryIDs_
edm::propagate_const< std::unique_ptr< RunHelperBase > > runHelper_
std::shared_ptr< BranchIDListHelper const > branchIDListHelper() const
Accessors for branchIDListHelper.
Definition: InputSource.h:144
ProcessHistoryRegistry & processHistoryRegistryForUpdate()
Definition: InputSource.h:331
std::shared_ptr< ThinnedAssociationsHelper const > thinnedAssociationsHelper() const
Accessors for thinnedAssociationsHelper.
Definition: InputSource.h:156
int remainingLuminosityBlocks() const
Definition: InputSource.h:186
ProcessConfiguration const & processConfiguration() const
Accessor for Process Configuration.
Definition: InputSource.h:192
bool RepeatingCachedRootSource::nextProcessBlock_ ( ProcessBlockPrincipal processBlockPrincipal)
overrideprivatevirtual

Reimplemented from edm::InputSource.

Definition at line 364 of file RepeatingCachedRootSource.cc.

References rootFile_.

364  {
365  return rootFile_->nextProcessBlock_(processBlockPrincipal);
366 }
std::unique_ptr< RootFile > rootFile_
void RepeatingCachedRootSource::readEvent_ ( EventPrincipal eventPrincipal)
overrideprotectedvirtual

Implements edm::InputSource.

Definition at line 326 of file RepeatingCachedRootSource.cc.

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

326  {
327  auto index = eventIndex_++;
328 
329  auto repeatedIndex = index % cachedWrappers_.size();
330 
331  auto const& aux = eventAuxs_[repeatedIndex];
332 
333  auto history = processHistoryRegistry().getMapped(aux.processHistoryID());
334 
335  streamToCacheIndex_[eventPrincipal.streamID().value()] = repeatedIndex;
336  eventPrincipal.fillEventPrincipal(aux,
337  history,
342  &delayedReaders_[eventPrincipal.streamID().value()]);
343 }
ProcessHistoryRegistry const & processHistoryRegistry() const
Accessors for process history registry.
Definition: InputSource.h:140
std::vector< RCDelayedReader > delayedReaders_
bool getMapped(ProcessHistoryID const &key, ProcessHistory &value) const
ProductProvenanceRetriever provRetriever_
StreamID streamID() const
unsigned int value() const
Definition: StreamID.h:43
std::vector< std::vector< std::shared_ptr< edm::WrapperBase > > > cachedWrappers_
void fillEventPrincipal(EventAuxiliary const &aux, ProcessHistory const *processHistory, DelayedReader *reader=nullptr)
std::vector< EventAuxiliary > eventAuxs_
bool RepeatingCachedRootSource::readIt ( EventID const &  id,
EventPrincipal eventPrincipal,
StreamContext streamContext 
)
overrideprivatevirtual

Reimplemented from edm::InputSource.

Definition at line 352 of file RepeatingCachedRootSource.cc.

354  {
355  return false;
356 }
void RepeatingCachedRootSource::readLuminosityBlock_ ( LuminosityBlockPrincipal lumiPrincipal)
overrideprotectedvirtual

Reimplemented from edm::InputSource.

Definition at line 319 of file RepeatingCachedRootSource.cc.

References rootFile_.

319  {
320  return rootFile_->readLuminosityBlock_(lumiPrincipal);
321 }
std::unique_ptr< RootFile > rootFile_
std::shared_ptr< LuminosityBlockAuxiliary > RepeatingCachedRootSource::readLuminosityBlockAuxiliary_ ( )
overrideprotectedvirtual

Implements edm::InputSource.

Definition at line 323 of file RepeatingCachedRootSource.cc.

References rootFile_.

323  {
324  return rootFile_->readLuminosityBlockAuxiliary_();
325 }
std::unique_ptr< RootFile > rootFile_
void RepeatingCachedRootSource::readProcessBlock_ ( ProcessBlockPrincipal processBlockPrincipal)
overrideprivatevirtual

Reimplemented from edm::InputSource.

Definition at line 368 of file RepeatingCachedRootSource.cc.

References rootFile_.

368  {
369  rootFile_->readProcessBlock_(processBlockPrincipal);
370 }
std::unique_ptr< RootFile > rootFile_
void RepeatingCachedRootSource::readRun_ ( RunPrincipal runPrincipal)
overrideprivatevirtual

Reimplemented from edm::InputSource.

Definition at line 350 of file RepeatingCachedRootSource.cc.

References rootFile_.

350 { rootFile_->readRun_(runPrincipal); }
std::unique_ptr< RootFile > rootFile_
std::shared_ptr< RunAuxiliary > RepeatingCachedRootSource::readRunAuxiliary_ ( )
overrideprivatevirtual

Implements edm::InputSource.

Definition at line 345 of file RepeatingCachedRootSource.cc.

References rootFile_.

345  {
346  return rootFile_->readRunAuxiliary_();
347  ;
348 }
std::unique_ptr< RootFile > rootFile_
void RepeatingCachedRootSource::skip ( int  offset)
overrideprivatevirtual

Reimplemented from edm::InputSource.

Definition at line 358 of file RepeatingCachedRootSource.cc.

358 {}

Member Data Documentation

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

Definition at line 117 of file RepeatingCachedRootSource.cc.

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

BranchListIndexes edm::RepeatingCachedRootSource::branchListIndexes_
private

Definition at line 114 of file RepeatingCachedRootSource.cc.

Referenced by beginJob(), and readEvent_().

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

Definition at line 116 of file RepeatingCachedRootSource.cc.

Referenced by readEvent_(), and RepeatingCachedRootSource().

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

Definition at line 112 of file RepeatingCachedRootSource.cc.

Referenced by beginJob(), and readEvent_().

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

Definition at line 121 of file RepeatingCachedRootSource.cc.

Referenced by readEvent_().

size_t edm::RepeatingCachedRootSource::nextEventIndex_ = 0
private

Definition at line 119 of file RepeatingCachedRootSource.cc.

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

Definition at line 110 of file RepeatingCachedRootSource.cc.

Referenced by makeRootFile().

ItemType edm::RepeatingCachedRootSource::presentState_ = IsFile
private

Definition at line 120 of file RepeatingCachedRootSource.cc.

Referenced by getNextItemType().

ProductProvenanceRetriever edm::RepeatingCachedRootSource::provRetriever_
private

Definition at line 115 of file RepeatingCachedRootSource.cc.

Referenced by readEvent_().

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

Definition at line 106 of file RepeatingCachedRootSource.cc.

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

Definition at line 108 of file RepeatingCachedRootSource.cc.

Referenced by makeRootFile().

EventSelectionIDVector edm::RepeatingCachedRootSource::selectionIDs_
private

Definition at line 113 of file RepeatingCachedRootSource.cc.

Referenced by beginJob(), and readEvent_().

ProductSelectorRules edm::RepeatingCachedRootSource::selectorRules_
private

Definition at line 107 of file RepeatingCachedRootSource.cc.

Referenced by makeRootFile().

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

Definition at line 118 of file RepeatingCachedRootSource.cc.

Referenced by getProduct(), and readEvent_().