DataSetBroker.h
Go to the documentation of this file.
1 #ifndef art_Framework_Modules_detail_DataSetBroker_h
2 #define art_Framework_Modules_detail_DataSetBroker_h
3 
8 
9 #include <map>
10 #include <memory>
11 #include <string>
12 #include <vector>
13 
14 namespace art {
15  namespace detail {
16 
17  using ProductsForDataset_t =
18  std::map<std::string, SamplingInputFile::InstanceForID_t>;
19  using Products_t = std::map<BranchKey, ProductsForDataset_t>;
20 
21  class DataSetBroker {
22  public:
23  explicit DataSetBroker(fhicl::ParameterSet const& pset);
24 
25  std::map<BranchKey, BranchDescription> openInputFiles(
26  std::vector<std::string> const& inputCommands,
27  bool dropDescendants,
28  unsigned int treeCacheSize,
29  int64_t treeMaxVirtualSize,
30  int64_t saveMemoryObjectThreshold,
31  BranchDescription const& sampledEventInfoDesc,
32  bool const compactRangeSetsForReading,
33  ModuleDescription const& md,
34  bool const readParameterSets,
35  MasterProductRegistry& preg);
36 
37  bool canReadEvent();
38 
39  std::unique_ptr<SampledRunInfo> readAllRunProducts(
40  Products_t& read_products);
41 
42  std::unique_ptr<SampledSubRunInfo> readAllSubRunProducts(
43  Products_t& read_products);
44 
45  std::unique_ptr<EventPrincipal> readNextEvent(
46  EventID const& id,
47  ProcessConfigurations const& sampled_pcs,
48  ProcessConfiguration const& current_pc);
49 
50  void countSummary() const;
51 
52  private:
53  struct Config {
56  };
57  std::map<std::string, Config> configs_{};
58  std::map<std::string, art::detail::SamplingInputFile> files_;
59  std::unique_ptr<DataSetSampler> dataSetSampler_{nullptr};
60  std::map<std::string, unsigned> counts_;
61  unsigned totalCounts_{};
63  };
64  }
65 }
66 
67 #endif /* art_Framework_Modules_detail_DataSetBroker_h */
68 
69 // Local Variables:
70 // mode: c++
71 // End:
DataSetBroker(fhicl::ParameterSet const &pset)
std::map< std::string, Config > configs_
Definition: DataSetBroker.h:57
std::map< std::string, SamplingInputFile::InstanceForID_t > ProductsForDataset_t
Definition: DataSetBroker.h:18
std::unique_ptr< SampledRunInfo > readAllRunProducts(Products_t &read_products)
cet::exempt_ptr< std::string const > currentDataset_
Definition: DataSetBroker.h:62
std::map< std::string, art::detail::SamplingInputFile > files_
Definition: DataSetBroker.h:58
std::unique_ptr< SampledSubRunInfo > readAllSubRunProducts(Products_t &read_products)
std::map< std::string, unsigned > counts_
Definition: DataSetBroker.h:60
std::map< BranchKey, BranchDescription > openInputFiles(std::vector< std::string > const &inputCommands, bool dropDescendants, unsigned int treeCacheSize, int64_t treeMaxVirtualSize, int64_t saveMemoryObjectThreshold, BranchDescription const &sampledEventInfoDesc, bool const compactRangeSetsForReading, ModuleDescription const &md, bool const readParameterSets, MasterProductRegistry &preg)
std::vector< ProcessConfiguration > ProcessConfigurations
std::map< BranchKey, ProductsForDataset_t > Products_t
Definition: DataSetBroker.h:19
std::unique_ptr< DataSetSampler > dataSetSampler_
Definition: DataSetBroker.h:59
Service to store calibration data products (CDP) in the SQLite3 metadatabase of a file...
Definition: FillParentInfo.h:8
std::unique_ptr< EventPrincipal > readNextEvent(EventID const &id, ProcessConfigurations const &sampled_pcs, ProcessConfiguration const &current_pc)
enum BeamMode string