More information on this package is here.
#include "TMapUtils.h"

TMapUtils


class description - header file - source file

class TMapUtils: public TObject

Inheritance Inherited Members Includes Libraries
Class Charts

Function Members (Methods)

Display options:
Show inherited
Show non-public
public:
TMapUtils()
TMapUtils(const TMapUtils&)
TMapUtils(const char* dbHOSTNAME, const char* dbDATABASE, const char* dbUSERNAME)
virtual~TMapUtils()
voidTObject::AbstractMethod(const char* method) const
virtual voidTObject::AppendPad(Option_t* option = "")
virtual voidTObject::Browse(TBrowser* b)
static TClass*Class()
virtual const char*TObject::ClassName() const
virtual voidTObject::Clear(Option_t* = "")
virtual TObject*TObject::Clone(const char* newname = "") const
virtual Int_tTObject::Compare(const TObject* obj) const
TSQLServer*ConnectDB()
virtual voidTObject::Copy(TObject& object) const
Int_tCreateSystem(const char* system)
virtual voidTObject::Delete(Option_t* option = "")
virtual Int_tTObject::DistancetoPrimitive(Int_t px, Int_t py)
virtual voidTObject::Draw(Option_t* option = "")
virtual voidTObject::DrawClass() const
virtual TObject*TObject::DrawClone(Option_t* option = "") const
virtual voidTObject::Dump() const
virtual voidTObject::Error(const char* method, const char* msgfmt) const
virtual voidTObject::Execute(const char* method, const char* params, Int_t* error = 0)
virtual voidTObject::Execute(TMethod* method, TObjArray* params, Int_t* error = 0)
virtual voidTObject::ExecuteEvent(Int_t event, Int_t px, Int_t py)
virtual voidTObject::Fatal(const char* method, const char* msgfmt) const
virtual TObject*TObject::FindObject(const char* name) const
virtual TObject*TObject::FindObject(const TObject* obj) const
voidGet_Map_Float(const char* fcSystem, const char* fcSubSystem, const char* fcItem, Int_t fcRun_no, TArrayF* fFloatArray, const char* fcAuthor = "*")
voidGet_Map_Int(const char* fcSystem, const char* fcSubSystem, const char* fcItem, Int_t fcRun_no, TArrayI* fIntArray, const char* fcAuthor = "*")
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
virtual const char*TObject::GetIconName() const
Int_tGetItem(TSQLServer* fbConn, const char* tSystem, const char* tSubSystem, const char* tItem, TDBItem* tMapItem)
voidGetItemEx(TSQLServer* conn, int subsystem_id, const char* item_name, TDBItem* fMapItem)
virtual const char*TObject::GetName() const
virtual char*TObject::GetObjectInfo(Int_t px, Int_t py) const
static Bool_tTObject::GetObjectStat()
virtual Option_t*TObject::GetOption() const
Int_tGetRunIndex(TSQLServer* fbConn, TDBItem tMapItem, Int_t fcRunNum, const char* fcAuthor, TRunIndex* tRunIndex)
voidGetRunIndexEx(TSQLServer* fbConn, TDBItem tMapItem, Int_t fcRunNum, const char* fcAuthor, TRunIndex* tRunIndex)
Int_tGetSubSystemID(TSQLServer* conn, int system_id, const char* subsystem_name, Int_t* pSubSystem_ID)
Int_tGetSubSystemIDEx(TSQLServer* conn, int system_id, const char* subsystem_name)
Int_tGetSystemID(TSQLServer* conn, const char* system_name, Int_t* pSystem_ID)
Int_tGetSystemIDEx(TSQLServer* conn, const char* system_name)
TStringGetTableName(const char* dSystem, const char* dSubSystem, const char* dItem)
virtual const char*TObject::GetTitle() const
virtual UInt_tTObject::GetUniqueID() const
virtual Bool_tTObject::HandleTimer(TTimer* timer)
virtual ULong_tTObject::Hash() const
virtual voidTObject::Info(const char* method, const char* msgfmt) const
virtual Bool_tTObject::InheritsFrom(const char* classname) const
virtual Bool_tTObject::InheritsFrom(const TClass* cl) const
virtual voidTObject::Inspect() const
voidTObject::InvertBit(UInt_t f)
virtual TClass*IsA() const
virtual Bool_tTObject::IsEqual(const TObject* obj) const
virtual Bool_tTObject::IsFolder() const
Bool_tTObject::IsOnHeap() const
virtual Bool_tTObject::IsSortable() const
Bool_tTObject::IsZombie() const
virtual voidTObject::ls(Option_t* option = "") const
voidTObject::MayNotUse(const char* method) const
virtual Bool_tTObject::Notify()
static voidTObject::operator delete(void* ptr)
static voidTObject::operator delete(void* ptr, void* vp)
static voidTObject::operator delete[](void* ptr)
static voidTObject::operator delete[](void* ptr, void* vp)
void*TObject::operator new(size_t sz)
void*TObject::operator new(size_t sz, void* vp)
void*TObject::operator new[](size_t sz)
void*TObject::operator new[](size_t sz, void* vp)
TMapUtils&operator=(const TMapUtils&)
virtual voidTObject::Paint(Option_t* option = "")
virtual voidTObject::Pop()
virtual voidTObject::Print(Option_t* option = "") const
voidPrintFloatArray(TArrayF tmpFArray)
voidPrintInfo()
voidPrintIntArray(TArrayI tmpIArray)
voidPrintItem(const char* tSystem, const char* tSubSystem, const char* tItem, Int_t tMinRun, Int_t tMaxRun)
voidPrintItemTable(TSQLServer* fbConn, TDBItem tMapItem, Int_t fcRunNum)
virtual Int_tTObject::Read(const char* name)
virtual voidTObject::RecursiveRemove(TObject* obj)
voidTObject::ResetBit(UInt_t f)
virtual voidTObject::SaveAs(const char* filename = "", Option_t* option = "") const
virtual voidTObject::SavePrimitive(ostream& out, Option_t* option = "")
voidScanMaps()
voidScanSystem(const char* tSystem)
TSQLResult&SelectValues(const char* fcSystem, const char* fcSubSystem, const char* fcItem, Int_t fcRun_no, const char* fcAuthor, const char* fcValueType)
voidTObject::SetBit(UInt_t f)
voidTObject::SetBit(UInt_t f, Bool_t set)
voidSetDatabase(const char* dbDATABASE)
voidSetDBParams(const char* dbHOSTNAME, const char* dbDATABASE, const char* dbUSERNAME)
voidSetDbVersion(const char* fVersion)
voidSetDebugMode(Int_t DbgMode)
virtual voidTObject::SetDrawOption(Option_t* option = "")
static voidTObject::SetDtorOnly(void* obj)
voidSetHost(const char* dbHOSTNAME)
voidSetIndexTable(const char* fRunIndexTableName)
static voidTObject::SetObjectStat(Bool_t stat)
voidSetPassword(const char* dbPASSWORD)
virtual voidTObject::SetUniqueID(UInt_t uid)
virtual voidShowMembers(TMemberInspector& insp, char* parent)
virtual voidStreamer(TBuffer& b)
voidStreamerNVirtual(TBuffer& b)
virtual voidTObject::SysError(const char* method, const char* msgfmt) const
Int_tTableExists(TSQLServer* conn, const char* tblname)
Int_tTableExists_Ex(TSQLServer* conn, const char* tblname)
Bool_tTObject::TestBit(UInt_t f) const
Int_tTObject::TestBits(UInt_t f) const
virtual voidTObject::UseCurrentStyle()
virtual voidTObject::Warning(const char* method, const char* msgfmt) const
virtual Int_tTObject::Write(const char* name = "0", Int_t option = 0, Int_t bufsize = 0)
virtual Int_tTObject::Write(const char* name = "0", Int_t option = 0, Int_t bufsize = 0) const
protected:
virtual voidTObject::DoError(int level, const char* location, const char* fmt, va_list va) const
voidTObject::MakeZombie()

Data Members

public:
enum TObject::EStatusBits { kCanDelete
kMustCleanup
kObjInCanvas
kIsReferenced
kHasUUID
kCannotPick
kNoContextMenu
kInvalidObject
};
enum TObject::[unnamed] { kIsOnHeap
kNotDeleted
kZombie
kBitMask
kSingleKey
kOverwrite
kWriteDelete
};
private:
TStringfHOSTNAMEDatabase HOST name
TStringfDATABASEDatabase to use
TStringfUSERNAMEDatabase User name
TStringfPASSWORDDatabase User Password
TStringfRun_INDEX_Table
Int_tfDebugModeDebugmode controls printouts given from various methods
TStringfItemValueVersionThis contains Velue table version Development or Production

Class Description

____________________ 

  File :  TMapUtils.cxx

  TMapUtils is set of tools to get or put
  data into CLAS Calibration Database (MySQL version)

  THIS NEEDS MORE DOCUMENTATION.
TMapUtils()
TMapUtils(const char *dbHOSTNAME, const char *dbDATABASE,const char *dbUSERNAME)
 
 Constructor initializes Database host
 Database and user name
~TMapUtils()
 Default destructor


Int_t CreateSystem(const char *system)
void PrintInfo()
 Prints information about Database settings
 HOSTNAME, DATABASE, USERNAME 


TSQLServer * ConnectDB()
  Connecting to a Database on server specified in constructor
  and returning pointer to TSQLServer Structure...

void ScanMaps()
  Connectos to DATBASE on HOSTNAME and Prints out System Names from
  table System. They correcspond to MAP names in old version of MapManager

void ScanSystem(const char *tSystem)
 Prints out Subsystems and Items for Given System


void PrintItemTable(TSQLServer *fbConn,TDBItem tMapItem, Int_t fcRunNum)
   



void PrintItem(const char *tSystem, const char *tSubSystem,const char *tItem, Int_t tMinRun, Int_t tMaxRun)
 
  This function Prints content of ValueDescription table for Given Item
 specified by (System,SubSystem,Item) in Run ranges tMinRun -> tMaxRun

 NOTE. This will print all entries independent of author entry in the database

TSQLResult & SelectValues(const char *fcSystem, const char *fcSubSystem,const char *fcItem, Int_t fcRun_no, const char *fcAuthor, const char *fcValueType)
 Selects Values from Database for given Item , Run Number and author and returns 
 TSQLResult to calling function. Also makes check on type of Item.

 NOTE. If calling this function one must call it from "try"-"catch" block.
 If error accures function will trow an exception. 

void Get_Map_Int(const char *fcSystem, const char *fcSubSystem,const char *fcItem, Int_t fcRun_no,TArrayI *fIntArray, const char *fcAuthor)
  This routine initializes Integer Buffer passed to it and fills it with  
  Values for given Item. There are several advantages using this method.

  1) User does not have to warry about deleting array if it is defined
      as static. For example :
   {
       TIntBuffer  myDC_T0;
       GetMapIntBuff("DC_","t0","value",15678,&myDC_T0);
   }
   after this braket buffer will be delated automaticaly.

   2) Class TIntBuffer has bound check (unlike array of int's).
      if one will ask for non existing element in array it will not 
      couse segmentation falt.

  NOTE: It is recomended to use this function instead of 
  GetMapInt to avoid memory leaks. 
 
 
void Get_Map_Float(const char *fcSystem, const char *fcSubSystem,const char *fcItem, Int_t fcRun_no,TArrayF *fFloatArray, const char *fcAuthor)
  This routine initializes Float Buffer passed to it and fills it with  
  Values for given Item. There are several advantages using this method.

  1) User does not have to warry about deleting array if it is defined
      as static. For example :
   {
       TFloatBuffer  myDC_T0;
       GetMapFloatBuff("DC_","t0","value",15678,&myDC_T0);
   }
   after this braket buffer will be delated automaticaly.

   2) Class TFloatBuffer has bound check (unlike array of int's).
      if one will ask for non existing element in array it will not 
      couse segmentation falt.

  NOTE: It is recomended to use this function instead of 
  GetMapFloat to avoid memory leaks. 
 
 
Int_t GetSystemID(TSQLServer *conn, const char *system_name, Int_t *pSystem_ID)
 This routine writes into pSystem_ID system ID for given System_name

 returns 0 if system was found. -1 otherwise

Int_t GetSystemIDEx(TSQLServer *conn, const char *system_name)
Int_t TableExists(TSQLServer *conn, const char *tblname)
Int_t TableExists_Ex(TSQLServer *conn, const char *tblname)
  Checks if Tbale  tblname exists in database 
  returns 0 if table exists throws exception otherwise.

Int_t GetSubSystemID(TSQLServer *conn, int system_id, const char *subsystem_name, Int_t *pSubSystem_ID)
  SubSystem in pSubSystem_ID variable


Int_t GetSubSystemIDEx(TSQLServer *conn, int system_id, const char *subsystem_name)
 Returns SubSystem id from table SubSystem corresponding to given SystemID


void GetItemEx(TSQLServer *conn, int subsystem_id, const char *item_name, TDBItem *fMapItem)
Int_t GetItem(TSQLServer *fbConn, const char *fcSystem,const char *fcSubSystem,const char *fcItem, TDBItem *sfItem)
Int_t GetRunIndex(TSQLServer *fbConn, TDBItem tMapItem, Int_t fcRunNum, const char *fcAuthor, TRunIndex *tRunIndex)
  
 This routin finds latest ItemValueId from RunIndex table for given run number
 and returns Record of Runindex entry in tRunIndex variable.
 This is just wrapper for GetRunIndexEx routin which throws exception if 
 ItemValueId is not found. returns 0 on success, -1 otherwise.

void GetRunIndexEx(TSQLServer *fbConn, TDBItem tMapItem, Int_t fcRunNum, const char *fcAuthor, TRunIndex *tRunIndex)
 This routin finds latest ItemValueId from RunIndex table for given run number
 and returns Record of Runindex entry in tRunIndex variable.

TString GetTableName(const char *dSystem,const char *dSubSystem, const char *dItem)
void SetDebugMode(Int_t DbgMode)
void SetIndexTable(const char *fRunIndexTableName)
void SetDbVersion(const char *fVersion)



void PrintIntArray(TArrayI tmpIArray)
void PrintFloatArray(TArrayF tmpFArray)
TMapUtils()
void SetDBParams(const char *dbHOSTNAME,const char *dbDATABASE, const char *dbUSERNAME)
void SetHost(const char *dbHOSTNAME)
void SetDatabase(const char *dbDATABASE)
void SetPassword(const char *dbPASSWORD)


Author: Maurik Holtrop
Last update: Wed Mar 28 16:06:01 2007
CopyLeft - This code is freely available.

ROOT Home page - ClasTool Class index - Class Hierarchy - Top of the page