/*
$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
+
Revision 1.4 2006/08/08 14:19:07 jgrosseo
Update to shuttle classes (Alberto)
#include <TMap.h>
#include <TList.h>
-#include <TString.h>
#include <TObjString.h>
+#include <TSystem.h>
ClassImp(AliTestShuttle)
fStartTime(startTime),
fEndTime(endTime),
fInputFiles(0),
+ fRunParameters(0),
fPreprocessors(0),
fDcsAliasMap(0)
{
// constructor
fInputFiles = new TMap;
+ fRunParameters = new TMap;
fPreprocessors = new TObjArray;
}
delete fInputFiles;
fInputFiles = 0;
+ delete fRunParameters;
+ fRunParameters = 0;
+
delete fPreprocessors;
fPreprocessors = 0;
AliCDBId id(path, startRun, endRun);
- return AliCDBManager::Instance()->Put(object, id, metaData);
+ return AliCDBManager::Instance()->GetStorage(fgkMainCDB)->Put(object, id, metaData);
}
//______________________________________________________________________________________________
AliCDBId id(path, fRun, fRun);
- return AliCDBManager::Instance()->GetStorage("local://ReferenceStorage")->Put(object, id, metaData);
+ return AliCDBManager::Instance()->GetStorage(fgkMainRefStorage)->Put(object, id, metaData);
}
//______________________________________________________________________________________________
{
// registers a preprocessor
- fPreprocessors->Add(preprocessor);
+ const char* detName = preprocessor->GetName();
+ if(strcmp("DET", detName) != 0) {
+ if(GetDetPos(detName) < 0)
+ AliFatal(Form("********** !!!!! Invalid detector name: %s !!!!! **********", detName));
+ }
+
+ fPreprocessors->Add(preprocessor);
}
+
+//______________________________________________________________________________________________
+void AliTestShuttle::AddInputRunParameter(const char* key, const char* value){
+// set a run parameter (in reality it will be read from the DAQ logbook)
+
+ TObjString* keyObj = new TObjString(key);
+ if (fRunParameters->Contains(key)) {
+ AliWarning(Form("Parameter %s already existing and it will be replaced.", key));
+ delete fRunParameters->Remove(keyObj);
+
+ }
+ fRunParameters->Add(keyObj, new TObjString(value));
+ AliDebug(2, Form("Number of parameters: %d", fRunParameters->
+ GetEntries()));
+}
+
+//______________________________________________________________________________________________
+const char* AliTestShuttle::GetRunParameter(const char* key){
+// get a run parameter
+
+ TObjString* value = dynamic_cast<TObjString*> (fRunParameters->GetValue(key));
+ if(!value) {
+ AliError(Form("No such parameter: %s", key));
+ return 0;
+ }
+ return value->GetName();
+}
+