]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/AliGRPPreprocessor.cxx
Adding CTP run configuration and scalers into the GRP preprocessing. They are abtaine...
[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 DAQ 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         Log(Form("File with Id CTP_runconfig found in source %s! Copied to %s",source->GetName(),runcfgfile.Data()));
368         AliTriggerConfiguration *runcfg = AliTriggerConfiguration::LoadConfiguration(runcfgfile);
369         if (!runcfg) {
370           Log("Bad CTP run configuration file! The corresponding CDB entry will not be filled!");
371         }
372         AliCDBMetaData metaData;
373         metaData.SetBeamPeriod(0);
374         metaData.SetResponsible("Roman Lietava");
375         metaData.SetComment("CTP run configuration");
376         if (!Store("CTP","Config", runcfg, &metaData, 0, 0)) {
377           Log("Unable to store the CTP run configuration object to OCDB!");
378         }
379       }
380     }
381     delete list;
382   }
383
384   {
385     // Get the CTP counters information
386     TList* list = GetFileSources(kDCS,"CTP_xcounters");  
387     if (!list) {
388       Log("No CTP counters file: connection problems with DAQ FXS logbook!");
389       return 1;
390     }
391   
392     if (list->GetEntries() == 0) {
393       Log("No CTP counters file to be processed!");
394     }
395     else {
396       TIter iter(list);
397       TObjString *source;
398       while ((source = dynamic_cast<TObjString *> (iter.Next()))) {
399         TString countersfile = GetFile(kDCS, "CTP_xcounters", source->GetName());
400         Log(Form("File with Id CTP_xcounters found in source %s! Copied to %s",source->GetName(),countersfile.Data()));
401         AliTriggerRunScalers *scalers = AliTriggerRunScalers::ReadScalers(countersfile);
402         if (!scalers) {
403           Log("Bad CTP counters file! The corresponding CDB entry will not be filled!");
404         }
405         AliCDBMetaData metaData;
406         metaData.SetBeamPeriod(0);
407         metaData.SetResponsible("Roman Lietava");
408         metaData.SetComment("CTP scalers");
409         if (!Store("CTP","Scalers", scalers, &metaData, 0, 0)) {
410           Log("Unable to store the CTP scalers object to OCDB!");
411         }
412       }
413     }
414     delete list;
415   }
416
417   return 0;
418 }
419
420 //_______________________________________________________________
421 TList *AliGRPPreprocessor::ProcessDcsDPs(TMap* valueMap, UInt_t iStartTime, UInt_t iStopTime) {
422   //Getting the DCS dps
423   //===========//
424   
425   TList *list = new TList();
426
427   //DCS data points
428   //===========//
429   AliInfo(Form("==========LHCState==========="));
430   TObjArray *aliasLHCState = (TObjArray *)valueMap->GetValue(fgkDCSDataPoints[0]);
431   if(!aliasLHCState) {
432     Log(Form("LHCState not found!!!"));
433     return list;
434   }
435   AliGRPDCS *dcs1 = new AliGRPDCS(aliasLHCState,iStartTime,iStopTime);
436   TString sLHCState = dcs1->ProcessDCS(3);  
437   if (sLHCState) {
438     Log(Form("<LHCState> for run %d: %s",fRun, sLHCState.Data()));
439   } else {
440     Log(Form("LHCState not put in TMap!"));
441   }
442   TMap *mapDCS1 = new TMap();
443   mapDCS1->Add(new TObjString("fLHCState"),new TObjString(sLHCState));
444   list->Add(mapDCS1);
445
446   AliInfo(Form("==========LHCPeriod==========="));
447   TObjArray *aliasLHCPeriod = (TObjArray *)valueMap->GetValue(fgkDCSDataPoints[1]);
448   if(!aliasLHCPeriod) {
449     Log(Form("LHCPeriod not found!!!"));
450     return list;
451   }
452   AliGRPDCS *dcs2 = new AliGRPDCS(aliasLHCPeriod,iStartTime,iStopTime);
453   TString sLHCPeriod = dcs2->ProcessDCS(3);  
454   if (sLHCPeriod) {
455     Log(Form("<LHCPeriod> for run %d: %s",fRun, sLHCPeriod.Data()));
456   } else {
457     Log(Form("LHCPeriod not put in TMap!"));
458   }
459   TMap *mapDCS2 = new TMap();
460   mapDCS2->Add(new TObjString("fLHCCondition"),new TObjString(sLHCPeriod));
461   list->Add(mapDCS2);
462
463   AliInfo(Form("==========LHCLuminosity==========="));
464   TObjArray *aliasLHCLuminosity = (TObjArray *)valueMap->GetValue(fgkDCSDataPoints[2]);
465   if(!aliasLHCLuminosity) {
466     Log(Form("LHCLuminosity not found!!!"));
467     return list;
468   }
469   AliGRPDCS *dcs3 = new AliGRPDCS(aliasLHCLuminosity,iStartTime,iStopTime);
470   TString sMeanLHCLuminosity = dcs3->ProcessDCS(2);  
471   if (sMeanLHCLuminosity) {
472     Log(Form("<LHCLuminosity> for run %d: %s",fRun, sMeanLHCLuminosity.Data()));
473   } else {
474     Log(Form("LHCLuminosity not put in TMap!"));
475   }
476   TMap *mapDCS3 = new TMap();
477   mapDCS3->Add(new TObjString("fLHCLuminosity"),new TObjString(sMeanLHCLuminosity));
478   list->Add(mapDCS3);
479
480   AliInfo(Form("==========BeamIntensity==========="));
481   TObjArray *aliasBeamIntensity = (TObjArray *)valueMap->GetValue(fgkDCSDataPoints[3]);
482   if(!aliasBeamIntensity) {
483     Log(Form("BeamIntensity not found!!!"));
484     return list;
485   }
486   AliGRPDCS *dcs4 = new AliGRPDCS(aliasBeamIntensity,iStartTime,iStopTime);
487   TString sMeanBeamIntensity = dcs4->ProcessDCS(2);  
488   if (sMeanBeamIntensity) {
489     Log(Form("<BeamIntensity> for run %d: %s",fRun, sMeanBeamIntensity.Data()));
490   } else {
491     Log(Form("BeamIntensity not put in TMap!"));
492   }
493   TMap *mapDCS4 = new TMap();
494   mapDCS4->Add(new TObjString("fBeamIntensity"),new TObjString(sMeanBeamIntensity));
495   list->Add(mapDCS4);
496
497   AliInfo(Form("==========L3Current==========="));
498   TObjArray *aliasL3Current = (TObjArray *)valueMap->GetValue(fgkDCSDataPoints[4]);
499   if(!aliasL3Current) {
500     Log(Form("L3Current not found!!!"));
501     return list;
502   }
503   AliGRPDCS *dcs5 = new AliGRPDCS(aliasL3Current,iStartTime,iStopTime);
504   TString sMeanL3Current = dcs5->ProcessDCS(2);  
505   if (sMeanL3Current) {
506     Log(Form("<L3Current> for run %d: %s",fRun, sMeanL3Current.Data()));
507   } else {
508     Log(Form("L3Current not put in TMap!"));
509   }
510   TMap *mapDCS5 = new TMap();
511   mapDCS5->Add(new TObjString("fL3Current"),new TObjString(sMeanL3Current));
512   list->Add(mapDCS5);
513
514   AliInfo(Form("==========L3Polarity==========="));
515   TObjArray *aliasL3Polarity = (TObjArray *)valueMap->GetValue(fgkDCSDataPoints[5]);
516   if(!aliasL3Polarity) {
517     Log(Form("L3Polarity not found!!!"));
518     return list;
519   }
520   AliGRPDCS *dcs6 = new AliGRPDCS(aliasL3Polarity,iStartTime,iStopTime);
521   TString sL3Polarity = dcs6->ProcessDCS(4);  
522   if (sL3Polarity) {
523     Log(Form("<L3Polarity> for run %d: %s",fRun, sL3Polarity.Data()));
524   } else {
525     Log(Form("L3Polarity not put in TMap!"));
526   }
527   TMap *mapDCS6 = new TMap();
528   mapDCS6->Add(new TObjString("fL3Polarity"),new TObjString(sL3Polarity));
529   list->Add(mapDCS6);
530
531   AliInfo(Form("==========DipoleCurrent==========="));
532   TObjArray *aliasDipoleCurrent = (TObjArray *)valueMap->GetValue(fgkDCSDataPoints[6]);
533   if(!aliasDipoleCurrent) {
534     Log(Form("DipoleCurrent not found!!!"));
535     return list;
536   }
537   AliGRPDCS *dcs7 = new AliGRPDCS(aliasDipoleCurrent,iStartTime,iStopTime);
538   TString sMeanDipoleCurrent = dcs7->ProcessDCS(2);  
539   if (sMeanDipoleCurrent) {
540     Log(Form("<DipoleCurrent> for run %d: %s",fRun, sMeanDipoleCurrent.Data()));
541   } else {
542     Log(Form("DipoleCurrent not put in TMap!"));
543   }
544   TMap *mapDCS7 = new TMap();
545   mapDCS7->Add(new TObjString("fDipoleCurrent"),new TObjString(sMeanDipoleCurrent));
546   list->Add(mapDCS7);
547
548   AliInfo(Form("==========DipolePolarity==========="));
549   TObjArray *aliasDipolePolarity = (TObjArray *)valueMap->GetValue(fgkDCSDataPoints[7]);
550   if(!aliasDipolePolarity) {
551     Log(Form("DipolePolarity not found!!!"));
552     return list;
553   }
554   AliGRPDCS *dcs8 = new AliGRPDCS(aliasDipolePolarity,iStartTime,iStopTime);
555   TString sDipolePolarity = dcs8->ProcessDCS(4);  
556   if (sDipolePolarity) {
557     Log(Form("<DipolePolarity> for run %d: %s",fRun, sDipolePolarity.Data()));
558   } else {
559     Log(Form("DipolePolarity not put in TMap!"));
560   }
561   TMap *mapDCS8 = new TMap();
562   mapDCS8->Add(new TObjString("fDipolePolarity"),new TObjString(sDipolePolarity));
563   list->Add(mapDCS8);
564
565   AliInfo(Form("==========CavernTemperature==========="));
566   TObjArray *aliasCavernTemperature = (TObjArray *)valueMap->GetValue(fgkDCSDataPoints[8]);
567   if(!aliasCavernTemperature) {
568     Log(Form("CavernTemperature not found!!!"));
569     return list;
570   }
571   AliGRPDCS *dcs9 = new AliGRPDCS(aliasCavernTemperature,iStartTime,iStopTime);
572   TString sMeanCavernTemperature = dcs9->ProcessDCS(2);  
573   if (sMeanCavernTemperature) {
574     Log(Form("<CavernTemperature> for run %d: %s",fRun, sMeanCavernTemperature.Data()));
575   } else {
576     Log(Form("CavernTemperature not put in TMap!"));
577   }
578   TMap *mapDCS9 = new TMap();
579   mapDCS9->Add(new TObjString("fCavernTemperature"),new TObjString(sMeanCavernTemperature));
580   list->Add(mapDCS9);
581
582   AliInfo(Form("==========CavernPressure==========="));
583   TObjArray *aliasCavernPressure = (TObjArray *)valueMap->GetValue(fgkDCSDataPoints[9]);
584   if(!aliasCavernPressure) {
585     Log(Form("CavernPressure not found!!!"));
586     return list;
587   }
588   AliGRPDCS *dcs10 = new AliGRPDCS(aliasCavernPressure,iStartTime,iStopTime);
589   TString sMeanCavernPressure = dcs10->ProcessDCS(2);  
590   if (sMeanCavernPressure) {
591     Log(Form("<CavernPressure> for run %d: %s",fRun, sMeanCavernPressure.Data()));
592   } else {
593     Log(Form("CavernPressure not put in TMap!"));
594   }
595   TMap *mapDCS10 = new TMap();
596   mapDCS10->Add(new TObjString("fCavernPressure"),new TObjString(sMeanCavernPressure));
597   list->Add(mapDCS10);
598
599   return list;
600 }
601
602 //_______________________________________________________________
603 AliDCSSensorArray *AliGRPPreprocessor::GetPressureMap(TMap* dcsAliasMap, AliDCSSensorArray *fPressure) {
604   // extract DCS pressure maps. Perform fits to save space
605   
606   TMap *map = fPressure->ExtractDCS(dcsAliasMap);
607   if (map) {
608     fPressure->MakeSplineFit(map);
609     Double_t fitFraction = fPressure->NumFits()/fPressure->NumSensors(); 
610     if (fitFraction > kFitFraction ) {
611       AliInfo(Form("Pressure values extracted, fits performed.\n"));
612     } else { 
613       AliInfo("Too few pressure maps fitted. \n");
614     }
615   } else {
616     AliInfo("AliGRPDCS: no atmospheric pressure map extracted. \n");
617   }
618   delete map;
619  
620   return fPressure;
621 }
622
623 //_______________________________________________________________
624 /*UInt_t AliGRPPreprocessor::MapPressure(TMap* dcsAliasMap) {
625   // extract DCS pressure maps. Perform fits to save space
626   
627   UInt_t result=0;
628   TMap *map = fPressure->ExtractDCS(dcsAliasMap);
629   if (map) {
630     fPressure->MakeSplineFit(map);
631     Double_t fitFraction = fPressure->NumFits()/fPressure->NumSensors(); 
632     if (fitFraction > kFitFraction ) {
633       AliInfo(Form("Pressure values extracted, fits performed.\n"));
634     } else { 
635       Log ("Too few pressure maps fitted. \n");
636       result = 9;
637     }
638   } else {
639     Log("AliTPCPreprocsessor: no atmospheric pressure map extracted. \n");
640     result=9;
641   }
642   delete map;
643   // Now store the final CDB file
644   
645   if ( result == 0 ) {
646     AliCDBMetaData metaData;
647     metaData.SetBeamPeriod(0);
648     metaData.SetResponsible("Panos Christakoglou");
649     metaData.SetComment("Preprocessor AliGRP data base pressure entries.");
650     
651     Bool_t storeOK = Store("Calib", "Pressure", fPressure, &metaData, 0, 0);
652     if ( !storeOK ) result=1; 
653   }
654   
655   return result; 
656   }*/