Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:00:06

0001 //
0002 // Gena Kukartsev (Brown), Feb. 1, 2008
0003 //
0004 //
0005 #ifndef HCALConfigDB_h
0006 #define HCALConfigDB_h
0007 
0008 #include <iostream>
0009 #include <cstring>
0010 #include "CaloOnlineTools/HcalOnlineDb/interface/ConfigurationDatabaseImpl.hh"
0011 
0012 /**
0013 
0014    \class HCALConfigDB
0015    \brief Gather config data from online DB
0016    \author Gena Kukartsev
0017 
0018 */
0019 
0020 class HCALConfigDB {
0021 public:
0022   typedef hcal::ConfigurationDatabaseImpl ConfigurationDatabaseImpl;
0023 
0024   HCALConfigDB();
0025   ~HCALConfigDB();
0026   HCALConfigDB(std::string _accessor);
0027   void connect(std::string _accessor);
0028   void connect(std::string _accessor1, std::string _accessor2);  // for very specific case of XML and Oracle
0029   void disconnect(void);
0030   void setAccessor(std::string _accessor);
0031   std::vector<unsigned int> getOnlineLUT(
0032       std::string tag, int crate, int slot, int topbottom, int fiber, int channel, int luttype);
0033   std::vector<unsigned int> getOnlineLUT(
0034       std::string tag,
0035       uint32_t _rawid,
0036       hcal::ConfigurationDatabase::LUTType _lt = hcal::ConfigurationDatabase::LinearizerLUT);
0037   std::vector<unsigned int> getOnlineLUTFromXML(
0038       std::string tag,
0039       uint32_t _rawid,
0040       hcal::ConfigurationDatabase::LUTType _lt = hcal::ConfigurationDatabase::LinearizerLUT);
0041 
0042   oracle::occi::Connection* getConnection(void);
0043   oracle::occi::Environment* getEnvironment(void);
0044 
0045   std::string clobToString(const oracle::occi::Clob&);
0046 
0047 protected:
0048   std::string accessor;
0049   ConfigurationDatabaseImpl* database;
0050 
0051   // the second DB handle for a crazy case
0052   // when two connections are needed,
0053   // e.g. when the main connection is to
0054   // an XML file
0055   std::string accessor2;
0056   ConfigurationDatabaseImpl* database2;
0057 };
0058 #endif