minor coverity defect: added protection for self-assignment
[u/mrichter/AliRoot.git] / TRD / AliTRDDataDCS.h
CommitLineData
cd4fc278 1#ifndef ALITRDDATADCS_H
2#define ALITRDDATADCS_H
a5e1169e 3
67b87932 4/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
6
7/* $Id$ */
8
9////////////////////////////////////////////////////////////////////////////
10// //
11// Extracts the DCS information //
12// //
13////////////////////////////////////////////////////////////////////////////
14
a5e1169e 15#include <TNamed.h>
54d68e69 16
17class TObjArray;
18class TString;
a5e1169e 19
20class TGraph;
21class AliSplineFit;
22class TMap;
23
a5e1169e 24class AliTRDDataDCS : public TNamed
25{
26
acc49af9 27 public :
a5e1169e 28
acc49af9 29 AliTRDDataDCS ();
a5e1169e 30 ~AliTRDDataDCS ();
31
32 Bool_t ExtractDCS (TMap * aliDCS);
33 Bool_t PerformFit ();
34 void ClearFits ();
35 void ClearGraphs ();
36
37 UInt_t GetNAlias () const {return fNAlias;}
38 TString GetAmandaStr (UInt_t iAlias) const;
39 UInt_t GetNChannel (UInt_t iAlias) const;
40
41 TGraph * GetGraph (UInt_t iAlias, UInt_t iChannel = 0) const;
42 AliSplineFit * GetFit (UInt_t iAlias, UInt_t iChannel = 0) const;
43
44 // Get TGraph
54d68e69 45 TGraph * GetGraphChamberByteStatus (UInt_t iSensor) const {return GetGraph (kChamberByteStatus, iSensor);}
46 TGraph * GetGraphPreTrigger () const {return GetGraph (kPreTrigger);}
47 TGraph * GetGraphGoofyHv () const {return GetGraph (kGoofyHv);}
48 TGraph * GetGraphGoofyPeakPos (UInt_t iSensor) const {return GetGraph (kGoofyPeakPos, iSensor);}
49 TGraph * GetGraphGoofyPeakArea (UInt_t iSensor) const {return GetGraph (kGoofyPeakArea, iSensor);}
50 TGraph * GetGraphGoofyTemp (UInt_t iSensor) const {return GetGraph (kGoofyTemp, iSensor);}
51 TGraph * GetGraphGoofyPressure () const {return GetGraph (kGoofyPressure);}
52 TGraph * GetGraphGoofyVelocity () const {return GetGraph (kGoofyVelocity);}
53 TGraph * GetGraphGoofyGain (UInt_t iSensor) const {return GetGraph (kGoofyGain, iSensor);}
54 TGraph * GetGraphGoofyCO2 () const {return GetGraph (kGoofyCO2);}
55 TGraph * GetGraphGoofyN2 () const {return GetGraph (kGoofyN2);}
56 TGraph * GetGraphGasO2 () const {return GetGraph (kGasO2);}
57 TGraph * GetGraphGasOverpressure () const {return GetGraph (kGasOverpressure);}
58 TGraph * GetGraphEnvTemp (UInt_t iSensor) const {return GetGraph (kEnvTemp, iSensor);}
59 TGraph * GetGraphHvAnodeImon (UInt_t iSensor) const {return GetGraph (kHvAnodeImon, iSensor);}
60 TGraph * GetGraphHvDriftImon (UInt_t iSensor) const {return GetGraph (kHvDriftImon, iSensor);}
61 TGraph * GetGraphHvAnodeUmon (UInt_t iSensor) const {return GetGraph (kHvAnodeUmon, iSensor);}
62 TGraph * GetGraphHvDriftUmon (UInt_t iSensor) const {return GetGraph (kHvDriftUmon, iSensor);}
63 TGraph * GetGraphAdcClkPhase () const {return GetGraph (kAdcClkPhase);}
64 TGraph * GetGraphAtmPressure () const {return GetGraph (kAtmPressure);}
65 TGraph * GetGraphLuminosity () const {return GetGraph (kLuminosity);}
66 TGraph * GetGraphMagneticField () const {return GetGraph (kMagneticField);}
a5e1169e 67
54d68e69 68 AliSplineFit * GetFitChamberByteStatus (UInt_t iSensor) const {return GetFit (kChamberByteStatus, iSensor);}
69 AliSplineFit * GetFitPreTrigger () const {return GetFit (kPreTrigger);}
70 AliSplineFit * GetFitGoofyHv () const {return GetFit (kGoofyHv);}
71 AliSplineFit * GetFitGoofyPeakPos (UInt_t iSensor) const {return GetFit (kGoofyPeakPos, iSensor);}
72 AliSplineFit * GetFitGoofyPeakArea (UInt_t iSensor) const {return GetFit (kGoofyPeakArea, iSensor);}
73 AliSplineFit * GetFitGoofyTemp (UInt_t iSensor) const {return GetFit (kGoofyTemp, iSensor);}
74 AliSplineFit * GetFitGoofyPressure () const {return GetFit (kGoofyPressure);}
75 AliSplineFit * GetFitGoofyVelocity () const {return GetFit (kGoofyVelocity);}
76 AliSplineFit * GetFitGoofyGain (UInt_t iSensor) const {return GetFit (kGoofyGain, iSensor);}
77 AliSplineFit * GetFitGoofyCO2 () const {return GetFit (kGoofyCO2);}
78 AliSplineFit * GetFitGoofyN2 () const {return GetFit (kGoofyN2);}
79 AliSplineFit * GetFitGasO2 () const {return GetFit (kGasO2);}
80 AliSplineFit * GetFitGasOverpressure () const {return GetFit (kGasOverpressure);}
81 AliSplineFit * GetFitEnvTemp (UInt_t iSensor) const {return GetFit (kEnvTemp, iSensor);}
82 AliSplineFit * GetFitHvAnodeImon (UInt_t iSensor) const {return GetFit (kHvAnodeImon, iSensor);}
83 AliSplineFit * GetFitHvDriftImon (UInt_t iSensor) const {return GetFit (kHvDriftImon, iSensor);}
84 AliSplineFit * GetFitHvAnodeUmon (UInt_t iSensor) const {return GetFit (kHvAnodeUmon, iSensor);}
85 AliSplineFit * GetFitHvDriftUmon (UInt_t iSensor) const {return GetFit (kHvDriftUmon, iSensor);}
86 AliSplineFit * GetFitAdcClkPhase () const {return GetFit (kAdcClkPhase);}
87 AliSplineFit * GetFitAtmPressure () const {return GetFit (kAtmPressure);}
88 AliSplineFit * GetFitLuminosity () const {return GetFit (kLuminosity);}
89 AliSplineFit * GetFitMagneticField () const {return GetFit (kMagneticField);}
a5e1169e 90
c893147d 91 void Print (const Option_t * const option = "") const;
a5e1169e 92
acc49af9 93 protected :
54d68e69 94
c893147d 95 TGraph * FindAndMakeGraph (TMap * const dcsMap
96 , const char * amandaStr
97 , char dataType);
98 AliSplineFit * Fit (const TGraph * const graph,
a5e1169e 99 Int_t kMinPoints, Int_t kIter,
100 Double_t kMaxDelta, Int_t kFitReq);
101
102 void Init ();
103 void InitFits ();
104 void InitGraphs ();
105
106 void SetConf (UInt_t iAlias, const char * amanda, char dataType, UInt_t nChannel,
107 Bool_t enableGraph, Bool_t enableFit, Int_t kMinPoints,
108 Int_t kIter, Double_t kMaxDelta, Int_t kFitReq);
109
acc49af9 110 private :
54d68e69 111
112 enum { kChamberByteStatus = 0
113 , kPreTrigger = 1
114 , kGoofyHv = 2
115 , kGoofyPeakPos = 3
116 , kGoofyPeakArea = 4
117 , kGoofyTemp = 5
118 , kGoofyPressure = 6
119 , kGoofyVelocity = 7
120 , kGoofyGain = 8
121 , kGoofyCO2 = 9
122 , kGoofyN2 = 10
123 , kGasO2 = 11
124 , kGasOverpressure = 12
125 , kEnvTemp = 13
126 , kHvAnodeImon = 14
127 , kHvDriftImon = 15
128 , kHvAnodeUmon = 16
129 , kHvDriftUmon = 17
130 , kAdcClkPhase = 18
131 , kAtmPressure = 19
132 , kLuminosity = 20
133 , kMagneticField = 21
134 };
135
acc49af9 136 Bool_t fGraphsAreIni; // Check whether graphs are initialized
137 Bool_t fFitsAreIni; // Check whether firs are initialized
138 UInt_t fNAlias; // Number of aliases
a5e1169e 139
54d68e69 140 class AliTRDDataDCSdata {
141 public:
142 AliTRDDataDCSdata()
143 :fFit(0x0)
144 ,fGraph(0x0) { };
145 virtual ~AliTRDDataDCSdata() { };
146 TObjArray GetFit() const { return fFit; }
147 TObjArray GetGraph() const { return fGraph; }
148 TObject* GetFit(Int_t i) const { return fFit[i]; }
149 TObject* GetGraph(Int_t i) const { return fGraph[i]; }
150 protected:
151 TObjArray fFit; // array of AliSplineFit
152 TObjArray fGraph; // array of TGraph
153 };
154
155 class AliTRDDataDCSconf {
156 public:
157 AliTRDDataDCSconf()
158 :fAmanda(0)
159 ,fDataType(0)
160 ,fNChannel(0)
161 ,fEnableGraph(0)
162 ,fEnableFit(0)
163 ,fMinPoints(0)
164 ,fIter(0)
165 ,fMaxDelta(0)
166 ,fFitReq(0) { };
167 virtual ~AliTRDDataDCSconf() { };
168 TString GetAmanda() const { return fAmanda; }
169 Char_t GetDataType() const { return fDataType; }
170 UInt_t GetNChannel() const { return fNChannel; }
171 Bool_t GetEnableGraph() const { return fEnableGraph; }
172 Bool_t GetEnableFit() const { return fEnableFit; }
173 Int_t GetMinPoints() const { return fMinPoints; }
174 Int_t GetIter() const { return fIter; }
175 Double_t GetMaxDelta() const { return fMaxDelta; }
176 Int_t GetFitReq() const { return fFitReq; }
177 void SetAmanda(TString s) { fAmanda = s; }
178 void SetDataType(Char_t d) { fDataType = d; }
179 void SetNChannel(UInt_t n) { fNChannel = n; }
180 void SetEnableGraph(Bool_t e) { fEnableGraph = e; }
181 void SetEnableFit(Bool_t e) { fEnableFit = e; }
182 void SetMinPoints(Int_t m) { fMinPoints = m; }
183 void SetIter(Int_t i) { fIter = i; }
184 void SetMaxDelta(Double_t m) { fMaxDelta = m; }
185 void SetFitReq(Int_t f) { fFitReq = f; }
186 protected:
187 TString fAmanda; // amanda string
188 Char_t fDataType; // 'c' for char, 'f' for float
189 UInt_t fNChannel; // number of channel
190 Bool_t fEnableGraph; // will be converted in TGraph
191 Bool_t fEnableFit; // will be converted in AliSplineFit
192 Int_t fMinPoints; // minimum number of points per knot in fit
193 Int_t fIter; // number of iterations for spline fit
194 Double_t fMaxDelta; // precision parameter for spline fit
195 Int_t fFitReq; // fit requirement, 2 = continuous 2nd derivative
196 };
197
198 AliTRDDataDCSdata fDatas [22]; // configurations
199 AliTRDDataDCSconf fConfs [22]; // data arrays
a5e1169e 200
54d68e69 201 ClassDef(AliTRDDataDCS,1) // TRD calibration class
a5e1169e 202
54d68e69 203};
a5e1169e 204
205#endif