CMS 3D CMS Logo

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 
18 
19 #include <array>
20 #include <memory>
21 #include <string>
22 #include <vector>
23 
24 namespace edm {
25 
27  class FileCatalogItem;
28  class RootPrimaryFileSequence;
29  class RootSecondaryFileSequence;
30  class RunHelperBase;
31 
32  class PoolSource : public InputSource {
33  public:
34  explicit PoolSource(ParameterSet const& pset, InputSourceDescription const& desc);
35  ~PoolSource() override;
38 
39  // const accessors
40  bool skipBadFiles() const { return skipBadFiles_; }
41  bool dropDescendants() const { return dropDescendants_; }
42  bool bypassVersionCheck() const { return bypassVersionCheck_; }
43  bool labelRawDataLikeMC() const { return labelRawDataLikeMC_; }
44  unsigned int nStreams() const { return nStreams_; }
45  int treeMaxVirtualSize() const { return treeMaxVirtualSize_; }
47  RunHelperBase* runHelper() { return runHelper_.get(); }
48 
49  static void fillDescriptions(ConfigurationDescriptions& descriptions);
50 
51  protected:
52  ItemType getNextItemType() override;
53  void readLuminosityBlock_(LuminosityBlockPrincipal& lumiPrincipal) override;
54  std::shared_ptr<LuminosityBlockAuxiliary> readLuminosityBlockAuxiliary_() override;
55  void readEvent_(EventPrincipal& eventPrincipal) override;
56 
57  private:
58  std::shared_ptr<RunAuxiliary> readRunAuxiliary_() override;
59  void readRun_(RunPrincipal& runPrincipal) override;
60  void fillProcessBlockHelper_() override;
63  std::shared_ptr<FileBlock> readFile_() override;
64  void closeFile_() override;
65  void endJob() override;
66  bool readIt(EventID const& id, EventPrincipal& eventPrincipal, StreamContext& streamContext) override;
67  void skip(int offset) override;
68  bool goToEvent_(EventID const& eventID) override;
69  void rewind_() override;
70  bool randomAccess_() const override;
73 
74  std::pair<SharedResourcesAcquirer*, std::recursive_mutex*> resourceSharedWithDelayedReader_() override;
75 
81  std::vector<edm::propagate_const<std::unique_ptr<EventPrincipal>>> secondaryEventPrincipals_;
82  std::array<std::vector<BranchID>, NumBranchTypes> branchIDsToReplace_;
83 
84  unsigned int nStreams_;
92 
94  std::unique_ptr<SharedResourcesAcquirer>
95  resourceSharedWithDelayedReaderPtr_; // We do not use propagate_const because the acquirer is itself mutable.
96  std::shared_ptr<std::recursive_mutex> mutexSharedWithDelayedReader_;
99  }; // class PoolSource
100 } // namespace edm
101 #endif
bool bypassVersionCheck_
Definition: PoolSource.h:86
void fillProcessBlockHelper_() override
Definition: PoolSource.cc:177
edm::propagate_const< std::unique_ptr< RootSecondaryFileSequence > > secondaryFileSequence_
Definition: PoolSource.h:98
PoolSource(ParameterSet const &pset, InputSourceDescription const &desc)
Definition: PoolSource.cc:65
bool labelRawDataLikeMC() const
Definition: PoolSource.h:43
bool goToEvent_(EventID const &eventID) override
Definition: PoolSource.cc:288
InputFileCatalog catalog_
Definition: PoolSource.h:77
std::unique_ptr< SharedResourcesAcquirer > resourceSharedWithDelayedReaderPtr_
Definition: PoolSource.h:95
ProductRegistry & productRegistryUpdate()
Definition: InputSource.h:330
bool nextProcessBlock_(ProcessBlockPrincipal &) override
Definition: PoolSource.cc:179
edm::propagate_const< std::unique_ptr< RunHelperBase > > runHelper_
Definition: PoolSource.h:93
edm::propagate_const< std::shared_ptr< RunPrincipal > > secondaryRunPrincipal_
Definition: PoolSource.h:79
bool dropDescendants_
Definition: PoolSource.h:89
void readProcessBlock_(ProcessBlockPrincipal &) override
Definition: PoolSource.cc:183
bool skipBadFiles() const
Definition: PoolSource.h:40
void readLuminosityBlock_(LuminosityBlockPrincipal &lumiPrincipal) override
Definition: PoolSource.cc:207
unsigned int nStreams() const
Definition: PoolSource.h:44
unsigned int nStreams_
Definition: PoolSource.h:84
std::shared_ptr< LuminosityBlockAuxiliary > readLuminosityBlockAuxiliary_() override
Definition: PoolSource.cc:173
~PoolSource() override
Definition: PoolSource.cc:152
std::pair< SharedResourcesAcquirer *, std::recursive_mutex * > resourceSharedWithDelayedReader_() override
Definition: PoolSource.cc:278
RunHelperBase * runHelper()
Definition: PoolSource.h:47
bool randomAccess_() const override
Definition: PoolSource.cc:327
ProcessingController::ReverseState reverseState_() const override
Definition: PoolSource.cc:331
bool delayReadingEventProducts_
Definition: PoolSource.h:91
void readRun_(RunPrincipal &runPrincipal) override
Definition: PoolSource.cc:187
std::vector< edm::propagate_const< std::unique_ptr< EventPrincipal > > > secondaryEventPrincipals_
Definition: PoolSource.h:81
void readEvent_(EventPrincipal &eventPrincipal) override
Definition: PoolSource.cc:229
bool labelRawDataLikeMC_
Definition: PoolSource.h:90
std::shared_ptr< RunAuxiliary > readRunAuxiliary_() override
Definition: PoolSource.cc:171
ItemType getNextItemType() override
Definition: PoolSource.cc:263
int const treeMaxVirtualSize_
Definition: PoolSource.h:87
InputFileCatalog secondaryCatalog_
Definition: PoolSource.h:78
static void fillDescriptions(ConfigurationDescriptions &descriptions)
Definition: PoolSource.cc:290
ProcessingController::ForwardState forwardState_() const override
Definition: PoolSource.cc:329
int treeMaxVirtualSize() const
Definition: PoolSource.h:45
bool readIt(EventID const &id, EventPrincipal &eventPrincipal, StreamContext &streamContext) override
Definition: PoolSource.cc:254
std::array< std::vector< BranchID >, NumBranchTypes > branchIDsToReplace_
Definition: PoolSource.h:82
ProductSelectorRules productSelectorRules_
Definition: PoolSource.h:88
bool skipBadFiles_
Definition: PoolSource.h:85
void endJob() override
Definition: PoolSource.cc:154
ProcessHistoryRegistry & processHistoryRegistryForUpdate()
Definition: InputSource.h:331
void skip(int offset) override
Definition: PoolSource.cc:286
RootServiceChecker rootServiceChecker_
Definition: PoolSource.h:76
HLT enums.
ProductSelectorRules const & productSelectorRules() const
Definition: PoolSource.h:46
std::shared_ptr< std::recursive_mutex > mutexSharedWithDelayedReader_
Definition: PoolSource.h:96
bool bypassVersionCheck() const
Definition: PoolSource.h:42
void rewind_() override
Definition: PoolSource.cc:283
edm::propagate_const< std::shared_ptr< LuminosityBlockPrincipal > > secondaryLumiPrincipal_
Definition: PoolSource.h:80
bool dropDescendants() const
Definition: PoolSource.h:41
edm::propagate_const< std::unique_ptr< RootPrimaryFileSequence > > primaryFileSequence_
Definition: PoolSource.h:97
std::shared_ptr< FileBlock > readFile_() override
Definition: PoolSource.cc:161
void closeFile_() override
Definition: PoolSource.cc:169