File indexing completed on 2024-04-06 12:19:06
0001 #ifndef IOPool_Input_RootEmbeddedFileSequence_h
0002 #define IOPool_Input_RootEmbeddedFileSequence_h
0003
0004
0005
0006
0007
0008
0009
0010 #include "RootInputFileSequence.h"
0011 #include "FWCore/Framework/interface/Frameworkfwd.h"
0012 #include "FWCore/Sources/interface/VectorInputSource.h"
0013 #include "DataFormats/Provenance/interface/ProcessHistoryID.h"
0014
0015 #include <memory>
0016 #include <string>
0017 #include <vector>
0018
0019 namespace CLHEP {
0020 class HepRandomEngine;
0021 }
0022
0023 namespace edm {
0024
0025 class BranchID;
0026 class FileCatalogItem;
0027 class InputFileCatalog;
0028 class ParameterSetDescription;
0029 class EmbeddedRootSource;
0030 class RootFile;
0031
0032 class RootEmbeddedFileSequence : public RootInputFileSequence {
0033 public:
0034 explicit RootEmbeddedFileSequence(ParameterSet const& pset,
0035 EmbeddedRootSource& input,
0036 InputFileCatalog const& catalog);
0037 ~RootEmbeddedFileSequence() override;
0038
0039 RootEmbeddedFileSequence(RootEmbeddedFileSequence const&) = delete;
0040 RootEmbeddedFileSequence& operator=(RootEmbeddedFileSequence const&) = delete;
0041
0042 void endJob();
0043 void skipEntries(unsigned int offset);
0044 bool readOneEvent(
0045 EventPrincipal& cache, size_t& fileNameHash, CLHEP::HepRandomEngine*, EventID const* id, bool recycleFiles);
0046 bool readOneRandom(EventPrincipal& cache, size_t& fileNameHash, CLHEP::HepRandomEngine*, EventID const*, bool);
0047 bool readOneRandomWithID(
0048 EventPrincipal& cache, size_t& fileNameHash, CLHEP::HepRandomEngine*, EventID const* id, bool);
0049 bool readOneSequential(
0050 EventPrincipal& cache, size_t& fileNameHash, CLHEP::HepRandomEngine*, EventID const*, bool recycleFiles);
0051 bool readOneSequentialWithID(
0052 EventPrincipal& cache, size_t& fileNameHash, CLHEP::HepRandomEngine*, EventID const* id, bool);
0053 void readOneSpecified(EventPrincipal& cache, size_t& fileNameHash, SecondaryEventIDAndFileInfo const& id);
0054
0055 static void fillDescription(ParameterSetDescription& desc);
0056
0057 private:
0058 void closeFile_() override;
0059 void initFile_(bool skipBadFiles) override;
0060 RootFileSharedPtr makeRootFile(std::shared_ptr<InputFile> filePtr) override;
0061
0062 EmbeddedRootSource& input_;
0063
0064 std::vector<ProcessHistoryID> orderedProcessHistoryIDs_;
0065
0066 bool sequential_;
0067 bool sameLumiBlock_;
0068 bool (RootEmbeddedFileSequence::*fptr_)(EventPrincipal&, size_t&, CLHEP::HepRandomEngine*, EventID const*, bool);
0069 int eventsRemainingInFile_;
0070 int initialNumberOfEventsToSkip_;
0071 unsigned int treeCacheSize_;
0072 bool enablePrefetching_;
0073 bool enforceGUIDInFileName_;
0074 unsigned int maxFileSkips_;
0075 };
0076 }
0077 #endif