Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:52:16

0001 #ifndef CondTools_L1Trigger_DataManager_h
0002 #define CondTools_L1Trigger_DataManager_h
0003 
0004 #include "FWCore/Framework/interface/DataKeyTags.h"
0005 #include "CondCore/CondDB/interface/Session.h"
0006 
0007 #include <string>
0008 
0009 namespace l1t {
0010 
0011   /* Helper class that provides common objects required to access Pool and Coral DB's.
0012  * This class will initialize connections and makes sure that they are closed
0013  * when it is destroyed.
0014  * Connections are initialized, but user is still responsible for opening and commiting
0015  * them
0016  */
0017   class DataManager {
0018   public:
0019     DataManager();
0020     explicit DataManager(const std::string& connectString, const std::string& authenticationPath, bool isOMDS = false);
0021     virtual ~DataManager();
0022 
0023     void connect(const std::string& connectString, const std::string& authenticationPath, bool isOMDS = false);
0024     void setDebug(bool debug);
0025 
0026     cond::persistency::Session dbSession() { return session; }
0027 
0028   protected:
0029     //Returns type object for provided type name
0030     edm::eventsetup::TypeTag findType(const std::string& type);
0031 
0032     // Database connection management
0033     cond::persistency::Session session;
0034 
0035   private:
0036     bool debugFlag = false;
0037   };
0038 
0039 }  // namespace l1t
0040 
0041 #endif