CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_3/src/CaloOnlineTools/HcalOnlineDb/interface/HCALConfigDB.h

Go to the documentation of this file.
00001 //
00002 // Gena Kukartsev (Brown), Feb. 1, 2008
00003 //
00004 //
00005 #ifndef HCALConfigDB_h
00006 #define HCALConfigDB_h
00007 
00008 #include <iostream>
00009 #include <string.h>
00010 #include "CaloOnlineTools/HcalOnlineDb/interface/ConfigurationDatabaseImpl.hh"
00011 
00012 
00021 class HCALConfigDB{
00022  public:
00023   typedef hcal::ConfigurationDatabaseImpl ConfigurationDatabaseImpl;
00024   
00025   HCALConfigDB( );
00026   ~HCALConfigDB( );
00027   HCALConfigDB( std::string _accessor );
00028   void connect( std::string _accessor );
00029   void connect( std::string _accessor1, std::string _accessor2 ); // for very specific case of XML and Oracle
00030   void disconnect( void );
00031   void setAccessor( std::string _accessor );
00032   std::vector<unsigned int> getOnlineLUT( std::string tag, int crate, int slot, int topbottom, int fiber, int channel, int luttype );
00033   std::vector<unsigned int> getOnlineLUT( std::string tag, uint32_t _rawid, hcal::ConfigurationDatabase::LUTType _lt = hcal::ConfigurationDatabase::LinearizerLUT );
00034   std::vector<unsigned int> getOnlineLUTFromXML( std::string tag, uint32_t _rawid, hcal::ConfigurationDatabase::LUTType _lt = hcal::ConfigurationDatabase::LinearizerLUT );
00035 
00036   oracle::occi::Connection * getConnection( void );
00037   oracle::occi::Environment * getEnvironment( void );
00038 
00039   std::string clobToString(oracle::occi::Clob);
00040   
00041  protected:
00042 
00043   std::string accessor;
00044   ConfigurationDatabaseImpl * database;
00045 
00046   // the second DB handle for a crazy case
00047   // when two connections are needed,
00048   // e.g. when the main connection is to
00049   // an XML file
00050   std::string accessor2;
00051   ConfigurationDatabaseImpl * database2;
00052 
00053 };
00054 #endif