71 template <
typename ProductType>
75 template <
typename ProductType>
79 template <
typename ProductType,
typename RecordType, const
char* LABEL,
typename EffectiveType>
92 const std::vector<std::string>& dumpRequest,
93 std::ostream* dumpStream) {
97 if (
std::find(dumpRequest.begin(), dumpRequest.end(),
dumpName_) != dumpRequest.end()) {
98 *dumpStream <<
"New HCAL " <<
dumpName_ <<
" set" << std::endl;
108 template <
typename ProductType, const
char* LABEL,
typename EffectiveType = std::false_type>
111 static constexpr
const char*
label = LABEL;
115 template <
typename RecordType,
typename... TokenHolders>
123 const std::vector<std::string>& dumpRequest,
124 std::ostream* dumpStream) {
125 host.ifRecordChanges<RecordType>(
record, [
this, &
host, &dumpRequest, &dumpStream](
auto const& rec) {
127 auto&&...
item) { ((
item.setupHcalDbService(
host, rec, dumpRequest, dumpStream)), ...); },
136 typename TokenHolders::Effective>...>
141 template <
typename ProductT,
typename RecordT>
163 template <
typename ProductType,
typename RecordType,
size_t IND1,
size_t IND2>
165 const auto& tokenHolder = std::get<IND2>(std::get<IND1>(
tokenHolders_));
166 auto item =
record.getTransientHandle(tokenHolder.token());
168 auto productWithTopology = std::make_unique<ProductType>(*item);
169 const auto& topo =
record.get(tokenHolder.topoToken());
170 productWithTopology->setTopo(&topo);
172 return productWithTopology;
175 template <
size_t IND1,
size_t IND2>
177 auto& holder = std::get<IND2>(std::get<IND1>(
tokenHolders_));
180 using ProductT =
typename HolderT::Product;
185 this, &HcalDbProducer::produceWithTopology<ProductT, RecordT, IND1, IND2>,
edm::es::Label(
label)),
189 template <
size_t IND1,
size_t... IND2s>
191 ((setupProduce<IND1, IND2s>(
label,
tag)), ...);
194 template <
size_t IND1>
196 setupProduceAllImpl<IND1>(
197 label,
tag, std::make_index_sequence<std::tuple_size_v<std::tuple_element_t<IND1, decltype(tokenHolders_)>>>{});
206 constexpr
static const char kEmpty[] =
"";
238 std::tuple<TokenAndTopologyHolder<HcalPedestals, HcalPedestalsRcd>,
257 std::tuple<TokenAndTopologyHolder<HcalPedestals, HcalPedestalsRcd>,
static void serviceSetData(HostType &host, const ProductType &item, std::true_type)
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
std::tuple< TokensForServiceHolder< HcalPedestalWidthsRcd, ServiceToken< HcalPedestalWidths, kWithTopoEff, std::true_type >, ServiceToken< HcalPedestalWidths, kWithTopo > >, TokensForServiceHolder< HcalPedestalsRcd, ServiceToken< HcalPedestals, kWithTopoEff, std::true_type >, ServiceToken< HcalPedestals, kWithTopo > >, TokensForServiceHolder< HcalRecoParamsRcd, ServiceToken< HcalRecoParams, kWithTopo > >, TokensForServiceHolder< HcalMCParamsRcd, ServiceToken< HcalMCParams, kWithTopo > >, TokensForServiceHolder< HcalLutMetadataRcd, ServiceToken< HcalLutMetadata, kWithTopo > >, TokensForServiceHolder< HcalTPParametersRcd, ServiceToken< HcalTPParameters, kEmpty > >, TokensForServiceHolder< HcalTPChannelParametersRcd, ServiceToken< HcalTPChannelParameters, kWithTopo > >, TokensForServiceHolder< HcalSiPMCharacteristicsRcd, ServiceToken< HcalSiPMCharacteristics, kEmpty > >, TokensForServiceHolder< HcalSiPMParametersRcd, ServiceToken< HcalSiPMParameters, kWithTopo > >, TokensForServiceHolder< HcalFrontEndMapRcd, ServiceToken< HcalFrontEndMap, kEmpty > >, TokensForServiceHolder< HcalElectronicsMapRcd, ServiceToken< HcalElectronicsMap, kEmpty > >, TokensForServiceHolder< HcalL1TriggerObjectsRcd, ServiceToken< HcalL1TriggerObjects, kWithTopo > >, TokensForServiceHolder< HcalZSThresholdsRcd, ServiceToken< HcalZSThresholds, kWithTopo > >, TokensForServiceHolder< HcalChannelQualityRcd, ServiceToken< HcalChannelQuality, kWithTopo > >, TokensForServiceHolder< HcalGainWidthsRcd, ServiceToken< HcalGainWidths, kWithTopo > >, TokensForServiceHolder< HcalQIETypesRcd, ServiceToken< HcalQIETypes, kWithTopo > >, TokensForServiceHolder< HcalQIEDataRcd, ServiceToken< HcalQIEData, kWithTopo > >, TokensForServiceHolder< HcalTimeCorrsRcd, ServiceToken< HcalTimeCorrs, kWithTopo > >, TokensForServiceHolder< HcalPFCorrsRcd, ServiceToken< HcalPFCorrs, kWithTopo > >, TokensForServiceHolder< HcalLUTCorrsRcd, ServiceToken< HcalLUTCorrs, kWithTopo > >, TokensForServiceHolder< HcalGainsRcd, ServiceToken< HcalGains, kWithTopo > >, TokensForServiceHolder< HcalRespCorrsRcd, ServiceToken< HcalRespCorrs, kWithTopo > > > tokensForService_
std::tuple< std::tuple< TokenAndTopologyHolder< HcalPedestals, HcalPedestalsRcd >, TokenAndTopologyHolder< HcalPedestalWidths, HcalPedestalWidthsRcd >, TokenAndTopologyHolder< HcalGains, HcalGainsRcd >, TokenAndTopologyHolder< HcalGainWidths, HcalGainWidthsRcd >, TokenAndTopologyHolder< HcalQIEData, HcalQIEDataRcd >, TokenAndTopologyHolder< HcalQIETypes, HcalQIETypesRcd >, TokenAndTopologyHolder< HcalChannelQuality, HcalChannelQualityRcd >, TokenAndTopologyHolder< HcalZSThresholds, HcalZSThresholdsRcd >, TokenAndTopologyHolder< HcalRespCorrs, HcalRespCorrsRcd >, TokenAndTopologyHolder< HcalL1TriggerObjects, HcalL1TriggerObjectsRcd >, TokenAndTopologyHolder< HcalTimeCorrs, HcalTimeCorrsRcd >, TokenAndTopologyHolder< HcalLUTCorrs, HcalLUTCorrsRcd >, TokenAndTopologyHolder< HcalPFCorrs, HcalPFCorrsRcd >, TokenAndTopologyHolder< HcalLutMetadata, HcalLutMetadataRcd >, TokenAndTopologyHolder< HcalSiPMParameters, HcalSiPMParametersRcd >, TokenAndTopologyHolder< HcalTPChannelParameters, HcalTPChannelParametersRcd >, TokenAndTopologyHolder< HcalMCParams, HcalMCParamsRcd >, TokenAndTopologyHolder< HcalRecoParams, HcalRecoParamsRcd > >, std::tuple< TokenAndTopologyHolder< HcalPedestals, HcalPedestalsRcd >, TokenAndTopologyHolder< HcalPedestalWidths, HcalPedestalWidthsRcd > > > tokenHolders_
void setConsumes(edm::ESConsumesCollector &&cc, const edm::ESInputTag &tag)
HcalDbProducer(const edm::ParameterSet &)
void setupHcalDbService(HostType &host, const RecordType &record, const std::vector< std::string > &dumpRequest, std::ostream *dumpStream)
const auto & token() const
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
void setupProduceAll(const char *label, const edm::ESInputTag &tag)
void setupHcalDbService(HostType &host, const HcalDbRecord &record, const std::vector< std::string > &dumpRequest, std::ostream *dumpStream)
T getUntrackedParameter(std::string const &, T const &) const
edm::ESGetToken< ProductType, RecordType > token_
const auto & topoToken() const
std::unique_ptr< ProductType > produceWithTopology(RecordType const &record)
static constexpr const char * label
std::vector< std::string > mDumpRequest
static constexpr const char kEmpty[]
void setupProduce(const char *label, const edm::ESInputTag &tag)
void setConsumes(edm::ESConsumesCollector &cc)
void setupProduceAllImpl(const char *label, const edm::ESInputTag &tag, std::index_sequence< IND2s... >)
std::shared_ptr< T > makeOrGet(FM &&iMakeFunc)
Takes an object from the queue if one is available, or creates one using iMakeFunc.
static constexpr const char kWithTopoEff[]
edm::ESGetToken< HcalTopology, HcalRecNumberingRecord > topoToken_
static constexpr const char kWithTopo[]
void setConsumes(edm::ESConsumesCollector &cc)
static void serviceSetData(HostType &host, const ProductType &item, std::false_type)
TokenAndTopologyHolder()=default
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
std::string typeDemangle(char const *mangledName)
~HcalDbProducer() override
bool dumpObject(std::ostream &fOutput, const HcalPedestals &fObject)
edm::ESProductHost< HcalDbService, HcalPedestalsRcd, HcalPedestalWidthsRcd, HcalGainsRcd, HcalGainWidthsRcd, HcalQIEDataRcd, HcalQIETypesRcd, HcalChannelQualityRcd, HcalZSThresholdsRcd, HcalRespCorrsRcd, HcalL1TriggerObjectsRcd, HcalTimeCorrsRcd, HcalLUTCorrsRcd, HcalPFCorrsRcd, HcalLutMetadataRcd, HcalSiPMParametersRcd, HcalTPChannelParametersRcd, HcalMCParamsRcd, HcalRecoParamsRcd, HcalElectronicsMapRcd, HcalFrontEndMapRcd, HcalSiPMCharacteristicsRcd, HcalTPParametersRcd > HostType
edm::ESGetToken< ProductT, RecordT > token_
std::tuple< ServiceTokenImpl< typename TokenHolders::Product, RecordType, TokenHolders::label, typename TokenHolders::Effective >... > tokens_
std::ostream * mDumpStream
std::shared_ptr< HcalDbService > produce(const HcalDbRecord &)
edm::ReusableObjectHolder< HostType > holder_
ESConsumesCollectorAdaptor consumes()