1 /**************************************************************************
\r
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
\r
4 * Author: The ALICE Off-line Project. *
\r
5 * Contributors are mentioned in the code where appropriate. *
\r
7 * Permission to use, copy, modify and distribute this software and its *
\r
8 * documentation strictly for non-commercial purposes is hereby granted *
\r
9 * without fee, provided that the above copyright notice appears in all *
\r
10 * copies and that both the copyright notice and this permission notice *
\r
11 * appear in the supporting documentation. The authors make no claims *
\r
12 * about the suitability of this software for any purpose. It is *
\r
13 * provided "as is" without express or implied warranty. *
\r
14 **************************************************************************/
\r
17 // Class AliVZEROTrending
\r
18 // ---------------------------
\r
20 // class used in QA to publish variables evolution versus time in AMORE.
\r
21 // These histo are the one which will be looked at by QA Shifter
\r
26 #include "AliVZEROTrending.h"
\r
28 ClassImp(AliVZEROTrending)
\r
30 //_____________________________________________________________________________
\r
31 AliVZEROTrending::AliVZEROTrending() : TH1(), fNEntries(0)
\r
33 // Default constructor
\r
35 //_____________________________________________________________________________
\r
36 AliVZEROTrending::AliVZEROTrending(const char* name, const char* title) : TH1(), fNEntries(0)
\r
41 //_____________________________________________________________________________
\r
42 AliVZEROTrending::AliVZEROTrending(const AliVZEROTrending &trend) :
\r
43 TH1(), fNEntries(trend.fNEntries)
\r
46 SetName(trend.GetName());
\r
47 SetTitle(trend.GetTitle());
\r
48 for (int i = 0; i < kDataSize; i++) {
\r
49 fTime[i] = trend.fTime[i];
\r
50 for (int j = 0; j < 8; j++) {
\r
51 fData[j][i] = trend.fData[j][i];
\r
56 //_____________________________________________________________________________
\r
57 AliVZEROTrending::~AliVZEROTrending(){
\r
60 // -----------------------------------------------------------------
\r
61 void AliVZEROTrending::AddEntry(Double_t * data, UInt_t time)
\r
64 if(fNEntries<kDataSize){
\r
65 for (int i = 0; i < 8; i++)
\r
67 fData[i][fNEntries] = data[i];
\r
68 fTime[fNEntries] = (double) time;
\r
73 for (int i = 0; i < kDataSize-1; i++){
\r
74 fTime[i] = fTime[i+1];
\r
75 for (int ich = 0; ich < 8; ich++){
\r
76 fData[ich][i] = fData[ich][i+1];
\r
79 for (int i = 0; i < 8; i++)
\r
81 fData[i][fNEntries-1] = data[i];
\r
82 fTime[fNEntries-1] = (double) time;
\r
86 //printf("sizeof UInt_t Double_t %d %d\n",sizeof(UInt_t),sizeof(Double_t));
\r
87 //printf("Add Entry %d @ %f : %f %f %f %f %f %f %f %f \n",fNEntries,fTime[fNEntries-1],
\r
88 // data[0],data[1],data[2],data[3],data[4],data[5],data[6],data[7]);
\r
90 // -----------------------------------------------------------------
\r
91 void AliVZEROTrending::PrintEntry(UInt_t entry)
\r
94 if(entry>=fNEntries){
\r
95 AliError(Form("maximum entry is %d\n",fNEntries-1));
\r
97 AliInfo(Form("Entry %d @ %f : %f %f %f %f %f %f %f %f \n",entry, fTime[entry],
\r
98 fData[0][entry],fData[1][entry],fData[2][entry],fData[3][entry],fData[4][entry],fData[5][entry],fData[6][entry],fData[7][entry]));
\r