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> ();
42 else if (objectName ==
"PedestalWidths") {
44 findingRecord <HcalPedestalWidthsRcd> ();
46 else if (objectName ==
"Gains") {
48 findingRecord <HcalGainsRcd> ();
50 else if (objectName ==
"GainWidths") {
52 findingRecord <HcalGainWidthsRcd> ();
54 else if (objectName ==
"QIEData") {
56 findingRecord <HcalQIEDataRcd> ();
58 else if (objectName ==
"QIETypes") {
60 findingRecord <HcalQIETypesRcd> ();
62 else if (objectName ==
"ChannelQuality") {
64 findingRecord <HcalChannelQualityRcd> ();
66 else if (objectName ==
"ZSThresholds") {
68 findingRecord <HcalZSThresholdsRcd> ();
70 else if (objectName ==
"RespCorrs") {
72 findingRecord <HcalRespCorrsRcd> ();
74 else if (objectName ==
"LUTCorrs") {
76 findingRecord <HcalLUTCorrsRcd> ();
78 else if (objectName ==
"PFCorrs") {
80 findingRecord <HcalPFCorrsRcd> ();
82 else if (objectName ==
"TimeCorrs") {
84 findingRecord <HcalTimeCorrsRcd> ();
86 else if (objectName ==
"L1TriggerObjects") {
88 findingRecord <HcalL1TriggerObjectsRcd> ();
90 else if (objectName ==
"ElectronicsMap") {
92 findingRecord <HcalElectronicsMapRcd> ();
94 else if (objectName ==
"FrontEndMap") {
96 findingRecord <HcalFrontEndMapRcd> ();
98 else if (objectName ==
"ValidationCorrs") {
100 findingRecord <HcalValidationCorrsRcd> ();
102 else if (objectName ==
"LutMetadata") {
104 findingRecord <HcalLutMetadataRcd> ();
106 else if (objectName ==
"DcsValues") {
108 findingRecord <HcalDcsRcd> ();
110 else if (objectName ==
"DcsMap") {
112 findingRecord <HcalDcsMapRcd> ();
114 else if (objectName ==
"RecoParams") {
116 findingRecord <HcalRecoParamsRcd> ();
118 else if (objectName ==
"TimingParams") {
120 findingRecord <HcalTimingParamsRcd> ();
122 else if (objectName ==
"LongRecoParams") {
124 findingRecord <HcalLongRecoParamsRcd> ();
126 else if (objectName ==
"ZDCLowGainFractions") {
128 findingRecord <HcalZDCLowGainFractionsRcd> ();
130 else if (objectName ==
"MCParams") {
132 findingRecord <HcalMCParamsRcd> ();
134 else if (objectName ==
"FlagHFDigiTimeParams") {
136 findingRecord <HcalFlagHFDigiTimeParamsRcd> ();
138 else if (objectName ==
"SiPMParameters") {
140 findingRecord <HcalSiPMParametersRcd> ();
142 else if (objectName ==
"SiPMCharacteristics") {
144 findingRecord <HcalSiPMCharacteristicsRcd> ();
146 else if (objectName ==
"TPChannelParameters") {
148 findingRecord <HcalTPChannelParametersRcd> ();
150 else if (objectName ==
"TPParameters") {
152 findingRecord <HcalTPParametersRcd> ();
155 std::cerr <<
"HcalTextCalibrations-> Unknown object name '" << objectName
156 <<
"', known names are: " 157 <<
"Pedestals PedestalWidths Gains GainWidths QIEData QIETypes ChannelQuality ElectronicsMap " 158 <<
"FrontEndMap ZSThresholds RespCorrs LUTCorrs PFCorrs TimeCorrs L1TriggerObjects " 159 <<
"ValidationCorrs LutMetadata DcsValues DcsMap " 160 <<
"RecoParams LongRecoParams ZDCLowGainFraction FlagHFDigiTimeParams MCParams " 161 <<
"SiPMParameters SiPMCharacteristics TPChannelParameters TPParameters" << std::endl;
182 template <
class T,
template <
class>
class F>
184 std::ifstream inStream (fFile.c_str ());
185 if (!inStream.good ()) {
186 std::cerr <<
"HcalTextCalibrations-> Unable to open file '" << fFile <<
"'" << std::endl;
187 throw cms::Exception(
"FileNotFound") <<
"Unable to open '" << fFile <<
"'" << std::endl;
189 auto result = F<T>(topo)(inStream);
191 std::cerr <<
"HcalTextCalibrations-> Can not read object from file '" << fFile <<
"'" << std::endl;
192 throw cms::Exception(
"ReadError") <<
"Can not read object from file '" << fFile <<
"'" << std::endl;
196 template <
class T> std::unique_ptr<T>
get_impl (
const std::string& fFile) {
return produce_impl<T,HcalTextCalibrations::CheckGetObject>(fFile); }
198 template <
class T> std::unique_ptr<T>
create_impl (
const std::string& fFile) {
return produce_impl<T,HcalTextCalibrations::CheckCreateObject>(fFile); }
206 return get_impl_topo<HcalPedestals> (mInputs [
"Pedestals"],topo);
213 return get_impl_topo<HcalPedestalWidths> (mInputs [
"PedestalWidths"],topo);
220 return get_impl_topo<HcalGains> (mInputs [
"Gains"],topo);
227 return get_impl_topo<HcalGainWidths> (mInputs [
"GainWidths"],topo);
234 return get_impl_topo<HcalQIEData> (mInputs [
"QIEData"],topo);
241 return get_impl_topo<HcalQIETypes> (mInputs [
"QIETypes"],topo);
248 return get_impl_topo<HcalChannelQuality> (mInputs [
"ChannelQuality"],topo);
254 return get_impl_topo<HcalZSThresholds> (mInputs [
"ZSThresholds"],topo);
261 return get_impl_topo<HcalRespCorrs> (mInputs [
"RespCorrs"],topo);
268 return get_impl_topo<HcalLUTCorrs> (mInputs [
"LUTCorrs"],topo);
275 return get_impl_topo<HcalPFCorrs> (mInputs [
"PFCorrs"],topo);
282 return get_impl_topo<HcalTimeCorrs> (mInputs [
"TimeCorrs"],topo);
289 return get_impl_topo<HcalL1TriggerObjects> (mInputs [
"L1TriggerObjects"],topo);
293 return create_impl<HcalElectronicsMap> (mInputs [
"ElectronicsMap"]);
297 return create_impl<HcalFrontEndMap> (mInputs [
"FrontEndMap"]);
304 return get_impl_topo<HcalValidationCorrs> (mInputs [
"ValidationCorrs"],topo);
311 return get_impl_topo<HcalLutMetadata> (mInputs [
"LutMetadata"],topo);
314 std::unique_ptr<HcalDcsValues>
316 return get_impl<HcalDcsValues> (mInputs [
"DcsValues"]);
320 return create_impl<HcalDcsMap> (mInputs [
"DcsMap"]);
327 return get_impl_topo<HcalRecoParams> (mInputs [
"RecoParams"],topo);
334 return get_impl_topo<HcalLongRecoParams> (mInputs [
"LongRecoParams"],topo);
341 return get_impl_topo<HcalZDCLowGainFractions> (mInputs [
"ZDCLowGainFractions"],topo);
348 return get_impl_topo<HcalTimingParams> (mInputs [
"TimingParams"],topo);
354 return get_impl_topo<HcalMCParams> (mInputs [
"MCParams"],topo);
361 return get_impl_topo<HcalFlagHFDigiTimeParams> (mInputs [
"FlagHFDigiTimeParams"],topo);
368 return get_impl_topo<HcalSiPMParameters> (mInputs [
"SiPMParameters"],topo);
372 return create_impl<HcalSiPMCharacteristics> (mInputs [
"SiPMCharacteristics"]);
379 return get_impl_topo<HcalTPChannelParameters> (mInputs [
"TPChannelParameters"],topo);
383 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< T > get_impl(const std::string &fFile)
std::unique_ptr< T > get_impl_topo(const std::string &fFile, const HcalTopology *topo)
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)
std::unique_ptr< T > create_impl(const std::string &fFile)
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)
const DepRecordT & getRecord() const
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)
HcalTextCalibrations(const edm::ParameterSet &)
const char * name() const
std::unique_ptr< T > produce_impl(const std::string &fFile, const HcalTopology *topo=0)
std::unique_ptr< HcalTPChannelParameters > produceTPChannelParameters(const HcalTPChannelParametersRcd &rcd)
std::unique_ptr< HcalQIETypes > produceQIETypes(const HcalQIETypesRcd &rcd)
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)