CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PoolSource.h
Go to the documentation of this file.
1 #ifndef IOPool_Input_PoolSource_h
2 #define IOPool_Input_PoolSource_h
3 
4 /*----------------------------------------------------------------------
5 
6 PoolSource: This is an InputSource
7 
8 ----------------------------------------------------------------------*/
9 
15 
16 #include "boost/shared_ptr.hpp"
17 
18 #include <array>
19 #include <memory>
20 #include <string>
21 #include <vector>
22 
23 namespace edm {
24 
26  class FileCatalogItem;
27  class RootInputFileSequence;
28 
29  class PoolSource : public VectorInputSource {
30  public:
31  explicit PoolSource(ParameterSet const& pset, InputSourceDescription const& desc);
32  virtual ~PoolSource();
34 
35  static void fillDescriptions(ConfigurationDescriptions & descriptions);
36 
37  private:
38  virtual EventPrincipal* readEvent_();
39  virtual boost::shared_ptr<LuminosityBlockAuxiliary> readLuminosityBlockAuxiliary_();
40  virtual boost::shared_ptr<LuminosityBlockPrincipal> readLuminosityBlock_(boost::shared_ptr<LuminosityBlockPrincipal> lbCache);
41  virtual boost::shared_ptr<RunAuxiliary> readRunAuxiliary_();
42  virtual boost::shared_ptr<RunPrincipal> readRun_(boost::shared_ptr<RunPrincipal> rpCache);
43  virtual boost::shared_ptr<FileBlock> readFile_();
44  virtual void closeFile_();
45  virtual void endJob();
46  virtual ItemType getNextItemType();
47  virtual EventPrincipal* readIt(EventID const& id);
48  virtual void skip(int offset);
49  virtual bool goToEvent_(EventID const& eventID);
50  virtual void rewind_();
51  virtual EventPrincipal* readOneRandom();
55  virtual EventPrincipal* readOneSpecified(EventID const& id);
56  virtual void dropUnwantedBranches_(std::vector<std::string> const& wantedBranches);
57  virtual void preForkReleaseResources();
58  virtual void postForkReacquireResources(boost::shared_ptr<edm::multicore::MessageReceiverForSource>);
59  virtual bool randomAccess_() const;
62 
64  std::unique_ptr<RootInputFileSequence> primaryFileSequence_;
65  std::unique_ptr<RootInputFileSequence> secondaryFileSequence_;
66  boost::shared_ptr<RunPrincipal> secondaryRunPrincipal_;
67  boost::shared_ptr<LuminosityBlockPrincipal> secondaryLumiPrincipal_;
68  std::unique_ptr<EventPrincipal> secondaryEventPrincipal_;
69  std::array<std::vector<BranchID>, NumBranchTypes> branchIDsToReplace_;
70 
71  //used when process has been forked
72  boost::shared_ptr<edm::multicore::MessageReceiverForSource> receiver_;
74 
75  }; // class PoolSource
77 }
78 #endif
virtual boost::shared_ptr< RunAuxiliary > readRunAuxiliary_()
Definition: PoolSource.cc:125
PoolSource(ParameterSet const &pset, InputSourceDescription const &desc)
Definition: PoolSource.cc:54
PoolSource PoolRASource
Definition: PoolSource.h:76
virtual ProcessingController::ForwardState forwardState_() const
Definition: PoolSource.cc:323
virtual boost::shared_ptr< LuminosityBlockPrincipal > readLuminosityBlock_(boost::shared_ptr< LuminosityBlockPrincipal > lbCache)
Definition: PoolSource.cc:157
virtual bool goToEvent_(EventID const &eventID)
Definition: PoolSource.cc:265
virtual boost::shared_ptr< RunPrincipal > readRun_(boost::shared_ptr< RunPrincipal > rpCache)
Definition: PoolSource.cc:135
std::unique_ptr< RootInputFileSequence > secondaryFileSequence_
Definition: PoolSource.h:65
virtual EventPrincipal * readOneRandomWithID(LuminosityBlockID const &lumiID)
Definition: PoolSource.cc:276
virtual void dropUnwantedBranches_(std::vector< std::string > const &wantedBranches)
Definition: PoolSource.cc:300
virtual bool randomAccess_() const
Definition: PoolSource.cc:318
virtual ProcessingController::ReverseState reverseState_() const
Definition: PoolSource.cc:328
virtual EventPrincipal * readOneRandom()
Definition: PoolSource.cc:270
boost::shared_ptr< RunPrincipal > secondaryRunPrincipal_
Definition: PoolSource.h:66
virtual EventPrincipal * readOneSequential()
Definition: PoolSource.cc:282
unsigned int numberOfEventsBeforeBigSkip_
Definition: PoolSource.h:73
virtual EventPrincipal * readEvent_()
Definition: PoolSource.cc:180
virtual ~PoolSource()
Definition: PoolSource.cc:102
std::unique_ptr< EventPrincipal > secondaryEventPrincipal_
Definition: PoolSource.h:68
unsigned int offset(bool)
static void fillDescriptions(ConfigurationDescriptions &descriptions)
Definition: PoolSource.cc:306
virtual void postForkReacquireResources(boost::shared_ptr< edm::multicore::MessageReceiverForSource >)
Definition: PoolSource.cc:236
virtual void rewind_()
Definition: PoolSource.cc:246
ProductRegistry & productRegistryUpdate() const
Definition: InputSource.h:295
std::array< std::vector< BranchID >, NumBranchTypes > branchIDsToReplace_
Definition: PoolSource.h:69
virtual void endJob()
Definition: PoolSource.cc:105
virtual EventPrincipal * readOneSequentialWithID(LuminosityBlockID const &lumiID)
Definition: PoolSource.cc:288
std::unique_ptr< RootInputFileSequence > primaryFileSequence_
Definition: PoolSource.h:64
virtual void closeFile_()
Definition: PoolSource.cc:120
RootServiceChecker rootServiceChecker_
Definition: PoolSource.h:63
virtual EventPrincipal * readOneSpecified(EventID const &id)
Definition: PoolSource.cc:294
boost::shared_ptr< edm::multicore::MessageReceiverForSource > receiver_
Definition: PoolSource.h:72
virtual ItemType getNextItemType()
Definition: PoolSource.cc:213
virtual void skip(int offset)
Definition: PoolSource.cc:260
boost::shared_ptr< LuminosityBlockPrincipal > secondaryLumiPrincipal_
Definition: PoolSource.h:67
virtual void preForkReleaseResources()
Definition: PoolSource.cc:231
virtual boost::shared_ptr< FileBlock > readFile_()
Definition: PoolSource.cc:112
virtual EventPrincipal * readIt(EventID const &id)
Definition: PoolSource.cc:206
virtual boost::shared_ptr< LuminosityBlockAuxiliary > readLuminosityBlockAuxiliary_()
Definition: PoolSource.cc:130