1 /**************************************************************************
\r
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
\r
4 * Author: The ALICE Off-line Project. *
\r
5 * Contributors are mentioned in the code where appropriate. *
\r
7 * Permission to use, copy, modify and distribute this software and its *
\r
8 * documentation strictly for non-commercial purposes is hereby granted *
\r
9 * without fee, provided that the above copyright notice appears in all *
\r
10 * copies and that both the copyright notice and this permission notice *
\r
11 * appear in the supporting documentation. The authors make no claims *
\r
12 * about the suitability of this software for any purpose. It is *
\r
13 * provided "as is" without express or implied warranty. *
\r
14 **************************************************************************/
\r
18 // **********************
\r
19 // Class containing the GRP data that have to be stored in the OCDB.
\r
20 // Data come either from DAQ logbook or from DCS DB.
\r
21 // Processing of the data can also be performed here.
\r
22 // **********************
\r
25 #include <TObject.h>
\r
26 #include <TObjString.h>
\r
28 #include "AliGRPObject.h"
\r
29 #include "AliDCSSensor.h"
\r
32 ClassImp(AliGRPObject)
\r
34 const Float_t AliGRPObject::fgkInvalidFloat = 1E-33; // value to identify invalid data - float
\r
35 const TString AliGRPObject::fgkInvalidString = ""; // value to identify invalid data - string
\r
36 const Char_t AliGRPObject::fgkInvalidChar = -1; // value to identify invalid data - uchar
\r
37 const Int_t AliGRPObject::fgkInvalidInt = -1; // value to identify invalid data - uint
\r
38 const Int_t AliGRPObject::fgkInvalidUInt = 0; // value to identify invalid data - uint
\r
39 const Int_t AliGRPObject::fgknDCSDPHallProbes = 40; // number of dcs dps
\r
40 const char* AliGRPObject::fgkDCSDataPointsHallProbes[AliGRPObject::fgknDCSDPHallProbes] = {
\r
44 "L3_BSF17_Temperature",
\r
48 "L3_BSF4_Temperature",
\r
52 "L3_BKF17_Temperature",
\r
56 "L3_BKF4_Temperature",
\r
60 "L3_BSF13_Temperature",
\r
64 "L3_BSF8_Temperature",
\r
68 "L3_BKF13_Temperature",
\r
72 "L3_BKF8_Temperature",
\r
76 "Dipole_Inside_Temperature",
\r
77 "Dipole_Outside_H1",
\r
78 "Dipole_Outside_H2",
\r
79 "Dipole_Outside_H3",
\r
80 "Dipole_Outside_Temperature",
\r
83 //-----------------------------------------------------------------------------
\r
84 AliGRPObject::AliGRPObject():
\r
88 fTimeStart((time_t)fgkInvalidFloat),
\r
89 fTimeEnd((time_t)fgkInvalidFloat),
\r
90 fBeamEnergy(fgkInvalidFloat),
\r
91 fBeamType(fgkInvalidString),
\r
92 fNumberOfDetectors(fgkInvalidChar),
\r
93 fDetectorMask(fgkInvalidUInt),
\r
94 fLHCPeriod(fgkInvalidString),
\r
95 fRunType(fgkInvalidString),
\r
96 fLHCState(fgkInvalidString),
\r
97 fLHCLuminosity(new Float_t[fPoints]),
\r
98 fLHCLuminositySplineFit(0x0),
\r
99 fBeamIntensity(new Float_t[fPoints]),
\r
100 fBeamIntensitySplineFit(0x0),
\r
101 fL3Polarity(fgkInvalidChar),
\r
102 fDipolePolarity(fgkInvalidChar),
\r
103 fL3Current(new Float_t[fPoints]),
\r
104 fDipoleCurrent(new Float_t[fPoints]),
\r
105 fCavernTemperature(new Float_t[fPoints]),
\r
106 //fCavernAtmosPressure(new Float_t[fPoints]),
\r
107 fCavernAtmosPressure(0x0),
\r
108 fSurfaceAtmosPressure(0x0),
\r
113 // AliGRPObject default ctor
\r
116 fDimension = fgknDCSDPHallProbes*fPoints;
\r
117 fHallProbes = new Float_t[fDimension];
\r
119 for (Int_t nhp=0; nhp< fDimension; nhp++){
\r
120 fHallProbes[nhp] = fgkInvalidFloat;
\r
123 for (Int_t i = 0; i < fPoints; i++){
\r
125 fLHCLuminosity[i] = fgkInvalidFloat;
\r
126 fBeamIntensity[i] = fgkInvalidFloat;
\r
127 fL3Current[i] = fgkInvalidFloat;
\r
128 fDipoleCurrent[i] = fgkInvalidFloat;
\r
129 fCavernTemperature[i] = fgkInvalidFloat;
\r
130 // fCavernAtmosPressure[i] = fgkInvalidFloat;
\r
134 //-----------------------------------------------------------------------------
\r
136 AliGRPObject::AliGRPObject(const AliGRPObject &obj):
\r
138 fPoints(obj.fPoints),
\r
139 fDimension(obj.fDimension),
\r
140 fTimeStart(obj.fTimeStart),
\r
141 fTimeEnd(obj.fTimeEnd),
\r
142 fBeamEnergy(obj.fBeamEnergy),
\r
143 fBeamType(obj.fBeamType),
\r
144 fNumberOfDetectors(obj.fNumberOfDetectors),
\r
145 fDetectorMask(obj.fDetectorMask),
\r
146 fLHCPeriod(obj.fLHCPeriod),
\r
147 fRunType(obj.fRunType),
\r
148 fLHCState(obj.fLHCState),
\r
149 fLHCLuminosity(new Float_t[fPoints]),
\r
150 fLHCLuminositySplineFit(obj.fLHCLuminositySplineFit),
\r
151 fBeamIntensity(new Float_t[fPoints]),
\r
152 fBeamIntensitySplineFit(obj.fBeamIntensitySplineFit),
\r
153 fL3Polarity(obj.fL3Polarity),
\r
154 fDipolePolarity(obj.fDipolePolarity),
\r
155 fL3Current(new Float_t[fPoints]),
\r
156 fDipoleCurrent(new Float_t[fPoints]),
\r
157 fCavernTemperature(new Float_t[fPoints]),
\r
158 fCavernAtmosPressure(obj.fCavernAtmosPressure),
\r
159 fSurfaceAtmosPressure(obj.fSurfaceAtmosPressure),
\r
165 // AliGRPObject copy ctor
\r
168 for (Int_t nhp=0; nhp< fDimension; nhp++){
\r
169 fHallProbes[nhp] = obj.fHallProbes[nhp];
\r
172 for (Int_t i = 0; i < fPoints; i++){
\r
174 fLHCLuminosity[i] = obj.fLHCLuminosity[i];
\r
175 fBeamIntensity[i] = obj.fBeamIntensity[i];
\r
176 fL3Current[i] = obj.fL3Current[i];
\r
177 fDipoleCurrent[i] = obj.fDipoleCurrent[i];
\r
178 fCavernTemperature[i] = obj.fCavernTemperature[i];
\r
182 //-----------------------------------------------------------------------------
\r
184 AliGRPObject& AliGRPObject:: operator=(const AliGRPObject & obj)
\r
188 // AliGRPObject assignment operator
\r
191 this->fTimeStart = obj.GetTimeStart();
\r
192 this->fTimeEnd = obj.GetTimeEnd();
\r
193 this->fBeamEnergy = obj.GetBeamEnergy();
\r
194 this->fBeamType = obj.GetBeamType();
\r
195 this->fNumberOfDetectors = obj.GetNumberOfDetectors();
\r
196 this->fDetectorMask = obj.GetDetectorMask();
\r
197 this->fLHCPeriod = obj.GetLHCPeriod();
\r
198 this->fRunType = obj.GetRunType();
\r
199 this->fLHCState = obj.GetLHCState();
\r
200 this->fLHCLuminositySplineFit = obj.GetLHCLuminositySplineFit();
\r
201 this->fBeamIntensitySplineFit = obj.GetBeamIntensitySplineFit();
\r
202 this->fL3Polarity = obj.GetL3Polarity();
\r
203 this->fDipolePolarity = obj.GetDipolePolarity();
\r
204 this->fCavernAtmosPressure = obj.GetCavernAtmosPressure();
\r
205 this->fSurfaceAtmosPressure = obj.GetSurfaceAtmosPressure();
\r
206 this->fPoints = obj.GetPoints();
\r
207 this->fDimension = obj.GetDimension();
\r
209 this->fLHCLuminosity = new Float_t[fPoints];
\r
210 this->fBeamIntensity = new Float_t[fPoints];
\r
211 this->fL3Current = new Float_t[fPoints];
\r
212 this->fDipoleCurrent = new Float_t[fPoints];
\r
213 this->fCavernTemperature = new Float_t[fPoints];
\r
215 for (Int_t nhp=0; nhp< fDimension; nhp++){
\r
216 this->fHallProbes[nhp] = obj.GetHallProbes(nhp);
\r
219 for (Int_t i = 0; i < fPoints; i++){
\r
221 this->fLHCLuminosity[i] = obj.GetLHCLuminosity((Stats)i);
\r
222 this->fBeamIntensity[i] = obj.GetBeamIntensity((Stats)i);
\r
223 this->fL3Current[i] = obj.GetL3Current((Stats)i);
\r
224 this->fDipoleCurrent[i] = obj.GetDipoleCurrent((Stats)i);
\r
225 this->fCavernTemperature[i] = obj.GetCavernTemperature((Stats)i);
\r
231 //-----------------------------------------------------------------------------
\r
233 AliGRPObject::~AliGRPObject() {
\r
240 delete [] fHallProbes;
\r
241 delete [] fLHCLuminosity;
\r
242 delete [] fBeamIntensity;
\r
243 delete [] fL3Current;
\r
244 delete [] fDipoleCurrent;
\r
245 delete [] fCavernTemperature;
\r
247 if (fLHCLuminositySplineFit){
\r
248 delete fLHCLuminositySplineFit;
\r
249 fLHCLuminositySplineFit = 0x0;
\r
251 if (fBeamIntensitySplineFit){
\r
252 delete fBeamIntensitySplineFit;
\r
253 fBeamIntensitySplineFit = 0x0;
\r
255 if (fCavernAtmosPressure){
\r
256 delete fCavernAtmosPressure;
\r
257 fCavernAtmosPressure = 0x0;
\r
259 if (fSurfaceAtmosPressure){
\r
260 delete fSurfaceAtmosPressure;
\r
261 fSurfaceAtmosPressure = 0x0;
\r
265 //-----------------------------------------------------------------------------
\r
267 Float_t* AliGRPObject::GetHallProbes(DP_HallProbes hp) const {
\r
270 // method to return array of statistical
\r
271 // variables for Hall Probe hp
\r
274 Float_t * array = new Float_t[fPoints];
\r
275 Int_t shift = fPoints*(Int_t)hp;
\r
276 for (Int_t i=0;i<fPoints; i++){
\r
278 array[i] = fHallProbes[shift+i];
\r
285 //-------------------------------------------------------------------------------
\r
287 void AliGRPObject::SetHallProbes(DP_HallProbes hp, const Float_t* hall_probe){
\r
290 // method to set hall probe hp
\r
291 // from a given array
\r
294 Int_t shift = fPoints*hp;
\r
295 for (Int_t i = 0; i< fPoints; i++){
\r
297 fHallProbes[i+shift] = hall_probe[i];
\r
302 //-------------------------------------------------------------------------------
\r
304 void AliGRPObject::ReadValuesFromMap(const TMap* mapGRP){
\r
307 // method to set the values of the GRP parameters
\r
308 // reading them from the old format of the GRP
\r
309 // object, i.e. a TMap
\r
312 if (mapGRP->GetValue("fAliceStartTime")){
\r
313 SetTimeStart((time_t)(((TObjString*)(mapGRP->GetValue("fAliceStartTime")))->GetString()).Atoi());
\r
316 AliError(Form("No fAliceStartTime value found in GRP map!"));
\r
318 if (mapGRP->GetValue("fAliceStopTime")){
\r
319 SetTimeEnd((time_t)(((TObjString*)(mapGRP->GetValue("fAliceStopTime")))->GetString()).Atoi());
\r
323 AliError(Form("No fAliceStopTime value found in GRP map!"));
\r
326 if(mapGRP->GetValue("fAliceBeamEnergy")){
\r
327 SetBeamEnergy((((TObjString*)(mapGRP->GetValue("fAliceBeamEnergy")))->GetString()).Atof());
\r
330 AliError(Form("No fAliceBeamEnergy value found in GRP map!"));
\r
332 if(mapGRP->GetValue("fAliceBeamType")){
\r
333 SetBeamType(((TObjString*)(mapGRP->GetValue("fAliceBeamType")))->GetString());
\r
336 AliError(Form("No fAliceBeamType value found in GRP map!"));
\r
338 if(mapGRP->GetValue("fNumberOfDetectors")){
\r
339 SetNumberOfDetectors((Char_t)(((TObjString*)(mapGRP->GetValue("fNumberOfDetectors")))->GetString()).Atoi());
\r
342 AliError(Form("No fNumberOfDetectors value found in GRP map!"));
\r
344 if(mapGRP->GetValue("fDetectorMask")){
\r
345 SetDetectorMask((UInt_t)(((TObjString*)(mapGRP->GetValue("fDetectorMask")))->GetString()).Atoi());
\r
348 AliError(Form("No fDetectorMask value found in GRP map!"));
\r
350 if(mapGRP->GetValue("fLHCPeriod")){
\r
351 SetLHCPeriod(((TObjString*)(mapGRP->GetValue("fLHCPeriod")))->GetString());
\r
354 AliError(Form("No fLHCPeriod value found in GRP map!"));
\r
356 if(mapGRP->GetValue("fRunType")){
\r
357 SetRunType(((TObjString*)(mapGRP->GetValue("fRunType")))->GetString());
\r
360 AliError(Form("No fRunType value found in GRP map!"));
\r
362 if(mapGRP->GetValue("fLHCState")){
\r
363 SetLHCState(((TObjString*)(mapGRP->GetValue("fLHCState")))->GetString());
\r
366 AliError(Form("No fLHCState value found in GRP map!"));
\r
368 if(mapGRP->GetValue("fLHCluminosity")){
\r
369 AliInfo(Form("fLHCLuminosity found, but porting only average to the new object, since the other values are not available in the old object"));
\r
370 SetLHCLuminosity((Float_t)(((TObjString*)(mapGRP->GetValue("fLHCLuminosity")))->GetString()).Atof(),(Stats)0);
\r
373 AliError(Form("No fLHCLuminosity value found in GRP map!"));
\r
375 if(mapGRP->GetValue("fBeamIntensity")){
\r
376 AliInfo(Form("fBeamIntensity found, but porting only average to the new object, since the other values are not available in the old object"));
\r
377 SetBeamIntensity((Float_t)(((TObjString*)(mapGRP->GetValue("fBeamIntensity")))->GetString()).Atof(),(Stats)0);
\r
380 AliError(Form("No fBeamIntensity value found in GRP map!"));
\r
382 if(mapGRP->GetValue("fL3Polarity")){
\r
383 SetL3Polarity((Char_t)(((TObjString*)(mapGRP->GetValue("fL3Polarity")))->GetString()).Atoi());
\r
386 AliError(Form("No fL3Polarity value found in GRP map!"));
\r
388 if(mapGRP->GetValue("fDipolePolarity")){
\r
389 SetDipolePolarity((Char_t)(((TObjString*)(mapGRP->GetValue("fDipolePolarity")))->GetString()).Atoi());
\r
392 AliError(Form("No fDipolePolarity value found in GRP map!"));
\r
394 if(mapGRP->GetValue("fL3Current")){
\r
395 AliInfo(Form("fL3Current found, but porting only average to the new object, since the other values are not available in the old object"));
\r
396 SetL3Current((Float_t)(((TObjString*)(mapGRP->GetValue("fL3Current")))->GetString()).Atof(),(Stats)0);
\r
399 AliError(Form("No fL3Current value found in GRP map!"));
\r
401 if(mapGRP->GetValue("fDipoleCurrent")){
\r
402 AliInfo(Form("fDipoleCurrent found, but porting only average to the new object, since the other values are not available in the old object"));
\r
403 SetDipoleCurrent((Float_t)(((TObjString*)(mapGRP->GetValue("fDipoleCurrent")))->GetString()).Atof(),(Stats)0);
\r
406 AliError(Form("No fDipoleCurrent value found in GRP map!"));
\r
408 if(mapGRP->GetValue("fCavernTemperature")){
\r
409 AliInfo(Form("fCaverntemperature found, but porting only average to the new object, since the other values are not available in the old object"));
\r
410 SetCavernTemperature((Float_t)(((TObjString*)(mapGRP->GetValue("fCavernTemperature")))->GetString()).Atof(),(Stats)0);
\r
413 AliError(Form("No fCavernTemperature value found in GRP map!"));
\r
415 if(mapGRP->GetValue("fCavernAtmosPressure")){
\r
416 AliInfo(Form("fCavernAtmosPressure found, but not ported to the new object since of a different type"));
\r
419 AliError(Form("No fCavernAtmosPressure value found in GRP map!"));
\r
421 if(mapGRP->GetValue("fP2Pressure")){
\r
422 SetSurfaceAtmosPressure((AliDCSSensor*)((TObjString*)(mapGRP->GetValue("fP2Pressure"))));
\r
425 AliError(Form("No fP2Pressure value found in GRP map!"));
\r