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++) {
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");
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 "
146 const int fSubversion=1,
147 const int fIOVBegin=1,
150 std::unique_ptr<T>
result (
new T (topo));
155 }
catch (hcal::exception::ConfigurationDatabaseException &
e) {
156 std::cerr <<
"Cannot connect to the database" << std::endl;
158 oracle::occi::Connection * _connection = db -> getConnection();
160 if (!
HcalDbOmds::getObject (_connection, fTag, fVersion, fSubversion, fIOVBegin, fQuery, &*result)) {
161 std::cerr <<
"HcalOmdsCalibrations-> Can not read tag name '" << fTag <<
"' from database '" << fAccessor <<
"'" << std::endl;
162 throw cms::Exception(
"ReadError") <<
"Can not read tag name '" << fTag <<
"' from database '" << fAccessor <<
"'" << std::endl;
166 std::cerr <<
"Database connection is null. This should NEVER happen here. Something fishy is going on..." << std::endl;
173 const int fSubversion=1,
174 const int fIOVBegin=1,
177 std::unique_ptr<T>
result (
new T ());
182 }
catch (hcal::exception::ConfigurationDatabaseException &
e) {
183 std::cerr <<
"Cannot connect to the database" << std::endl;
185 oracle::occi::Connection * _connection = db -> getConnection();
187 if (!
HcalDbOmds::getObject (_connection, fTag, fVersion, fSubversion, fIOVBegin, fQuery, &*result)) {
188 std::cerr <<
"HcalOmdsCalibrations-> Can not read tag name '" << fTag <<
"' from database '" << fAccessor <<
"'" << std::endl;
189 throw cms::Exception(
"ReadError") <<
"Can not read tag name '" << fTag <<
"' from database '" << fAccessor <<
"'" << std::endl;
193 std::cerr <<
"Database connection is null. This should NEVER happen here. Something fishy is going on..." << std::endl;
205 return produce_impl<HcalPedestals> (topo, mInputs [
"Pedestals"],
206 mVersion[
"Pedestals"],
207 mSubversion[
"Pedestals"],
208 mIOVBegin[
"Pedestals"],
210 mAccessor[
"Pedestals"]);
217 return produce_impl<HcalPedestalWidths> (topo, mInputs [
"PedestalWidths"],
218 mVersion[
"PedestalWidths"],
219 mSubversion[
"PedestalWidths"],
220 mIOVBegin[
"PedestalWidths"],
221 mQuery[
"PedestalWidths"],
222 mAccessor[
"PedestalWidths"]);
229 return produce_impl<HcalGains> (topo, mInputs [
"Gains"],
231 mSubversion[
"Gains"],
241 return produce_impl<HcalGainWidths> (topo, mInputs [
"GainWidths"],
242 mVersion[
"GainWidths"],
243 mSubversion[
"GainWidths"],
244 mIOVBegin[
"GainWidths"],
245 mQuery[
"GainWidths"],
246 mAccessor[
"GainWidths"]);
253 return produce_impl<HcalQIEData> (topo, mInputs [
"QIEData"],
255 mSubversion[
"QIEData"],
256 mIOVBegin[
"QIEData"],
258 mAccessor[
"QIEData"]);
265 return produce_impl<HcalChannelQuality> (topo, mInputs [
"ChannelQuality"],
266 mVersion[
"ChannelQuality"],
267 mSubversion[
"ChannelQuality"],
268 mIOVBegin[
"ChannelQuality"],
269 mQuery[
"ChannelQuality"],
270 mAccessor[
"ChannelQuality"]);
277 return produce_impl<HcalZSThresholds> (topo, mInputs [
"ZSThresholds"],
278 mVersion[
"ZSThresholds"],
279 mSubversion[
"ZSThresholds"],
280 mIOVBegin[
"ZSThresholds"],
281 mQuery[
"ZSThresholds"],
282 mAccessor[
"ZSThresholds"]);
289 return produce_impl<HcalRespCorrs> (topo, mInputs [
"RespCorrs"],
290 mVersion[
"RespCorrs"],
291 mSubversion[
"RespCorrs"],
292 mIOVBegin[
"RespCorrs"],
294 mAccessor[
"RespCorrs"]);
301 return produce_impl<HcalL1TriggerObjects> (topo, mInputs [
"L1TriggerObjects"],
302 mVersion[
"L1TriggerObjects"],
303 mSubversion[
"L1TriggerObjects"],
304 mIOVBegin[
"L1TriggerObjects"],
305 mQuery[
"L1TriggerObjects"],
306 mAccessor[
"L1TriggerObjects"]);
310 return produce_impl<HcalElectronicsMap> (mInputs [
"ElectronicsMap"],
311 mVersion[
"ElectronicsMap"],
312 mSubversion[
"ElectronicsMap"],
313 mIOVBegin[
"ElectronicsMap"],
314 mQuery[
"ElectronicsMap"],
315 mAccessor[
"ElectronicsMap"]);
322 return produce_impl<HcalValidationCorrs> (topo, mInputs [
"ValidationCorrs"],
323 mVersion[
"ValidationCorrs"],
324 mSubversion[
"ValidationCorrs"],
325 mIOVBegin[
"ValidationCorrs"],
326 mQuery[
"ValidationCorrs"],
327 mAccessor[
"ValidationCorrs"]);
334 return produce_impl<HcalLutMetadata> (topo, mInputs [
"LutMetadata"],
335 mVersion[
"LutMetadata"],
336 mSubversion[
"LutMetadata"],
337 mIOVBegin[
"LutMetadata"],
338 mQuery[
"LutMetadata"],
339 mAccessor[
"LutMetadata"]);
343 return produce_impl<HcalDcsValues> (mInputs [
"DcsValues"],
344 mVersion[
"DcsValues"],
345 mSubversion[
"DcsValues"],
346 mIOVBegin[
"DcsValues"],
348 mAccessor[
"DcsValues"]);
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::unique_ptr< HcalQIEData > produceQIEData(const HcalQIEDataRcd &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)
static const IOVSyncValue & endOfTime()
std::unique_ptr< HcalChannelQuality > produceChannelQuality(const HcalChannelQualityRcd &rcd)
std::unique_ptr< HcalRespCorrs > produceRespCorrs(const HcalRespCorrsRcd &rcd)
std::pair< Time_t, Time_t > ValidityInterval
std::unique_ptr< HcalGainWidths > produceGainWidths(const HcalGainWidthsRcd &rcd)
HcalOmdsCalibrations(const edm::ParameterSet &)
std::unique_ptr< HcalValidationCorrs > produceValidationCorrs(const HcalValidationCorrsRcd &rcd)
const DepRecordT & getRecord() const
std::unique_ptr< HcalElectronicsMap > produceElectronicsMap(const HcalElectronicsMapRcd &rcd)
std::unique_ptr< HcalZSThresholds > produceZSThresholds(const HcalZSThresholdsRcd &rcd)
std::unique_ptr< T > produce_impl(const std::string &fFile)
static const IOVSyncValue & beginOfTime()
const char * name() const
std::unique_ptr< HcalDcsValues > produceDcsValues(const HcalDcsRcd &rcd)
Gather config data from online DB.
static const std::string omds_occi_default_accessor
std::unique_ptr< HcalGains > produceGains(const HcalGainsRcd &rcd)
std::unique_ptr< HcalPedestals > producePedestals(const HcalPedestalsRcd &rcd)
static const std::string default_query
std::unique_ptr< HcalL1TriggerObjects > produceL1TriggerObjects(const HcalL1TriggerObjectsRcd &rcd)
char data[epos_bytes_allocation]
std::unique_ptr< HcalPedestalWidths > producePedestalWidths(const HcalPedestalWidthsRcd &rcd)
std::unique_ptr< HcalLutMetadata > produceLutMetadata(const HcalLutMetadataRcd &rcd)