Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:04:09

0001 #ifndef DataFormats_FWLite_EntryFinder_h
0002 #define DataFormats_FWLite_EntryFinder_h
0003 // -*- C++ -*-
0004 //
0005 // Package:     FWLite/DataFormats
0006 // Class  :     EntryFinder
0007 //
0008 /**\class  DataFormats/FWLite/interface/EntryFinder.h
0009 
0010    Description: <one line class summary>
0011 
0012    Usage:
0013    <usage>
0014 
0015 */
0016 //
0017 // Original Author:  Bill Tanenbaum
0018 //
0019 // system include files
0020 
0021 // user include files
0022 #include "DataFormats/Provenance/interface/FileIndex.h"
0023 #include "DataFormats/Provenance/interface/IndexIntoFile.h"
0024 
0025 // forward declarations
0026 
0027 namespace fwlite {
0028   class BranchMapReader;
0029   class EntryFinder {
0030   public:
0031     EntryFinder();
0032     ~EntryFinder();
0033     typedef edm::IndexIntoFile::EntryNumber_t EntryNumber_t;
0034     bool empty() const { return indexIntoFile_.empty() && fileIndex_.empty(); }
0035     EntryNumber_t findEvent(edm::RunNumber_t const& run,
0036                             edm::LuminosityBlockNumber_t const& lumi,
0037                             edm::EventNumber_t const& event) const;
0038     EntryNumber_t findLumi(edm::RunNumber_t const& run, edm::LuminosityBlockNumber_t const& lumi) const;
0039     EntryNumber_t findRun(edm::RunNumber_t const& run) const;
0040     void fillIndex(BranchMapReader& branchMap);
0041     static EntryNumber_t const invalidEntry = -1LL;
0042 
0043   private:
0044     edm::IndexIntoFile indexIntoFile_;
0045     edm::FileIndex fileIndex_;
0046   };
0047 }  // namespace fwlite
0048 #endif