Masking of not calibrated chambers
[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
57b90263 237 if (this == &data)
238 return *this;
239 AliT0DataDCS::operator=(data);
240
8eb4ac75 241 this->fRun=data.fRun;
242 this->fStartTime=data.fStartTime;
243 this->fEndTime=data.fEndTime;
244 this->fStartTimeDCSQuery=data.fStartTimeDCSQuery;
245 this->fEndTimeDCSQuery=data.fEndTimeDCSQuery;
246
247 for(int i=0;i<kNAliases;i++)
248 {
249 this->fAliasNames[i]=data.fAliasNames[i];
250 }
251
252 return *this;
253}
254
255//---------------------------------------------------------------
256AliT0DataDCS::~AliT0DataDCS()
257{
dc7ca31d 258}
259
260//---------------------------------------------------------------
91366e58 261Bool_t AliT0DataDCS::ProcessData(TMap& aliasMap)
262{
d99eeddf 263 //process DCS data
264
265 UInt_t t0Scaler[kScalers];
266 UInt_t t0ScalerSec[kScalers];
8eb4ac75 267 Int_t aliasEntr[kNAliases];
d99eeddf 268 Float_t t0AhvImon[kHV];
269 Float_t t0AHVvmon[kHV];
270 Float_t t0AlvImon[kLV];
271 Float_t t0AlvVmon[kLV];
272 Float_t t0ChvImon[kHV];
273 Float_t t0ChvVmon[kHV];
274 Float_t t0ClvImon[kLV];
275 Float_t t0ClvVmon[kLV];
276 Float_t t0AcfdThre[kCFD];
277 Float_t t0AcfdWalk[kCFD];
278 Float_t t0CcfdThre[kCFD];
279 Float_t t0CcfdWalk[kCFD];
280 Float_t t0ACtrm[kTRM];
281 Float_t t0ACdrm[kDRM];
282 Float_t t0atten=0.;
283 Int_t t0MPDcentA=0;
284 Int_t t0MPDcentC=0;
285 Int_t t0MPDsemiCentA=0;
286 Int_t t0MPDsemiCentC=0;
287 Int_t t0TVDCtop=0;
288 Int_t t0TVDCbottom=0;
289 Int_t t0MPDmode=0;
955ef7d2 290
970bb0d0 291 TObjArray *aliasArr;
8eb4ac75 292 for(Int_t k=0; k<kScalers; k++)
293 {
d99eeddf 294 t0Scaler[k]=0;
295 t0ScalerSec[k]=0;
8eb4ac75 296 }
297
298 for(Int_t k=0; k<kHV; k++)
299 {
d99eeddf 300 t0AhvImon[k]=0.;
301 t0AHVvmon[k]=0.;
302 t0ChvImon[k]=0.;
303 t0ChvVmon[k]=0.;
8eb4ac75 304 }
882ad8b4 305 for(Int_t k=0; k<kLV; k++)
8eb4ac75 306 {
d99eeddf 307 t0AlvImon[k]=0.;
308 t0AlvVmon[k]=0.;
309 t0ClvImon[k]=0.;
310 t0ClvVmon[k]=0.;
8eb4ac75 311 }
312 for(Int_t k=0; k<kCFD; k++)
313 {
d99eeddf 314 t0AcfdThre[k]=0.;
315 t0AcfdWalk[k]=0.;
316 t0CcfdThre[k]=0.;
317 t0CcfdWalk[k]=0.;
8eb4ac75 318 }
319 for(Int_t k=0; k<kTRM; k++)
320 {
d99eeddf 321 t0ACtrm[k]=0.;
8eb4ac75 322 }
323 for(Int_t k=0; k<kDRM; k++)
324 {
d99eeddf 325 t0ACdrm[k]=0.;
8eb4ac75 326 }
327
5bdebf6a 328 // here starts the main loop
8eb4ac75 329 for(Int_t j=0; j<kNAliases; j++)
970bb0d0 330 {
8eb4ac75 331 aliasEntr[j]=0;
9dcc11e4 332 for (Int_t k=0;k<32;k++)
333 {
d99eeddf 334 t0Scaler[k]=0;
335 t0ScalerSec[k]=0;
8eb4ac75 336
9dcc11e4 337 }
338 aliasArr = (TObjArray*) aliasMap.GetValue(fAliasNames[j].Data());
5bdebf6a 339
970bb0d0 340 if(!aliasArr)
341 {
342 AliError(Form("Alias %s not found!", fAliasNames[j].Data()));
91366e58 343 continue;
970bb0d0 344 }
8eb4ac75 345 Introduce(j, aliasArr);
970bb0d0 346 if(aliasArr->GetEntries()<2)
347 {
348 AliError(Form("Alias %s has just %d entries!",
349 fAliasNames[j].Data(),aliasArr->GetEntries()));
350 continue;
351 }
8eb4ac75 352 if (j < kScalers)
353 {
354 aliasEntr[j] = aliasArr->GetEntries();
355 for(Int_t l=0; l<aliasEntr[j]; l++)
356 {
2cc08a41 357 AliDCSValue *aValue=static_cast<AliDCSValue*> (aliasArr->At(l));
d99eeddf 358 t0Scaler[j]+= (UInt_t) aValue->GetFloat();
8eb4ac75 359 }
d99eeddf 360 fScalerMean[j] = ((UInt_t) t0Scaler[j])/((UInt_t) aliasEntr[j]);
8eb4ac75 361 }
362 else if (j < 2*kScalers)
970bb0d0 363 {
8eb4ac75 364 aliasEntr[j] = aliasArr->GetEntries();
365 for(Int_t l=0; l<aliasEntr[j]; l++)
366 {
2cc08a41 367 AliDCSValue *aValue=static_cast<AliDCSValue*> (aliasArr->At(l));
d99eeddf 368 t0ScalerSec[j-kScalers]+= (UInt_t) aValue->GetFloat();
8eb4ac75 369 }
d99eeddf 370 fScalerSecMean[j-kScalers] = ((UInt_t) t0ScalerSec[j-kScalers])/((UInt_t) aliasEntr[j]);
8eb4ac75 371 }
372 else if (j < 2*kScalers+kHV)
373 {
374 aliasEntr[j] = aliasArr->GetEntries();
375 for(Int_t l=0; l<aliasEntr[j]; l++)
376 {
2cc08a41 377 AliDCSValue *aValue=static_cast<AliDCSValue*> (aliasArr->At(l));
d99eeddf 378 t0AhvImon[j-2*kScalers]+= aValue->GetFloat();
8eb4ac75 379 }
d99eeddf 380 fHViA[j-2*kScalers] = t0AhvImon[j-2*kScalers] / aliasEntr[j];
8eb4ac75 381 }
382 else if (j < 2*kScalers+2*kHV)
383 {
384 aliasEntr[j] = aliasArr->GetEntries();
385 for(Int_t l=0; l<aliasEntr[j]; l++)
386 {
2cc08a41 387 AliDCSValue *aValue=static_cast<AliDCSValue*> (aliasArr->At(l));
d99eeddf 388 t0AHVvmon[j-(2*kScalers+kHV)]+= aValue->GetFloat();
8eb4ac75 389 }
d99eeddf 390 fHVvA[j-(2*kScalers+kHV)] = t0AHVvmon[j-(2*kScalers+kHV)] / aliasEntr[j];
8eb4ac75 391 }
392 else if (j < 2*kScalers+2*kHV+kLV)
393 {
394 aliasEntr[j] = aliasArr->GetEntries();
395 for(Int_t l=0; l<aliasEntr[j]; l++)
396 {
2cc08a41 397 AliDCSValue *aValue=static_cast<AliDCSValue*> (aliasArr->At(l));
d99eeddf 398 t0AlvImon[j-(2*kScalers+2*kHV)]+= aValue->GetFloat();
8eb4ac75 399 }
d99eeddf 400 fLViA[j-(2*kScalers+2*kHV)] = t0AlvImon[j-(2*kScalers+2*kHV)] / aliasEntr[j];
8eb4ac75 401 }
402 else if (j < 2*kScalers+2*kHV+2*kLV)
403 {
404 aliasEntr[j] = aliasArr->GetEntries();
405 for(Int_t l=0; l<aliasEntr[j]; l++)
406 {
2cc08a41 407 AliDCSValue *aValue=static_cast<AliDCSValue*> (aliasArr->At(l));
d99eeddf 408 t0AlvVmon[j-(2*kScalers+2*kHV+kLV)]+= aValue->GetFloat();
8eb4ac75 409 }
d99eeddf 410 fLVvA[j-(2*kScalers+2*kHV+kLV)] = t0AlvVmon[j-(2*kScalers+2*kHV+kLV)] / aliasEntr[j];
8eb4ac75 411 }
412 else if (j < 2*kScalers+3*kHV+2*kLV)
413 {
414 aliasEntr[j] = aliasArr->GetEntries();
415 for(Int_t l=0; l<aliasEntr[j]; l++)
416 {
2cc08a41 417 AliDCSValue *aValue=static_cast<AliDCSValue*> (aliasArr->At(l));
d99eeddf 418 t0ChvImon[j-(2*kScalers+2*kHV+2*kLV)]+= aValue->GetFloat();
8eb4ac75 419 }
d99eeddf 420 fHViC[j-(2*kScalers+2*kHV+2*kLV)] = t0ChvImon[j-(2*kScalers+2*kHV+2*kLV)] / aliasEntr[j];
8eb4ac75 421 }
422 else if (j < 2*kScalers+4*kHV+2*kLV)
423 {
424 aliasEntr[j] = aliasArr->GetEntries();
425 for(Int_t l=0; l<aliasEntr[j]; l++)
426 {
2cc08a41 427 AliDCSValue *aValue=static_cast<AliDCSValue*> (aliasArr->At(l));
d99eeddf 428 t0ChvVmon[j-(2*kScalers+3*kHV+2*kLV)]+= aValue->GetFloat();
8eb4ac75 429 }
d99eeddf 430 fHVvC[j-(2*kScalers+3*kHV+2*kLV)] = t0ChvVmon[j-(2*kScalers+3*kHV+2*kLV)] / aliasEntr[j];
8eb4ac75 431 }
432 else if (j < 2*kScalers+4*kHV+3*kLV)
433 {
434 aliasEntr[j] = aliasArr->GetEntries();
435 for(Int_t l=0; l<aliasEntr[j]; l++)
436 {
2cc08a41 437 AliDCSValue *aValue=static_cast<AliDCSValue*> (aliasArr->At(l));
d99eeddf 438 t0ClvImon[j-(2*kScalers+4*kHV+2*kLV)]+= aValue->GetFloat();
8eb4ac75 439 }
d99eeddf 440 fLViC[j-(2*kScalers+4*kHV+2*kLV)] = t0ClvImon[j-(2*kScalers+4*kHV+2*kLV)] / aliasEntr[j];
8eb4ac75 441 }
442 else if (j < 2*kScalers+4*kHV+4*kLV)
443 {
444 aliasEntr[j] = aliasArr->GetEntries();
445 for(Int_t l=0; l<aliasEntr[j]; l++)
446 {
2cc08a41 447 AliDCSValue *aValue=static_cast<AliDCSValue*> (aliasArr->At(l));
d99eeddf 448 t0ClvVmon[j-(2*kScalers+4*kHV+3*kLV)]+= aValue->GetFloat();
8eb4ac75 449 }
d99eeddf 450 fLVvC[j-(2*kScalers+4*kHV+3*kLV)] = t0ClvVmon[j-(2*kScalers+4*kHV+3*kLV)] / aliasEntr[j];
8eb4ac75 451 }
452 else if (j < 2*kScalers+4*kHV+4*kLV+kCFD)
453 {
454 aliasEntr[j] = aliasArr->GetEntries();
455 for(Int_t l=0; l<aliasEntr[j]; l++)
456 {
2cc08a41 457 AliDCSValue *aValue=static_cast<AliDCSValue*> (aliasArr->At(l));
d99eeddf 458 t0AcfdThre[j-(2*kScalers+4*kHV+4*kLV)]+= aValue->GetFloat();
8eb4ac75 459 }
d99eeddf 460 fCFDtA[j-(2*kScalers+4*kHV+4*kLV)] = t0AcfdThre[j-(2*kScalers+4*kHV+4*kLV)] / aliasEntr[j];
8eb4ac75 461 }
462 else if (j < 2*kScalers+4*kHV+4*kLV+2*kCFD)
463 {
464 aliasEntr[j] = aliasArr->GetEntries();
465 for(Int_t l=0; l<aliasEntr[j]; l++)
466 {
2cc08a41 467 AliDCSValue *aValue=static_cast<AliDCSValue*> (aliasArr->At(l));
d99eeddf 468 t0AcfdWalk[j-(2*kScalers+4*kHV+4*kLV+kCFD)]+= aValue->GetFloat();
8eb4ac75 469 }
d99eeddf 470 fCFDwA[j-(2*kScalers+4*kHV+4*kLV+kCFD)] = t0AcfdWalk[j-(2*kScalers+4*kHV+4*kLV+kCFD)] / aliasEntr[j];
8eb4ac75 471 }
472 else if (j < 2*kScalers+4*kHV+4*kLV+3*kCFD)
473 {
474 aliasEntr[j] = aliasArr->GetEntries();
475 for(Int_t l=0; l<aliasEntr[j]; l++)
476 {
2cc08a41 477 AliDCSValue *aValue=static_cast<AliDCSValue*> (aliasArr->At(l));
d99eeddf 478 t0CcfdThre[j-(2*kScalers+4*kHV+4*kLV+2*kCFD)]+= aValue->GetFloat();
8eb4ac75 479 }
d99eeddf 480 fCFDtC[j-(2*kScalers+4*kHV+4*kLV+2*kCFD)] = t0CcfdThre[j-(2*kScalers+4*kHV+4*kLV+2*kCFD)] / aliasEntr[j];
8eb4ac75 481 }
482 else if (j < 2*kScalers+4*kHV+4*kLV+4*kCFD)
483 {
484 aliasEntr[j] = aliasArr->GetEntries();
485 for(Int_t l=0; l<aliasEntr[j]; l++)
486 {
2cc08a41 487 AliDCSValue *aValue=static_cast<AliDCSValue*> (aliasArr->At(l));
d99eeddf 488 t0CcfdWalk[j-(2*kScalers+4*kHV+4*kLV+3*kCFD)]+= aValue->GetFloat();
8eb4ac75 489 }
d99eeddf 490 fCFDwC[j-(2*kScalers+4*kHV+4*kLV+3*kCFD)] = t0CcfdWalk[j-(2*kScalers+4*kHV+4*kLV+3*kCFD)] / aliasEntr[j];
8eb4ac75 491 }
492 else if (j < 2*kScalers+4*kHV+4*kLV+4*kCFD+kTRM)
493 {
494 aliasEntr[j] = aliasArr->GetEntries();
495 for(Int_t l=0; l<aliasEntr[j]; l++)
496 {
2cc08a41 497 AliDCSValue *aValue=static_cast<AliDCSValue*> (aliasArr->At(l));
d99eeddf 498 t0ACtrm[j-(2*kScalers+4*kHV+4*kLV+4*kCFD)]+= aValue->GetFloat();
8eb4ac75 499 }
d99eeddf 500 fTRM[j-(2*kScalers+4*kHV+4*kLV+4*kCFD)] = t0ACtrm[j-(2*kScalers+4*kHV+4*kLV+4*kCFD)] / aliasEntr[j];
8eb4ac75 501 }
502 else if (j < 2*kScalers+4*kHV+4*kLV+4*kCFD+kTRM+kDRM)
503 {
504 aliasEntr[j] = aliasArr->GetEntries();
505 for(Int_t l=0; l<aliasEntr[j]; l++)
506 {
2cc08a41 507 AliDCSValue *aValue=static_cast<AliDCSValue*> (aliasArr->At(l));
d99eeddf 508 t0ACdrm[j-(2*kScalers+4*kHV+4*kLV+4*kCFD+kTRM)]+= aValue->GetFloat();
8eb4ac75 509 }
d99eeddf 510 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 511 }
955ef7d2 512 else if (j < 2*kScalers+4*kHV+4*kLV+4*kCFD+kTRM+kDRM+kAtten)
8eb4ac75 513 {
514 aliasEntr[j] = aliasArr->GetEntries();
515 for(Int_t l=0; l<aliasEntr[j]; l++)
516 {
2cc08a41 517 AliDCSValue *aValue=static_cast<AliDCSValue*> (aliasArr->At(l));
d99eeddf 518 t0atten += aValue->GetFloat();
8eb4ac75 519 }
d99eeddf 520 fAtten = t0atten /((Float_t) aliasEntr[j]);
8eb4ac75 521 }
955ef7d2 522 else if (j < 2*kScalers+4*kHV+4*kLV+4*kCFD+kTRM+kDRM+2*kAtten)
523 {
524 aliasEntr[j] = aliasArr->GetEntries();
525 for(Int_t l=0; l<aliasEntr[j]; l++)
526 {
2cc08a41 527 AliDCSValue *aValue=static_cast<AliDCSValue*> (aliasArr->At(l));
1c8e4bb6 528 t0MPDcentA += Int_t(aValue->GetFloat());
955ef7d2 529 }
1c8e4bb6 530 if(aliasEntr[j]!=0)
531 fMPDcentA = t0MPDcentA / aliasEntr[j];
955ef7d2 532 }
533 else if (j < 2*kScalers+4*kHV+4*kLV+4*kCFD+kTRM+kDRM+3*kAtten)
534 {
535 aliasEntr[j] = aliasArr->GetEntries();
536 for(Int_t l=0; l<aliasEntr[j]; l++)
537 {
2cc08a41 538 AliDCSValue *aValue=static_cast<AliDCSValue*> (aliasArr->At(l));
d99eeddf 539 t0MPDcentC += (Int_t) aValue->GetFloat();
955ef7d2 540 }
d99eeddf 541 fMPDcentC = ((Int_t) t0MPDcentC) /((Int_t) aliasEntr[j]);
955ef7d2 542 }
543 else if (j < 2*kScalers+4*kHV+4*kLV+4*kCFD+kTRM+kDRM+4*kAtten)
544 {
545 aliasEntr[j] = aliasArr->GetEntries();
546 for(Int_t l=0; l<aliasEntr[j]; l++)
547 {
548 AliDCSValue *aValue=dynamic_cast<AliDCSValue*> (aliasArr->At(l));
d99eeddf 549 t0MPDsemiCentA += (Int_t) aValue->GetFloat();
955ef7d2 550 }
d99eeddf 551 fMPDsemiCentA = ((Int_t) t0MPDsemiCentA) /((Int_t) aliasEntr[j]);
955ef7d2 552 }
553 else if (j < 2*kScalers+4*kHV+4*kLV+4*kCFD+kTRM+kDRM+5*kAtten)
554 {
555 aliasEntr[j] = aliasArr->GetEntries();
556 for(Int_t l=0; l<aliasEntr[j]; l++)
557 {
2cc08a41 558 AliDCSValue *aValue=static_cast<AliDCSValue*> (aliasArr->At(l));
d99eeddf 559 t0MPDsemiCentC += (Int_t) aValue->GetFloat();
955ef7d2 560 }
d99eeddf 561 fMPDsemiCentC = ((Int_t) t0MPDsemiCentC)/ ((Int_t) aliasEntr[j]);
955ef7d2 562 }
563 else if (j < 2*kScalers+4*kHV+4*kLV+4*kCFD+kTRM+kDRM+6*kAtten)
564 {
565 aliasEntr[j] = aliasArr->GetEntries();
566 for(Int_t l=0; l<aliasEntr[j]; l++)
567 {
2cc08a41 568 AliDCSValue *aValue=static_cast<AliDCSValue*> (aliasArr->At(l));
d99eeddf 569 t0TVDCtop += (Int_t) aValue->GetFloat();
955ef7d2 570 }
d99eeddf 571 fTVDCtop = ((Int_t) t0TVDCtop)/((Int_t) aliasEntr[j]);
955ef7d2 572 }
573 else if (j < 2*kScalers+4*kHV+4*kLV+4*kCFD+kTRM+kDRM+7*kAtten)
574 {
575 aliasEntr[j] = aliasArr->GetEntries();
576 for(Int_t l=0; l<aliasEntr[j]; l++)
577 {
2cc08a41 578 AliDCSValue *aValue=static_cast<AliDCSValue*> (aliasArr->At(l));
d99eeddf 579 t0TVDCbottom += (Int_t) aValue->GetFloat();
955ef7d2 580 }
d99eeddf 581 fTVDCbottom = ((Int_t) t0TVDCbottom) /((Int_t) aliasEntr[j]);
955ef7d2 582 }
583 else
584 {
585 aliasEntr[j] = aliasArr->GetEntries();
586 for(Int_t l=0; l<aliasEntr[j]; l++)
587 {
2cc08a41 588 AliDCSValue *aValue=static_cast<AliDCSValue*> (aliasArr->At(l));
d99eeddf 589 t0MPDmode += (Int_t) aValue->GetFloat();
955ef7d2 590 }
d99eeddf 591 fMPDmode = ((Int_t) t0MPDmode)/((Int_t) aliasEntr[j]);
955ef7d2 592 }
19fb06bd 593 }
dc7ca31d 594 fIsProcessed=kTRUE;
9dcc11e4 595 return kTRUE;
dc7ca31d 596}
597
598//---------------------------------------------------------------
d99eeddf 599void AliT0DataDCS::Init()
600{
601 // initialize all DP aliases
602
603 TString sindex;
604 for(int i=0;i<kNAliases;i++)
605 {
606 if (i<kScalers)
607 {
608 fAliasNames[i] = "t00_ac_scaler_";
609 sindex.Form("%02d",i);
610 fAliasNames[i] += sindex;
611 }
612 else if (i < 2*kScalers)
613 {
614 fAliasNames[i] = "t00_ac_scaler_sec_";
615 sindex.Form("%02d",i-kScalers);
616 fAliasNames[i] += sindex;
617 }
618 else if (i < 2*kScalers+kHV)
619 {
620 fAliasNames[i] = "t00_a_hv_imon_";
621 sindex.Form("%02d",i-2*kScalers);
622 fAliasNames[i] += sindex;
623 }
624 else if (i < 2*kScalers+2*kHV)
625 {
626 fAliasNames[i] = "t00_a_hv_vmon_";
627 sindex.Form("%02d",i-(2*kScalers+kHV));
628 fAliasNames[i] += sindex;
629 }
630 else if (i < 2*kScalers+2*kHV+kLV)
631 {
632 fAliasNames[i] = "t00_a_lv_imon_";
633 sindex.Form("%01d",i-(2*kScalers+2*kHV));
634 fAliasNames[i] += sindex;
635 }
636 else if (i < 2*kScalers+2*kHV+2*kLV)
637 {
638 fAliasNames[i] = "t00_a_lv_vmon_";
639 sindex.Form("%01d",i-(2*kScalers+2*kHV+kLV));
640 fAliasNames[i] += sindex;
641 }
642 else if (i < 2*kScalers+3*kHV+2*kLV)
643 {
644 fAliasNames[i] = "t00_c_hv_imon_";
645 sindex.Form("%02d",i-(2*kScalers+2*kHV+2*kLV));
646 fAliasNames[i] += sindex;
647 }
648 else if (i < 2*kScalers+4*kHV+2*kLV)
649 {
650 fAliasNames[i] = "t00_c_hv_vmon_";
651 sindex.Form("%02d",i-(2*kScalers+3*kHV+2*kLV));
652 fAliasNames[i] += sindex;
653 }
654 else if (i < 2*kScalers+4*kHV+3*kLV)
655 {
656 fAliasNames[i] = "t00_c_lv_imon_";
657 sindex.Form("%01d",i-(2*kScalers+4*kHV+2*kLV));
658 fAliasNames[i] += sindex;
659 }
660 else if (i < 2*kScalers+4*kHV+4*kLV)
661 {
662 fAliasNames[i] = "t00_c_lv_vmon_";
663 sindex.Form("%01d",i-(2*kScalers+4*kHV+3*kLV));
664 fAliasNames[i] += sindex;
665 }
666 else if (i < 2*kScalers+4*kHV+4*kLV+kCFD)
667 {
668 fAliasNames[i] = "t00_a_cfd_thre_";
669 sindex.Form("%02d",i-(2*kScalers+4*kHV+4*kLV));
670 fAliasNames[i] += sindex;
671 }
672 else if (i < 2*kScalers+4*kHV+4*kLV+2*kCFD)
673 {
674 fAliasNames[i] = "t00_a_cfd_walk_";
675 sindex.Form("%02d",i-(2*kScalers+4*kHV+4*kLV+kCFD));
676 fAliasNames[i] += sindex;
677 }
678 else if (i < 2*kScalers+4*kHV+4*kLV+3*kCFD)
679 {
680 fAliasNames[i] = "t00_c_cfd_thre_";
19fb06bd 681 sindex.Form("%02d",i-(2*kScalers+4*kHV+4*kLV+2*kCFD));
8eb4ac75 682 fAliasNames[i] += sindex;
d99eeddf 683 }
684 else if (i < 2*kScalers+4*kHV+4*kLV+4*kCFD)
8eb4ac75 685 {
686 fAliasNames[i] = "t00_c_cfd_walk_";
19fb06bd 687 sindex.Form("%02d",i-(2*kScalers+4*kHV+4*kLV+3*kCFD));
8eb4ac75 688 fAliasNames[i] += sindex;
689 }
d99eeddf 690 else if (i < 2*kScalers+4*kHV+4*kLV+4*kCFD+kTRM)
691 {
692 fAliasNames[i] = "t00_ac_trm_";
693 sindex.Form("%02d",i-(2*kScalers+4*kHV+4*kLV+4*kCFD));
694 fAliasNames[i] += sindex;
695 }
696 else if (i < 2*kScalers+4*kHV+4*kLV+4*kCFD+kTRM+kDRM)
697 {
698 fAliasNames[i] = "t00_ac_drm_";
699 sindex.Form("%02d",i-(2*kScalers+4*kHV+4*kLV+4*kCFD+kTRM));
700 fAliasNames[i] += sindex;
701 }
702 else if (i < 2*kScalers+4*kHV+4*kLV+4*kCFD+kTRM+kDRM+kAtten)
703 {
704 fAliasNames[i] = "t00_ac_atten";
705 }
706 else if (i < 2*kScalers+4*kHV+4*kLV+4*kCFD+kTRM+kDRM+2*kAtten)
707 {
708 fAliasNames[i] = "t00_a_mpd_cent";
709 }
710 else if (i < 2*kScalers+4*kHV+4*kLV+4*kCFD+kTRM+kDRM+3*kAtten)
711 {
712 fAliasNames[i] = "t00_c_mpd_cent";
713 }
714 else if (i < 2*kScalers+4*kHV+4*kLV+4*kCFD+kTRM+kDRM+4*kAtten)
715 {
716 fAliasNames[i] = "t00_a_mpd_scent";
955ef7d2 717 }
d99eeddf 718 else if (i < 2*kScalers+4*kHV+4*kLV+4*kCFD+kTRM+kDRM+5*kAtten)
719 {
720 fAliasNames[i] = "t00_c_mpd_scent";
721 }
722 else if (i < 2*kScalers+4*kHV+4*kLV+4*kCFD+kTRM+kDRM+6*kAtten)
723 {
724 fAliasNames[i] = "t00_ac_tvdc_top";
725 }
726 else if (i < 2*kScalers+4*kHV+4*kLV+4*kCFD+kTRM+kDRM+7*kAtten)
727 {
728 fAliasNames[i] = "t00_ac_tvdc_bottom";
dc7ca31d 729 }
d99eeddf 730 else
731 {
732 fAliasNames[i] = "t00_ac_mpd_mode";
733 }
734 }
dc7ca31d 735
dc7ca31d 736}
737
738//---------------------------------------------------------------
8eb4ac75 739void AliT0DataDCS::Introduce(UInt_t numAlias, const TObjArray* aliasArr)const
740{
dc7ca31d 741
742 int entries=aliasArr->GetEntries();
743 AliInfo(Form("************ Alias: %s **********",fAliasNames[numAlias].Data()));
744 AliInfo(Form(" %d DP values collected",entries));
745
746}
747
dc7ca31d 748
5bdebf6a 749//---------------------------------------------------------------
750void AliT0DataDCS::PrintfArray(const char *label, const Float_t *array, Int_t numElements) const
751{
d99eeddf 752 //print all elements of array
5bdebf6a 753 printf("%s: \n",label);
754 for(Int_t i=0;i<numElements;i++){
755 printf(" %.2f", array[i]);
756 }
757 printf("\n");
758}
759//---------------------------------------------------------------
760
761void AliT0DataDCS::PrintT0Data() const
762{
d99eeddf 763 //print DP values
764
5bdebf6a 765 printf("AliT0DataDCS::Print()\n");
766 printf("RUN: %d\n", fRun);
767 printf("START TIME: %d\n", fStartTime);
768 printf("END TIME: %d\n", fEndTime);
769 printf("StartTimeDCSQuery: %d\n", fStartTimeDCSQuery);
770 printf("EndTimeDCSQuery: %d\n", fEndTimeDCSQuery);
771
772 PrintfArray("HV A side current", fHViA, kHV);
773 PrintfArray("HV A side voltage", fHVvA, kHV);
774 PrintfArray("LV A side current", fLViA, kLV);
775 PrintfArray("LV A side voltage", fLVvA, kLV);
776 PrintfArray("HV C side current", fHViC, kHV);
777 PrintfArray("HV C side voltage", fHVvC, kHV);
778 PrintfArray("LV C side current", fLViC, kLV);
779 PrintfArray("LV C side voltage", fLVvC, kLV);
780
781 PrintfArray("CFD threshold A side", fCFDtA, kCFD);
782 PrintfArray("CFD walk A side", fCFDwA, kCFD);
783 PrintfArray("CFD threshold C side", fCFDtC, kCFD);
784 PrintfArray("CFD walk C side", fCFDwC, kCFD);
785
786 //PrintfArray("SCALERS", (Float_t*) fScalerMean, kScalers);
787 printf("SCALERS: \n");
788 for(Int_t i=0;i<kScalers;i++){
789 printf(" %d", fScalerMean[i]);
790 }
791 printf("\n");
792
793
794 // PrintfArray("SCALERS per second",(Float_t*) fScalerSecMean, kScalers);
795 printf("SCALERS per second: \n");
796 for(Int_t i=0;i<kScalers;i++){
797 printf(" %d", fScalerSecMean[i]);
798 }
799 printf("\n");
800
801
802
803
804 PrintfArray("TRM", fTRM, kTRM);
805 PrintfArray("DRM", fDRM, kDRM);
806
807 printf("Laser Amplitude: %f\n", fAtten);
808 printf("mult. discrim. central A side: %d\n", fMPDcentA);
809 printf("mult. discrim. central C side: %d\n", fMPDcentC);
810 printf("mult. discrim. semi-central A side: %d\n", fMPDsemiCentA);
811 printf("mult. discrim. semi-central C side: %d\n", fMPDsemiCentC);
812
813 printf("TVDC top: %d\n", fTVDCtop);
814 printf("TVDC bottom: %d\n", fTVDCbottom);
815 printf("MPDmode: %d\n", fMPDmode);
816}
817
91366e58 818