ROOT logo
AliRoot » STEER » CDB » AliCDBManager

class AliCDBManager: public TObject

Function Members (Methods)

public:
virtual~AliCDBManager()
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* = "")
voidClearCache()
virtual TObject*TObject::Clone(const char* newname = "") const
virtual Int_tTObject::Compare(const TObject* obj) const
virtual voidTObject::Copy(TObject& object) const
AliCDBParam*CreateParameter(const char* dbString) const
virtual voidTObject::Delete(Option_t* option = "")MENU
static voidDestroy()
voidDestroyActiveStorage(AliCDBStorage* storage)
voidDestroyActiveStorages()
Bool_tDiffObjects(const char* cdbFile1, const char* cdbFile2) const
virtual Int_tTObject::DistancetoPrimitive(Int_t px, Int_t py)
Bool_tDrain(AliCDBEntry* entry)
virtual voidTObject::Draw(Option_t* option = "")
virtual voidTObject::DrawClass() constMENU
virtual TObject*TObject::DrawClone(Option_t* option = "") constMENU
virtual voidTObject::Dump() constMENU
voidDumpToLightSnapshotFile(const char* lightSnapshotFileName) const
voidDumpToSnapshotFile(const char* snapshotFileName, Bool_t singleKeys) 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)
voidExtractBaseFolder(TString& url)
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
AliCDBEntry*Get(const AliCDBId& query, Bool_t forceCaching = kFALSE)
AliCDBEntry*Get(const AliCDBPath& path, Int_t runNumber = -1, Int_t version = -1, Int_t subVersion = -1)
AliCDBEntry*Get(const AliCDBPath& path, const AliCDBRunRange& runRange, Int_t version = -1, Int_t subVersion = -1)
TList*GetActiveStorages()
TList*GetAll(const AliCDBId& query)
TList*GetAll(const AliCDBPath& path, Int_t runNumber = -1, Int_t version = -1, Int_t subVersion = -1)
TList*GetAll(const AliCDBPath& path, const AliCDBRunRange& runRange, Int_t version = -1, Int_t subVersion = -1)
Bool_tGetCacheFlag() const
AliCDBParam*GetCondParam() const
TStringGetCvmfsOcdbTag() const
static const char*GetDataTypeName(AliCDBManager::DataType type)
AliCDBStorage*GetDefaultStorage() const
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
Int_tGetEndRunLHCPeriod()
const TMap*GetEntryCache() const
AliCDBEntry*GetEntryFromSnapshot(const char* path)
virtual const char*TObject::GetIconName() const
TStringGetLHCPeriod()
Bool_tGetLock() const
const char*GetMirrorSEs() const
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
Bool_tGetRaw() const
AliCDBParam*GetRefParam() const
const TList*GetRetrievedIds() const
Int_tGetRun() const
AliCDBStorage*GetSpecificStorage(const char* calibType)
Int_tGetStartRunLHCPeriod()
AliCDBStorage*GetStorage(const char* dbString)
const TMap*GetStorageMap() const
virtual const char*TObject::GetTitle() const
virtual UInt_tTObject::GetUniqueID() const
const char*GetURI(const char* path)
virtual Bool_tTObject::HandleTimer(TTimer* timer)
virtual ULong_tTObject::Hash() const
Bool_tHasStorage(const char* dbString) 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
voidInit()
voidInitFromCache(TMap* entryCache, Int_t run)
Bool_tInitFromSnapshot(const char* snapshotFileName, Bool_t overwrite = kTRUE)
virtual voidTObject::Inspect() constMENU
static AliCDBManager*Instance(TMap* entryCache = NULL, Int_t run = -1)
voidTObject::InvertBit(UInt_t f)
virtual TClass*IsA() const
Bool_tIsDefaultStorageSet() const
Bool_tIsDrainSet() const
virtual Bool_tTObject::IsEqual(const TObject* obj) const
virtual Bool_tTObject::IsFolder() const
Bool_tIsOCDBUploadMode() const
Bool_tTObject::IsOnHeap() const
Bool_tIsShortLived(const char* path)
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()
voidTObject::Obsolete(const char* method, const char* asOfVers, const char* removedFromVers) const
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)
virtual voidTObject::Paint(Option_t* option = "")
virtual voidTObject::Pop()
virtual voidPrint(Option_t* option = "") const
Bool_tPut(AliCDBEntry* entry, const char* mirrors = "", AliCDBManager::DataType type = kPrivate)
Bool_tPut(TObject* object, const AliCDBId& id, AliCDBMetaData* metaData, const char* mirrors = "", AliCDBManager::DataType type = kPrivate)
voidQueryCDB()
virtual Int_tTObject::Read(const char* name)
virtual voidTObject::RecursiveRemove(TObject* obj)
voidRegisterFactory(AliCDBStorageFactory* factory)
voidTObject::ResetBit(UInt_t f)
virtual voidTObject::SaveAs(const char* filename = "", Option_t* option = "") constMENU
virtual voidTObject::SavePrimitive(basic_ostream<char,char_traits<char> >& out, Option_t* option = "")
voidTObject::SetBit(UInt_t f)
voidTObject::SetBit(UInt_t f, Bool_t set)
voidSetCacheFlag(Bool_t cacheFlag)
voidSetDefaultStorage(const char* dbString)
voidSetDefaultStorage(const AliCDBParam* param)
voidSetDefaultStorage(AliCDBStorage* storage)
voidSetDefaultStorage(const char* runType, const char* simType)
voidSetDefaultStorageFromRun(Int_t run)
voidSetDrain(const char* dbString)
voidSetDrain(const AliCDBParam* param)
voidSetDrain(AliCDBStorage* storage)
virtual voidTObject::SetDrawOption(Option_t* option = "")MENU
static voidTObject::SetDtorOnly(void* obj)
ULong64_tSetLock(Bool_t lockFlag = kTRUE, ULong64_t key = 0)
voidSetMirrorSEs(const char* mirrors)
static voidTObject::SetObjectStat(Bool_t stat)
Bool_tSetOCDBUploadMode()
voidSetRaw(Bool_t rawFlag)
voidSetRun(Int_t run)
Bool_tSetSnapshotMode(const char* snapshotFileName = "OCDB.root")
voidSetSpecificStorage(const char* calibType, const char* dbString, Int_t version = -1, Int_t subVersion = -1)
virtual voidTObject::SetUniqueID(UInt_t uid)
virtual voidShowMembers(TMemberInspector&)
virtual voidStreamer(TBuffer&)
voidStreamerNVirtual(TBuffer& ClassDef_StreamerNVirtual_b)
virtual voidTObject::SysError(const char* method, const char* msgfmt) const
Bool_tTObject::TestBit(UInt_t f) const
Int_tTObject::TestBits(UInt_t f) const
voidUnloadFromCache(const char* path)
voidUnsetDefaultStorage()
voidUnsetDrain()
voidUnsetOCDBUploadMode()
voidUnsetSnapshotMode()
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:
AliCDBManager()
AliCDBManager(const AliCDBManager& source)
voidAlienToCvmfsUri(TString& uriString) const
voidCacheEntry(const char* path, AliCDBEntry* entry)
virtual voidTObject::DoError(int level, const char* location, const char* fmt, va_list va) const
AliCDBStorage*GetActiveStorage(const AliCDBParam* param)
AliCDBId*GetId(const AliCDBId& query)
AliCDBId*GetId(const AliCDBPath& path, Int_t runNumber = -1, Int_t version = -1, Int_t subVersion = -1)
AliCDBId*GetId(const AliCDBPath& path, const AliCDBRunRange& runRange, Int_t version = -1, Int_t subVersion = -1)
voidGetLHCPeriodAgainstAlienFile(Int_t run, TString& lhcPeriod, Int_t& startRun, Int_t& endRun)
voidGetLHCPeriodAgainstCvmfsFile(Int_t run, TString& lhcPeriod, Int_t& startRun, Int_t& endRun)
AliCDBStorage*GetStorage(const AliCDBParam* param)
voidInitShortLived()
voidTObject::MakeZombie()
AliCDBManager&operator=(const AliCDBManager& source)
voidPutActiveStorage(AliCDBParam* param, AliCDBStorage* storage)
AliCDBParam*SelectSpecificStorage(const TString& path)
voidSetSpecificStorage(const char* calibType, const AliCDBParam* param, Int_t version = -1, Int_t subVersion = -1)
voidValidateCvmfsCase() const

Data Members

public:
enum DataType { kCondition
kReference
kPrivate
};
enum TObject::EStatusBits { kCanDelete
kMustCleanup
kObjInCanvas
kIsReferenced
kHasUUID
kCannotPick
kNoContextMenu
kInvalidObject
};
enum TObject::[unnamed] { kIsOnHeap
kNotDeleted
kZombie
kBitMask
kSingleKey
kOverwrite
kWriteDelete
};
protected:
TMapfActiveStorages! list of active storages
Bool_tfCache! The cache flag
AliCDBParam*fCondParamConditions data storage parameters
TStringfCvmfsOcdbset from $OCDB_PATH, points to a cvmfs AliRoot package
AliCDBStorage*fDefaultStorage! pointer to default storage
AliCDBStorage*fDrainStorage! pointer to drain storage
Int_tfEndRunLHCPeriodlast run of the LHC period set
TMapfEntryCache! cache of the retrieved objects
TListfFactories! list of registered storage factories
TList*fIds! List of the retrieved object Id's (to be streamed to file)
TStringfLHCPeriodLHC period alien folder
Bool_tfLock! Lock flag, if ON default storage and run number cannot be reset
Bool_tfOCDBUploadMode! flag for uploads to Official CDBs (upload to cvmfs must follow upload to AliEn)
Bool_tfRawflag to say whether we are in the raw case
AliCDBParam*fRefParamReference data storage parameters
Int_tfRun! The run number
TList*fShortLived! List of short lived objects
TFile*fSnapshotFile
Bool_tfSnapshotMode! flag saying if we are in snapshot mode
TMapfSpecificStorages! list of detector-specific storages
Int_tfStartRunLHCPeriod1st run of the LHC period set
TMap*fStorageMap! list of storages (to be streamed to file)
static AliCDBManager*fgInstanceAliCDBManager instance
static TStringfgkCondUriURI of the Conditions data base folder
static TStringfgkMCFullStorageURI of the MC-Full Conditions data base folder form MC data
static TStringfgkMCIdealStorageURI of the MC-Ideal Conditions data base folder form MC data
static TStringfgkMCResidualStorageURI of the MC-Residual Conditions data base folder form MC data
static TStringfgkOCDBFolderXMLfilealien path of the XML file for OCDB folder <--> Run range correspondance
static TStringfgkRefUriURI of the Reference data base folder
private:
ULong64_tfKey! Key for locking/unlocking

Class Charts

Inheritance Chart:
TObject
AliCDBManager
AliQAManager

Function documentation

AliCDBManager* Instance(TMap* entryCache = NULL, Int_t run = -1)
 returns AliCDBManager instance (singleton)
void Init()
 factory registering
void InitFromCache(TMap* entryCache, Int_t run)
 initialize manager from existing cache
 used on the slaves in case of parallel reconstruction
void DumpToSnapshotFile(const char* snapshotFileName, Bool_t singleKeys) const
 If singleKeys is true, dump the entries map and the ids list to the snapshot file
 (provided mostly for historical reasons, the file is then read with InitFromSnapshot),
 otherwise write to file each AliCDBEntry separately (the is the preferred way, the file
 is then read with SetSnapshotMode).
void DumpToLightSnapshotFile(const char* lightSnapshotFileName) const
 The light snapshot does not contain the CDB objects (AliCDBEntries) but
 only the information identifying them, that is the map of storages and
 the list of AliCDBIds, as in the UserInfo of AliESDs.root
Bool_t InitFromSnapshot(const char* snapshotFileName, Bool_t overwrite = kTRUE)
 initialize manager from a CDB snapshot, that is add the entries
 to the entries map and the ids to the ids list taking them from
 the map and the list found in the input file
void Destroy()
 delete ALCDBManager instance and active storages
AliCDBManager()
 default constuctor
~AliCDBManager()
 destructor
void PutActiveStorage(AliCDBParam* param, AliCDBStorage* storage)
 put a storage object into the list of active storages
void RegisterFactory(AliCDBStorageFactory* factory)
 add a storage factory to the list of registerd factories
Bool_t HasStorage(const char* dbString) const
 check if dbString is a URI valid for one of the registered factories
AliCDBParam* CreateParameter(const char* dbString) const
 create AliCDBParam object from URI string
void AlienToCvmfsUri(TString& uriString) const
 convert alien storage uri to local:///cvmfs storage uri (called when OCDB_PATH is set)
AliCDBStorage* GetStorage(const char* dbString)
 Get the CDB storage corresponding to the URI string passed as argument
 If "raw://" is passed, get the storage for the raw OCDB for the current run (fRun)
AliCDBStorage* GetStorage(const AliCDBParam* param)
 get storage object from AliCDBParam object
AliCDBStorage* GetActiveStorage(const AliCDBParam* param)
 get a storage object from the list of active storages
TList* GetActiveStorages()
 return list of active storages
 user has responsibility to delete returned object
void SetDrain(const char* dbString)
 set drain storage from URI string
void SetDrain(const AliCDBParam* param)
 set drain storage from AliCDBParam
void SetDrain(AliCDBStorage* storage)
 set drain storage from another active storage
Bool_t Drain(AliCDBEntry* entry)
 drain retrieved object to drain storage
Bool_t SetOCDBUploadMode()
 Set the framework in official upload mode. This tells the framework to upload
 objects to cvmfs after they have been uploaded to AliEn OCDBs.
 It return false if the executable to upload to cvmfs is not found.
void SetDefaultStorage(const char* dbString)
 sets default storage from URI string
void SetDefaultStorage(const AliCDBParam* param)
 set default storage from AliCDBParam object
void SetDefaultStorage(AliCDBStorage* storage)
 set default storage from another active storage
void SetDefaultStorage(const char* runType, const char* simType)
 sets default storage for MC data
 mcString MUST be "MC",
 simType can be "Ideal","Residual","Full"
void ValidateCvmfsCase() const
 The OCDB_PATH variable contains the path to the directory in /cvmfs/ which is
 an AliRoot tag based snapshot of the AliEn file catalogue (e.g.
 /cvmfs/alice.cern.ch/x86_64-2.6-gnu-4.1.2/Packages/OCDB/v5-05-76-AN).
 The directory has to contain:
 1) <data|MC>/20??.list.gz gzipped text files listing the OCDB files (seen by that AliRoot tag)
 2) bin/getOCDBFilesPerRun.sh   (shell+awk) script extracting from 1) the list
    of valid files for the given run.
void SetDefaultStorageFromRun(Int_t run)
 set default storage from the run number - to be used only with raw data
void GetLHCPeriodAgainstAlienFile(Int_t run, TString& lhcPeriod, Int_t& startRun, Int_t& endRun)
 set LHC period (year + first, last run) comparing run number and AliEn XML file
void GetLHCPeriodAgainstCvmfsFile(Int_t run, TString& lhcPeriod, Int_t& startRun, Int_t& endRun)
 set LHC period (year + first, last run) comparing run number and CVMFS file
 We don't want to connect to AliEn just to set the uri from the runnumber
 for that we use the script getUriFromYear.sh in the cvmfs AliRoot package
void UnsetDefaultStorage()
 Unset default storage
void SetSpecificStorage(const char* calibType, const char* dbString, Int_t version = -1, Int_t subVersion = -1)
 sets storage specific for detector or calibration type (works with AliCDBManager::Get(...))
void SetSpecificStorage(const char* calibType, const AliCDBParam* param, Int_t version = -1, Int_t subVersion = -1)
 sets storage specific for detector or calibration type (works with AliCDBManager::Get(...))
 Default storage should be defined prior to any specific storages, e.g.:
 AliCDBManager::instance()->SetDefaultStorage("alien://");
 AliCDBManager::instance()->SetSpecificStorage("TPC/*","local://DB_TPC");
 AliCDBManager::instance()->SetSpecificStorage("*/Align/*","local://DB_TPCAlign");
 calibType must be a valid CDB path! (3 level folder structure)
 Specific version/subversion is set in the uniqueid of the AliCDBParam value stored in the
 specific storages map
AliCDBStorage* GetSpecificStorage(const char* calibType)
 get storage specific for detector or calibration type
AliCDBParam* SelectSpecificStorage(const TString& path)
 select storage valid for path from the list of specific storages
AliCDBEntry* Get(const AliCDBPath& path, Int_t runNumber = -1, Int_t version = -1, Int_t subVersion = -1)
 get an AliCDBEntry object from the database
 RunNumber is not specified. Try with fRun
AliCDBEntry* Get(const AliCDBPath& path, const AliCDBRunRange& runRange, Int_t version = -1, Int_t subVersion = -1)
 get an AliCDBEntry object from the database!
AliCDBEntry* Get(const AliCDBId& query, Bool_t forceCaching = kFALSE)
 get an AliCDBEntry object from the database
AliCDBEntry* GetEntryFromSnapshot(const char* path)
 get the entry from the open snapshot file
Bool_t SetSnapshotMode(const char* snapshotFileName = "OCDB.root")
 set the manager in snapshot mode
const char* GetURI(const char* path)
 return the URI of the storage where to look for path
Int_t GetStartRunLHCPeriod()
 get the first run of validity
 for the current period
 if set
Int_t GetEndRunLHCPeriod()
 get the last run of validity
 for the current period
 if set
TString GetLHCPeriod()
 get the current LHC period string

AliCDBId* GetId(const AliCDBPath& path, Int_t runNumber = -1, Int_t version = -1, Int_t subVersion = -1)
 get the AliCDBId of the valid object from the database (does not retrieve the object)
 User must delete returned object!
 RunNumber is not specified. Try with fRun
AliCDBId* GetId(const AliCDBPath& path, const AliCDBRunRange& runRange, Int_t version = -1, Int_t subVersion = -1)
 get the AliCDBId of the valid object from the database (does not retrieve the object)
 User must delete returned object!
AliCDBId* GetId(const AliCDBId& query)
 get the AliCDBId of the valid object from the database (does not retrieve the object)
 User must delete returned object!
TList* GetAll(const AliCDBPath& path, Int_t runNumber = -1, Int_t version = -1, Int_t subVersion = -1)
 get multiple AliCDBEntry objects from the database
 RunNumber is not specified. Try with fRun
TList* GetAll(const AliCDBPath& path, const AliCDBRunRange& runRange, Int_t version = -1, Int_t subVersion = -1)
 get multiple AliCDBEntry objects from the database
TList* GetAll(const AliCDBId& query)
 get multiple AliCDBEntry objects from the database
 Warning: this method works correctly only for queries of the type "Detector/*"
 		and not for more specific queries e.g. "Detector/Calib/*" !
 Warning #2: Entries are cached, but GetAll will keep on retrieving objects from OCDB!
 		To get an object from cache use Get() function
Bool_t Put(TObject* object, const AliCDBId& id, AliCDBMetaData* metaData, const char* mirrors = "", AliCDBManager::DataType type = kPrivate)
 store an AliCDBEntry object into the database
Bool_t Put(AliCDBEntry* entry, const char* mirrors = "", AliCDBManager::DataType type = kPrivate)
 store an AliCDBEntry object into the database
void SetMirrorSEs(const char* mirrors)
 set mirror Storage Elements for the default storage, if it is of type "alien"
const char* GetMirrorSEs() const
 get mirror Storage Elements for the default storage, if it is of type "alien"
void CacheEntry(const char* path, AliCDBEntry* entry)
 cache AliCDBEntry. Cache is valid until run number is changed.
void Print(Option_t* option = "") const
 Print list of active storages and their URIs
void SetRun(Int_t run)
 Sets current run number.
 When the run number changes the caching is cleared.
void ClearCache()
 clear AliCDBEntry cache
void UnloadFromCache(const char* path)
 unload cached object
 that is remove the entry from the cache and the id from the list of ids

void DestroyActiveStorages()
 delete list of active storages
void DestroyActiveStorage(AliCDBStorage* storage)
 destroys active storage
void QueryCDB()
 query default and specific storages for files valid for fRun. Every storage loads the Ids into its list.
const char* GetDataTypeName(AliCDBManager::DataType type)
 returns the name (string) of the data type
Bool_t DiffObjects(const char* cdbFile1, const char* cdbFile2) const
 Compare byte-by-byte the objects contained in the CDB entry in two different files,
 whose name is passed as input
 Return value:
   kTRUE - in case the content of the OCDB object (persistent part) is exactly the same
   kFALSE - otherwise
void InitShortLived()
 Init the list of short-lived objects
 currently disabled
Bool_t IsShortLived(const char* path)
 returns the name (string) of the data type
ULong64_t SetLock(Bool_t lockFlag = kTRUE, ULong64_t key = 0)
 To lock/unlock user must provide the key. A new key is provided after
 each successful lock. User should always backup the returned key and
 use it on next access.
void ExtractBaseFolder(TString& url)
 TBD RS
 remove everything but the url -
 Exact copy of the AliReconstuction::Rectify.... (to be removed)


AliCDBParam* GetCondParam() const
{return fCondParam;}
AliCDBParam* GetRefParam() const
{return fRefParam;}
const TMap* GetStorageMap() const
{return fStorageMap;}
const TList* GetRetrievedIds() const
{return fIds;}
Bool_t IsDefaultStorageSet() const
{return fDefaultStorage != 0;}
AliCDBStorage* GetDefaultStorage() const
{return fDefaultStorage;}
void UnsetDrain()
{fDrainStorage = 0x0;}
Bool_t IsDrainSet() const
{return fDrainStorage != 0;}
void UnsetOCDBUploadMode()
Bool_t IsOCDBUploadMode() const
{ return fOCDBUploadMode; }
void SetCacheFlag(Bool_t cacheFlag)
{fCache=cacheFlag;}
Bool_t GetCacheFlag() const
{return fCache;}
Bool_t GetLock() const
{return fLock;}
void SetRaw(Bool_t rawFlag)
{fRaw=rawFlag;}
Bool_t GetRaw() const
{return fRaw;}
Int_t GetRun() const
{return fRun;}
const TMap* GetEntryCache() const
{return &fEntryCache;}
void UnsetSnapshotMode()
TString GetCvmfsOcdbTag() const
{return fCvmfsOcdb;}
AliCDBManager()
AliCDBManager & operator=(const AliCDBManager& source)