+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * *
+ * Author: The ALICE Off-line Project. *
+ * Contributors are mentioned in the code where appropriate. *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+
+/*
+$Log$
+*/
+
+//
+// Class to simulate the
+// data coming from DCS
+// for a test preprocessor
+//
+
#include "AliTestDataDCS.h"
-#include "AliCDBMetaData.h"
#include "AliDCSValue.h"
#include "AliLog.h"
#include <TTimeStamp.h>
-#include <TObjString.h>
-#include <TH2F.h>
-#include <TProfile.h>
#include <TGraph.h>
-#include <TDatime.h>
-#include <TStyle.h>
#include <TCanvas.h>
+#include <TObjArray.h>
+#include <TMap.h>
ClassImp(AliTestDataDCS)
fGraphs("TGraph",kNGraphs),
fIsProcessed(kFALSE)
{
+
+ //
+ // constructor
+ //
+
AliInfo(Form("\n\tRun %d \n\tStartTime %s \n\tEndTime %s", nRun,
TTimeStamp(startTime).AsString(),
TTimeStamp(endTime).AsString()));
//---------------------------------------------------------------
void AliTestDataDCS::ProcessData(TMap& aliasMap){
+ //
+ // processing the data
+ //
+
if(!(fHv[0])) Init();
TObjArray *aliasArr;
//---------------------------------------------------------------
void AliTestDataDCS::Init(){
+ //
+ // initialization
+ //
+
TH1::AddDirectory(kFALSE);
fGraphs.SetOwner(1);
//---------------------------------------------------------------
void AliTestDataDCS::Draw(const Option_t* /*option*/)
{
-// Draw all histos and graphs
+ //
+ // Draw all histos and graphs
+ //
if(!fIsProcessed) return;
-#ifndef AliTestDataDCS_H
-#define AliTestDataDCS_H
+#ifndef ALITESTDATADCS_H
+#define ALITESTDATADCS_H
+
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+/* $Id$ */
+
+//
+// Class to simulate DCS Data point
+// for a Test Preprocessor
+//
-#include <TMap.h>
#include <TClonesArray.h>
-#include <TH2F.h>
+#include <TH1F.h>
#include <TGraph.h>
#include <TF1.h>
+class TMap;
+
class AliTestDataDCS : public TObject {
public:
enum {kNAliases=6, kNHistos=3, kNGraphs=3, kNFunctions=2};
void SetRun(Int_t run) {fRun = run;}
void SetStartTime(Int_t startTime) {fStartTime = startTime;}
void SetEndTime(Int_t endTime) {fEndTime = endTime;}
- Int_t GetRun() {return fRun;}
- Int_t GetStartTime() {return fStartTime;}
- Int_t GetEndTime() {return fEndTime;}
+ Int_t GetRun() const {return fRun;}
+ Int_t GetStartTime() const {return fStartTime;}
+ Int_t GetEndTime() const {return fEndTime;}
void ProcessData(TMap& aliasMap);
const char* GetAliasName(UInt_t pos)
{return pos<kNAliases ? fAliasNames[pos].Data() : 0;}
- const TH1F* GetHisto(UInt_t pos)
+ const TH1F* GetHisto(UInt_t pos) const
{return pos<kNHistos ? fHv[pos] : 0;}
- Float_t GetMean(UInt_t pos) {return pos<kNHistos ? fMean[pos] : 0;}
- Float_t GetWidth(UInt_t pos) {return pos<kNHistos ? fWidth[pos] : 0;}
+ Float_t GetMean(UInt_t pos) const {return pos<kNHistos ? fMean[pos] : 0;}
+ Float_t GetWidth(UInt_t pos) const {return pos<kNHistos ? fWidth[pos] : 0;}
const TGraph* GetGraph(UInt_t pos)
{return pos<kNGraphs ? ((TGraph*) fGraphs.UncheckedAt(pos)) : 0;}
- const TF1* GetFunction() {return fFunc;}
+ const TF1* GetFunction() const {return fFunc;}
Double_t Eval(int pos, Double_t time)
{return pos<kNGraphs ? ((TGraph*) fGraphs.UncheckedAt(pos))->Eval(time) : -1;}
private:
+ AliTestDataDCS(const AliTestDataDCS& other);
+ AliTestDataDCS& operator= (const AliTestDataDCS& other);
void Init();
void Introduce(UInt_t numAlias, const TObjArray* aliasArr);
void CreateGraph(int i, int dim, const Double_t *x, const Double_t *y);
- Int_t fRun;
- UInt_t fStartTime;
- UInt_t fEndTime;
+ Int_t fRun; // run number
+ UInt_t fStartTime; // run start time
+ UInt_t fEndTime; // run end time
- Float_t fMean[kNHistos];
- Float_t fWidth[kNHistos];
+ Float_t fMean[kNHistos]; // mean of the histograms
+ Float_t fWidth[kNHistos]; // width of the histograms
- TString fAliasNames[kNAliases];
- TH1F *fHv[kNHistos];
- TClonesArray fGraphs;
- TF1 *fFunc;
+ TString fAliasNames[kNAliases]; // aliases of the DPs
+ TH1F *fHv[kNHistos]; // histograms
+ TClonesArray fGraphs; // graphs
+ TF1 *fFunc; // functions
- Bool_t fIsProcessed;
+ Bool_t fIsProcessed; // flag indicating whether the DCS data have been processed
ClassDef(AliTestDataDCS, 2);
};