Bug fix in the order of the Ds cuts (Sadhana, Francesco)
[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 }
dc7ca31d 89
8eb4ac75 90}
dc7ca31d 91//---------------------------------------------------------------
8eb4ac75 92AliT0DataDCS::AliT0DataDCS(Int_t nRun, UInt_t startTime, UInt_t endTime, UInt_t startTimeDCSQuery, UInt_t endTimeDCSQuery):
dc7ca31d 93 TObject(),
94 fRun(nRun),
95 fStartTime(startTime),
96 fEndTime(endTime),
8eb4ac75 97 fStartTimeDCSQuery(startTimeDCSQuery),
98 fEndTimeDCSQuery(endTimeDCSQuery),
99 fAtten(0.),
955ef7d2 100 fMPDcentA(0),
101 fMPDcentC(0),
102 fMPDsemiCentA(0),
103 fMPDsemiCentC(0),
104 fTVDCtop(0),
105 fTVDCbottom(0),
106 fMPDmode(0),
dc7ca31d 107 fIsProcessed(kFALSE)
108{
d99eeddf 109 // constructor
110
8eb4ac75 111 for(Int_t i=0;i<kScalers;i++)
112 {
5bdebf6a 113 fScalerMean[i]=0;
114 fScalerSecMean[i]=0;
8eb4ac75 115 }
116 for(Int_t i=0;i<kHV;i++)
117 {
118 fHViA[i]=0.;
119 fHVvA[i]=0.;
120 fHViC[i]=0.;
121 fHVvC[i]=0.;
122 }
123 for(Int_t i=0;i<kLV;i++)
124 {
125 fLViA[i]=0.;
126 fLVvA[i]=0.;
127 fLViC[i]=0.;
128 fLVvC[i]=0.;
129 }
130 for(Int_t i=0;i<kTRM;i++)
131 {
132 fTRM[i]=0.;
133 }
134 for(Int_t i=0;i<kDRM;i++)
135 {
136 fDRM[i]=0.;
137 }
138
139 AliInfo(Form("\n\tRun %d \n\tStartTime %s \n\tEndTime %s \n\tStartTime DCS Query %s \n\tEndTime DCS Query %s", nRun,
dc7ca31d 140 TTimeStamp(startTime).AsString(),
8eb4ac75 141 TTimeStamp(endTime).AsString(),
142 TTimeStamp(startTimeDCSQuery).AsString(),
143 TTimeStamp(endTimeDCSQuery).AsString()));
dc7ca31d 144
dc7ca31d 145 Init();
146
147}
8eb4ac75 148//---------------------------------------------------------------
149
150AliT0DataDCS::AliT0DataDCS(const AliT0DataDCS & data):
151 TObject(),
152 fRun(0),
153 fStartTime(0),
154 fEndTime(0),
155 fStartTimeDCSQuery(0),
156 fEndTimeDCSQuery(0),
157 fAtten(0.),
955ef7d2 158 fMPDcentA(0),
159 fMPDcentC(0),
160 fMPDsemiCentA(0),
161 fMPDsemiCentC(0),
162 fTVDCtop(0),
163 fTVDCbottom(0),
164 fMPDmode(0),
8eb4ac75 165 fIsProcessed(kFALSE)
166{
167
168// copy constructor
dc7ca31d 169
8eb4ac75 170 fRun=data.fRun;
171 fStartTime=data.fStartTime;
172 fEndTime=data.fEndTime;
173 fStartTimeDCSQuery=data.fStartTimeDCSQuery;
174 fEndTimeDCSQuery=data.fEndTimeDCSQuery;
175 fIsProcessed=data.fIsProcessed;
176 fAtten=data.fAtten;
955ef7d2 177 fMPDcentA=data.fMPDcentA;
178 fMPDcentC=data.fMPDcentC;
179 fMPDsemiCentA=data.fMPDsemiCentA;
180 fMPDsemiCentC=data.fMPDsemiCentC;
181 fTVDCtop=data.fTVDCtop;
182 fTVDCbottom=data.fTVDCbottom;
183 fMPDmode=data.fMPDmode;
8eb4ac75 184 for(int i=0;i<kNAliases;i++)
185 {
186 fAliasNames[i]=data.fAliasNames[i];
187 }
188
189 for(Int_t i=0;i<kScalers;i++)
190 {
191 fScalerMean[i]=data.fScalerMean[i];
192 fScalerSecMean[i]=data.fScalerSecMean[i];
193 }
194 for(Int_t i=0;i<kHV;i++)
195 {
196 fHViA[i]=data.fHViA[i];
197 fHVvA[i]=data.fHVvA[i];
198 fHViC[i]=data.fHViC[i];
199 fHVvC[i]=data.fHVvC[i];
200 }
201 for(Int_t i=0;i<kLV;i++)
202 {
203 fLViA[i]=data.fLViA[i];
204 fLVvA[i]=data.fLVvA[i];
205 fLViC[i]=data.fLViC[i];
206 fLVvC[i]=data.fLVvC[i];
207 }
208 for(Int_t i=0;i<kTRM;i++)
209 {
210 fTRM[i]=data.fTRM[i];
211 }
212 for(Int_t i=0;i<kDRM;i++)
213 {
214 fDRM[i]=data.fDRM[i];
215 }
216}
dc7ca31d 217//---------------------------------------------------------------
dc7ca31d 218
8eb4ac75 219AliT0DataDCS& AliT0DataDCS:: operator=(const AliT0DataDCS & data) {
220
221// assignment operator
222
223 this->fRun=data.fRun;
224 this->fStartTime=data.fStartTime;
225 this->fEndTime=data.fEndTime;
226 this->fStartTimeDCSQuery=data.fStartTimeDCSQuery;
227 this->fEndTimeDCSQuery=data.fEndTimeDCSQuery;
228
229 for(int i=0;i<kNAliases;i++)
230 {
231 this->fAliasNames[i]=data.fAliasNames[i];
232 }
233
234 return *this;
235}
236
237//---------------------------------------------------------------
238AliT0DataDCS::~AliT0DataDCS()
239{
dc7ca31d 240}
241
242//---------------------------------------------------------------
91366e58 243Bool_t AliT0DataDCS::ProcessData(TMap& aliasMap)
244{
d99eeddf 245 //process DCS data
246
247 UInt_t t0Scaler[kScalers];
248 UInt_t t0ScalerSec[kScalers];
8eb4ac75 249 Int_t aliasEntr[kNAliases];
d99eeddf 250 Float_t t0AhvImon[kHV];
251 Float_t t0AHVvmon[kHV];
252 Float_t t0AlvImon[kLV];
253 Float_t t0AlvVmon[kLV];
254 Float_t t0ChvImon[kHV];
255 Float_t t0ChvVmon[kHV];
256 Float_t t0ClvImon[kLV];
257 Float_t t0ClvVmon[kLV];
258 Float_t t0AcfdThre[kCFD];
259 Float_t t0AcfdWalk[kCFD];
260 Float_t t0CcfdThre[kCFD];
261 Float_t t0CcfdWalk[kCFD];
262 Float_t t0ACtrm[kTRM];
263 Float_t t0ACdrm[kDRM];
264 Float_t t0atten=0.;
265 Int_t t0MPDcentA=0;
266 Int_t t0MPDcentC=0;
267 Int_t t0MPDsemiCentA=0;
268 Int_t t0MPDsemiCentC=0;
269 Int_t t0TVDCtop=0;
270 Int_t t0TVDCbottom=0;
271 Int_t t0MPDmode=0;
955ef7d2 272
970bb0d0 273 TObjArray *aliasArr;
8eb4ac75 274 for(Int_t k=0; k<kScalers; k++)
275 {
d99eeddf 276 t0Scaler[k]=0;
277 t0ScalerSec[k]=0;
8eb4ac75 278 }
279
280 for(Int_t k=0; k<kHV; k++)
281 {
d99eeddf 282 t0AhvImon[k]=0.;
283 t0AHVvmon[k]=0.;
284 t0ChvImon[k]=0.;
285 t0ChvVmon[k]=0.;
8eb4ac75 286 }
882ad8b4 287 for(Int_t k=0; k<kLV; k++)
8eb4ac75 288 {
d99eeddf 289 t0AlvImon[k]=0.;
290 t0AlvVmon[k]=0.;
291 t0ClvImon[k]=0.;
292 t0ClvVmon[k]=0.;
8eb4ac75 293 }
294 for(Int_t k=0; k<kCFD; k++)
295 {
d99eeddf 296 t0AcfdThre[k]=0.;
297 t0AcfdWalk[k]=0.;
298 t0CcfdThre[k]=0.;
299 t0CcfdWalk[k]=0.;
8eb4ac75 300 }
301 for(Int_t k=0; k<kTRM; k++)
302 {
d99eeddf 303 t0ACtrm[k]=0.;
8eb4ac75 304 }
305 for(Int_t k=0; k<kDRM; k++)
306 {
d99eeddf 307 t0ACdrm[k]=0.;
8eb4ac75 308 }
309
5bdebf6a 310 // here starts the main loop
8eb4ac75 311 for(Int_t j=0; j<kNAliases; j++)
970bb0d0 312 {
8eb4ac75 313 aliasEntr[j]=0;
9dcc11e4 314 for (Int_t k=0;k<32;k++)
315 {
d99eeddf 316 t0Scaler[k]=0;
317 t0ScalerSec[k]=0;
8eb4ac75 318
9dcc11e4 319 }
320 aliasArr = (TObjArray*) aliasMap.GetValue(fAliasNames[j].Data());
5bdebf6a 321
970bb0d0 322 if(!aliasArr)
323 {
324 AliError(Form("Alias %s not found!", fAliasNames[j].Data()));
91366e58 325 continue;
970bb0d0 326 }
8eb4ac75 327 Introduce(j, aliasArr);
970bb0d0 328 if(aliasArr->GetEntries()<2)
329 {
330 AliError(Form("Alias %s has just %d entries!",
331 fAliasNames[j].Data(),aliasArr->GetEntries()));
332 continue;
333 }
8eb4ac75 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));
d99eeddf 340 t0Scaler[j]+= (UInt_t) aValue->GetFloat();
8eb4ac75 341 }
d99eeddf 342 fScalerMean[j] = ((UInt_t) t0Scaler[j])/((UInt_t) aliasEntr[j]);
8eb4ac75 343 }
344 else if (j < 2*kScalers)
970bb0d0 345 {
8eb4ac75 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));
d99eeddf 350 t0ScalerSec[j-kScalers]+= (UInt_t) aValue->GetFloat();
8eb4ac75 351 }
d99eeddf 352 fScalerSecMean[j-kScalers] = ((UInt_t) t0ScalerSec[j-kScalers])/((UInt_t) aliasEntr[j]);
8eb4ac75 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));
d99eeddf 360 t0AhvImon[j-2*kScalers]+= aValue->GetFloat();
8eb4ac75 361 }
d99eeddf 362 fHViA[j-2*kScalers] = t0AhvImon[j-2*kScalers] / aliasEntr[j];
8eb4ac75 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));
d99eeddf 370 t0AHVvmon[j-(2*kScalers+kHV)]+= aValue->GetFloat();
8eb4ac75 371 }
d99eeddf 372 fHVvA[j-(2*kScalers+kHV)] = t0AHVvmon[j-(2*kScalers+kHV)] / aliasEntr[j];
8eb4ac75 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));
d99eeddf 380 t0AlvImon[j-(2*kScalers+2*kHV)]+= aValue->GetFloat();
8eb4ac75 381 }
d99eeddf 382 fLViA[j-(2*kScalers+2*kHV)] = t0AlvImon[j-(2*kScalers+2*kHV)] / aliasEntr[j];
8eb4ac75 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));
d99eeddf 390 t0AlvVmon[j-(2*kScalers+2*kHV+kLV)]+= aValue->GetFloat();
8eb4ac75 391 }
d99eeddf 392 fLVvA[j-(2*kScalers+2*kHV+kLV)] = t0AlvVmon[j-(2*kScalers+2*kHV+kLV)] / aliasEntr[j];
8eb4ac75 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));
d99eeddf 400 t0ChvImon[j-(2*kScalers+2*kHV+2*kLV)]+= aValue->GetFloat();
8eb4ac75 401 }
d99eeddf 402 fHViC[j-(2*kScalers+2*kHV+2*kLV)] = t0ChvImon[j-(2*kScalers+2*kHV+2*kLV)] / aliasEntr[j];
8eb4ac75 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));
d99eeddf 410 t0ChvVmon[j-(2*kScalers+3*kHV+2*kLV)]+= aValue->GetFloat();
8eb4ac75 411 }
d99eeddf 412 fHVvC[j-(2*kScalers+3*kHV+2*kLV)] = t0ChvVmon[j-(2*kScalers+3*kHV+2*kLV)] / aliasEntr[j];
8eb4ac75 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));
d99eeddf 420 t0ClvImon[j-(2*kScalers+4*kHV+2*kLV)]+= aValue->GetFloat();
8eb4ac75 421 }
d99eeddf 422 fLViC[j-(2*kScalers+4*kHV+2*kLV)] = t0ClvImon[j-(2*kScalers+4*kHV+2*kLV)] / aliasEntr[j];
8eb4ac75 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));
d99eeddf 430 t0ClvVmon[j-(2*kScalers+4*kHV+3*kLV)]+= aValue->GetFloat();
8eb4ac75 431 }
d99eeddf 432 fLVvC[j-(2*kScalers+4*kHV+3*kLV)] = t0ClvVmon[j-(2*kScalers+4*kHV+3*kLV)] / aliasEntr[j];
8eb4ac75 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));
d99eeddf 440 t0AcfdThre[j-(2*kScalers+4*kHV+4*kLV)]+= aValue->GetFloat();
8eb4ac75 441 }
d99eeddf 442 fCFDtA[j-(2*kScalers+4*kHV+4*kLV)] = t0AcfdThre[j-(2*kScalers+4*kHV+4*kLV)] / aliasEntr[j];
8eb4ac75 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));
d99eeddf 450 t0AcfdWalk[j-(2*kScalers+4*kHV+4*kLV+kCFD)]+= aValue->GetFloat();
8eb4ac75 451 }
d99eeddf 452 fCFDwA[j-(2*kScalers+4*kHV+4*kLV+kCFD)] = t0AcfdWalk[j-(2*kScalers+4*kHV+4*kLV+kCFD)] / aliasEntr[j];
8eb4ac75 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));
d99eeddf 460 t0CcfdThre[j-(2*kScalers+4*kHV+4*kLV+2*kCFD)]+= aValue->GetFloat();
8eb4ac75 461 }
d99eeddf 462 fCFDtC[j-(2*kScalers+4*kHV+4*kLV+2*kCFD)] = t0CcfdThre[j-(2*kScalers+4*kHV+4*kLV+2*kCFD)] / aliasEntr[j];
8eb4ac75 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));
d99eeddf 470 t0CcfdWalk[j-(2*kScalers+4*kHV+4*kLV+3*kCFD)]+= aValue->GetFloat();
8eb4ac75 471 }
d99eeddf 472 fCFDwC[j-(2*kScalers+4*kHV+4*kLV+3*kCFD)] = t0CcfdWalk[j-(2*kScalers+4*kHV+4*kLV+3*kCFD)] / aliasEntr[j];
8eb4ac75 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));
d99eeddf 480 t0ACtrm[j-(2*kScalers+4*kHV+4*kLV+4*kCFD)]+= aValue->GetFloat();
8eb4ac75 481 }
d99eeddf 482 fTRM[j-(2*kScalers+4*kHV+4*kLV+4*kCFD)] = t0ACtrm[j-(2*kScalers+4*kHV+4*kLV+4*kCFD)] / aliasEntr[j];
8eb4ac75 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));
d99eeddf 490 t0ACdrm[j-(2*kScalers+4*kHV+4*kLV+4*kCFD+kTRM)]+= aValue->GetFloat();
8eb4ac75 491 }
d99eeddf 492 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 493 }
955ef7d2 494 else if (j < 2*kScalers+4*kHV+4*kLV+4*kCFD+kTRM+kDRM+kAtten)
8eb4ac75 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));
d99eeddf 500 t0atten += aValue->GetFloat();
8eb4ac75 501 }
d99eeddf 502 fAtten = t0atten /((Float_t) aliasEntr[j]);
8eb4ac75 503 }
955ef7d2 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));
d99eeddf 510 t0MPDcentA += aValue->GetFloat();
955ef7d2 511 }
d99eeddf 512 fMPDcentA = t0MPDcentA /((Float_t) aliasEntr[j]);
955ef7d2 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));
d99eeddf 520 t0MPDcentC += (Int_t) aValue->GetFloat();
955ef7d2 521 }
d99eeddf 522 fMPDcentC = ((Int_t) t0MPDcentC) /((Int_t) aliasEntr[j]);
955ef7d2 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));
d99eeddf 530 t0MPDsemiCentA += (Int_t) aValue->GetFloat();
955ef7d2 531 }
d99eeddf 532 fMPDsemiCentA = ((Int_t) t0MPDsemiCentA) /((Int_t) aliasEntr[j]);
955ef7d2 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));
d99eeddf 540 t0MPDsemiCentC += (Int_t) aValue->GetFloat();
955ef7d2 541 }
d99eeddf 542 fMPDsemiCentC = ((Int_t) t0MPDsemiCentC)/ ((Int_t) aliasEntr[j]);
955ef7d2 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));
d99eeddf 550 t0TVDCtop += (Int_t) aValue->GetFloat();
955ef7d2 551 }
d99eeddf 552 fTVDCtop = ((Int_t) t0TVDCtop)/((Int_t) aliasEntr[j]);
955ef7d2 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));
d99eeddf 560 t0TVDCbottom += (Int_t) aValue->GetFloat();
955ef7d2 561 }
d99eeddf 562 fTVDCbottom = ((Int_t) t0TVDCbottom) /((Int_t) aliasEntr[j]);
955ef7d2 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));
d99eeddf 570 t0MPDmode += (Int_t) aValue->GetFloat();
955ef7d2 571 }
d99eeddf 572 fMPDmode = ((Int_t) t0MPDmode)/((Int_t) aliasEntr[j]);
955ef7d2 573 }
19fb06bd 574 }
dc7ca31d 575 fIsProcessed=kTRUE;
9dcc11e4 576 return kTRUE;
dc7ca31d 577}
578
579//---------------------------------------------------------------
d99eeddf 580void AliT0DataDCS::Init()
581{
582 // initialize all DP aliases
583
584 TString sindex;
585 for(int i=0;i<kNAliases;i++)
586 {
587 if (i<kScalers)
588 {
589 fAliasNames[i] = "t00_ac_scaler_";
590 sindex.Form("%02d",i);
591 fAliasNames[i] += sindex;
592 }
593 else if (i < 2*kScalers)
594 {
595 fAliasNames[i] = "t00_ac_scaler_sec_";
596 sindex.Form("%02d",i-kScalers);
597 fAliasNames[i] += sindex;
598 }
599 else if (i < 2*kScalers+kHV)
600 {
601 fAliasNames[i] = "t00_a_hv_imon_";
602 sindex.Form("%02d",i-2*kScalers);
603 fAliasNames[i] += sindex;
604 }
605 else if (i < 2*kScalers+2*kHV)
606 {
607 fAliasNames[i] = "t00_a_hv_vmon_";
608 sindex.Form("%02d",i-(2*kScalers+kHV));
609 fAliasNames[i] += sindex;
610 }
611 else if (i < 2*kScalers+2*kHV+kLV)
612 {
613 fAliasNames[i] = "t00_a_lv_imon_";
614 sindex.Form("%01d",i-(2*kScalers+2*kHV));
615 fAliasNames[i] += sindex;
616 }
617 else if (i < 2*kScalers+2*kHV+2*kLV)
618 {
619 fAliasNames[i] = "t00_a_lv_vmon_";
620 sindex.Form("%01d",i-(2*kScalers+2*kHV+kLV));
621 fAliasNames[i] += sindex;
622 }
623 else if (i < 2*kScalers+3*kHV+2*kLV)
624 {
625 fAliasNames[i] = "t00_c_hv_imon_";
626 sindex.Form("%02d",i-(2*kScalers+2*kHV+2*kLV));
627 fAliasNames[i] += sindex;
628 }
629 else if (i < 2*kScalers+4*kHV+2*kLV)
630 {
631 fAliasNames[i] = "t00_c_hv_vmon_";
632 sindex.Form("%02d",i-(2*kScalers+3*kHV+2*kLV));
633 fAliasNames[i] += sindex;
634 }
635 else if (i < 2*kScalers+4*kHV+3*kLV)
636 {
637 fAliasNames[i] = "t00_c_lv_imon_";
638 sindex.Form("%01d",i-(2*kScalers+4*kHV+2*kLV));
639 fAliasNames[i] += sindex;
640 }
641 else if (i < 2*kScalers+4*kHV+4*kLV)
642 {
643 fAliasNames[i] = "t00_c_lv_vmon_";
644 sindex.Form("%01d",i-(2*kScalers+4*kHV+3*kLV));
645 fAliasNames[i] += sindex;
646 }
647 else if (i < 2*kScalers+4*kHV+4*kLV+kCFD)
648 {
649 fAliasNames[i] = "t00_a_cfd_thre_";
650 sindex.Form("%02d",i-(2*kScalers+4*kHV+4*kLV));
651 fAliasNames[i] += sindex;
652 }
653 else if (i < 2*kScalers+4*kHV+4*kLV+2*kCFD)
654 {
655 fAliasNames[i] = "t00_a_cfd_walk_";
656 sindex.Form("%02d",i-(2*kScalers+4*kHV+4*kLV+kCFD));
657 fAliasNames[i] += sindex;
658 }
659 else if (i < 2*kScalers+4*kHV+4*kLV+3*kCFD)
660 {
661 fAliasNames[i] = "t00_c_cfd_thre_";
19fb06bd 662 sindex.Form("%02d",i-(2*kScalers+4*kHV+4*kLV+2*kCFD));
8eb4ac75 663 fAliasNames[i] += sindex;
d99eeddf 664 }
665 else if (i < 2*kScalers+4*kHV+4*kLV+4*kCFD)
8eb4ac75 666 {
667 fAliasNames[i] = "t00_c_cfd_walk_";
19fb06bd 668 sindex.Form("%02d",i-(2*kScalers+4*kHV+4*kLV+3*kCFD));
8eb4ac75 669 fAliasNames[i] += sindex;
670 }
d99eeddf 671 else if (i < 2*kScalers+4*kHV+4*kLV+4*kCFD+kTRM)
672 {
673 fAliasNames[i] = "t00_ac_trm_";
674 sindex.Form("%02d",i-(2*kScalers+4*kHV+4*kLV+4*kCFD));
675 fAliasNames[i] += sindex;
676 }
677 else if (i < 2*kScalers+4*kHV+4*kLV+4*kCFD+kTRM+kDRM)
678 {
679 fAliasNames[i] = "t00_ac_drm_";
680 sindex.Form("%02d",i-(2*kScalers+4*kHV+4*kLV+4*kCFD+kTRM));
681 fAliasNames[i] += sindex;
682 }
683 else if (i < 2*kScalers+4*kHV+4*kLV+4*kCFD+kTRM+kDRM+kAtten)
684 {
685 fAliasNames[i] = "t00_ac_atten";
686 }
687 else if (i < 2*kScalers+4*kHV+4*kLV+4*kCFD+kTRM+kDRM+2*kAtten)
688 {
689 fAliasNames[i] = "t00_a_mpd_cent";
690 }
691 else if (i < 2*kScalers+4*kHV+4*kLV+4*kCFD+kTRM+kDRM+3*kAtten)
692 {
693 fAliasNames[i] = "t00_c_mpd_cent";
694 }
695 else if (i < 2*kScalers+4*kHV+4*kLV+4*kCFD+kTRM+kDRM+4*kAtten)
696 {
697 fAliasNames[i] = "t00_a_mpd_scent";
955ef7d2 698 }
d99eeddf 699 else if (i < 2*kScalers+4*kHV+4*kLV+4*kCFD+kTRM+kDRM+5*kAtten)
700 {
701 fAliasNames[i] = "t00_c_mpd_scent";
702 }
703 else if (i < 2*kScalers+4*kHV+4*kLV+4*kCFD+kTRM+kDRM+6*kAtten)
704 {
705 fAliasNames[i] = "t00_ac_tvdc_top";
706 }
707 else if (i < 2*kScalers+4*kHV+4*kLV+4*kCFD+kTRM+kDRM+7*kAtten)
708 {
709 fAliasNames[i] = "t00_ac_tvdc_bottom";
dc7ca31d 710 }
d99eeddf 711 else
712 {
713 fAliasNames[i] = "t00_ac_mpd_mode";
714 }
715 }
dc7ca31d 716
dc7ca31d 717}
718
719//---------------------------------------------------------------
8eb4ac75 720void AliT0DataDCS::Introduce(UInt_t numAlias, const TObjArray* aliasArr)const
721{
dc7ca31d 722
723 int entries=aliasArr->GetEntries();
724 AliInfo(Form("************ Alias: %s **********",fAliasNames[numAlias].Data()));
725 AliInfo(Form(" %d DP values collected",entries));
726
727}
728
dc7ca31d 729
5bdebf6a 730//---------------------------------------------------------------
731void AliT0DataDCS::PrintfArray(const char *label, const Float_t *array, Int_t numElements) const
732{
d99eeddf 733 //print all elements of array
5bdebf6a 734 printf("%s: \n",label);
735 for(Int_t i=0;i<numElements;i++){
736 printf(" %.2f", array[i]);
737 }
738 printf("\n");
739}
740//---------------------------------------------------------------
741
742void AliT0DataDCS::PrintT0Data() const
743{
d99eeddf 744 //print DP values
745
5bdebf6a 746 printf("AliT0DataDCS::Print()\n");
747 printf("RUN: %d\n", fRun);
748 printf("START TIME: %d\n", fStartTime);
749 printf("END TIME: %d\n", fEndTime);
750 printf("StartTimeDCSQuery: %d\n", fStartTimeDCSQuery);
751 printf("EndTimeDCSQuery: %d\n", fEndTimeDCSQuery);
752
753 PrintfArray("HV A side current", fHViA, kHV);
754 PrintfArray("HV A side voltage", fHVvA, kHV);
755 PrintfArray("LV A side current", fLViA, kLV);
756 PrintfArray("LV A side voltage", fLVvA, kLV);
757 PrintfArray("HV C side current", fHViC, kHV);
758 PrintfArray("HV C side voltage", fHVvC, kHV);
759 PrintfArray("LV C side current", fLViC, kLV);
760 PrintfArray("LV C side voltage", fLVvC, kLV);
761
762 PrintfArray("CFD threshold A side", fCFDtA, kCFD);
763 PrintfArray("CFD walk A side", fCFDwA, kCFD);
764 PrintfArray("CFD threshold C side", fCFDtC, kCFD);
765 PrintfArray("CFD walk C side", fCFDwC, kCFD);
766
767 //PrintfArray("SCALERS", (Float_t*) fScalerMean, kScalers);
768 printf("SCALERS: \n");
769 for(Int_t i=0;i<kScalers;i++){
770 printf(" %d", fScalerMean[i]);
771 }
772 printf("\n");
773
774
775 // PrintfArray("SCALERS per second",(Float_t*) fScalerSecMean, kScalers);
776 printf("SCALERS per second: \n");
777 for(Int_t i=0;i<kScalers;i++){
778 printf(" %d", fScalerSecMean[i]);
779 }
780 printf("\n");
781
782
783
784
785 PrintfArray("TRM", fTRM, kTRM);
786 PrintfArray("DRM", fDRM, kDRM);
787
788 printf("Laser Amplitude: %f\n", fAtten);
789 printf("mult. discrim. central A side: %d\n", fMPDcentA);
790 printf("mult. discrim. central C side: %d\n", fMPDcentC);
791 printf("mult. discrim. semi-central A side: %d\n", fMPDsemiCentA);
792 printf("mult. discrim. semi-central C side: %d\n", fMPDsemiCentC);
793
794 printf("TVDC top: %d\n", fTVDCtop);
795 printf("TVDC bottom: %d\n", fTVDCbottom);
796 printf("MPDmode: %d\n", fMPDmode);
797}
798
91366e58 799