From: aszostak Date: Mon, 21 Apr 2008 09:08:32 +0000 (+0000) Subject: Makeing the macros for dHLT a little more user friendly. X-Git-Url: http://git.uio.no/git/?p=u%2Fmrichter%2FAliRoot.git;a=commitdiff_plain;h=846e6f41a7e6cd2233ed0f2846cfc1e364562235 Makeing the macros for dHLT a little more user friendly. --- diff --git a/HLT/MUON/macros/MakeHitsTable.C b/HLT/MUON/macros/MakeHitsTable.C index 6193c2212a7..695e6110404 100644 --- a/HLT/MUON/macros/MakeHitsTable.C +++ b/HLT/MUON/macros/MakeHitsTable.C @@ -30,6 +30,7 @@ #include "TFile.h" #include "TError.h" +#include "AliCDBManager.h" #include "AliLoader.h" #include "AliRunLoader.h" #include "AliStack.h" @@ -62,6 +63,22 @@ void MakeHitsTable( Float_t sigmaZtrg = 0.02 // 2 microns resolution ) { + // Setup the CDB default storage and run number if nothing was set. + AliCDBManager* cdbManager = AliCDBManager::Instance(); + if (cdbManager == NULL) + { + cerr << "ERROR: Global CDB manager object does not exist." << endl; + return; + } + if (cdbManager->GetDefaultStorage() == NULL) + { + cdbManager->SetDefaultStorage("local://$ALICE_ROOT"); + } + if (cdbManager->GetRun() == -1) + { + cdbManager->SetRun(0); + } + gSystem->Load("libAliHLTMUON.so"); // Must pree load libAliHLTMUON.so before loading this macro and running it in compiled mode. diff --git a/HLT/MUON/macros/MakeTrackTable.C b/HLT/MUON/macros/MakeTrackTable.C index 631f48b4f1a..61124075341 100644 --- a/HLT/MUON/macros/MakeTrackTable.C +++ b/HLT/MUON/macros/MakeTrackTable.C @@ -31,6 +31,7 @@ #include "TError.h" #include "TMath.h" +#include "AliCDBManager.h" #include "AliLoader.h" #include "AliRunLoader.h" #include "AliStack.h" @@ -62,6 +63,22 @@ void MakeTrackTable( Float_t sigmaZtrg = 0.02 // 2 microns resolution ) { + // Setup the CDB default storage and run number if nothing was set. + AliCDBManager* cdbManager = AliCDBManager::Instance(); + if (cdbManager == NULL) + { + cerr << "ERROR: Global CDB manager object does not exist." << endl; + return; + } + if (cdbManager->GetDefaultStorage() == NULL) + { + cdbManager->SetDefaultStorage("local://$ALICE_ROOT"); + } + if (cdbManager->GetRun() == -1) + { + cdbManager->SetRun(0); + } + gSystem->Load("libAliHLTMUON.so"); // Must pree load libAliHLTMUON.so before loading this macro and running it in compiled mode. diff --git a/HLT/MUON/macros/MakeTriggerTable.C b/HLT/MUON/macros/MakeTriggerTable.C index 10c78bde0ac..777d52f0eb9 100644 --- a/HLT/MUON/macros/MakeTriggerTable.C +++ b/HLT/MUON/macros/MakeTriggerTable.C @@ -30,6 +30,7 @@ #include "TFile.h" #include "TError.h" +#include "AliCDBManager.h" #include "AliLoader.h" #include "AliRunLoader.h" #include "AliStack.h" @@ -58,6 +59,22 @@ void MakeTriggerTable( Float_t sigmaZtrg = 0.02 // 2 microns resolution ) { + // Setup the CDB default storage and run number if nothing was set. + AliCDBManager* cdbManager = AliCDBManager::Instance(); + if (cdbManager == NULL) + { + cerr << "ERROR: Global CDB manager object does not exist." << endl; + return; + } + if (cdbManager->GetDefaultStorage() == NULL) + { + cdbManager->SetDefaultStorage("local://$ALICE_ROOT"); + } + if (cdbManager->GetRun() == -1) + { + cdbManager->SetRun(0); + } + gSystem->Load("libAliHLTMUON.so"); // Must pree load libAliHLTMUON.so before loading this macro and running it in compiled mode. diff --git a/HLT/MUON/macros/RunChain.C b/HLT/MUON/macros/RunChain.C index b60316e67bc..e9fdd81c181 100644 --- a/HLT/MUON/macros/RunChain.C +++ b/HLT/MUON/macros/RunChain.C @@ -41,10 +41,12 @@ */ #if !defined(__CINT__) || defined(__MAKECINT__) -#include "HLT/BASE/AliHLTSystem.h" -#include "HLT/BASE/AliHLTConfiguration.h" +#include "AliCDBManager.h" +#include "AliHLTSystem.h" +#include "AliHLTConfiguration.h" #include "AliLog.h" #include "TString.h" +#include "TClassTable.h" #include using std::cerr; using std::endl; @@ -102,6 +104,22 @@ void RunChain( const char* lutDir = "CDB" ) { + // Setup the CDB default storage and run number if nothing was set. + AliCDBManager* cdbManager = AliCDBManager::Instance(); + if (cdbManager == NULL) + { + cerr << "ERROR: Global CDB manager object does not exist." << endl; + return; + } + if (cdbManager->GetDefaultStorage() == NULL) + { + cdbManager->SetDefaultStorage("local://$ALICE_ROOT"); + } + if (cdbManager->GetRun() == -1) + { + cdbManager->SetRun(0); + } + // Make sure that the lastEvent is greater than firstEvent. if (lastEvent < firstEvent) lastEvent = firstEvent; @@ -222,8 +240,14 @@ void RunChain( )); } - sys.LoadComponentLibraries("libAliHLTUtil.so"); - sys.LoadComponentLibraries("libAliHLTMUON.so"); + if (gClassTable->GetID("AliHLTAgentUtil") < 0) + { + sys.LoadComponentLibraries("libAliHLTUtil.so"); + } + if (gClassTable->GetID("AliHLTMUONAgent") < 0) + { + sys.LoadComponentLibraries("libAliHLTMUON.so"); + } // The DDL file publishers are only needed if we create the ddlreco or // full chains. The filename lists are built assuming the aliroot rawXX/ diff --git a/HLT/MUON/macros/rootlogon.C b/HLT/MUON/macros/rootlogon.C index 0c4a9b4f18b..d1b4e885c90 100644 --- a/HLT/MUON/macros/rootlogon.C +++ b/HLT/MUON/macros/rootlogon.C @@ -54,4 +54,20 @@ gROOT->SetMacroPath(macroPath); gSystem->Load("libAliHLTMUON.so"); + + // Setup the CDB default storage and run number if nothing was set. + AliCDBManager* cdbManager = AliCDBManager::Instance(); + if (cdbManager == NULL) + { + cerr << "ERROR: Global CDB manager object does not exist." << endl; + return; + } + if (cdbManager->GetDefaultStorage() == NULL) + { + cdbManager->SetDefaultStorage("local://$ALICE_ROOT"); + } + if (cdbManager->GetRun() == -1) + { + cdbManager->SetRun(0); + } }