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():TObject()
35 // Default constructor
48 //_____________________________________________________________________________
49 AliTRDCalROC::AliTRDCalROC(Int_t p, Int_t c):TObject()
52 // Constructor that initializes a given pad plane type
61 // The pad plane parameter
126 fNchannels = fNrows * fNcols;
128 fData = new UShort_t[fNchannels];
130 for (Int_t i=0; i<fNchannels; ++i)
134 //_____________________________________________________________________________
135 AliTRDCalROC::AliTRDCalROC(const AliTRDCalROC &c):TObject(c)
138 // AliTRDCalROC copy constructor
141 ((AliTRDCalROC &) c).Copy(*this);
145 //_____________________________________________________________________________
146 AliTRDCalROC::~AliTRDCalROC()
149 // AliTRDCalROC destructor
158 //_____________________________________________________________________________
159 AliTRDCalROC &AliTRDCalROC::operator=(const AliTRDCalROC &c)
162 // Assignment operator
165 if (this != &c) ((AliTRDCalROC &) c).Copy(*this);
170 //_____________________________________________________________________________
171 void AliTRDCalROC::Copy(TObject &c) const
177 ((AliTRDCalROC &) c).fPla = fPla;
178 ((AliTRDCalROC &) c).fCha = fCha;
180 ((AliTRDCalROC &) c).fNrows = fNrows;
181 ((AliTRDCalROC &) c).fNcols = fNcols;
185 ((AliTRDCalROC &) c).fNchannels = fNchannels;
187 if (((AliTRDCalROC &) c).fData) delete [] ((AliTRDCalROC &) c).fData;
188 ((AliTRDCalROC &) c).fData = new UShort_t[fNchannels];
189 for (iBin = 0; iBin < fNchannels; iBin++) {
190 ((AliTRDCalROC &) c).fData[iBin] = fData[iBin];
197 //_____________________________________________________________________________
198 void AliTRDCalROC::Scale(Float_t value)
201 // Scales all values of this ROC with the provided parameter. Is used if ROC defines
202 // local variations of a global (or per detector defined) parameter
205 for (Int_t iBin = 0; iBin < fNchannels; iBin++) {
206 fData[iBin] = (UShort_t) (value * fData[iBin]);