]> git.uio.no Git - u/mrichter/AliRoot.git/blame - STEER/CDB/AliDCSSensor.h
Adding print function and constant getter to the array of sensors
[u/mrichter/AliRoot.git] / STEER / CDB / AliDCSSensor.h
CommitLineData
7264822f 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
8////////////////////////////////////////////////////////////////////////////
9// Container class for DCS sensors
10////////////////////////////////////////////////////////////////////////////
11
12
13#include "TObject.h"
14#include "TMath.h"
15#include "TTimeStamp.h"
16#include "AliSplineFit.h"
17
18class TObjArray;
19class TClonesArray;
20class TTree;
21class TFile;
22class TString;
23class TGraph;
24class TVector3;
25
26
27////////////////////////////////////////////////////////////////////////
28// Class AliDCSSensor
29////////////////////////////////////////////////////////////////////////
30
31class AliDCSSensor : public TNamed {
32
33public:
34 AliDCSSensor();
35 AliDCSSensor(const AliDCSSensor& source);
36 virtual ~AliDCSSensor(){}
37 AliDCSSensor& operator=(const AliDCSSensor& source);
3dc6d65a 38 virtual void Print(const Option_t* option="") const;
7264822f 39
40 Int_t GetId() const {return fId; }
41 Int_t GetIdDCS() const {return fIdDCS; }
24cd438b 42 const TString& GetStringID() const {return fStringID; }
3dc6d65a 43
7264822f 44 Double_t GetX() const {return fX; }
45 Double_t GetY() const {return fY; }
46 Double_t GetZ() const {return fZ; }
47 Double_t GetR() const {return TMath::Sqrt(fX*fX+fY*fY);}
48 Double_t GetPhi() const {return TMath::ATan2(fY,fX); }
49
8cb8848e 50 UInt_t GetStartTime() const {return fStartTime;}
51 UInt_t GetEndTime() const { return fEndTime; }
7264822f 52 TGraph* GetGraph() const {return fGraph; }
53 AliSplineFit* GetFit() const {return fFit; }
54
55 void SetId (Int_t id) {fId = id; }
56 void SetIdDCS (Int_t iddcs) {fIdDCS = iddcs; }
24cd438b 57 void SetStringID (const TString& stringID) {fStringID = stringID; }
7264822f 58
59 void SetX (Double_t x) {fX = x; }
60 void SetY (Double_t y) {fY = y; }
61 void SetZ (Double_t z) {fZ = z; }
62
63 void SetGraph (TGraph *gr) {fGraph = gr; }
64 void SetFit (AliSplineFit *f) {fFit = f; }
65 void SetStartTime (UInt_t stime) {fStartTime = stime; }
66 void SetStartTime (TTimeStamp time) {fStartTime = time.GetSec(); }
8cb8848e 67 void SetEndTime (UInt_t stime) {fEndTime = stime; }
68 void SetEndTime (TTimeStamp time) {fEndTime = time.GetSec(); }
6ec4e3e3 69 Double_t GetValue(UInt_t timeSec); // timeSec offset for individual sensor map
70 Double_t GetValue(TTimeStamp time); // use this for absolute time stamp
1bc2e138 71 Double_t Eval(const TTimeStamp& time, Bool_t& inside) const;
72 Double_t EvalGraph(const TTimeStamp& time, Bool_t& inside) const;
e7097603 73 Double_t EvalGraph(const Double_t& timeHour) const;
6ec4e3e3 74 TGraph *MakeGraph (Int_t nPoints=100, Bool_t debug=kFALSE) const;
24cd438b 75 static TClonesArray * ReadTree(TTree *tree);
8cb8848e 76
7264822f 77
78protected:
24cd438b 79 Int_t fId; // Internal number of sensor id (array index)
80 Int_t fIdDCS; // ID number in DCS
81 TString fStringID; // Amanda String ID
8cb8848e 82 UInt_t fStartTime; // start time for DCS map/fit
83 UInt_t fEndTime; // end time for DCS map/fit
7264822f 84 TGraph * fGraph; // graph with values
85 AliSplineFit *fFit; // fit to graph values
86 Double_t fX; //X-position of the sensor
87 Double_t fY; //Y-position of the sensor
88 Double_t fZ; //Z-position of the sensor
89
24cd438b 90 ClassDef(AliDCSSensor,3);
7264822f 91};
92#endif
24cd438b 93