46 std::vector<edm::ParameterSet>
data = iConfig.
getParameter<std::vector<edm::ParameterSet> >(
"input");
47 std::vector<edm::ParameterSet>::iterator request = data.begin ();
48 for (; request != data.end (); request++) {
49 std::string
objectName = request->getParameter<std::string> (
"object");
51 if (request->exists(
"version")) mVersion[objectName] = request->getParameter<std::string>(
"version");
52 if (request->exists(
"subversion")) mSubversion[objectName] = request->getParameter<
int>(
"subversion");
53 if (request->exists(
"iov_begin")) mIOVBegin[objectName] = request->getParameter<
int>(
"iov_begin");
54 if (request->exists(
"accessor")) mAccessor[objectName] = request->getParameter<std::string>(
"accessor");
55 if (request->exists(
"query")) mQuery[objectName] = request->getParameter<std::string>(
"query");
57 mInputs [
objectName] = request->getParameter<std::string>(
"tag");
58 if (objectName ==
"Pedestals") {
60 findingRecord <HcalPedestalsRcd> ();
62 else if (objectName ==
"PedestalWidths") {
64 findingRecord <HcalPedestalWidthsRcd> ();
66 else if (objectName ==
"Gains") {
68 findingRecord <HcalGainsRcd> ();
70 else if (objectName ==
"GainWidths") {
72 findingRecord <HcalGainWidthsRcd> ();
74 else if (objectName ==
"QIEData") {
76 findingRecord <HcalQIEDataRcd> ();
78 else if (objectName ==
"ChannelQuality") {
80 findingRecord <HcalChannelQualityRcd> ();
82 else if (objectName ==
"ZSThresholds") {
84 findingRecord <HcalZSThresholdsRcd> ();
86 else if (objectName ==
"RespCorrs") {
88 findingRecord <HcalRespCorrsRcd> ();
90 else if (objectName ==
"L1TriggerObjects") {
92 findingRecord <HcalL1TriggerObjectsRcd> ();
94 else if (objectName ==
"ElectronicsMap") {
96 findingRecord <HcalElectronicsMapRcd> ();
98 else if (objectName ==
"ValidationCorrs") {
100 findingRecord <HcalValidationCorrsRcd> ();
102 else if (objectName ==
"LutMetadata") {
104 findingRecord <HcalLutMetadataRcd> ();
106 else if (objectName ==
"DcsValues") {
108 findingRecord <HcalDcsRcd> ();
111 std::cerr <<
"HcalOmdsCalibrations-> Unknown object name '" << objectName
112 <<
"', known names are: "
113 <<
"Pedestals PedestalWidths Gains GainWidths QIEData ChannelQuality ElectronicsMap "
114 <<
"ZSThresholds RespCorrs L1TriggerObjects ValidationCorrs LutMetadata DcsValues "
138 const static std::string
omds_occi_default_accessor =
"occi://CMS_HCL_APPUSER_R@anyhost/cms_omds_lb?PASSWORD=HCAL_Reader_44,LHWM_VERSION=22";
145 const int fSubversion=1,
146 const int fIOVBegin=1,
149 std::auto_ptr<T>
result (
new T ());
154 }
catch (hcal::exception::ConfigurationDatabaseException &
e) {
155 std::cerr <<
"Cannot connect to the database" << std::endl;
157 oracle::occi::Connection * _connection = db -> getConnection();
159 if (!
HcalDbOmds::getObject (_connection, fTag, fVersion, fSubversion, fIOVBegin, fQuery, &*result)) {
160 std::cerr <<
"HcalOmdsCalibrations-> Can not read tag name '" << fTag <<
"' from database '" << fAccessor <<
"'" << std::endl;
161 throw cms::Exception(
"ReadError") <<
"Can not read tag name '" << fTag <<
"' from database '" << fAccessor <<
"'" << std::endl;
165 std::cerr <<
"Database connection is null. This should NEVER happen here. Something fishy is going on..." << std::endl;
173 return produce_impl<HcalPedestals> (mInputs [
"Pedestals"],
174 mVersion[
"Pedestals"],
175 mSubversion[
"Pedestals"],
176 mIOVBegin[
"Pedestals"],
178 mAccessor[
"Pedestals"]);
182 return produce_impl<HcalPedestalWidths> (mInputs [
"PedestalWidths"],
183 mVersion[
"PedestalWidths"],
184 mSubversion[
"PedestalWidths"],
185 mIOVBegin[
"PedestalWidths"],
186 mQuery[
"PedestalWidths"],
187 mAccessor[
"PedestalWidths"]);
191 return produce_impl<HcalGains> (mInputs [
"Gains"],
193 mSubversion[
"Gains"],
200 return produce_impl<HcalGainWidths> (mInputs [
"GainWidths"],
201 mVersion[
"GainWidths"],
202 mSubversion[
"GainWidths"],
203 mIOVBegin[
"GainWidths"],
204 mQuery[
"GainWidths"],
205 mAccessor[
"GainWidths"]);
209 return produce_impl<HcalQIEData> (mInputs [
"QIEData"],
211 mSubversion[
"QIEData"],
212 mIOVBegin[
"QIEData"],
214 mAccessor[
"QIEData"]);
218 return produce_impl<HcalChannelQuality> (mInputs [
"ChannelQuality"],
219 mVersion[
"ChannelQuality"],
220 mSubversion[
"ChannelQuality"],
221 mIOVBegin[
"ChannelQuality"],
222 mQuery[
"ChannelQuality"],
223 mAccessor[
"ChannelQuality"]);
227 return produce_impl<HcalZSThresholds> (mInputs [
"ZSThresholds"],
228 mVersion[
"ZSThresholds"],
229 mSubversion[
"ZSThresholds"],
230 mIOVBegin[
"ZSThresholds"],
231 mQuery[
"ZSThresholds"],
232 mAccessor[
"ZSThresholds"]);
236 return produce_impl<HcalRespCorrs> (mInputs [
"RespCorrs"],
237 mVersion[
"RespCorrs"],
238 mSubversion[
"RespCorrs"],
239 mIOVBegin[
"RespCorrs"],
241 mAccessor[
"RespCorrs"]);
245 return produce_impl<HcalL1TriggerObjects> (mInputs [
"L1TriggerObjects"],
246 mVersion[
"L1TriggerObjects"],
247 mSubversion[
"L1TriggerObjects"],
248 mIOVBegin[
"L1TriggerObjects"],
249 mQuery[
"L1TriggerObjects"],
250 mAccessor[
"L1TriggerObjects"]);
254 return produce_impl<HcalElectronicsMap> (mInputs [
"ElectronicsMap"],
255 mVersion[
"ElectronicsMap"],
256 mSubversion[
"ElectronicsMap"],
257 mIOVBegin[
"ElectronicsMap"],
258 mQuery[
"ElectronicsMap"],
259 mAccessor[
"ElectronicsMap"]);
263 return produce_impl<HcalValidationCorrs> (mInputs [
"ValidationCorrs"],
264 mVersion[
"ValidationCorrs"],
265 mSubversion[
"ValidationCorrs"],
266 mIOVBegin[
"ValidationCorrs"],
267 mQuery[
"ValidationCorrs"],
268 mAccessor[
"ValidationCorrs"]);
272 return produce_impl<HcalLutMetadata> (mInputs [
"LutMetadata"],
273 mVersion[
"LutMetadata"],
274 mSubversion[
"LutMetadata"],
275 mIOVBegin[
"LutMetadata"],
276 mQuery[
"LutMetadata"],
277 mAccessor[
"LutMetadata"]);
281 return produce_impl<HcalDcsValues> (mInputs [
"DcsValues"],
282 mVersion[
"DcsValues"],
283 mSubversion[
"DcsValues"],
284 mIOVBegin[
"DcsValues"],
286 mAccessor[
"DcsValues"]);
std::auto_ptr< HcalZSThresholds > produceZSThresholds(const HcalZSThresholdsRcd &rcd)
T getParameter(std::string const &) const
static const std::string default_version
virtual void setIntervalFor(const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &, edm::ValidityInterval &)
std::auto_ptr< HcalQIEData > produceQIEData(const HcalQIEDataRcd &rcd)
std::auto_ptr< HcalDcsValues > produceDcsValues(const HcalDcsRcd &rcd)
bool getObject(oracle::occi::Connection *connection, const std::string &fTag, const std::string &fVersion, const int fSubversion, const int fIOVBegin, const std::string &fQuery, HcalPedestals *fObject)
std::auto_ptr< HcalL1TriggerObjects > produceL1TriggerObjects(const HcalL1TriggerObjectsRcd &rcd)
static const IOVSyncValue & endOfTime()
std::pair< Time_t, Time_t > ValidityInterval
HcalOmdsCalibrations(const edm::ParameterSet &)
std::auto_ptr< HcalPedestalWidths > producePedestalWidths(const HcalPedestalWidthsRcd &rcd)
std::auto_ptr< HcalPedestals > producePedestals(const HcalPedestalsRcd &rcd)
std::auto_ptr< HcalGainWidths > produceGainWidths(const HcalGainWidthsRcd &rcd)
static const IOVSyncValue & beginOfTime()
const char * name() const
std::auto_ptr< HcalRespCorrs > produceRespCorrs(const HcalRespCorrsRcd &rcd)
std::auto_ptr< HcalLutMetadata > produceLutMetadata(const HcalLutMetadataRcd &rcd)
Gather config data from online DB.
static const std::string omds_occi_default_accessor
static const std::string default_query
std::auto_ptr< HcalChannelQuality > produceChannelQuality(const HcalChannelQualityRcd &rcd)
std::auto_ptr< HcalElectronicsMap > produceElectronicsMap(const HcalElectronicsMapRcd &rcd)
char data[epos_bytes_allocation]
std::auto_ptr< HcalGains > produceGains(const HcalGainsRcd &rcd)
std::auto_ptr< HcalValidationCorrs > produceValidationCorrs(const HcalValidationCorrsRcd &rcd)
std::auto_ptr< T > produce_impl(const std::string &fFile)