31 std::vector<edm::ParameterSet>
data = iConfig.
getParameter<std::vector<edm::ParameterSet> >(
"input");
32 std::vector<edm::ParameterSet>::iterator request =
data.begin();
33 for (; request !=
data.end(); ++request) {
40 findingRecord<HcalPedestalsRcd>();
43 findingRecord<HcalPedestalWidthsRcd>();
44 }
else if (
objectName ==
"EffectivePedestals") {
48 findingRecord<HcalPedestalsRcd>();
49 }
else if (
objectName ==
"EffectivePedestalWidths") {
53 findingRecord<HcalPedestalWidthsRcd>();
56 findingRecord<HcalGainsRcd>();
59 findingRecord<HcalGainWidthsRcd>();
62 findingRecord<HcalQIEDataRcd>();
65 findingRecord<HcalQIETypesRcd>();
69 findingRecord<HcalChannelQualityRcd>();
72 findingRecord<HcalZSThresholdsRcd>();
75 findingRecord<HcalRespCorrsRcd>();
78 findingRecord<HcalLUTCorrsRcd>();
81 findingRecord<HcalPFCorrsRcd>();
84 findingRecord<HcalTimeCorrsRcd>();
87 findingRecord<HcalL1TriggerObjectsRcd>();
90 findingRecord<HcalElectronicsMapRcd>();
93 findingRecord<HcalFrontEndMapRcd>();
96 findingRecord<HcalValidationCorrsRcd>();
99 findingRecord<HcalLutMetadataRcd>();
102 findingRecord<HcalDcsRcd>();
105 findingRecord<HcalDcsMapRcd>();
108 findingRecord<HcalRecoParamsRcd>();
111 findingRecord<HcalTimingParamsRcd>();
114 findingRecord<HcalLongRecoParamsRcd>();
115 }
else if (
objectName ==
"ZDCLowGainFractions") {
117 findingRecord<HcalZDCLowGainFractionsRcd>();
120 findingRecord<HcalMCParamsRcd>();
121 }
else if (
objectName ==
"FlagHFDigiTimeParams") {
123 findingRecord<HcalFlagHFDigiTimeParamsRcd>();
126 findingRecord<HcalSiPMParametersRcd>();
127 }
else if (
objectName ==
"SiPMCharacteristics") {
129 findingRecord<HcalSiPMCharacteristicsRcd>();
130 }
else if (
objectName ==
"TPChannelParameters") {
132 findingRecord<HcalTPChannelParametersRcd>();
135 findingRecord<HcalTPParametersRcd>();
137 std::cerr <<
"HcalTextCalibrations-> Unknown object name '" <<
objectName <<
"', known names are: "
138 <<
"Pedestals PedestalWidths Gains GainWidths QIEData QIETypes ChannelQuality ElectronicsMap "
139 <<
"FrontEndMap ZSThresholds RespCorrs LUTCorrs PFCorrs TimeCorrs L1TriggerObjects "
140 <<
"ValidationCorrs LutMetadata DcsValues DcsMap "
141 <<
"RecoParams LongRecoParams ZDCLowGainFraction FlagHFDigiTimeParams MCParams "
142 <<
"SiPMParameters SiPMCharacteristics TPChannelParameters TPParameters" << std::endl;
160 template <
class T,
template <
class>
class F>
162 std::ifstream inStream(fFile.c_str());
163 if (!inStream.good()) {
164 std::cerr <<
"HcalTextCalibrations-> Unable to open file '" << fFile <<
"'" << std::endl;
165 throw cms::Exception(
"FileNotFound") <<
"Unable to open '" << fFile <<
"'" << std::endl;
167 auto result = F<T>(topo)(inStream);
169 std::cerr <<
"HcalTextCalibrations-> Can not read object from file '" << fFile <<
"'" << std::endl;
170 throw cms::Exception(
"ReadError") <<
"Can not read object from file '" << fFile <<
"'" << std::endl;
175 std::unique_ptr<T> get_impl(
const std::string& fFile) {
176 return produce_impl<T, HcalTextCalibrations::CheckGetObject>(fFile);
180 return produce_impl<T, HcalTextCalibrations::CheckGetObjectTopo>(fFile, topo);
183 std::unique_ptr<T> create_impl(
const std::string& fFile) {
184 return produce_impl<T, HcalTextCalibrations::CheckCreateObject>(fFile);
190 return get_impl_topo<HcalPedestals>(mInputs[
n], &rcd.
get(mTokens[
n]));
195 return get_impl_topo<HcalPedestalWidths>(mInputs[
n], &rcd.
get(mTokens[
n]));
200 return get_impl_topo<HcalPedestals>(mInputs[
n], &rcd.
get(mTokens[
n]));
206 return get_impl_topo<HcalPedestalWidths>(mInputs[
n], &rcd.
get(mTokens[
n]));
211 return get_impl_topo<HcalGains>(mInputs[
n], &rcd.get(mTokens[
n]));
216 return get_impl_topo<HcalGainWidths>(mInputs[
n], &rcd.
get(mTokens[
n]));
221 return get_impl_topo<HcalQIEData>(mInputs[
n], &rcd.
get(mTokens[
n]));
226 return get_impl_topo<HcalQIETypes>(mInputs[
n], &rcd.
get(mTokens[
n]));
231 return get_impl_topo<HcalChannelQuality>(mInputs[
n], &rcd.
get(mTokens[
n]));
236 return get_impl_topo<HcalZSThresholds>(mInputs[
n], &rcd.
get(mTokens[
n]));
241 return get_impl_topo<HcalRespCorrs>(mInputs[
n], &rcd.
get(mTokens[
n]));
246 return get_impl_topo<HcalLUTCorrs>(mInputs[
n], &rcd.
get(mTokens[
n]));
251 return get_impl_topo<HcalPFCorrs>(mInputs[
n], &rcd.
get(mTokens[
n]));
256 return get_impl_topo<HcalTimeCorrs>(mInputs[
n], &rcd.
get(mTokens[
n]));
261 return get_impl_topo<HcalL1TriggerObjects>(mInputs[
n], &rcd.
get(mTokens[
n]));
265 return create_impl<HcalElectronicsMap>(mInputs[
"ElectronicsMap"]);
269 return create_impl<HcalFrontEndMap>(mInputs[
"FrontEndMap"]);
274 return get_impl_topo<HcalValidationCorrs>(mInputs[
n], &rcd.
get(mTokens[
n]));
279 return get_impl_topo<HcalLutMetadata>(mInputs[
n], &rcd.
get(mTokens[
n]));
283 return get_impl<HcalDcsValues>(mInputs[
"DcsValues"]);
287 return create_impl<HcalDcsMap>(mInputs[
"DcsMap"]);
292 return get_impl_topo<HcalRecoParams>(mInputs[
n], &rcd.
get(mTokens[
n]));
297 return get_impl_topo<HcalLongRecoParams>(mInputs[
n], &rcd.
get(mTokens[
n]));
303 return get_impl_topo<HcalZDCLowGainFractions>(mInputs[
n], &rcd.
get(mTokens[
n]));
308 return get_impl_topo<HcalTimingParams>(mInputs[
n], &rcd.
get(mTokens[
n]));
312 return get_impl_topo<HcalMCParams>(mInputs[
n], &rcd.
get(mTokens[
n]));
318 return get_impl_topo<HcalFlagHFDigiTimeParams>(mInputs[
n], &rcd.
get(mTokens[
n]));
323 return get_impl_topo<HcalSiPMParameters>(mInputs[
n], &rcd.
get(mTokens[
n]));
328 return create_impl<HcalSiPMCharacteristics>(mInputs[
"SiPMCharacteristics"]);
334 return get_impl_topo<HcalTPChannelParameters>(mInputs[
n], &rcd.
get(mTokens[
n]));
338 return get_impl<HcalTPParameters>(mInputs[
"TPParameters"]);