#include <TTimeStamp.h>
#include <TObjString.h>
+#include <TList.h>
//
// This class is an example for a simple preprocessor.
AliPreprocessor::Initialize(run, startTime, endTime);
- AliInfo(Form("\n\tRun %d \n\tStartTime %s \n\tEndTime %s", run,
+ Log(Form("\n\tRun %d \n\tStartTime %s \n\tEndTime %s", run,
TTimeStamp(startTime).AsString(),
TTimeStamp(endTime).AsString()));
fData = new AliTestDataDCS(fRun, fStartTime, fEndTime);
}
+//______________________________________________________________________________________________
+Bool_t AliTestPreprocessor::ProcessDCS()
+{
+ //
+ // decide here if DCS data is to be processed
+ //
+
+ // TODO implement a decision, e.g. based on the run type
+ // In this example: Skip DCS if run type is CALIB
+ if (strcmp(GetRunType(), "CALIB") == 0)
+ return kFALSE;
+
+ return kTRUE;
+}
+
//______________________________________________________________________________________________
UInt_t AliTestPreprocessor::Process(TMap* dcsAliasMap)
{
// Fills data into a AliTestDataDCS object
if (!dcsAliasMap)
- return 0;
+ return 1;
// The processing of the DCS input data is forwarded to AliTestDataDCS
- fData->ProcessData(*dcsAliasMap);
+ fData->ProcessData(*dcsAliasMap);
+
+ // Example of how to retrieve the run type from the Shuttle, using GetRunType() function
+ // TODO Here the run type for the "DET" detector must be set manually with SetInputRunType function,
+ // in reality it will be read from the "run type" logbook!
+ TString runType = GetRunType();
+ Log(Form("Run type for run %d: %s", fRun, runType.Data()));
- const char* fileName = GetFile(kDAQ, "PEDESTALS", "GDC");
- if (fileName)
- AliInfo(Form("Got the file %s, now we can extract some values.", fileName));
+ TString fileName = GetFile(kDAQ, "PEDESTALS", "GDC");
+ if (fileName.Length() > 0)
+ Log(Form("Got the file %s, now we can extract some values.", fileName.Data()));
//TODO here the file could be opened, some values extracted and written to e.g. fData
+ //Example to store a file directly to the reference storage
+ if (!StoreReferenceFile(fileName, "InputData.root"))
+ return 1;
+
TList* list = GetFileSources(kDAQ, "DRIFTVELOCITY");
if (list)
{
- AliInfo("The following sources produced files with the id DRIFTVELOCITY");
+ Log("The following sources produced files with the id DRIFTVELOCITY");
list->Print();
delete list;
}
//Now we have to store the final CDB file
AliCDBMetaData metaData;
metaData.SetBeamPeriod(0);
- metaData.SetResponsible("Alberto Colla");
+ metaData.SetResponsible("TPC expert");
metaData.SetComment("This preprocessor fills an AliTestDataDCS object.");
- UInt_t result = Store("SHUTTLE", "Data", fData, &metaData, 0, 0);
+ Bool_t result = Store("Calib", "Data", fData, &metaData, 0, 0);
delete fData;
fData = 0;
- return result;
+ if (!result)
+ return 1;
+
+ return 0;
}