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 <array>
17 #include <memory>
18 #include <string>
19 #include <vector>
20 
21 namespace CLHEP {
22  class HepRandomEngine;
23 }
24 
25 namespace edm {
26 
28  class FileCatalogItem;
29  class RootInputFileSequence;
30 
31  class PoolSource : public VectorInputSource {
32  public:
33  explicit PoolSource(ParameterSet const& pset, InputSourceDescription const& desc);
34  virtual ~PoolSource();
37 
38  static void fillDescriptions(ConfigurationDescriptions & descriptions);
39 
40  private:
41  virtual void readEvent_(EventPrincipal& eventPrincipal);
42  virtual std::shared_ptr<LuminosityBlockAuxiliary> readLuminosityBlockAuxiliary_();
43  virtual void readLuminosityBlock_(LuminosityBlockPrincipal& lumiPrincipal);
44  virtual std::shared_ptr<RunAuxiliary> readRunAuxiliary_();
45  virtual void readRun_(RunPrincipal& runPrincipal);
46  virtual std::unique_ptr<FileBlock> readFile_();
47  virtual void closeFile_();
48  virtual void endJob();
49  virtual ItemType getNextItemType();
50  virtual bool readIt(EventID const& id, EventPrincipal& eventPrincipal, StreamContext& streamContext) override;
51  virtual void skip(int offset);
52  virtual bool goToEvent_(EventID const& eventID);
53  virtual void rewind_();
54  virtual void readOneRandom(EventPrincipal& cache, CLHEP::HepRandomEngine*) override;
55  virtual bool readOneRandomWithID(EventPrincipal& cache, LuminosityBlockID const& lumiID, CLHEP::HepRandomEngine*) override;
56  virtual bool readOneSequential(EventPrincipal& cache);
57  virtual bool readOneSequentialWithID(EventPrincipal& cache, LuminosityBlockID const& lumiID);
58  virtual void readOneSpecified(EventPrincipal& cache, EventID const& id);
59  virtual void dropUnwantedBranches_(std::vector<std::string> const& wantedBranches);
60  virtual void preForkReleaseResources();
61  virtual bool randomAccess_() const;
64 
66 
67 
69  std::unique_ptr<RootInputFileSequence> primaryFileSequence_;
70  std::unique_ptr<RootInputFileSequence> secondaryFileSequence_;
71  std::shared_ptr<RunPrincipal> secondaryRunPrincipal_;
72  std::shared_ptr<LuminosityBlockPrincipal> secondaryLumiPrincipal_;
73  std::vector<std::unique_ptr<EventPrincipal>> secondaryEventPrincipals_;
74  std::array<std::vector<BranchID>, NumBranchTypes> branchIDsToReplace_;
75 
76  std::unique_ptr<SharedResourcesAcquirer> resourceSharedWithDelayedReaderPtr_;
77  }; // class PoolSource
79 }
80 #endif
PoolSource(ParameterSet const &pset, InputSourceDescription const &desc)
Definition: PoolSource.cc:63
PoolSource PoolRASource
Definition: PoolSource.h:78
std::unique_ptr< SharedResourcesAcquirer > resourceSharedWithDelayedReaderPtr_
Definition: PoolSource.h:76
virtual std::unique_ptr< FileBlock > readFile_()
Definition: PoolSource.cc:144
virtual ProcessingController::ForwardState forwardState_() const
Definition: PoolSource.cc:343
virtual bool goToEvent_(EventID const &eventID)
Definition: PoolSource.cc:285
std::shared_ptr< RunPrincipal > secondaryRunPrincipal_
Definition: PoolSource.h:71
virtual void readOneRandom(EventPrincipal &cache, CLHEP::HepRandomEngine *) override
Definition: PoolSource.cc:290
std::unique_ptr< RootInputFileSequence > secondaryFileSequence_
Definition: PoolSource.h:70
virtual void dropUnwantedBranches_(std::vector< std::string > const &wantedBranches)
Definition: PoolSource.cc:320
std::shared_ptr< LuminosityBlockPrincipal > secondaryLumiPrincipal_
Definition: PoolSource.h:72
virtual bool randomAccess_() const
Definition: PoolSource.cc:338
virtual ProcessingController::ReverseState reverseState_() const
Definition: PoolSource.cc:348
std::shared_ptr< RunPrincipal > const runPrincipal() const
virtual ~PoolSource()
Definition: PoolSource.cc:134
SharedResourcesAcquirer * resourceSharedWithDelayedReader_() const override
Definition: PoolSource.cc:268
unsigned int offset(bool)
virtual void readRun_(RunPrincipal &runPrincipal)
Definition: PoolSource.cc:167
virtual std::shared_ptr< LuminosityBlockAuxiliary > readLuminosityBlockAuxiliary_()
Definition: PoolSource.cc:162
static void fillDescriptions(ConfigurationDescriptions &descriptions)
Definition: PoolSource.cc:326
virtual void rewind_()
Definition: PoolSource.cc:274
virtual void readOneSpecified(EventPrincipal &cache, EventID const &id)
Definition: PoolSource.cc:314
ProductRegistry & productRegistryUpdate() const
Definition: InputSource.h:351
virtual bool readIt(EventID const &id, EventPrincipal &eventPrincipal, StreamContext &streamContext) override
Definition: PoolSource.cc:238
virtual void readEvent_(EventPrincipal &eventPrincipal)
Definition: PoolSource.cc:216
std::array< std::vector< BranchID >, NumBranchTypes > branchIDsToReplace_
Definition: PoolSource.h:74
virtual void endJob()
Definition: PoolSource.cc:137
std::unique_ptr< RootInputFileSequence > primaryFileSequence_
Definition: PoolSource.h:69
virtual void closeFile_()
Definition: PoolSource.cc:152
RootServiceChecker rootServiceChecker_
Definition: PoolSource.h:68
virtual ItemType getNextItemType()
Definition: PoolSource.cc:247
ProcessHistoryRegistry & processHistoryRegistryUpdate() const
Definition: InputSource.h:352
virtual void skip(int offset)
Definition: PoolSource.cc:280
virtual bool readOneSequentialWithID(EventPrincipal &cache, LuminosityBlockID const &lumiID)
Definition: PoolSource.cc:308
virtual void preForkReleaseResources()
Definition: PoolSource.cc:263
virtual bool readOneSequential(EventPrincipal &cache)
Definition: PoolSource.cc:302
virtual bool readOneRandomWithID(EventPrincipal &cache, LuminosityBlockID const &lumiID, CLHEP::HepRandomEngine *) override
Definition: PoolSource.cc:296
std::vector< std::unique_ptr< EventPrincipal > > secondaryEventPrincipals_
Definition: PoolSource.h:73
virtual std::shared_ptr< RunAuxiliary > readRunAuxiliary_()
Definition: PoolSource.cc:157
virtual void readLuminosityBlock_(LuminosityBlockPrincipal &lumiPrincipal)
Definition: PoolSource.cc:191