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