/*
$Log$
+Revision 1.6 2006/11/06 14:22:47 jgrosseo
+major update (Alberto)
+o) reading of run parameters from the logbook
+o) online offline naming conversion
+o) standalone DCSclient package
+
Revision 1.5 2006/10/02 12:58:52 jgrosseo
Small interface change in StoreReferenceData
#include <TMap.h>
#include <TList.h>
#include <TObjString.h>
+#include <TSystem.h>
ClassImp(AliTestShuttle)
-TString AliTestShuttle::fgkOCDBUri("local://$ALICE_ROOT/SHUTTLE/TestShuttle/TestCDB");
-TString AliTestShuttle::fgkRefUri("local://$ALICE_ROOT/SHUTTLE/TestShuttle/TestReference");
+TString AliTestShuttle::fgkMainCDB("local://$ALICE_ROOT/SHUTTLE/TestShuttle/TestCDB");
+TString AliTestShuttle::fgkMainRefStorage("local://$ALICE_ROOT/SHUTTLE/TestShuttle/TestReference");
+
+TString AliTestShuttle::fgkShuttleTempDir = gSystem->ExpandPathName("$ALICE_ROOT/SHUTTLE/TestShuttle/temp");
+TString AliTestShuttle::fgkShuttleLogDir = gSystem->ExpandPathName("$ALICE_ROOT/SHUTTLE/TestShuttle/log");
//______________________________________________________________________________________________
AliTestShuttle::AliTestShuttle(Int_t run, UInt_t startTime, UInt_t endTime) :
AliCDBId id(path, startRun, endRun);
- return AliCDBManager::Instance()->GetStorage(fgkOCDBUri)->Put(object, id, metaData);
+ return AliCDBManager::Instance()->GetStorage(fgkMainCDB)->Put(object, id, metaData);
}
//______________________________________________________________________________________________
AliCDBId id(path, fRun, fRun);
- return AliCDBManager::Instance()->GetStorage(fgkRefUri)->Put(object, id, metaData);
+ return AliCDBManager::Instance()->GetStorage(fgkMainRefStorage)->Put(object, id, metaData);
}
//______________________________________________________________________________________________
}
return value->GetName();
}
+
+//______________________________________________________________________________________________
+void AliTestShuttle::SetShuttleTempDir(const char* tmpDir)
+{
+// sets Shuttle temp directory
+
+ fgkShuttleTempDir = gSystem->ExpandPathName(tmpDir);
+}
+
+//______________________________________________________________________________________________
+void AliTestShuttle::SetShuttleLogDir(const char* logDir)
+{
+// sets Shuttle log directory
+
+ fgkShuttleLogDir = gSystem->ExpandPathName(logDir);
+}
+
AliTestShuttle(Int_t run, UInt_t startTime, UInt_t endTime);
virtual ~AliTestShuttle();
- static TString GetOCDBStorage () {return fgkOCDBUri;}
- static void SetOCDBStorage (TString ocdbUri) {fgkOCDBUri = ocdbUri;}
- static TString GetReferenceStorage () {return fgkRefUri;}
- static void SetReferenceStorage (TString refUri) {fgkRefUri = refUri;}
-
void AddInputFile(Int_t system, const char* detector, const char* id, const char* source, const char* fileName);
void SetDCSInput(TMap* dcsAliasMap) { fDcsAliasMap = dcsAliasMap; }
void AddInputRunParameter(const char* key, const char* value);
virtual const char* GetRunParameter(const char* key);
virtual void Log(const char* detector, const char* message);
+ static TString GetMainCDB () {return fgkMainCDB;}
+ static void SetMainCDB (TString mainCDB) {fgkMainCDB = mainCDB;}
+ static TString GetMainRefStorage() {return fgkMainRefStorage;}
+ static void SetMainRefStorage (TString mainRefStorage) {fgkMainRefStorage = mainRefStorage;}
+
+ static void SetShuttleTempDir (const char* tmpDir);
+ static const char* GetShuttleTempDir() {return fgkShuttleTempDir.Data();}
+ static void SetShuttleLogDir (const char* logDir);
+ static const char* GetShuttleLogDir() {return fgkShuttleLogDir.Data();}
+
virtual void RegisterPreprocessor(AliPreprocessor* preprocessor);
protected:
- static TString fgkOCDBUri; // URI of the test OCDB storage
- static TString fgkRefUri; // URI of the test Reference storage
+ static TString fgkMainCDB; // URI of the main (Grid) CDB storage
+ static TString fgkMainRefStorage; // URI of the main (Grid) REFERENCE storage
+ static TString fgkShuttleTempDir; // base path of SHUTTLE temp folder
+ static TString fgkShuttleLogDir; // path of SHUTTLE log folder
Int_t fRun; // run that is simulated with the AliTestShuttle
UInt_t fStartTime; // starttime that is simulated with the AliTestShuttle
// TODO if needed, change location of OCDB and Reference test folders
// by default they are set to $ALICE_ROOT/SHUTTLE/TestShuttle/TestCDB and TestReference
- // AliTestShuttle::SetOCDBStorage("local://$ALICE_ROOT/SHUTTLE/TestShuttle/TestCDB");
- // AliTestShuttle::SetReferenceStorage("local://$ALICE_ROOT/SHUTTLE/TestShuttle/TestCDB");
+ // AliTestShuttle::SetMainCDB("local://$ALICE_ROOT/SHUTTLE/TestShuttle/TestCDB");
+ // AliTestShuttle::SetMainRefStorage("local://$ALICE_ROOT/SHUTTLE/TestShuttle/TestCDB");
+
+ printf("Test OCDB storage Uri: %s\n", AliTestShuttle::GetMainCDB().Data());
+ printf("Test Reference storage Uri: %s\n", AliTestShuttle::GetMainRefStorage().Data());
+
+ // TODO if needed, change location of temp and log folders (however they are not explicitly used here)
+ // by default they are set to $ALICE_ROOT/SHUTTLE/TestShuttle/temp and log
+ // AliTestShuttle::SetShuttleTempDir("local://$ALICE_ROOT/SHUTTLE/TestShuttle/temp");
+ // AliTestShuttle::SetShuttleLogDir("local://$ALICE_ROOT/SHUTTLE/TestShuttle/log");
+
+ printf("Test Shuttle temp dir: %s\n", AliTestShuttle::GetShuttleTempDir());
+ printf("Test Shuttle log dir: %s\n", AliTestShuttle::GetShuttleLogDir());
- printf("Test OCDB storage Uri: %s\n", AliTestShuttle::GetOCDBStorage().Data());
- printf("Test Reference storage Uri: %s\n", AliTestShuttle::GetReferenceStorage().Data());
// create AliTestShuttle instance
// The parameters are run, startTime, endTime
// $ALICE_ROOT/SHUTTLE/TestShuttle/TestCDB/<detector>/SHUTTLE/Data
//
// Check the file which should have been created
- AliCDBEntry* entry = AliCDBManager::Instance()->GetStorage(AliTestShuttle::GetOCDBStorage())
+ AliCDBEntry* entry = AliCDBManager::Instance()->GetStorage(AliTestShuttle::GetMainCDB())
->Get("TPC/SHUTTLE/Data", 7);
if (!entry)
{
// The file contains an AliCDBEntry that contains a TMap with the DCS structure.
// An explanation of the structure can be found in CreateDCSAliasMap()
- AliCDBEntry *entry = AliCDBManager::Instance()->Get("DET/DCS/Data", 0);
+ AliCDBManager::Instance()->GetStorage(AliTestShuttle::GetMainCDB())
+ AliCDBEntry *entry = AliCDBManager::Instance()->GetStorage(AliTestShuttle::GetMainCDB())
+ ->Get("DET/DCS/Data", 0);
return dynamic_cast<TMap*> (entry->GetObject());
}
AliCDBId id("DET/DCS/Data", 0, 0);
- // initialize location of CDB
- AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT/SHUTTLE/TestShuttle/TestCDB");
+ // look into AliTestShuttle's CDB main folder
- AliCDBManager::Instance()->Put(dcsAliasMap, id, &metaData);
+ AliCDBManager::Instance()->GetStorage(AliTestShuttle::GetMainCDB())
+ ->Put(dcsAliasMap, id, &metaData);
}