CMS 3D CMS Logo

Functions | Variables

/data/refman/pasoursint/CMSSW_4_4_5_patch3/src/CaloOnlineTools/HcalOnlineDb/src/HcalOmdsCalibrations.cc File Reference

#include <memory>
#include <iostream>
#include <fstream>
#include "FWCore/Utilities/interface/Exception.h"
#include "FWCore/ParameterSet/interface/FileInPath.h"
#include "FWCore/Framework/interface/ValidityInterval.h"
#include "CaloOnlineTools/HcalOnlineDb/interface/HcalDbOmds.h"
#include "CondFormats/DataRecord/interface/HcalPedestalsRcd.h"
#include "CondFormats/DataRecord/interface/HcalPedestalWidthsRcd.h"
#include "CondFormats/DataRecord/interface/HcalGainsRcd.h"
#include "CondFormats/DataRecord/interface/HcalGainWidthsRcd.h"
#include "CondFormats/DataRecord/interface/HcalElectronicsMapRcd.h"
#include "CondFormats/DataRecord/interface/HcalChannelQualityRcd.h"
#include "CondFormats/DataRecord/interface/HcalQIEDataRcd.h"
#include "CondFormats/DataRecord/interface/HcalRespCorrsRcd.h"
#include "CondFormats/DataRecord/interface/HcalZSThresholdsRcd.h"
#include "CondFormats/DataRecord/interface/HcalL1TriggerObjectsRcd.h"
#include "CondFormats/DataRecord/interface/HcalValidationCorrsRcd.h"
#include "CondFormats/DataRecord/interface/HcalLutMetadataRcd.h"
#include "CondFormats/DataRecord/interface/HcalDcsRcd.h"
#include "CaloOnlineTools/HcalOnlineDb/interface/HCALConfigDB.h"
#include "CaloOnlineTools/HcalOnlineDb/interface/HcalOmdsCalibrations.h"

Go to the source code of this file.

Functions

template<class T >
std::auto_ptr< Tproduce_impl (const std::string &fTag, const std::string &fVersion=default_version, const int fSubversion=1, const int fIOVBegin=1, const std::string &fQuery=default_query, const std::string &fAccessor=omds_occi_default_accessor)

Variables

static const std::string default_query = ""
static const std::string default_version = ""
static const std::string omds_occi_default_accessor = "occi://CMS_HCL_APPUSER_R@anyhost/cms_omds_lb?PASSWORD=HCAL_Reader_44,LHWM_VERSION=22"

Function Documentation

template<class T >
std::auto_ptr<T> produce_impl ( const std::string &  fTag,
const std::string &  fVersion = default_version,
const int  fSubversion = 1,
const int  fIOVBegin = 1,
const std::string &  fQuery = default_query,
const std::string &  fAccessor = omds_occi_default_accessor 
)

Definition at line 143 of file HcalOmdsCalibrations.cc.

References benchmark_cfg::cerr, align_tpl::connect, EcalCondDB::db, Exception, HcalDbOmds::getObject(), and query::result.

                                                                                         {
  std::auto_ptr<T> result (new T ());

  HCALConfigDB * db = new HCALConfigDB();
  try {
    db -> connect( fAccessor );
  } catch (hcal::exception::ConfigurationDatabaseException & e) {
    std::cerr << "Cannot connect to the database" << std::endl;
  }
  oracle::occi::Connection * _connection = db -> getConnection();
  if (_connection){
    if (!HcalDbOmds::getObject (_connection, fTag, fVersion, fSubversion, fIOVBegin, fQuery, &*result)) {
      std::cerr << "HcalOmdsCalibrations-> Can not read tag name '" << fTag << "' from database '" << fAccessor << "'" << std::endl;
      throw cms::Exception("ReadError") << "Can not read tag name '" << fTag << "' from database '" << fAccessor << "'" << std::endl;
    }
  }
  else{
    std::cerr << "Database connection is null. This should NEVER happen here. Something fishy is going on..." << std::endl;
  }
  return result;
}

Variable Documentation

const std::string default_query = "" [static]

Definition at line 140 of file HcalOmdsCalibrations.cc.

const std::string default_version = "" [static]

Definition at line 139 of file HcalOmdsCalibrations.cc.

const std::string omds_occi_default_accessor = "occi://CMS_HCL_APPUSER_R@anyhost/cms_omds_lb?PASSWORD=HCAL_Reader_44,LHWM_VERSION=22" [static]

Definition at line 138 of file HcalOmdsCalibrations.cc.