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

 PoolSource (ParameterSet const &pset, InputSourceDescription const &desc)
 
virtual ~PoolSource ()
 
- Public Member Functions inherited from edm::InputSource
std::shared_ptr< ActivityRegistryactReg () const
 Accessor for Activity Registry. More...
 
std::shared_ptr
< BranchIDListHelper
branchIDListHelper () const
 Accessor for branchIDListHelper. More...
 
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
 Const accessor for process history registry. More...
 
ProcessingMode processingMode () const
 RunsLumisAndEvents (default), RunsAndLumis, or Runs. More...
 
std::shared_ptr
< ProductRegistry const > 
productRegistry () const
 Accessor for product registry. More...
 
bool randomAccess () const
 
void readAndMergeLumi (LuminosityBlockPrincipal &lbp)
 Read next luminosity block (same as a prior lumi) More...
 
void readAndMergeRun (RunPrincipal &rp)
 Read next run (same as a prior run) More...
 
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 () const
 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
thinnedAssociationsHelper () const
 Accessor for thinnedAssociationsHelper. More...
 
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_ ()
 
virtual void endJob ()
 
virtual
ProcessingController::ForwardState 
forwardState_ () const
 
virtual ItemType getNextItemType ()
 
virtual bool goToEvent_ (EventID const &eventID)
 
virtual void preForkReleaseResources ()
 
virtual bool randomAccess_ () const
 
virtual void readEvent_ (EventPrincipal &eventPrincipal)
 
virtual std::unique_ptr
< FileBlock
readFile_ ()
 
virtual bool readIt (EventID const &id, EventPrincipal &eventPrincipal, StreamContext &streamContext) override
 
virtual void readLuminosityBlock_ (LuminosityBlockPrincipal &lumiPrincipal)
 
virtual std::shared_ptr
< LuminosityBlockAuxiliary
readLuminosityBlockAuxiliary_ ()
 
virtual void readRun_ (RunPrincipal &runPrincipal)
 
virtual std::shared_ptr
< RunAuxiliary
readRunAuxiliary_ ()
 
SharedResourcesAcquirerresourceSharedWithDelayedReader_ () const override
 
virtual
ProcessingController::ReverseState 
reverseState_ () const
 
virtual void rewind_ ()
 
virtual void skip (int offset)
 

Private Attributes

std::array< std::vector
< BranchID >, NumBranchTypes
branchIDsToReplace_
 
InputFileCatalog catalog_
 
std::unique_ptr
< RootPrimaryFileSequence
primaryFileSequence_
 
std::unique_ptr
< SharedResourcesAcquirer
resourceSharedWithDelayedReaderPtr_
 
RootServiceChecker rootServiceChecker_
 
InputFileCatalog secondaryCatalog_
 
std::vector< std::unique_ptr
< EventPrincipal > > 
secondaryEventPrincipals_
 
std::unique_ptr
< RootSecondaryFileSequence
secondaryFileSequence_
 
std::shared_ptr
< LuminosityBlockPrincipal
secondaryLumiPrincipal_
 
std::shared_ptr< RunPrincipalsecondaryRunPrincipal_
 

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
 
std::shared_ptr
< LuminosityBlockPrincipal >
const 
luminosityBlockPrincipal () const
 
bool newLumi () const
 
bool newRun () const
 
ProcessHistoryRegistryprocessHistoryRegistryForUpdate () const
 
ProductRegistryproductRegistryUpdate () const
 
void reset () const
 
void resetEventCached ()
 
void resetLuminosityBlockAuxiliary (bool isNewLumi=true) const
 
void resetNewLumi ()
 
void resetNewRun ()
 
void resetRunAuxiliary (bool isNewRun=true) const
 
std::shared_ptr< RunPrincipal >
const 
runPrincipal () 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 29 of file PoolSource.h.

Constructor & Destructor Documentation

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

Definition at line 64 of file PoolSource.cc.

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

64  :
65  InputSource(pset, desc),
67  catalog_(pset.getUntrackedParameter<std::vector<std::string> >("fileNames"),
68  pset.getUntrackedParameter<std::string>("overrideCatalog", std::string())),
69  secondaryCatalog_(pset.getUntrackedParameter<std::vector<std::string> >("secondaryFileNames", std::vector<std::string>()),
70  pset.getUntrackedParameter<std::string>("overrideCatalog", std::string())),
71  primaryFileSequence_(new RootPrimaryFileSequence(pset, *this, catalog_, desc.allocations_->numberOfStreams())),
73  new RootSecondaryFileSequence(pset, *this, secondaryCatalog_, desc.allocations_->numberOfStreams())),
79  {
80  if (secondaryCatalog_.empty() && pset.getUntrackedParameter<bool>("needSecondaryFileNames", false)) {
81  throw Exception(errors::Configuration, "PoolSource") << "'secondaryFileNames' must be specified\n";
82  }
84  unsigned int nStreams = desc.allocations_->numberOfStreams();
85  secondaryEventPrincipals_.reserve(nStreams);
86  for(unsigned int index = 0; index < nStreams; ++index) {
87  secondaryEventPrincipals_.emplace_back(new EventPrincipal(secondaryFileSequence_->fileProductRegistry(),
88  secondaryFileSequence_->fileBranchIDListHelper(),
89  std::make_shared<ThinnedAssociationsHelper const>(),
91  nullptr,
92  index));
93  }
94  std::array<std::set<BranchID>, NumBranchTypes> idsToReplace;
95  ProductRegistry::ProductList const& secondary = secondaryFileSequence_->fileProductRegistry()->productList();
96  ProductRegistry::ProductList const& primary = primaryFileSequence_->fileProductRegistry()->productList();
97  std::set<BranchID> associationsFromSecondary;
98  typedef ProductRegistry::ProductList::const_iterator const_iterator;
99  typedef ProductRegistry::ProductList::iterator iterator;
100  //this is the registry used by the 'outside' world and only has the primary file information in it at present
102  for(const_iterator it = secondary.begin(), itEnd = secondary.end(); it != itEnd; ++it) {
103  if(it->second.present()) {
104  idsToReplace[it->second.branchType()].insert(it->second.branchID());
105  if(it->second.branchType() == InEvent &&
106  it->second.unwrappedType() == typeid(ThinnedAssociation)) {
107  associationsFromSecondary.insert(it->second.branchID());
108  }
109  //now make sure this is marked as not dropped else the product will not be 'get'table from the Event
110  iterator itFound = fullList.find(it->first);
111  if(itFound != fullList.end()) {
112  itFound->second.setDropped(false);
113  }
114  }
115  }
116  for(const_iterator it = primary.begin(), itEnd = primary.end(); it != itEnd; ++it) {
117  if(it->second.present()) {
118  idsToReplace[it->second.branchType()].erase(it->second.branchID());
119  associationsFromSecondary.erase(it->second.branchID());
120  }
121  }
122  if(idsToReplace[InEvent].empty() && idsToReplace[InLumi].empty() && idsToReplace[InRun].empty()) {
123  secondaryFileSequence_.reset();
124  } else {
125  for(int i = InEvent; i < NumBranchTypes; ++i) {
126  branchIDsToReplace_[i].reserve(idsToReplace[i].size());
127  for(std::set<BranchID>::const_iterator it = idsToReplace[i].begin(), itEnd = idsToReplace[i].end();
128  it != itEnd; ++it) {
129  branchIDsToReplace_[i].push_back(*it);
130  }
131  }
132  }
133  secondaryFileSequence_->initAssociationsFromSecondary(associationsFromSecondary);
134  }
135  }
int i
Definition: DBlmapReader.cc:9
SharedResourcesAcquirer createAcquirerForSourceDelayedReader()
InputFileCatalog catalog_
Definition: PoolSource.h:60
std::unique_ptr< SharedResourcesAcquirer > resourceSharedWithDelayedReaderPtr_
Definition: PoolSource.h:69
std::shared_ptr< RunPrincipal > secondaryRunPrincipal_
Definition: PoolSource.h:64
std::map< BranchKey, BranchDescription > ProductList
std::unique_ptr< RootPrimaryFileSequence > primaryFileSequence_
Definition: PoolSource.h:62
std::shared_ptr< LuminosityBlockPrincipal > secondaryLumiPrincipal_
Definition: PoolSource.h:65
static SharedResourcesRegistry * instance()
#define end
Definition: vmac.h:37
InputFileCatalog secondaryCatalog_
Definition: PoolSource.h:61
ProductRegistry & productRegistryUpdate() const
Definition: InputSource.h:345
std::array< std::vector< BranchID >, NumBranchTypes > branchIDsToReplace_
Definition: PoolSource.h:67
ProductList & productListUpdator()
RootServiceChecker rootServiceChecker_
Definition: PoolSource.h:59
#define begin
Definition: vmac.h:30
ProcessConfiguration const & processConfiguration() const
Accessor for Process Configuration.
Definition: InputSource.h:209
std::unique_ptr< RootSecondaryFileSequence > secondaryFileSequence_
Definition: PoolSource.h:63
InputSource(ParameterSet const &, InputSourceDescription const &)
Constructor.
Definition: InputSource.cc:47
std::vector< std::unique_ptr< EventPrincipal > > secondaryEventPrincipals_
Definition: PoolSource.h:66
tuple size
Write out results.
edm::PoolSource::~PoolSource ( )
virtual

Definition at line 137 of file PoolSource.cc.

137 {}

Member Function Documentation

void edm::PoolSource::closeFile_ ( )
privatevirtual

Reimplemented from edm::InputSource.

Definition at line 155 of file PoolSource.cc.

References primaryFileSequence_.

155  {
156  primaryFileSequence_->closeFile_();
157  }
std::unique_ptr< RootPrimaryFileSequence > primaryFileSequence_
Definition: PoolSource.h:62
void edm::PoolSource::endJob ( void  )
privatevirtual

Reimplemented from edm::InputSource.

Definition at line 140 of file PoolSource.cc.

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

140  {
142  primaryFileSequence_->endJob();
144  }
std::unique_ptr< RootPrimaryFileSequence > primaryFileSequence_
Definition: PoolSource.h:62
static void reportReadBranches()
Definition: InputFile.cc:113
std::unique_ptr< RootSecondaryFileSequence > secondaryFileSequence_
Definition: PoolSource.h:63
void edm::PoolSource::fillDescriptions ( ConfigurationDescriptions descriptions)
static

Definition at line 293 of file PoolSource.cc.

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

293  {
294 
296 
297  std::vector<std::string> defaultStrings;
298  desc.setComment("Reads EDM/Root files.");
299  desc.addUntracked<std::vector<std::string> >("fileNames")
300  ->setComment("Names of files to be processed.");
301  desc.addUntracked<std::vector<std::string> >("secondaryFileNames", defaultStrings)
302  ->setComment("Names of secondary files to be processed.");
303  desc.addUntracked<bool>("needSecondaryFileNames", false)
304  ->setComment("If True, 'secondaryFileNames' must be specified and be non-empty.");
305  desc.addUntracked<std::string>("overrideCatalog", std::string());
308 
309  descriptions.add("source", desc);
310  }
static void fillDescription(ParameterSetDescription &desc)
static void fillDescription(ParameterSetDescription &desc)
Definition: InputSource.cc:127
ProcessingController::ForwardState edm::PoolSource::forwardState_ ( ) const
privatevirtual

Reimplemented from edm::InputSource.

Definition at line 318 of file PoolSource.cc.

References primaryFileSequence_.

318  {
319  return primaryFileSequence_->forwardState();
320  }
std::unique_ptr< RootPrimaryFileSequence > primaryFileSequence_
Definition: PoolSource.h:62
InputSource::ItemType edm::PoolSource::getNextItemType ( )
privatevirtual

Implements edm::InputSource.

Definition at line 250 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(), secondaryFileSequence_, and edm::InputSource::state().

250  {
254  InputSource::ItemType itemType = primaryFileSequence_->getNextItemType(run, lumi, event);
256  if(itemType == IsRun || itemType == IsLumi || itemType == IsEvent) {
257  if(!secondaryFileSequence_->containedInCurrentFile(run, lumi, event)) {
258  return IsSynchronize;
259  }
260  }
261  }
262  return itemType;
263  }
tuple lumi
Definition: fjr2json.py:35
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
std::unique_ptr< RootPrimaryFileSequence > primaryFileSequence_
Definition: PoolSource.h:62
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:347
static LuminosityBlockNumber_t const invalidLumi
unsigned int RunNumber_t
std::unique_ptr< RootSecondaryFileSequence > secondaryFileSequence_
Definition: PoolSource.h:63
bool edm::PoolSource::goToEvent_ ( EventID const &  eventID)
privatevirtual

Reimplemented from edm::InputSource.

Definition at line 288 of file PoolSource.cc.

References primaryFileSequence_.

288  {
289  return primaryFileSequence_->goToEvent(eventID);
290  }
std::unique_ptr< RootPrimaryFileSequence > primaryFileSequence_
Definition: PoolSource.h:62
void edm::PoolSource::preForkReleaseResources ( )
privatevirtual

Reimplemented from edm::InputSource.

Definition at line 266 of file PoolSource.cc.

References primaryFileSequence_.

266  {
267  primaryFileSequence_->closeFile_();
268  }
std::unique_ptr< RootPrimaryFileSequence > primaryFileSequence_
Definition: PoolSource.h:62
bool edm::PoolSource::randomAccess_ ( ) const
privatevirtual

Reimplemented from edm::InputSource.

Definition at line 313 of file PoolSource.cc.

313  {
314  return true;
315  }
void edm::PoolSource::readEvent_ ( EventPrincipal eventPrincipal)
privatevirtual

Implements edm::InputSource.

Definition at line 219 of file PoolSource.cc.

References branchIDsToReplace_, edm::Principal::clearPrincipal(), relativeConstraints::empty, edm::EventID::event(), edm::hlt::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().

219  {
220  primaryFileSequence_->readEvent(eventPrincipal);
222  bool found = secondaryFileSequence_->skipToItem(eventPrincipal.run(),
223  eventPrincipal.luminosityBlock(),
224  eventPrincipal.id().event());
225  if(found) {
226  EventPrincipal& secondaryEventPrincipal = *secondaryEventPrincipals_[eventPrincipal.streamID().value()];
227  secondaryFileSequence_->readEvent(secondaryEventPrincipal);
228  checkConsistency(eventPrincipal, secondaryEventPrincipal);
229  checkHistoryConsistency(eventPrincipal, secondaryEventPrincipal);
230  eventPrincipal.recombine(secondaryEventPrincipal, branchIDsToReplace_[InEvent]);
231  eventPrincipal.mergeProvenanceRetrievers(secondaryEventPrincipal);
232  secondaryEventPrincipal.clearPrincipal();
233  } else {
234  throw Exception(errors::MismatchedInputFiles, "PoolSource::readEvent_") <<
235  eventPrincipal.id() << " is not found in the secondary input files\n";
236  }
237  }
238  }
std::unique_ptr< RootPrimaryFileSequence > primaryFileSequence_
Definition: PoolSource.h:62
std::array< std::vector< BranchID >, NumBranchTypes > branchIDsToReplace_
Definition: PoolSource.h:67
std::unique_ptr< RootSecondaryFileSequence > secondaryFileSequence_
Definition: PoolSource.h:63
std::vector< std::unique_ptr< EventPrincipal > > secondaryEventPrincipals_
Definition: PoolSource.h:66
std::unique_ptr< FileBlock > edm::PoolSource::readFile_ ( )
privatevirtual

Reimplemented from edm::InputSource.

Definition at line 147 of file PoolSource.cc.

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

147  {
148  std::unique_ptr<FileBlock> fb = primaryFileSequence_->readFile_();
150  fb->setNotFastClonable(FileBlock::HasSecondaryFileSequence);
151  }
152  return std::move(fb);
153  }
std::unique_ptr< RootPrimaryFileSequence > primaryFileSequence_
Definition: PoolSource.h:62
std::unique_ptr< RootSecondaryFileSequence > secondaryFileSequence_
Definition: PoolSource.h:63
bool edm::PoolSource::readIt ( EventID const &  id,
EventPrincipal eventPrincipal,
StreamContext streamContext 
)
overrideprivatevirtual

Reimplemented from edm::InputSource.

Definition at line 241 of file PoolSource.cc.

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

241  {
242  bool found = primaryFileSequence_->skipToItem(id.run(), id.luminosityBlock(), id.event());
243  if(!found) return false;
244  EventSourceSentry sentry(*this, streamContext);
245  readEvent_(eventPrincipal);
246  return true;
247  }
RunNumber_t run() const
Accessor for current run number.
Definition: InputSource.cc:590
std::unique_ptr< RootPrimaryFileSequence > primaryFileSequence_
Definition: PoolSource.h:62
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
virtual void readEvent_(EventPrincipal &eventPrincipal)
Definition: PoolSource.cc:219
void edm::PoolSource::readLuminosityBlock_ ( LuminosityBlockPrincipal lumiPrincipal)
privatevirtual

Reimplemented from edm::InputSource.

Definition at line 194 of file PoolSource.cc.

References edm::LuminosityBlockPrincipal::aux(), branchIDsToReplace_, relativeConstraints::empty, edm::hlt::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_.

194  {
195  primaryFileSequence_->readLuminosityBlock_(lumiPrincipal);
197  bool found = secondaryFileSequence_->skipToItem(lumiPrincipal.run(), lumiPrincipal.luminosityBlock(), 0U);
198  if(found) {
199  std::shared_ptr<LuminosityBlockAuxiliary> secondaryAuxiliary = secondaryFileSequence_->readLuminosityBlockAuxiliary_();
200  checkConsistency(lumiPrincipal.aux(), *secondaryAuxiliary);
201  secondaryLumiPrincipal_ = std::make_shared<LuminosityBlockPrincipal>(secondaryAuxiliary,
202  secondaryFileSequence_->fileProductRegistry(),
204  nullptr,
205  lumiPrincipal.index());
206  secondaryFileSequence_->readLuminosityBlock_(*secondaryLumiPrincipal_);
207  checkHistoryConsistency(lumiPrincipal, *secondaryLumiPrincipal_);
208  lumiPrincipal.recombine(*secondaryLumiPrincipal_, branchIDsToReplace_[InLumi]);
209  } else {
210  throw Exception(errors::MismatchedInputFiles, "PoolSource::readLuminosityBlock_")
211  << " Run " << lumiPrincipal.run()
212  << " LuminosityBlock " << lumiPrincipal.luminosityBlock()
213  << " is not found in the secondary input files\n";
214  }
215  }
216  }
std::unique_ptr< RootPrimaryFileSequence > primaryFileSequence_
Definition: PoolSource.h:62
std::shared_ptr< LuminosityBlockPrincipal > secondaryLumiPrincipal_
Definition: PoolSource.h:65
std::array< std::vector< BranchID >, NumBranchTypes > branchIDsToReplace_
Definition: PoolSource.h:67
ProcessConfiguration const & processConfiguration() const
Accessor for Process Configuration.
Definition: InputSource.h:209
std::unique_ptr< RootSecondaryFileSequence > secondaryFileSequence_
Definition: PoolSource.h:63
std::shared_ptr< LuminosityBlockAuxiliary > edm::PoolSource::readLuminosityBlockAuxiliary_ ( )
privatevirtual

Implements edm::InputSource.

Definition at line 165 of file PoolSource.cc.

References primaryFileSequence_.

165  {
166  return primaryFileSequence_->readLuminosityBlockAuxiliary_();
167  }
std::unique_ptr< RootPrimaryFileSequence > primaryFileSequence_
Definition: PoolSource.h:62
void edm::PoolSource::readRun_ ( RunPrincipal runPrincipal)
privatevirtual

Reimplemented from edm::InputSource.

Definition at line 170 of file PoolSource.cc.

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

170  {
173  bool found = secondaryFileSequence_->skipToItem(runPrincipal.run(), 0U, 0U);
174  if(found) {
175  std::shared_ptr<RunAuxiliary> secondaryAuxiliary = secondaryFileSequence_->readRunAuxiliary_();
176  checkConsistency(runPrincipal.aux(), *secondaryAuxiliary);
177  secondaryRunPrincipal_ = std::make_shared<RunPrincipal>(secondaryAuxiliary,
178  secondaryFileSequence_->fileProductRegistry(),
180  nullptr,
181  runPrincipal.index());
182  secondaryFileSequence_->readRun_(*secondaryRunPrincipal_);
183  checkHistoryConsistency(runPrincipal, *secondaryRunPrincipal_);
184  runPrincipal.recombine(*secondaryRunPrincipal_, branchIDsToReplace_[InRun]);
185  } else {
186  throw Exception(errors::MismatchedInputFiles, "PoolSource::readRun_")
187  << " Run " << runPrincipal.run()
188  << " is not found in the secondary input files\n";
189  }
190  }
191  }
std::shared_ptr< RunPrincipal > secondaryRunPrincipal_
Definition: PoolSource.h:64
std::unique_ptr< RootPrimaryFileSequence > primaryFileSequence_
Definition: PoolSource.h:62
std::shared_ptr< RunPrincipal > const runPrincipal() const
std::array< std::vector< BranchID >, NumBranchTypes > branchIDsToReplace_
Definition: PoolSource.h:67
ProcessConfiguration const & processConfiguration() const
Accessor for Process Configuration.
Definition: InputSource.h:209
std::unique_ptr< RootSecondaryFileSequence > secondaryFileSequence_
Definition: PoolSource.h:63
std::shared_ptr< RunAuxiliary > edm::PoolSource::readRunAuxiliary_ ( )
privatevirtual

Implements edm::InputSource.

Definition at line 160 of file PoolSource.cc.

References primaryFileSequence_.

160  {
161  return primaryFileSequence_->readRunAuxiliary_();
162  }
std::unique_ptr< RootPrimaryFileSequence > primaryFileSequence_
Definition: PoolSource.h:62
SharedResourcesAcquirer * edm::PoolSource::resourceSharedWithDelayedReader_ ( ) const
overrideprivatevirtual

Reimplemented from edm::InputSource.

Definition at line 271 of file PoolSource.cc.

References resourceSharedWithDelayedReaderPtr_.

271  {
273  }
std::unique_ptr< SharedResourcesAcquirer > resourceSharedWithDelayedReaderPtr_
Definition: PoolSource.h:69
ProcessingController::ReverseState edm::PoolSource::reverseState_ ( ) const
privatevirtual

Reimplemented from edm::InputSource.

Definition at line 323 of file PoolSource.cc.

References primaryFileSequence_.

323  {
324  return primaryFileSequence_->reverseState();
325  }
std::unique_ptr< RootPrimaryFileSequence > primaryFileSequence_
Definition: PoolSource.h:62
void edm::PoolSource::rewind_ ( )
privatevirtual

Reimplemented from edm::InputSource.

Definition at line 277 of file PoolSource.cc.

References primaryFileSequence_.

277  {
278  primaryFileSequence_->rewind_();
279  }
std::unique_ptr< RootPrimaryFileSequence > primaryFileSequence_
Definition: PoolSource.h:62
void edm::PoolSource::skip ( int  offset)
privatevirtual

Reimplemented from edm::InputSource.

Definition at line 283 of file PoolSource.cc.

References primaryFileSequence_.

283  {
284  primaryFileSequence_->skipEvents(offset);
285  }
std::unique_ptr< RootPrimaryFileSequence > primaryFileSequence_
Definition: PoolSource.h:62

Member Data Documentation

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

Definition at line 67 of file PoolSource.h.

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

InputFileCatalog edm::PoolSource::catalog_
private

Definition at line 60 of file PoolSource.h.

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

Definition at line 69 of file PoolSource.h.

Referenced by resourceSharedWithDelayedReader_().

RootServiceChecker edm::PoolSource::rootServiceChecker_
private

Definition at line 59 of file PoolSource.h.

InputFileCatalog edm::PoolSource::secondaryCatalog_
private

Definition at line 61 of file PoolSource.h.

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

Definition at line 66 of file PoolSource.h.

Referenced by readEvent_().

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

Definition at line 65 of file PoolSource.h.

Referenced by readLuminosityBlock_().

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

Definition at line 64 of file PoolSource.h.

Referenced by readRun_().