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::shared_ptr<FileBlock> readFile_();
43  void endJob();
45  void skipEventsAtBeginning(int offset);
46  void skipEvents(int offset);
47  bool goToEvent(EventID const& eventID);
48  void rewind_();
52 
53  private:
54  void initFile_(bool skipBadFiles) override;
55  RootFileSharedPtr makeRootFile(std::shared_ptr<InputFile> filePtr) override;
56  bool nextFile();
57  bool previousFile();
58  void rewindFile();
59  void closeFile_() override;
60 
61  int remainingEvents() const;
62  int remainingLuminosityBlocks() const;
63 
65  bool firstFile_;
67  std::vector<ProcessHistoryID> orderedProcessHistoryIDs_;
68 
69  std::shared_ptr<EventSkipperByID const> eventSkipperByID() const { return get_underlying_safe(eventSkipperByID_); }
70  std::shared_ptr<EventSkipperByID>& eventSkipperByID() { return get_underlying_safe(eventSkipperByID_); }
71  std::shared_ptr<DuplicateChecker const> duplicateChecker() const { return get_underlying_safe(duplicateChecker_); }
72  std::shared_ptr<DuplicateChecker>& duplicateChecker() { return get_underlying_safe(duplicateChecker_); }
73 
79  unsigned int treeCacheSize_;
82  bool goToEventInNewFile_ = false;
85  bool skipToStop_ = false;
86  bool skipIntoNewFile_ = false;
91  }; // class RootPrimaryFileSequence
92 } // namespace edm
93 #endif
InputSource::ItemType getNextItemType(RunNumber_t &run, LuminosityBlockNumber_t &lumi, EventNumber_t &event)
void initFile_(bool skipBadFiles) override
RootPrimaryFileSequence & operator=(RootPrimaryFileSequence const &)=delete
unsigned long long EventNumber_t
edm::propagate_const< std::shared_ptr< EventSkipperByID > > eventSkipperByID_
constexpr std::shared_ptr< T > & get_underlying_safe(propagate_const< std::shared_ptr< T >> &iP)
static void fillDescription(ParameterSetDescription &desc)
unsigned int LuminosityBlockNumber_t
std::shared_ptr< DuplicateChecker const > duplicateChecker() const
static std::string const input
Definition: EdmProvDump.cc:47
std::shared_ptr< EventSkipperByID const > eventSkipperByID() const
std::shared_ptr< RootFile > RootFileSharedPtr
bool goToEvent(EventID const &eventID)
ProcessingController::ForwardState forwardState() const
std::shared_ptr< FileBlock > readFile_()
RootFileSharedPtr makeRootFile(std::shared_ptr< InputFile > filePtr) override
std::vector< ProcessHistoryID > orderedProcessHistoryIDs_
RootPrimaryFileSequence(ParameterSet const &pset, PoolSource &input, InputFileCatalog const &catalog)
edm::propagate_const< std::shared_ptr< DuplicateChecker > > duplicateChecker_
BranchDescription::MatchMode branchesMustMatch_
HLT enums.
unsigned int RunNumber_t
ProcessingController::ReverseState reverseState() const
std::shared_ptr< DuplicateChecker > & duplicateChecker()
edm::propagate_const< std::shared_ptr< FileBlock > > fb_
Definition: event.py:1
std::shared_ptr< EventSkipperByID > & eventSkipperByID()