9d9ca05006722ca2a82630aad2a24cc837d150e1
[u/mrichter/AliRoot.git] / T0 / AliT0DataDCS.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 /*
17 $Log: AliT0DataDCS.cxx,v $
18  Revision   2008/01/30 
19 Fetching data points from DCS, calculating mean and storing data to Reference DB 
20  
21  Version 1.1  2006/10
22 Preliminary test version (T.Malkiewicz)
23 */
24
25 #include "AliT0DataDCS.h"
26
27 #include "AliCDBMetaData.h"
28 #include "AliDCSValue.h"
29 #include "AliLog.h"
30
31 #include <TTimeStamp.h>
32 #include <TObjString.h>
33 #include <TH2F.h>
34 #include <TProfile.h>
35 #include <TGraph.h>
36 #include <TDatime.h>
37 #include <TStyle.h>
38 #include <TCanvas.h>
39 #include <iostream>
40
41 // AliT0DataDCS class
42 // declaring DCS aliases for T0
43 // fetching T0 data points from DCS, 
44 // calculating mean values for the entire run
45 // and storing the result to Reference DB
46
47 ClassImp(AliT0DataDCS)
48
49 //---------------------------------------------------------------
50 AliT0DataDCS::AliT0DataDCS():
51         TObject(),
52         fRun(0),        
53         fStartTime(0),
54         fEndTime(0),
55         fStartTimeDCSQuery(0),
56         fEndTimeDCSQuery(0),
57         fAtten(0.),
58         fMPDcentA(0),
59         fMPDcentC(0),
60         fMPDsemiCentA(0),
61         fMPDsemiCentC(0),
62         fTVDCtop(0),
63         fTVDCbottom(0),
64         fMPDmode(0),
65         fIsProcessed(kFALSE)
66 {
67   for(Int_t i=0;i<kScalers;i++) 
68   {
69     fScalerMean[i]=0.;
70     fScalerSecMean[i]=0.;
71   }
72   for(Int_t i=0;i<kHV;i++)
73   {
74     fHViA[i]=0.;
75     fHVvA[i]=0.;
76     fHViC[i]=0.;
77     fHVvC[i]=0.;
78   }
79   for(Int_t i=0;i<kLV;i++)
80   {
81     fLViA[i]=0.;
82     fLVvA[i]=0.;
83     fLViC[i]=0.;
84     fLVvC[i]=0.;
85   }
86   for(Int_t i=0;i<kTRM;i++)
87   {
88     fTRM[i]=0.;
89   }
90   for(Int_t i=0;i<kDRM;i++)
91   {
92     fDRM[i]=0.;
93   }
94
95 }
96 //---------------------------------------------------------------
97 AliT0DataDCS::AliT0DataDCS(Int_t nRun, UInt_t startTime, UInt_t endTime, UInt_t startTimeDCSQuery, UInt_t endTimeDCSQuery):
98         TObject(),
99         fRun(nRun),
100         fStartTime(startTime),
101         fEndTime(endTime),
102         fStartTimeDCSQuery(startTimeDCSQuery),
103         fEndTimeDCSQuery(endTimeDCSQuery),
104         fAtten(0.),
105         fMPDcentA(0),
106         fMPDcentC(0),
107         fMPDsemiCentA(0),
108         fMPDsemiCentC(0),
109         fTVDCtop(0),
110         fTVDCbottom(0),
111         fMPDmode(0),
112         fIsProcessed(kFALSE)
113 {
114   for(Int_t i=0;i<kScalers;i++)
115   {
116     fScalerMean[i]=0.;
117     fScalerSecMean[i]=0.;
118   }
119   for(Int_t i=0;i<kHV;i++)
120   {
121     fHViA[i]=0.;
122     fHVvA[i]=0.;
123     fHViC[i]=0.;
124     fHVvC[i]=0.;
125   }
126   for(Int_t i=0;i<kLV;i++)
127   {
128     fLViA[i]=0.;
129     fLVvA[i]=0.;
130     fLViC[i]=0.;
131     fLVvC[i]=0.;
132   }
133   for(Int_t i=0;i<kTRM;i++)
134   {
135     fTRM[i]=0.;
136   }
137   for(Int_t i=0;i<kDRM;i++)
138   {
139     fDRM[i]=0.;
140   }
141
142         AliInfo(Form("\n\tRun %d \n\tStartTime %s \n\tEndTime %s \n\tStartTime DCS Query %s \n\tEndTime DCS Query %s", nRun,
143         TTimeStamp(startTime).AsString(),
144         TTimeStamp(endTime).AsString(),
145         TTimeStamp(startTimeDCSQuery).AsString(), 
146         TTimeStamp(endTimeDCSQuery).AsString()));
147
148         Init();
149
150 }
151 //---------------------------------------------------------------
152
153 AliT0DataDCS::AliT0DataDCS(const AliT0DataDCS & data):
154   TObject(), 
155   fRun(0),
156   fStartTime(0),
157   fEndTime(0),
158   fStartTimeDCSQuery(0),
159   fEndTimeDCSQuery(0),
160   fAtten(0.),
161   fMPDcentA(0),
162   fMPDcentC(0),
163   fMPDsemiCentA(0),
164   fMPDsemiCentC(0),
165   fTVDCtop(0),
166   fTVDCbottom(0),
167   fMPDmode(0),
168   fIsProcessed(kFALSE)
169 {
170
171 // copy constructor
172
173   fRun=data.fRun;
174   fStartTime=data.fStartTime;
175   fEndTime=data.fEndTime;
176   fStartTimeDCSQuery=data.fStartTimeDCSQuery;
177   fEndTimeDCSQuery=data.fEndTimeDCSQuery;
178   fIsProcessed=data.fIsProcessed;
179   fAtten=data.fAtten;
180   fMPDcentA=data.fMPDcentA;
181   fMPDcentC=data.fMPDcentC;
182   fMPDsemiCentA=data.fMPDsemiCentA;
183   fMPDsemiCentC=data.fMPDsemiCentC;
184   fTVDCtop=data.fTVDCtop;
185   fTVDCbottom=data.fTVDCbottom;
186   fMPDmode=data.fMPDmode;
187   for(int i=0;i<kNAliases;i++) 
188   {
189     fAliasNames[i]=data.fAliasNames[i];
190   }
191   
192   for(Int_t i=0;i<kScalers;i++)
193   {
194     fScalerMean[i]=data.fScalerMean[i];
195     fScalerSecMean[i]=data.fScalerSecMean[i];
196   }
197   for(Int_t i=0;i<kHV;i++)
198   {
199     fHViA[i]=data.fHViA[i];
200     fHVvA[i]=data.fHVvA[i];
201     fHViC[i]=data.fHViC[i];
202     fHVvC[i]=data.fHVvC[i];
203   }
204   for(Int_t i=0;i<kLV;i++)
205   {
206     fLViA[i]=data.fLViA[i];
207     fLVvA[i]=data.fLVvA[i];
208     fLViC[i]=data.fLViC[i];
209     fLVvC[i]=data.fLVvC[i];
210   }
211   for(Int_t i=0;i<kTRM;i++)
212   {
213     fTRM[i]=data.fTRM[i];
214   }
215   for(Int_t i=0;i<kDRM;i++)
216   {
217     fDRM[i]=data.fDRM[i];
218   }
219 }
220 //---------------------------------------------------------------
221
222 AliT0DataDCS& AliT0DataDCS:: operator=(const AliT0DataDCS & data) { 
223
224 // assignment operator
225
226   this->fRun=data.fRun;
227   this->fStartTime=data.fStartTime;
228   this->fEndTime=data.fEndTime;
229   this->fStartTimeDCSQuery=data.fStartTimeDCSQuery;
230   this->fEndTimeDCSQuery=data.fEndTimeDCSQuery;
231
232   for(int i=0;i<kNAliases;i++)
233   {
234     this->fAliasNames[i]=data.fAliasNames[i];
235   }
236
237   return *this;
238 }
239
240 //---------------------------------------------------------------
241 AliT0DataDCS::~AliT0DataDCS() 
242 {
243 }
244
245 //---------------------------------------------------------------
246 Bool_t AliT0DataDCS::ProcessData(TMap& aliasMap)
247 {
248                 Int_t t0_scaler[kScalers];
249                 Int_t t0_scaler_sec[kScalers];
250                 Int_t aliasEntr[kNAliases];
251                 Float_t t0_a_hv_imon[kHV];
252                 Float_t t0_a_hv_vmon[kHV];
253                 Float_t t0_a_lv_imon[kLV];
254                 Float_t t0_a_lv_vmon[kLV];
255                 Float_t t0_c_hv_imon[kHV];
256                 Float_t t0_c_hv_vmon[kHV];
257                 Float_t t0_c_lv_imon[kLV];
258                 Float_t t0_c_lv_vmon[kLV];
259                 Float_t t0_a_cfd_thre[kCFD];
260                 Float_t t0_a_cfd_walk[kCFD];
261                 Float_t t0_c_cfd_thre[kCFD];
262                 Float_t t0_c_cfd_walk[kCFD];
263                 Float_t t0_ac_trm[kTRM];
264                 Float_t t0_ac_drm[kDRM];
265                 Float_t t0_atten=0.;
266                 Int_t t0_MPDcentA=0;
267                 Int_t t0_MPDcentC=0;
268                 Int_t t0_MPDsemiCentA=0;
269                 Int_t t0_MPDsemiCentC=0;
270                 Int_t t0_TVDCtop=0;
271                 Int_t t0_TVDCbottom=0;                  
272                 Int_t t0_MPDmode=0;
273         
274                 TObjArray *aliasArr;
275                 for(Int_t k=0; k<kScalers; k++)
276                 {
277                    t0_scaler[k]=0;
278                    t0_scaler_sec[k]=0;
279                 }
280
281                 for(Int_t k=0; k<kHV; k++)
282                 {
283                    t0_a_hv_imon[k]=0.;
284                    t0_a_hv_vmon[k]=0.;
285                    t0_c_hv_imon[k]=0.;
286                    t0_c_hv_vmon[k]=0.;
287                 }
288                 for(Int_t k=0; k<kLV; k++)
289                 {
290                    t0_a_lv_imon[k]=0.;
291                    t0_a_lv_vmon[k]=0.;
292                    t0_c_lv_imon[k]=0.;
293                    t0_c_lv_vmon[k]=0.;
294                 }
295                 for(Int_t k=0; k<kCFD; k++)
296                 {
297                    t0_a_cfd_thre[k]=0.;
298                    t0_a_cfd_walk[k]=0.;
299                    t0_c_cfd_thre[k]=0.;
300                    t0_c_cfd_walk[k]=0.;
301                 }
302                 for(Int_t k=0; k<kTRM; k++)
303                 {
304                    t0_ac_trm[k]=0.;
305                 }
306                 for(Int_t k=0; k<kDRM; k++)
307                 {
308                    t0_ac_drm[k]=0.;
309                 }
310
311 // here starts the main loop
312                 for(Int_t j=0; j<kNAliases; j++)
313                 {
314                   aliasEntr[j]=0;
315                   for (Int_t k=0;k<32;k++) 
316                   {
317                     t0_scaler[k]=0;
318                     t0_scaler_sec[k]=0; 
319                     
320                   }
321                   aliasArr = (TObjArray*) aliasMap.GetValue(fAliasNames[j].Data());
322                   if(!aliasArr)
323                   {
324                         AliError(Form("Alias %s not found!", fAliasNames[j].Data()));
325                         continue;
326                   }
327                   Introduce(j, aliasArr);
328                   if(aliasArr->GetEntries()<2)
329                   {
330                         AliError(Form("Alias %s has just %d entries!",
331                                         fAliasNames[j].Data(),aliasArr->GetEntries()));
332                         continue;
333                   }
334                   if (j < kScalers)
335                   { 
336                     aliasEntr[j] = aliasArr->GetEntries();
337                     for(Int_t l=0; l<aliasEntr[j]; l++)
338                     {
339                       AliDCSValue *aValue=dynamic_cast<AliDCSValue*> (aliasArr->At(l));
340                       t0_scaler[j]+= aValue->GetUInt();
341                     }
342                     fScalerMean[j] = t0_scaler[j] / aliasEntr[j];
343                   }
344                   else if (j < 2*kScalers)
345                   {
346                     aliasEntr[j] = aliasArr->GetEntries();              
347                     for(Int_t l=0; l<aliasEntr[j]; l++)
348                     {
349                       AliDCSValue *aValue=dynamic_cast<AliDCSValue*> (aliasArr->At(l));
350                       t0_scaler_sec[j-kScalers]+= aValue->GetUInt();
351                     }
352                     fScalerSecMean[j-kScalers] = t0_scaler_sec[j-kScalers] / aliasEntr[j];
353                   }
354                   else if (j < 2*kScalers+kHV)
355                   {
356                     aliasEntr[j] = aliasArr->GetEntries();
357                     for(Int_t l=0; l<aliasEntr[j]; l++)
358                     {
359                       AliDCSValue *aValue=dynamic_cast<AliDCSValue*> (aliasArr->At(l));
360                       t0_a_hv_imon[j-2*kScalers]+= aValue->GetFloat();
361                     }
362                     fHViA[j-2*kScalers] = t0_a_hv_imon[j-2*kScalers] / aliasEntr[j];
363                   }
364                   else if (j < 2*kScalers+2*kHV)
365                   {
366                     aliasEntr[j] = aliasArr->GetEntries();
367                     for(Int_t l=0; l<aliasEntr[j]; l++)
368                     {
369                       AliDCSValue *aValue=dynamic_cast<AliDCSValue*> (aliasArr->At(l));
370                       t0_a_hv_vmon[j-(2*kScalers+kHV)]+= aValue->GetFloat();
371                     }
372                     fHVvA[j-(2*kScalers+kHV)] = t0_a_hv_vmon[j-(2*kScalers+kHV)] / aliasEntr[j];
373                   }
374                   else if (j < 2*kScalers+2*kHV+kLV)
375                   {
376                     aliasEntr[j] = aliasArr->GetEntries();
377                     for(Int_t l=0; l<aliasEntr[j]; l++)
378                     {
379                       AliDCSValue *aValue=dynamic_cast<AliDCSValue*> (aliasArr->At(l));
380                       t0_a_lv_imon[j-(2*kScalers+2*kHV)]+= aValue->GetFloat();
381                     }
382                     fLViA[j-(2*kScalers+2*kHV)] = t0_a_lv_imon[j-(2*kScalers+2*kHV)] / aliasEntr[j];
383                   }
384                   else if (j < 2*kScalers+2*kHV+2*kLV)
385                   {
386                     aliasEntr[j] = aliasArr->GetEntries();
387                     for(Int_t l=0; l<aliasEntr[j]; l++)
388                     {
389                       AliDCSValue *aValue=dynamic_cast<AliDCSValue*> (aliasArr->At(l));
390                       t0_a_lv_vmon[j-(2*kScalers+2*kHV+kLV)]+= aValue->GetFloat();
391                     }
392                     fLVvA[j-(2*kScalers+2*kHV+kLV)] = t0_a_lv_vmon[j-(2*kScalers+2*kHV+kLV)] / aliasEntr[j];
393                   }
394                   else if (j < 2*kScalers+3*kHV+2*kLV)
395                   {
396                     aliasEntr[j] = aliasArr->GetEntries();
397                     for(Int_t l=0; l<aliasEntr[j]; l++)
398                     {
399                       AliDCSValue *aValue=dynamic_cast<AliDCSValue*> (aliasArr->At(l));
400                       t0_c_hv_imon[j-(2*kScalers+2*kHV+2*kLV)]+= aValue->GetFloat();
401                     }
402                     fHViC[j-(2*kScalers+2*kHV+2*kLV)] = t0_c_hv_imon[j-(2*kScalers+2*kHV+2*kLV)] / aliasEntr[j];
403                   }
404                   else if (j < 2*kScalers+4*kHV+2*kLV)
405                   {
406                     aliasEntr[j] = aliasArr->GetEntries();
407                     for(Int_t l=0; l<aliasEntr[j]; l++)
408                     {
409                       AliDCSValue *aValue=dynamic_cast<AliDCSValue*> (aliasArr->At(l));
410                       t0_c_hv_vmon[j-(2*kScalers+3*kHV+2*kLV)]+= aValue->GetFloat();
411                     }
412                     fHVvC[j-(2*kScalers+3*kHV+2*kLV)] = t0_c_hv_vmon[j-(2*kScalers+3*kHV+2*kLV)] / aliasEntr[j];
413                   }
414                   else if (j < 2*kScalers+4*kHV+3*kLV)
415                   {
416                     aliasEntr[j] = aliasArr->GetEntries();
417                     for(Int_t l=0; l<aliasEntr[j]; l++)
418                     {
419                       AliDCSValue *aValue=dynamic_cast<AliDCSValue*> (aliasArr->At(l));
420                       t0_c_lv_imon[j-(2*kScalers+4*kHV+2*kLV)]+= aValue->GetFloat();
421                     }
422                     fLViC[j-(2*kScalers+4*kHV+2*kLV)] = t0_c_lv_imon[j-(2*kScalers+4*kHV+2*kLV)] / aliasEntr[j];
423                   }
424                   else if (j < 2*kScalers+4*kHV+4*kLV)
425                   {
426                     aliasEntr[j] = aliasArr->GetEntries();
427                     for(Int_t l=0; l<aliasEntr[j]; l++)
428                     {
429                       AliDCSValue *aValue=dynamic_cast<AliDCSValue*> (aliasArr->At(l));
430                       t0_c_lv_vmon[j-(2*kScalers+4*kHV+3*kLV)]+= aValue->GetFloat();
431                     }
432                     fLVvC[j-(2*kScalers+4*kHV+3*kLV)] = t0_c_lv_vmon[j-(2*kScalers+4*kHV+3*kLV)] / aliasEntr[j];
433                   }
434                   else if (j < 2*kScalers+4*kHV+4*kLV+kCFD)
435                   {
436                     aliasEntr[j] = aliasArr->GetEntries();
437                     for(Int_t l=0; l<aliasEntr[j]; l++)
438                     {
439                       AliDCSValue *aValue=dynamic_cast<AliDCSValue*> (aliasArr->At(l));
440                       t0_a_cfd_thre[j-(2*kScalers+4*kHV+4*kLV)]+= aValue->GetFloat();
441                     }
442                     fCFDtA[j-(2*kScalers+4*kHV+4*kLV)] = t0_a_cfd_thre[j-(2*kScalers+4*kHV+4*kLV)] / aliasEntr[j];
443                   }
444                   else if (j < 2*kScalers+4*kHV+4*kLV+2*kCFD)
445                   {
446                     aliasEntr[j] = aliasArr->GetEntries();
447                     for(Int_t l=0; l<aliasEntr[j]; l++)
448                     {
449                       AliDCSValue *aValue=dynamic_cast<AliDCSValue*> (aliasArr->At(l));
450                       t0_a_cfd_walk[j-(2*kScalers+4*kHV+4*kLV+kCFD)]+= aValue->GetFloat();
451                     }
452                     fCFDwA[j-(2*kScalers+4*kHV+4*kLV+kCFD)] = t0_a_cfd_walk[j-(2*kScalers+4*kHV+4*kLV+kCFD)] / aliasEntr[j];
453                   }
454                   else if (j < 2*kScalers+4*kHV+4*kLV+3*kCFD)
455                   {
456                     aliasEntr[j] = aliasArr->GetEntries();
457                     for(Int_t l=0; l<aliasEntr[j]; l++)
458                     {
459                       AliDCSValue *aValue=dynamic_cast<AliDCSValue*> (aliasArr->At(l));
460                       t0_c_cfd_thre[j-(2*kScalers+4*kHV+4*kLV+2*kCFD)]+= aValue->GetFloat();
461                     }
462                     fCFDtC[j-(2*kScalers+4*kHV+4*kLV+2*kCFD)] = t0_c_cfd_thre[j-(2*kScalers+4*kHV+4*kLV+2*kCFD)] / aliasEntr[j];
463                   }
464                   else if (j < 2*kScalers+4*kHV+4*kLV+4*kCFD)
465                   {
466                     aliasEntr[j] = aliasArr->GetEntries();
467                     for(Int_t l=0; l<aliasEntr[j]; l++)
468                     {
469                       AliDCSValue *aValue=dynamic_cast<AliDCSValue*> (aliasArr->At(l));
470                       t0_c_cfd_walk[j-(2*kScalers+4*kHV+4*kLV+3*kCFD)]+= aValue->GetFloat();
471                     }
472                     fCFDwC[j-(2*kScalers+4*kHV+4*kLV+3*kCFD)] = t0_c_cfd_walk[j-(2*kScalers+4*kHV+4*kLV+3*kCFD)] / aliasEntr[j];
473                   }
474                   else if (j < 2*kScalers+4*kHV+4*kLV+4*kCFD+kTRM)
475                   {
476                     aliasEntr[j] = aliasArr->GetEntries();
477                     for(Int_t l=0; l<aliasEntr[j]; l++)
478                     {
479                       AliDCSValue *aValue=dynamic_cast<AliDCSValue*> (aliasArr->At(l));
480                       t0_ac_trm[j-(2*kScalers+4*kHV+4*kLV+4*kCFD)]+= aValue->GetFloat();
481                     }
482                     fTRM[j-(2*kScalers+4*kHV+4*kLV+4*kCFD)] = t0_ac_trm[j-(2*kScalers+4*kHV+4*kLV+4*kCFD)] / aliasEntr[j];
483                   }
484                   else if (j < 2*kScalers+4*kHV+4*kLV+4*kCFD+kTRM+kDRM)
485                   {
486                     aliasEntr[j] = aliasArr->GetEntries();
487                     for(Int_t l=0; l<aliasEntr[j]; l++)
488                     {
489                       AliDCSValue *aValue=dynamic_cast<AliDCSValue*> (aliasArr->At(l));
490                       t0_ac_drm[j-(2*kScalers+4*kHV+4*kLV+4*kCFD+kTRM)]+= aValue->GetFloat();
491                     }
492                     fDRM[j-(2*kScalers+4*kHV+4*kLV+4*kCFD+kTRM)] = t0_ac_drm[j-(2*kScalers+4*kHV+4*kLV+4*kCFD+kTRM)] / aliasEntr[j];
493                   }
494                   else if (j < 2*kScalers+4*kHV+4*kLV+4*kCFD+kTRM+kDRM+kAtten)
495                   {
496                     aliasEntr[j] = aliasArr->GetEntries();
497                     for(Int_t l=0; l<aliasEntr[j]; l++)
498                     {           
499                       AliDCSValue *aValue=dynamic_cast<AliDCSValue*> (aliasArr->At(l));
500                       t0_atten += aValue->GetInt();
501                     }
502                     fAtten = t0_atten / aliasEntr[j];
503                   }
504                   else if (j < 2*kScalers+4*kHV+4*kLV+4*kCFD+kTRM+kDRM+2*kAtten)
505                   {
506                     aliasEntr[j] = aliasArr->GetEntries();
507                     for(Int_t l=0; l<aliasEntr[j]; l++)
508                     {
509                       AliDCSValue *aValue=dynamic_cast<AliDCSValue*> (aliasArr->At(l));
510                       t0_MPDcentA += aValue->GetInt();
511                     }
512                     fMPDcentA = t0_MPDcentA / aliasEntr[j];
513                   }
514                   else if (j < 2*kScalers+4*kHV+4*kLV+4*kCFD+kTRM+kDRM+3*kAtten)
515                   {
516                     aliasEntr[j] = aliasArr->GetEntries();
517                     for(Int_t l=0; l<aliasEntr[j]; l++)
518                     {
519                       AliDCSValue *aValue=dynamic_cast<AliDCSValue*> (aliasArr->At(l));
520                       t0_MPDcentC += aValue->GetInt();
521                     }
522                     fMPDcentC = t0_MPDcentC / aliasEntr[j];
523                   }
524                   else if (j < 2*kScalers+4*kHV+4*kLV+4*kCFD+kTRM+kDRM+4*kAtten)
525                   {
526                     aliasEntr[j] = aliasArr->GetEntries();
527                     for(Int_t l=0; l<aliasEntr[j]; l++)
528                     {
529                       AliDCSValue *aValue=dynamic_cast<AliDCSValue*> (aliasArr->At(l));
530                       t0_MPDsemiCentA += aValue->GetInt();
531                     }
532                     fMPDsemiCentA = t0_MPDsemiCentA / aliasEntr[j];
533                   }
534                   else if (j < 2*kScalers+4*kHV+4*kLV+4*kCFD+kTRM+kDRM+5*kAtten)
535                   {
536                     aliasEntr[j] = aliasArr->GetEntries();
537                     for(Int_t l=0; l<aliasEntr[j]; l++)
538                     {
539                       AliDCSValue *aValue=dynamic_cast<AliDCSValue*> (aliasArr->At(l));
540                       t0_MPDsemiCentC += aValue->GetInt();
541                     }
542                     fMPDsemiCentC = t0_MPDsemiCentC / aliasEntr[j];
543                   }
544                   else if (j < 2*kScalers+4*kHV+4*kLV+4*kCFD+kTRM+kDRM+6*kAtten)
545                   {
546                     aliasEntr[j] = aliasArr->GetEntries();
547                     for(Int_t l=0; l<aliasEntr[j]; l++)
548                     {
549                       AliDCSValue *aValue=dynamic_cast<AliDCSValue*> (aliasArr->At(l));
550                       t0_TVDCtop += aValue->GetInt();
551                     }
552                     fTVDCtop = t0_TVDCtop / aliasEntr[j];
553                   }
554                   else if (j < 2*kScalers+4*kHV+4*kLV+4*kCFD+kTRM+kDRM+7*kAtten)
555                   {
556                     aliasEntr[j] = aliasArr->GetEntries();
557                     for(Int_t l=0; l<aliasEntr[j]; l++)
558                     {
559                       AliDCSValue *aValue=dynamic_cast<AliDCSValue*> (aliasArr->At(l));
560                       t0_TVDCbottom += aValue->GetInt();
561                     }
562                     fTVDCbottom = t0_TVDCbottom / aliasEntr[j];
563                   }
564                   else
565                   {
566                     aliasEntr[j] = aliasArr->GetEntries();
567                     for(Int_t l=0; l<aliasEntr[j]; l++)
568                     {
569                       AliDCSValue *aValue=dynamic_cast<AliDCSValue*> (aliasArr->At(l));
570                       t0_MPDmode += aValue->GetInt();
571                     }
572                     fMPDmode = t0_MPDmode / aliasEntr[j];
573                   }
574                 }
575         fIsProcessed=kTRUE;
576         return kTRUE;
577 }
578
579 //---------------------------------------------------------------
580 void AliT0DataDCS::Init()
581 {
582         TString sindex;
583         for(int i=0;i<kNAliases;i++)
584         {       
585                 if (i<kScalers)
586                 {
587                   fAliasNames[i] = "t00_ac_scaler_";
588                   sindex.Form("%02d",i);
589                   fAliasNames[i] += sindex;
590                 }
591                 else if (i < 2*kScalers)
592                 {
593                   fAliasNames[i] = "t00_ac_scaler_sec_";
594                   sindex.Form("%02d",i-kScalers);
595                   fAliasNames[i] += sindex;
596                 }
597                 else if (i < 2*kScalers+kHV)
598                 {
599                   fAliasNames[i] = "t00_a_hv_imon_";
600                   sindex.Form("%02d",i-2*kScalers);
601                   fAliasNames[i] += sindex;
602                 }
603                 else if (i < 2*kScalers+2*kHV)
604                 {
605                   fAliasNames[i] = "t00_a_hv_vmon_";
606                   sindex.Form("%02d",i-(2*kScalers+kHV));
607                   fAliasNames[i] += sindex;
608                 }
609                 else if (i < 2*kScalers+2*kHV+kLV)
610                 {
611                   fAliasNames[i] = "t00_a_lv_imon_";
612                   sindex.Form("%01d",i-(2*kScalers+2*kHV));
613                   fAliasNames[i] += sindex;
614                 }
615                 else if (i < 2*kScalers+2*kHV+2*kLV)
616                 {
617                   fAliasNames[i] = "t00_a_lv_vmon_";
618                   sindex.Form("%01d",i-(2*kScalers+2*kHV+kLV));
619                   fAliasNames[i] += sindex;
620                 }
621                 else if (i < 2*kScalers+3*kHV+2*kLV)
622                 {
623                   fAliasNames[i] = "t00_c_hv_imon_";
624                   sindex.Form("%02d",i-(2*kScalers+2*kHV+2*kLV));
625                   fAliasNames[i] += sindex;
626                 }
627                 else if (i < 2*kScalers+4*kHV+2*kLV)
628                 {
629                   fAliasNames[i] = "t00_c_hv_vmon_";
630                   sindex.Form("%02d",i-(2*kScalers+3*kHV+2*kLV));
631                   fAliasNames[i] += sindex;
632                 }
633                 else if (i < 2*kScalers+4*kHV+3*kLV)
634                 {
635                   fAliasNames[i] = "t00_c_lv_imon_";
636                   sindex.Form("%01d",i-(2*kScalers+4*kHV+2*kLV));
637                   fAliasNames[i] += sindex;
638                 }
639                 else if (i < 2*kScalers+4*kHV+4*kLV)
640                 {
641                   fAliasNames[i] = "t00_c_lv_vmon_";
642                   sindex.Form("%01d",i-(2*kScalers+4*kHV+3*kLV));
643                   fAliasNames[i] += sindex;
644                 }
645                 else if (i < 2*kScalers+4*kHV+4*kLV+kCFD)
646                 {
647                   fAliasNames[i] = "t00_a_cfd_thre_";
648                   sindex.Form("%02d",i-(2*kScalers+4*kHV+4*kLV));
649                   fAliasNames[i] += sindex;
650                 }
651                 else if (i < 2*kScalers+4*kHV+4*kLV+2*kCFD)
652                 {
653                   fAliasNames[i] = "t00_a_cfd_walk_";
654                   sindex.Form("%02d",i-(2*kScalers+4*kHV+4*kLV+kCFD));
655                   fAliasNames[i] += sindex;
656                 }
657                   else if (i < 2*kScalers+4*kHV+4*kLV+3*kCFD)
658                 {
659                   fAliasNames[i] = "t00_c_cfd_thre_";
660                   sindex.Form("%02d",i-(2*kScalers+4*kHV+4*kLV+2*kCFD));
661                   fAliasNames[i] += sindex;
662                 }
663                 else if (i < 2*kScalers+4*kHV+4*kLV+4*kCFD)
664                 {
665                   fAliasNames[i] = "t00_c_cfd_walk_";
666                   sindex.Form("%02d",i-(2*kScalers+4*kHV+4*kLV+3*kCFD));
667                   fAliasNames[i] += sindex;
668                 }
669                 else if (i < 2*kScalers+4*kHV+4*kLV+4*kCFD+kTRM)
670                 {
671                   fAliasNames[i] = "t00_ac_trm_";
672                   sindex.Form("%02d",i-(2*kScalers+4*kHV+4*kLV+4*kCFD));
673                   fAliasNames[i] += sindex;
674                 }
675                  else if (i < 2*kScalers+4*kHV+4*kLV+4*kCFD+kTRM+kDRM)
676                 {
677                   fAliasNames[i] = "t00_ac_drm_";
678                   sindex.Form("%02d",i-(2*kScalers+4*kHV+4*kLV+4*kCFD+kTRM));
679                   fAliasNames[i] += sindex;
680                 }
681                 else if (i < 2*kScalers+4*kHV+4*kLV+4*kCFD+kTRM+kDRM+kAtten)
682                 {
683                   fAliasNames[i] = "t00_ac_atten";
684                 }
685                 else if (i < 2*kScalers+4*kHV+4*kLV+4*kCFD+kTRM+kDRM+2*kAtten)
686                 {
687                   fAliasNames[i] = "t00_a_mpd_cent";
688                 }
689                 else if (i < 2*kScalers+4*kHV+4*kLV+4*kCFD+kTRM+kDRM+3*kAtten)
690                 {
691                   fAliasNames[i] = "t00_c_mpd_cent";
692                 }
693                 else if (i < 2*kScalers+4*kHV+4*kLV+4*kCFD+kTRM+kDRM+4*kAtten)
694                 {
695                   fAliasNames[i] = "t00_a_mpd_scent";
696                 }
697                 else if (i < 2*kScalers+4*kHV+4*kLV+4*kCFD+kTRM+kDRM+5*kAtten)
698                 {
699                   fAliasNames[i] = "t00_c_mpd_scent";
700                 }
701                 else if (i < 2*kScalers+4*kHV+4*kLV+4*kCFD+kTRM+kDRM+6*kAtten)
702                 {
703                   fAliasNames[i] = "t00_ac_tvdc_top";
704                 }
705                 else if (i < 2*kScalers+4*kHV+4*kLV+4*kCFD+kTRM+kDRM+7*kAtten)
706                 {
707                   fAliasNames[i] = "t00_ac_tvdc_bottom";
708                 }
709                 else
710                 {
711                   fAliasNames[i] = "t00_ac_mpd_mode";
712                 }
713         }
714
715 }
716
717 //---------------------------------------------------------------
718 void AliT0DataDCS::Introduce(UInt_t numAlias, const TObjArray* aliasArr)const
719 {
720
721         int entries=aliasArr->GetEntries();
722         AliInfo(Form("************ Alias: %s **********",fAliasNames[numAlias].Data()));
723         AliInfo(Form("          %d DP values collected",entries));
724
725 }
726
727
728