Changes in QA to be able to process separately different triggers (Ruben)
[u/mrichter/AliRoot.git] / STEER / AliGRPObject.h
CommitLineData
39e3007b 1#ifndef ALIGRPOBJECT_H\r
2#define ALIGRPOBJECT_H\r
3\r
4/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *\r
5 * See cxx source for full Copyright notice */\r
6\r
7/* $Id$ */\r
8\r
9//\r
10// AliGRPObject\r
11// class to store the information\r
12// coming from the GRP preprocessor\r
13// \r
14\r
195fcf27 15#include <time.h>\r
c7f6296a 16#include <TString.h>\r
de67dd6b 17#include <TTimeStamp.h>\r
195fcf27 18\r
39e3007b 19class TMap;\r
20\r
21class AliDCSSensor;\r
22class AliSplineFit;\r
23class AliLog;\r
24\r
25class AliGRPObject : public TObject {\r
26 public:\r
27\r
28 enum Stats {kMean = 0, kTruncMean = 1, kMedian = 2, kSDMean = 3, kSDMedian = 4};\r
99c7d495 29 \r
5cf76849 30 enum StatusBits {kPolConvLHC = BIT(14), kUniformBMap = BIT(15),kConvSqrtSHalfGeV = BIT(16)};\r
39e3007b 31\r
32 enum DP_HallProbes { \r
33 khpL3bsf17H1= 0 , khpL3bsf17H2, khpL3bsf17H3, khpL3bsf17Temperature, \r
34 khpL3bsf4H1, khpL3bsf4H2, khpL3bsf4H3, khpL3bsf4Temperature, \r
35 khpL3bkf17H1, khpL3bkf17H2, khpL3bkf17H3, khpL3bkf17Temperature, \r
36 khpL3bkf4H1, khpL3bkf4H2, khpL3bkf4H3, khpL3bkf4Temperature, \r
37 khpL3bsf13H1, khpL3bsf13H2, khpL3bsf13H3, khpL3bsf13Temperature,\r
38 khpL3bsf8H1, khpL3bsf8H2, khpL3bsf8H3, khpL3bsfy8Temperature,\r
39 khpL3bkf13H1, khpL3bkf13H2, khpL3bkf13H3, khpL3bkf13Temperature,\r
40 khpL3bkf8H1, khpL3bkf8H2, khpL3bkf8H3, khpL3bkf8Temperature,\r
41 khpDipoleInsideH1, khpDipoleInsideH2, khpDipoleInsideH3, khpDipoleInsideTemperature,\r
42 khpDipoleOutsideH1, khpDipoleOutsideH2, khpDipoleOutsideH3, khpDipoleOutsideTemperature};\r
43\r
44\r
45 AliGRPObject();\r
46 AliGRPObject(const AliGRPObject & obj);\r
47 AliGRPObject& operator=(const AliGRPObject & obj);\r
48 ~AliGRPObject();\r
49\r
50 // getters\r
5cf76849 51 Bool_t IsBeamEnergyIsSqrtSHalfGeV() const {return TestBit(kConvSqrtSHalfGeV);}\r
99c7d495 52 Bool_t IsPolarityConventionLHC() const {return TestBit(kPolConvLHC);}\r
53 Bool_t IsUniformBMap() const {return TestBit(kUniformBMap);}\r
39e3007b 54 time_t GetTimeStart() const {return fTimeStart;}\r
55 time_t GetTimeEnd() const {return fTimeEnd;}\r
549ab3c2 56 Float_t GetBeamEnergy() const;\r
39e3007b 57 TString GetBeamType() const {return fBeamType;}\r
58 Char_t GetNumberOfDetectors() const {return fNumberOfDetectors;}\r
95eb6639 59 UInt_t GetDetectorMask() const {return fDetectorMask;}\r
39e3007b 60 TString GetLHCPeriod() const {return fLHCPeriod;}\r
61 TString GetRunType() const {return fRunType;}\r
62 TString GetLHCState() const {return fLHCState;}\r
0254e751 63 TString GetMachineMode() const {return fMachineMode;}\r
64 TObjArray* GetLHCStateArray() const {return fLHCStateArray;}\r
65 TObjArray* GetMachineModeArray() const {return fMachineModeArray;}\r
39e3007b 66 Char_t GetL3Polarity() const {return fL3Polarity;}\r
67 Char_t GetDipolePolarity() const {return fDipolePolarity;}\r
68 Float_t* GetL3Current() const {return fL3Current;}\r
69 Float_t GetL3Current(Stats stat) const {return fL3Current[stat];}\r
70 Float_t* GetDipoleCurrent() const {return fDipoleCurrent;}\r
71 Float_t GetDipoleCurrent(Stats stat) const {return fDipoleCurrent[stat];}\r
72 Float_t* GetCavernTemperature() const {return fCavernTemperature;}\r
73 Float_t GetCavernTemperature(Stats stat) const {return fCavernTemperature[stat];}\r
39e3007b 74 AliDCSSensor* GetCavernAtmosPressure() const {return fCavernAtmosPressure;}\r
ce996d13 75 AliDCSSensor* GetCavernAtmosPressure2() const {return fCavernAtmosPressure2;}\r
39e3007b 76 AliDCSSensor* GetSurfaceAtmosPressure() const {return fSurfaceAtmosPressure;}\r
de67dd6b 77 AliDCSSensor* GetBestCavernAtmosPressure() const ;\r
78 AliDCSSensor* GetBestCavernAtmosPressure(const TTimeStamp& time) const;\r
79 static AliDCSSensor* GetBestCavernAtmosPressure(AliDCSSensor* cavern1, \r
80 AliDCSSensor* cavern2, AliDCSSensor* surface, const TTimeStamp& time);\r
81\r
39e3007b 82\r
a861a1ce 83 Float_t* GetHallProbesArray(DP_HallProbes hp) const;\r
39e3007b 84 Float_t GetHallProbes(Int_t hp) const {return fHallProbes[hp];}\r
85 Float_t GetHallProbes(DP_HallProbes hp, Stats stat) const {return fHallProbes[hp*fPoints+stat];}\r
86\r
87 Int_t GetPoints() const {return fPoints;}\r
88 Int_t GetDimension() const {return fDimension;}\r
89\r
6b01e5fd 90 Double_t GetMaxTimeLHCValidity() const {return fMaxTimeLHCValidity;}\r
92664bc8 91 //\r
92 TObjArray* GetQATrigClasses() const {return (TObjArray*)fQATrigClasses;}\r
93 TObjArray* GetQACloningRequest() const {return (TObjArray*)fQACloningRequest;}\r
94 //\r
39e3007b 95 // setters\r
5cf76849 96 void SetBeamEnergyIsSqrtSHalfGeV(Bool_t v=kTRUE) {SetBit(kConvSqrtSHalfGeV,v);}\r
99c7d495 97 void SetPolarityConventionLHC(Bool_t v=kTRUE) {return SetBit(kPolConvLHC,v);}\r
98 void SetUniformBMap(Bool_t v=kTRUE) {return SetBit(kUniformBMap,v);}\r
39e3007b 99 void SetTimeStart(time_t timeStart) {fTimeStart = timeStart;}\r
100 void SetTimeEnd(time_t timeEnd) {fTimeEnd = timeEnd;}\r
101 void SetBeamEnergy(Float_t beamEnergy) {fBeamEnergy = beamEnergy;}\r
102 void SetBeamType(TString beamType) {fBeamType = beamType;}\r
103 void SetNumberOfDetectors(Char_t numberOfDetectors) {fNumberOfDetectors = numberOfDetectors;}\r
104 void SetDetectorMask(UInt_t detectorMask) {fDetectorMask = detectorMask;}\r
105 void SetLHCPeriod(TString lhcPeriod) {fLHCPeriod = lhcPeriod;}\r
106 void SetRunType(TString runType) {fRunType = runType;}\r
107 void SetLHCState(TString lhcState) {fLHCState = lhcState;}\r
0254e751 108 void SetMachineMode(TString machineMode) {fMachineMode = machineMode;}\r
109 void SetLHCStateArray(TObjArray* lhcStateArray) {fLHCStateArray = lhcStateArray;}\r
110 void SetMachineModeArray(TObjArray* machineModeArray) {fMachineModeArray = machineModeArray;}\r
39e3007b 111 void SetL3Polarity(Char_t l3Polarity) {fL3Polarity = l3Polarity;}\r
112 void SetDipolePolarity(Char_t dipolePolarity) {fDipolePolarity = dipolePolarity;}\r
113 void SetL3Current(const Float_t* l3Current) {\r
114 for (Int_t i = 0;i<fPoints;i++) fL3Current[i] = l3Current[i];\r
115 }\r
116 void SetL3Current(Float_t l3Current, Stats stat) {fL3Current[stat] = l3Current;}\r
117 void SetDipoleCurrent(const Float_t* dipoleCurrent) {\r
118 for (Int_t i = 0;i<fPoints;i++) fDipoleCurrent[i] = dipoleCurrent[i];\r
119 }\r
120 void SetDipoleCurrent(Float_t dipoleCurrent, Stats stat) {fDipoleCurrent[stat] = dipoleCurrent;}\r
121 void SetCavernTemperature(const Float_t* cavernTemperature) {\r
122 for (Int_t i = 0;i<fPoints;i++) fCavernTemperature[i] = cavernTemperature[i];\r
123 }\r
124 void SetCavernTemperature(Float_t cavernTemperature, Stats stat) {fCavernTemperature[stat] = cavernTemperature;}\r
39e3007b 125 void SetCavernAtmosPressure(AliDCSSensor* const cavernAtmosPressure) {fCavernAtmosPressure = cavernAtmosPressure;}\r
ce996d13 126 void SetCavernAtmosPressure2(AliDCSSensor* const cavernAtmosPressure) {fCavernAtmosPressure2 = cavernAtmosPressure;}\r
39e3007b 127 void SetSurfaceAtmosPressure(AliDCSSensor* const surfacePressure) {fSurfaceAtmosPressure = surfacePressure;}\r
128\r
129 void SetHallProbes(DP_HallProbes hp, Float_t hall_probe, Stats stat) {fHallProbes[hp*fPoints+stat] = hall_probe;}\r
130 void SetHallProbes(const Float_t* hall_probe){\r
131 for (Int_t i = 0; i< fDimension; i++) fHallProbes[i] = hall_probe[i];}\r
132\r
133 void SetHallProbes(DP_HallProbes hp, const Float_t* hall_probe); \r
134 void SetPoints(Int_t points) {fPoints = points;}\r
135 void SetDimension(Int_t dimension) {fDimension = dimension;}\r
6b01e5fd 136 void SetMaxTimeLHCValidity(Double_t maxTimeLHCValidity) {fMaxTimeLHCValidity = maxTimeLHCValidity;}\r
92664bc8 137 //\r
138 void SetQATrigClasses(TObjArray* arr) {fQATrigClasses = arr;}\r
139 void SetQACloningRequest(TObjArray* arr) {fQACloningRequest = arr;}\r
140 //\r
39e3007b 141 // getters for "invalid" flags\r
142\r
143 static Float_t GetInvalidFloat() {return fgkInvalidFloat;}\r
144 static TString GetInvalidString() {return fgkInvalidString;}\r
145 static Int_t GetInvalidInt() {return fgkInvalidInt;}\r
146 static Int_t GetInvalidUInt() {return fgkInvalidUInt;}\r
147 static Char_t GetInvalidChar() {return fgkInvalidChar;}\r
148 static Int_t GetNumberOfHP() {return fgknDCSDPHallProbes;}\r
149 static const char* GetHPDP(Int_t indexHP) {return fgkDCSDataPointsHallProbes[indexHP];}\r
150\r
de67dd6b 151 Double_t EvalCavernPressure(const TTimeStamp& time, Bool_t& inside) const;\r
152 static Double_t EvalCavernPressure(AliDCSSensor* cavern1, \r
153 AliDCSSensor* cavern2, AliDCSSensor* surface, \r
154 const TTimeStamp& time, Bool_t& inside);\r
155\r
39e3007b 156 // to read old GRP object in TMap format\r
157\r
158 void ReadValuesFromMap(const TMap* map); \r
159\r
53b0ec45 160 void SetSingleBeamType(Int_t ibeamType, TString beamType) {fSeparateBeamType[ibeamType] = beamType;}\r
161 TString GetSingleBeamType(Int_t ibeamType) const {return fBeamType[ibeamType];}\r
162\r
39e3007b 163 private:\r
164\r
165 static const Float_t fgkInvalidFloat; // value to identify invalid data - float\r
166 static const TString fgkInvalidString; // value to identify invalid data - string\r
167 static const Char_t fgkInvalidChar; // value to identify invalid data - char\r
168 static const Int_t fgkInvalidInt; // value to identify invalid data - int\r
169 static const Int_t fgkInvalidUInt; // value to identify invalid data - uint\r
170 static const Int_t fgknDCSDPHallProbes; //! number of dcs dps\r
171 static const char* fgkDCSDataPointsHallProbes[]; //! names of dcs dps\r
172\r
173 Int_t fPoints; // number of statistical quantities to be stored\r
174 Int_t fDimension; // dimension of Hall Probes array\r
175\r
176 time_t fTimeStart; // DAQ_time_start entry from DAQ logbook\r
177 time_t fTimeEnd; // DAQ_time_end entry from DAQ logbook\r
178 Float_t fBeamEnergy; // beamEnergy entry from DAQ logbook\r
179 TString fBeamType; // beamType entry from DAQ logbook\r
180 Char_t fNumberOfDetectors; // numberOfDetectors entry from DAQ logbook\r
181 UInt_t fDetectorMask; // detectorMask entry from DAQ logbook\r
182 TString fLHCPeriod; // LHCperiod entry from DAQ logbook \r
183 TString fRunType; // RunType entry from DAQ logbook \r
184 TString fLHCState; // LHCState entry from DCS DB\r
39e3007b 185 Char_t fL3Polarity; // L3Polarity entry from DCS DB\r
186 Char_t fDipolePolarity; // DipolePolarity entry from DCS DB \r
187 Float_t* fL3Current; // [fPoints]\r
188 // L3Current entry from DCS DB\r
189 Float_t* fDipoleCurrent; // [fPoints]\r
190 // DipoleCurrent entry from DCS DB\r
191 Float_t* fCavernTemperature; // [fPoints]\r
192 // CavernTemperature entry from DCS DB\r
39e3007b 193 AliDCSSensor* fCavernAtmosPressure; // CavernAtmosPressure entry from DCS DB\r
ce996d13 194 AliDCSSensor* fCavernAtmosPressure2; // CavernAtmosPressure2 entry from DCS DB\r
39e3007b 195 AliDCSSensor* fSurfaceAtmosPressure; // SurfaceAtmosPressure entry from DCS DB\r
196\r
197 // Hall Probes\r
198\r
199 Float_t* fHallProbes; //[fDimension] \r
200 // array containg the values for the Hall Probes\r
201\r
0254e751 202 TString fMachineMode; // Machine Mode from LHC\r
0254e751 203 TObjArray* fLHCStateArray; // Array of values for the LHC State\r
204 TObjArray* fMachineModeArray; // Array of values for the LHC State\r
92664bc8 205 TObjArray* fQATrigClasses; // RS: Array of trigger class to watch in QA\r
206 TObjArray* fQACloningRequest; // RS: Array of cloning requests for QA histos\r
6b01e5fd 207 Double_t fMaxTimeLHCValidity; // time until which the LHC Data Machine Mode and Beam Mode didn't change \r
53b0ec45 208 TString fSeparateBeamType[2]; // separate beam Types from LHC\r
6b01e5fd 209\r
92664bc8 210 ClassDef(AliGRPObject,8)\r
39e3007b 211\r
212};\r
213\r
214#endif\r