1 #include "AliTestPreprocessor.h"
3 #include "AliCDBMetaData.h"
4 #include "AliDCSValue.h"
6 #include "AliTestDataDCS.h"
8 #include <TTimeStamp.h>
11 // This class is an example for a simple preprocessor.
12 // It takes data from DCS and passes it to the class AliTestDataDCS, which
13 // reformats its. This class is then written to the CDB.
16 ClassImp(AliTestPreprocessor)
18 //______________________________________________________________________________________________
19 AliTestPreprocessor::AliTestPreprocessor(const char* detector, AliShuttleInterface* shuttle) :
20 AliPreprocessor(detector, shuttle),
26 //______________________________________________________________________________________________
27 AliTestPreprocessor::~AliTestPreprocessor()
32 //______________________________________________________________________________________________
33 void AliTestPreprocessor::Initialize(Int_t run, UInt_t startTime,
36 // Creates AliTestDataDCS object
38 AliPreprocessor::Initialize(run, startTime, endTime);
40 AliInfo(Form("\n\tRun %d \n\tStartTime %s \n\tEndTime %s", run,
41 TTimeStamp(startTime).AsString(),
42 TTimeStamp(endTime).AsString()));
44 fData = new AliTestDataDCS(fRun, fStartTime, fEndTime);
47 //______________________________________________________________________________________________
48 UInt_t AliTestPreprocessor::Process(TMap* dcsAliasMap)
50 // Fills data into a AliTestDataDCS object
55 // The processing of the DCS input data is forwarded to AliTestDataDCS
56 fData->ProcessData(*dcsAliasMap);
58 const char* fileName = GetFile(kDAQ, "PEDESTALS", "GDC");
60 AliInfo(Form("Got the file %s, now we can extract some values.", fileName));
61 //TODO here the file could be opened, some values extracted and written to e.g. fData
63 TList* list = GetFileSources(kDAQ, "DRIFTVELOCITY");
66 AliInfo("The following sources produced files with the id DRIFTVELOCITY");
70 //TODO here the files could be opened, some values extracted and written to e.g. fData
72 //Now we have to store the final CDB file
73 AliCDBMetaData metaData;
74 metaData.SetBeamPeriod(0);
75 metaData.SetResponsible("Alberto Colla");
76 metaData.SetComment("This preprocessor fills an AliTestDataDCS object.");
78 UInt_t result = Store("SHUTTLE", "Data", fData, &metaData, 0, 0);