30 std::vector<edm::ParameterSet>
data = iConfig.
getParameter<std::vector<edm::ParameterSet> >(
"input");
31 std::vector<edm::ParameterSet>::iterator request =
data.begin();
32 for (; request !=
data.end(); ++request) {
39 findingRecord<HcalPedestalsRcd>();
42 findingRecord<HcalPedestalWidthsRcd>();
43 }
else if (
objectName ==
"EffectivePedestals") {
47 findingRecord<HcalPedestalsRcd>();
48 }
else if (
objectName ==
"EffectivePedestalWidths") {
52 findingRecord<HcalPedestalWidthsRcd>();
55 findingRecord<HcalGainsRcd>();
58 findingRecord<HcalGainWidthsRcd>();
61 findingRecord<HcalPFCutsRcd>();
64 findingRecord<HcalQIEDataRcd>();
67 findingRecord<HcalQIETypesRcd>();
70 findingRecord<HcalChannelQualityRcd>();
73 findingRecord<HcalZSThresholdsRcd>();
76 findingRecord<HcalRespCorrsRcd>();
79 findingRecord<HcalLUTCorrsRcd>();
82 findingRecord<HcalPFCorrsRcd>();
85 findingRecord<HcalTimeCorrsRcd>();
88 findingRecord<HcalL1TriggerObjectsRcd>();
91 findingRecord<HcalElectronicsMapRcd>();
94 findingRecord<HcalFrontEndMapRcd>();
97 findingRecord<HcalValidationCorrsRcd>();
100 findingRecord<HcalLutMetadataRcd>();
103 findingRecord<HcalDcsRcd>();
106 findingRecord<HcalDcsMapRcd>();
109 findingRecord<HcalRecoParamsRcd>();
112 findingRecord<HcalTimingParamsRcd>();
115 findingRecord<HcalLongRecoParamsRcd>();
116 }
else if (
objectName ==
"ZDCLowGainFractions") {
118 findingRecord<HcalZDCLowGainFractionsRcd>();
121 findingRecord<HcalMCParamsRcd>();
122 }
else if (
objectName ==
"FlagHFDigiTimeParams") {
124 findingRecord<HcalFlagHFDigiTimeParamsRcd>();
127 findingRecord<HcalSiPMParametersRcd>();
128 }
else if (
objectName ==
"SiPMCharacteristics") {
130 findingRecord<HcalSiPMCharacteristicsRcd>();
131 }
else if (
objectName ==
"TPChannelParameters") {
133 findingRecord<HcalTPChannelParametersRcd>();
136 findingRecord<HcalTPParametersRcd>();
138 std::cerr <<
"HcalTextCalibrations-> Unknown object name '" <<
objectName <<
"', known names are: " 139 <<
"Pedestals PedestalWidths Gains GainWidths PFCuts QIEData QIETypes ChannelQuality ElectronicsMap " 140 <<
"FrontEndMap ZSThresholds RespCorrs LUTCorrs PFCorrs TimeCorrs L1TriggerObjects " 141 <<
"ValidationCorrs LutMetadata DcsValues DcsMap " 142 <<
"RecoParams LongRecoParams ZDCLowGainFraction FlagHFDigiTimeParams MCParams " 143 <<
"SiPMParameters SiPMCharacteristics TPChannelParameters TPParameters" << std::endl;
161 template <
class T,
template <
class>
class F>
163 std::ifstream inStream(fFile.c_str());
164 if (!inStream.good()) {
165 std::cerr <<
"HcalTextCalibrations-> Unable to open file '" << fFile <<
"'" << std::endl;
166 throw cms::Exception(
"FileNotFound") <<
"Unable to open '" << fFile <<
"'" << std::endl;
168 auto result = F<T>(topo)(inStream);
170 std::cerr <<
"HcalTextCalibrations-> Can not read object from file '" << fFile <<
"'" << std::endl;
171 throw cms::Exception(
"ReadError") <<
"Can not read object from file '" << fFile <<
"'" << std::endl;
176 std::unique_ptr<T> get_impl(
const std::string& fFile) {
177 return produce_impl<T, HcalTextCalibrations::CheckGetObject>(fFile);
181 return produce_impl<T, HcalTextCalibrations::CheckGetObjectTopo>(fFile, topo);
184 std::unique_ptr<T> create_impl(
const std::string& fFile) {
185 return produce_impl<T, HcalTextCalibrations::CheckCreateObject>(fFile);
191 return get_impl_topo<HcalPedestals>(mInputs[
n], &rcd.
get(mTokens[
n]));
196 return get_impl_topo<HcalPedestalWidths>(mInputs[
n], &rcd.
get(mTokens[
n]));
201 return get_impl_topo<HcalPedestals>(mInputs[
n], &rcd.
get(mTokens[
n]));
207 return get_impl_topo<HcalPedestalWidths>(mInputs[
n], &rcd.
get(mTokens[
n]));
212 return get_impl_topo<HcalGains>(mInputs[
n], &rcd.get(mTokens[
n]));
217 return get_impl_topo<HcalGainWidths>(mInputs[
n], &rcd.
get(mTokens[
n]));
222 return get_impl_topo<HcalPFCuts>(mInputs[
n], &rcd.get(mTokens[
n]));
227 return get_impl_topo<HcalQIEData>(mInputs[
n], &rcd.
get(mTokens[
n]));
232 return get_impl_topo<HcalQIETypes>(mInputs[
n], &rcd.
get(mTokens[
n]));
237 return get_impl_topo<HcalChannelQuality>(mInputs[
n], &rcd.
get(mTokens[
n]));
242 return get_impl_topo<HcalZSThresholds>(mInputs[
n], &rcd.
get(mTokens[
n]));
247 return get_impl_topo<HcalRespCorrs>(mInputs[
n], &rcd.
get(mTokens[
n]));
252 return get_impl_topo<HcalLUTCorrs>(mInputs[
n], &rcd.
get(mTokens[
n]));
257 return get_impl_topo<HcalPFCorrs>(mInputs[
n], &rcd.
get(mTokens[
n]));
262 return get_impl_topo<HcalTimeCorrs>(mInputs[
n], &rcd.
get(mTokens[
n]));
267 return get_impl_topo<HcalL1TriggerObjects>(mInputs[
n], &rcd.
get(mTokens[
n]));
271 return create_impl<HcalElectronicsMap>(mInputs[
"ElectronicsMap"]);
275 return create_impl<HcalFrontEndMap>(mInputs[
"FrontEndMap"]);
280 return get_impl_topo<HcalValidationCorrs>(mInputs[
n], &rcd.
get(mTokens[
n]));
285 return get_impl_topo<HcalLutMetadata>(mInputs[
n], &rcd.
get(mTokens[
n]));
289 return get_impl<HcalDcsValues>(mInputs[
"DcsValues"]);
293 return create_impl<HcalDcsMap>(mInputs[
"DcsMap"]);
298 return get_impl_topo<HcalRecoParams>(mInputs[
n], &rcd.
get(mTokens[
n]));
303 return get_impl_topo<HcalLongRecoParams>(mInputs[
n], &rcd.
get(mTokens[
n]));
309 return get_impl_topo<HcalZDCLowGainFractions>(mInputs[
n], &rcd.
get(mTokens[
n]));
314 return get_impl_topo<HcalTimingParams>(mInputs[
n], &rcd.
get(mTokens[
n]));
318 return get_impl_topo<HcalMCParams>(mInputs[
n], &rcd.
get(mTokens[
n]));
324 return get_impl_topo<HcalFlagHFDigiTimeParams>(mInputs[
n], &rcd.
get(mTokens[
n]));
329 return get_impl_topo<HcalSiPMParameters>(mInputs[
n], &rcd.
get(mTokens[
n]));
334 return create_impl<HcalSiPMCharacteristics>(mInputs[
"SiPMCharacteristics"]);
340 return get_impl_topo<HcalTPChannelParameters>(mInputs[
n], &rcd.
get(mTokens[
n]));
344 return get_impl<HcalTPParameters>(mInputs[
"TPParameters"]);
std::unique_ptr< HcalPedestals > producePedestals(const HcalPedestalsRcd &rcd)
std::unique_ptr< HcalGainWidths > produceGainWidths(const HcalGainWidthsRcd &rcd)
T getParameter(std::string const &) const
std::unique_ptr< HcalZDCLowGainFractions > produceZDCLowGainFractions(const HcalZDCLowGainFractionsRcd &rcd)
std::unique_ptr< HcalPedestals > produceEffectivePedestals(const HcalPedestalsRcd &rcd)
std::unique_ptr< HcalL1TriggerObjects > produceL1TriggerObjects(const HcalL1TriggerObjectsRcd &rcd)
std::unique_ptr< HcalPedestalWidths > producePedestalWidths(const HcalPedestalWidthsRcd &rcd)
std::unique_ptr< HcalLongRecoParams > produceLongRecoParams(const HcalLongRecoParamsRcd &rcd)
std::unique_ptr< HcalMCParams > produceMCParams(const HcalMCParamsRcd &rcd)
std::unique_ptr< HcalLUTCorrs > produceLUTCorrs(const HcalLUTCorrsRcd &rcd)
std::unique_ptr< HcalPFCorrs > producePFCorrs(const HcalPFCorrsRcd &rcd)
static const IOVSyncValue & endOfTime()
std::unique_ptr< HcalDcsValues > produceDcsValues(HcalDcsRcd const &rcd)
std::unique_ptr< HcalQIEData > produceQIEData(const HcalQIEDataRcd &rcd)
std::pair< Time_t, Time_t > ValidityInterval
void setIntervalFor(const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &, edm::ValidityInterval &) override
std::unique_ptr< HcalSiPMCharacteristics > produceSiPMCharacteristics(const HcalSiPMCharacteristicsRcd &rcd)
std::unique_ptr< HcalPFCuts > producePFCuts(const HcalPFCutsRcd &rcd)
std::unique_ptr< T > produce_impl(const std::string &fFile)
std::unique_ptr< HcalZSThresholds > produceZSThresholds(const HcalZSThresholdsRcd &rcd)
std::unique_ptr< HcalSiPMParameters > produceSiPMParameters(const HcalSiPMParametersRcd &rcd)
std::unique_ptr< HcalDcsMap > produceDcsMap(const HcalDcsMapRcd &rcd)
static const IOVSyncValue & beginOfTime()
std::unique_ptr< HcalRecoParams > produceRecoParams(const HcalRecoParamsRcd &rcd)
std::unique_ptr< HcalChannelQuality > produceChannelQuality(const HcalChannelQualityRcd &rcd)
std::unique_ptr< HcalPedestalWidths > produceEffectivePedestalWidths(const HcalPedestalWidthsRcd &rcd)
HcalTextCalibrations(const edm::ParameterSet &)
std::unique_ptr< HcalTPChannelParameters > produceTPChannelParameters(const HcalTPChannelParametersRcd &rcd)
std::unique_ptr< HcalQIETypes > produceQIETypes(const HcalQIETypesRcd &rcd)
Namespace of DDCMS conversion namespace.
std::unique_ptr< HcalTimingParams > produceTimingParams(const HcalTimingParamsRcd &rcd)
std::unique_ptr< HcalTPParameters > produceTPParameters(const HcalTPParametersRcd &rcd)
std::unique_ptr< HcalElectronicsMap > produceElectronicsMap(const HcalElectronicsMapRcd &rcd)
std::unique_ptr< HcalGains > produceGains(const HcalGainsRcd &rcd)
char data[epos_bytes_allocation]
std::unique_ptr< HcalRespCorrs > produceRespCorrs(const HcalRespCorrsRcd &rcd)
std::unique_ptr< HcalFrontEndMap > produceFrontEndMap(const HcalFrontEndMapRcd &rcd)
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
std::unique_ptr< HcalLutMetadata > produceLutMetadata(const HcalLutMetadataRcd &rcd)
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
std::unique_ptr< HcalTimeCorrs > produceTimeCorrs(const HcalTimeCorrsRcd &rcd)
~HcalTextCalibrations() override
std::unique_ptr< HcalFlagHFDigiTimeParams > produceFlagHFDigiTimeParams(const HcalFlagHFDigiTimeParamsRcd &rcd)
const char * name() const
std::unique_ptr< HcalValidationCorrs > produceValidationCorrs(const HcalValidationCorrsRcd &rcd)