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:
38  InputFileCatalog const& catalog);
39  ~RootPrimaryFileSequence() override;
40 
41  RootPrimaryFileSequence(RootPrimaryFileSequence const&) = delete; // Disallow copying and moving
42  RootPrimaryFileSequence& operator=(RootPrimaryFileSequence const&) = delete; // Disallow copying and moving
43 
44  std::unique_ptr<FileBlock> readFile_();
45  void closeFile_() override;
46  void endJob();
48  bool skipEvents(int offset);
49  bool goToEvent(EventID const& eventID);
50  void rewind_();
51  static void fillDescription(ParameterSetDescription & desc);
54  private:
55  void initFile_(bool skipBadFiles) override;
56  RootFileSharedPtr makeRootFile(std::shared_ptr<InputFile> filePtr) override;
57  bool nextFile();
58  bool previousFile();
59  void rewindFile();
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 
77  unsigned int treeCacheSize_;
81  }; // class RootPrimaryFileSequence
82 }
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:44
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()