ROOT logo
#ifndef AliDCSSensor_H
#define AliDCSSensor_H
/* Copyright(c) 2006-07, ALICE Experiment at CERN, All rights reserved. *
 * See cxx source for full Copyright notice                               */



////////////////////////////////////////////////////////////////////////////
//              Container class for DCS sensors            
////////////////////////////////////////////////////////////////////////////


#include "TObject.h"
#include "TMath.h"
#include "TTimeStamp.h"
#include "AliSplineFit.h"

class TObjArray;
class TClonesArray;
class TTree;
class TFile;
class TString;
class TGraph;
class TVector3;


////////////////////////////////////////////////////////////////////////
//              Class AliDCSSensor
////////////////////////////////////////////////////////////////////////

class AliDCSSensor : public TNamed {

public:
  AliDCSSensor();
  AliDCSSensor(const AliDCSSensor& source);
  virtual ~AliDCSSensor(){}
  AliDCSSensor& operator=(const AliDCSSensor& source);
  virtual void Print(const Option_t* option="") const;
  virtual void Draw(Option_t* option="") ;
  
  Int_t       GetId()     const {return fId;     }
  Int_t       GetIdDCS()  const {return fIdDCS;     }
  const TString& GetStringID() const {return fStringID; }

  Double_t    GetX()   	   const {return fX;      }
  Double_t    GetY()   	   const {return fY;      }
  Double_t    GetZ()   	   const {return fZ;      }
  Double_t    GetR()   	   const {return TMath::Sqrt(fX*fX+fY*fY);}
  Double_t    GetPhi() 	   const {return TMath::ATan2(fY,fX);    }
  
  UInt_t      GetStartTime() const {return fStartTime;} 
  UInt_t      GetEndTime() const { return fEndTime; }
  TGraph*     GetGraph()   const {return fGraph; }
  AliSplineFit* GetFit()   const {return fFit; }

  void SetId     (Int_t id)        {fId     = id;    }
  void SetIdDCS  (Int_t iddcs)     {fIdDCS  = iddcs;    }
  void SetStringID (const TString& stringID)  {fStringID = stringID; }
  
  void SetX       (Double_t x)       {fX     = x;      }
  void SetY       (Double_t y)       {fY     = y;      }
  void SetZ       (Double_t z)       {fZ     = z;      }

  void SetGraph   (TGraph *gr)      {fGraph = gr; }
  void SetFit     (AliSplineFit *f) {fFit = f; }
  void SetStartTime (UInt_t stime)  {fStartTime = stime; }
  void SetStartTime (TTimeStamp time)  {fStartTime = time.GetSec(); }
  void SetEndTime (UInt_t stime)  {fEndTime = stime; }
  void SetEndTime (TTimeStamp time)  {fEndTime = time.GetSec(); }
  Double_t GetValue(UInt_t timeSec);   // timeSec offset for individual sensor map
  Double_t GetValue(TTimeStamp time);  // use this for absolute time stamp
  Double_t Eval(const TTimeStamp& time, Bool_t& inside) const;
  Double_t EvalGraph(const TTimeStamp& time, Bool_t& inside) const;
  Double_t EvalGraph(const Double_t& timeHour) const;
  TGraph *MakeGraph (Int_t nPoints=100, Bool_t debug=kFALSE) const;
  static TClonesArray *  ReadTree(TTree *tree);
  

protected:
  Int_t fId;         // Internal number of sensor id  (array index)
  Int_t fIdDCS;      // ID number in DCS
  TString  fStringID; // Amanda String ID
  UInt_t   fStartTime;  // start time for DCS map/fit
  UInt_t   fEndTime;    // end time for DCS map/fit
  TGraph * fGraph;      // graph with values
  AliSplineFit *fFit;   // fit to graph values
  Double_t fX;      //X-position of the sensor
  Double_t fY;      //Y-position of the sensor
  Double_t fZ;      //Z-position of the sensor

  ClassDef(AliDCSSensor,3);
};
#endif

 AliDCSSensor.h:1
 AliDCSSensor.h:2
 AliDCSSensor.h:3
 AliDCSSensor.h:4
 AliDCSSensor.h:5
 AliDCSSensor.h:6
 AliDCSSensor.h:7
 AliDCSSensor.h:8
 AliDCSSensor.h:9
 AliDCSSensor.h:10
 AliDCSSensor.h:11
 AliDCSSensor.h:12
 AliDCSSensor.h:13
 AliDCSSensor.h:14
 AliDCSSensor.h:15
 AliDCSSensor.h:16
 AliDCSSensor.h:17
 AliDCSSensor.h:18
 AliDCSSensor.h:19
 AliDCSSensor.h:20
 AliDCSSensor.h:21
 AliDCSSensor.h:22
 AliDCSSensor.h:23
 AliDCSSensor.h:24
 AliDCSSensor.h:25
 AliDCSSensor.h:26
 AliDCSSensor.h:27
 AliDCSSensor.h:28
 AliDCSSensor.h:29
 AliDCSSensor.h:30
 AliDCSSensor.h:31
 AliDCSSensor.h:32
 AliDCSSensor.h:33
 AliDCSSensor.h:34
 AliDCSSensor.h:35
 AliDCSSensor.h:36
 AliDCSSensor.h:37
 AliDCSSensor.h:38
 AliDCSSensor.h:39
 AliDCSSensor.h:40
 AliDCSSensor.h:41
 AliDCSSensor.h:42
 AliDCSSensor.h:43
 AliDCSSensor.h:44
 AliDCSSensor.h:45
 AliDCSSensor.h:46
 AliDCSSensor.h:47
 AliDCSSensor.h:48
 AliDCSSensor.h:49
 AliDCSSensor.h:50
 AliDCSSensor.h:51
 AliDCSSensor.h:52
 AliDCSSensor.h:53
 AliDCSSensor.h:54
 AliDCSSensor.h:55
 AliDCSSensor.h:56
 AliDCSSensor.h:57
 AliDCSSensor.h:58
 AliDCSSensor.h:59
 AliDCSSensor.h:60
 AliDCSSensor.h:61
 AliDCSSensor.h:62
 AliDCSSensor.h:63
 AliDCSSensor.h:64
 AliDCSSensor.h:65
 AliDCSSensor.h:66
 AliDCSSensor.h:67
 AliDCSSensor.h:68
 AliDCSSensor.h:69
 AliDCSSensor.h:70
 AliDCSSensor.h:71
 AliDCSSensor.h:72
 AliDCSSensor.h:73
 AliDCSSensor.h:74
 AliDCSSensor.h:75
 AliDCSSensor.h:76
 AliDCSSensor.h:77
 AliDCSSensor.h:78
 AliDCSSensor.h:79
 AliDCSSensor.h:80
 AliDCSSensor.h:81
 AliDCSSensor.h:82
 AliDCSSensor.h:83
 AliDCSSensor.h:84
 AliDCSSensor.h:85
 AliDCSSensor.h:86
 AliDCSSensor.h:87
 AliDCSSensor.h:88
 AliDCSSensor.h:89
 AliDCSSensor.h:90
 AliDCSSensor.h:91
 AliDCSSensor.h:92
 AliDCSSensor.h:93
 AliDCSSensor.h:94