]>
Commit | Line | Data |
---|---|---|
cfaccd71 | 1 | #ifndef ALIITSDCSDATASDD_H |
2 | #define ALIITSDCSDATASDD_H | |
3 | ||
4 | /* Copyright(c) 2007-2009, ALICE Experiment at CERN, All rights reserved. * | |
5 | * See cxx source for full Copyright notice */ | |
6 | ||
7 | /* $Id$ */ | |
8 | ||
9 | /////////////////////////////////////////////////////////////////// | |
10 | // // | |
11 | // Class to define object containing SDD DCS data // | |
12 | // Origin: F.Prino, Torino, prino@to.infn.it // | |
e22bf775 | 13 | // V.Pospisil, CTU Prague, gdermog@seznam.cz // |
cfaccd71 | 14 | /////////////////////////////////////////////////////////////////// |
15 | ||
16 | #include<TObject.h> | |
17 | #include<TArrayF.h> | |
18 | #include<TArrayI.h> | |
e22bf775 | 19 | #include<TArrayC.h> |
cfaccd71 | 20 | |
e22bf775 | 21 | class AliITSDCSDataSDD : public TObject |
22 | { | |
cfaccd71 | 23 | |
24 | public: | |
e22bf775 | 25 | AliITSDCSDataSDD( void ); |
26 | // Default constructor | |
27 | ~AliITSDCSDataSDD( void ){}; | |
28 | // Destructor is void | |
29 | ||
30 | void SetNPointsTempLeft( Int_t npts ); | |
31 | void SetNPointsTempRight( Int_t npts ); | |
32 | void SetNPointsHV( Int_t npts ); | |
33 | void SetNPointsMV( Int_t npts ); | |
34 | void SetNPointsStatus( Int_t npts ); | |
35 | // Sets sizes of the DCS variable arrays | |
36 | ||
37 | void SetValueTempLeft(Int_t time, Float_t temperature ); | |
38 | void SetValueTempRight(Int_t time, Float_t temperature ); | |
39 | void SetValueHV(Int_t time, Float_t voltage ); | |
40 | void SetValueMV(Int_t time, Float_t voltage ); | |
41 | void SetValueStatus(Int_t time, Char_t status ); | |
42 | // Inserts value of a DCS variable into the appropriate array. | |
43 | // Resizes and sorts array if necessary. | |
44 | ||
45 | void Compress(); // Tries to minimize array sizes | |
46 | ||
47 | Int_t GetTempLeftRecords() const {return fTempLeftSetPoints;} | |
48 | Int_t GetTempRightRecords() const {return fTempRightSetPoints;} | |
49 | Int_t GetHVRecords() const {return fHVSetPoints;} | |
50 | Int_t GetMVRecords() const {return fMVSetPoints;} | |
51 | Int_t GetStatusRecords() const {return fStatusSetPoints;} | |
52 | // Returns number of stored values of specific DCS variable | |
53 | ||
54 | Int_t GetTempLeftSize() const {return fTempLeftMaxPoints;} | |
55 | Int_t GetTempRightSize() const {return fTempRightMaxPoints;} | |
56 | Int_t GetHVSize() const {return fHVMaxPoints;} | |
57 | Int_t GetMVSize() const {return fMVMaxPoints;} | |
58 | Int_t GetStatusSize() const {return fStatusMaxPoints;} | |
59 | // Returns size of selected array | |
60 | ||
61 | Float_t GetTempLeftIdx( Int_t index ) const {return fTempLeft.At(index);}; | |
62 | Float_t GetTempRightIdx( Int_t index ) const {return fTempRight.At(index);}; | |
63 | Float_t GetHVIdx( Int_t index ) const {return fHV.At(index);}; | |
64 | Float_t GetMVIdx( Int_t index ) const {return fMV.At(index);}; | |
65 | Char_t GetStatusIdx( Int_t index ) const {return fStatus.At(index);}; | |
66 | // Returns value of specific DCS variable by index in the array | |
67 | ||
68 | Bool_t GetOKStatIdx( Int_t index ) const { return (Bool_t)(fStatus.At(index) & 1 ); }; | |
69 | Bool_t GetTempLeftStatIdx( Int_t index ) const { return (Bool_t)(fStatus.At(index) & 2 ); }; | |
70 | Bool_t GetTempRightStatIdx( Int_t index ) const { return (Bool_t)(fStatus.At(index) & 4 ); }; | |
71 | // Return status of a readout device by index in the array | |
72 | ||
73 | Int_t GetTempLeftTimeIdx( Int_t index ) const {return fTempLeftTimeStamp.At(index);}; | |
74 | Int_t GetTempRightTimeIdx( Int_t index ) const {return fTempRightTimeStamp.At(index);}; | |
75 | Int_t GetHVTimeIdx( Int_t index ) const {return fHVTimeStamp.At(index);}; | |
76 | Int_t GetMVTimeIdx( Int_t index ) const {return fMVTimeStamp.At(index);}; | |
77 | Int_t GetStatusTimeIdx( Int_t index ) const {return fStatusTimeStamp.At(index);}; | |
78 | // Returns time stamp of specific DCS variable by index in the array | |
79 | ||
80 | Float_t GetTempLeft( Int_t time ); | |
81 | Float_t GetTempRight( Int_t time ); | |
82 | Float_t GetHV( Int_t time ); | |
83 | Float_t GetMV( Int_t time ); | |
84 | Char_t GetStatus( Int_t time ); | |
85 | // Returns value of specific DCS variable by time stamp | |
86 | ||
87 | Bool_t GetOKStat( Int_t time ) { Char_t stat = GetStatus( time ); return (Bool_t)( stat & 1 ); }; | |
88 | Bool_t GetTempLeftStat( Int_t time ) { Char_t stat = GetStatus( time ); return (Bool_t)( stat & 2 ); }; | |
89 | Bool_t GetTempRightStat( Int_t time ) { Char_t stat = GetStatus( time ); return (Bool_t)( stat & 4 ); }; | |
90 | // Return status of a readout device in given time | |
91 | ||
92 | Float_t GetDriftField( Int_t timeStamp ); | |
93 | // Returns drift field counted for specific time | |
cfaccd71 | 94 | |
e22bf775 | 95 | Float_t GetDriftSpeed( Int_t timeStamp ) const; |
96 | // Returns drift speed counted for specific time. This metod is not dedicated | |
97 | // for normal usage - it should be used only in cases that the injectors for | |
98 | // given module fails | |
99 | ||
100 | void PrintValues( FILE *output = stdout ) const; | |
101 | // Displays stored DCS varable values or writes it into a text file | |
cfaccd71 | 102 | private: |
103 | ||
e22bf775 | 104 | TArrayF fTempLeft; //|| "don't split" automatic streamer instruction |
105 | // Temperature on left side. If there is stored a negative value | |
106 | // something wrong happend with the temperature chip. | |
107 | TArrayI fTempLeftTimeStamp; //|| | |
108 | // Time stamps of the temperatures on left side | |
109 | Int_t fTempLeftMaxPoints; // Size of the arrays | |
110 | Int_t fTempLeftSetPoints; // Number of filled array cells (number of set values) | |
111 | ||
112 | ||
113 | TArrayF fTempRight; //|| | |
114 | // Temperature on right side. If there is stored a negative value | |
115 | // something wrong happend with the temperature chip. | |
116 | TArrayI fTempRightTimeStamp; //|| | |
117 | // Time stamps of temperatures on right side | |
118 | Int_t fTempRightMaxPoints; // Size of the arrays | |
119 | Int_t fTempRightSetPoints; // Number of filled array cells (number of set values) | |
120 | ||
121 | ||
122 | TArrayF fHV; //|| | |
123 | // High voltage on SDD | |
124 | TArrayI fHVTimeStamp; //|| | |
125 | // Time stamps of HV | |
126 | Int_t fHVMaxPoints; // Size of the arrays | |
127 | Int_t fHVSetPoints; // Number of filled array cells (number of set values) | |
128 | ||
129 | ||
130 | TArrayF fMV; //|| | |
131 | // Medium voltage on SDD | |
132 | TArrayI fMVTimeStamp; //|| | |
133 | // Time stamps of MV | |
134 | Int_t fMVMaxPoints; // Size of the arrays | |
135 | Int_t fMVSetPoints; // Number of filled array cells (number of set values) | |
136 | ||
137 | ||
138 | TArrayC fStatus; //|| | |
139 | // Status of temperature and voltage readout | |
140 | // | |
141 | // bit 0 - _OK | |
142 | // bit 1 - _TEMP_L_STATE | |
143 | // bit 2 - _TEMP_R_STATE | |
144 | ||
145 | TArrayI fStatusTimeStamp; //|| | |
146 | // Time stamps of MV | |
147 | Int_t fStatusMaxPoints; // Size of the arrays | |
148 | Int_t fStatusSetPoints; // Number of filled array cells (number of set values) | |
149 | ||
150 | ||
151 | Int_t FindIndex( Int_t timeStamp, TArrayI &timeStampArray, Int_t n ) const; | |
152 | // Returns index in the array of time stamps by selected value. Returns -1 | |
153 | // if the time is less than time stamp in the timeArray[0] | |
cfaccd71 | 154 | |
e22bf775 | 155 | ClassDef(AliITSDCSDataSDD, 2) |
cfaccd71 | 156 | |
e22bf775 | 157 | }; /*class AliITSDCSDataSDD*/ |
cfaccd71 | 158 | |
159 | #endif |