Line data Source code
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 : /* $Id: AliTRDEntriesInfo.cxx 27946 2008-08-13 15:26:24Z cblume $ */
17 :
18 : ///////////////////////////////////////////////////////////////////////////////
19 : // //
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 //
24 : // //
25 : ///////////////////////////////////////////////////////////////////////////////
26 :
27 : #include "AliTRDEntriesInfo.h"
28 :
29 48 : ClassImp(AliTRDEntriesInfo)
30 :
31 : //_____________________________________________________________________________
32 : AliTRDEntriesInfo::AliTRDEntriesInfo()
33 0 : :AliTRDUshortInfo()
34 0 : {
35 : //
36 : // Default constructor
37 : //
38 :
39 0 : }
40 : //_____________________________________________________________________________
41 : AliTRDEntriesInfo::AliTRDEntriesInfo(Int_t n)
42 0 : :AliTRDUshortInfo(n)
43 0 : {
44 : //
45 : // Constructor that initializes a given size
46 : //
47 :
48 0 : }
49 : //_____________________________________________________________________________
50 : AliTRDEntriesInfo::AliTRDEntriesInfo(const AliTRDEntriesInfo &c)
51 0 : :AliTRDUshortInfo(c)
52 0 : {
53 : //
54 : // AliTRDEntriesInfo copy constructor
55 : //
56 :
57 0 : }
58 : //_____________________________________________________________________________
59 : AliTRDEntriesInfo::~AliTRDEntriesInfo()
60 0 : {
61 : //
62 : // AliTRDEntriesInfo destructor
63 : //
64 :
65 :
66 0 : }
67 : //_____________________________________________________________________________
68 : AliTRDEntriesInfo &AliTRDEntriesInfo::operator=(const AliTRDEntriesInfo &c)
69 : {
70 : //
71 : // Assignment operator
72 : //
73 :
74 0 : if (this != &c) ((AliTRDEntriesInfo &) c).Copy(*this);
75 0 : return *this;
76 :
77 : }
78 : //___________________________________________________________________________________
79 : Int_t AliTRDEntriesInfo::GetSum() const
80 : {
81 : //
82 : // Calculate the sum of entries
83 : //
84 :
85 : Int_t total = 0;
86 :
87 0 : for(Int_t k = 0; k < fSize; k++){
88 0 : total += fData[k];
89 : }
90 :
91 :
92 0 : return total;
93 :
94 : }
95 : //____________________________________________________________________________________________
96 : Bool_t AliTRDEntriesInfo::TestAdd(const AliTRDEntriesInfo * info)
97 : {
98 : //
99 : // add values
100 : //
101 0 : for (Int_t idata = 0; idata< fSize; idata++){
102 0 : if((At(idata)+info->At(idata)) > 65535) return kFALSE;
103 : }
104 0 : return kTRUE;
105 0 : }
106 : //____________________________________________________________________________________________
107 : void AliTRDEntriesInfo::Add(const AliTRDEntriesInfo * info)
108 : {
109 : //
110 : // add values
111 : //
112 0 : for (Int_t idata = 0; idata< fSize; idata++){
113 0 : fData[idata] += info->At(idata);
114 : }
115 0 : }
116 : //____________________________________________________________________________________________
117 : void AliTRDEntriesInfo::AddIf(const AliTRDEntriesInfo * info)
118 : {
119 : //
120 : // add values
121 : //
122 0 : for (Int_t idata = 0; idata< fSize; idata++){
123 0 : if(((fData[idata]+info->At(idata)) <= 65535) && ((fData[idata]+info->At(idata)) >= 0)) fData[idata] += info->At(idata);
124 : }
125 0 : }
|