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 **************************************************************************/
18 //-------------------------------------------------------------------------
19 // Class AliGRPPreprocessor
20 // Global Run Parameters (GRP) preprocessor
21 // Origin: Panos Christakoglou, UOA-CERN, Panos.Christakoglou@cern.ch
22 //-------------------------------------------------------------------------
26 #include <TObjString.h>
27 #include <TTimeStamp.h>
29 #include "AliGRPPreprocessor.h"
30 #include "AliGRPDCS.h"
32 #include "AliCDBMetaData.h"
36 class AliShuttleInterface;
40 ClassImp(AliGRPPreprocessor)
42 //_______________________________________________________________
43 AliGRPPreprocessor::AliGRPPreprocessor():
44 AliPreprocessor("GRP",0) {
45 // default constructor - Don't use this!
49 //_______________________________________________________________
50 AliGRPPreprocessor::AliGRPPreprocessor(AliShuttleInterface* shuttle):
51 AliPreprocessor("GRP",shuttle) {
52 // constructor - shuttle must be instantiated!
56 //_______________________________________________________________
57 AliGRPPreprocessor::~AliGRPPreprocessor() {
61 //_______________________________________________________________
62 void AliGRPPreprocessor::Initialize(Int_t run, UInt_t startTime, UInt_t endTime) {
63 // Initialize preprocessor
65 AliInfo(Form("\n\tRun %d \n\tStartTime %s \n\tEndTime %s", run, TTimeStamp(startTime).AsString(), TTimeStamp(endTime).AsString()));
68 fStartTime = startTime;
70 AliInfo("This preprocessor is to test the GetRunParameter function.");
73 //_______________________________________________________________
74 UInt_t AliGRPPreprocessor::Process(TMap* valueMap) {
75 // process data retrieved by the Shuttle
76 const char* timeStart = GetRunParameter("time_start");
77 const char* timeEnd = GetRunParameter("time_end");
78 TObjArray *alias1 = (TObjArray *)valueMap->GetValue("SFTTemp1.FloatValue");
80 Log(Form("SFTTemp1.FloatValue not found!!!"));
83 AliGRPDCS *dcs = new AliGRPDCS(alias1);
84 TH1F *h1 = new TH1F("alias1","",100,15,25);
85 TString sAlias1Mean = dcs->ProcessDCS(h1);
90 Log(Form("<alias1> for run %d: %s",fRun, sAlias1Mean.Data()));
92 Log(Form("DCSAlias1 not put in TMap!"));
95 Log(Form("Start time for run %d: %s",fRun, timeStart));
97 Log(Form("Start time not put in logbook!"));
100 Log(Form("End time for run %d: %s",fRun, timeEnd));
102 Log(Form("End time not put in logbook!"));
105 TList *values = new TList();
108 TMap *map1 = new TMap();
109 map1->Add(new TObjString("histoDCS1"),h1);
112 TMap *map2 = new TMap();
113 map2->Add(new TObjString("DCS1"),new TObjString(sAlias1Mean));
116 TMap *map3 = new TMap();
117 map3->Add(new TObjString("fAliceStartTime"),new TObjString(timeStart));
120 TMap *map4 = new TMap();
121 map4->Add(new TObjString("fAliceStopTime"),new TObjString(timeEnd));
125 md.SetResponsible("Panos");
127 result = Store("GRP", "Values", values, &md);