CMS 3D CMS Logo

Public Member Functions | Protected Member Functions | Protected Attributes

l1t::DataManager Class Reference

#include <DataManager.h>

Inheritance diagram for l1t::DataManager:
l1t::OMDSReader

List of all members.

Public Member Functions

void connect (const std::string &connectString, const std::string &authenticationPath, bool isOMDS=false)
 DataManager ()
 DataManager (const std::string &connectString, const std::string &authenticationPath, bool isOMDS=false)
cond::DbConnectiondbConnection ()
cond::DbSessiondbSession ()
void setDebug (bool debug)
virtual ~DataManager ()

Protected Member Functions

edm::eventsetup::TypeTag findType (const std::string &type) const

Protected Attributes

cond::DbConnectionconnection
cond::DbSessionsession

Detailed Description

Definition at line 20 of file DataManager.h.


Constructor & Destructor Documentation

l1t::DataManager::DataManager ( )

Definition at line 12 of file DataManager.cc.

    : session( 0 ),
      connection( 0 ) {}
l1t::DataManager::DataManager ( const std::string &  connectString,
const std::string &  authenticationPath,
bool  isOMDS = false 
) [explicit]

Definition at line 16 of file DataManager.cc.

References connect().

  {
    connect( connectString, authenticationPath, isOMDS ) ;
  }
l1t::DataManager::~DataManager ( ) [virtual]

Definition at line 45 of file DataManager.cc.

References cond::DbSession::close(), cond::DbConnection::close(), connection, and session.

{
  // delete all in reverse direction
  if( connection )
    connection->close() ;
  if( session )
    session->close() ;

  delete connection ;
  delete session ;
}

Member Function Documentation

void l1t::DataManager::connect ( const std::string &  connectString,
const std::string &  authenticationPath,
bool  isOMDS = false 
)

Definition at line 24 of file DataManager.cc.

References cond::DbConnection::configuration(), cond::DbConnection::configure(), connection, cond::DbConnection::createSession(), cond::DbSession::open(), session, and setDebug().

Referenced by DataManager().

  {
    connection = new cond::DbConnection() ;
    setDebug( false ) ;

    if( !isOMDS )
      {
        connection->configuration().setConnectionSharing( true ) ;
        connection->configuration().setReadOnlySessionOnUpdateConnections(
          true ) ;
      }

    connection->configuration().setAuthenticationPath( authenticationPath ) ;
    connection->configure() ;

    session = new cond::DbSession( connection->createSession() ) ;
    session->open( connectString, isOMDS ) ;
}
cond::DbConnection* l1t::DataManager::dbConnection ( ) [inline]

Definition at line 37 of file DataManager.h.

References connection.

          { return connection ; }
cond::DbSession* l1t::DataManager::dbSession ( ) [inline]

Definition at line 34 of file DataManager.h.

References session.

Referenced by L1CaloHcalScaleConfigOnlineProd::newObject().

          { return session ; }
edm::eventsetup::TypeTag l1t::DataManager::findType ( const std::string &  type) const [protected]

Definition at line 57 of file DataManager.cc.

{
  static edm::eventsetup::TypeTag defaultType;
  edm::eventsetup::TypeTag typeTag = edm::eventsetup::TypeTag::findType (type);
  
  if (typeTag == defaultType)
    //throw cond::Exception ("l1t::DataManager::findType")
    edm::LogError("L1TriggerDB") << "DataManager::findType() : " << type << " was not found";
  
  return typeTag;
}
void l1t::DataManager::setDebug ( bool  debug)

Definition at line 70 of file DataManager.cc.

References cond::DbConnection::configuration(), connection, and Debug.

Referenced by connect().

  {
    if( debug )
      {
        connection->configuration().setMessageLevel( coral::Debug ) ;
      }
    else
      {
        connection->configuration().setMessageLevel( coral::Error ) ;
      }
  }

Member Data Documentation

Definition at line 45 of file DataManager.h.

Referenced by connect(), dbConnection(), setDebug(), and ~DataManager().