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<HcalQIEDataRcd>();
64 findingRecord<HcalQIETypesRcd>();
68 findingRecord<HcalChannelQualityRcd>();
71 findingRecord<HcalZSThresholdsRcd>();
74 findingRecord<HcalRespCorrsRcd>();
77 findingRecord<HcalLUTCorrsRcd>();
80 findingRecord<HcalPFCorrsRcd>();
83 findingRecord<HcalTimeCorrsRcd>();
86 findingRecord<HcalL1TriggerObjectsRcd>();
89 findingRecord<HcalElectronicsMapRcd>();
92 findingRecord<HcalFrontEndMapRcd>();
95 findingRecord<HcalValidationCorrsRcd>();
98 findingRecord<HcalLutMetadataRcd>();
101 findingRecord<HcalDcsRcd>();
104 findingRecord<HcalDcsMapRcd>();
107 findingRecord<HcalRecoParamsRcd>();
110 findingRecord<HcalTimingParamsRcd>();
113 findingRecord<HcalLongRecoParamsRcd>();
114 }
else if (
objectName ==
"ZDCLowGainFractions") {
116 findingRecord<HcalZDCLowGainFractionsRcd>();
119 findingRecord<HcalMCParamsRcd>();
120 }
else if (
objectName ==
"FlagHFDigiTimeParams") {
122 findingRecord<HcalFlagHFDigiTimeParamsRcd>();
125 findingRecord<HcalSiPMParametersRcd>();
126 }
else if (
objectName ==
"SiPMCharacteristics") {
128 findingRecord<HcalSiPMCharacteristicsRcd>();
129 }
else if (
objectName ==
"TPChannelParameters") {
131 findingRecord<HcalTPChannelParametersRcd>();
134 findingRecord<HcalTPParametersRcd>();
136 std::cerr <<
"HcalTextCalibrations-> Unknown object name '" <<
objectName <<
"', known names are: "
137 <<
"Pedestals PedestalWidths Gains GainWidths QIEData QIETypes ChannelQuality ElectronicsMap "
138 <<
"FrontEndMap ZSThresholds RespCorrs LUTCorrs PFCorrs TimeCorrs L1TriggerObjects "
139 <<
"ValidationCorrs LutMetadata DcsValues DcsMap "
140 <<
"RecoParams LongRecoParams ZDCLowGainFraction FlagHFDigiTimeParams MCParams "
141 <<
"SiPMParameters SiPMCharacteristics TPChannelParameters TPParameters" << std::endl;
159 template <
class T,
template <
class>
class F>
161 std::ifstream inStream(fFile.c_str());
162 if (!inStream.good()) {
163 std::cerr <<
"HcalTextCalibrations-> Unable to open file '" << fFile <<
"'" << std::endl;
164 throw cms::Exception(
"FileNotFound") <<
"Unable to open '" << fFile <<
"'" << std::endl;
166 auto result = F<T>(topo)(inStream);
168 std::cerr <<
"HcalTextCalibrations-> Can not read object from file '" << fFile <<
"'" << std::endl;
169 throw cms::Exception(
"ReadError") <<
"Can not read object from file '" << fFile <<
"'" << std::endl;
174 std::unique_ptr<T> get_impl(
const std::string& fFile) {
175 return produce_impl<T, HcalTextCalibrations::CheckGetObject>(fFile);
179 return produce_impl<T, HcalTextCalibrations::CheckGetObjectTopo>(fFile, topo);
182 std::unique_ptr<T> create_impl(
const std::string& fFile) {
183 return produce_impl<T, HcalTextCalibrations::CheckCreateObject>(fFile);
189 return get_impl_topo<HcalPedestals>(mInputs[
n], &rcd.
get(mTokens[
n]));
194 return get_impl_topo<HcalPedestalWidths>(mInputs[
n], &rcd.
get(mTokens[
n]));
199 return get_impl_topo<HcalPedestals>(mInputs[
n], &rcd.
get(mTokens[
n]));
205 return get_impl_topo<HcalPedestalWidths>(mInputs[
n], &rcd.
get(mTokens[
n]));
210 return get_impl_topo<HcalGains>(mInputs[
n], &rcd.get(mTokens[
n]));
215 return get_impl_topo<HcalGainWidths>(mInputs[
n], &rcd.
get(mTokens[
n]));
220 return get_impl_topo<HcalQIEData>(mInputs[
n], &rcd.
get(mTokens[
n]));
225 return get_impl_topo<HcalQIETypes>(mInputs[
n], &rcd.
get(mTokens[
n]));
230 return get_impl_topo<HcalChannelQuality>(mInputs[
n], &rcd.
get(mTokens[
n]));
235 return get_impl_topo<HcalZSThresholds>(mInputs[
n], &rcd.
get(mTokens[
n]));
240 return get_impl_topo<HcalRespCorrs>(mInputs[
n], &rcd.
get(mTokens[
n]));
245 return get_impl_topo<HcalLUTCorrs>(mInputs[
n], &rcd.
get(mTokens[
n]));
250 return get_impl_topo<HcalPFCorrs>(mInputs[
n], &rcd.
get(mTokens[
n]));
255 return get_impl_topo<HcalTimeCorrs>(mInputs[
n], &rcd.
get(mTokens[
n]));
260 return get_impl_topo<HcalL1TriggerObjects>(mInputs[
n], &rcd.
get(mTokens[
n]));
264 return create_impl<HcalElectronicsMap>(mInputs[
"ElectronicsMap"]);
268 return create_impl<HcalFrontEndMap>(mInputs[
"FrontEndMap"]);
273 return get_impl_topo<HcalValidationCorrs>(mInputs[
n], &rcd.
get(mTokens[
n]));
278 return get_impl_topo<HcalLutMetadata>(mInputs[
n], &rcd.
get(mTokens[
n]));
282 return get_impl<HcalDcsValues>(mInputs[
"DcsValues"]);
286 return create_impl<HcalDcsMap>(mInputs[
"DcsMap"]);
291 return get_impl_topo<HcalRecoParams>(mInputs[
n], &rcd.
get(mTokens[
n]));
296 return get_impl_topo<HcalLongRecoParams>(mInputs[
n], &rcd.
get(mTokens[
n]));
302 return get_impl_topo<HcalZDCLowGainFractions>(mInputs[
n], &rcd.
get(mTokens[
n]));
307 return get_impl_topo<HcalTimingParams>(mInputs[
n], &rcd.
get(mTokens[
n]));
311 return get_impl_topo<HcalMCParams>(mInputs[
n], &rcd.
get(mTokens[
n]));
317 return get_impl_topo<HcalFlagHFDigiTimeParams>(mInputs[
n], &rcd.
get(mTokens[
n]));
322 return get_impl_topo<HcalSiPMParameters>(mInputs[
n], &rcd.
get(mTokens[
n]));
327 return create_impl<HcalSiPMCharacteristics>(mInputs[
"SiPMCharacteristics"]);
333 return get_impl_topo<HcalTPChannelParameters>(mInputs[
n], &rcd.
get(mTokens[
n]));
337 return get_impl<HcalTPParameters>(mInputs[
"TPParameters"]);