CMS 3D CMS Logo

RootPrimaryFileSequence.h
Go to the documentation of this file.
1 #ifndef IOPool_Input_RootPrimaryFileSequence_h
2 #define IOPool_Input_RootPrimaryFileSequence_h
3 
4 /*----------------------------------------------------------------------
5 
6 RootPrimaryFileSequence: This is an InputSource
7 
8 ----------------------------------------------------------------------*/
9 
10 #include "RootInputFileSequence.h"
19 
20 #include <memory>
21 #include <string>
22 #include <vector>
23 
24 namespace edm {
25 
26  class BranchID;
27  class DuplicateChecker;
28  class FileCatalogItem;
29  class InputFileCatalog;
31  class PoolSource;
32  class RootFile;
33 
35  public:
37  ~RootPrimaryFileSequence() override;
38 
39  RootPrimaryFileSequence(RootPrimaryFileSequence const&) = delete; // Disallow copying and moving
40  RootPrimaryFileSequence& operator=(RootPrimaryFileSequence const&) = delete; // Disallow copying and moving
41 
42  std::unique_ptr<FileBlock> readFile_();
43  void endJob();
45  bool skipEvents(int offset);
46  bool goToEvent(EventID const& eventID);
47  void rewind_();
48  static void fillDescription(ParameterSetDescription& desc);
51 
52  private:
53  void initFile_(bool skipBadFiles) override;
54  RootFileSharedPtr makeRootFile(std::shared_ptr<InputFile> filePtr) override;
55  bool nextFile();
56  bool previousFile();
57  void rewindFile();
58  void closeFile_() override;
59 
60  int remainingEvents() const;
61  int remainingLuminosityBlocks() const;
62 
64  bool firstFile_;
66  std::vector<ProcessHistoryID> orderedProcessHistoryIDs_;
67 
68  std::shared_ptr<EventSkipperByID const> eventSkipperByID() const { return get_underlying_safe(eventSkipperByID_); }
69  std::shared_ptr<EventSkipperByID>& eventSkipperByID() { return get_underlying_safe(eventSkipperByID_); }
70  std::shared_ptr<DuplicateChecker const> duplicateChecker() const { return get_underlying_safe(duplicateChecker_); }
71  std::shared_ptr<DuplicateChecker>& duplicateChecker() { return get_underlying_safe(duplicateChecker_); }
72 
76  unsigned int treeCacheSize_;
81  }; // class RootPrimaryFileSequence
82 } // namespace edm
83 #endif
InputSource::ItemType getNextItemType(RunNumber_t &run, LuminosityBlockNumber_t &lumi, EventNumber_t &event)
void initFile_(bool skipBadFiles) override
ProcessingController::ForwardState forwardState() const
RootPrimaryFileSequence & operator=(RootPrimaryFileSequence const &)=delete
unsigned long long EventNumber_t
edm::propagate_const< std::shared_ptr< EventSkipperByID > > eventSkipperByID_
static void fillDescription(ParameterSetDescription &desc)
std::unique_ptr< FileBlock > readFile_()
unsigned int LuminosityBlockNumber_t
static std::string const input
Definition: EdmProvDump.cc:48
ProcessingController::ReverseState reverseState() const
std::shared_ptr< RootFile > RootFileSharedPtr
bool goToEvent(EventID const &eventID)
RootFileSharedPtr makeRootFile(std::shared_ptr< InputFile > filePtr) override
std::vector< ProcessHistoryID > orderedProcessHistoryIDs_
RootPrimaryFileSequence(ParameterSet const &pset, PoolSource &input, InputFileCatalog const &catalog)
std::shared_ptr< T > & get_underlying_safe(propagate_const< std::shared_ptr< T >> &iP)
std::shared_ptr< EventSkipperByID const > eventSkipperByID() const
edm::propagate_const< std::shared_ptr< DuplicateChecker > > duplicateChecker_
BranchDescription::MatchMode branchesMustMatch_
HLT enums.
unsigned int RunNumber_t
std::shared_ptr< DuplicateChecker const > duplicateChecker() const
std::shared_ptr< DuplicateChecker > & duplicateChecker()
Definition: event.py:1
std::shared_ptr< EventSkipperByID > & eventSkipperByID()