1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
17 // Prototype of TRD Preprocessor
20 #include "TestTRDPreprocessor.h"
22 #include "AliCDBMetaData.h"
23 #include "AliDCSValue.h"
25 #include "AliShuttleInterface.h"
27 #include <TTimeStamp.h>
28 #include <TObjString.h>
31 ClassImp(TestTRDPreprocessor)
33 //________________________________________________________________________________________
34 TestTRDPreprocessor::TestTRDPreprocessor():
35 AliPreprocessor("TRD",0)
37 // default constructor - Don't use this!
41 //________________________________________________________________________________________
42 TestTRDPreprocessor::TestTRDPreprocessor(AliShuttleInterface* shuttle):
43 AliPreprocessor("TRD", shuttle)
45 // constructor - shuttle must be instantiated!
49 //________________________________________________________________________________________
50 void TestTRDPreprocessor::Initialize(Int_t run, UInt_t startTime,
53 // Initialize preprocessor
55 AliInfo(Form("\n\tRun %d \n\tStartTime %s \n\tEndTime %s", run,
56 TTimeStamp(startTime).AsString(),
57 TTimeStamp(endTime).AsString()));
60 fStartTime = startTime;
64 //________________________________________________________________________________________
65 UInt_t TestTRDPreprocessor::Process(TMap* /*valueMap*/)
67 // process data retrieved by the Shuttle
69 //TIter iter(valueMap);
71 //while ((aPair = (TPair*) iter.Next())) {
74 //AliCDBMetaData metaData;
75 //metaData.SetComment("This is a test!");
77 // return Store(valueMap, &metaData);
79 TList* filesources = GetFileSources(AliShuttleInterface::kHLT, "Calib_String");
82 AliError(Form("No sources found for Calib_String for run %d !", fRun));
86 AliInfo("Here's the list of sources for Calib_String");
89 TIter iter(filesources);
93 while((source=dynamic_cast<TObjString*> (iter.Next()))){
94 printf("\n\n Getting file #%d\n",++i);
96 TString filename = GetFile(AliShuttleInterface::kHLT, "Calib_String", source->GetName());
97 if(!filename.Length()) {
98 AliError(Form("Error: retrieval of file from source %s failed!", source->GetName()));
102 TString command = Form("more %s",filename.Data());
103 gSystem->Exec(command.Data());
105 // STORAGE! The First file name will be stored into CDB, the second into reference storage
106 TObjString filenameObj(filename);
107 AliCDBMetaData metaData;
108 result = Store("Calib", "Data", &filenameObj, &metaData);
109 // if(i==1) result = Store("Calib", "Data", &filenameObj, &metaData);
110 // if(i==2) result = StoreReferenceData("Calib", "RefData", &filenameObj, &metaData);