]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/rec/AliHLTMisc.cxx
Preliminary files for CMake
[u/mrichter/AliRoot.git] / HLT / rec / AliHLTMisc.cxx
CommitLineData
7e914051 1// $Id$
579d9eb7 2
3/**************************************************************************
4 * This file is property of and copyright by the ALICE HLT Project *
5 * ALICE Experiment at CERN, All rights reserved. *
6 * *
7 * Primary Authors: Matthias Richter <Matthias.Richter@ift.uib.no> *
8 * for The ALICE HLT Project. *
9 * *
10 * Permission to use, copy, modify and distribute this software and its *
11 * documentation strictly for non-commercial purposes is hereby granted *
12 * without fee, provided that the above copyright notice appears in all *
13 * copies and that both the copyright notice and this permission notice *
14 * appear in the supporting documentation. The authors make no claims *
15 * about the suitability of this software for any purpose. It is *
16 * provided "as is" without express or implied warranty. *
17 **************************************************************************/
18
19/** @file AliHLTMisc.cxx
20 @author Matthias Richter
21 @date
22 @brief Miscellaneous methods for the HLT AliRoot integration
23*/
24
25#include "AliHLTMisc.h"
26#include "AliHLTLogging.h"
27#include "AliCDBManager.h"
28
29int AliHLTMiscInitCDB(const char* cdbpath)
30{
31 int iResult=0;
32 AliCDBManager* pCDB = AliCDBManager::Instance();
33 AliHLTLogging log;
34 if (!pCDB) {
35 log.Logging(kHLTLogError, "InitCDB", "CDB handling", "Could not get CDB instance");
36 } else {
703bcca6 37 if (cdbpath && cdbpath[0]!=0) {
38 pCDB->SetDefaultStorage(cdbpath);
39 log.Logging(kHLTLogDebug, "InitCDB", "CDB handling", "CDB instance 0x%x", pCDB);
40 } else if (!pCDB->IsDefaultStorageSet()) {
41 const char* cdbUri="local://$ALICE_ROOT";
42 pCDB->SetDefaultStorage(cdbUri);
43 pCDB->SetRun(0);
44 log.Logging(kHLTLogInfo, "InitCDB", "CDB handling", "set default URI: %s", cdbUri);
45 }
579d9eb7 46 }
47 return iResult;
48}
49
50int AliHLTMiscSetCDBRunNo(int runNo)
51{
52 int iResult=0;
53 AliCDBManager* pCDB = AliCDBManager::Instance();
54 AliHLTLogging log;
55 if (!pCDB) {
56 log.Logging(kHLTLogError, "InitCDB", "CDB handling", "Could not get CDB instance");
57 } else {
58 pCDB->SetRun(runNo);
59 }
60 return iResult;
61}