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)
 
void readMany (int number, EventPrincipalVector &result)
 
void readManyRandom (int number, EventPrincipalVector &result, unsigned int &fileSeqNumber)
 
void readManySequential (int number, EventPrincipalVector &result, unsigned int &fileSeqNumber)
 
void readManySpecified (std::vector< EventID > const &events, EventPrincipalVector &result)
 
 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 >)
 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)
 Called by framework at end of lumi block. More...
 
void doEndRun (RunPrincipal &rp)
 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 const 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...
 
ProcessHistoryID const & processHistoryID () const
 Accessor for the input process history ID of the current run. 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 ()
 Read next luminosity block. More...
 
void readAndCacheRun ()
 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...
 
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...
 
void wakeUp ()
 Wake up 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)
 

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 void readMany_ (int number, EventPrincipalVector &result)
 
virtual void readManyRandom_ (int number, EventPrincipalVector &result, unsigned int &fileSeqNumber)
 
virtual void readManySequential_ (int number, EventPrincipalVector &result, unsigned int &fileSeqNumber)
 
virtual void readManySpecified_ (std::vector< EventID > const &events, EventPrincipalVector &result)
 
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

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

Additional Inherited Members

- Public Types inherited from edm::VectorInputSource
typedef std::vector
< EventPrincipalVectorElement
EventPrincipalVector
 
typedef boost::shared_ptr
< EventPrincipal
EventPrincipalVectorElement
 
- 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)
 
EventPrincipal *const eventPrincipalCache ()
 
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 setLumiPrematurelyRead ()
 
void setRunAuxiliary (RunAuxiliary *rp)
 
void setRunPrematurelyRead ()
 
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 52 of file PoolSource.cc.

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

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

Definition at line 100 of file PoolSource.cc.

100 {}

Member Function Documentation

void edm::PoolSource::closeFile_ ( )
privatevirtual

Reimplemented from edm::InputSource.

Definition at line 117 of file PoolSource.cc.

References primaryFileSequence_.

117  {
118  primaryFileSequence_->closeFile_();
119  }
boost::scoped_ptr< RootInputFileSequence > primaryFileSequence_
Definition: PoolSource.h:63
void edm::PoolSource::dropUnwantedBranches_ ( std::vector< std::string > const &  wantedBranches)
privatevirtual

Implements edm::VectorInputSource.

Definition at line 290 of file PoolSource.cc.

References primaryFileSequence_, and secondaryFileSequence_.

290  {
291  assert (!secondaryFileSequence_);
292  primaryFileSequence_->dropUnwantedBranches_(wantedBranches);
293  }
boost::scoped_ptr< RootInputFileSequence > primaryFileSequence_
Definition: PoolSource.h:63
boost::scoped_ptr< RootInputFileSequence > secondaryFileSequence_
Definition: PoolSource.h:64
void edm::PoolSource::endJob ( void  )
privatevirtual

Reimplemented from edm::InputSource.

Definition at line 103 of file PoolSource.cc.

References primaryFileSequence_, and secondaryFileSequence_.

103  {
105  primaryFileSequence_->endJob();
106  }
boost::scoped_ptr< RootInputFileSequence > primaryFileSequence_
Definition: PoolSource.h:63
boost::scoped_ptr< RootInputFileSequence > secondaryFileSequence_
Definition: PoolSource.h:64
void edm::PoolSource::fillDescriptions ( ConfigurationDescriptions descriptions)
static

Definition at line 296 of file PoolSource.cc.

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

296  {
297 
299 
300  desc.setComment("Reads EDM/Root files.");
303 
304  descriptions.add("source", desc);
305  }
static void fillDescription(ParameterSetDescription &desc)
static void fillDescription(ParameterSetDescription &desc)
ProcessingController::ForwardState edm::PoolSource::forwardState_ ( ) const
privatevirtual

Reimplemented from edm::InputSource.

Definition at line 313 of file PoolSource.cc.

References primaryFileSequence_.

313  {
314  return primaryFileSequence_->forwardState();
315  }
boost::scoped_ptr< RootInputFileSequence > primaryFileSequence_
Definition: PoolSource.h:63
InputSource::ItemType edm::PoolSource::getNextItemType ( )
privatevirtual

Implements edm::InputSource.

Definition at line 209 of file PoolSource.cc.

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

209  {
210  if(receiver_ &&
212  receiver_->receive();
213  unsigned long toSkip = receiver_->numberToSkip();
214  if (0 != toSkip) {
215  primaryFileSequence_->skipEvents(toSkip, principalCache());
217  }
218  numberOfEventsBeforeBigSkip_ = receiver_->numberOfConsecutiveIndices();
220  return IsStop;
221  }
222  }
223  return primaryFileSequence_->getNextItemType();;
224  }
void decreaseRemainingEventsBy(int iSkipped)
Definition: InputSource.cc:472
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:176
unsigned int numberOfEventsBeforeBigSkip_
Definition: PoolSource.h:72
PrincipalCache const & principalCache() const
Definition: InputSource.h:316
boost::scoped_ptr< RootInputFileSequence > primaryFileSequence_
Definition: PoolSource.h:63
boost::shared_ptr< edm::multicore::MessageReceiverForSource > receiver_
Definition: PoolSource.h:71
bool edm::PoolSource::goToEvent_ ( EventID const &  eventID)
privatevirtual

Reimplemented from edm::InputSource.

Definition at line 261 of file PoolSource.cc.

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

261  {
262  return primaryFileSequence_->goToEvent(eventID, principalCache());
263  }
PrincipalCache const & principalCache() const
Definition: InputSource.h:316
boost::scoped_ptr< RootInputFileSequence > primaryFileSequence_
Definition: PoolSource.h:63
void edm::PoolSource::postForkReacquireResources ( boost::shared_ptr< edm::multicore::MessageReceiverForSource iReceiver)
privatevirtual

Definition at line 232 of file PoolSource.cc.

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

232  {
233  receiver_ = iReceiver;
234  receiver_->receive();
236  rewind();
237  decreaseRemainingEventsBy(receiver_->numberToSkip());
238  }
void decreaseRemainingEventsBy(int iSkipped)
Definition: InputSource.cc:472
void rewind()
Begin again at the first event.
Definition: InputSource.h:138
PrincipalCache const & principalCache() const
Definition: InputSource.h:316
boost::scoped_ptr< RootInputFileSequence > primaryFileSequence_
Definition: PoolSource.h:63
boost::shared_ptr< edm::multicore::MessageReceiverForSource > receiver_
Definition: PoolSource.h:71
void edm::PoolSource::preForkReleaseResources ( )
privatevirtual

Reimplemented from edm::InputSource.

Definition at line 227 of file PoolSource.cc.

References primaryFileSequence_.

227  {
228  primaryFileSequence_->closeFile_();
229  }
boost::scoped_ptr< RootInputFileSequence > primaryFileSequence_
Definition: PoolSource.h:63
bool edm::PoolSource::randomAccess_ ( ) const
privatevirtual

Reimplemented from edm::InputSource.

Definition at line 308 of file PoolSource.cc.

308  {
309  return true;
310  }
EventPrincipal * edm::PoolSource::readEvent_ ( )
privatevirtual

Implements edm::InputSource.

Definition at line 177 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::errors::MismatchedInputFiles, numberOfEventsBeforeBigSkip_, primaryFileSequence_, receiver_, edm::Principal::recombine(), edm::EventPrincipal::run(), secondaryEventPrincipal_, secondaryFileSequence_, and secondaryLumiPrincipal_.

Referenced by readIt().

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

Reimplemented from edm::InputSource.

Definition at line 109 of file PoolSource.cc.

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

109  {
110  boost::shared_ptr<FileBlock> fb = primaryFileSequence_->readFile_(principalCache());
112  fb->setNotFastClonable(FileBlock::HasSecondaryFileSequence);
113  }
114  return fb;
115  }
PrincipalCache const & principalCache() const
Definition: InputSource.h:316
boost::scoped_ptr< RootInputFileSequence > primaryFileSequence_
Definition: PoolSource.h:63
boost::scoped_ptr< RootInputFileSequence > secondaryFileSequence_
Definition: PoolSource.h:64
EventPrincipal * edm::PoolSource::readIt ( EventID const &  id)
privatevirtual

Reimplemented from edm::InputSource.

Definition at line 202 of file PoolSource.cc.

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

202  {
203  bool found = primaryFileSequence_->skipToItem(id.run(), id.luminosityBlock(), id.event());
204  if (!found) return 0;
205  return readEvent_();
206  }
RunNumber_t run() const
Accessor for current run number.
Definition: InputSource.cc:582
virtual EventPrincipal * readEvent_()
Definition: PoolSource.cc:177
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:588
boost::scoped_ptr< RootInputFileSequence > primaryFileSequence_
Definition: PoolSource.h:63
boost::shared_ptr< LuminosityBlockPrincipal > edm::PoolSource::readLuminosityBlock_ ( boost::shared_ptr< LuminosityBlockPrincipal lbCache)
privatevirtual

Reimplemented from edm::InputSource.

Definition at line 154 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_.

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

Implements edm::InputSource.

Definition at line 127 of file PoolSource.cc.

References primaryFileSequence_.

127  {
128  return primaryFileSequence_->readLuminosityBlockAuxiliary_();
129  }
boost::scoped_ptr< RootInputFileSequence > primaryFileSequence_
Definition: PoolSource.h:63
void edm::PoolSource::readMany_ ( int  number,
EventPrincipalVector result 
)
privatevirtual

Implements edm::VectorInputSource.

Definition at line 266 of file PoolSource.cc.

References primaryFileSequence_, and secondaryFileSequence_.

266  {
267  assert (!secondaryFileSequence_);
268  primaryFileSequence_->readMany(number, result);
269  }
tuple result
Definition: query.py:137
boost::scoped_ptr< RootInputFileSequence > primaryFileSequence_
Definition: PoolSource.h:63
boost::scoped_ptr< RootInputFileSequence > secondaryFileSequence_
Definition: PoolSource.h:64
void edm::PoolSource::readManyRandom_ ( int  number,
EventPrincipalVector result,
unsigned int &  fileSeqNumber 
)
privatevirtual

Implements edm::VectorInputSource.

Definition at line 272 of file PoolSource.cc.

References primaryFileSequence_, and secondaryFileSequence_.

272  {
273  assert (!secondaryFileSequence_);
274  primaryFileSequence_->readManyRandom(number, result, fileSeqNumber);
275  }
tuple result
Definition: query.py:137
boost::scoped_ptr< RootInputFileSequence > primaryFileSequence_
Definition: PoolSource.h:63
boost::scoped_ptr< RootInputFileSequence > secondaryFileSequence_
Definition: PoolSource.h:64
void edm::PoolSource::readManySequential_ ( int  number,
EventPrincipalVector result,
unsigned int &  fileSeqNumber 
)
privatevirtual

Implements edm::VectorInputSource.

Definition at line 278 of file PoolSource.cc.

References primaryFileSequence_, and secondaryFileSequence_.

278  {
279  assert (!secondaryFileSequence_);
280  primaryFileSequence_->readManySequential(number, result, fileSeqNumber);
281  }
tuple result
Definition: query.py:137
boost::scoped_ptr< RootInputFileSequence > primaryFileSequence_
Definition: PoolSource.h:63
boost::scoped_ptr< RootInputFileSequence > secondaryFileSequence_
Definition: PoolSource.h:64
void edm::PoolSource::readManySpecified_ ( std::vector< EventID > const &  events,
EventPrincipalVector result 
)
privatevirtual

Implements edm::VectorInputSource.

Definition at line 284 of file PoolSource.cc.

References primaryFileSequence_, and secondaryFileSequence_.

284  {
285  assert (!secondaryFileSequence_);
286  primaryFileSequence_->readManySpecified(events, result);
287  }
tuple result
Definition: query.py:137
boost::scoped_ptr< RootInputFileSequence > primaryFileSequence_
Definition: PoolSource.h:63
tuple events
Definition: patZpeak.py:19
boost::scoped_ptr< RootInputFileSequence > secondaryFileSequence_
Definition: PoolSource.h:64
boost::shared_ptr< RunPrincipal > edm::PoolSource::readRun_ ( boost::shared_ptr< RunPrincipal rpCache)
privatevirtual

Reimplemented from edm::InputSource.

Definition at line 132 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_.

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

Implements edm::InputSource.

Definition at line 122 of file PoolSource.cc.

References primaryFileSequence_.

122  {
123  return primaryFileSequence_->readRunAuxiliary_();
124  }
boost::scoped_ptr< RootInputFileSequence > primaryFileSequence_
Definition: PoolSource.h:63
ProcessingController::ReverseState edm::PoolSource::reverseState_ ( ) const
privatevirtual

Reimplemented from edm::InputSource.

Definition at line 318 of file PoolSource.cc.

References primaryFileSequence_.

318  {
319  return primaryFileSequence_->reverseState();
320  }
boost::scoped_ptr< RootInputFileSequence > primaryFileSequence_
Definition: PoolSource.h:63
void edm::PoolSource::rewind_ ( )
privatevirtual

Reimplemented from edm::InputSource.

Definition at line 242 of file PoolSource.cc.

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

242  {
243  primaryFileSequence_->rewind_();
244  if (receiver_) {
245  unsigned int numberToSkip = receiver_->numberToSkip();
246  if(0 != numberToSkip) {
247  primaryFileSequence_->skipEvents(numberToSkip, principalCache());
248  }
249  numberOfEventsBeforeBigSkip_ = receiver_->numberOfConsecutiveIndices();
250  }
251 
252  }
unsigned int numberOfEventsBeforeBigSkip_
Definition: PoolSource.h:72
PrincipalCache const & principalCache() const
Definition: InputSource.h:316
boost::scoped_ptr< RootInputFileSequence > primaryFileSequence_
Definition: PoolSource.h:63
boost::shared_ptr< edm::multicore::MessageReceiverForSource > receiver_
Definition: PoolSource.h:71
void edm::PoolSource::skip ( int  offset)
privatevirtual

Reimplemented from edm::InputSource.

Definition at line 256 of file PoolSource.cc.

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

256  {
258  }
unsigned int offset(bool)
PrincipalCache const & principalCache() const
Definition: InputSource.h:316
boost::scoped_ptr< RootInputFileSequence > primaryFileSequence_
Definition: PoolSource.h:63

Member Data Documentation

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

Definition at line 68 of file PoolSource.h.

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

unsigned int edm::PoolSource::numberOfEventsBeforeBigSkip_
private

Definition at line 72 of file PoolSource.h.

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

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

Definition at line 71 of file PoolSource.h.

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

RootServiceChecker edm::PoolSource::rootServiceChecker_
private

Definition at line 62 of file PoolSource.h.

boost::scoped_ptr<EventPrincipal> edm::PoolSource::secondaryEventPrincipal_
private

Definition at line 67 of file PoolSource.h.

Referenced by readEvent_().

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

Definition at line 66 of file PoolSource.h.

Referenced by readEvent_(), and readLuminosityBlock_().

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

Definition at line 65 of file PoolSource.h.

Referenced by readLuminosityBlock_(), and readRun_().