AliRoot Core  3dc7879 (3dc7879)
AliDCSSensor.h
Go to the documentation of this file.
1 #ifndef AliDCSSensor_H
2 #define AliDCSSensor_H
3 /* Copyright(c) 2006-07, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice */
5 
6 
7 
9 // Container class for DCS sensors
11 
12 
13 #include "TObject.h"
14 #include "TMath.h"
15 #include "TTimeStamp.h"
16 #include "AliSplineFit.h"
17 
18 class TObjArray;
19 class TClonesArray;
20 class TTree;
21 class TFile;
22 class TString;
23 class TGraph;
24 class TVector3;
25 
26 
28 // Class AliDCSSensor
30 
31 class AliDCSSensor : public TNamed {
32 
33 public:
34  AliDCSSensor();
35  AliDCSSensor(const AliDCSSensor& source);
36  virtual ~AliDCSSensor();
37  AliDCSSensor& operator=(const AliDCSSensor& source);
38  virtual void Print(const Option_t* option="") const;
39  virtual void Draw(Option_t* option="") ;
40 
41  Int_t GetId() const {return fId; }
42  Int_t GetIdDCS() const {return fIdDCS; }
43  const TString& GetStringID() const {return fStringID; }
44 
45  Double_t GetX() const {return fX; }
46  Double_t GetY() const {return fY; }
47  Double_t GetZ() const {return fZ; }
48  Double_t GetR() const {return TMath::Sqrt(fX*fX+fY*fY);}
49  Double_t GetPhi() const {return TMath::ATan2(fY,fX); }
50 
51  UInt_t GetStartTime() const {return fStartTime;}
52  UInt_t GetEndTime() const { return fEndTime; }
53  TGraph* GetGraph() const {return fGraph; }
54  AliSplineFit* GetFit() const {return fFit; }
55 
56  void SetId (Int_t id) {fId = id; }
57  void SetIdDCS (Int_t iddcs) {fIdDCS = iddcs; }
58  void SetStringID (const TString& stringID) {fStringID = stringID; }
59 
60  void SetX (Double_t x) {fX = x; }
61  void SetY (Double_t y) {fY = y; }
62  void SetZ (Double_t z) {fZ = z; }
63 
64  void SetGraph (TGraph *gr) {fGraph = gr; }
65  void SetFit (AliSplineFit *f) {fFit = f; }
66  void SetStartTime (UInt_t stime) {fStartTime = stime; }
67  void SetStartTime (TTimeStamp time) {fStartTime = time.GetSec(); }
68  void SetEndTime (UInt_t stime) {fEndTime = stime; }
69  void SetEndTime (TTimeStamp time) {fEndTime = time.GetSec(); }
70  Double_t GetValue(UInt_t timeSec); // timeSec offset for individual sensor map
71  Double_t GetValue(TTimeStamp time); // use this for absolute time stamp
72  Double_t Eval(const TTimeStamp& time, Bool_t& inside) const;
73  Double_t EvalGraph(const TTimeStamp& time, Bool_t& inside) const;
74  Double_t EvalGraph(const Double_t& timeHour) const;
75  TGraph *MakeGraph (Int_t nPoints=100, Bool_t debug=kFALSE) const;
76  static TClonesArray * ReadTree(TTree *tree);
77 
78 
79 protected:
80  Int_t fId; // Internal number of sensor id (array index)
81  Int_t fIdDCS; // ID number in DCS
82  TString fStringID; // Amanda String ID
83  UInt_t fStartTime; // start time for DCS map/fit
84  UInt_t fEndTime; // end time for DCS map/fit
85  TGraph * fGraph; // graph with values
86  AliSplineFit *fFit; // fit to graph values
87  Double_t fX; //X-position of the sensor
88  Double_t fY; //Y-position of the sensor
89  Double_t fZ; //Z-position of the sensor
90 
91  ClassDef(AliDCSSensor,3);
92 };
93 #endif
94 
UInt_t GetEndTime() const
Definition: AliDCSSensor.h:52
Double_t GetZ() const
Definition: AliDCSSensor.h:47
AliSplineFit * GetFit() const
Definition: AliDCSSensor.h:54
void SetGraph(TGraph *gr)
Definition: AliDCSSensor.h:64
#define TObjArray
Double_t GetX() const
Definition: AliDCSSensor.h:45
virtual void Draw(Option_t *option="")
Double_t fZ
Definition: AliDCSSensor.h:89
Double_t EvalGraph(const TTimeStamp &time, Bool_t &inside) const
Int_t GetIdDCS() const
Definition: AliDCSSensor.h:42
void SetStringID(const TString &stringID)
Definition: AliDCSSensor.h:58
UInt_t fStartTime
Definition: AliDCSSensor.h:83
UInt_t GetStartTime() const
Definition: AliDCSSensor.h:51
AliSplineFit * fFit
Definition: AliDCSSensor.h:86
void SetFit(AliSplineFit *f)
Definition: AliDCSSensor.h:65
void SetStartTime(UInt_t stime)
Definition: AliDCSSensor.h:66
void SetZ(Double_t z)
Definition: AliDCSSensor.h:62
TTree * tree
Int_t GetId() const
Definition: AliDCSSensor.h:41
Double_t Eval(const TTimeStamp &time, Bool_t &inside) const
void SetIdDCS(Int_t iddcs)
Definition: AliDCSSensor.h:57
static TClonesArray * ReadTree(TTree *tree)
void SetX(Double_t x)
Definition: AliDCSSensor.h:60
void SetEndTime(TTimeStamp time)
Definition: AliDCSSensor.h:69
TGraph * GetGraph() const
Definition: AliDCSSensor.h:53
TGraph * gr
Definition: CalibTime.C:25
virtual ~AliDCSSensor()
AliDCSSensor & operator=(const AliDCSSensor &source)
Double_t GetR() const
Definition: AliDCSSensor.h:48
void SetY(Double_t y)
Definition: AliDCSSensor.h:61
void SetEndTime(UInt_t stime)
Definition: AliDCSSensor.h:68
const TString & GetStringID() const
Definition: AliDCSSensor.h:43
Double_t GetPhi() const
Definition: AliDCSSensor.h:49
TF1 * f
Definition: interpolTest.C:21
Double_t fX
Definition: AliDCSSensor.h:87
Double_t GetValue(UInt_t timeSec)
virtual void Print(const Option_t *option="") const
Double_t fY
Definition: AliDCSSensor.h:88
TString fStringID
Definition: AliDCSSensor.h:82
void SetId(Int_t id)
Definition: AliDCSSensor.h:56
UInt_t fEndTime
Definition: AliDCSSensor.h:84
TGraph * MakeGraph(Int_t nPoints=100, Bool_t debug=kFALSE) const
void SetStartTime(TTimeStamp time)
Definition: AliDCSSensor.h:67
Int_t debug
TGraph * fGraph
Definition: AliDCSSensor.h:85
Double_t GetY() const
Definition: AliDCSSensor.h:46