]>
Commit | Line | Data |
---|---|---|
ec642f76 | 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 | ||
16 | ||
17 | //_________________________________________________________________________ | |
cd228525 | 18 | // Calibration data class contains two arrays: |
19 | // data themselves and their quality (or possibility to check | |
20 | // goodness of the data. | |
21 | // There are two kinds of data in PHOS "Gains" and "Pedestals" | |
22 | // each of them have as well title and validity range to distinguish | |
23 | // different calibrations. | |
ec642f76 | 24 | // |
25 | //*-- Author : D.Peressounko | |
26 | ////////////////////////////////////////////////////////////////////////////// | |
27 | ||
28 | // --- ROOT system --- | |
29 | ||
30 | // --- Standard library --- | |
31 | ||
32 | // --- AliRoot header files --- | |
33 | #include "AliPHOSCalibrationData.h" | |
34 | ||
35 | ||
36 | ClassImp(AliPHOSCalibrationData) | |
37 | ||
38 | ||
39 | //____________________________________________________________________________ | |
43fbaae1 | 40 | AliPHOSCalibrationData::AliPHOSCalibrationData(): |
41 | fCategory(), | |
42 | fVersion(), | |
43 | fData(0), | |
44 | fDataCheck(0), | |
45 | fBegin(0), | |
46 | fEnd(0) | |
00953b03 | 47 | { |
43fbaae1 | 48 | // default ctor |
ec642f76 | 49 | } |
50 | ||
51 | //____________________________________________________________________________ | |
43fbaae1 | 52 | AliPHOSCalibrationData::AliPHOSCalibrationData(const char * category, const char * version, Int_t nchannels): |
53 | fCategory(category), | |
54 | fVersion(version), | |
55 | fData(new TArrayF(nchannels)), | |
56 | fDataCheck(new TArrayF(nchannels)), | |
57 | fBegin(0), | |
58 | fEnd(0) | |
00953b03 | 59 | { |
60 | // ctor: sets up the calibration IO | |
ec642f76 | 61 | } |
43fbaae1 | 62 | |
ec642f76 | 63 | //____________________________________________________________________________ |
43fbaae1 | 64 | AliPHOSCalibrationData::AliPHOSCalibrationData(const AliPHOSCalibrationData & cd): |
65 | TObject(cd), | |
66 | fCategory(cd.fCategory), | |
67 | fVersion(cd.fVersion), | |
68 | fData(new TArrayF(*cd.fData)), | |
69 | fDataCheck(new TArrayF(*cd.fDataCheck)), | |
70 | fBegin(cd.fBegin), | |
71 | fEnd(cd.fEnd) | |
00953b03 | 72 | { |
73 | //copy ctor | |
ec642f76 | 74 | } |
43fbaae1 | 75 | |
ec642f76 | 76 | //____________________________________________________________________________ |
77 | AliPHOSCalibrationData::~AliPHOSCalibrationData() | |
78 | { | |
00953b03 | 79 | // dtor: deletes the arrays |
ec642f76 | 80 | if(fData){ |
81 | delete fData ; | |
82 | fData=0 ; | |
83 | } | |
84 | if(fDataCheck){ | |
85 | delete fDataCheck ; | |
86 | fDataCheck=0; | |
87 | } | |
88 | } | |
89 | //____________________________________________________________________________ | |
00953b03 | 90 | Float_t AliPHOSCalibrationData::Data(Int_t channel)const |
91 | { | |
92 | // returns calibration data for a given channel | |
ec642f76 | 93 | return fData->At(channel) ; |
94 | } | |
95 | //____________________________________________________________________________ | |
00953b03 | 96 | Float_t AliPHOSCalibrationData::DataCheck(Int_t channel)const |
97 | { | |
98 | // returns calibration data check for a given channel | |
ec642f76 | 99 | return fDataCheck->At(channel) ; |
100 | } | |
101 | //____________________________________________________________________________ | |
00953b03 | 102 | AliPHOSCalibrationData & AliPHOSCalibrationData::operator = (const AliPHOSCalibrationData & rvalue) |
103 | { | |
104 | // overload of = | |
ec642f76 | 105 | if(fData) |
106 | delete fData; | |
107 | fData = new TArrayF(*rvalue.fData) ; | |
108 | if(fDataCheck) | |
109 | delete fDataCheck ; | |
110 | fDataCheck = new TArrayF(*rvalue.fDataCheck) ; | |
111 | fCategory=rvalue.fCategory; | |
112 | fVersion=rvalue.fVersion ; | |
113 | fBegin=rvalue.fBegin ; | |
114 | fEnd = rvalue.fEnd ; | |
115 | return *this ; | |
116 | } |