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) {
38 if (objectName ==
"Pedestals") {
40 findingRecord<HcalPedestalsRcd>();
41 }
else if (objectName ==
"PedestalWidths") {
43 findingRecord<HcalPedestalWidthsRcd>();
44 }
else if (objectName ==
"EffectivePedestals") {
46 .setConsumes(mTokens[objectName]);
47 findingRecord<HcalPedestalsRcd>();
48 }
else if (objectName ==
"EffectivePedestalWidths") {
50 .setConsumes(mTokens[objectName]);
51 findingRecord<HcalPedestalWidthsRcd>();
52 }
else if (objectName ==
"Gains") {
54 findingRecord<HcalGainsRcd>();
55 }
else if (objectName ==
"GainWidths") {
57 findingRecord<HcalGainWidthsRcd>();
58 }
else if (objectName ==
"QIEData") {
60 findingRecord<HcalQIEDataRcd>();
61 }
else if (objectName ==
"QIETypes") {
63 findingRecord<HcalQIETypesRcd>();
64 }
else if (objectName ==
"ChannelQuality") {
66 .setConsumes(mTokens[objectName]);
67 findingRecord<HcalChannelQualityRcd>();
68 }
else if (objectName ==
"ZSThresholds") {
70 findingRecord<HcalZSThresholdsRcd>();
71 }
else if (objectName ==
"RespCorrs") {
73 findingRecord<HcalRespCorrsRcd>();
74 }
else if (objectName ==
"LUTCorrs") {
76 findingRecord<HcalLUTCorrsRcd>();
77 }
else if (objectName ==
"PFCorrs") {
79 findingRecord<HcalPFCorrsRcd>();
80 }
else if (objectName ==
"TimeCorrs") {
82 findingRecord<HcalTimeCorrsRcd>();
83 }
else if (objectName ==
"L1TriggerObjects") {
85 findingRecord<HcalL1TriggerObjectsRcd>();
86 }
else if (objectName ==
"ElectronicsMap") {
88 findingRecord<HcalElectronicsMapRcd>();
89 }
else if (objectName ==
"FrontEndMap") {
91 findingRecord<HcalFrontEndMapRcd>();
92 }
else if (objectName ==
"ValidationCorrs") {
94 findingRecord<HcalValidationCorrsRcd>();
95 }
else if (objectName ==
"LutMetadata") {
97 findingRecord<HcalLutMetadataRcd>();
98 }
else if (objectName ==
"DcsValues") {
100 findingRecord<HcalDcsRcd>();
101 }
else if (objectName ==
"DcsMap") {
103 findingRecord<HcalDcsMapRcd>();
104 }
else if (objectName ==
"RecoParams") {
106 findingRecord<HcalRecoParamsRcd>();
107 }
else if (objectName ==
"TimingParams") {
109 findingRecord<HcalTimingParamsRcd>();
110 }
else if (objectName ==
"LongRecoParams") {
112 findingRecord<HcalLongRecoParamsRcd>();
113 }
else if (objectName ==
"ZDCLowGainFractions") {
115 findingRecord<HcalZDCLowGainFractionsRcd>();
116 }
else if (objectName ==
"MCParams") {
118 findingRecord<HcalMCParamsRcd>();
119 }
else if (objectName ==
"FlagHFDigiTimeParams") {
121 findingRecord<HcalFlagHFDigiTimeParamsRcd>();
122 }
else if (objectName ==
"SiPMParameters") {
124 findingRecord<HcalSiPMParametersRcd>();
125 }
else if (objectName ==
"SiPMCharacteristics") {
127 findingRecord<HcalSiPMCharacteristicsRcd>();
128 }
else if (objectName ==
"TPChannelParameters") {
130 findingRecord<HcalTPChannelParametersRcd>();
131 }
else if (objectName ==
"TPParameters") {
133 findingRecord<HcalTPParametersRcd>();
135 std::cerr <<
"HcalTextCalibrations-> Unknown object name '" << objectName <<
"', known names are: " 136 <<
"Pedestals PedestalWidths Gains GainWidths QIEData QIETypes ChannelQuality ElectronicsMap " 137 <<
"FrontEndMap ZSThresholds RespCorrs LUTCorrs PFCorrs TimeCorrs L1TriggerObjects " 138 <<
"ValidationCorrs LutMetadata DcsValues DcsMap " 139 <<
"RecoParams LongRecoParams ZDCLowGainFraction FlagHFDigiTimeParams MCParams " 140 <<
"SiPMParameters SiPMCharacteristics TPChannelParameters TPParameters" << std::endl;
158 template <
class T,
template <
class>
class F>
160 std::ifstream inStream(fFile.c_str());
161 if (!inStream.good()) {
162 std::cerr <<
"HcalTextCalibrations-> Unable to open file '" << fFile <<
"'" << std::endl;
163 throw cms::Exception(
"FileNotFound") <<
"Unable to open '" << fFile <<
"'" << std::endl;
165 auto result = F<T>(topo)(inStream);
167 std::cerr <<
"HcalTextCalibrations-> Can not read object from file '" << fFile <<
"'" << std::endl;
168 throw cms::Exception(
"ReadError") <<
"Can not read object from file '" << fFile <<
"'" << std::endl;
173 std::unique_ptr<T> get_impl(
const std::string& fFile) {
174 return produce_impl<T, HcalTextCalibrations::CheckGetObject>(fFile);
178 return produce_impl<T, HcalTextCalibrations::CheckGetObjectTopo>(fFile, topo);
181 std::unique_ptr<T> create_impl(
const std::string& fFile) {
182 return produce_impl<T, HcalTextCalibrations::CheckCreateObject>(fFile);
188 return get_impl_topo<HcalPedestals>(mInputs[
n], &rcd.
get(mTokens[n]));
193 return get_impl_topo<HcalPedestalWidths>(mInputs[
n], &rcd.
get(mTokens[n]));
198 return get_impl_topo<HcalPedestals>(mInputs[
n], &rcd.
get(mTokens[n]));
204 return get_impl_topo<HcalPedestalWidths>(mInputs[
n], &rcd.
get(mTokens[n]));
209 return get_impl_topo<HcalGains>(mInputs[
n], &rcd.
get(mTokens[n]));
214 return get_impl_topo<HcalGainWidths>(mInputs[
n], &rcd.
get(mTokens[n]));
219 return get_impl_topo<HcalQIEData>(mInputs[
n], &rcd.
get(mTokens[n]));
224 return get_impl_topo<HcalQIETypes>(mInputs[
n], &rcd.
get(mTokens[n]));
229 return get_impl_topo<HcalChannelQuality>(mInputs[
n], &rcd.
get(mTokens[n]));
234 return get_impl_topo<HcalZSThresholds>(mInputs[
n], &rcd.
get(mTokens[n]));
239 return get_impl_topo<HcalRespCorrs>(mInputs[
n], &rcd.
get(mTokens[n]));
244 return get_impl_topo<HcalLUTCorrs>(mInputs[
n], &rcd.
get(mTokens[n]));
249 return get_impl_topo<HcalPFCorrs>(mInputs[
n], &rcd.
get(mTokens[n]));
254 return get_impl_topo<HcalTimeCorrs>(mInputs[
n], &rcd.
get(mTokens[n]));
259 return get_impl_topo<HcalL1TriggerObjects>(mInputs[
n], &rcd.
get(mTokens[n]));
263 return create_impl<HcalElectronicsMap>(mInputs[
"ElectronicsMap"]);
267 return create_impl<HcalFrontEndMap>(mInputs[
"FrontEndMap"]);
272 return get_impl_topo<HcalValidationCorrs>(mInputs[
n], &rcd.
get(mTokens[n]));
277 return get_impl_topo<HcalLutMetadata>(mInputs[
n], &rcd.
get(mTokens[n]));
281 return get_impl<HcalDcsValues>(mInputs[
"DcsValues"]);
285 return create_impl<HcalDcsMap>(mInputs[
"DcsMap"]);
290 return get_impl_topo<HcalRecoParams>(mInputs[
n], &rcd.
get(mTokens[n]));
295 return get_impl_topo<HcalLongRecoParams>(mInputs[
n], &rcd.
get(mTokens[n]));
301 return get_impl_topo<HcalZDCLowGainFractions>(mInputs[
n], &rcd.
get(mTokens[n]));
306 return get_impl_topo<HcalTimingParams>(mInputs[
n], &rcd.
get(mTokens[n]));
310 return get_impl_topo<HcalMCParams>(mInputs[
n], &rcd.
get(mTokens[n]));
316 return get_impl_topo<HcalFlagHFDigiTimeParams>(mInputs[
n], &rcd.
get(mTokens[n]));
321 return get_impl_topo<HcalSiPMParameters>(mInputs[
n], &rcd.
get(mTokens[n]));
326 return create_impl<HcalSiPMCharacteristics>(mInputs[
"SiPMCharacteristics"]);
332 return get_impl_topo<HcalTPChannelParameters>(mInputs[
n], &rcd.
get(mTokens[n]));
336 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< T > produce_impl(const std::string &fFile)
std::unique_ptr< HcalZSThresholds > produceZSThresholds(const HcalZSThresholdsRcd &rcd)
std::unique_ptr< HcalSiPMParameters > produceSiPMParameters(const HcalSiPMParametersRcd &rcd)
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
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 &)
const char * name() const
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)
std::string fullPath() const
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
std::unique_ptr< HcalLutMetadata > produceLutMetadata(const HcalLutMetadataRcd &rcd)
std::unique_ptr< HcalTimeCorrs > produceTimeCorrs(const HcalTimeCorrsRcd &rcd)
~HcalTextCalibrations() override
std::unique_ptr< HcalFlagHFDigiTimeParams > produceFlagHFDigiTimeParams(const HcalFlagHFDigiTimeParamsRcd &rcd)
std::unique_ptr< HcalValidationCorrs > produceValidationCorrs(const HcalValidationCorrsRcd &rcd)