1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
16 ////////////////////////////////////////////////////////////////////////////////
18 // This class represents the value(s) of a the LHC DPs at a given timestamp //
19 // The variuos measurement that occurred at the same timestamp are associated //
20 // to the same timestamp. //
22 ////////////////////////////////////////////////////////////////////////////////
25 #include "AliDCSArray.h"
28 //#include "TTimeStamp.h"
29 #include <TObjArray.h>
30 #include <TObjString.h>
36 AliDCSArray::AliDCSArray() :
50 // default constructor
54 //--------------------------------------------------------------------------
55 AliDCSArray::AliDCSArray(Int_t nentries, Bool_t* value, Double_t timeStamp) :
59 fBool(new Bool_t[fnentries]),
65 fTimeStamp(timeStamp),
69 // constructor for Bool
72 for (Int_t i = 0; i<fnentries; i++){
77 //--------------------------------------------------------------------------
78 AliDCSArray::AliDCSArray(Int_t nentries, Char_t* value, Double_t timeStamp) :
83 fChar(new Char_t[fnentries]),
88 fTimeStamp(timeStamp),
92 // constructor for Char
94 for (Int_t i = 0; i<fnentries; i++){
99 //-------------------------------------------------------------------------
100 AliDCSArray::AliDCSArray(Int_t nentries, Int_t* value, Double_t timeStamp) :
106 fInt(new Int_t[fnentries]),
110 fTimeStamp(timeStamp),
114 // constructor for Int
116 for (Int_t i = 0; i<fnentries; i++){
121 //-------------------------------------------------------------------------
122 AliDCSArray::AliDCSArray(Int_t nentries, UInt_t* value, Double_t timeStamp) :
129 fUInt(new UInt_t[fnentries]),
132 fTimeStamp(timeStamp),
136 // constructor for UInt
139 for (Int_t i = 0; i<fnentries; i++){
144 //-------------------------------------------------------------------------
145 AliDCSArray::AliDCSArray(Int_t nentries, Float_t* value, Double_t timeStamp) :
153 fFloat(new Float_t[fnentries]),
155 fTimeStamp(timeStamp),
159 // constructor for Float
162 for (Int_t i = 0; i<fnentries; i++){
163 fFloat[i] = value[i];
166 //-------------------------------------------------------------------------
167 AliDCSArray::AliDCSArray(Int_t nentries, Double_t* value, Double_t timeStamp) :
177 fTimeStamp(timeStamp),
178 fDouble(new Double_t[fnentries])
181 // constructor for Double
184 for (Int_t i = 0; i<fnentries; i++){
185 fDouble[i] = value[i];
189 //------------------------------------------------------------------------
190 AliDCSArray::AliDCSArray(Int_t nentries, TObjArray* value, Double_t timeStamp) :
199 fStringArray(new TObjArray()),
200 fTimeStamp(timeStamp),
204 // constructor for String
207 fStringArray->SetOwner(1);
208 for (Int_t i = 0; i<fnentries; i++){
209 TObjString* strobj = new TObjString();
210 strobj->SetString(((TObjString*)value->At(i))->String());
211 fStringArray->Add(strobj);
215 //-----------------------------------------------------------------------
216 AliDCSArray::~AliDCSArray()
242 if (fStringArray!=0x0){
252 //-----------------------------------------------------------------------
253 void AliDCSArray::Init()
256 // init helper, that initializes everything to 0