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 **************************************************************************/
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 "AliTRDCalROC.h"
29 ClassImp(AliTRDCalROC)
31 //_____________________________________________________________________________
32 AliTRDCalROC::AliTRDCalROC()
42 // Default constructor
47 //_____________________________________________________________________________
48 AliTRDCalROC::AliTRDCalROC(Int_t p, Int_t c)
58 // Constructor that initializes a given pad plane type
62 // The pad plane parameter
127 fNchannels = fNrows * fNcols;
128 if (fNchannels != 0) {
129 fData = new UShort_t[fNchannels];
132 for (Int_t i=0; i<fNchannels; ++i) {
138 //_____________________________________________________________________________
139 AliTRDCalROC::AliTRDCalROC(const AliTRDCalROC &c)
145 ,fNchannels(c.fNchannels)
149 // AliTRDCalROC copy constructor
154 if (((AliTRDCalROC &) c).fData) delete [] ((AliTRDCalROC &) c).fData;
155 ((AliTRDCalROC &) c).fData = new UShort_t[fNchannels];
156 for (iBin = 0; iBin < fNchannels; iBin++) {
157 ((AliTRDCalROC &) c).fData[iBin] = fData[iBin];
162 //_____________________________________________________________________________
163 AliTRDCalROC::~AliTRDCalROC()
166 // AliTRDCalROC destructor
176 //_____________________________________________________________________________
177 AliTRDCalROC &AliTRDCalROC::operator=(const AliTRDCalROC &c)
180 // Assignment operator
183 if (this != &c) ((AliTRDCalROC &) c).Copy(*this);
188 //_____________________________________________________________________________
189 void AliTRDCalROC::Copy(TObject &c) const
195 ((AliTRDCalROC &) c).fPla = fPla;
196 ((AliTRDCalROC &) c).fCha = fCha;
198 ((AliTRDCalROC &) c).fNrows = fNrows;
199 ((AliTRDCalROC &) c).fNcols = fNcols;
203 ((AliTRDCalROC &) c).fNchannels = fNchannels;
205 if (((AliTRDCalROC &) c).fData) delete [] ((AliTRDCalROC &) c).fData;
206 ((AliTRDCalROC &) c).fData = new UShort_t[fNchannels];
207 for (iBin = 0; iBin < fNchannels; iBin++) {
208 ((AliTRDCalROC &) c).fData[iBin] = fData[iBin];
215 //_____________________________________________________________________________
216 void AliTRDCalROC::Scale(Float_t value)
219 // Scales all values of this ROC with the provided parameter. Is used if ROC defines
220 // local variations of a global (or per detector defined) parameter
223 for (Int_t iBin = 0; iBin < fNchannels; iBin++) {
224 fData[iBin] = (UShort_t) (value * fData[iBin]);