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 Types | 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 Types

typedef input::EntryNumber EntryNumber
 
typedef boost::shared_ptr
< RootFile
RootFileSharedPtr
 

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 31 of file PoolSource.h.

Member Typedef Documentation

Definition at line 41 of file PoolSource.h.

typedef boost::shared_ptr<RootFile> edm::PoolSource::RootFileSharedPtr
private

Definition at line 40 of file PoolSource.h.

Constructor & Destructor Documentation

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

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

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

Definition at line 101 of file PoolSource.cc.

101 {}

Member Function Documentation

void edm::PoolSource::closeFile_ ( )
privatevirtual

Reimplemented from edm::InputSource.

Definition at line 118 of file PoolSource.cc.

References primaryFileSequence_.

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

Implements edm::VectorInputSource.

Definition at line 291 of file PoolSource.cc.

References primaryFileSequence_, and secondaryFileSequence_.

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

Reimplemented from edm::InputSource.

Definition at line 104 of file PoolSource.cc.

References primaryFileSequence_, and secondaryFileSequence_.

104  {
106  primaryFileSequence_->endJob();
107  }
boost::scoped_ptr< RootInputFileSequence > primaryFileSequence_
Definition: PoolSource.h:67
boost::scoped_ptr< RootInputFileSequence > secondaryFileSequence_
Definition: PoolSource.h:68
void edm::PoolSource::fillDescriptions ( ConfigurationDescriptions descriptions)
static

Definition at line 297 of file PoolSource.cc.

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

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

Reimplemented from edm::InputSource.

Definition at line 314 of file PoolSource.cc.

References primaryFileSequence_.

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

Implements edm::InputSource.

Definition at line 210 of file PoolSource.cc.

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

210  {
211  if(receiver_ &&
213  receiver_->receive();
214  unsigned long toSkip = receiver_->numberToSkip();
215  if (0 != toSkip) {
216  primaryFileSequence_->skipEvents(toSkip, principalCache());
218  }
219  numberOfEventsBeforeBigSkip_ = receiver_->numberOfConsecutiveIndices();
221  return IsStop;
222  }
223  }
224  return primaryFileSequence_->getNextItemType();;
225  }
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:76
PrincipalCache const & principalCache() const
Definition: InputSource.h:316
boost::scoped_ptr< RootInputFileSequence > primaryFileSequence_
Definition: PoolSource.h:67
boost::shared_ptr< edm::multicore::MessageReceiverForSource > receiver_
Definition: PoolSource.h:75
bool edm::PoolSource::goToEvent_ ( EventID const &  eventID)
privatevirtual

Reimplemented from edm::InputSource.

Definition at line 262 of file PoolSource.cc.

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

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

Definition at line 233 of file PoolSource.cc.

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

233  {
234  receiver_ = iReceiver;
235  receiver_->receive();
237  rewind();
238  decreaseRemainingEventsBy(receiver_->numberToSkip());
239  }
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:67
boost::shared_ptr< edm::multicore::MessageReceiverForSource > receiver_
Definition: PoolSource.h:75
void edm::PoolSource::preForkReleaseResources ( )
privatevirtual

Reimplemented from edm::InputSource.

Definition at line 228 of file PoolSource.cc.

References primaryFileSequence_.

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

Reimplemented from edm::InputSource.

Definition at line 309 of file PoolSource.cc.

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

Implements edm::InputSource.

Definition at line 178 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().

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

Reimplemented from edm::InputSource.

Definition at line 110 of file PoolSource.cc.

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

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

Reimplemented from edm::InputSource.

Definition at line 203 of file PoolSource.cc.

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

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

Reimplemented from edm::InputSource.

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

155  {
157  boost::shared_ptr<LuminosityBlockPrincipal> primaryPrincipal = primaryFileSequence_->readLuminosityBlock_(lbCache);
158  bool found = secondaryFileSequence_->skipToItem(primaryPrincipal->run(), primaryPrincipal->luminosityBlock(), 0U);
159  if (found) {
160  boost::shared_ptr<LuminosityBlockAuxiliary> secondaryAuxiliary = secondaryFileSequence_->readLuminosityBlockAuxiliary_();
161  checkConsistency(primaryPrincipal->aux(), *secondaryAuxiliary);
162  boost::shared_ptr<LuminosityBlockPrincipal> lbp(new LuminosityBlockPrincipal(secondaryAuxiliary, secondaryFileSequence_->fileProductRegistry(), processConfiguration(), secondaryRunPrincipal_));
163  secondaryLumiPrincipal_ = secondaryFileSequence_->readLuminosityBlock_(lbp);
164  checkHistoryConsistency(*primaryPrincipal, *secondaryLumiPrincipal_);
165  primaryPrincipal->recombine(*secondaryLumiPrincipal_, branchIDsToReplace_[InLumi]);
166  } else {
167  throw Exception(errors::MismatchedInputFiles, "PoolSource::readLuminosityBlock_")
168  << " Run " << primaryPrincipal->run()
169  << " LuminosityBlock " << primaryPrincipal->luminosityBlock()
170  << " is not found in the secondary input files\n";
171  }
172  return primaryPrincipal;
173  }
174  return primaryFileSequence_->readLuminosityBlock_(lbCache);
175  }
boost::shared_ptr< RunPrincipal > secondaryRunPrincipal_
Definition: PoolSource.h:69
boost::array< std::vector< BranchID >, NumBranchTypes > branchIDsToReplace_
Definition: PoolSource.h:72
boost::scoped_ptr< RootInputFileSequence > primaryFileSequence_
Definition: PoolSource.h:67
boost::shared_ptr< LuminosityBlockPrincipal > secondaryLumiPrincipal_
Definition: PoolSource.h:70
boost::scoped_ptr< RootInputFileSequence > secondaryFileSequence_
Definition: PoolSource.h:68
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 128 of file PoolSource.cc.

References primaryFileSequence_.

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

Implements edm::VectorInputSource.

Definition at line 267 of file PoolSource.cc.

References primaryFileSequence_, and secondaryFileSequence_.

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

Implements edm::VectorInputSource.

Definition at line 273 of file PoolSource.cc.

References primaryFileSequence_, and secondaryFileSequence_.

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

Implements edm::VectorInputSource.

Definition at line 279 of file PoolSource.cc.

References primaryFileSequence_, and secondaryFileSequence_.

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

Implements edm::VectorInputSource.

Definition at line 285 of file PoolSource.cc.

References primaryFileSequence_, and secondaryFileSequence_.

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

Reimplemented from edm::InputSource.

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

133  {
135  boost::shared_ptr<RunPrincipal> primaryPrincipal = primaryFileSequence_->readRun_(rpCache);
136  bool found = secondaryFileSequence_->skipToItem(primaryPrincipal->run(), 0U, 0U);
137  if (found) {
138  boost::shared_ptr<RunAuxiliary> secondaryAuxiliary = secondaryFileSequence_->readRunAuxiliary_();
139  checkConsistency(primaryPrincipal->aux(), *secondaryAuxiliary);
140  boost::shared_ptr<RunPrincipal> rp(new RunPrincipal(secondaryAuxiliary, secondaryFileSequence_->fileProductRegistry(), processConfiguration()));
142  checkHistoryConsistency(*primaryPrincipal, *secondaryRunPrincipal_);
143  primaryPrincipal->recombine(*secondaryRunPrincipal_, branchIDsToReplace_[InRun]);
144  } else {
145  throw Exception(errors::MismatchedInputFiles, "PoolSource::readRun_")
146  << " Run " << primaryPrincipal->run()
147  << " is not found in the secondary input files\n";
148  }
149  return primaryPrincipal;
150  }
151  return primaryFileSequence_->readRun_(rpCache);
152  }
boost::shared_ptr< RunPrincipal > secondaryRunPrincipal_
Definition: PoolSource.h:69
boost::array< std::vector< BranchID >, NumBranchTypes > branchIDsToReplace_
Definition: PoolSource.h:72
boost::scoped_ptr< RootInputFileSequence > primaryFileSequence_
Definition: PoolSource.h:67
boost::scoped_ptr< RootInputFileSequence > secondaryFileSequence_
Definition: PoolSource.h:68
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 123 of file PoolSource.cc.

References primaryFileSequence_.

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

Reimplemented from edm::InputSource.

Definition at line 319 of file PoolSource.cc.

References primaryFileSequence_.

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

Reimplemented from edm::InputSource.

Definition at line 243 of file PoolSource.cc.

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

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

Reimplemented from edm::InputSource.

Definition at line 257 of file PoolSource.cc.

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

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

Member Data Documentation

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

Definition at line 72 of file PoolSource.h.

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

unsigned int edm::PoolSource::numberOfEventsBeforeBigSkip_
private

Definition at line 76 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 75 of file PoolSource.h.

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

RootServiceChecker edm::PoolSource::rootServiceChecker_
private

Definition at line 66 of file PoolSource.h.

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

Definition at line 71 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 70 of file PoolSource.h.

Referenced by readEvent_(), and readLuminosityBlock_().

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

Definition at line 69 of file PoolSource.h.

Referenced by readLuminosityBlock_(), and readRun_().