memory leak fixed
[u/mrichter/AliRoot.git] / T0 / AliT0DataDCS.cxx
CommitLineData
9dcc11e4 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 *
8eb4ac75 10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
9dcc11e4 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
19Fetching data points from DCS, calculating mean and storing data to Reference DB
20
21 Version 1.1 2006/10
22Preliminary test version (T.Malkiewicz)
23*/
24
dc7ca31d 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>
dc7ca31d 33
9dcc11e4 34// AliT0DataDCS class
35// declaring DCS aliases for T0
36// fetching T0 data points from DCS,
37// calculating mean values for the entire run
38// and storing the result to Reference DB
39
dc7ca31d 40ClassImp(AliT0DataDCS)
41
42//---------------------------------------------------------------
43AliT0DataDCS::AliT0DataDCS():
44 TObject(),
9dcc11e4 45 fRun(0),
dc7ca31d 46 fStartTime(0),
47 fEndTime(0),
8eb4ac75 48 fStartTimeDCSQuery(0),
49 fEndTimeDCSQuery(0),
50 fAtten(0.),
955ef7d2 51 fMPDcentA(0),
52 fMPDcentC(0),
53 fMPDsemiCentA(0),
54 fMPDsemiCentC(0),
55 fTVDCtop(0),
56 fTVDCbottom(0),
57 fMPDmode(0),
dc7ca31d 58 fIsProcessed(kFALSE)
59{
d99eeddf 60 // default constructor
61 //
8eb4ac75 62 for(Int_t i=0;i<kScalers;i++)
63 {
5bdebf6a 64 fScalerMean[i]=0;
65 fScalerSecMean[i]=0;
8eb4ac75 66 }
67 for(Int_t i=0;i<kHV;i++)
68 {
69 fHViA[i]=0.;
70 fHVvA[i]=0.;
71 fHViC[i]=0.;
72 fHVvC[i]=0.;
73 }
74 for(Int_t i=0;i<kLV;i++)
75 {
76 fLViA[i]=0.;
77 fLVvA[i]=0.;
78 fLViC[i]=0.;
79 fLVvC[i]=0.;
80 }
81 for(Int_t i=0;i<kTRM;i++)
82 {
83 fTRM[i]=0.;
84 }
85 for(Int_t i=0;i<kDRM;i++)
86 {
87 fDRM[i]=0.;
88 }
36cde487 89 for ( Int_t i=0; i<kCFD; i++ )
90 {
91 fCFDtA[i] = 0;
92 fCFDtC[i] = 0;
93 fCFDwA[i] = 0;
94 fCFDwC[i] = 0;
95 }
96
dc7ca31d 97
8eb4ac75 98}
dc7ca31d 99//---------------------------------------------------------------
8eb4ac75 100AliT0DataDCS::AliT0DataDCS(Int_t nRun, UInt_t startTime, UInt_t endTime, UInt_t startTimeDCSQuery, UInt_t endTimeDCSQuery):
dc7ca31d 101 TObject(),
102 fRun(nRun),
103 fStartTime(startTime),
104 fEndTime(endTime),
8eb4ac75 105 fStartTimeDCSQuery(startTimeDCSQuery),
106 fEndTimeDCSQuery(endTimeDCSQuery),
107 fAtten(0.),
955ef7d2 108 fMPDcentA(0),
109 fMPDcentC(0),
110 fMPDsemiCentA(0),
111 fMPDsemiCentC(0),
112 fTVDCtop(0),
113 fTVDCbottom(0),
114 fMPDmode(0),
dc7ca31d 115 fIsProcessed(kFALSE)
116{
d99eeddf 117 // constructor
118
8eb4ac75 119 for(Int_t i=0;i<kScalers;i++)
120 {
5bdebf6a 121 fScalerMean[i]=0;
122 fScalerSecMean[i]=0;
8eb4ac75 123 }
124 for(Int_t i=0;i<kHV;i++)
125 {
126 fHViA[i]=0.;
127 fHVvA[i]=0.;
128 fHViC[i]=0.;
129 fHVvC[i]=0.;
130 }
131 for(Int_t i=0;i<kLV;i++)
132 {
133 fLViA[i]=0.;
134 fLVvA[i]=0.;
135 fLViC[i]=0.;
136 fLVvC[i]=0.;
137 }
138 for(Int_t i=0;i<kTRM;i++)
139 {
140 fTRM[i]=0.;
141 }
142 for(Int_t i=0;i<kDRM;i++)
143 {
144 fDRM[i]=0.;
145 }
146
147 AliInfo(Form("\n\tRun %d \n\tStartTime %s \n\tEndTime %s \n\tStartTime DCS Query %s \n\tEndTime DCS Query %s", nRun,
dc7ca31d 148 TTimeStamp(startTime).AsString(),
8eb4ac75 149 TTimeStamp(endTime).AsString(),
150 TTimeStamp(startTimeDCSQuery).AsString(),
151 TTimeStamp(endTimeDCSQuery).AsString()));
dc7ca31d 152
dc7ca31d 153 Init();
154
155}
8eb4ac75 156//---------------------------------------------------------------
157
158AliT0DataDCS::AliT0DataDCS(const AliT0DataDCS & data):
159 TObject(),
160 fRun(0),
161 fStartTime(0),
162 fEndTime(0),
163 fStartTimeDCSQuery(0),
164 fEndTimeDCSQuery(0),
165 fAtten(0.),
955ef7d2 166 fMPDcentA(0),
167 fMPDcentC(0),
168 fMPDsemiCentA(0),
169 fMPDsemiCentC(0),
170 fTVDCtop(0),
171 fTVDCbottom(0),
172 fMPDmode(0),
8eb4ac75 173 fIsProcessed(kFALSE)
174{
175
176// copy constructor
dc7ca31d 177
8eb4ac75 178 fRun=data.fRun;
179 fStartTime=data.fStartTime;
180 fEndTime=data.fEndTime;
181 fStartTimeDCSQuery=data.fStartTimeDCSQuery;
182 fEndTimeDCSQuery=data.fEndTimeDCSQuery;
183 fIsProcessed=data.fIsProcessed;
184 fAtten=data.fAtten;
955ef7d2 185 fMPDcentA=data.fMPDcentA;
186 fMPDcentC=data.fMPDcentC;
187 fMPDsemiCentA=data.fMPDsemiCentA;
188 fMPDsemiCentC=data.fMPDsemiCentC;
189 fTVDCtop=data.fTVDCtop;
190 fTVDCbottom=data.fTVDCbottom;
191 fMPDmode=data.fMPDmode;
8eb4ac75 192 for(int i=0;i<kNAliases;i++)
193 {
194 fAliasNames[i]=data.fAliasNames[i];
195 }
196
197 for(Int_t i=0;i<kScalers;i++)
198 {
199 fScalerMean[i]=data.fScalerMean[i];
200 fScalerSecMean[i]=data.fScalerSecMean[i];
201 }
202 for(Int_t i=0;i<kHV;i++)
203 {
204 fHViA[i]=data.fHViA[i];
205 fHVvA[i]=data.fHVvA[i];
206 fHViC[i]=data.fHViC[i];
207 fHVvC[i]=data.fHVvC[i];
208 }
209 for(Int_t i=0;i<kLV;i++)
210 {
211 fLViA[i]=data.fLViA[i];
212 fLVvA[i]=data.fLVvA[i];
213 fLViC[i]=data.fLViC[i];
214 fLVvC[i]=data.fLVvC[i];
215 }
216 for(Int_t i=0;i<kTRM;i++)
217 {
218 fTRM[i]=data.fTRM[i];
219 }
220 for(Int_t i=0;i<kDRM;i++)
221 {
222 fDRM[i]=data.fDRM[i];
223 }
36cde487 224 for ( Int_t i=0; i<kCFD; i++ )
225 {
226 fCFDtA[i] = data.fCFDtA[i];
227 fCFDtC[i] = data.fCFDtC[i];
228 fCFDwA[i] = data.fCFDwA[i];
229 fCFDwC[i] = data.fCFDwC[i];
230 }
8eb4ac75 231}
dc7ca31d 232//---------------------------------------------------------------
dc7ca31d 233
8eb4ac75 234AliT0DataDCS& AliT0DataDCS:: operator=(const AliT0DataDCS & data) {
235
236// assignment operator
237
238 this->fRun=data.fRun;
239 this->fStartTime=data.fStartTime;
240 this->fEndTime=data.fEndTime;
241 this->fStartTimeDCSQuery=data.fStartTimeDCSQuery;
242 this->fEndTimeDCSQuery=data.fEndTimeDCSQuery;
243
244 for(int i=0;i<kNAliases;i++)
245 {
246 this->fAliasNames[i]=data.fAliasNames[i];
247 }
248
249 return *this;
250}
251
252//---------------------------------------------------------------
253AliT0DataDCS::~AliT0DataDCS()
254{
dc7ca31d 255}
256
257//---------------------------------------------------------------
91366e58 258Bool_t AliT0DataDCS::ProcessData(TMap& aliasMap)
259{
d99eeddf 260 //process DCS data
261
262 UInt_t t0Scaler[kScalers];
263 UInt_t t0ScalerSec[kScalers];
8eb4ac75 264 Int_t aliasEntr[kNAliases];
d99eeddf 265 Float_t t0AhvImon[kHV];
266 Float_t t0AHVvmon[kHV];
267 Float_t t0AlvImon[kLV];
268 Float_t t0AlvVmon[kLV];
269 Float_t t0ChvImon[kHV];
270 Float_t t0ChvVmon[kHV];
271 Float_t t0ClvImon[kLV];
272 Float_t t0ClvVmon[kLV];
273 Float_t t0AcfdThre[kCFD];
274 Float_t t0AcfdWalk[kCFD];
275 Float_t t0CcfdThre[kCFD];
276 Float_t t0CcfdWalk[kCFD];
277 Float_t t0ACtrm[kTRM];
278 Float_t t0ACdrm[kDRM];
279 Float_t t0atten=0.;
280 Int_t t0MPDcentA=0;
281 Int_t t0MPDcentC=0;
282 Int_t t0MPDsemiCentA=0;
283 Int_t t0MPDsemiCentC=0;
284 Int_t t0TVDCtop=0;
285 Int_t t0TVDCbottom=0;
286 Int_t t0MPDmode=0;
955ef7d2 287
970bb0d0 288 TObjArray *aliasArr;
8eb4ac75 289 for(Int_t k=0; k<kScalers; k++)
290 {
d99eeddf 291 t0Scaler[k]=0;
292 t0ScalerSec[k]=0;
8eb4ac75 293 }
294
295 for(Int_t k=0; k<kHV; k++)
296 {
d99eeddf 297 t0AhvImon[k]=0.;
298 t0AHVvmon[k]=0.;
299 t0ChvImon[k]=0.;
300 t0ChvVmon[k]=0.;
8eb4ac75 301 }
882ad8b4 302 for(Int_t k=0; k<kLV; k++)
8eb4ac75 303 {
d99eeddf 304 t0AlvImon[k]=0.;
305 t0AlvVmon[k]=0.;
306 t0ClvImon[k]=0.;
307 t0ClvVmon[k]=0.;
8eb4ac75 308 }
309 for(Int_t k=0; k<kCFD; k++)
310 {
d99eeddf 311 t0AcfdThre[k]=0.;
312 t0AcfdWalk[k]=0.;
313 t0CcfdThre[k]=0.;
314 t0CcfdWalk[k]=0.;
8eb4ac75 315 }
316 for(Int_t k=0; k<kTRM; k++)
317 {
d99eeddf 318 t0ACtrm[k]=0.;
8eb4ac75 319 }
320 for(Int_t k=0; k<kDRM; k++)
321 {
d99eeddf 322 t0ACdrm[k]=0.;
8eb4ac75 323 }
324
5bdebf6a 325 // here starts the main loop
8eb4ac75 326 for(Int_t j=0; j<kNAliases; j++)
970bb0d0 327 {
8eb4ac75 328 aliasEntr[j]=0;
9dcc11e4 329 for (Int_t k=0;k<32;k++)
330 {
d99eeddf 331 t0Scaler[k]=0;
332 t0ScalerSec[k]=0;
8eb4ac75 333
9dcc11e4 334 }
335 aliasArr = (TObjArray*) aliasMap.GetValue(fAliasNames[j].Data());
5bdebf6a 336
970bb0d0 337 if(!aliasArr)
338 {
339 AliError(Form("Alias %s not found!", fAliasNames[j].Data()));
91366e58 340 continue;
970bb0d0 341 }
8eb4ac75 342 Introduce(j, aliasArr);
970bb0d0 343 if(aliasArr->GetEntries()<2)
344 {
345 AliError(Form("Alias %s has just %d entries!",
346 fAliasNames[j].Data(),aliasArr->GetEntries()));
347 continue;
348 }
8eb4ac75 349 if (j < kScalers)
350 {
351 aliasEntr[j] = aliasArr->GetEntries();
352 for(Int_t l=0; l<aliasEntr[j]; l++)
353 {
2cc08a41 354 AliDCSValue *aValue=static_cast<AliDCSValue*> (aliasArr->At(l));
d99eeddf 355 t0Scaler[j]+= (UInt_t) aValue->GetFloat();
8eb4ac75 356 }
d99eeddf 357 fScalerMean[j] = ((UInt_t) t0Scaler[j])/((UInt_t) aliasEntr[j]);
8eb4ac75 358 }
359 else if (j < 2*kScalers)
970bb0d0 360 {
8eb4ac75 361 aliasEntr[j] = aliasArr->GetEntries();
362 for(Int_t l=0; l<aliasEntr[j]; l++)
363 {
2cc08a41 364 AliDCSValue *aValue=static_cast<AliDCSValue*> (aliasArr->At(l));
d99eeddf 365 t0ScalerSec[j-kScalers]+= (UInt_t) aValue->GetFloat();
8eb4ac75 366 }
d99eeddf 367 fScalerSecMean[j-kScalers] = ((UInt_t) t0ScalerSec[j-kScalers])/((UInt_t) aliasEntr[j]);
8eb4ac75 368 }
369 else if (j < 2*kScalers+kHV)
370 {
371 aliasEntr[j] = aliasArr->GetEntries();
372 for(Int_t l=0; l<aliasEntr[j]; l++)
373 {
2cc08a41 374 AliDCSValue *aValue=static_cast<AliDCSValue*> (aliasArr->At(l));
d99eeddf 375 t0AhvImon[j-2*kScalers]+= aValue->GetFloat();
8eb4ac75 376 }
d99eeddf 377 fHViA[j-2*kScalers] = t0AhvImon[j-2*kScalers] / aliasEntr[j];
8eb4ac75 378 }
379 else if (j < 2*kScalers+2*kHV)
380 {
381 aliasEntr[j] = aliasArr->GetEntries();
382 for(Int_t l=0; l<aliasEntr[j]; l++)
383 {
2cc08a41 384 AliDCSValue *aValue=static_cast<AliDCSValue*> (aliasArr->At(l));
d99eeddf 385 t0AHVvmon[j-(2*kScalers+kHV)]+= aValue->GetFloat();
8eb4ac75 386 }
d99eeddf 387 fHVvA[j-(2*kScalers+kHV)] = t0AHVvmon[j-(2*kScalers+kHV)] / aliasEntr[j];
8eb4ac75 388 }
389 else if (j < 2*kScalers+2*kHV+kLV)
390 {
391 aliasEntr[j] = aliasArr->GetEntries();
392 for(Int_t l=0; l<aliasEntr[j]; l++)
393 {
2cc08a41 394 AliDCSValue *aValue=static_cast<AliDCSValue*> (aliasArr->At(l));
d99eeddf 395 t0AlvImon[j-(2*kScalers+2*kHV)]+= aValue->GetFloat();
8eb4ac75 396 }
d99eeddf 397 fLViA[j-(2*kScalers+2*kHV)] = t0AlvImon[j-(2*kScalers+2*kHV)] / aliasEntr[j];
8eb4ac75 398 }
399 else if (j < 2*kScalers+2*kHV+2*kLV)
400 {
401 aliasEntr[j] = aliasArr->GetEntries();
402 for(Int_t l=0; l<aliasEntr[j]; l++)
403 {
2cc08a41 404 AliDCSValue *aValue=static_cast<AliDCSValue*> (aliasArr->At(l));
d99eeddf 405 t0AlvVmon[j-(2*kScalers+2*kHV+kLV)]+= aValue->GetFloat();
8eb4ac75 406 }
d99eeddf 407 fLVvA[j-(2*kScalers+2*kHV+kLV)] = t0AlvVmon[j-(2*kScalers+2*kHV+kLV)] / aliasEntr[j];
8eb4ac75 408 }
409 else if (j < 2*kScalers+3*kHV+2*kLV)
410 {
411 aliasEntr[j] = aliasArr->GetEntries();
412 for(Int_t l=0; l<aliasEntr[j]; l++)
413 {
2cc08a41 414 AliDCSValue *aValue=static_cast<AliDCSValue*> (aliasArr->At(l));
d99eeddf 415 t0ChvImon[j-(2*kScalers+2*kHV+2*kLV)]+= aValue->GetFloat();
8eb4ac75 416 }
d99eeddf 417 fHViC[j-(2*kScalers+2*kHV+2*kLV)] = t0ChvImon[j-(2*kScalers+2*kHV+2*kLV)] / aliasEntr[j];
8eb4ac75 418 }
419 else if (j < 2*kScalers+4*kHV+2*kLV)
420 {
421 aliasEntr[j] = aliasArr->GetEntries();
422 for(Int_t l=0; l<aliasEntr[j]; l++)
423 {
2cc08a41 424 AliDCSValue *aValue=static_cast<AliDCSValue*> (aliasArr->At(l));
d99eeddf 425 t0ChvVmon[j-(2*kScalers+3*kHV+2*kLV)]+= aValue->GetFloat();
8eb4ac75 426 }
d99eeddf 427 fHVvC[j-(2*kScalers+3*kHV+2*kLV)] = t0ChvVmon[j-(2*kScalers+3*kHV+2*kLV)] / aliasEntr[j];
8eb4ac75 428 }
429 else if (j < 2*kScalers+4*kHV+3*kLV)
430 {
431 aliasEntr[j] = aliasArr->GetEntries();
432 for(Int_t l=0; l<aliasEntr[j]; l++)
433 {
2cc08a41 434 AliDCSValue *aValue=static_cast<AliDCSValue*> (aliasArr->At(l));
d99eeddf 435 t0ClvImon[j-(2*kScalers+4*kHV+2*kLV)]+= aValue->GetFloat();
8eb4ac75 436 }
d99eeddf 437 fLViC[j-(2*kScalers+4*kHV+2*kLV)] = t0ClvImon[j-(2*kScalers+4*kHV+2*kLV)] / aliasEntr[j];
8eb4ac75 438 }
439 else if (j < 2*kScalers+4*kHV+4*kLV)
440 {
441 aliasEntr[j] = aliasArr->GetEntries();
442 for(Int_t l=0; l<aliasEntr[j]; l++)
443 {
2cc08a41 444 AliDCSValue *aValue=static_cast<AliDCSValue*> (aliasArr->At(l));
d99eeddf 445 t0ClvVmon[j-(2*kScalers+4*kHV+3*kLV)]+= aValue->GetFloat();
8eb4ac75 446 }
d99eeddf 447 fLVvC[j-(2*kScalers+4*kHV+3*kLV)] = t0ClvVmon[j-(2*kScalers+4*kHV+3*kLV)] / aliasEntr[j];
8eb4ac75 448 }
449 else if (j < 2*kScalers+4*kHV+4*kLV+kCFD)
450 {
451 aliasEntr[j] = aliasArr->GetEntries();
452 for(Int_t l=0; l<aliasEntr[j]; l++)
453 {
2cc08a41 454 AliDCSValue *aValue=static_cast<AliDCSValue*> (aliasArr->At(l));
d99eeddf 455 t0AcfdThre[j-(2*kScalers+4*kHV+4*kLV)]+= aValue->GetFloat();
8eb4ac75 456 }
d99eeddf 457 fCFDtA[j-(2*kScalers+4*kHV+4*kLV)] = t0AcfdThre[j-(2*kScalers+4*kHV+4*kLV)] / aliasEntr[j];
8eb4ac75 458 }
459 else if (j < 2*kScalers+4*kHV+4*kLV+2*kCFD)
460 {
461 aliasEntr[j] = aliasArr->GetEntries();
462 for(Int_t l=0; l<aliasEntr[j]; l++)
463 {
2cc08a41 464 AliDCSValue *aValue=static_cast<AliDCSValue*> (aliasArr->At(l));
d99eeddf 465 t0AcfdWalk[j-(2*kScalers+4*kHV+4*kLV+kCFD)]+= aValue->GetFloat();
8eb4ac75 466 }
d99eeddf 467 fCFDwA[j-(2*kScalers+4*kHV+4*kLV+kCFD)] = t0AcfdWalk[j-(2*kScalers+4*kHV+4*kLV+kCFD)] / aliasEntr[j];
8eb4ac75 468 }
469 else if (j < 2*kScalers+4*kHV+4*kLV+3*kCFD)
470 {
471 aliasEntr[j] = aliasArr->GetEntries();
472 for(Int_t l=0; l<aliasEntr[j]; l++)
473 {
2cc08a41 474 AliDCSValue *aValue=static_cast<AliDCSValue*> (aliasArr->At(l));
d99eeddf 475 t0CcfdThre[j-(2*kScalers+4*kHV+4*kLV+2*kCFD)]+= aValue->GetFloat();
8eb4ac75 476 }
d99eeddf 477 fCFDtC[j-(2*kScalers+4*kHV+4*kLV+2*kCFD)] = t0CcfdThre[j-(2*kScalers+4*kHV+4*kLV+2*kCFD)] / aliasEntr[j];
8eb4ac75 478 }
479 else if (j < 2*kScalers+4*kHV+4*kLV+4*kCFD)
480 {
481 aliasEntr[j] = aliasArr->GetEntries();
482 for(Int_t l=0; l<aliasEntr[j]; l++)
483 {
2cc08a41 484 AliDCSValue *aValue=static_cast<AliDCSValue*> (aliasArr->At(l));
d99eeddf 485 t0CcfdWalk[j-(2*kScalers+4*kHV+4*kLV+3*kCFD)]+= aValue->GetFloat();
8eb4ac75 486 }
d99eeddf 487 fCFDwC[j-(2*kScalers+4*kHV+4*kLV+3*kCFD)] = t0CcfdWalk[j-(2*kScalers+4*kHV+4*kLV+3*kCFD)] / aliasEntr[j];
8eb4ac75 488 }
489 else if (j < 2*kScalers+4*kHV+4*kLV+4*kCFD+kTRM)
490 {
491 aliasEntr[j] = aliasArr->GetEntries();
492 for(Int_t l=0; l<aliasEntr[j]; l++)
493 {
2cc08a41 494 AliDCSValue *aValue=static_cast<AliDCSValue*> (aliasArr->At(l));
d99eeddf 495 t0ACtrm[j-(2*kScalers+4*kHV+4*kLV+4*kCFD)]+= aValue->GetFloat();
8eb4ac75 496 }
d99eeddf 497 fTRM[j-(2*kScalers+4*kHV+4*kLV+4*kCFD)] = t0ACtrm[j-(2*kScalers+4*kHV+4*kLV+4*kCFD)] / aliasEntr[j];
8eb4ac75 498 }
499 else if (j < 2*kScalers+4*kHV+4*kLV+4*kCFD+kTRM+kDRM)
500 {
501 aliasEntr[j] = aliasArr->GetEntries();
502 for(Int_t l=0; l<aliasEntr[j]; l++)
503 {
2cc08a41 504 AliDCSValue *aValue=static_cast<AliDCSValue*> (aliasArr->At(l));
d99eeddf 505 t0ACdrm[j-(2*kScalers+4*kHV+4*kLV+4*kCFD+kTRM)]+= aValue->GetFloat();
8eb4ac75 506 }
d99eeddf 507 fDRM[j-(2*kScalers+4*kHV+4*kLV+4*kCFD+kTRM)] = t0ACdrm[j-(2*kScalers+4*kHV+4*kLV+4*kCFD+kTRM)] / aliasEntr[j];
8eb4ac75 508 }
955ef7d2 509 else if (j < 2*kScalers+4*kHV+4*kLV+4*kCFD+kTRM+kDRM+kAtten)
8eb4ac75 510 {
511 aliasEntr[j] = aliasArr->GetEntries();
512 for(Int_t l=0; l<aliasEntr[j]; l++)
513 {
2cc08a41 514 AliDCSValue *aValue=static_cast<AliDCSValue*> (aliasArr->At(l));
d99eeddf 515 t0atten += aValue->GetFloat();
8eb4ac75 516 }
d99eeddf 517 fAtten = t0atten /((Float_t) aliasEntr[j]);
8eb4ac75 518 }
955ef7d2 519 else if (j < 2*kScalers+4*kHV+4*kLV+4*kCFD+kTRM+kDRM+2*kAtten)
520 {
521 aliasEntr[j] = aliasArr->GetEntries();
522 for(Int_t l=0; l<aliasEntr[j]; l++)
523 {
2cc08a41 524 AliDCSValue *aValue=static_cast<AliDCSValue*> (aliasArr->At(l));
1c8e4bb6 525 t0MPDcentA += Int_t(aValue->GetFloat());
955ef7d2 526 }
1c8e4bb6 527 if(aliasEntr[j]!=0)
528 fMPDcentA = t0MPDcentA / aliasEntr[j];
955ef7d2 529 }
530 else if (j < 2*kScalers+4*kHV+4*kLV+4*kCFD+kTRM+kDRM+3*kAtten)
531 {
532 aliasEntr[j] = aliasArr->GetEntries();
533 for(Int_t l=0; l<aliasEntr[j]; l++)
534 {
2cc08a41 535 AliDCSValue *aValue=static_cast<AliDCSValue*> (aliasArr->At(l));
d99eeddf 536 t0MPDcentC += (Int_t) aValue->GetFloat();
955ef7d2 537 }
d99eeddf 538 fMPDcentC = ((Int_t) t0MPDcentC) /((Int_t) aliasEntr[j]);
955ef7d2 539 }
540 else if (j < 2*kScalers+4*kHV+4*kLV+4*kCFD+kTRM+kDRM+4*kAtten)
541 {
542 aliasEntr[j] = aliasArr->GetEntries();
543 for(Int_t l=0; l<aliasEntr[j]; l++)
544 {
545 AliDCSValue *aValue=dynamic_cast<AliDCSValue*> (aliasArr->At(l));
d99eeddf 546 t0MPDsemiCentA += (Int_t) aValue->GetFloat();
955ef7d2 547 }
d99eeddf 548 fMPDsemiCentA = ((Int_t) t0MPDsemiCentA) /((Int_t) aliasEntr[j]);
955ef7d2 549 }
550 else if (j < 2*kScalers+4*kHV+4*kLV+4*kCFD+kTRM+kDRM+5*kAtten)
551 {
552 aliasEntr[j] = aliasArr->GetEntries();
553 for(Int_t l=0; l<aliasEntr[j]; l++)
554 {
2cc08a41 555 AliDCSValue *aValue=static_cast<AliDCSValue*> (aliasArr->At(l));
d99eeddf 556 t0MPDsemiCentC += (Int_t) aValue->GetFloat();
955ef7d2 557 }
d99eeddf 558 fMPDsemiCentC = ((Int_t) t0MPDsemiCentC)/ ((Int_t) aliasEntr[j]);
955ef7d2 559 }
560 else if (j < 2*kScalers+4*kHV+4*kLV+4*kCFD+kTRM+kDRM+6*kAtten)
561 {
562 aliasEntr[j] = aliasArr->GetEntries();
563 for(Int_t l=0; l<aliasEntr[j]; l++)
564 {
2cc08a41 565 AliDCSValue *aValue=static_cast<AliDCSValue*> (aliasArr->At(l));
d99eeddf 566 t0TVDCtop += (Int_t) aValue->GetFloat();
955ef7d2 567 }
d99eeddf 568 fTVDCtop = ((Int_t) t0TVDCtop)/((Int_t) aliasEntr[j]);
955ef7d2 569 }
570 else if (j < 2*kScalers+4*kHV+4*kLV+4*kCFD+kTRM+kDRM+7*kAtten)
571 {
572 aliasEntr[j] = aliasArr->GetEntries();
573 for(Int_t l=0; l<aliasEntr[j]; l++)
574 {
2cc08a41 575 AliDCSValue *aValue=static_cast<AliDCSValue*> (aliasArr->At(l));
d99eeddf 576 t0TVDCbottom += (Int_t) aValue->GetFloat();
955ef7d2 577 }
d99eeddf 578 fTVDCbottom = ((Int_t) t0TVDCbottom) /((Int_t) aliasEntr[j]);
955ef7d2 579 }
580 else
581 {
582 aliasEntr[j] = aliasArr->GetEntries();
583 for(Int_t l=0; l<aliasEntr[j]; l++)
584 {
2cc08a41 585 AliDCSValue *aValue=static_cast<AliDCSValue*> (aliasArr->At(l));
d99eeddf 586 t0MPDmode += (Int_t) aValue->GetFloat();
955ef7d2 587 }
d99eeddf 588 fMPDmode = ((Int_t) t0MPDmode)/((Int_t) aliasEntr[j]);
955ef7d2 589 }
19fb06bd 590 }
dc7ca31d 591 fIsProcessed=kTRUE;
9dcc11e4 592 return kTRUE;
dc7ca31d 593}
594
595//---------------------------------------------------------------
d99eeddf 596void AliT0DataDCS::Init()
597{
598 // initialize all DP aliases
599
600 TString sindex;
601 for(int i=0;i<kNAliases;i++)
602 {
603 if (i<kScalers)
604 {
605 fAliasNames[i] = "t00_ac_scaler_";
606 sindex.Form("%02d",i);
607 fAliasNames[i] += sindex;
608 }
609 else if (i < 2*kScalers)
610 {
611 fAliasNames[i] = "t00_ac_scaler_sec_";
612 sindex.Form("%02d",i-kScalers);
613 fAliasNames[i] += sindex;
614 }
615 else if (i < 2*kScalers+kHV)
616 {
617 fAliasNames[i] = "t00_a_hv_imon_";
618 sindex.Form("%02d",i-2*kScalers);
619 fAliasNames[i] += sindex;
620 }
621 else if (i < 2*kScalers+2*kHV)
622 {
623 fAliasNames[i] = "t00_a_hv_vmon_";
624 sindex.Form("%02d",i-(2*kScalers+kHV));
625 fAliasNames[i] += sindex;
626 }
627 else if (i < 2*kScalers+2*kHV+kLV)
628 {
629 fAliasNames[i] = "t00_a_lv_imon_";
630 sindex.Form("%01d",i-(2*kScalers+2*kHV));
631 fAliasNames[i] += sindex;
632 }
633 else if (i < 2*kScalers+2*kHV+2*kLV)
634 {
635 fAliasNames[i] = "t00_a_lv_vmon_";
636 sindex.Form("%01d",i-(2*kScalers+2*kHV+kLV));
637 fAliasNames[i] += sindex;
638 }
639 else if (i < 2*kScalers+3*kHV+2*kLV)
640 {
641 fAliasNames[i] = "t00_c_hv_imon_";
642 sindex.Form("%02d",i-(2*kScalers+2*kHV+2*kLV));
643 fAliasNames[i] += sindex;
644 }
645 else if (i < 2*kScalers+4*kHV+2*kLV)
646 {
647 fAliasNames[i] = "t00_c_hv_vmon_";
648 sindex.Form("%02d",i-(2*kScalers+3*kHV+2*kLV));
649 fAliasNames[i] += sindex;
650 }
651 else if (i < 2*kScalers+4*kHV+3*kLV)
652 {
653 fAliasNames[i] = "t00_c_lv_imon_";
654 sindex.Form("%01d",i-(2*kScalers+4*kHV+2*kLV));
655 fAliasNames[i] += sindex;
656 }
657 else if (i < 2*kScalers+4*kHV+4*kLV)
658 {
659 fAliasNames[i] = "t00_c_lv_vmon_";
660 sindex.Form("%01d",i-(2*kScalers+4*kHV+3*kLV));
661 fAliasNames[i] += sindex;
662 }
663 else if (i < 2*kScalers+4*kHV+4*kLV+kCFD)
664 {
665 fAliasNames[i] = "t00_a_cfd_thre_";
666 sindex.Form("%02d",i-(2*kScalers+4*kHV+4*kLV));
667 fAliasNames[i] += sindex;
668 }
669 else if (i < 2*kScalers+4*kHV+4*kLV+2*kCFD)
670 {
671 fAliasNames[i] = "t00_a_cfd_walk_";
672 sindex.Form("%02d",i-(2*kScalers+4*kHV+4*kLV+kCFD));
673 fAliasNames[i] += sindex;
674 }
675 else if (i < 2*kScalers+4*kHV+4*kLV+3*kCFD)
676 {
677 fAliasNames[i] = "t00_c_cfd_thre_";
19fb06bd 678 sindex.Form("%02d",i-(2*kScalers+4*kHV+4*kLV+2*kCFD));
8eb4ac75 679 fAliasNames[i] += sindex;
d99eeddf 680 }
681 else if (i < 2*kScalers+4*kHV+4*kLV+4*kCFD)
8eb4ac75 682 {
683 fAliasNames[i] = "t00_c_cfd_walk_";
19fb06bd 684 sindex.Form("%02d",i-(2*kScalers+4*kHV+4*kLV+3*kCFD));
8eb4ac75 685 fAliasNames[i] += sindex;
686 }
d99eeddf 687 else if (i < 2*kScalers+4*kHV+4*kLV+4*kCFD+kTRM)
688 {
689 fAliasNames[i] = "t00_ac_trm_";
690 sindex.Form("%02d",i-(2*kScalers+4*kHV+4*kLV+4*kCFD));
691 fAliasNames[i] += sindex;
692 }
693 else if (i < 2*kScalers+4*kHV+4*kLV+4*kCFD+kTRM+kDRM)
694 {
695 fAliasNames[i] = "t00_ac_drm_";
696 sindex.Form("%02d",i-(2*kScalers+4*kHV+4*kLV+4*kCFD+kTRM));
697 fAliasNames[i] += sindex;
698 }
699 else if (i < 2*kScalers+4*kHV+4*kLV+4*kCFD+kTRM+kDRM+kAtten)
700 {
701 fAliasNames[i] = "t00_ac_atten";
702 }
703 else if (i < 2*kScalers+4*kHV+4*kLV+4*kCFD+kTRM+kDRM+2*kAtten)
704 {
705 fAliasNames[i] = "t00_a_mpd_cent";
706 }
707 else if (i < 2*kScalers+4*kHV+4*kLV+4*kCFD+kTRM+kDRM+3*kAtten)
708 {
709 fAliasNames[i] = "t00_c_mpd_cent";
710 }
711 else if (i < 2*kScalers+4*kHV+4*kLV+4*kCFD+kTRM+kDRM+4*kAtten)
712 {
713 fAliasNames[i] = "t00_a_mpd_scent";
955ef7d2 714 }
d99eeddf 715 else if (i < 2*kScalers+4*kHV+4*kLV+4*kCFD+kTRM+kDRM+5*kAtten)
716 {
717 fAliasNames[i] = "t00_c_mpd_scent";
718 }
719 else if (i < 2*kScalers+4*kHV+4*kLV+4*kCFD+kTRM+kDRM+6*kAtten)
720 {
721 fAliasNames[i] = "t00_ac_tvdc_top";
722 }
723 else if (i < 2*kScalers+4*kHV+4*kLV+4*kCFD+kTRM+kDRM+7*kAtten)
724 {
725 fAliasNames[i] = "t00_ac_tvdc_bottom";
dc7ca31d 726 }
d99eeddf 727 else
728 {
729 fAliasNames[i] = "t00_ac_mpd_mode";
730 }
731 }
dc7ca31d 732
dc7ca31d 733}
734
735//---------------------------------------------------------------
8eb4ac75 736void AliT0DataDCS::Introduce(UInt_t numAlias, const TObjArray* aliasArr)const
737{
dc7ca31d 738
739 int entries=aliasArr->GetEntries();
740 AliInfo(Form("************ Alias: %s **********",fAliasNames[numAlias].Data()));
741 AliInfo(Form(" %d DP values collected",entries));
742
743}
744
dc7ca31d 745
5bdebf6a 746//---------------------------------------------------------------
747void AliT0DataDCS::PrintfArray(const char *label, const Float_t *array, Int_t numElements) const
748{
d99eeddf 749 //print all elements of array
5bdebf6a 750 printf("%s: \n",label);
751 for(Int_t i=0;i<numElements;i++){
752 printf(" %.2f", array[i]);
753 }
754 printf("\n");
755}
756//---------------------------------------------------------------
757
758void AliT0DataDCS::PrintT0Data() const
759{
d99eeddf 760 //print DP values
761
5bdebf6a 762 printf("AliT0DataDCS::Print()\n");
763 printf("RUN: %d\n", fRun);
764 printf("START TIME: %d\n", fStartTime);
765 printf("END TIME: %d\n", fEndTime);
766 printf("StartTimeDCSQuery: %d\n", fStartTimeDCSQuery);
767 printf("EndTimeDCSQuery: %d\n", fEndTimeDCSQuery);
768
769 PrintfArray("HV A side current", fHViA, kHV);
770 PrintfArray("HV A side voltage", fHVvA, kHV);
771 PrintfArray("LV A side current", fLViA, kLV);
772 PrintfArray("LV A side voltage", fLVvA, kLV);
773 PrintfArray("HV C side current", fHViC, kHV);
774 PrintfArray("HV C side voltage", fHVvC, kHV);
775 PrintfArray("LV C side current", fLViC, kLV);
776 PrintfArray("LV C side voltage", fLVvC, kLV);
777
778 PrintfArray("CFD threshold A side", fCFDtA, kCFD);
779 PrintfArray("CFD walk A side", fCFDwA, kCFD);
780 PrintfArray("CFD threshold C side", fCFDtC, kCFD);
781 PrintfArray("CFD walk C side", fCFDwC, kCFD);
782
783 //PrintfArray("SCALERS", (Float_t*) fScalerMean, kScalers);
784 printf("SCALERS: \n");
785 for(Int_t i=0;i<kScalers;i++){
786 printf(" %d", fScalerMean[i]);
787 }
788 printf("\n");
789
790
791 // PrintfArray("SCALERS per second",(Float_t*) fScalerSecMean, kScalers);
792 printf("SCALERS per second: \n");
793 for(Int_t i=0;i<kScalers;i++){
794 printf(" %d", fScalerSecMean[i]);
795 }
796 printf("\n");
797
798
799
800
801 PrintfArray("TRM", fTRM, kTRM);
802 PrintfArray("DRM", fDRM, kDRM);
803
804 printf("Laser Amplitude: %f\n", fAtten);
805 printf("mult. discrim. central A side: %d\n", fMPDcentA);
806 printf("mult. discrim. central C side: %d\n", fMPDcentC);
807 printf("mult. discrim. semi-central A side: %d\n", fMPDsemiCentA);
808 printf("mult. discrim. semi-central C side: %d\n", fMPDsemiCentC);
809
810 printf("TVDC top: %d\n", fTVDCtop);
811 printf("TVDC bottom: %d\n", fTVDCbottom);
812 printf("MPDmode: %d\n", fMPDmode);
813}
814
91366e58 815