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::VectorInputSource edm::EDInputSource edm::InputSource edm::ProductRegistryHelper

Public Member Functions

 PoolSource (ParameterSet const &pset, InputSourceDescription const &desc)
 
virtual ~PoolSource ()
 
- Public Member Functions inherited from edm::VectorInputSource
void dropUnwantedBranches (std::vector< std::string > const &wantedBranches)
 
template<typename T >
size_t loopRandom (size_t number, T eventOperator)
 
template<typename T >
size_t loopRandomWithID (LuminosityBlockID const &id, size_t number, T eventOperator)
 
template<typename T >
size_t loopSequential (size_t number, T eventOperator)
 
template<typename T >
size_t loopSequentialWithID (LuminosityBlockID const &id, size_t number, T eventOperator)
 
template<typename T , typename Collection >
size_t loopSpecified (Collection const &events, T eventOperator)
 
 VectorInputSource (ParameterSet const &pset, InputSourceDescription const &desc)
 
virtual ~VectorInputSource ()
 
- Public Member Functions inherited from edm::EDInputSource
InputFileCatalogcatalog (int n=0)
 
 EDInputSource (ParameterSet const &pset, InputSourceDescription const &desc)
 
std::vector< FileCatalogItem >
const & 
fileCatalogItems (int n=0) const
 
std::vector< std::string > const & fileNames (int n=0) const
 
std::vector< std::string > const & logicalFileNames (int n=0) const
 
virtual ~EDInputSource ()
 
- Public Member Functions inherited from edm::InputSource
boost::shared_ptr
< ActivityRegistry
actReg () const
 Accessor for Activity Registry. More...
 
void closeFile (boost::shared_ptr< FileBlock >, bool cleaningUpAfterException)
 close current file More...
 
void doBeginJob ()
 Called by framework at beginning of job. More...
 
void doBeginLumi (LuminosityBlockPrincipal &lbp)
 Called by framework at beginning of lumi block. More...
 
void doBeginRun (RunPrincipal &rp)
 Called by framework at beginning of run. More...
 
void doEndJob ()
 Called by framework at end of job. More...
 
void doEndLumi (LuminosityBlockPrincipal &lbp, bool cleaningUpAfterException)
 Called by framework at end of lumi block. More...
 
void doEndRun (RunPrincipal &rp, bool cleaningUpAfterException)
 Called by framework at end of run. More...
 
void doPostForkReacquireResources (boost::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...
 
void issueReports (EventID const &eventID)
 issue an event report More...
 
LuminosityBlockNumber_t luminosityBlock () const
 Accessor for current luminosity block number. More...
 
boost::shared_ptr
< LuminosityBlockAuxiliary
luminosityBlockAuxiliary () const
 Called by the framework to merge or insert lumi in principal cache. More...
 
int markLumi ()
 Mark lumi as read. More...
 
int markRun ()
 Mark run as read. More...
 
int maxEvents () const
 
int maxLuminosityBlocks () const
 
ModuleDescription const & moduleDescription () const
 Accessor for 'module' description. More...
 
ItemType nextItemType ()
 
bool primary () const
 Accessor for primary input source flag. More...
 
ProcessConfiguration const & processConfiguration () const
 Accessor for Process Configuration. More...
 
std::string const & processGUID () const
 Accessor for global process identifier. More...
 
ProcessingMode processingMode () const
 RunsLumisAndEvents (default), RunsAndLumis, or Runs. More...
 
boost::shared_ptr
< ProductRegistry const > 
productRegistry () const
 Accessor for product registry. More...
 
bool randomAccess () const
 
void readAndCacheLumi (bool merge, HistoryAppender &historyAppender)
 Read next luminosity block. More...
 
void readAndCacheRun (bool merge, HistoryAppender &historyAppender)
 Read next run. More...
 
EventPrincipalreadEvent (boost::shared_ptr< LuminosityBlockPrincipal > lbCache)
 
EventPrincipalreadEvent (EventID const &)
 Read a specific event. More...
 
boost::shared_ptr< FileBlockreadFile ()
 Read next file. More...
 
boost::shared_ptr
< LuminosityBlockAuxiliary
readLuminosityBlockAuxiliary ()
 Read next luminosity block Auxilary. More...
 
boost::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...
 
ProcessingController::ReverseState reverseState () const
 
void rewind ()
 Begin again at the first event. More...
 
RunNumber_t run () const
 Accessor for current run number. More...
 
boost::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)
 
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::EDInputSource
static void fillDescription (ParameterSetDescription &desc)
 
- 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 dropUnwantedBranches_ (std::vector< std::string > const &wantedBranches)
 
virtual void endJob ()
 
virtual
ProcessingController::ForwardState 
forwardState_ () const
 
virtual ItemType getNextItemType ()
 
virtual bool goToEvent_ (EventID const &eventID)
 
virtual void postForkReacquireResources (boost::shared_ptr< edm::multicore::MessageReceiverForSource >)
 
virtual void preForkReleaseResources ()
 
virtual bool randomAccess_ () const
 
virtual EventPrincipalreadEvent_ ()
 
virtual boost::shared_ptr
< FileBlock
readFile_ ()
 
virtual EventPrincipalreadIt (EventID const &id)
 
virtual boost::shared_ptr
< LuminosityBlockPrincipal
readLuminosityBlock_ (boost::shared_ptr< LuminosityBlockPrincipal > lbCache)
 
virtual boost::shared_ptr
< LuminosityBlockAuxiliary
readLuminosityBlockAuxiliary_ ()
 
virtual EventPrincipalreadOneRandom ()
 
virtual EventPrincipalreadOneRandomWithID (LuminosityBlockID const &lumiID)
 
virtual EventPrincipalreadOneSequential ()
 
virtual EventPrincipalreadOneSequentialWithID (LuminosityBlockID const &lumiID)
 
virtual EventPrincipalreadOneSpecified (EventID const &id)
 
virtual boost::shared_ptr
< RunPrincipal
readRun_ (boost::shared_ptr< RunPrincipal > rpCache)
 
virtual boost::shared_ptr
< RunAuxiliary
readRunAuxiliary_ ()
 
virtual
ProcessingController::ReverseState 
reverseState_ () const
 
virtual void rewind_ ()
 
virtual void skip (int offset)
 

Private Attributes

std::array< std::vector
< BranchID >, NumBranchTypes
branchIDsToReplace_
 
unsigned int numberOfEventsBeforeBigSkip_
 
std::unique_ptr
< RootInputFileSequence
primaryFileSequence_
 
boost::shared_ptr
< edm::multicore::MessageReceiverForSource
receiver_
 
RootServiceChecker rootServiceChecker_
 
std::unique_ptr< EventPrincipalsecondaryEventPrincipal_
 
std::unique_ptr
< RootInputFileSequence
secondaryFileSequence_
 
boost::shared_ptr
< LuminosityBlockPrincipal
secondaryLumiPrincipal_
 
boost::shared_ptr< RunPrincipalsecondaryRunPrincipal_
 

Additional Inherited Members

- Public Types inherited from edm::InputSource
enum  ItemType {
  IsInvalid, IsStop, IsFile, IsRun,
  IsLumi, IsEvent, IsRepeat
}
 
enum  ProcessingMode { Runs, RunsAndLumis, RunsLumisAndEvents }
 
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Protected Member Functions inherited from edm::InputSource
void decreaseRemainingEventsBy (int iSkipped)
 
EventPrincipaleventPrincipalCache ()
 
boost::shared_ptr
< LuminosityBlockPrincipal >
const 
luminosityBlockPrincipal () const
 
PrincipalCache const & principalCache () const
 
PrincipalCacheprincipalCache ()
 
ProductRegistryproductRegistryUpdate () const
 
void reset () const
 
void resetLuminosityBlockAuxiliary () const
 
void resetRunAuxiliary () const
 
boost::shared_ptr
< RunPrincipal > const 
runPrincipal () const
 
void setLuminosityBlockAuxiliary (LuminosityBlockAuxiliary *lbp)
 
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 54 of file PoolSource.cc.

References begin, branchIDsToReplace_, relativeConstraints::empty, end, HDQMDatabaseProducer::fullList, i, edm::InEvent, edm::InLumi, edm::InRun, edm::NumBranchTypes, edm::InputSource::primary(), primaryFileSequence_, edm::ProductRegistry::productListUpdator(), edm::InputSource::productRegistryUpdate(), secondaryFileSequence_, and findQualityFiles::size.

54  :
55  VectorInputSource(pset, desc),
57  primaryFileSequence_(new RootInputFileSequence(pset, *this, catalog(), principalCache(),
60  new RootInputFileSequence(pset, *this, catalog(1), principalCache(), InputType::SecondaryFile)),
63  secondaryEventPrincipal_(secondaryFileSequence_ ? new EventPrincipal(secondaryFileSequence_->fileProductRegistry(), processConfiguration()) : 0),
67  assert(primary());
68  std::array<std::set<BranchID>, NumBranchTypes> idsToReplace;
69  ProductRegistry::ProductList const& secondary = secondaryFileSequence_->fileProductRegistry()->productList();
70  ProductRegistry::ProductList const& primary = primaryFileSequence_->fileProductRegistry()->productList();
71  typedef ProductRegistry::ProductList::const_iterator const_iterator;
72  typedef ProductRegistry::ProductList::iterator iterator;
73  //this is the registry used by the 'outside' world and only has the primary file information in it at present
75  for(const_iterator it = secondary.begin(), itEnd = secondary.end(); it != itEnd; ++it) {
76  if(it->second.present()) {
77  idsToReplace[it->second.branchType()].insert(it->second.branchID());
78  //now make sure this is marked as not dropped else the product will not be 'get'table from the Event
79  iterator itFound = fullList.find(it->first);
80  if(itFound != fullList.end()) {
81  itFound->second.dropped()=false;
82  }
83  }
84  }
85  for(const_iterator it = primary.begin(), itEnd = primary.end(); it != itEnd; ++it) {
86  if(it->second.present()) idsToReplace[it->second.branchType()].erase(it->second.branchID());
87  }
88  if(idsToReplace[InEvent].empty() && idsToReplace[InLumi].empty() && idsToReplace[InRun].empty()) {
89  secondaryFileSequence_.reset();
90  } else {
91  for(int i = InEvent; i < NumBranchTypes; ++i) {
92  branchIDsToReplace_[i].reserve(idsToReplace[i].size());
93  for(std::set<BranchID>::const_iterator it = idsToReplace[i].begin(), itEnd = idsToReplace[i].end();
94  it != itEnd; ++it) {
95  branchIDsToReplace_[i].push_back(*it);
96  }
97  }
98  }
99  }
100  }
int i
Definition: DBlmapReader.cc:9
std::map< BranchKey, BranchDescription > ProductList
std::unique_ptr< RootInputFileSequence > secondaryFileSequence_
Definition: PoolSource.h:65
boost::shared_ptr< RunPrincipal > secondaryRunPrincipal_
Definition: PoolSource.h:66
InputFileCatalog & catalog(int n=0)
Definition: EDInputSource.h:33
unsigned int numberOfEventsBeforeBigSkip_
Definition: PoolSource.h:73
std::unique_ptr< EventPrincipal > secondaryEventPrincipal_
Definition: PoolSource.h:68
#define end
Definition: vmac.h:38
VectorInputSource(ParameterSet const &pset, InputSourceDescription const &desc)
PrincipalCache const & principalCache() const
Definition: InputSource.h:312
ProductRegistry & productRegistryUpdate() const
Definition: InputSource.h:295
std::array< std::vector< BranchID >, NumBranchTypes > branchIDsToReplace_
Definition: PoolSource.h:69
ProductList & productListUpdator()
bool primary() const
Accessor for primary input source flag.
Definition: InputSource.h:187
std::unique_ptr< RootInputFileSequence > primaryFileSequence_
Definition: PoolSource.h:64
RootServiceChecker rootServiceChecker_
Definition: PoolSource.h:63
#define begin
Definition: vmac.h:31
boost::shared_ptr< LuminosityBlockPrincipal > secondaryLumiPrincipal_
Definition: PoolSource.h:67
ProcessConfiguration const & processConfiguration() const
Accessor for Process Configuration.
Definition: InputSource.h:184
tuple size
Write out results.
edm::PoolSource::~PoolSource ( )
virtual

Definition at line 102 of file PoolSource.cc.

102 {}

Member Function Documentation

void edm::PoolSource::closeFile_ ( )
privatevirtual

Reimplemented from edm::InputSource.

Definition at line 120 of file PoolSource.cc.

References primaryFileSequence_.

120  {
121  primaryFileSequence_->closeFile_();
122  }
std::unique_ptr< RootInputFileSequence > primaryFileSequence_
Definition: PoolSource.h:64
void edm::PoolSource::dropUnwantedBranches_ ( std::vector< std::string > const &  wantedBranches)
privatevirtual

Implements edm::VectorInputSource.

Definition at line 300 of file PoolSource.cc.

References primaryFileSequence_, and secondaryFileSequence_.

300  {
301  assert(!secondaryFileSequence_);
302  primaryFileSequence_->dropUnwantedBranches_(wantedBranches);
303  }
std::unique_ptr< RootInputFileSequence > secondaryFileSequence_
Definition: PoolSource.h:65
std::unique_ptr< RootInputFileSequence > primaryFileSequence_
Definition: PoolSource.h:64
void edm::PoolSource::endJob ( void  )
privatevirtual

Reimplemented from edm::InputSource.

Definition at line 105 of file PoolSource.cc.

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

105  {
107  primaryFileSequence_->endJob();
109  }
std::unique_ptr< RootInputFileSequence > secondaryFileSequence_
Definition: PoolSource.h:65
std::unique_ptr< RootInputFileSequence > primaryFileSequence_
Definition: PoolSource.h:64
static void reportReadBranches()
Definition: InputFile.cc:100
void edm::PoolSource::fillDescriptions ( ConfigurationDescriptions descriptions)
static

Definition at line 306 of file PoolSource.cc.

References edm::ConfigurationDescriptions::add(), edm::EDInputSource::fillDescription(), edm::RootInputFileSequence::fillDescription(), and edm::ParameterSetDescription::setComment().

306  {
307 
309 
310  desc.setComment("Reads EDM/Root files.");
313 
314  descriptions.add("source", desc);
315  }
static void fillDescription(ParameterSetDescription &desc)
static void fillDescription(ParameterSetDescription &desc)
ProcessingController::ForwardState edm::PoolSource::forwardState_ ( ) const
privatevirtual

Reimplemented from edm::InputSource.

Definition at line 323 of file PoolSource.cc.

References primaryFileSequence_.

323  {
324  return primaryFileSequence_->forwardState();
325  }
std::unique_ptr< RootInputFileSequence > primaryFileSequence_
Definition: PoolSource.h:64
InputSource::ItemType edm::PoolSource::getNextItemType ( )
privatevirtual

Implements edm::InputSource.

Definition at line 213 of file PoolSource.cc.

References edm::InputSource::decreaseRemainingEventsBy(), edm::InputSource::IsStop, numberOfEventsBeforeBigSkip_, or, primaryFileSequence_, edm::InputSource::principalCache(), receiver_, and edm::InputSource::remainingEvents().

213  {
214  if(receiver_ &&
216  receiver_->receive();
217  unsigned long toSkip = receiver_->numberToSkip();
218  if(0 != toSkip) {
219  primaryFileSequence_->skipEvents(toSkip, principalCache());
221  }
222  numberOfEventsBeforeBigSkip_ = receiver_->numberOfConsecutiveIndices();
224  return IsStop;
225  }
226  }
227  return primaryFileSequence_->getNextItemType();;
228  }
void decreaseRemainingEventsBy(int iSkipped)
Definition: InputSource.cc:482
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventIDconst &, edm::Timestampconst & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
int remainingEvents() const
Definition: InputSource.h:170
unsigned int numberOfEventsBeforeBigSkip_
Definition: PoolSource.h:73
PrincipalCache const & principalCache() const
Definition: InputSource.h:312
std::unique_ptr< RootInputFileSequence > primaryFileSequence_
Definition: PoolSource.h:64
boost::shared_ptr< edm::multicore::MessageReceiverForSource > receiver_
Definition: PoolSource.h:72
bool edm::PoolSource::goToEvent_ ( EventID const &  eventID)
privatevirtual

Reimplemented from edm::InputSource.

Definition at line 265 of file PoolSource.cc.

References primaryFileSequence_.

265  {
266  return primaryFileSequence_->goToEvent(eventID);
267  }
std::unique_ptr< RootInputFileSequence > primaryFileSequence_
Definition: PoolSource.h:64
void edm::PoolSource::postForkReacquireResources ( boost::shared_ptr< edm::multicore::MessageReceiverForSource iReceiver)
privatevirtual

Definition at line 236 of file PoolSource.cc.

References edm::InputSource::decreaseRemainingEventsBy(), primaryFileSequence_, edm::InputSource::principalCache(), receiver_, and edm::InputSource::rewind().

236  {
237  receiver_ = iReceiver;
238  receiver_->receive();
240  rewind();
241  decreaseRemainingEventsBy(receiver_->numberToSkip());
242  }
void decreaseRemainingEventsBy(int iSkipped)
Definition: InputSource.cc:482
PrincipalCache const & principalCache() const
Definition: InputSource.h:312
std::unique_ptr< RootInputFileSequence > primaryFileSequence_
Definition: PoolSource.h:64
boost::shared_ptr< edm::multicore::MessageReceiverForSource > receiver_
Definition: PoolSource.h:72
void rewind()
Begin again at the first event.
Definition: InputSource.cc:407
void edm::PoolSource::preForkReleaseResources ( )
privatevirtual

Reimplemented from edm::InputSource.

Definition at line 231 of file PoolSource.cc.

References primaryFileSequence_.

231  {
232  primaryFileSequence_->closeFile_();
233  }
std::unique_ptr< RootInputFileSequence > primaryFileSequence_
Definition: PoolSource.h:64
bool edm::PoolSource::randomAccess_ ( ) const
privatevirtual

Reimplemented from edm::InputSource.

Definition at line 318 of file PoolSource.cc.

318  {
319  return true;
320  }
EventPrincipal * edm::PoolSource::readEvent_ ( )
privatevirtual

Implements edm::InputSource.

Definition at line 180 of file PoolSource.cc.

References branchIDsToReplace_, relativeConstraints::empty, edm::EventID::event(), edm::InputSource::eventPrincipalCache(), edm::hlt::Exception, newFWLiteAna::found, edm::EventPrincipal::id(), edm::InEvent, edm::EventPrincipal::luminosityBlock(), edm::InputSource::luminosityBlockPrincipal(), edm::EventPrincipal::mergeMappers(), edm::errors::MismatchedInputFiles, numberOfEventsBeforeBigSkip_, primaryFileSequence_, receiver_, edm::Principal::recombine(), edm::EventPrincipal::run(), secondaryEventPrincipal_, secondaryFileSequence_, and secondaryLumiPrincipal_.

Referenced by readIt().

180  {
181  EventSourceSentry(*this);
182  EventPrincipal* primaryPrincipal = primaryFileSequence_->readEvent(*eventPrincipalCache(), luminosityBlockPrincipal());
184  bool found = secondaryFileSequence_->skipToItem(primaryPrincipal->run(),
185  primaryPrincipal->luminosityBlock(),
186  primaryPrincipal->id().event());
187  if(found) {
188  EventPrincipal* secondaryPrincipal = secondaryFileSequence_->readEvent(*secondaryEventPrincipal_, secondaryLumiPrincipal_);
189  checkConsistency(*primaryPrincipal, *secondaryPrincipal);
190  checkHistoryConsistency(*primaryPrincipal, *secondaryPrincipal);
191  primaryPrincipal->recombine(*secondaryPrincipal, branchIDsToReplace_[InEvent]);
192  primaryPrincipal->mergeMappers(*secondaryPrincipal);
193  secondaryEventPrincipal_->clearPrincipal();
194  } else {
195  throw Exception(errors::MismatchedInputFiles, "PoolSource::readEvent_") <<
196  primaryPrincipal->id() << " is not found in the secondary input files\n";
197  }
198  }
199  if(receiver_) {
201  }
202  return primaryPrincipal;
203  }
std::unique_ptr< RootInputFileSequence > secondaryFileSequence_
Definition: PoolSource.h:65
boost::shared_ptr< LuminosityBlockPrincipal > const luminosityBlockPrincipal() const
Definition: InputSource.cc:281
unsigned int numberOfEventsBeforeBigSkip_
Definition: PoolSource.h:73
std::unique_ptr< EventPrincipal > secondaryEventPrincipal_
Definition: PoolSource.h:68
std::array< std::vector< BranchID >, NumBranchTypes > branchIDsToReplace_
Definition: PoolSource.h:69
std::unique_ptr< RootInputFileSequence > primaryFileSequence_
Definition: PoolSource.h:64
boost::shared_ptr< edm::multicore::MessageReceiverForSource > receiver_
Definition: PoolSource.h:72
boost::shared_ptr< LuminosityBlockPrincipal > secondaryLumiPrincipal_
Definition: PoolSource.h:67
EventPrincipal * eventPrincipalCache()
Definition: InputSource.cc:139
boost::shared_ptr< FileBlock > edm::PoolSource::readFile_ ( )
privatevirtual

Reimplemented from edm::InputSource.

Definition at line 112 of file PoolSource.cc.

References benchmark_cfg::fb, edm::FileBlock::HasSecondaryFileSequence, primaryFileSequence_, edm::InputSource::principalCache(), and secondaryFileSequence_.

112  {
113  boost::shared_ptr<FileBlock> fb = primaryFileSequence_->readFile_(principalCache());
115  fb->setNotFastClonable(FileBlock::HasSecondaryFileSequence);
116  }
117  return fb;
118  }
std::unique_ptr< RootInputFileSequence > secondaryFileSequence_
Definition: PoolSource.h:65
PrincipalCache const & principalCache() const
Definition: InputSource.h:312
std::unique_ptr< RootInputFileSequence > primaryFileSequence_
Definition: PoolSource.h:64
EventPrincipal * edm::PoolSource::readIt ( EventID const &  id)
privatevirtual

Reimplemented from edm::InputSource.

Definition at line 206 of file PoolSource.cc.

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

206  {
207  bool found = primaryFileSequence_->skipToItem(id.run(), id.luminosityBlock(), id.event());
208  if(!found) return 0;
209  return readEvent_();
210  }
RunNumber_t run() const
Accessor for current run number.
Definition: InputSource.cc:606
virtual EventPrincipal * readEvent_()
Definition: PoolSource.cc:180
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:612
std::unique_ptr< RootInputFileSequence > primaryFileSequence_
Definition: PoolSource.h:64
boost::shared_ptr< LuminosityBlockPrincipal > edm::PoolSource::readLuminosityBlock_ ( boost::shared_ptr< LuminosityBlockPrincipal lbCache)
privatevirtual

Reimplemented from edm::InputSource.

Definition at line 157 of file PoolSource.cc.

References branchIDsToReplace_, relativeConstraints::empty, edm::hlt::Exception, newFWLiteAna::found, edm::InLumi, edm::errors::MismatchedInputFiles, primaryFileSequence_, edm::InputSource::processConfiguration(), secondaryFileSequence_, secondaryLumiPrincipal_, and secondaryRunPrincipal_.

157  {
159  boost::shared_ptr<LuminosityBlockPrincipal> primaryPrincipal = primaryFileSequence_->readLuminosityBlock_(lbCache);
160  bool found = secondaryFileSequence_->skipToItem(primaryPrincipal->run(), primaryPrincipal->luminosityBlock(), 0U);
161  if(found) {
162  boost::shared_ptr<LuminosityBlockAuxiliary> secondaryAuxiliary = secondaryFileSequence_->readLuminosityBlockAuxiliary_();
163  checkConsistency(primaryPrincipal->aux(), *secondaryAuxiliary);
164  boost::shared_ptr<LuminosityBlockPrincipal> lbp(new LuminosityBlockPrincipal(secondaryAuxiliary, secondaryFileSequence_->fileProductRegistry(), processConfiguration(), secondaryRunPrincipal_));
165  secondaryLumiPrincipal_ = secondaryFileSequence_->readLuminosityBlock_(lbp);
166  checkHistoryConsistency(*primaryPrincipal, *secondaryLumiPrincipal_);
167  primaryPrincipal->recombine(*secondaryLumiPrincipal_, branchIDsToReplace_[InLumi]);
168  } else {
169  throw Exception(errors::MismatchedInputFiles, "PoolSource::readLuminosityBlock_")
170  << " Run " << primaryPrincipal->run()
171  << " LuminosityBlock " << primaryPrincipal->luminosityBlock()
172  << " is not found in the secondary input files\n";
173  }
174  return primaryPrincipal;
175  }
176  return primaryFileSequence_->readLuminosityBlock_(lbCache);
177  }
std::unique_ptr< RootInputFileSequence > secondaryFileSequence_
Definition: PoolSource.h:65
boost::shared_ptr< RunPrincipal > secondaryRunPrincipal_
Definition: PoolSource.h:66
std::array< std::vector< BranchID >, NumBranchTypes > branchIDsToReplace_
Definition: PoolSource.h:69
std::unique_ptr< RootInputFileSequence > primaryFileSequence_
Definition: PoolSource.h:64
boost::shared_ptr< LuminosityBlockPrincipal > secondaryLumiPrincipal_
Definition: PoolSource.h:67
ProcessConfiguration const & processConfiguration() const
Accessor for Process Configuration.
Definition: InputSource.h:184
boost::shared_ptr< LuminosityBlockAuxiliary > edm::PoolSource::readLuminosityBlockAuxiliary_ ( )
privatevirtual

Implements edm::InputSource.

Definition at line 130 of file PoolSource.cc.

References primaryFileSequence_.

130  {
131  return primaryFileSequence_->readLuminosityBlockAuxiliary_();
132  }
std::unique_ptr< RootInputFileSequence > primaryFileSequence_
Definition: PoolSource.h:64
EventPrincipal * edm::PoolSource::readOneRandom ( )
privatevirtual

Implements edm::VectorInputSource.

Definition at line 270 of file PoolSource.cc.

References primaryFileSequence_, and secondaryFileSequence_.

270  {
271  assert(!secondaryFileSequence_);
272  return primaryFileSequence_->readOneRandom();
273  }
std::unique_ptr< RootInputFileSequence > secondaryFileSequence_
Definition: PoolSource.h:65
std::unique_ptr< RootInputFileSequence > primaryFileSequence_
Definition: PoolSource.h:64
EventPrincipal * edm::PoolSource::readOneRandomWithID ( LuminosityBlockID const &  lumiID)
privatevirtual

Implements edm::VectorInputSource.

Definition at line 276 of file PoolSource.cc.

References primaryFileSequence_, and secondaryFileSequence_.

276  {
277  assert(!secondaryFileSequence_);
278  return primaryFileSequence_->readOneRandomWithID(lumiID);
279  }
std::unique_ptr< RootInputFileSequence > secondaryFileSequence_
Definition: PoolSource.h:65
std::unique_ptr< RootInputFileSequence > primaryFileSequence_
Definition: PoolSource.h:64
EventPrincipal * edm::PoolSource::readOneSequential ( )
privatevirtual

Implements edm::VectorInputSource.

Definition at line 282 of file PoolSource.cc.

References primaryFileSequence_, and secondaryFileSequence_.

282  {
283  assert(!secondaryFileSequence_);
284  return primaryFileSequence_->readOneSequential();
285  }
std::unique_ptr< RootInputFileSequence > secondaryFileSequence_
Definition: PoolSource.h:65
std::unique_ptr< RootInputFileSequence > primaryFileSequence_
Definition: PoolSource.h:64
EventPrincipal * edm::PoolSource::readOneSequentialWithID ( LuminosityBlockID const &  lumiID)
privatevirtual

Implements edm::VectorInputSource.

Definition at line 288 of file PoolSource.cc.

References primaryFileSequence_, and secondaryFileSequence_.

288  {
289  assert(!secondaryFileSequence_);
290  return primaryFileSequence_->readOneSequentialWithID(lumiID);
291  }
std::unique_ptr< RootInputFileSequence > secondaryFileSequence_
Definition: PoolSource.h:65
std::unique_ptr< RootInputFileSequence > primaryFileSequence_
Definition: PoolSource.h:64
EventPrincipal * edm::PoolSource::readOneSpecified ( EventID const &  id)
privatevirtual

Implements edm::VectorInputSource.

Definition at line 294 of file PoolSource.cc.

References primaryFileSequence_, and secondaryFileSequence_.

294  {
295  assert(!secondaryFileSequence_);
296  return primaryFileSequence_->readOneSpecified(id);
297  }
std::unique_ptr< RootInputFileSequence > secondaryFileSequence_
Definition: PoolSource.h:65
std::unique_ptr< RootInputFileSequence > primaryFileSequence_
Definition: PoolSource.h:64
boost::shared_ptr< RunPrincipal > edm::PoolSource::readRun_ ( boost::shared_ptr< RunPrincipal rpCache)
privatevirtual

Reimplemented from edm::InputSource.

Definition at line 135 of file PoolSource.cc.

References branchIDsToReplace_, relativeConstraints::empty, edm::hlt::Exception, newFWLiteAna::found, edm::InRun, edm::errors::MismatchedInputFiles, primaryFileSequence_, edm::InputSource::processConfiguration(), secondaryFileSequence_, and secondaryRunPrincipal_.

135  {
137  boost::shared_ptr<RunPrincipal> primaryPrincipal = primaryFileSequence_->readRun_(rpCache);
138  bool found = secondaryFileSequence_->skipToItem(primaryPrincipal->run(), 0U, 0U);
139  if(found) {
140  boost::shared_ptr<RunAuxiliary> secondaryAuxiliary = secondaryFileSequence_->readRunAuxiliary_();
141  checkConsistency(primaryPrincipal->aux(), *secondaryAuxiliary);
142  boost::shared_ptr<RunPrincipal> rp(new RunPrincipal(secondaryAuxiliary, secondaryFileSequence_->fileProductRegistry(), processConfiguration()));
144  checkHistoryConsistency(*primaryPrincipal, *secondaryRunPrincipal_);
145  primaryPrincipal->recombine(*secondaryRunPrincipal_, branchIDsToReplace_[InRun]);
146  } else {
147  throw Exception(errors::MismatchedInputFiles, "PoolSource::readRun_")
148  << " Run " << primaryPrincipal->run()
149  << " is not found in the secondary input files\n";
150  }
151  return primaryPrincipal;
152  }
153  return primaryFileSequence_->readRun_(rpCache);
154  }
std::unique_ptr< RootInputFileSequence > secondaryFileSequence_
Definition: PoolSource.h:65
boost::shared_ptr< RunPrincipal > secondaryRunPrincipal_
Definition: PoolSource.h:66
std::array< std::vector< BranchID >, NumBranchTypes > branchIDsToReplace_
Definition: PoolSource.h:69
std::unique_ptr< RootInputFileSequence > primaryFileSequence_
Definition: PoolSource.h:64
ProcessConfiguration const & processConfiguration() const
Accessor for Process Configuration.
Definition: InputSource.h:184
boost::shared_ptr< RunAuxiliary > edm::PoolSource::readRunAuxiliary_ ( )
privatevirtual

Implements edm::InputSource.

Definition at line 125 of file PoolSource.cc.

References primaryFileSequence_.

125  {
126  return primaryFileSequence_->readRunAuxiliary_();
127  }
std::unique_ptr< RootInputFileSequence > primaryFileSequence_
Definition: PoolSource.h:64
ProcessingController::ReverseState edm::PoolSource::reverseState_ ( ) const
privatevirtual

Reimplemented from edm::InputSource.

Definition at line 328 of file PoolSource.cc.

References primaryFileSequence_.

328  {
329  return primaryFileSequence_->reverseState();
330  }
std::unique_ptr< RootInputFileSequence > primaryFileSequence_
Definition: PoolSource.h:64
void edm::PoolSource::rewind_ ( )
privatevirtual

Reimplemented from edm::InputSource.

Definition at line 246 of file PoolSource.cc.

References numberOfEventsBeforeBigSkip_, primaryFileSequence_, edm::InputSource::principalCache(), and receiver_.

246  {
247  primaryFileSequence_->rewind_();
248  if(receiver_) {
249  unsigned int numberToSkip = receiver_->numberToSkip();
250  if(0 != numberToSkip) {
251  primaryFileSequence_->skipEvents(numberToSkip, principalCache());
252  }
253  numberOfEventsBeforeBigSkip_ = receiver_->numberOfConsecutiveIndices();
254  }
255 
256  }
unsigned int numberOfEventsBeforeBigSkip_
Definition: PoolSource.h:73
PrincipalCache const & principalCache() const
Definition: InputSource.h:312
std::unique_ptr< RootInputFileSequence > primaryFileSequence_
Definition: PoolSource.h:64
boost::shared_ptr< edm::multicore::MessageReceiverForSource > receiver_
Definition: PoolSource.h:72
void edm::PoolSource::skip ( int  offset)
privatevirtual

Reimplemented from edm::InputSource.

Definition at line 260 of file PoolSource.cc.

References primaryFileSequence_, and edm::InputSource::principalCache().

260  {
262  }
unsigned int offset(bool)
PrincipalCache const & principalCache() const
Definition: InputSource.h:312
std::unique_ptr< RootInputFileSequence > primaryFileSequence_
Definition: PoolSource.h:64

Member Data Documentation

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

Definition at line 69 of file PoolSource.h.

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

unsigned int edm::PoolSource::numberOfEventsBeforeBigSkip_
private

Definition at line 73 of file PoolSource.h.

Referenced by getNextItemType(), readEvent_(), and rewind_().

std::unique_ptr<RootInputFileSequence> edm::PoolSource::primaryFileSequence_
private
boost::shared_ptr<edm::multicore::MessageReceiverForSource> edm::PoolSource::receiver_
private

Definition at line 72 of file PoolSource.h.

Referenced by getNextItemType(), postForkReacquireResources(), readEvent_(), and rewind_().

RootServiceChecker edm::PoolSource::rootServiceChecker_
private

Definition at line 63 of file PoolSource.h.

std::unique_ptr<EventPrincipal> edm::PoolSource::secondaryEventPrincipal_
private

Definition at line 68 of file PoolSource.h.

Referenced by readEvent_().

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

Definition at line 67 of file PoolSource.h.

Referenced by readEvent_(), and readLuminosityBlock_().

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

Definition at line 66 of file PoolSource.h.

Referenced by readLuminosityBlock_(), and readRun_().