adding function to read configuration from buffer in memory
[u/mrichter/AliRoot.git] / STEER / AliGRPPreprocessor.cxx
CommitLineData
33c82fbf 1/**************************************************************************
3dedb44a 2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
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 **************************************************************************/
15
7ca4655f 16/* $Id$ */
17
3dedb44a 18//-------------------------------------------------------------------------
19// Class AliGRPPreprocessor
20// Global Run Parameters (GRP) preprocessor
21// Origin: Panos Christakoglou, UOA-CERN, Panos.Christakoglou@cern.ch
22//-------------------------------------------------------------------------
23
836d8b4f 24#include <TChain.h>
7ca4655f 25#include <TList.h>
26#include <TMap.h>
27#include <TObjString.h>
28#include <TTimeStamp.h>
29cc8704 29#include <TSystem.h>
30#include <TFile.h>
7ca4655f 31
3dedb44a 32#include "AliGRPPreprocessor.h"
33#include "AliGRPDCS.h"
17984b61 34#include "AliDCSSensorArray.h"
3dedb44a 35
48b1b444 36#include "AliTriggerConfiguration.h"
37#include "AliTriggerRunScalers.h"
38
3dedb44a 39#include "AliCDBMetaData.h"
40#include "AliLog.h"
41
3dedb44a 42class AliDCSValue;
43class AliShuttleInterface;
44
45#include <TH1.h>
46
17984b61 47const Double_t kFitFraction = 0.7; // Fraction of DCS sensor fits required
48
3dedb44a 49ClassImp(AliGRPPreprocessor)
50
17984b61 51//_______________________________________________________________
52 const char* AliGRPPreprocessor::fgkDCSDataPoints[12] = {"LHCState","LHCPeriod","LHCLuminosity","BeamIntensity","L3Current","L3Polarity","DipoleCurrent","DipolePolarity","CavernTemperature","CavernAtmosPressure","gva_cr5AtmosphericPressure","gva_meyrinAtmosphericPressure"};
53
3dedb44a 54//_______________________________________________________________
55AliGRPPreprocessor::AliGRPPreprocessor(AliShuttleInterface* shuttle):
17984b61 56 AliPreprocessor("GRP",shuttle), fPressure(0) {
3dedb44a 57 // constructor - shuttle must be instantiated!
ad103e84 58
59 AddRunType("PHYSICS");
3dedb44a 60}
61
62//_______________________________________________________________
63AliGRPPreprocessor::~AliGRPPreprocessor() {
64 //destructor
17984b61 65 delete fPressure;
3dedb44a 66}
67
68//_______________________________________________________________
69void AliGRPPreprocessor::Initialize(Int_t run, UInt_t startTime, UInt_t endTime) {
70 // Initialize preprocessor
5a5052e5 71
72 AliPreprocessor::Initialize(run, startTime, endTime);
73
17984b61 74 AliInfo("Initialization of the GRP preprocessor.");
75
76 TClonesArray * array = new TClonesArray("AliDCSSensor",2);
77 for(Int_t j = 0; j < 2; j++) {
78 AliDCSSensor * sens = new ((*array)[j])AliDCSSensor;
79 sens->SetStringID(fgkDCSDataPoints[j+10]);
80 }
81 AliInfo(Form("Pressure Entries: %d",array->GetEntries()));
82
83 fPressure = new AliDCSSensorArray(fStartTime, fEndTime, array);
3dedb44a 84}
85
86//_______________________________________________________________
87UInt_t AliGRPPreprocessor::Process(TMap* valueMap) {
88 // process data retrieved by the Shuttle
17984b61 89
90 //=================//
91 // DAQ logbook //
92 //=================//
29cc8704 93
17984b61 94 TList *daqlblist = ProcessDaqLB();
95 if(!daqlblist) {
96 Log(Form("Problem with the DAQ logbook parameters!!!"));
b49acef7 97 return 1;
17984b61 98 }
17984b61 99
100 //=================//
101 // DAQ FXS //
102 //=================//
bba57327 103 UInt_t iDaqFxs = ProcessDaqFxs();
8b5f35a9 104 if(iDaqFxs == 0) {
105 Log(Form("ProcessDaqFxs successful!"));
b49acef7 106 } else {
107 Log(Form("Could not store run raw tag file!"));
108 return 1;
109 }
110
48b1b444 111 //=================//
112 // DCS FXS //
113 //=================//
114 UInt_t iDcsFxs = ProcessDcsFxs();
115 if(iDcsFxs == 0) {
116 Log(Form("ProcessDcsFxs successful!"));
117 } else {
118 Log(Form("Could not store CTP run configuration and scalers!"));
119 return 1;
120 }
b49acef7 121
17984b61 122 //=================//
123 // DCS data points //
124 //=================//
5a5052e5 125 TList *dcsdplist = ProcessDcsDPs(valueMap);
17984b61 126 if(!dcsdplist) {
127 Log(Form("Problem with the DCS data points!!!"));
09d9e56b 128 return 1;
17984b61 129 }
130 if(dcsdplist->GetEntries() != 10) {
131 Log(Form("Problem with the DCS data points!!!"));
09d9e56b 132 // return 1; // TODO:COMMENTED FOR TESTING PURPOSES!
17984b61 133 }
134 //NEEDS TO BE REVISED - BREAKS!!!
135// AliDCSSensorArray *dcsSensorArray = GetPressureMap(valueMap,fPressure);
136// if(!dcsSensorArray) {
137// Log(Form("Problem with the pressure sensor values!!!"));
138// return 0;
139// }
140
5a5052e5 141 daqlblist->AddAll(dcsdplist);
142 daqlblist->SetOwner(1);
143 AliInfo(Form("Final list entries: %d",daqlblist->GetEntries()));
17984b61 144
145 AliCDBMetaData md;
146 md.SetResponsible("Panos Christakoglou");
147 md.SetComment("Output parameters from the GRP preprocessor.");
148
5a5052e5 149 Bool_t result = Store("GRP", "Data", daqlblist, &md);
17984b61 150
5a5052e5 151 delete daqlblist;
17984b61 152
153 if (result)
154 return 0;
155 else
156 return 1;
157}
158
17984b61 159//_______________________________________________________________
160TList *AliGRPPreprocessor::ProcessDaqLB() {
161 //Getting the DAQ lb informnation
3dedb44a 162 const char* timeStart = GetRunParameter("time_start");
163 const char* timeEnd = GetRunParameter("time_end");
125567f8 164 const char* beamEnergy = GetRunParameter("beamEnergy");
165 const char* beamType = GetRunParameter("beamType");
166 const char* numberOfDetectors = GetRunParameter("numberOfDetectors");
167 const char* detectorMask = GetRunParameter("detectorMask");
fed5d40b 168 const char* lhcPeriod = GetRunParameter("LHCperiod");
125567f8 169
17984b61 170 if (timeStart) {
171 Log(Form("Start time for run %d: %s",fRun, timeStart));
172 } else {
173 Log(Form("Start time not put in logbook!"));
174 }
175 TMap *mapDAQ1 = new TMap();
176 mapDAQ1->Add(new TObjString("fAliceStartTime"),new TObjString(timeStart));
177
178 if (timeEnd) {
179 Log(Form("End time for run %d: %s",fRun, timeEnd));
180 } else {
181 Log(Form("End time not put in logbook!"));
182 }
183 TMap *mapDAQ2 = new TMap();
184 mapDAQ2->Add(new TObjString("fAliceStopTime"),new TObjString(timeEnd));
185
186 if (beamEnergy) {
187 Log(Form("Beam energy for run %d: %s",fRun, beamEnergy));
188 } else {
189 Log(Form("Beam energy not put in logbook!"));
190 }
191 TMap *mapDAQ3 = new TMap();
192 mapDAQ3->Add(new TObjString("fAliceBeamEnergy"),new TObjString(beamEnergy));
193
194 if (beamType) {
195 Log(Form("Beam type for run %d: %s",fRun, beamType));
196 } else {
197 Log(Form("Beam type not put in logbook!"));
198 }
199 TMap *mapDAQ4 = new TMap();
200 mapDAQ4->Add(new TObjString("fAliceBeamType"),new TObjString(beamType));
201
202 if (numberOfDetectors) {
203 Log(Form("Number of active detectors for run %d: %s",fRun, numberOfDetectors));
204 } else {
205 Log(Form("Number of active detectors not put in logbook!"));
206 }
207 TMap *mapDAQ5 = new TMap();
208 mapDAQ5->Add(new TObjString("fNumberOfDetectors"),new TObjString(numberOfDetectors));
209
210 if (detectorMask) {
211 Log(Form("Detector mask for run %d: %s",fRun, detectorMask));
212 } else {
213 Log(Form("Detector mask not put in logbook!"));
214 }
215 TMap *mapDAQ6 = new TMap();
216 mapDAQ6->Add(new TObjString("fDetectorMask"),new TObjString(detectorMask));
217
218 if (lhcPeriod) {
219 Log(Form("LHC period (DAQ) for run %d: %s",fRun, lhcPeriod));
220 } else {
221 Log(Form("LHCperiod not put in logbook!"));
222 }
223 TMap *mapDAQ7 = new TMap();
224 mapDAQ7->Add(new TObjString("fLHCPeriod"),new TObjString(lhcPeriod));
225
226 TList *list = new TList();
227 list->Add(mapDAQ1); list->Add(mapDAQ2);
228 list->Add(mapDAQ3); list->Add(mapDAQ4);
229 list->Add(mapDAQ5); list->Add(mapDAQ6);
230 list->Add(mapDAQ7);
5a5052e5 231
232 TMap* mapDAQ8 = new TMap;
233 mapDAQ8->Add(new TObjString("fRunType"), new TObjString(GetRunType()));
234 list->Add(mapDAQ8);
17984b61 235
236 return list;
237}
238
239//_______________________________________________________________
bba57327 240UInt_t AliGRPPreprocessor::ProcessDaqFxs() {
836d8b4f 241 //======DAQ FXS======//
29cc8704 242
c865efca 243 TList* list = GetFileSources(kDAQ);
244 if (!list) {
ff97356e 245 Log("No raw data tag list: connection problems with DAQ FXS logbook!");
246 return 1;
247 }
248
249 if (list->GetEntries() == 0)
250 {
251 Log("no raw data tags in this run: nothing to merge!");
252 delete list; list=0;
253 return 0;
c865efca 254 }
ff97356e 255
256 TChain *fRawTagChain = new TChain("T");
257 Int_t nFiles=0;
4a33bdd9 258 TIterator* iter = list->MakeIterator();
259 TObject* obj = 0;
958ecabf 260 while ((obj = iter->Next())) {
261 TObjString* objStr = dynamic_cast<TObjString*> (obj);
262 if (objStr) {
263 Log(Form("Found source %s", objStr->String().Data()));
264 TList* list2 = GetFileIDs(kDAQ, objStr->String());
836d8b4f 265 if (!list2) {
ff97356e 266 Log("No list with ids from DAQ was found: connection problems with DAQ FXS logbook!");
267 delete fRawTagChain; fRawTagChain=0;
268 return 1;
836d8b4f 269 }
270 Log(Form("Number of ids: %d",list2->GetEntries()));
271 for(Int_t i = 0; i < list2->GetEntries(); i++) {
272 TObjString *idStr = (TObjString *)list2->At(i);
ff97356e 273 TString fileName = GetFile(kDAQ,idStr->String().Data(),objStr->String().Data());
274 if (fileName.Length() > 0)
275 {
276 Log(Form("Adding file in the chain: %s",fileName.Data()));
277 fRawTagChain->Add(fileName.Data());
278 nFiles++;
279 } else {
280 Log(Form("Could not retrieve file with id %s from source %s: "
281 "connection problems with DAQ FXS!",
282 idStr->String().Data(),objStr->String().Data()));
283 delete list; list=0;
284 delete list2; list2=0;
285 delete fRawTagChain; fRawTagChain=0;
286 return 2;
287 }
836d8b4f 288 }
958ecabf 289 delete list2;
290 }
291 }
ff97356e 292
29cc8704 293 TString fRawDataFileName = "GRP_Merged.tag.root";
ff97356e 294 Log(Form("Merging %d raw data tags into file: %s", nFiles, fRawDataFileName.Data()));
b49acef7 295 fRawTagChain->Merge(fRawDataFileName);
29cc8704 296
b49acef7 297 TString outputfile = Form("Run%d.Merged.RAW.tag.root", fRun);
bba57327 298 Bool_t result = StoreRunMetadataFile(fRawDataFileName.Data(),outputfile.Data());
ff97356e 299
300 if (!result)
301 {
302 Log("Problem storing raw data tags in local file!!");
8b5f35a9 303 } else {
304 Log("Raw data tags merged successfully!!");
ff97356e 305 }
306
307 delete iter;
308 delete list;
309 delete fRawTagChain; fRawTagChain=0;
8b5f35a9 310
311 if (result == kFALSE)
312 {
313 return 3;
314 }
315
073502c9 316 return 0;
8b5f35a9 317
17984b61 318}
319
48b1b444 320//_______________________________________________________________
321UInt_t AliGRPPreprocessor::ProcessDcsFxs() {
322 //======DCS FXS======//
323 // Get the CTP run configuration
324 // and scalers from DCS FXS
325
326 {
327 // Get the CTP run configuration
328 TList* list = GetFileSources(kDCS,"CTP_runconfig");
329 if (!list) {
cbdd8439 330 Log("No CTP runconfig file: connection problems with DCS FXS logbook!");
48b1b444 331 return 1;
332 }
333
334 if (list->GetEntries() == 0) {
335 Log("No CTP runconfig file to be processed!");
336 }
337 else {
338 TIter iter(list);
339 TObjString *source;
340 while ((source = dynamic_cast<TObjString *> (iter.Next()))) {
341 TString runcfgfile = GetFile(kDCS, "CTP_runconfig", source->GetName());
7229d3c2 342 if (runcfgfile.IsNull()) {
343 Log("No CTP runconfig files has been found: empty source!");
48b1b444 344 }
7229d3c2 345 else {
346 Log(Form("File with Id CTP_runconfig found in source %s! Copied to %s",source->GetName(),runcfgfile.Data()));
347 AliTriggerConfiguration *runcfg = AliTriggerConfiguration::LoadConfiguration(runcfgfile);
348 if (!runcfg) {
349 Log("Bad CTP run configuration file! The corresponding CDB entry will not be filled!");
350 }
351 else {
352 AliCDBMetaData metaData;
353 metaData.SetBeamPeriod(0);
354 metaData.SetResponsible("Roman Lietava");
355 metaData.SetComment("CTP run configuration");
356 if (!Store("CTP","Config", runcfg, &metaData, 0, 0)) {
357 Log("Unable to store the CTP run configuration object to OCDB!");
358 }
359 }
48b1b444 360 }
361 }
362 }
363 delete list;
364 }
365
366 {
367 // Get the CTP counters information
368 TList* list = GetFileSources(kDCS,"CTP_xcounters");
369 if (!list) {
370 Log("No CTP counters file: connection problems with DAQ FXS logbook!");
371 return 1;
372 }
373
374 if (list->GetEntries() == 0) {
375 Log("No CTP counters file to be processed!");
376 }
377 else {
378 TIter iter(list);
379 TObjString *source;
380 while ((source = dynamic_cast<TObjString *> (iter.Next()))) {
381 TString countersfile = GetFile(kDCS, "CTP_xcounters", source->GetName());
7229d3c2 382 if (countersfile.IsNull()) {
383 Log("No CTP counters files has been found: empty source!");
48b1b444 384 }
7229d3c2 385 else {
386 Log(Form("File with Id CTP_xcounters found in source %s! Copied to %s",source->GetName(),countersfile.Data()));
387 AliTriggerRunScalers *scalers = AliTriggerRunScalers::ReadScalers(countersfile);
388 if (!scalers) {
389 Log("Bad CTP counters file! The corresponding CDB entry will not be filled!");
390 }
391 else {
392 AliCDBMetaData metaData;
393 metaData.SetBeamPeriod(0);
394 metaData.SetResponsible("Roman Lietava");
395 metaData.SetComment("CTP scalers");
396 if (!Store("CTP","Scalers", scalers, &metaData, 0, 0)) {
397 Log("Unable to store the CTP scalers object to OCDB!");
398 }
399 }
48b1b444 400 }
401 }
402 }
403 delete list;
404 }
405
406 return 0;
407}
408
17984b61 409//_______________________________________________________________
5a5052e5 410TList *AliGRPPreprocessor::ProcessDcsDPs(TMap* valueMap) {
17984b61 411 //Getting the DCS dps
e97cc90e 412 //===========//
17984b61 413
414 TList *list = new TList();
415
e97cc90e 416 //DCS data points
417 //===========//
17984b61 418 AliInfo(Form("==========LHCState==========="));
419 TObjArray *aliasLHCState = (TObjArray *)valueMap->GetValue(fgkDCSDataPoints[0]);
e97cc90e 420 if(!aliasLHCState) {
421 Log(Form("LHCState not found!!!"));
17984b61 422 return list;
8ecdaed6 423 }
5a5052e5 424 AliGRPDCS *dcs1 = new AliGRPDCS(aliasLHCState,fStartTime,fEndTime);
e97cc90e 425 TString sLHCState = dcs1->ProcessDCS(3);
426 if (sLHCState) {
427 Log(Form("<LHCState> for run %d: %s",fRun, sLHCState.Data()));
428 } else {
429 Log(Form("LHCState not put in TMap!"));
430 }
17984b61 431 TMap *mapDCS1 = new TMap();
432 mapDCS1->Add(new TObjString("fLHCState"),new TObjString(sLHCState));
433 list->Add(mapDCS1);
e97cc90e 434
17984b61 435 AliInfo(Form("==========LHCPeriod==========="));
436 TObjArray *aliasLHCPeriod = (TObjArray *)valueMap->GetValue(fgkDCSDataPoints[1]);
e97cc90e 437 if(!aliasLHCPeriod) {
438 Log(Form("LHCPeriod not found!!!"));
17984b61 439 return list;
e97cc90e 440 }
5a5052e5 441 AliGRPDCS *dcs2 = new AliGRPDCS(aliasLHCPeriod,fStartTime,fEndTime);
e97cc90e 442 TString sLHCPeriod = dcs2->ProcessDCS(3);
443 if (sLHCPeriod) {
444 Log(Form("<LHCPeriod> for run %d: %s",fRun, sLHCPeriod.Data()));
3dedb44a 445 } else {
e97cc90e 446 Log(Form("LHCPeriod not put in TMap!"));
3dedb44a 447 }
17984b61 448 TMap *mapDCS2 = new TMap();
449 mapDCS2->Add(new TObjString("fLHCCondition"),new TObjString(sLHCPeriod));
450 list->Add(mapDCS2);
125567f8 451
17984b61 452 AliInfo(Form("==========LHCLuminosity==========="));
453 TObjArray *aliasLHCLuminosity = (TObjArray *)valueMap->GetValue(fgkDCSDataPoints[2]);
e97cc90e 454 if(!aliasLHCLuminosity) {
455 Log(Form("LHCLuminosity not found!!!"));
17984b61 456 return list;
e97cc90e 457 }
5a5052e5 458 AliGRPDCS *dcs3 = new AliGRPDCS(aliasLHCLuminosity,fStartTime,fEndTime);
e97cc90e 459 TString sMeanLHCLuminosity = dcs3->ProcessDCS(2);
460 if (sMeanLHCLuminosity) {
461 Log(Form("<LHCLuminosity> for run %d: %s",fRun, sMeanLHCLuminosity.Data()));
462 } else {
463 Log(Form("LHCLuminosity not put in TMap!"));
464 }
17984b61 465 TMap *mapDCS3 = new TMap();
466 mapDCS3->Add(new TObjString("fLHCLuminosity"),new TObjString(sMeanLHCLuminosity));
467 list->Add(mapDCS3);
e97cc90e 468
17984b61 469 AliInfo(Form("==========BeamIntensity==========="));
470 TObjArray *aliasBeamIntensity = (TObjArray *)valueMap->GetValue(fgkDCSDataPoints[3]);
e97cc90e 471 if(!aliasBeamIntensity) {
472 Log(Form("BeamIntensity not found!!!"));
17984b61 473 return list;
e97cc90e 474 }
5a5052e5 475 AliGRPDCS *dcs4 = new AliGRPDCS(aliasBeamIntensity,fStartTime,fEndTime);
e97cc90e 476 TString sMeanBeamIntensity = dcs4->ProcessDCS(2);
477 if (sMeanBeamIntensity) {
478 Log(Form("<BeamIntensity> for run %d: %s",fRun, sMeanBeamIntensity.Data()));
479 } else {
480 Log(Form("BeamIntensity not put in TMap!"));
481 }
17984b61 482 TMap *mapDCS4 = new TMap();
483 mapDCS4->Add(new TObjString("fBeamIntensity"),new TObjString(sMeanBeamIntensity));
484 list->Add(mapDCS4);
e97cc90e 485
17984b61 486 AliInfo(Form("==========L3Current==========="));
487 TObjArray *aliasL3Current = (TObjArray *)valueMap->GetValue(fgkDCSDataPoints[4]);
e97cc90e 488 if(!aliasL3Current) {
489 Log(Form("L3Current not found!!!"));
17984b61 490 return list;
e97cc90e 491 }
5a5052e5 492 AliGRPDCS *dcs5 = new AliGRPDCS(aliasL3Current,fStartTime,fEndTime);
e97cc90e 493 TString sMeanL3Current = dcs5->ProcessDCS(2);
494 if (sMeanL3Current) {
495 Log(Form("<L3Current> for run %d: %s",fRun, sMeanL3Current.Data()));
496 } else {
497 Log(Form("L3Current not put in TMap!"));
498 }
17984b61 499 TMap *mapDCS5 = new TMap();
500 mapDCS5->Add(new TObjString("fL3Current"),new TObjString(sMeanL3Current));
501 list->Add(mapDCS5);
e97cc90e 502
17984b61 503 AliInfo(Form("==========L3Polarity==========="));
504 TObjArray *aliasL3Polarity = (TObjArray *)valueMap->GetValue(fgkDCSDataPoints[5]);
e97cc90e 505 if(!aliasL3Polarity) {
506 Log(Form("L3Polarity not found!!!"));
17984b61 507 return list;
e97cc90e 508 }
5a5052e5 509 AliGRPDCS *dcs6 = new AliGRPDCS(aliasL3Polarity,fStartTime,fEndTime);
e97cc90e 510 TString sL3Polarity = dcs6->ProcessDCS(4);
511 if (sL3Polarity) {
512 Log(Form("<L3Polarity> for run %d: %s",fRun, sL3Polarity.Data()));
513 } else {
514 Log(Form("L3Polarity not put in TMap!"));
515 }
17984b61 516 TMap *mapDCS6 = new TMap();
517 mapDCS6->Add(new TObjString("fL3Polarity"),new TObjString(sL3Polarity));
518 list->Add(mapDCS6);
e97cc90e 519
17984b61 520 AliInfo(Form("==========DipoleCurrent==========="));
521 TObjArray *aliasDipoleCurrent = (TObjArray *)valueMap->GetValue(fgkDCSDataPoints[6]);
e97cc90e 522 if(!aliasDipoleCurrent) {
523 Log(Form("DipoleCurrent not found!!!"));
17984b61 524 return list;
e97cc90e 525 }
5a5052e5 526 AliGRPDCS *dcs7 = new AliGRPDCS(aliasDipoleCurrent,fStartTime,fEndTime);
e97cc90e 527 TString sMeanDipoleCurrent = dcs7->ProcessDCS(2);
528 if (sMeanDipoleCurrent) {
529 Log(Form("<DipoleCurrent> for run %d: %s",fRun, sMeanDipoleCurrent.Data()));
530 } else {
531 Log(Form("DipoleCurrent not put in TMap!"));
532 }
17984b61 533 TMap *mapDCS7 = new TMap();
534 mapDCS7->Add(new TObjString("fDipoleCurrent"),new TObjString(sMeanDipoleCurrent));
535 list->Add(mapDCS7);
e97cc90e 536
17984b61 537 AliInfo(Form("==========DipolePolarity==========="));
538 TObjArray *aliasDipolePolarity = (TObjArray *)valueMap->GetValue(fgkDCSDataPoints[7]);
e97cc90e 539 if(!aliasDipolePolarity) {
540 Log(Form("DipolePolarity not found!!!"));
17984b61 541 return list;
e97cc90e 542 }
5a5052e5 543 AliGRPDCS *dcs8 = new AliGRPDCS(aliasDipolePolarity,fStartTime,fEndTime);
e97cc90e 544 TString sDipolePolarity = dcs8->ProcessDCS(4);
545 if (sDipolePolarity) {
546 Log(Form("<DipolePolarity> for run %d: %s",fRun, sDipolePolarity.Data()));
547 } else {
548 Log(Form("DipolePolarity not put in TMap!"));
549 }
17984b61 550 TMap *mapDCS8 = new TMap();
551 mapDCS8->Add(new TObjString("fDipolePolarity"),new TObjString(sDipolePolarity));
552 list->Add(mapDCS8);
e97cc90e 553
17984b61 554 AliInfo(Form("==========CavernTemperature==========="));
555 TObjArray *aliasCavernTemperature = (TObjArray *)valueMap->GetValue(fgkDCSDataPoints[8]);
e97cc90e 556 if(!aliasCavernTemperature) {
557 Log(Form("CavernTemperature not found!!!"));
17984b61 558 return list;
e97cc90e 559 }
5a5052e5 560 AliGRPDCS *dcs9 = new AliGRPDCS(aliasCavernTemperature,fStartTime,fEndTime);
e97cc90e 561 TString sMeanCavernTemperature = dcs9->ProcessDCS(2);
562 if (sMeanCavernTemperature) {
563 Log(Form("<CavernTemperature> for run %d: %s",fRun, sMeanCavernTemperature.Data()));
564 } else {
565 Log(Form("CavernTemperature not put in TMap!"));
566 }
17984b61 567 TMap *mapDCS9 = new TMap();
568 mapDCS9->Add(new TObjString("fCavernTemperature"),new TObjString(sMeanCavernTemperature));
569 list->Add(mapDCS9);
e97cc90e 570
17984b61 571 AliInfo(Form("==========CavernPressure==========="));
572 TObjArray *aliasCavernPressure = (TObjArray *)valueMap->GetValue(fgkDCSDataPoints[9]);
e97cc90e 573 if(!aliasCavernPressure) {
574 Log(Form("CavernPressure not found!!!"));
17984b61 575 return list;
e97cc90e 576 }
5a5052e5 577 AliGRPDCS *dcs10 = new AliGRPDCS(aliasCavernPressure,fStartTime,fEndTime);
e97cc90e 578 TString sMeanCavernPressure = dcs10->ProcessDCS(2);
579 if (sMeanCavernPressure) {
580 Log(Form("<CavernPressure> for run %d: %s",fRun, sMeanCavernPressure.Data()));
581 } else {
582 Log(Form("CavernPressure not put in TMap!"));
583 }
17984b61 584 TMap *mapDCS10 = new TMap();
585 mapDCS10->Add(new TObjString("fCavernPressure"),new TObjString(sMeanCavernPressure));
586 list->Add(mapDCS10);
e97cc90e 587
17984b61 588 return list;
589}
125567f8 590
17984b61 591//_______________________________________________________________
592AliDCSSensorArray *AliGRPPreprocessor::GetPressureMap(TMap* dcsAliasMap, AliDCSSensorArray *fPressure) {
593 // extract DCS pressure maps. Perform fits to save space
3dedb44a 594
17984b61 595 TMap *map = fPressure->ExtractDCS(dcsAliasMap);
596 if (map) {
597 fPressure->MakeSplineFit(map);
598 Double_t fitFraction = fPressure->NumFits()/fPressure->NumSensors();
599 if (fitFraction > kFitFraction ) {
600 AliInfo(Form("Pressure values extracted, fits performed.\n"));
601 } else {
602 AliInfo("Too few pressure maps fitted. \n");
603 }
604 } else {
605 AliInfo("AliGRPDCS: no atmospheric pressure map extracted. \n");
606 }
607 delete map;
608
609 return fPressure;
610}
e97cc90e 611
17984b61 612//_______________________________________________________________
613/*UInt_t AliGRPPreprocessor::MapPressure(TMap* dcsAliasMap) {
614 // extract DCS pressure maps. Perform fits to save space
3dedb44a 615
17984b61 616 UInt_t result=0;
617 TMap *map = fPressure->ExtractDCS(dcsAliasMap);
618 if (map) {
619 fPressure->MakeSplineFit(map);
620 Double_t fitFraction = fPressure->NumFits()/fPressure->NumSensors();
621 if (fitFraction > kFitFraction ) {
622 AliInfo(Form("Pressure values extracted, fits performed.\n"));
623 } else {
624 Log ("Too few pressure maps fitted. \n");
625 result = 9;
626 }
627 } else {
628 Log("AliTPCPreprocsessor: no atmospheric pressure map extracted. \n");
629 result=9;
630 }
631 delete map;
632 // Now store the final CDB file
3dedb44a 633
17984b61 634 if ( result == 0 ) {
635 AliCDBMetaData metaData;
636 metaData.SetBeamPeriod(0);
637 metaData.SetResponsible("Panos Christakoglou");
638 metaData.SetComment("Preprocessor AliGRP data base pressure entries.");
639
640 Bool_t storeOK = Store("Calib", "Pressure", fPressure, &metaData, 0, 0);
641 if ( !storeOK ) result=1;
642 }
3dedb44a 643
17984b61 644 return result;
645 }*/