]> git.uio.no Git - u/mrichter/AliRoot.git/blame - SHUTTLE/TestShuttle/AliTestDataDCS.h
Added method to recompute chi2 and stddev + cosmetics
[u/mrichter/AliRoot.git] / SHUTTLE / TestShuttle / AliTestDataDCS.h
CommitLineData
14487e6a 1#ifndef ALITESTDATADCS_H
2#define ALITESTDATADCS_H
3
4/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
6/* $Id$ */
7
8//
9// Class to simulate DCS Data point
10// for a Test Preprocessor
11//
5c6b40ae 12
5c6b40ae 13#include <TClonesArray.h>
14487e6a 14#include <TH1F.h>
5c6b40ae 15#include <TGraph.h>
16#include <TF1.h>
17
14487e6a 18class TMap;
19
5c6b40ae 20class AliTestDataDCS : public TObject {
21public:
22 enum {kNAliases=6, kNHistos=3, kNGraphs=3, kNFunctions=2};
36137ac1 23 enum {kHvMin=0, kHvMax=20};
5c6b40ae 24
25 AliTestDataDCS();
26 AliTestDataDCS(Int_t nRun, UInt_t startTime, UInt_t endTime);
27 ~AliTestDataDCS();
28
29 void SetRun(Int_t run) {fRun = run;}
30 void SetStartTime(Int_t startTime) {fStartTime = startTime;}
31 void SetEndTime(Int_t endTime) {fEndTime = endTime;}
14487e6a 32 Int_t GetRun() const {return fRun;}
33 Int_t GetStartTime() const {return fStartTime;}
34 Int_t GetEndTime() const {return fEndTime;}
5c6b40ae 35
36 void ProcessData(TMap& aliasMap);
37
38 const char* GetAliasName(UInt_t pos)
39 {return pos<kNAliases ? fAliasNames[pos].Data() : 0;}
14487e6a 40 const TH1F* GetHisto(UInt_t pos) const
5c6b40ae 41 {return pos<kNHistos ? fHv[pos] : 0;}
42
14487e6a 43 Float_t GetMean(UInt_t pos) const {return pos<kNHistos ? fMean[pos] : 0;}
44 Float_t GetWidth(UInt_t pos) const {return pos<kNHistos ? fWidth[pos] : 0;}
5c6b40ae 45
46 const TGraph* GetGraph(UInt_t pos)
47 {return pos<kNGraphs ? ((TGraph*) fGraphs.UncheckedAt(pos)) : 0;}
48
14487e6a 49 const TF1* GetFunction() const {return fFunc;}
5c6b40ae 50
51 Double_t Eval(int pos, Double_t time)
52 {return pos<kNGraphs ? ((TGraph*) fGraphs.UncheckedAt(pos))->Eval(time) : -1;}
53
54 void Draw(const Option_t* option);
55
56
57private:
14487e6a 58 AliTestDataDCS(const AliTestDataDCS& other);
59 AliTestDataDCS& operator= (const AliTestDataDCS& other);
5c6b40ae 60 void Init();
61 void Introduce(UInt_t numAlias, const TObjArray* aliasArr);
62 void CreateGraph(int i, int dim, const Double_t *x, const Double_t *y);
63
14487e6a 64 Int_t fRun; // run number
65 UInt_t fStartTime; // run start time
66 UInt_t fEndTime; // run end time
5c6b40ae 67
14487e6a 68 Float_t fMean[kNHistos]; // mean of the histograms
69 Float_t fWidth[kNHistos]; // width of the histograms
5c6b40ae 70
14487e6a 71 TString fAliasNames[kNAliases]; // aliases of the DPs
72 TH1F *fHv[kNHistos]; // histograms
73 TClonesArray fGraphs; // graphs
74 TF1 *fFunc; // functions
5c6b40ae 75
14487e6a 76 Bool_t fIsProcessed; // flag indicating whether the DCS data have been processed
5c6b40ae 77
78 ClassDef(AliTestDataDCS, 2);
79};
80
81#endif