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 const char* beamEnergy = GetRunParameter("beamEnergy");
79 const char* beamType = GetRunParameter("beamType");
80 const char* numberOfDetectors = GetRunParameter("numberOfDetectors");
81 const char* detectorMask = GetRunParameter("detectorMask");
83 TObjArray *alias1 = (TObjArray *)valueMap->GetValue("SFTTemp1.FloatValue");
85 Log(Form("SFTTemp1.FloatValue not found!!!"));
88 AliGRPDCS *dcs = new AliGRPDCS(alias1);
89 TH1F *h1 = new TH1F("alias1","",100,15,25);
90 TString sAlias1Mean = dcs->ProcessDCS(h1);
95 Log(Form("<alias1> for run %d: %s",fRun, sAlias1Mean.Data()));
97 Log(Form("DCSAlias1 not put in TMap!"));
102 Log(Form("Start time for run %d: %s",fRun, timeStart));
104 Log(Form("Start time not put in logbook!"));
107 Log(Form("End time for run %d: %s",fRun, timeEnd));
109 Log(Form("End time not put in logbook!"));
112 Log(Form("Beam energy for run %d: %s",fRun, beamEnergy));
114 Log(Form("Beam energy not put in logbook!"));
117 Log(Form("Beam type for run %d: %s",fRun, beamType));
119 Log(Form("Beam type not put in logbook!"));
121 if (numberOfDetectors) {
122 Log(Form("Number of active detectors for run %d: %s",fRun, numberOfDetectors));
124 Log(Form("Number of active detectors not put in logbook!"));
127 Log(Form("Detector mask for run %d: %s",fRun, detectorMask));
129 Log(Form("Detector mask not put in logbook!"));
132 TList *values = new TList();
136 TMap *mapDAQ1 = new TMap();
137 mapDAQ1->Add(new TObjString("fAliceStartTime"),new TObjString(timeStart));
138 values->Add(mapDAQ1);
140 TMap *mapDAQ2 = new TMap();
141 mapDAQ2->Add(new TObjString("fAliceStopTime"),new TObjString(timeEnd));
142 values->Add(mapDAQ2);
144 TMap *mapDAQ3 = new TMap();
145 mapDAQ3->Add(new TObjString("fAliceBeamEnergy"),new TObjString(beamEnergy));
146 values->Add(mapDAQ3);
148 TMap *mapDAQ4 = new TMap();
149 mapDAQ4->Add(new TObjString("fAliceBeamType"),new TObjString(beamType));
150 values->Add(mapDAQ4);
152 TMap *mapDAQ5 = new TMap();
153 mapDAQ5->Add(new TObjString("fNumberOfDetectors"),new TObjString(numberOfDetectors));
154 values->Add(mapDAQ5);
156 TMap *mapDAQ6 = new TMap();
157 mapDAQ6->Add(new TObjString("fDetectorMask"),new TObjString(detectorMask));
158 values->Add(mapDAQ6);
161 TMap *mapDCS1 = new TMap();
162 mapDCS1->Add(new TObjString("histoDCS1"),h1);
163 values->Add(mapDCS1);
165 TMap *mapDCS2 = new TMap();
166 mapDCS2->Add(new TObjString("DCS1"),new TObjString(sAlias1Mean));
167 values->Add(mapDCS2);
170 md.SetResponsible("Panos");
172 result = Store("GRP", "Values", values, &md);