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");
77 Log(Form("SFTTemp1.FloatValue not found!!!"));
80 AliGRPDCS *dcs = new AliGRPDCS(alias1);
81 TH1F *h1 = new TH1F("alias1","",100,15,25);
82 TString sAlias1Mean = dcs->ProcessDCS(h1);
87 Log(Form("<alias1> for run %d: %s",fRun, sAlias1Mean.Data()));
89 Log(Form("DCSAlias1 not put in TMap!"));
92 Log(Form("Start time for run %d: %s",fRun, timeStart));
94 Log(Form("Start time not put in logbook!"));
97 Log(Form("End time for run %d: %s",fRun, timeEnd));
99 Log(Form("End time not put in logbook!"));
102 TList *values = new TList();
105 TMap *map1 = new TMap();
106 map1->Add(new TObjString("histoDCS1"),h1);
109 TMap *map2 = new TMap();
110 map2->Add(new TObjString("DCS1"),new TObjString(sAlias1Mean));
113 TMap *map3 = new TMap();
114 map3->Add(new TObjString("fAliceStartTime"),new TObjString(timeStart));
117 TMap *map4 = new TMap();
118 map4->Add(new TObjString("fAliceStopTime"),new TObjString(timeEnd));
122 md.SetResponsible("Panos");
124 result = Store("GRP", "Values", values, &md);