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 **************************************************************************/
16 //-------------------------------------------------------------------------
17 // Class AliGRPPreprocessor
18 // Global Run Parameters (GRP) preprocessor
19 // Origin: Panos Christakoglou, UOA-CERN, Panos.Christakoglou@cern.ch
20 //-------------------------------------------------------------------------
22 #include "AliGRPPreprocessor.h"
23 #include "AliGRPDCS.h"
25 #include "AliCDBMetaData.h"
28 #include <TTimeStamp.h>
30 #include <TObjString.h>
33 class AliShuttleInterface;
37 ClassImp(AliGRPPreprocessor)
39 //_______________________________________________________________
40 AliGRPPreprocessor::AliGRPPreprocessor():
41 AliPreprocessor("GRP",0) {
42 // default constructor - Don't use this!
46 //_______________________________________________________________
47 AliGRPPreprocessor::AliGRPPreprocessor(AliShuttleInterface* shuttle):
48 AliPreprocessor("GRP",shuttle) {
49 // constructor - shuttle must be instantiated!
53 //_______________________________________________________________
54 AliGRPPreprocessor::~AliGRPPreprocessor() {
58 //_______________________________________________________________
59 void AliGRPPreprocessor::Initialize(Int_t run, UInt_t startTime, UInt_t endTime) {
60 // Initialize preprocessor
62 AliInfo(Form("\n\tRun %d \n\tStartTime %s \n\tEndTime %s", run, TTimeStamp(startTime).AsString(), TTimeStamp(endTime).AsString()));
65 fStartTime = startTime;
67 AliInfo("This preprocessor is to test the GetRunParameter function.");
70 //_______________________________________________________________
71 UInt_t AliGRPPreprocessor::Process(TMap* valueMap) {
72 // process data retrieved by the Shuttle
73 const char* timeStart = GetRunParameter("time_start");
74 const char* timeEnd = GetRunParameter("time_end");
75 TObjArray *alias1 = (TObjArray *)valueMap->GetValue("SFTTemp1.FloatValue");
76 AliGRPDCS *dcs = new AliGRPDCS(alias1);
77 TH1F *h1 = new TH1F("alias1","",100,15,25);
78 TString sAlias1Mean = dcs->ProcessDCS(h1);
83 Log(Form("<alias1> for run %d: %s",fRun, sAlias1Mean.Data()));
85 Log(Form("DCSAlias1 not put in TMap!"));
88 Log(Form("Start time for run %d: %s",fRun, timeStart));
90 Log(Form("Start time not put in logbook!"));
93 Log(Form("End time for run %d: %s",fRun, timeEnd));
95 Log(Form("End time not put in logbook!"));
98 TList *values = new TList();
101 TMap *map1 = new TMap();
102 map1->Add(new TObjString("histoDCS1"),h1);
105 TMap *map2 = new TMap();
106 map2->Add(new TObjString("DCS1"),new TObjString(sAlias1Mean));
109 TMap *map3 = new TMap();
110 map3->Add(new TObjString("fAliceStartTime"),new TObjString(timeStart));
113 TMap *map4 = new TMap();
114 map4->Add(new TObjString("fAliceStopTime"),new TObjString(timeEnd));
118 md.SetResponsible("Panos");
120 result = Store("GRP", "Values", values, &md);