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