1 #ifndef HeterogeneousCore_CUDACore_interface_ConvertingESProducerWithDependenciesT_h 2 #define HeterogeneousCore_CUDACore_interface_ConvertingESProducerWithDependenciesT_h 28 template <
template <
typename,
typename>
class Gen,
typename Tuple1,
typename Tuple2>
31 template <
template <
typename,
typename>
class Gen,
typename Tuple1,
typename Tuple2, std::size_t... Is>
33 return std::make_tuple(
37 template <
template <
typename,
typename>
class Gen,
typename... Ts1,
typename... Ts2>
39 static_assert(
sizeof...(Ts1) ==
sizeof...(Ts2));
40 using type =
typename std::decay<decltype(TypeZipperImpl<Gen>(
41 std::tuple<Ts1...>{}, std::tuple<Ts2...>{}, std::index_sequence_for<Ts1...>{}))>
::type;
46 template <
typename CombinedRecord,
typename Target,
typename... Dependencies>
49 template <
template <
typename...>
typename CombinedRecord,
50 typename... DepsRecords,
52 typename... Dependencies>
56 static constexpr std::size_t nsources =
sizeof...(Dependencies);
57 static_assert(
sizeof...(Dependencies) ==
sizeof...(DepsRecords));
60 std::vector<edm::ESInputTag>
tags(nsources);
61 for (std::size_t
i = 0;
i < nsources;
i++)
66 WalkConsumes<nsources - 1>::iterate(cc,
tokens_,
tags);
69 std::unique_ptr<Target>
produce(CombinedRecord<DepsRecords...>
const&
record) {
70 auto handles = std::tuple<edm::ESHandle<Dependencies>...>{};
80 for (std::size_t
i = 0;
i < nsources;
i++)
91 template <std::
size_t N>
95 std::vector<edm::ESInputTag>
const&
tags) {
97 WalkConsumes<N - 1>::iterate(cc, tokens,
tags);
98 std::get<N>(tokens) = cc.consumes(
tags[
N]);
102 template <std::size_t
N,
typename...
Types>
104 static void iterate(CombinedRecord<DepsRecords...>
const& containingRecord,
105 std::tuple<Types...>& ts,
107 using Record =
typename std::tuple_element<
N, std::tuple<DepsRecords...>>
::type;
109 WalkAndCall<N - 1, Types...>::iterate(containingRecord, ts, tokens);
111 auto const&
record = containingRecord.template getRecord<Record>();
113 std::get<N>(ts) =
record.getHandle(std::get<N>(tokens));
118 #endif // HeterogeneousCore_CUDACore_interface_ConvertingESProducerWithDependenciesT_h void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
T getParameter(std::string const &) const
static void fillDescriptions(edm::ConfigurationDescriptions &confDesc)
std::string to_string(const V &value)
std::vector< BaseVolumeHandle * > handles
auto TypeZipperImpl(Tuple1 const &t1, Tuple2 const &t2, std::index_sequence< Is... >)
ConvertingESProducerWithDependenciesT(edm::ParameterSet const &ps)
typename detail::TypeZipper< edm::ESGetToken, std::tuple< Dependencies... >, std::tuple< DepsRecords... > >::type TokenType
std::vector< edm::EDGetTokenT< int > > tokens_
std::unique_ptr< Target > produce(CombinedRecord< DepsRecords... > const &record)
static void iterate(CombinedRecord< DepsRecords... > const &containingRecord, std::tuple< Types... > &ts, TokenType const &tokens)
static void iterate(edm::ESConsumesCollectorT< CombinedRecord< DepsRecords... >> &cc, TokenType &tokens, std::vector< edm::ESInputTag > const &tags)
typename std::decay< decltype(TypeZipperImpl< Gen >(std::tuple< Ts1... >{}, std::tuple< Ts2... >{}, std::index_sequence_for< Ts1... >{}))>::type type