Implementation of Shuttle access to HLT FXS and database
authoracolla <acolla@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 15 Jan 2007 09:30:07 +0000 (09:30 +0000)
committeracolla <acolla@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 15 Jan 2007 09:30:07 +0000 (09:30 +0000)
SHUTTLE/test/LinkDef.h
SHUTTLE/test/Makefile
SHUTTLE/test/TestShuttleLogbook.C
SHUTTLE/test/TestTRDPreprocessor.cxx [new file with mode: 0644]
SHUTTLE/test/TestTRDPreprocessor.h [new file with mode: 0644]

index 2aa20a691c6903004d49ed9a69e72e090bb0130f..645a1e675543c226f8a88ff0643758c862c6a1b6 100644 (file)
@@ -12,6 +12,7 @@
 #pragma link C++ class TestTPCPreprocessor;
 #pragma link C++ class TestHMPIDPreprocessor;
 #pragma link C++ class TestZDCPreprocessor;
+#pragma link C++ class TestTRDPreprocessor;
 #pragma link C++ class AliTPCDataDCS;
 
 #endif
index cc0a48ca598709be22623dfbb577786c4023d2bb..2c9c50d234ad2425407161b4050ff136f1016fb0 100644 (file)
@@ -3,7 +3,7 @@ include ../../build/Makefile.$(ALICE_TARGET)
 
 
 CLASSES = TestITSPreprocessorSPD.cxx TestTPCPreprocessor.cxx TestHMPIDPreprocessor.cxx AliTPCDataDCS.cxx \
-         TestZDCPreprocessor.cxx
+         TestZDCPreprocessor.cxx TestTRDPreprocessor.cxx
 DICT = DictTest.cxx
 
 HEADERS := $(patsubst %.cxx,%.h,$(CLASSES))
index fc5e0f4673be009640d3eba4037794797151faac..f05df9f5249b99fe3f0121ab7a3197a8cdb38911 100644 (file)
@@ -288,10 +288,10 @@ void TestShuttleLogbook(){
 
        AliShuttleLogbookEntry::Status y[18]={1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1};
        AliShuttleLogbookEntry lb(21242, y);
-//     lb.SetDetectorStatus("HMP","Unprocessed"); // HMPID
-//     lb.SetDetectorStatus("ZDC","Unprocessed"); // ZDC
-//     lb.SetDetectorStatus("TPC","Unprocessed"); // TPC
-//     lb.SetDetectorStatus("SPD","Unprocessed"); // SPD
+       lb.SetDetectorStatus("HMP","Unprocessed"); // HMPID
+       lb.SetDetectorStatus("ZDC","Unprocessed"); // ZDC
+       lb.SetDetectorStatus("TPC","Unprocessed"); // TPC
+       lb.SetDetectorStatus("SPD","Unprocessed"); // SPD
        lb.SetDetectorStatus("GRP","Unprocessed"); // GRP
        lb.Print();
 
@@ -299,7 +299,7 @@ void TestShuttleLogbook(){
        InsertNewRun(lb,21243);
        InsertNewRun(lb,21244);
        InsertNewRun(lb,21245);
-       InsertNewRun(lb,21246);
-       InsertNewRun(lb,1000);
+//     InsertNewRun(lb,21246);
+//     InsertNewRun(lb,1000);
 
 }
diff --git a/SHUTTLE/test/TestTRDPreprocessor.cxx b/SHUTTLE/test/TestTRDPreprocessor.cxx
new file mode 100644 (file)
index 0000000..3a8fa83
--- /dev/null
@@ -0,0 +1,117 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+//
+// Prototype of TRD Preprocessor
+//
+
+#include "TestTRDPreprocessor.h"
+
+#include "AliCDBMetaData.h"
+#include "AliDCSValue.h"
+#include "AliLog.h"
+#include "AliShuttleInterface.h"
+
+#include <TTimeStamp.h>
+#include <TObjString.h>
+#include <TSystem.h>
+
+ClassImp(TestTRDPreprocessor)
+
+//________________________________________________________________________________________
+TestTRDPreprocessor::TestTRDPreprocessor():
+       AliPreprocessor("TRD",0)
+{
+// default constructor - Don't use this!
+
+}
+
+//________________________________________________________________________________________
+TestTRDPreprocessor::TestTRDPreprocessor(AliShuttleInterface* shuttle):
+       AliPreprocessor("TRD", shuttle)
+{
+// constructor - shuttle must be instantiated!
+
+}
+
+//________________________________________________________________________________________
+void TestTRDPreprocessor::Initialize(Int_t run, UInt_t startTime,
+       UInt_t endTime)
+{
+// Initialize preprocessor
+
+       AliInfo(Form("\n\tRun %d \n\tStartTime %s \n\tEndTime %s", run,
+               TTimeStamp(startTime).AsString(),
+               TTimeStamp(endTime).AsString()));
+
+       fRun = run;
+       fStartTime = startTime;
+       fEndTime = endTime;
+}
+
+//________________________________________________________________________________________
+UInt_t TestTRDPreprocessor::Process(TMap* /*valueMap*/)
+{
+// process data retrieved by the Shuttle
+
+       //TIter iter(valueMap);
+       //TPair* aPair;
+       //while ((aPair = (TPair*) iter.Next())) {
+               //aPair->Print();
+       //}
+       //AliCDBMetaData metaData;
+       //metaData.SetComment("This is a test!");
+
+       // return Store(valueMap, &metaData);
+
+       TList* filesources = GetFileSources(AliShuttleInterface::kHLT, "Calib_String");
+
+       if(!filesources) {
+               AliError(Form("No sources found for Calib_String for run %d !", fRun));
+               return 0;
+       }
+
+       AliInfo("Here's the list of sources for Calib_String");
+       filesources->Print();
+
+       TIter iter(filesources);
+       TObjString* source;
+       int i=0;
+       UInt_t result = 0;
+       while((source=dynamic_cast<TObjString*> (iter.Next()))){
+               printf("\n\n Getting file #%d\n",++i);
+               //if(i==1) continue;
+               TString filename = GetFile(AliShuttleInterface::kHLT, "Calib_String", source->GetName());
+               if(!filename.Length()) {
+                       AliError(Form("Error: retrieval of file from source %s failed!", source->GetName()));
+                       delete filesources;
+                       return 0;
+               }
+               TString command = Form("more %s",filename.Data());
+               gSystem->Exec(command.Data());
+
+               // STORAGE! The First file name will be stored into CDB, the second into reference storage
+               TObjString filenameObj(filename);
+               AliCDBMetaData metaData;
+               result = Store("Calib", "Data", &filenameObj, &metaData);
+//             if(i==1) result = Store("Calib", "Data", &filenameObj, &metaData);
+//             if(i==2) result = StoreReferenceData("Calib", "RefData", &filenameObj, &metaData);
+
+       }
+       delete filesources;
+
+       return result;
+}
+
diff --git a/SHUTTLE/test/TestTRDPreprocessor.h b/SHUTTLE/test/TestTRDPreprocessor.h
new file mode 100644 (file)
index 0000000..13e0ec7
--- /dev/null
@@ -0,0 +1,25 @@
+#ifndef TEST_TRD_PRE_PROCESSOR_H
+#define TEST_TRD_PRE_PRECESSOR_H
+
+#include "AliPreprocessor.h"
+
+//
+// Prototype of TRD Preprocessor
+//
+
+class TestTRDPreprocessor: public AliPreprocessor {
+public:
+       TestTRDPreprocessor();
+       TestTRDPreprocessor(AliShuttleInterface* shuttle);
+
+protected:
+
+        virtual void Initialize(Int_t run, UInt_t startTime,
+                        UInt_t endTime);
+
+        virtual UInt_t Process(TMap* valueSet);
+
+       ClassDef(TestTRDPreprocessor, 0);
+};
+
+#endif