]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PHOS/AliPHOSCalibrationData.cxx
updating
[u/mrichter/AliRoot.git] / PHOS / AliPHOSCalibrationData.cxx
CommitLineData
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
36ClassImp(AliPHOSCalibrationData)
37
38
39//____________________________________________________________________________
00953b03 40 AliPHOSCalibrationData::AliPHOSCalibrationData():TObject()
41{
42 // default ctor : does nothing
ec642f76 43 fBegin=0;
44 fEnd=0;
45 fData = 0 ;
46 fDataCheck = 0 ;
47 fCategory="";
48 fVersion="" ;
49}
50
51//____________________________________________________________________________
00953b03 52 AliPHOSCalibrationData::AliPHOSCalibrationData(const char * category, const char * version, Int_t nchannels)
53{
54 // ctor: sets up the calibration IO
ec642f76 55 fData = new TArrayF(nchannels) ;
56 fDataCheck = new TArrayF(nchannels) ;
57 fCategory=category;
58 fVersion=version ;
59}
60//____________________________________________________________________________
00953b03 61AliPHOSCalibrationData::AliPHOSCalibrationData(const AliPHOSCalibrationData & cd)
a8c47ab6 62 : TObject(cd)
00953b03 63{
64 //copy ctor
ec642f76 65 fData = new TArrayF(*cd.fData) ;
66 fDataCheck = new TArrayF(*cd.fDataCheck) ;
67 fCategory=cd.fCategory;
68 fVersion=cd.fVersion ;
69}
70//____________________________________________________________________________
71 AliPHOSCalibrationData::~AliPHOSCalibrationData()
72{
00953b03 73 // dtor: deletes the arrays
ec642f76 74 if(fData){
75 delete fData ;
76 fData=0 ;
77 }
78 if(fDataCheck){
79 delete fDataCheck ;
80 fDataCheck=0;
81 }
82}
83//____________________________________________________________________________
00953b03 84Float_t AliPHOSCalibrationData::Data(Int_t channel)const
85{
86 // returns calibration data for a given channel
ec642f76 87 return fData->At(channel) ;
88}
89//____________________________________________________________________________
00953b03 90Float_t AliPHOSCalibrationData::DataCheck(Int_t channel)const
91{
92 // returns calibration data check for a given channel
ec642f76 93 return fDataCheck->At(channel) ;
94}
95//____________________________________________________________________________
00953b03 96AliPHOSCalibrationData & AliPHOSCalibrationData::operator = (const AliPHOSCalibrationData & rvalue)
97{
98 // overload of =
ec642f76 99 if(fData)
100 delete fData;
101 fData = new TArrayF(*rvalue.fData) ;
102 if(fDataCheck)
103 delete fDataCheck ;
104 fDataCheck = new TArrayF(*rvalue.fDataCheck) ;
105 fCategory=rvalue.fCategory;
106 fVersion=rvalue.fVersion ;
107 fBegin=rvalue.fBegin ;
108 fEnd = rvalue.fEnd ;
109 return *this ;
110}