47 std::vector<edm::ParameterSet>
data = iConfig.
getParameter<std::vector<edm::ParameterSet> >(
"input");
48 std::vector<edm::ParameterSet>::iterator request = data.begin ();
49 for (; request != data.end (); request++) {
52 if (request->exists(
"version")) mVersion[objectName] = request->getParameter<
std::string>(
"version");
53 if (request->exists(
"subversion")) mSubversion[objectName] = request->getParameter<
int>(
"subversion");
54 if (request->exists(
"iov_begin")) mIOVBegin[objectName] = request->getParameter<
int>(
"iov_begin");
55 if (request->exists(
"accessor")) mAccessor[objectName] = request->getParameter<
std::string>(
"accessor");
56 if (request->exists(
"query")) mQuery[objectName] = request->getParameter<
std::string>(
"query");
59 if (objectName ==
"Pedestals") {
61 findingRecord <HcalPedestalsRcd> ();
63 else if (objectName ==
"PedestalWidths") {
65 findingRecord <HcalPedestalWidthsRcd> ();
67 else if (objectName ==
"Gains") {
69 findingRecord <HcalGainsRcd> ();
71 else if (objectName ==
"GainWidths") {
73 findingRecord <HcalGainWidthsRcd> ();
75 else if (objectName ==
"QIEData") {
77 findingRecord <HcalQIEDataRcd> ();
79 else if (objectName ==
"ChannelQuality") {
81 findingRecord <HcalChannelQualityRcd> ();
83 else if (objectName ==
"ZSThresholds") {
85 findingRecord <HcalZSThresholdsRcd> ();
87 else if (objectName ==
"RespCorrs") {
89 findingRecord <HcalRespCorrsRcd> ();
91 else if (objectName ==
"L1TriggerObjects") {
93 findingRecord <HcalL1TriggerObjectsRcd> ();
95 else if (objectName ==
"ElectronicsMap") {
97 findingRecord <HcalElectronicsMapRcd> ();
99 else if (objectName ==
"ValidationCorrs") {
101 findingRecord <HcalValidationCorrsRcd> ();
103 else if (objectName ==
"LutMetadata") {
105 findingRecord <HcalLutMetadataRcd> ();
107 else if (objectName ==
"DcsValues") {
109 findingRecord <HcalDcsRcd> ();
112 std::cerr <<
"HcalOmdsCalibrations-> Unknown object name '" << objectName
113 <<
"', known names are: "
114 <<
"Pedestals PedestalWidths Gains GainWidths QIEData ChannelQuality ElectronicsMap "
115 <<
"ZSThresholds RespCorrs L1TriggerObjects ValidationCorrs LutMetadata DcsValues "
147 const int fSubversion=1,
148 const int fIOVBegin=1,
151 std::auto_ptr<T>
result (
new T (topo));
156 }
catch (hcal::exception::ConfigurationDatabaseException &
e) {
157 std::cerr <<
"Cannot connect to the database" << std::endl;
159 oracle::occi::Connection * _connection = db -> getConnection();
161 if (!
HcalDbOmds::getObject (_connection, fTag, fVersion, fSubversion, fIOVBegin, fQuery, &*result)) {
162 std::cerr <<
"HcalOmdsCalibrations-> Can not read tag name '" << fTag <<
"' from database '" << fAccessor <<
"'" << std::endl;
163 throw cms::Exception(
"ReadError") <<
"Can not read tag name '" << fTag <<
"' from database '" << fAccessor <<
"'" << std::endl;
167 std::cerr <<
"Database connection is null. This should NEVER happen here. Something fishy is going on..." << std::endl;
174 const int fSubversion=1,
175 const int fIOVBegin=1,
178 std::auto_ptr<T>
result (
new T ());
183 }
catch (hcal::exception::ConfigurationDatabaseException &
e) {
184 std::cerr <<
"Cannot connect to the database" << std::endl;
186 oracle::occi::Connection * _connection = db -> getConnection();
188 if (!
HcalDbOmds::getObject (_connection, fTag, fVersion, fSubversion, fIOVBegin, fQuery, &*result)) {
189 std::cerr <<
"HcalOmdsCalibrations-> Can not read tag name '" << fTag <<
"' from database '" << fAccessor <<
"'" << std::endl;
190 throw cms::Exception(
"ReadError") <<
"Can not read tag name '" << fTag <<
"' from database '" << fAccessor <<
"'" << std::endl;
194 std::cerr <<
"Database connection is null. This should NEVER happen here. Something fishy is going on..." << std::endl;
206 return produce_impl<HcalPedestals> (topo, mInputs [
"Pedestals"],
207 mVersion[
"Pedestals"],
208 mSubversion[
"Pedestals"],
209 mIOVBegin[
"Pedestals"],
211 mAccessor[
"Pedestals"]);
218 return produce_impl<HcalPedestalWidths> (topo, mInputs [
"PedestalWidths"],
219 mVersion[
"PedestalWidths"],
220 mSubversion[
"PedestalWidths"],
221 mIOVBegin[
"PedestalWidths"],
222 mQuery[
"PedestalWidths"],
223 mAccessor[
"PedestalWidths"]);
230 return produce_impl<HcalGains> (topo, mInputs [
"Gains"],
232 mSubversion[
"Gains"],
242 return produce_impl<HcalGainWidths> (topo, mInputs [
"GainWidths"],
243 mVersion[
"GainWidths"],
244 mSubversion[
"GainWidths"],
245 mIOVBegin[
"GainWidths"],
246 mQuery[
"GainWidths"],
247 mAccessor[
"GainWidths"]);
254 return produce_impl<HcalQIEData> (topo, mInputs [
"QIEData"],
256 mSubversion[
"QIEData"],
257 mIOVBegin[
"QIEData"],
259 mAccessor[
"QIEData"]);
266 return produce_impl<HcalChannelQuality> (topo, mInputs [
"ChannelQuality"],
267 mVersion[
"ChannelQuality"],
268 mSubversion[
"ChannelQuality"],
269 mIOVBegin[
"ChannelQuality"],
270 mQuery[
"ChannelQuality"],
271 mAccessor[
"ChannelQuality"]);
278 return produce_impl<HcalZSThresholds> (topo, mInputs [
"ZSThresholds"],
279 mVersion[
"ZSThresholds"],
280 mSubversion[
"ZSThresholds"],
281 mIOVBegin[
"ZSThresholds"],
282 mQuery[
"ZSThresholds"],
283 mAccessor[
"ZSThresholds"]);
290 return produce_impl<HcalRespCorrs> (topo, mInputs [
"RespCorrs"],
291 mVersion[
"RespCorrs"],
292 mSubversion[
"RespCorrs"],
293 mIOVBegin[
"RespCorrs"],
295 mAccessor[
"RespCorrs"]);
302 return produce_impl<HcalL1TriggerObjects> (topo, mInputs [
"L1TriggerObjects"],
303 mVersion[
"L1TriggerObjects"],
304 mSubversion[
"L1TriggerObjects"],
305 mIOVBegin[
"L1TriggerObjects"],
306 mQuery[
"L1TriggerObjects"],
307 mAccessor[
"L1TriggerObjects"]);
311 return produce_impl<HcalElectronicsMap> (mInputs [
"ElectronicsMap"],
312 mVersion[
"ElectronicsMap"],
313 mSubversion[
"ElectronicsMap"],
314 mIOVBegin[
"ElectronicsMap"],
315 mQuery[
"ElectronicsMap"],
316 mAccessor[
"ElectronicsMap"]);
323 return produce_impl<HcalValidationCorrs> (topo, mInputs [
"ValidationCorrs"],
324 mVersion[
"ValidationCorrs"],
325 mSubversion[
"ValidationCorrs"],
326 mIOVBegin[
"ValidationCorrs"],
327 mQuery[
"ValidationCorrs"],
328 mAccessor[
"ValidationCorrs"]);
335 return produce_impl<HcalLutMetadata> (topo, mInputs [
"LutMetadata"],
336 mVersion[
"LutMetadata"],
337 mSubversion[
"LutMetadata"],
338 mIOVBegin[
"LutMetadata"],
339 mQuery[
"LutMetadata"],
340 mAccessor[
"LutMetadata"]);
344 return produce_impl<HcalDcsValues> (mInputs [
"DcsValues"],
345 mVersion[
"DcsValues"],
346 mSubversion[
"DcsValues"],
347 mIOVBegin[
"DcsValues"],
349 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)
const DepRecordT & getRecord() const
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)