]>
Commit | Line | Data |
---|---|---|
3dedb44a | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
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 | **************************************************************************/ | |
15 | ||
9edefa04 | 16 | /* $Id$ */ |
17 | ||
3dedb44a | 18 | //----------------------------------------------------------------- |
19 | // AliGRPDCS class | |
20 | // This class deals with the DCS related info of the GRP | |
21 | // Origin: Panos Christakoglou, UOA-CERN, Panos.Christakoglou@cern.ch | |
22 | //----------------------------------------------------------------- | |
23 | ||
24 | #include "AliGRPDCS.h" | |
25 | ||
26 | #include "AliDCSValue.h" | |
27 | ||
28 | //#include <TObjString.h> | |
29 | class TObjString; | |
30 | ||
31 | #include <TH1.h> | |
9edefa04 | 32 | #include <TObjArray.h> |
3dedb44a | 33 | |
34 | ClassImp(AliGRPDCS) | |
35 | ||
36 | //_______________________________________________________________ | |
37 | AliGRPDCS::AliGRPDCS(): | |
38 | TObject(), fDCSArray(new TObjArray()) { | |
39 | // default constructor | |
40 | ||
41 | } | |
42 | ||
43 | //_______________________________________________________________ | |
44 | AliGRPDCS::AliGRPDCS(TObjArray *dcsArray): | |
45 | TObject() { | |
46 | // constructor | |
47 | fDCSArray = new TObjArray(); | |
48 | fDCSArray = dcsArray; | |
49 | } | |
50 | ||
51 | //___________________________________________________________________________ | |
52 | AliGRPDCS::AliGRPDCS(const AliGRPDCS& grpDcs): | |
53 | TObject(grpDcs) { | |
54 | //copy constructor | |
55 | ||
56 | if (grpDcs.fDCSArray) fDCSArray = new TObjArray(); | |
57 | } | |
58 | ||
59 | //_______________________________________________________________ | |
60 | const char* AliGRPDCS::ProcessDCS(TH1 *h) { | |
61 | // process the dcs float values | |
62 | Float_t fFDCSArraySum = 0.0, fFDCSArrayMean = 0.0; | |
63 | for(Int_t i = 0; i < fDCSArray->GetEntries(); i++) { | |
64 | AliDCSValue *v = (AliDCSValue *)fDCSArray->At(i); | |
65 | h->Fill(v->GetFloat()); | |
66 | fFDCSArraySum += v->GetFloat(); | |
67 | } | |
68 | fFDCSArrayMean = fFDCSArraySum/fDCSArray->GetEntries(); | |
69 | TString fDCSDataPointValue; fDCSDataPointValue += fFDCSArrayMean; | |
70 | ||
71 | return fDCSDataPointValue.Data(); | |
72 | } | |
73 |