SiStripCoralIface

Macros

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
#ifndef SISTRIPCORALIFACE_H
#define SISTRIPCORALIFACE_H
#include "CondCore/CondDB/interface/Session.h"
#include "CondCore/CondDB/interface/Exception.h"
#include "CoralBase/TimeStamp.h"

#include <iterator>
#include <iostream>
#include <string>
#include <map>

/**	
   \class SiStripCoralIface
   \brief An interface class to the PVSS cond DB
   \author J.Chen, J.Cole
*/
class SiStripCoralIface {
public:
  /** constructor */
  SiStripCoralIface(std::string connectionString, std::string authenticationPath, const bool debug);
  /** destructor*/
  ~SiStripCoralIface();
  /** Method to retrieve information from status change table or lastValue table.  queryType defines which table is to be accessed.*/
  void doQuery(std::string queryType,
               const coral::TimeStamp& startTime,
               const coral::TimeStamp& endTime,
               std::vector<coral::TimeStamp>&,
               std::vector<float>&,
               std::vector<std::string>&);
  /** Method to access the settings for each channel stored in the status change table*/
  void doSettingsQuery(const coral::TimeStamp& startTime,
                       const coral::TimeStamp& endTime,
                       std::vector<coral::TimeStamp>&,
                       std::vector<float>&,
                       std::vector<std::string>&,
                       std::vector<uint32_t>&);
  //
  void doNameQuery(std::vector<std::string>& vec_dpname, std::vector<uint32_t>& vec_dpid);

private:
  /** Set up the connection to the database*/
  void initialize();

  /* member variables*/
  std::string m_connectionString;
  std::string m_authPath;
  std::map<std::string, unsigned int> m_id_map;
  cond::persistency::Session m_session;
  std::unique_ptr<cond::persistency::TransactionScope> m_transaction;
  // cond::CoralTransaction* m_coraldb;
  // cond::Connection* con;

  bool debug_;
};
#endif