test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
edm::PoolSource Class Reference

#include <PoolSource.h>

Inheritance diagram for edm::PoolSource:
edm::InputSource edm::ProductRegistryHelper

Public Member Functions

bool bypassVersionCheck () const
 
bool dropDescendants () const
 
bool labelRawDataLikeMC () const
 
unsigned int nStreams () const
 
 PoolSource (ParameterSet const &pset, InputSourceDescription const &desc)
 
ProductSelectorRules const & productSelectorRules () const
 
RunHelperBaserunHelper ()
 
bool skipBadFiles () const
 
int treeMaxVirtualSize () const
 
virtual ~PoolSource ()
 
- 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...
 
void doBeginLumi (LuminosityBlockPrincipal &lbp, ProcessContext const *)
 Called by framework at beginning of lumi block. More...
 
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 doEndLumi (LuminosityBlockPrincipal &lbp, bool cleaningUpAfterException, ProcessContext const *)
 Called by framework at end of lumi block. More...
 
void doEndRun (RunPrincipal &rp, bool cleaningUpAfterException, ProcessContext const *)
 Called by framework at end of run. More...
 
void doPostForkReacquireResources (std::shared_ptr< multicore::MessageReceiverForSource >)
 
void doPreForkReleaseResources ()
 Called by the framework before forking the process. 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)
 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...
 
InputSourceoperator= (InputSource const &)=delete
 
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::unique_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 readRun (RunPrincipal &runPrincipal, HistoryAppender &historyAppender)
 Read next run (new run) More...
 
std::shared_ptr< RunAuxiliaryreadRunAuxiliary ()
 Read next run Auxiliary. More...
 
ProcessHistoryID const & reducedProcessHistoryID () const
 
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...
 
SharedResourcesAcquirerresourceSharedWithDelayedReader ()
 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)
 
bool skipForForking ()
 
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 ()
 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 &)
 

Private Member Functions

virtual void closeFile_ () override
 
virtual void endJob () override
 
virtual
ProcessingController::ForwardState 
forwardState_ () const override
 
virtual ItemType getNextItemType () override
 
virtual bool goToEvent_ (EventID const &eventID) override
 
virtual void preForkReleaseResources () override
 
virtual bool randomAccess_ () const override
 
virtual void readEvent_ (EventPrincipal &eventPrincipal) override
 
virtual std::unique_ptr
< FileBlock
readFile_ () override
 
virtual bool readIt (EventID const &id, EventPrincipal &eventPrincipal, StreamContext &streamContext) override
 
virtual void readLuminosityBlock_ (LuminosityBlockPrincipal &lumiPrincipal) override
 
virtual std::shared_ptr
< LuminosityBlockAuxiliary
readLuminosityBlockAuxiliary_ () override
 
virtual void readRun_ (RunPrincipal &runPrincipal) override
 
virtual std::shared_ptr
< RunAuxiliary
readRunAuxiliary_ () override
 
SharedResourcesAcquirerresourceSharedWithDelayedReader_ () override
 
virtual
ProcessingController::ReverseState 
reverseState_ () const override
 
virtual void rewind_ () override
 
virtual void skip (int offset) override
 

Private Attributes

std::array< std::vector
< BranchID >, NumBranchTypes
branchIDsToReplace_
 
bool bypassVersionCheck_
 
InputFileCatalog catalog_
 
bool dropDescendants_
 
bool labelRawDataLikeMC_
 
unsigned int nStreams_
 
edm::propagate_const
< std::unique_ptr
< RootPrimaryFileSequence > > 
primaryFileSequence_
 
ProductSelectorRules productSelectorRules_
 
std::unique_ptr
< SharedResourcesAcquirer
resourceSharedWithDelayedReaderPtr_
 
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_
 
int const 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 }
 
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- 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
 

Detailed Description

Definition at line 32 of file PoolSource.h.

Constructor & Destructor Documentation

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

Definition at line 65 of file PoolSource.cc.

References edm::SharedResourcesRegistry::createAcquirerForSourceDelayedReader(), and edm::SharedResourcesRegistry::instance().

65  :
66  InputSource(pset, desc),
68  catalog_(pset.getUntrackedParameter<std::vector<std::string> >("fileNames"),
69  pset.getUntrackedParameter<std::string>("overrideCatalog", std::string())),
70  secondaryCatalog_(pset.getUntrackedParameter<std::vector<std::string> >("secondaryFileNames", std::vector<std::string>()),
71  pset.getUntrackedParameter<std::string>("overrideCatalog", std::string())),
76  nStreams_(desc.allocations_->numberOfStreams()),
77  skipBadFiles_(pset.getUntrackedParameter<bool>("skipBadFiles")),
78  bypassVersionCheck_(pset.getUntrackedParameter<bool>("bypassVersionCheck")),
79  treeMaxVirtualSize_(pset.getUntrackedParameter<int>("treeMaxVirtualSize")),
80  productSelectorRules_(pset, "inputCommands", "InputSource"),
81  dropDescendants_(pset.getUntrackedParameter<bool>("dropDescendantsOfDroppedBranches")),
82  labelRawDataLikeMC_(pset.getUntrackedParameter<bool>("labelRawDataLikeMC")),
85  // Note: primaryFileSequence_ and secondaryFileSequence_ need to be initialized last, because they use data members
86  // initialized previously in their own initialization.
87  primaryFileSequence_(new RootPrimaryFileSequence(pset, *this, catalog_)),
89  new RootSecondaryFileSequence(pset, *this, secondaryCatalog_))
90  {
91  if (secondaryCatalog_.empty() && pset.getUntrackedParameter<bool>("needSecondaryFileNames", false)) {
92  throw Exception(errors::Configuration, "PoolSource") << "'secondaryFileNames' must be specified\n";
93  }
96  for(unsigned int index = 0; index < nStreams_; ++index) {
97  secondaryEventPrincipals_.emplace_back(new EventPrincipal(secondaryFileSequence_->fileProductRegistry(),
98  secondaryFileSequence_->fileBranchIDListHelper(),
99  std::make_shared<ThinnedAssociationsHelper const>(),
101  nullptr,
102  index));
103  }
104  std::array<std::set<BranchID>, NumBranchTypes> idsToReplace;
105  ProductRegistry::ProductList const& secondary = secondaryFileSequence_->fileProductRegistry()->productList();
106  ProductRegistry::ProductList const& primary = primaryFileSequence_->fileProductRegistry()->productList();
107  std::set<BranchID> associationsFromSecondary;
108  //this is the registry used by the 'outside' world and only has the primary file information in it at present
110  for(auto const& item : secondary) {
111  if(item.second.present()) {
112  idsToReplace[item.second.branchType()].insert(item.second.branchID());
113  if(item.second.branchType() == InEvent &&
114  item.second.unwrappedType() == typeid(ThinnedAssociation)) {
115  associationsFromSecondary.insert(item.second.branchID());
116  }
117  //now make sure this is marked as not dropped else the product will not be 'get'table from the Event
118  auto itFound = fullList.find(item.first);
119  if(itFound != fullList.end()) {
120  itFound->second.setDropped(false);
121  }
122  }
123  }
124  for(auto const& item : primary) {
125  if(item.second.present()) {
126  idsToReplace[item.second.branchType()].erase(item.second.branchID());
127  associationsFromSecondary.erase(item.second.branchID());
128  }
129  }
130  if(idsToReplace[InEvent].empty() && idsToReplace[InLumi].empty() && idsToReplace[InRun].empty()) {
131  secondaryFileSequence_ = nullptr; // propagate_const<T> has no reset() function
132  } else {
133  for(int i = InEvent; i < NumBranchTypes; ++i) {
134  branchIDsToReplace_[i].reserve(idsToReplace[i].size());
135  for(auto const& id : idsToReplace[i]) {
136  branchIDsToReplace_[i].push_back(id);
137  }
138  }
139  secondaryFileSequence_->initAssociationsFromSecondary(associationsFromSecondary);
140  }
141  }
142  }
bool bypassVersionCheck_
Definition: PoolSource.h:82
edm::propagate_const< std::unique_ptr< RootSecondaryFileSequence > > secondaryFileSequence_
Definition: PoolSource.h:91
int i
Definition: DBlmapReader.cc:9
SharedResourcesAcquirer createAcquirerForSourceDelayedReader()
InputFileCatalog catalog_
Definition: PoolSource.h:73
std::unique_ptr< SharedResourcesAcquirer > resourceSharedWithDelayedReaderPtr_
Definition: PoolSource.h:89
ProductRegistry & productRegistryUpdate()
Definition: InputSource.h:350
edm::propagate_const< std::unique_ptr< RunHelperBase > > runHelper_
Definition: PoolSource.h:88
std::map< BranchKey, BranchDescription > ProductList
edm::propagate_const< std::shared_ptr< RunPrincipal > > secondaryRunPrincipal_
Definition: PoolSource.h:75
bool dropDescendants_
Definition: PoolSource.h:85
unsigned int nStreams_
Definition: PoolSource.h:80
std::vector< edm::propagate_const< std::unique_ptr< EventPrincipal > > > secondaryEventPrincipals_
Definition: PoolSource.h:77
static SharedResourcesRegistry * instance()
bool labelRawDataLikeMC_
Definition: PoolSource.h:86
int const treeMaxVirtualSize_
Definition: PoolSource.h:83
std::unique_ptr< RunHelperBase > makeRunHelper(ParameterSet const &pset)
Definition: RunHelper.cc:13
InputFileCatalog secondaryCatalog_
Definition: PoolSource.h:74
std::array< std::vector< BranchID >, NumBranchTypes > branchIDsToReplace_
Definition: PoolSource.h:78
ProductSelectorRules productSelectorRules_
Definition: PoolSource.h:84
ProductList & productListUpdator()
bool skipBadFiles_
Definition: PoolSource.h:81
RootServiceChecker rootServiceChecker_
Definition: PoolSource.h:72
ProcessConfiguration const & processConfiguration() const
Accessor for Process Configuration.
Definition: InputSource.h:214
edm::propagate_const< std::shared_ptr< LuminosityBlockPrincipal > > secondaryLumiPrincipal_
Definition: PoolSource.h:76
InputSource(ParameterSet const &, InputSourceDescription const &)
Constructor.
Definition: InputSource.cc:47
tuple size
Write out results.
edm::propagate_const< std::unique_ptr< RootPrimaryFileSequence > > primaryFileSequence_
Definition: PoolSource.h:90
edm::PoolSource::~PoolSource ( )
virtual

Definition at line 144 of file PoolSource.cc.

144 {}

Member Function Documentation

bool edm::PoolSource::bypassVersionCheck ( ) const
inline
void edm::PoolSource::closeFile_ ( )
overrideprivatevirtual

Reimplemented from edm::InputSource.

Definition at line 162 of file PoolSource.cc.

References primaryFileSequence_.

162  {
163  primaryFileSequence_->closeFile_();
164  }
edm::propagate_const< std::unique_ptr< RootPrimaryFileSequence > > primaryFileSequence_
Definition: PoolSource.h:90
bool edm::PoolSource::dropDescendants ( ) const
inline
void edm::PoolSource::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::InputSource.

Definition at line 147 of file PoolSource.cc.

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

147  {
149  primaryFileSequence_->endJob();
151  }
edm::propagate_const< std::unique_ptr< RootSecondaryFileSequence > > secondaryFileSequence_
Definition: PoolSource.h:91
static void reportReadBranches()
Definition: InputFile.cc:113
edm::propagate_const< std::unique_ptr< RootPrimaryFileSequence > > primaryFileSequence_
Definition: PoolSource.h:90
void edm::PoolSource::fillDescriptions ( ConfigurationDescriptions descriptions)
static

Definition at line 300 of file PoolSource.cc.

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

300  {
301 
303 
304  std::vector<std::string> defaultStrings;
305  desc.setComment("Reads EDM/Root files.");
306  desc.addUntracked<std::vector<std::string> >("fileNames")
307  ->setComment("Names of files to be processed.");
308  desc.addUntracked<std::vector<std::string> >("secondaryFileNames", defaultStrings)
309  ->setComment("Names of secondary files to be processed.");
310  desc.addUntracked<bool>("needSecondaryFileNames", false)
311  ->setComment("If True, 'secondaryFileNames' must be specified and be non-empty.");
312  desc.addUntracked<std::string>("overrideCatalog", std::string());
313  desc.addUntracked<bool>("skipBadFiles", false)
314  ->setComment("True: Ignore any missing or unopenable input file.\n"
315  "False: Throw exception if missing or unopenable input file.");
316  desc.addUntracked<bool>("bypassVersionCheck", false)
317  ->setComment("True: Bypass release version check.\n"
318  "False: Throw exception if reading file in a release prior to the release in which the file was written.");
319  desc.addUntracked<int>("treeMaxVirtualSize", -1)
320  ->setComment("Size of ROOT TTree TBasket cache. Affects performance.");
321  desc.addUntracked<bool>("dropDescendantsOfDroppedBranches", true)
322  ->setComment("If True, also drop on input any descendent of any branch dropped on input.");
323  desc.addUntracked<bool>("labelRawDataLikeMC", true)
324  ->setComment("If True: replace module label for raw data to match MC. Also use 'LHC' as process.");
325  ProductSelectorRules::fillDescription(desc, "inputCommands");
329 
330  descriptions.add("source", desc);
331  }
static void fillDescription(ParameterSetDescription &desc, char const *parameterName)
static void fillDescription(ParameterSetDescription &desc)
Definition: RunHelper.cc:174
static void fillDescription(ParameterSetDescription &desc)
static void fillDescription(ParameterSetDescription &desc)
Definition: InputSource.cc:127
ProcessingController::ForwardState edm::PoolSource::forwardState_ ( ) const
overrideprivatevirtual

Reimplemented from edm::InputSource.

Definition at line 339 of file PoolSource.cc.

References primaryFileSequence_.

339  {
340  return primaryFileSequence_->forwardState();
341  }
edm::propagate_const< std::unique_ptr< RootPrimaryFileSequence > > primaryFileSequence_
Definition: PoolSource.h:90
InputSource::ItemType edm::PoolSource::getNextItemType ( )
overrideprivatevirtual

Implements edm::InputSource.

Definition at line 257 of file PoolSource.cc.

References event(), edm::IndexIntoFile::invalidEvent, edm::IndexIntoFile::invalidLumi, edm::IndexIntoFile::invalidRun, edm::InputSource::IsEvent, edm::InputSource::IsLumi, edm::InputSource::IsRun, edm::InputSource::IsSynchronize, fjr2json::lumi, primaryFileSequence_, edm::InputSource::run(), runHelper_, secondaryFileSequence_, and edm::InputSource::state().

257  {
261  InputSource::ItemType itemType = primaryFileSequence_->getNextItemType(run, lumi, event);
263  if(itemType == IsRun || itemType == IsLumi || itemType == IsEvent) {
264  if(!secondaryFileSequence_->containedInCurrentFile(run, lumi, event)) {
265  return IsSynchronize;
266  }
267  }
268  }
269  return runHelper_->nextItemType(state(), itemType);
270  }
edm::propagate_const< std::unique_ptr< RootSecondaryFileSequence > > secondaryFileSequence_
Definition: PoolSource.h:91
tuple lumi
Definition: fjr2json.py:35
edm::propagate_const< std::unique_ptr< RunHelperBase > > runHelper_
Definition: PoolSource.h:88
unsigned long long EventNumber_t
RunNumber_t run() const
Accessor for current run number.
Definition: InputSource.cc:590
unsigned int LuminosityBlockNumber_t
static EventNumber_t const invalidEvent
static RunNumber_t const invalidRun
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
ItemType state() const
Definition: InputSource.h:352
static LuminosityBlockNumber_t const invalidLumi
unsigned int RunNumber_t
edm::propagate_const< std::unique_ptr< RootPrimaryFileSequence > > primaryFileSequence_
Definition: PoolSource.h:90
bool edm::PoolSource::goToEvent_ ( EventID const &  eventID)
overrideprivatevirtual

Reimplemented from edm::InputSource.

Definition at line 295 of file PoolSource.cc.

References primaryFileSequence_.

295  {
296  return primaryFileSequence_->goToEvent(eventID);
297  }
edm::propagate_const< std::unique_ptr< RootPrimaryFileSequence > > primaryFileSequence_
Definition: PoolSource.h:90
bool edm::PoolSource::labelRawDataLikeMC ( ) const
inline
unsigned int edm::PoolSource::nStreams ( ) const
inline

Definition at line 44 of file PoolSource.h.

References nStreams_.

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

44 {return nStreams_;}
unsigned int nStreams_
Definition: PoolSource.h:80
void edm::PoolSource::preForkReleaseResources ( )
overrideprivatevirtual

Reimplemented from edm::InputSource.

Definition at line 273 of file PoolSource.cc.

References primaryFileSequence_.

273  {
274  primaryFileSequence_->closeFile_();
275  }
edm::propagate_const< std::unique_ptr< RootPrimaryFileSequence > > primaryFileSequence_
Definition: PoolSource.h:90
ProductSelectorRules const& edm::PoolSource::productSelectorRules ( ) const
inline

Definition at line 46 of file PoolSource.h.

References productSelectorRules_.

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

46 {return productSelectorRules_;}
ProductSelectorRules productSelectorRules_
Definition: PoolSource.h:84
bool edm::PoolSource::randomAccess_ ( ) const
overrideprivatevirtual

Reimplemented from edm::InputSource.

Definition at line 334 of file PoolSource.cc.

334  {
335  return true;
336  }
void edm::PoolSource::readEvent_ ( EventPrincipal eventPrincipal)
overrideprivatevirtual

Implements edm::InputSource.

Definition at line 226 of file PoolSource.cc.

References branchIDsToReplace_, edm::Principal::clearPrincipal(), 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::recombine(), edm::EventPrincipal::run(), secondaryEventPrincipals_, secondaryFileSequence_, edm::EventPrincipal::streamID(), and edm::StreamID::value().

Referenced by readIt().

226  {
227  primaryFileSequence_->readEvent(eventPrincipal);
229  bool found = secondaryFileSequence_->skipToItem(eventPrincipal.run(),
230  eventPrincipal.luminosityBlock(),
231  eventPrincipal.id().event());
232  if(found) {
233  EventPrincipal& secondaryEventPrincipal = *secondaryEventPrincipals_[eventPrincipal.streamID().value()];
234  secondaryFileSequence_->readEvent(secondaryEventPrincipal);
235  checkConsistency(eventPrincipal, secondaryEventPrincipal);
236  checkHistoryConsistency(eventPrincipal, secondaryEventPrincipal);
237  eventPrincipal.recombine(secondaryEventPrincipal, branchIDsToReplace_[InEvent]);
238  eventPrincipal.mergeProvenanceRetrievers(secondaryEventPrincipal);
239  secondaryEventPrincipal.clearPrincipal();
240  } else {
241  throw Exception(errors::MismatchedInputFiles, "PoolSource::readEvent_") <<
242  eventPrincipal.id() << " is not found in the secondary input files\n";
243  }
244  }
245  }
edm::propagate_const< std::unique_ptr< RootSecondaryFileSequence > > secondaryFileSequence_
Definition: PoolSource.h:91
std::vector< edm::propagate_const< std::unique_ptr< EventPrincipal > > > secondaryEventPrincipals_
Definition: PoolSource.h:77
std::array< std::vector< BranchID >, NumBranchTypes > branchIDsToReplace_
Definition: PoolSource.h:78
edm::propagate_const< std::unique_ptr< RootPrimaryFileSequence > > primaryFileSequence_
Definition: PoolSource.h:90
std::unique_ptr< FileBlock > edm::PoolSource::readFile_ ( )
overrideprivatevirtual

Reimplemented from edm::InputSource.

Definition at line 154 of file PoolSource.cc.

References benchmark_cfg::fb, edm::FileBlock::HasSecondaryFileSequence, eostools::move(), primaryFileSequence_, and secondaryFileSequence_.

154  {
155  std::unique_ptr<FileBlock> fb = primaryFileSequence_->readFile_();
157  fb->setNotFastClonable(FileBlock::HasSecondaryFileSequence);
158  }
159  return std::move(fb);
160  }
edm::propagate_const< std::unique_ptr< RootSecondaryFileSequence > > secondaryFileSequence_
Definition: PoolSource.h:91
def move
Definition: eostools.py:510
edm::propagate_const< std::unique_ptr< RootPrimaryFileSequence > > primaryFileSequence_
Definition: PoolSource.h:90
bool edm::PoolSource::readIt ( EventID const &  id,
EventPrincipal eventPrincipal,
StreamContext streamContext 
)
overrideprivatevirtual

Reimplemented from edm::InputSource.

Definition at line 248 of file PoolSource.cc.

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

248  {
249  bool found = primaryFileSequence_->skipToItem(id.run(), id.luminosityBlock(), id.event());
250  if(!found) return false;
251  EventSourceSentry sentry(*this, streamContext);
252  readEvent_(eventPrincipal);
253  return true;
254  }
RunNumber_t run() const
Accessor for current run number.
Definition: InputSource.cc:590
virtual void readEvent_(EventPrincipal &eventPrincipal) override
Definition: PoolSource.cc:226
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
LuminosityBlockNumber_t luminosityBlock() const
Accessor for current luminosity block number.
Definition: InputSource.cc:596
edm::propagate_const< std::unique_ptr< RootPrimaryFileSequence > > primaryFileSequence_
Definition: PoolSource.h:90
void edm::PoolSource::readLuminosityBlock_ ( LuminosityBlockPrincipal lumiPrincipal)
overrideprivatevirtual

Reimplemented from edm::InputSource.

Definition at line 201 of file PoolSource.cc.

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_, and secondaryLumiPrincipal_.

201  {
202  primaryFileSequence_->readLuminosityBlock_(lumiPrincipal);
204  bool found = secondaryFileSequence_->skipToItem(lumiPrincipal.run(), lumiPrincipal.luminosityBlock(), 0U);
205  if(found) {
206  std::shared_ptr<LuminosityBlockAuxiliary> secondaryAuxiliary = secondaryFileSequence_->readLuminosityBlockAuxiliary_();
207  checkConsistency(lumiPrincipal.aux(), *secondaryAuxiliary);
208  secondaryLumiPrincipal_ = std::make_shared<LuminosityBlockPrincipal>(secondaryAuxiliary,
209  secondaryFileSequence_->fileProductRegistry(),
211  nullptr,
212  lumiPrincipal.index());
213  secondaryFileSequence_->readLuminosityBlock_(*secondaryLumiPrincipal_);
214  checkHistoryConsistency(lumiPrincipal, *secondaryLumiPrincipal_);
215  lumiPrincipal.recombine(*secondaryLumiPrincipal_, branchIDsToReplace_[InLumi]);
216  } else {
217  throw Exception(errors::MismatchedInputFiles, "PoolSource::readLuminosityBlock_")
218  << " Run " << lumiPrincipal.run()
219  << " LuminosityBlock " << lumiPrincipal.luminosityBlock()
220  << " is not found in the secondary input files\n";
221  }
222  }
223  }
edm::propagate_const< std::unique_ptr< RootSecondaryFileSequence > > secondaryFileSequence_
Definition: PoolSource.h:91
std::array< std::vector< BranchID >, NumBranchTypes > branchIDsToReplace_
Definition: PoolSource.h:78
ProcessConfiguration const & processConfiguration() const
Accessor for Process Configuration.
Definition: InputSource.h:214
edm::propagate_const< std::shared_ptr< LuminosityBlockPrincipal > > secondaryLumiPrincipal_
Definition: PoolSource.h:76
edm::propagate_const< std::unique_ptr< RootPrimaryFileSequence > > primaryFileSequence_
Definition: PoolSource.h:90
std::shared_ptr< LuminosityBlockAuxiliary > edm::PoolSource::readLuminosityBlockAuxiliary_ ( )
overrideprivatevirtual

Implements edm::InputSource.

Definition at line 172 of file PoolSource.cc.

References primaryFileSequence_.

172  {
173  return primaryFileSequence_->readLuminosityBlockAuxiliary_();
174  }
edm::propagate_const< std::unique_ptr< RootPrimaryFileSequence > > primaryFileSequence_
Definition: PoolSource.h:90
void edm::PoolSource::readRun_ ( RunPrincipal runPrincipal)
overrideprivatevirtual

Reimplemented from edm::InputSource.

Definition at line 177 of file PoolSource.cc.

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_, and secondaryRunPrincipal_.

177  {
178  primaryFileSequence_->readRun_(runPrincipal);
180  bool found = secondaryFileSequence_->skipToItem(runPrincipal.run(), 0U, 0U);
181  if(found) {
182  std::shared_ptr<RunAuxiliary> secondaryAuxiliary = secondaryFileSequence_->readRunAuxiliary_();
183  checkConsistency(runPrincipal.aux(), *secondaryAuxiliary);
184  secondaryRunPrincipal_ = std::make_shared<RunPrincipal>(secondaryAuxiliary,
185  secondaryFileSequence_->fileProductRegistry(),
187  nullptr,
188  runPrincipal.index());
189  secondaryFileSequence_->readRun_(*secondaryRunPrincipal_);
190  checkHistoryConsistency(runPrincipal, *secondaryRunPrincipal_);
191  runPrincipal.recombine(*secondaryRunPrincipal_, branchIDsToReplace_[InRun]);
192  } else {
193  throw Exception(errors::MismatchedInputFiles, "PoolSource::readRun_")
194  << " Run " << runPrincipal.run()
195  << " is not found in the secondary input files\n";
196  }
197  }
198  }
edm::propagate_const< std::unique_ptr< RootSecondaryFileSequence > > secondaryFileSequence_
Definition: PoolSource.h:91
edm::propagate_const< std::shared_ptr< RunPrincipal > > secondaryRunPrincipal_
Definition: PoolSource.h:75
std::array< std::vector< BranchID >, NumBranchTypes > branchIDsToReplace_
Definition: PoolSource.h:78
ProcessConfiguration const & processConfiguration() const
Accessor for Process Configuration.
Definition: InputSource.h:214
edm::propagate_const< std::unique_ptr< RootPrimaryFileSequence > > primaryFileSequence_
Definition: PoolSource.h:90
std::shared_ptr< RunAuxiliary > edm::PoolSource::readRunAuxiliary_ ( )
overrideprivatevirtual

Implements edm::InputSource.

Definition at line 167 of file PoolSource.cc.

References primaryFileSequence_.

167  {
168  return primaryFileSequence_->readRunAuxiliary_();
169  }
edm::propagate_const< std::unique_ptr< RootPrimaryFileSequence > > primaryFileSequence_
Definition: PoolSource.h:90
SharedResourcesAcquirer * edm::PoolSource::resourceSharedWithDelayedReader_ ( )
overrideprivatevirtual

Reimplemented from edm::InputSource.

Definition at line 278 of file PoolSource.cc.

References resourceSharedWithDelayedReaderPtr_.

278  {
280  }
std::unique_ptr< SharedResourcesAcquirer > resourceSharedWithDelayedReaderPtr_
Definition: PoolSource.h:89
ProcessingController::ReverseState edm::PoolSource::reverseState_ ( ) const
overrideprivatevirtual

Reimplemented from edm::InputSource.

Definition at line 344 of file PoolSource.cc.

References primaryFileSequence_.

344  {
345  return primaryFileSequence_->reverseState();
346  }
edm::propagate_const< std::unique_ptr< RootPrimaryFileSequence > > primaryFileSequence_
Definition: PoolSource.h:90
void edm::PoolSource::rewind_ ( )
overrideprivatevirtual

Reimplemented from edm::InputSource.

Definition at line 284 of file PoolSource.cc.

References primaryFileSequence_.

284  {
285  primaryFileSequence_->rewind_();
286  }
edm::propagate_const< std::unique_ptr< RootPrimaryFileSequence > > primaryFileSequence_
Definition: PoolSource.h:90
RunHelperBase* edm::PoolSource::runHelper ( )
inline

Definition at line 47 of file PoolSource.h.

References runHelper_.

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

47 {return runHelper_.get();}
edm::propagate_const< std::unique_ptr< RunHelperBase > > runHelper_
Definition: PoolSource.h:88
void edm::PoolSource::skip ( int  offset)
overrideprivatevirtual

Reimplemented from edm::InputSource.

Definition at line 290 of file PoolSource.cc.

References primaryFileSequence_.

290  {
291  primaryFileSequence_->skipEvents(offset);
292  }
edm::propagate_const< std::unique_ptr< RootPrimaryFileSequence > > primaryFileSequence_
Definition: PoolSource.h:90
bool edm::PoolSource::skipBadFiles ( ) const
inline
int edm::PoolSource::treeMaxVirtualSize ( ) const
inline

Member Data Documentation

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

Definition at line 78 of file PoolSource.h.

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

bool edm::PoolSource::bypassVersionCheck_
private

Definition at line 82 of file PoolSource.h.

Referenced by bypassVersionCheck().

InputFileCatalog edm::PoolSource::catalog_
private

Definition at line 73 of file PoolSource.h.

bool edm::PoolSource::dropDescendants_
private

Definition at line 85 of file PoolSource.h.

Referenced by dropDescendants().

bool edm::PoolSource::labelRawDataLikeMC_
private

Definition at line 86 of file PoolSource.h.

Referenced by labelRawDataLikeMC().

unsigned int edm::PoolSource::nStreams_
private

Definition at line 80 of file PoolSource.h.

Referenced by nStreams().

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

Definition at line 84 of file PoolSource.h.

Referenced by productSelectorRules().

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

Definition at line 89 of file PoolSource.h.

Referenced by resourceSharedWithDelayedReader_().

RootServiceChecker edm::PoolSource::rootServiceChecker_
private

Definition at line 72 of file PoolSource.h.

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

Definition at line 88 of file PoolSource.h.

Referenced by getNextItemType(), and runHelper().

InputFileCatalog edm::PoolSource::secondaryCatalog_
private

Definition at line 74 of file PoolSource.h.

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

Definition at line 77 of file PoolSource.h.

Referenced by readEvent_().

edm::propagate_const<std::unique_ptr<RootSecondaryFileSequence> > edm::PoolSource::secondaryFileSequence_
private
edm::propagate_const<std::shared_ptr<LuminosityBlockPrincipal> > edm::PoolSource::secondaryLumiPrincipal_
private

Definition at line 76 of file PoolSource.h.

Referenced by readLuminosityBlock_().

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

Definition at line 75 of file PoolSource.h.

Referenced by readRun_().

bool edm::PoolSource::skipBadFiles_
private

Definition at line 81 of file PoolSource.h.

Referenced by skipBadFiles().

int const edm::PoolSource::treeMaxVirtualSize_
private

Definition at line 83 of file PoolSource.h.

Referenced by treeMaxVirtualSize().