58 std::map<std::string, std::string>
mInputs;
70 std::vector<edm::ParameterSet>
data = iConfig.
getParameter<std::vector<edm::ParameterSet> >(
"input");
71 std::vector<edm::ParameterSet>::iterator request = data.begin();
72 for (; request != data.end(); ++request) {
76 if (objectName ==
"Pedestals") {
78 findingRecord<CastorPedestalsRcd>();
79 }
else if (objectName ==
"PedestalWidths") {
81 findingRecord<CastorPedestalWidthsRcd>();
82 }
else if (objectName ==
"Gains") {
84 findingRecord<CastorGainsRcd>();
85 }
else if (objectName ==
"GainWidths") {
87 findingRecord<CastorGainWidthsRcd>();
88 }
else if (objectName ==
"QIEData") {
90 findingRecord<CastorQIEDataRcd>();
91 }
else if (objectName ==
"ChannelQuality") {
93 findingRecord<CastorChannelQualityRcd>();
94 }
else if (objectName ==
"ElectronicsMap") {
96 findingRecord<CastorElectronicsMapRcd>();
97 }
else if (objectName ==
"RecoParams") {
99 findingRecord<CastorRecoParamsRcd>();
100 }
else if (objectName ==
"SaturationCorrs") {
102 findingRecord<CastorSaturationCorrsRcd>();
104 std::cerr <<
"CastorTextCalibrations-> Unknown object name '" << objectName <<
"', known names are: "
105 <<
"Pedestals PedestalWidths Gains GainWidths QIEData ChannelQuality ElectronicsMap RecoParams "
127 std::unique_ptr<T>
result(
new T());
128 std::ifstream inStream(fFile.c_str());
129 if (!inStream.good()) {
130 std::cerr <<
"CastorTextCalibrations-> Unable to open file '" << fFile <<
"'" << std::endl;
131 throw cms::Exception(
"FileNotFound") <<
"Unable to open '" << fFile <<
"'" << std::endl;
134 std::cerr <<
"CastorTextCalibrations-> Can not read object from file '" << fFile <<
"'" << std::endl;
135 throw cms::Exception(
"ReadError") <<
"Can not read object from file '" << fFile <<
"'" << std::endl;
141 return produce_impl<CastorPedestals>(mInputs[
"Pedestals"]);
145 return produce_impl<CastorPedestalWidths>(mInputs[
"PedestalWidths"]);
149 return produce_impl<CastorGains>(mInputs[
"Gains"]);
153 return produce_impl<CastorGainWidths>(mInputs[
"GainWidths"]);
157 return produce_impl<CastorQIEData>(mInputs[
"QIEData"]);
161 return produce_impl<CastorChannelQuality>(mInputs[
"ChannelQuality"]);
165 return produce_impl<CastorElectronicsMap>(mInputs[
"ElectronicsMap"]);
169 return produce_impl<CastorRecoParams>(mInputs[
"RecoParams"]);
174 return produce_impl<CastorSaturationCorrs>(mInputs[
"SaturationCorrs"]);
static const IOVSyncValue & endOfTime()
std::unique_ptr< CastorPedestals > producePedestals(const CastorPedestalsRcd &rcd)
std::pair< Time_t, Time_t > ValidityInterval
void setIntervalFor(const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &, edm::ValidityInterval &) override
std::unique_ptr< CastorGainWidths > produceGainWidths(const CastorGainWidthsRcd &rcd)
std::unique_ptr< CastorPedestalWidths > producePedestalWidths(const CastorPedestalWidthsRcd &rcd)
std::unique_ptr< T > produce_impl(const std::string &fFile)
std::unique_ptr< CastorRecoParams > produceRecoParams(const CastorRecoParamsRcd &rcd)
static const IOVSyncValue & beginOfTime()
const char * name() const
std::map< std::string, std::string > mInputs
#define DEFINE_FWK_EVENTSETUP_SOURCE(type)
std::unique_ptr< CastorChannelQuality > produceChannelQuality(const CastorChannelQualityRcd &rcd)
bool getObject(std::istream &fInput, CastorPedestals &fObject)
T getParameter(std::string const &) const
char data[epos_bytes_allocation]
std::unique_ptr< CastorSaturationCorrs > produceSaturationCorrs(const CastorSaturationCorrsRcd &rcd)
std::unique_ptr< CastorElectronicsMap > produceElectronicsMap(const CastorElectronicsMapRcd &rcd)
std::string fullPath() const
~CastorTextCalibrations() override
CastorTextCalibrations(const edm::ParameterSet &)
std::unique_ptr< CastorQIEData > produceQIEData(const CastorQIEDataRcd &rcd)
std::unique_ptr< CastorGains > produceGains(const CastorGainsRcd &rcd)