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: AliTRDEntriesInfo.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 "AliTRDEntriesInfo.h"
29 ClassImp(AliTRDEntriesInfo)
31 //_____________________________________________________________________________
32 AliTRDEntriesInfo::AliTRDEntriesInfo()
36 // Default constructor
40 //_____________________________________________________________________________
41 AliTRDEntriesInfo::AliTRDEntriesInfo(Int_t n)
45 // Constructor that initializes a given size
49 //_____________________________________________________________________________
50 AliTRDEntriesInfo::AliTRDEntriesInfo(const AliTRDEntriesInfo &c)
54 // AliTRDEntriesInfo copy constructor
58 //_____________________________________________________________________________
59 AliTRDEntriesInfo::~AliTRDEntriesInfo()
62 // AliTRDEntriesInfo destructor
67 //_____________________________________________________________________________
68 AliTRDEntriesInfo &AliTRDEntriesInfo::operator=(const AliTRDEntriesInfo &c)
71 // Assignment operator
74 if (this != &c) ((AliTRDEntriesInfo &) c).Copy(*this);
78 //___________________________________________________________________________________
79 Int_t AliTRDEntriesInfo::GetSum() const
82 // Calculate the sum of entries
87 for(Int_t k = 0; k < fSize; k++){
95 //____________________________________________________________________________________________
96 Bool_t AliTRDEntriesInfo::TestAdd(const AliTRDEntriesInfo * info)
101 for (Int_t idata = 0; idata< fSize; idata++){
102 if((At(idata)+info->At(idata)) > 65535) return kFALSE;
106 //____________________________________________________________________________________________
107 void AliTRDEntriesInfo::Add(const AliTRDEntriesInfo * info)
112 for (Int_t idata = 0; idata< fSize; idata++){
113 fData[idata] += info->At(idata);
116 //____________________________________________________________________________________________
117 void AliTRDEntriesInfo::AddIf(const AliTRDEntriesInfo * info)
122 for (Int_t idata = 0; idata< fSize; idata++){
123 if(((fData[idata]+info->At(idata)) <= 65535) && ((fData[idata]+info->At(idata)) >= 0)) fData[idata] += info->At(idata);