AliRoot Core  3dc7879 (3dc7879)
AliGRPObject.h
Go to the documentation of this file.
1 #ifndef ALIGRPOBJECT_H
2 #define ALIGRPOBJECT_H
3 
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 // AliGRPObject
11 // class to store the information
12 // coming from the GRP preprocessor
13 //
14 
15 #include <time.h>
16 #include <TString.h>
17 #include <TTimeStamp.h>
18 #include <TArrayD.h>
19 
20 class TMap;
21 
22 class AliDCSSensor;
23 class AliSplineFit;
24 class AliLog;
25 
26 class AliGRPObject : public TObject {
27  public:
28 
29  enum Stats {kMean = 0, kTruncMean = 1, kMedian = 2, kSDMean = 3, kSDMedian = 4};
30 
31  enum StatusBits {kPolConvLHC = BIT(14), kUniformBMap = BIT(15),kConvSqrtSHalfGeV = BIT(16)};
32 
33  enum DP_HallProbes {
45 
46  AliGRPObject();
47  AliGRPObject(const AliGRPObject & obj);
48  AliGRPObject& operator=(const AliGRPObject & obj);
49  ~AliGRPObject();
50 
51  // getters
52  Bool_t IsBeamEnergyIsSqrtSHalfGeV() const {return TestBit(kConvSqrtSHalfGeV);}
53  Bool_t IsPolarityConventionLHC() const {return TestBit(kPolConvLHC);}
54  Bool_t IsUniformBMap() const {return TestBit(kUniformBMap);}
55  time_t GetTimeStart() const {return fTimeStart;}
56  time_t GetTimeEnd() const {return fTimeEnd;}
57  Float_t GetBeamEnergy() const;
58  TString GetBeamType() const {return fBeamType;}
59  Char_t GetNumberOfDetectors() const {return fNumberOfDetectors;}
60  UInt_t GetDetectorMask() const {return fDetectorMask;}
61  TString GetLHCPeriod() const {return fLHCPeriod;}
62  TString GetRunType() const {return fRunType;}
63  TString GetLHCState() const {return fLHCState;}
64  TString GetMachineMode() const {return fMachineMode;}
67  Char_t GetL3Polarity() const {return fL3Polarity;}
68  Char_t GetDipolePolarity() const {return fDipolePolarity;}
69  Float_t* GetL3Current() const {return fL3Current;}
70  Float_t GetL3Current(Stats stat) const {return fL3Current[stat];}
71  Float_t* GetDipoleCurrent() const {return fDipoleCurrent;}
72  Float_t GetDipoleCurrent(Stats stat) const {return fDipoleCurrent[stat];}
73  Float_t* GetCavernTemperature() const {return fCavernTemperature;}
79  AliDCSSensor* GetBestCavernAtmosPressure(const TTimeStamp& time) const;
81  AliDCSSensor* cavern2, AliDCSSensor* surface, const TTimeStamp& time);
82 
83  Int_t GetHLTMode() const {return fHLTMode;}
84  void SetHLTMode(char m) {fHLTMode = m;}
85 
86  Float_t* GetHallProbesArray(DP_HallProbes hp) const;
87  Float_t GetHallProbes(Int_t hp) const {return fHallProbes[hp];}
88  Float_t GetHallProbes(DP_HallProbes hp, Stats stat) const {return fHallProbes[hp*fPoints+stat];}
89 
90  Int_t GetPoints() const {return fPoints;}
91  Int_t GetDimension() const {return fDimension;}
92 
93  Double_t GetMaxTimeLHCValidity() const {return fMaxTimeLHCValidity;}
94  //
97  //
98  // setters
99  void SetBeamEnergyIsSqrtSHalfGeV(Bool_t v=kTRUE) {SetBit(kConvSqrtSHalfGeV,v);}
100  void SetPolarityConventionLHC(Bool_t v=kTRUE) {return SetBit(kPolConvLHC,v);}
101  void SetUniformBMap(Bool_t v=kTRUE) {return SetBit(kUniformBMap,v);}
102  void SetTimeStart(time_t timeStart) {fTimeStart = timeStart;}
103  void SetTimeEnd(time_t timeEnd) {fTimeEnd = timeEnd;}
104  void SetBeamEnergy(Float_t beamEnergy) {fBeamEnergy = beamEnergy;}
105  void SetBeamType(TString beamType) {fBeamType = beamType;}
106  void SetNumberOfDetectors(Char_t numberOfDetectors) {fNumberOfDetectors = numberOfDetectors;}
107  void SetDetectorMask(UInt_t detectorMask) {fDetectorMask = detectorMask;}
108  void SetLHCPeriod(TString lhcPeriod) {fLHCPeriod = lhcPeriod;}
109  void SetRunType(TString runType) {fRunType = runType;}
110  void SetLHCState(TString lhcState) {fLHCState = lhcState;}
111  void SetMachineMode(TString machineMode) {fMachineMode = machineMode;}
112  void SetLHCStateArray(TObjArray* lhcStateArray) {fLHCStateArray = lhcStateArray;}
113  void SetMachineModeArray(TObjArray* machineModeArray) {fMachineModeArray = machineModeArray;}
114  void SetL3Polarity(Char_t l3Polarity) {fL3Polarity = l3Polarity;}
115  void SetDipolePolarity(Char_t dipolePolarity) {fDipolePolarity = dipolePolarity;}
116  void SetL3Current(const Float_t* l3Current) {
117  for (Int_t i = 0;i<fPoints;i++) fL3Current[i] = l3Current[i];
118  }
119  void SetL3Current(Float_t l3Current, Stats stat) {fL3Current[stat] = l3Current;}
120  void SetDipoleCurrent(const Float_t* dipoleCurrent) {
121  for (Int_t i = 0;i<fPoints;i++) fDipoleCurrent[i] = dipoleCurrent[i];
122  }
123  void SetDipoleCurrent(Float_t dipoleCurrent, Stats stat) {fDipoleCurrent[stat] = dipoleCurrent;}
124  void SetCavernTemperature(const Float_t* cavernTemperature) {
125  for (Int_t i = 0;i<fPoints;i++) fCavernTemperature[i] = cavernTemperature[i];
126  }
127  void SetCavernTemperature(Float_t cavernTemperature, Stats stat) {fCavernTemperature[stat] = cavernTemperature;}
128  void SetCavernAtmosPressure(AliDCSSensor* const cavernAtmosPressure) {fCavernAtmosPressure = cavernAtmosPressure;}
129  void SetCavernAtmosPressure2(AliDCSSensor* const cavernAtmosPressure) {fCavernAtmosPressure2 = cavernAtmosPressure;}
130  void SetSurfaceAtmosPressure(AliDCSSensor* const surfacePressure) {fSurfaceAtmosPressure = surfacePressure;}
131 
132  void SetHallProbes(DP_HallProbes hp, Float_t hall_probe, Stats stat) {fHallProbes[hp*fPoints+stat] = hall_probe;}
133  void SetHallProbes(const Float_t* hall_probe){
134  for (Int_t i = 0; i< fDimension; i++) fHallProbes[i] = hall_probe[i];}
135 
136  void SetHallProbes(DP_HallProbes hp, const Float_t* hall_probe);
137  void SetPoints(Int_t points) {fPoints = points;}
138  void SetDimension(Int_t dimension) {fDimension = dimension;}
139  void SetMaxTimeLHCValidity(Double_t maxTimeLHCValidity) {fMaxTimeLHCValidity = maxTimeLHCValidity;}
140  //
143  //
144  // getters for "invalid" flags
145 
146  static Float_t GetInvalidFloat() {return fgkInvalidFloat;}
147  static TString GetInvalidString() {return fgkInvalidString;}
148  static Int_t GetInvalidInt() {return fgkInvalidInt;}
149  static Int_t GetInvalidUInt() {return fgkInvalidUInt;}
150  static Char_t GetInvalidChar() {return fgkInvalidChar;}
151  static Int_t GetNumberOfHP() {return fgknDCSDPHallProbes;}
152  static const char* GetHPDP(Int_t indexHP) {return fgkDCSDataPointsHallProbes[indexHP];}
153 
154  Double_t EvalCavernPressure(const TTimeStamp& time, Bool_t& inside) const;
155  static Double_t EvalCavernPressure(AliDCSSensor* cavern1,
156  AliDCSSensor* cavern2, AliDCSSensor* surface,
157  const TTimeStamp& time, Bool_t& inside);
158 
159  // to read old GRP object in TMap format
160 
161  void ReadValuesFromMap(const TMap* map);
162 
163  void SetSingleBeamType(Int_t ibeamType, TString beamType) {fSeparateBeamType[ibeamType] = beamType;}
164  TString GetSingleBeamType(Int_t ibeamType) const {return fSeparateBeamType[ibeamType];}
165 
166  void SetNFalseDataQualityFlag(Int_t nFalses) {fNFalseDataQualityFlag = nFalses;}
168 
169  void SetFalseDataQualityFlagPeriods(Double_t* falses);
171 
172  Double_t GetStartFalseDataQualityFlag(Int_t iperiod) const;
173  Double_t GetEndFalseDataQualityFlag(Int_t iperiod) const;
174 
175  void SetBeamTypeFromLHC(TString beamTypeFromLHC) {fBeamTypeFromLHC = beamTypeFromLHC;}
176  TString GetBeamTypeFromLHC() const {return fBeamTypeFromLHC;}
177 
178  private:
179 
180  static const Float_t fgkInvalidFloat; // value to identify invalid data - float
181  static const TString fgkInvalidString; // value to identify invalid data - string
182  static const Char_t fgkInvalidChar; // value to identify invalid data - char
183  static const Int_t fgkInvalidInt; // value to identify invalid data - int
184  static const Int_t fgkInvalidUInt; // value to identify invalid data - uint
185  static const Int_t fgknDCSDPHallProbes;
186  static const char* fgkDCSDataPointsHallProbes[];
187 
188  Int_t fPoints; // number of statistical quantities to be stored
189  Int_t fDimension; // dimension of Hall Probes array
190 
191  time_t fTimeStart; // DAQ_time_start entry from DAQ logbook
192  time_t fTimeEnd; // DAQ_time_end entry from DAQ logbook
193  Float_t fBeamEnergy; // beamEnergy entry from DAQ logbook
194  TString fBeamType; // beamType entry from DAQ logbook
195  Char_t fHLTMode; // HLT mode
196  Char_t fNumberOfDetectors; // numberOfDetectors entry from DAQ logbook
197  UInt_t fDetectorMask; // detectorMask entry from DAQ logbook
198  TString fLHCPeriod; // LHCperiod entry from DAQ logbook
199  TString fRunType; // RunType entry from DAQ logbook
200  TString fLHCState; // LHCState entry from DCS DB
201  Char_t fL3Polarity; // L3Polarity entry from DCS DB
202  Char_t fDipolePolarity; // DipolePolarity entry from DCS DB
203  Float_t* fL3Current; // [fPoints]
204  // L3Current entry from DCS DB
205  Float_t* fDipoleCurrent; // [fPoints]
206  // DipoleCurrent entry from DCS DB
207  Float_t* fCavernTemperature; // [fPoints]
208  // CavernTemperature entry from DCS DB
209  AliDCSSensor* fCavernAtmosPressure; // CavernAtmosPressure entry from DCS DB
210  AliDCSSensor* fCavernAtmosPressure2; // CavernAtmosPressure2 entry from DCS DB
211  AliDCSSensor* fSurfaceAtmosPressure; // SurfaceAtmosPressure entry from DCS DB
212 
213  // Hall Probes
214 
215  Float_t* fHallProbes; //[fDimension]
216  // array containg the values for the Hall Probes
217 
218  TString fMachineMode; // Machine Mode from LHC
219  TObjArray* fLHCStateArray; // Array of values for the LHC State
220  TObjArray* fMachineModeArray; // Array of values for the LHC State
221  TObjArray* fQATrigClasses; // RS: Array of trigger class to watch in QA
222  TObjArray* fQACloningRequest; // RS: Array of cloning requests for QA histos
223  Double_t fMaxTimeLHCValidity; // time until which the LHC Data Machine Mode and Beam Mode didn't change
224  TString fSeparateBeamType[2]; // separate beam Types from LHC
225  Int_t fNFalseDataQualityFlag; // number of times the data quality flag turned to FALSE
226  TArrayD* fFalseDataQualityFlag; // array of starts (even positions) and ends (odd poistions) of the periods
227  // when the data quality flag was FALSE
228  TString fBeamTypeFromLHC; // string containing the information about the beam types AS SENT BY LHC (in the form "beam1-beam2")
229 
230  ClassDef(AliGRPObject,11)
231 
232 };
233 
234 #endif
TString GetRunType() const
Definition: AliGRPObject.h:62
Char_t GetNumberOfDetectors() const
Definition: AliGRPObject.h:59
TObjArray * fLHCStateArray
Definition: AliGRPObject.h:219
void SetCavernTemperature(const Float_t *cavernTemperature)
Definition: AliGRPObject.h:124
static Int_t GetInvalidUInt()
Definition: AliGRPObject.h:149
AliDCSSensor * fCavernAtmosPressure2
Definition: AliGRPObject.h:210
Bool_t IsBeamEnergyIsSqrtSHalfGeV() const
Definition: AliGRPObject.h:52
void SetDipolePolarity(Char_t dipolePolarity)
Definition: AliGRPObject.h:115
Float_t fBeamEnergy
Definition: AliGRPObject.h:193
UInt_t GetDetectorMask() const
Definition: AliGRPObject.h:60
time_t GetTimeStart() const
Definition: AliGRPObject.h:55
AliDCSSensor * GetCavernAtmosPressure2() const
Definition: AliGRPObject.h:76
Float_t GetDipoleCurrent(Stats stat) const
Definition: AliGRPObject.h:72
void SetDipoleCurrent(const Float_t *dipoleCurrent)
Definition: AliGRPObject.h:120
time_t fTimeStart
Definition: AliGRPObject.h:191
void SetL3Current(Float_t l3Current, Stats stat)
Definition: AliGRPObject.h:119
TString GetSingleBeamType(Int_t ibeamType) const
Definition: AliGRPObject.h:164
static const Int_t fgkInvalidInt
Definition: AliGRPObject.h:183
Char_t fDipolePolarity
Definition: AliGRPObject.h:202
TString fLHCPeriod
Definition: AliGRPObject.h:198
TObjArray * GetMachineModeArray() const
Definition: AliGRPObject.h:66
void SetPoints(Int_t points)
Definition: AliGRPObject.h:137
void SetSingleBeamType(Int_t ibeamType, TString beamType)
Definition: AliGRPObject.h:163
TString GetBeamTypeFromLHC() const
Definition: AliGRPObject.h:176
#define TObjArray
Char_t fNumberOfDetectors
Definition: AliGRPObject.h:196
Float_t * GetDipoleCurrent() const
Definition: AliGRPObject.h:71
TObjArray * fQACloningRequest
Definition: AliGRPObject.h:222
Float_t GetCavernTemperature(Stats stat) const
Definition: AliGRPObject.h:74
TString GetLHCPeriod() const
Definition: AliGRPObject.h:61
void SetDimension(Int_t dimension)
Definition: AliGRPObject.h:138
AliGRPObject & operator=(const AliGRPObject &obj)
static const Float_t fgkInvalidFloat
Definition: AliGRPObject.h:180
Double_t GetStartFalseDataQualityFlag(Int_t iperiod) const
static Int_t GetNumberOfHP()
Definition: AliGRPObject.h:151
Float_t GetHallProbes(DP_HallProbes hp, Stats stat) const
Definition: AliGRPObject.h:88
void SetUniformBMap(Bool_t v=kTRUE)
Definition: AliGRPObject.h:101
void SetTimeEnd(time_t timeEnd)
Definition: AliGRPObject.h:103
void SetMachineModeArray(TObjArray *machineModeArray)
Definition: AliGRPObject.h:113
void SetLHCState(TString lhcState)
Definition: AliGRPObject.h:110
void SetL3Current(const Float_t *l3Current)
Definition: AliGRPObject.h:116
Int_t GetHLTMode() const
Definition: AliGRPObject.h:83
static TString GetInvalidString()
Definition: AliGRPObject.h:147
Float_t * fL3Current
Definition: AliGRPObject.h:203
Char_t GetL3Polarity() const
Definition: AliGRPObject.h:67
void SetHLTMode(char m)
Definition: AliGRPObject.h:84
TArrayD * GetFalseDataQualityFlagPeriods() const
Definition: AliGRPObject.h:170
Float_t * GetCavernTemperature() const
Definition: AliGRPObject.h:73
void SetFalseDataQualityFlagPeriods(Double_t *falses)
Double_t GetMaxTimeLHCValidity() const
Definition: AliGRPObject.h:93
TString fMachineMode
Definition: AliGRPObject.h:218
void SetBeamEnergyIsSqrtSHalfGeV(Bool_t v=kTRUE)
Definition: AliGRPObject.h:99
TString GetMachineMode() const
Definition: AliGRPObject.h:64
time_t fTimeEnd
Definition: AliGRPObject.h:192
void SetTimeStart(time_t timeStart)
Definition: AliGRPObject.h:102
TStatToolkit stat
Definition: AnalyzeLaser.C:5
Int_t GetNFalseDataQualityFlag() const
Definition: AliGRPObject.h:167
Double_t GetEndFalseDataQualityFlag(Int_t iperiod) const
static Char_t GetInvalidChar()
Definition: AliGRPObject.h:150
static const Char_t fgkInvalidChar
Definition: AliGRPObject.h:182
void SetLHCStateArray(TObjArray *lhcStateArray)
Definition: AliGRPObject.h:112
void SetMachineMode(TString machineMode)
Definition: AliGRPObject.h:111
static const Int_t fgknDCSDPHallProbes
Definition: AliGRPObject.h:185
Char_t GetDipolePolarity() const
Definition: AliGRPObject.h:68
TString GetBeamType() const
Definition: AliGRPObject.h:58
void SetBeamTypeFromLHC(TString beamTypeFromLHC)
Definition: AliGRPObject.h:175
TString fBeamType
Definition: AliGRPObject.h:194
Float_t GetL3Current(Stats stat) const
Definition: AliGRPObject.h:70
Char_t fL3Polarity
Definition: AliGRPObject.h:201
static const TString fgkInvalidString
Definition: AliGRPObject.h:181
TObjArray * GetLHCStateArray() const
Definition: AliGRPObject.h:65
static Int_t GetInvalidInt()
Definition: AliGRPObject.h:148
Double_t fMaxTimeLHCValidity
Definition: AliGRPObject.h:223
static const char * fgkDCSDataPointsHallProbes[]
number of dcs dps
Definition: AliGRPObject.h:186
Bool_t IsPolarityConventionLHC() const
Definition: AliGRPObject.h:53
Float_t * fDipoleCurrent
Definition: AliGRPObject.h:205
void SetCavernAtmosPressure(AliDCSSensor *const cavernAtmosPressure)
Definition: AliGRPObject.h:128
AliDCSSensor * GetSurfaceAtmosPressure() const
Definition: AliGRPObject.h:77
Int_t fPoints
names of dcs dps
Definition: AliGRPObject.h:188
Definition: AliLog.h:27
TString fSeparateBeamType[2]
Definition: AliGRPObject.h:224
void SetCavernAtmosPressure2(AliDCSSensor *const cavernAtmosPressure)
Definition: AliGRPObject.h:129
Char_t fHLTMode
Definition: AliGRPObject.h:195
void SetHallProbes(const Float_t *hall_probe)
Definition: AliGRPObject.h:133
Float_t * fHallProbes
Definition: AliGRPObject.h:215
Float_t * GetL3Current() const
Definition: AliGRPObject.h:69
AliDCSSensor * GetBestCavernAtmosPressure() const
static const char * GetHPDP(Int_t indexHP)
Definition: AliGRPObject.h:152
Int_t fDimension
Definition: AliGRPObject.h:189
Int_t GetDimension() const
Definition: AliGRPObject.h:91
Int_t GetPoints() const
Definition: AliGRPObject.h:90
Double_t EvalCavernPressure(const TTimeStamp &time, Bool_t &inside) const
void SetLHCPeriod(TString lhcPeriod)
Definition: AliGRPObject.h:108
void SetSurfaceAtmosPressure(AliDCSSensor *const surfacePressure)
Definition: AliGRPObject.h:130
time_t GetTimeEnd() const
Definition: AliGRPObject.h:56
void ReadValuesFromMap(const TMap *map)
TObjArray * fMachineModeArray
Definition: AliGRPObject.h:220
Float_t * GetHallProbesArray(DP_HallProbes hp) const
void SetBeamEnergy(Float_t beamEnergy)
Definition: AliGRPObject.h:104
TObjArray * fQATrigClasses
Definition: AliGRPObject.h:221
AliDCSSensor * GetCavernAtmosPressure() const
Definition: AliGRPObject.h:75
void SetQATrigClasses(TObjArray *arr)
Definition: AliGRPObject.h:141
void SetHallProbes(DP_HallProbes hp, Float_t hall_probe, Stats stat)
Definition: AliGRPObject.h:132
void SetDipoleCurrent(Float_t dipoleCurrent, Stats stat)
Definition: AliGRPObject.h:123
void SetMaxTimeLHCValidity(Double_t maxTimeLHCValidity)
Definition: AliGRPObject.h:139
void SetNumberOfDetectors(Char_t numberOfDetectors)
Definition: AliGRPObject.h:106
void SetBeamType(TString beamType)
Definition: AliGRPObject.h:105
AliDCSSensor * fCavernAtmosPressure
Definition: AliGRPObject.h:209
static Float_t GetInvalidFloat()
Definition: AliGRPObject.h:146
void SetDetectorMask(UInt_t detectorMask)
Definition: AliGRPObject.h:107
Float_t GetHallProbes(Int_t hp) const
Definition: AliGRPObject.h:87
UInt_t fDetectorMask
Definition: AliGRPObject.h:197
TString fRunType
Definition: AliGRPObject.h:199
TObjArray * GetQACloningRequest() const
Definition: AliGRPObject.h:96
TObjArray * GetQATrigClasses() const
Definition: AliGRPObject.h:95
TString GetLHCState() const
Definition: AliGRPObject.h:63
void SetRunType(TString runType)
Definition: AliGRPObject.h:109
void SetQACloningRequest(TObjArray *arr)
Definition: AliGRPObject.h:142
void SetNFalseDataQualityFlag(Int_t nFalses)
Definition: AliGRPObject.h:166
Bool_t IsUniformBMap() const
Definition: AliGRPObject.h:54
Float_t * fCavernTemperature
Definition: AliGRPObject.h:207
AliDCSSensor * fSurfaceAtmosPressure
Definition: AliGRPObject.h:211
TString fLHCState
Definition: AliGRPObject.h:200
Float_t GetBeamEnergy() const
void SetPolarityConventionLHC(Bool_t v=kTRUE)
Definition: AliGRPObject.h:100
TArrayD * fFalseDataQualityFlag
Definition: AliGRPObject.h:226
Int_t fNFalseDataQualityFlag
Definition: AliGRPObject.h:225
void SetL3Polarity(Char_t l3Polarity)
Definition: AliGRPObject.h:114
TString fBeamTypeFromLHC
Definition: AliGRPObject.h:228
void SetCavernTemperature(Float_t cavernTemperature, Stats stat)
Definition: AliGRPObject.h:127
static const Int_t fgkInvalidUInt
Definition: AliGRPObject.h:184