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 /* $Id: AliTRDUshortInfo.cxx 27946 2008-08-13 15:26:24Z cblume $ */
18 ///////////////////////////////////////////////////////////////////////////////
20 // Calibration base class for a single ROC //
21 // Contains one UShort_t value per pad //
22 // However, values are set and get as float, there are stored internally as //
23 // (UShort_t) value * 10000 //
25 ///////////////////////////////////////////////////////////////////////////////
27 #include "AliTRDUshortInfo.h"
29 ClassImp(AliTRDUshortInfo)
31 //_____________________________________________________________________________
32 AliTRDUshortInfo::AliTRDUshortInfo()
38 // Default constructor
43 //_____________________________________________________________________________
44 AliTRDUshortInfo::AliTRDUshortInfo(Int_t n)
50 // Constructor that initializes a given size
53 fData = new UShort_t[fSize];
54 for(Int_t k = 0; k < fSize; k++){
60 //_____________________________________________________________________________
61 AliTRDUshortInfo::AliTRDUshortInfo(const AliTRDUshortInfo &c)
67 // AliTRDUshortInfo copy constructor
72 fData = new UShort_t[fSize];
73 for (iBin = 0; iBin < fSize; iBin++) {
74 fData[iBin] = ((AliTRDUshortInfo &) c).fData[iBin];
79 //_____________________________________________________________________________
80 AliTRDUshortInfo::~AliTRDUshortInfo()
83 // AliTRDUshortInfo destructor
93 //_____________________________________________________________________________
94 AliTRDUshortInfo &AliTRDUshortInfo::operator=(const AliTRDUshortInfo &c)
97 // Assignment operator
109 fData = new UShort_t[fSize];
110 for (Int_t iBin = 0; iBin < fSize; iBin++) {
111 fData[iBin] = c.fData[iBin];
118 //_____________________________________________________________________________
119 void AliTRDUshortInfo::Copy(TObject &c) const
127 ((AliTRDUshortInfo &) c).fSize = fSize;
129 if (((AliTRDUshortInfo &) c).fData) delete [] ((AliTRDUshortInfo &) c).fData;
130 ((AliTRDUshortInfo &) c).fData = new UShort_t[fSize];
131 for (iBin = 0; iBin < fSize; iBin++) {
132 ((AliTRDUshortInfo &) c).fData[iBin] = fData[iBin];
139 //_____________________________________________________________________________
140 void AliTRDUshortInfo::SetSize(Int_t n)
146 if(fData) delete [] fData;
147 fData = new UShort_t[n];