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 CLHEP {
24  class HepRandomEngine;
25 }
26 
27 namespace edm {
28 
30  class FileCatalogItem;
31  class RootInputFileSequence;
32 
33  class PoolSource : public VectorInputSource {
34  public:
35  explicit PoolSource(ParameterSet const& pset, InputSourceDescription const& desc);
36  virtual ~PoolSource();
39 
40  static void fillDescriptions(ConfigurationDescriptions & descriptions);
41 
42  private:
43  virtual void readEvent_(EventPrincipal& eventPrincipal);
44  virtual boost::shared_ptr<LuminosityBlockAuxiliary> readLuminosityBlockAuxiliary_();
45  virtual void readLuminosityBlock_(LuminosityBlockPrincipal& lumiPrincipal);
46  virtual boost::shared_ptr<RunAuxiliary> readRunAuxiliary_();
47  virtual void readRun_(RunPrincipal& runPrincipal);
48  virtual std::unique_ptr<FileBlock> readFile_();
49  virtual void closeFile_();
50  virtual void endJob();
51  virtual ItemType getNextItemType();
52  virtual bool readIt(EventID const& id, EventPrincipal& eventPrincipal, StreamContext& streamContext) override;
53  virtual void skip(int offset);
54  virtual bool goToEvent_(EventID const& eventID);
55  virtual void rewind_();
56  virtual void readOneRandom(EventPrincipal& cache, CLHEP::HepRandomEngine*) override;
57  virtual bool readOneRandomWithID(EventPrincipal& cache, LuminosityBlockID const& lumiID, CLHEP::HepRandomEngine*) override;
58  virtual bool readOneSequential(EventPrincipal& cache);
59  virtual bool readOneSequentialWithID(EventPrincipal& cache, LuminosityBlockID const& lumiID);
60  virtual void readOneSpecified(EventPrincipal& cache, EventID const& id);
61  virtual void dropUnwantedBranches_(std::vector<std::string> const& wantedBranches);
62  virtual void preForkReleaseResources();
63  virtual bool randomAccess_() const;
66 
68 
69 
71  std::unique_ptr<RootInputFileSequence> primaryFileSequence_;
72  std::unique_ptr<RootInputFileSequence> secondaryFileSequence_;
73  boost::shared_ptr<RunPrincipal> secondaryRunPrincipal_;
74  boost::shared_ptr<LuminosityBlockPrincipal> secondaryLumiPrincipal_;
75  std::vector<std::unique_ptr<EventPrincipal>> secondaryEventPrincipals_;
76  std::array<std::vector<BranchID>, NumBranchTypes> branchIDsToReplace_;
77 
78  std::unique_ptr<SharedResourcesAcquirer> resourceSharedWithDelayedReaderPtr_;
79  }; // class PoolSource
81 }
82 #endif
virtual boost::shared_ptr< RunAuxiliary > readRunAuxiliary_()
Definition: PoolSource.cc:141
PoolSource(ParameterSet const &pset, InputSourceDescription const &desc)
Definition: PoolSource.cc:57
PoolSource PoolRASource
Definition: PoolSource.h:80
std::unique_ptr< SharedResourcesAcquirer > resourceSharedWithDelayedReaderPtr_
Definition: PoolSource.h:78
virtual std::unique_ptr< FileBlock > readFile_()
Definition: PoolSource.cc:128
virtual ProcessingController::ForwardState forwardState_() const
Definition: PoolSource.cc:327
virtual bool goToEvent_(EventID const &eventID)
Definition: PoolSource.cc:269
virtual void readOneRandom(EventPrincipal &cache, CLHEP::HepRandomEngine *) override
Definition: PoolSource.cc:274
std::unique_ptr< RootInputFileSequence > secondaryFileSequence_
Definition: PoolSource.h:72
virtual void dropUnwantedBranches_(std::vector< std::string > const &wantedBranches)
Definition: PoolSource.cc:304
virtual bool randomAccess_() const
Definition: PoolSource.cc:322
virtual ProcessingController::ReverseState reverseState_() const
Definition: PoolSource.cc:332
boost::shared_ptr< RunPrincipal > secondaryRunPrincipal_
Definition: PoolSource.h:73
virtual ~PoolSource()
Definition: PoolSource.cc:118
SharedResourcesAcquirer * resourceSharedWithDelayedReader_() const override
Definition: PoolSource.cc:252
unsigned int offset(bool)
virtual void readRun_(RunPrincipal &runPrincipal)
Definition: PoolSource.cc:151
static void fillDescriptions(ConfigurationDescriptions &descriptions)
Definition: PoolSource.cc:310
virtual void rewind_()
Definition: PoolSource.cc:258
virtual void readOneSpecified(EventPrincipal &cache, EventID const &id)
Definition: PoolSource.cc:298
ProductRegistry & productRegistryUpdate() const
Definition: InputSource.h:347
virtual bool readIt(EventID const &id, EventPrincipal &eventPrincipal, StreamContext &streamContext) override
Definition: PoolSource.cc:222
virtual void readEvent_(EventPrincipal &eventPrincipal)
Definition: PoolSource.cc:200
std::array< std::vector< BranchID >, NumBranchTypes > branchIDsToReplace_
Definition: PoolSource.h:76
virtual void endJob()
Definition: PoolSource.cc:121
std::unique_ptr< RootInputFileSequence > primaryFileSequence_
Definition: PoolSource.h:71
virtual void closeFile_()
Definition: PoolSource.cc:136
boost::shared_ptr< RunPrincipal > const runPrincipal() const
RootServiceChecker rootServiceChecker_
Definition: PoolSource.h:70
virtual ItemType getNextItemType()
Definition: PoolSource.cc:231
ProcessHistoryRegistry & processHistoryRegistryUpdate() const
Definition: InputSource.h:348
virtual void skip(int offset)
Definition: PoolSource.cc:264
virtual bool readOneSequentialWithID(EventPrincipal &cache, LuminosityBlockID const &lumiID)
Definition: PoolSource.cc:292
boost::shared_ptr< LuminosityBlockPrincipal > secondaryLumiPrincipal_
Definition: PoolSource.h:74
virtual void preForkReleaseResources()
Definition: PoolSource.cc:247
virtual bool readOneSequential(EventPrincipal &cache)
Definition: PoolSource.cc:286
virtual bool readOneRandomWithID(EventPrincipal &cache, LuminosityBlockID const &lumiID, CLHEP::HepRandomEngine *) override
Definition: PoolSource.cc:280
std::vector< std::unique_ptr< EventPrincipal > > secondaryEventPrincipals_
Definition: PoolSource.h:75
virtual boost::shared_ptr< LuminosityBlockAuxiliary > readLuminosityBlockAuxiliary_()
Definition: PoolSource.cc:146
virtual void readLuminosityBlock_(LuminosityBlockPrincipal &lumiPrincipal)
Definition: PoolSource.cc:175