LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
ConsumesCollector.cc
Go to the documentation of this file.
2 // vim: set sw=2 expandtab :
3 
5 
6 #include <algorithm>
7 
8 using namespace std;
9 
10 namespace art {
11 
12  array<vector<ProductInfo>, NumBranchTypes> const&
13  ConsumesCollector::getConsumables() const
14  {
15  return consumables_;
16  }
17 
18  void
19  ConsumesCollector::sortConsumables(std::string const& current_process_name)
20  {
21  // Now that we know we have seen all the consumes declarations,
22  // sort the results for fast lookup later.
23  for (auto& perBTConsumables : consumables_) {
24  for (auto& pi : perBTConsumables) {
25  pi.process = ProcessTag{pi.process.name(), current_process_name};
26  }
27  sort(begin(perBTConsumables), end(perBTConsumables));
28  }
29  }
30 
31  void
32  ConsumesCollector::emplace_back(BranchType const bt,
33  ProductInfo::ConsumableType const contype,
34  TypeID const& typeID,
35  InputTag const& tag)
36  {
37  consumables_[bt].emplace_back(
38  contype, typeID, tag.label(), tag.instance(), ProcessTag{tag.process()});
39  }
40 
41  void
42  ConsumesCollector::emplace_back(BranchType const bt,
43  ProductInfo::ConsumableType const contype,
44  TypeID const& typeID)
45  {
46  consumables_[bt].emplace_back(contype, typeID);
47  }
48 
49 } // namespace art
std::string const & instance() const noexcept
Definition: InputTag.cc:85
STL namespace.
std::string const & process() const noexcept
Definition: InputTag.cc:91
decltype(auto) constexpr end(T &&obj)
ADL-aware version of std::end.
Definition: StdUtils.h:77
std::string const & label() const noexcept
Definition: InputTag.cc:79
constexpr T pi()
Returns the constant pi (up to 35 decimal digits of precision)
BranchType
Definition: BranchType.h:20
Definition: MVAAlg.h:12
decltype(auto) constexpr begin(T &&obj)
ADL-aware version of std::begin.
Definition: StdUtils.h:69