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();
35 
36  static void fillDescriptions(ConfigurationDescriptions & descriptions);
37 
38  private:
39  virtual void readEvent_(EventPrincipal& eventPrincipal);
40  virtual boost::shared_ptr<LuminosityBlockAuxiliary> readLuminosityBlockAuxiliary_();
41  virtual void readLuminosityBlock_(LuminosityBlockPrincipal& lumiPrincipal);
42  virtual boost::shared_ptr<RunAuxiliary> readRunAuxiliary_();
43  virtual void readRun_(RunPrincipal& runPrincipal);
44  virtual std::unique_ptr<FileBlock> readFile_();
45  virtual void closeFile_();
46  virtual void endJob();
47  virtual ItemType getNextItemType();
48  virtual bool readIt(EventID const& id, EventPrincipal& eventPrincipal, StreamContext& streamContext) override;
49  virtual void skip(int offset);
50  virtual bool goToEvent_(EventID const& eventID);
51  virtual void rewind_();
52  virtual void readOneRandom(EventPrincipal& cache);
53  virtual bool readOneRandomWithID(EventPrincipal& cache, LuminosityBlockID const& lumiID);
54  virtual bool readOneSequential(EventPrincipal& cache);
55  virtual bool readOneSequentialWithID(EventPrincipal& cache, LuminosityBlockID const& lumiID);
56  virtual void readOneSpecified(EventPrincipal& cache, EventID const& id);
57  virtual void dropUnwantedBranches_(std::vector<std::string> const& wantedBranches);
58  virtual void preForkReleaseResources();
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::vector<std::unique_ptr<EventPrincipal>> secondaryEventPrincipals_;
69  std::array<std::vector<BranchID>, NumBranchTypes> branchIDsToReplace_;
70  }; // class PoolSource
72 }
73 #endif
virtual boost::shared_ptr< RunAuxiliary > readRunAuxiliary_()
Definition: PoolSource.cc:135
PoolSource(ParameterSet const &pset, InputSourceDescription const &desc)
Definition: PoolSource.cc:55
PoolSource PoolRASource
Definition: PoolSource.h:71
virtual std::unique_ptr< FileBlock > readFile_()
Definition: PoolSource.cc:122
virtual ProcessingController::ForwardState forwardState_() const
Definition: PoolSource.cc:316
virtual bool goToEvent_(EventID const &eventID)
Definition: PoolSource.cc:258
std::unique_ptr< RootInputFileSequence > secondaryFileSequence_
Definition: PoolSource.h:65
virtual void dropUnwantedBranches_(std::vector< std::string > const &wantedBranches)
Definition: PoolSource.cc:293
virtual bool randomAccess_() const
Definition: PoolSource.cc:311
virtual ProcessingController::ReverseState reverseState_() const
Definition: PoolSource.cc:321
boost::shared_ptr< RunPrincipal > secondaryRunPrincipal_
Definition: PoolSource.h:66
virtual ~PoolSource()
Definition: PoolSource.cc:112
unsigned int offset(bool)
virtual void readRun_(RunPrincipal &runPrincipal)
Definition: PoolSource.cc:145
static void fillDescriptions(ConfigurationDescriptions &descriptions)
Definition: PoolSource.cc:299
virtual void rewind_()
Definition: PoolSource.cc:247
virtual void readOneSpecified(EventPrincipal &cache, EventID const &id)
Definition: PoolSource.cc:287
ProductRegistry & productRegistryUpdate() const
Definition: InputSource.h:343
virtual bool readIt(EventID const &id, EventPrincipal &eventPrincipal, StreamContext &streamContext) override
Definition: PoolSource.cc:216
virtual void readEvent_(EventPrincipal &eventPrincipal)
Definition: PoolSource.cc:194
std::array< std::vector< BranchID >, NumBranchTypes > branchIDsToReplace_
Definition: PoolSource.h:69
virtual void endJob()
Definition: PoolSource.cc:115
std::unique_ptr< RootInputFileSequence > primaryFileSequence_
Definition: PoolSource.h:64
virtual void closeFile_()
Definition: PoolSource.cc:130
boost::shared_ptr< RunPrincipal > const runPrincipal() const
RootServiceChecker rootServiceChecker_
Definition: PoolSource.h:63
virtual bool readOneRandomWithID(EventPrincipal &cache, LuminosityBlockID const &lumiID)
Definition: PoolSource.cc:269
virtual ItemType getNextItemType()
Definition: PoolSource.cc:225
ProcessHistoryRegistry & processHistoryRegistryUpdate() const
Definition: InputSource.h:344
virtual void skip(int offset)
Definition: PoolSource.cc:253
virtual bool readOneSequentialWithID(EventPrincipal &cache, LuminosityBlockID const &lumiID)
Definition: PoolSource.cc:281
boost::shared_ptr< LuminosityBlockPrincipal > secondaryLumiPrincipal_
Definition: PoolSource.h:67
virtual void preForkReleaseResources()
Definition: PoolSource.cc:241
virtual void readOneRandom(EventPrincipal &cache)
Definition: PoolSource.cc:263
virtual bool readOneSequential(EventPrincipal &cache)
Definition: PoolSource.cc:275
std::vector< std::unique_ptr< EventPrincipal > > secondaryEventPrincipals_
Definition: PoolSource.h:68
virtual boost::shared_ptr< LuminosityBlockAuxiliary > readLuminosityBlockAuxiliary_()
Definition: PoolSource.cc:140
virtual void readLuminosityBlock_(LuminosityBlockPrincipal &lumiPrincipal)
Definition: PoolSource.cc:169