Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:14:48

0001 #ifndef SISTRIPCORALIFACE_H
0002 #define SISTRIPCORALIFACE_H
0003 #include "CondCore/CondDB/interface/Session.h"
0004 #include "CondCore/CondDB/interface/Exception.h"
0005 #include "CoralBase/TimeStamp.h"
0006 
0007 #include <iterator>
0008 #include <iostream>
0009 #include <string>
0010 #include <map>
0011 
0012 /** 
0013    \class SiStripCoralIface
0014    \brief An interface class to the PVSS cond DB
0015    \author J.Chen, J.Cole
0016 */
0017 class SiStripCoralIface {
0018 public:
0019   /** constructor */
0020   SiStripCoralIface(std::string connectionString, std::string authenticationPath, const bool debug);
0021   /** destructor*/
0022   ~SiStripCoralIface();
0023   /** Method to retrieve information from status change table or lastValue table.  queryType defines which table is to be accessed.*/
0024   void doQuery(std::string queryType,
0025                const coral::TimeStamp& startTime,
0026                const coral::TimeStamp& endTime,
0027                std::vector<coral::TimeStamp>&,
0028                std::vector<float>&,
0029                std::vector<std::string>&);
0030   /** Method to access the settings for each channel stored in the status change table*/
0031   void doSettingsQuery(const coral::TimeStamp& startTime,
0032                        const coral::TimeStamp& endTime,
0033                        std::vector<coral::TimeStamp>&,
0034                        std::vector<float>&,
0035                        std::vector<std::string>&,
0036                        std::vector<uint32_t>&);
0037   //
0038   void doNameQuery(std::vector<std::string>& vec_dpname, std::vector<uint32_t>& vec_dpid);
0039 
0040 private:
0041   /** Set up the connection to the database*/
0042   void initialize();
0043 
0044   /* member variables*/
0045   std::string m_connectionString;
0046   std::string m_authPath;
0047   std::map<std::string, unsigned int> m_id_map;
0048   cond::persistency::Session m_session;
0049   std::unique_ptr<cond::persistency::TransactionScope> m_transaction;
0050   // cond::CoralTransaction* m_coraldb;
0051   // cond::Connection* con;
0052 
0053   bool debug_;
0054 };
0055 #endif