41 std::vector<edm::ParameterSet>
data = iConfig.
getParameter<std::vector<edm::ParameterSet> >(
"input");
42 std::vector<edm::ParameterSet>::iterator request = data.begin ();
43 for (; request != data.end (); ++request) {
47 if (objectName ==
"Pedestals") {
49 findingRecord <CastorPedestalsRcd> ();
51 else if (objectName ==
"PedestalWidths") {
53 findingRecord <CastorPedestalWidthsRcd> ();
55 else if (objectName ==
"Gains") {
57 findingRecord <CastorGainsRcd> ();
59 else if (objectName ==
"GainWidths") {
61 findingRecord <CastorGainWidthsRcd> ();
63 else if (objectName ==
"QIEData") {
65 findingRecord <CastorQIEDataRcd> ();
67 else if (objectName ==
"ChannelQuality") {
69 findingRecord <CastorChannelQualityRcd> ();
71 else if (objectName ==
"ElectronicsMap") {
73 findingRecord <CastorElectronicsMapRcd> ();
75 else if (objectName ==
"RecoParams") {
77 findingRecord <CastorRecoParamsRcd> ();
79 else if (objectName ==
"SaturationCorrs") {
81 findingRecord <CastorSaturationCorrsRcd> ();
84 std::cerr <<
"CastorTextCalibrations-> Unknown object name '" << objectName
85 <<
"', known names are: "
86 <<
"Pedestals PedestalWidths Gains GainWidths QIEData ChannelQuality ElectronicsMap RecoParams SaturationCorrs"
110 std::auto_ptr<T>
result (
new T ());
111 std::ifstream inStream (fFile.c_str ());
112 if (!inStream.good ()) {
113 std::cerr <<
"CastorTextCalibrations-> Unable to open file '" << fFile <<
"'" << std::endl;
114 throw cms::Exception(
"FileNotFound") <<
"Unable to open '" << fFile <<
"'" << std::endl;
117 std::cerr <<
"CastorTextCalibrations-> Can not read object from file '" << fFile <<
"'" << std::endl;
118 throw cms::Exception(
"ReadError") <<
"Can not read object from file '" << fFile <<
"'" << std::endl;
125 return produce_impl<CastorPedestals> (mInputs [
"Pedestals"]);
129 return produce_impl<CastorPedestalWidths> (mInputs [
"PedestalWidths"]);
133 return produce_impl<CastorGains> (mInputs [
"Gains"]);
137 return produce_impl<CastorGainWidths> (mInputs [
"GainWidths"]);
141 return produce_impl<CastorQIEData> (mInputs [
"QIEData"]);
145 return produce_impl<CastorChannelQuality> (mInputs [
"ChannelQuality"]);
149 return produce_impl<CastorElectronicsMap> (mInputs [
"ElectronicsMap"]);
153 return produce_impl<CastorRecoParams> (mInputs [
"RecoParams"]);
157 return produce_impl<CastorSaturationCorrs> (mInputs [
"SaturationCorrs"]);
T getParameter(std::string const &) const
std::auto_ptr< CastorElectronicsMap > produceElectronicsMap(const CastorElectronicsMapRcd &rcd)
std::auto_ptr< CastorChannelQuality > produceChannelQuality(const CastorChannelQualityRcd &rcd)
static const IOVSyncValue & endOfTime()
std::auto_ptr< CastorRecoParams > produceRecoParams(const CastorRecoParamsRcd &rcd)
virtual void setIntervalFor(const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &, edm::ValidityInterval &)
std::pair< Time_t, Time_t > ValidityInterval
static const IOVSyncValue & beginOfTime()
bool getObject(std::istream &fInput, CastorPedestals *fObject)
const char * name() const
~CastorTextCalibrations()
std::auto_ptr< CastorPedestals > producePedestals(const CastorPedestalsRcd &rcd)
std::auto_ptr< CastorPedestalWidths > producePedestalWidths(const CastorPedestalWidthsRcd &rcd)
std::auto_ptr< CastorQIEData > produceQIEData(const CastorQIEDataRcd &rcd)
char data[epos_bytes_allocation]
std::auto_ptr< CastorGainWidths > produceGainWidths(const CastorGainWidthsRcd &rcd)
CastorTextCalibrations(const edm::ParameterSet &)
std::string fullPath() const
std::auto_ptr< T > produce_impl(const std::string &fFile)
std::auto_ptr< CastorGains > produceGains(const CastorGainsRcd &rcd)
std::auto_ptr< CastorSaturationCorrs > produceSaturationCorrs(const CastorSaturationCorrsRcd &rcd)