]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/AliGRPPreprocessor.cxx
ALICE interface to Pythia8
[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(AliShuttleInterface* shuttle):
56   AliPreprocessor("GRP",shuttle), fPressure(0) {
57   // constructor - shuttle must be instantiated!
58
59   AddRunType("PHYSICS");
60 }
61
62 //_______________________________________________________________
63 AliGRPPreprocessor::~AliGRPPreprocessor() {
64   //destructor
65   delete fPressure;
66 }
67
68 //_______________________________________________________________
69 void AliGRPPreprocessor::Initialize(Int_t run, UInt_t startTime, UInt_t endTime) {
70   // Initialize preprocessor
71
72   AliPreprocessor::Initialize(run, startTime, endTime);
73     
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);
84 }
85
86 //_______________________________________________________________
87 UInt_t AliGRPPreprocessor::Process(TMap* valueMap) {
88   // process data retrieved by the Shuttle
89   
90   //=================//
91   // DAQ logbook     //
92   //=================//
93   
94   TList *daqlblist = ProcessDaqLB();
95   if(!daqlblist) {
96     Log(Form("Problem with the DAQ logbook parameters!!!"));
97     return 1;
98   }
99
100   //=================//
101   // DAQ FXS         //
102   //=================//
103   UInt_t iDaqFxs = ProcessDaqFxs();
104   if(iDaqFxs == 0) {
105         Log(Form("ProcessDaqFxs successful!"));
106   } else {
107         Log(Form("Could not store run raw tag file!"));
108         return 1;
109   }
110   
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   }
121   
122   //=================//
123   // DCS data points //
124   //=================//
125   TList *dcsdplist = ProcessDcsDPs(valueMap);
126   if(!dcsdplist) {
127     Log(Form("Problem with the DCS data points!!!"));
128     return 1; 
129   }    
130   if(dcsdplist->GetEntries() != 10) {
131     Log(Form("Problem with the DCS data points!!!"));
132     // return 1; // TODO:COMMENTED FOR TESTING PURPOSES!
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
141   daqlblist->AddAll(dcsdplist);
142   daqlblist->SetOwner(1);
143   AliInfo(Form("Final list entries: %d",daqlblist->GetEntries()));
144   
145   AliCDBMetaData md;
146   md.SetResponsible("Panos Christakoglou");
147   md.SetComment("Output parameters from the GRP preprocessor.");
148   
149   Bool_t result = Store("GRP", "Data", daqlblist, &md);
150   
151   delete daqlblist;
152   
153   if (result)
154     return 0;
155   else
156     return 1;
157 }
158
159 //_______________________________________________________________
160 TList *AliGRPPreprocessor::ProcessDaqLB() {
161   //Getting the DAQ lb informnation
162   const char* timeStart = GetRunParameter("time_start");
163   const char* timeEnd = GetRunParameter("time_end");
164   const char* beamEnergy = GetRunParameter("beamEnergy");
165   const char* beamType = GetRunParameter("beamType");
166   const char* numberOfDetectors = GetRunParameter("numberOfDetectors");
167   const char* detectorMask = GetRunParameter("detectorMask");
168   const char* lhcPeriod = GetRunParameter("LHCperiod");
169
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);
231   
232   TMap* mapDAQ8 = new TMap;
233   mapDAQ8->Add(new TObjString("fRunType"), new TObjString(GetRunType()));
234   list->Add(mapDAQ8);
235
236   return list;
237 }
238
239 //_______________________________________________________________
240 UInt_t AliGRPPreprocessor::ProcessDaqFxs() {
241   //======DAQ FXS======//
242
243   TList* list = GetFileSources(kDAQ);  
244   if (!list) {
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;
254   }
255
256   TChain *fRawTagChain = new TChain("T");
257   Int_t nFiles=0;
258   TIterator* iter = list->MakeIterator();
259   TObject* obj = 0;
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());
265       if (!list2) {
266         Log("No list with ids from DAQ was found: connection problems with DAQ FXS logbook!");
267         delete fRawTagChain; fRawTagChain=0;
268         return 1;
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);
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         }
288       }
289       delete list2;
290     }
291   }
292   
293   TString fRawDataFileName = "GRP_Merged.tag.root";
294   Log(Form("Merging %d raw data tags into file: %s", nFiles, fRawDataFileName.Data()));
295   fRawTagChain->Merge(fRawDataFileName);
296   
297   TString outputfile = Form("Run%d.Merged.RAW.tag.root", fRun);
298   Bool_t result = StoreRunMetadataFile(fRawDataFileName.Data(),outputfile.Data());
299   
300   if (!result)
301   {
302         Log("Problem storing raw data tags in local file!!");
303   } else {
304         Log("Raw data tags merged successfully!!");  
305   }
306   
307   delete iter;
308   delete list;
309   delete fRawTagChain; fRawTagChain=0;
310   
311   if (result == kFALSE)
312   {
313         return 3;
314   }
315   
316   return 0;
317   
318 }
319
320 //_______________________________________________________________
321 UInt_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) {
330       Log("No CTP runconfig file: connection problems with DCS FXS logbook!");
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());
342         if (runcfgfile.IsNull()) {
343           Log("No CTP runconfig files has been found: empty source!");
344         }
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           }
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());
382         if (countersfile.IsNull()) {
383           Log("No CTP counters files has been found: empty source!");
384         }
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           }
400         }
401       }
402     }
403     delete list;
404   }
405
406   return 0;
407 }
408
409 //_______________________________________________________________
410 TList *AliGRPPreprocessor::ProcessDcsDPs(TMap* valueMap) {
411   //Getting the DCS dps
412   //===========//
413   
414   TList *list = new TList();
415
416   //DCS data points
417   //===========//
418   AliInfo(Form("==========LHCState==========="));
419   TObjArray *aliasLHCState = (TObjArray *)valueMap->GetValue(fgkDCSDataPoints[0]);
420   if(!aliasLHCState) {
421     Log(Form("LHCState not found!!!"));
422     return list;
423   }
424   AliGRPDCS *dcs1 = new AliGRPDCS(aliasLHCState,fStartTime,fEndTime);
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   }
431   TMap *mapDCS1 = new TMap();
432   mapDCS1->Add(new TObjString("fLHCState"),new TObjString(sLHCState));
433   list->Add(mapDCS1);
434
435   AliInfo(Form("==========LHCPeriod==========="));
436   TObjArray *aliasLHCPeriod = (TObjArray *)valueMap->GetValue(fgkDCSDataPoints[1]);
437   if(!aliasLHCPeriod) {
438     Log(Form("LHCPeriod not found!!!"));
439     return list;
440   }
441   AliGRPDCS *dcs2 = new AliGRPDCS(aliasLHCPeriod,fStartTime,fEndTime);
442   TString sLHCPeriod = dcs2->ProcessDCS(3);  
443   if (sLHCPeriod) {
444     Log(Form("<LHCPeriod> for run %d: %s",fRun, sLHCPeriod.Data()));
445   } else {
446     Log(Form("LHCPeriod not put in TMap!"));
447   }
448   TMap *mapDCS2 = new TMap();
449   mapDCS2->Add(new TObjString("fLHCCondition"),new TObjString(sLHCPeriod));
450   list->Add(mapDCS2);
451
452   AliInfo(Form("==========LHCLuminosity==========="));
453   TObjArray *aliasLHCLuminosity = (TObjArray *)valueMap->GetValue(fgkDCSDataPoints[2]);
454   if(!aliasLHCLuminosity) {
455     Log(Form("LHCLuminosity not found!!!"));
456     return list;
457   }
458   AliGRPDCS *dcs3 = new AliGRPDCS(aliasLHCLuminosity,fStartTime,fEndTime);
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   }
465   TMap *mapDCS3 = new TMap();
466   mapDCS3->Add(new TObjString("fLHCLuminosity"),new TObjString(sMeanLHCLuminosity));
467   list->Add(mapDCS3);
468
469   AliInfo(Form("==========BeamIntensity==========="));
470   TObjArray *aliasBeamIntensity = (TObjArray *)valueMap->GetValue(fgkDCSDataPoints[3]);
471   if(!aliasBeamIntensity) {
472     Log(Form("BeamIntensity not found!!!"));
473     return list;
474   }
475   AliGRPDCS *dcs4 = new AliGRPDCS(aliasBeamIntensity,fStartTime,fEndTime);
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   }
482   TMap *mapDCS4 = new TMap();
483   mapDCS4->Add(new TObjString("fBeamIntensity"),new TObjString(sMeanBeamIntensity));
484   list->Add(mapDCS4);
485
486   AliInfo(Form("==========L3Current==========="));
487   TObjArray *aliasL3Current = (TObjArray *)valueMap->GetValue(fgkDCSDataPoints[4]);
488   if(!aliasL3Current) {
489     Log(Form("L3Current not found!!!"));
490     return list;
491   }
492   AliGRPDCS *dcs5 = new AliGRPDCS(aliasL3Current,fStartTime,fEndTime);
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   }
499   TMap *mapDCS5 = new TMap();
500   mapDCS5->Add(new TObjString("fL3Current"),new TObjString(sMeanL3Current));
501   list->Add(mapDCS5);
502
503   AliInfo(Form("==========L3Polarity==========="));
504   TObjArray *aliasL3Polarity = (TObjArray *)valueMap->GetValue(fgkDCSDataPoints[5]);
505   if(!aliasL3Polarity) {
506     Log(Form("L3Polarity not found!!!"));
507     return list;
508   }
509   AliGRPDCS *dcs6 = new AliGRPDCS(aliasL3Polarity,fStartTime,fEndTime);
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   }
516   TMap *mapDCS6 = new TMap();
517   mapDCS6->Add(new TObjString("fL3Polarity"),new TObjString(sL3Polarity));
518   list->Add(mapDCS6);
519
520   AliInfo(Form("==========DipoleCurrent==========="));
521   TObjArray *aliasDipoleCurrent = (TObjArray *)valueMap->GetValue(fgkDCSDataPoints[6]);
522   if(!aliasDipoleCurrent) {
523     Log(Form("DipoleCurrent not found!!!"));
524     return list;
525   }
526   AliGRPDCS *dcs7 = new AliGRPDCS(aliasDipoleCurrent,fStartTime,fEndTime);
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   }
533   TMap *mapDCS7 = new TMap();
534   mapDCS7->Add(new TObjString("fDipoleCurrent"),new TObjString(sMeanDipoleCurrent));
535   list->Add(mapDCS7);
536
537   AliInfo(Form("==========DipolePolarity==========="));
538   TObjArray *aliasDipolePolarity = (TObjArray *)valueMap->GetValue(fgkDCSDataPoints[7]);
539   if(!aliasDipolePolarity) {
540     Log(Form("DipolePolarity not found!!!"));
541     return list;
542   }
543   AliGRPDCS *dcs8 = new AliGRPDCS(aliasDipolePolarity,fStartTime,fEndTime);
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   }
550   TMap *mapDCS8 = new TMap();
551   mapDCS8->Add(new TObjString("fDipolePolarity"),new TObjString(sDipolePolarity));
552   list->Add(mapDCS8);
553
554   AliInfo(Form("==========CavernTemperature==========="));
555   TObjArray *aliasCavernTemperature = (TObjArray *)valueMap->GetValue(fgkDCSDataPoints[8]);
556   if(!aliasCavernTemperature) {
557     Log(Form("CavernTemperature not found!!!"));
558     return list;
559   }
560   AliGRPDCS *dcs9 = new AliGRPDCS(aliasCavernTemperature,fStartTime,fEndTime);
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   }
567   TMap *mapDCS9 = new TMap();
568   mapDCS9->Add(new TObjString("fCavernTemperature"),new TObjString(sMeanCavernTemperature));
569   list->Add(mapDCS9);
570
571   AliInfo(Form("==========CavernPressure==========="));
572   TObjArray *aliasCavernPressure = (TObjArray *)valueMap->GetValue(fgkDCSDataPoints[9]);
573   if(!aliasCavernPressure) {
574     Log(Form("CavernPressure not found!!!"));
575     return list;
576   }
577   AliGRPDCS *dcs10 = new AliGRPDCS(aliasCavernPressure,fStartTime,fEndTime);
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   }
584   TMap *mapDCS10 = new TMap();
585   mapDCS10->Add(new TObjString("fCavernPressure"),new TObjString(sMeanCavernPressure));
586   list->Add(mapDCS10);
587
588   return list;
589 }
590
591 //_______________________________________________________________
592 AliDCSSensorArray *AliGRPPreprocessor::GetPressureMap(TMap* dcsAliasMap, AliDCSSensorArray *fPressure) {
593   // extract DCS pressure maps. Perform fits to save space
594   
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 }
611
612 //_______________________________________________________________
613 /*UInt_t AliGRPPreprocessor::MapPressure(TMap* dcsAliasMap) {
614   // extract DCS pressure maps. Perform fits to save space
615   
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
633   
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   }
643   
644   return result; 
645   }*/