unnecessary message suppressed
[u/mrichter/AliRoot.git] / PMD / AliPMDcluster.cxx
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 //                                                     //
17 //  Date   : August 05 2003                            //
18 //                                                     //
19 //  Store cluster information                          //
20 //                                                     //
21 //-----------------------------------------------------//
22 #include "Riostream.h"
23 #include "Rtypes.h"
24 #include "AliPMDcluster.h"
25 #include "AliLog.h"
26 #include <stdio.h>
27
28 ClassImp(AliPMDcluster)
29
30 AliPMDcluster::AliPMDcluster():
31   fDet(0),
32   fSMN(0)
33 {
34   // Default constructor
35   for (Int_t i = 0; i < 6; i++)
36     {
37       fClusData[i] = 0.;
38     }
39   for (Int_t i = 0; i < 19; i++)
40     {
41       fClusCellDataX[i] = 0;
42       fClusCellDataY[i] = 0;
43       fClusCellTrack[i] = -1;
44       fClusCellPid[i]   = -1;
45       fClusCellAdc[i]   = 0;
46     }
47
48 }
49 // --------------------------------------------------------------------- //
50 AliPMDcluster::AliPMDcluster(Int_t idet, Int_t ismn, Float_t *clusdata,
51                              Int_t *celldataX, Int_t *celldataY,
52                              Int_t *celltrack, Int_t *cellpid,
53                              Float_t *celladc):
54   fDet(idet),
55   fSMN(ismn)
56 {
57   // Constructor
58   for (Int_t i = 0; i < 6; i++)
59     {
60       fClusData[i] = clusdata[i];
61     }
62   if(fClusData[3] > 19.){
63     //AliError(Form("Too many clusters %f > 19",fClusData[3]));
64     fClusData[3] = 19.;
65   }
66              
67   for (Int_t i = 0; i < 19; i++)
68     {
69       fClusCellDataX[i] = celldataX[i];
70       fClusCellDataY[i] = celldataY[i];
71       fClusCellTrack[i] = celltrack[i];
72       fClusCellPid[i]   = cellpid[i];
73       fClusCellAdc[i]   = celladc[i];
74     }
75
76 }
77 // --------------------------------------------------------------------- //
78 AliPMDcluster::AliPMDcluster(AliPMDcluster *pmdcluster):
79   fDet(0),
80   fSMN(0)
81 {
82   *this = *pmdcluster;
83 }
84 // --------------------------------------------------------------------- //
85
86 AliPMDcluster::AliPMDcluster(const AliPMDcluster &pmdcluster):
87   TObject(pmdcluster),
88   fDet(pmdcluster.fDet),
89   fSMN(pmdcluster.fSMN)
90 {
91   //Copy Constructor 
92   for(Int_t i=0; i<6; i++)
93     {
94       this->fClusData[i] = pmdcluster.fClusData[i];
95     }
96   if(fClusData[3] > 19.){
97     //AliError(Form("Too many clusters %f > 19",fClusData[3]));
98     fClusData[3] = 19.;
99   }
100   for(Int_t i=0; i<19; i++)
101     {
102       this->fClusCellDataX[i] = pmdcluster.fClusCellDataX[i];
103       this->fClusCellDataY[i] = pmdcluster.fClusCellDataY[i];
104       this->fClusCellTrack[i] = pmdcluster.fClusCellTrack[i];
105       this->fClusCellPid[i]   = pmdcluster.fClusCellPid[i];
106       this->fClusCellAdc[i]   = pmdcluster.fClusCellAdc[i];
107     }
108 }
109 // --------------------------------------------------------------------- //
110
111 AliPMDcluster & AliPMDcluster::operator=(const AliPMDcluster &pmdcluster)
112 {
113   // Assignment operator 
114   if(this != &pmdcluster)
115     {
116       this->fDet = pmdcluster.fDet;
117       this->fSMN = pmdcluster.fSMN;
118       for(Int_t i=0; i<6; i++)
119         {
120           this->fClusData[i] = pmdcluster.fClusData[i];
121         }
122       if(fClusData[3] > 19.){
123         //AliError(Form("Too many clusters %f > 19",fClusData[3]));
124         fClusData[3] = 19.;
125       }
126       for(Int_t i=0; i<19; i++)
127         {
128           this->fClusCellDataX[i] = pmdcluster.fClusCellDataX[i];
129           this->fClusCellDataY[i] = pmdcluster.fClusCellDataY[i];
130           this->fClusCellTrack[i] = pmdcluster.fClusCellTrack[i];
131           this->fClusCellPid[i]   = pmdcluster.fClusCellPid[i];
132           this->fClusCellAdc[i]   = pmdcluster.fClusCellAdc[i];
133         }
134     }
135   return *this;
136 }
137 // --------------------------------------------------------------------- //
138
139 AliPMDcluster::~AliPMDcluster()
140 {
141   // Destructor
142 }
143 // --------------------------------------------------------------------- //
144
145 Int_t AliPMDcluster::GetDetector() const
146 {
147   return fDet;
148 }
149 // --------------------------------------------------------------------- //
150 Int_t AliPMDcluster::GetSMN() const
151 {
152   return fSMN;
153 }
154 // --------------------------------------------------------------------- //
155 Float_t AliPMDcluster::GetClusX() const
156 {
157   return fClusData[0];
158 }
159 // --------------------------------------------------------------------- //
160 Float_t AliPMDcluster::GetClusY() const
161 {
162   return fClusData[1];
163 }
164 // --------------------------------------------------------------------- //
165 Float_t AliPMDcluster::GetClusADC() const
166 {
167   return fClusData[2];
168 }
169 // --------------------------------------------------------------------- //
170 Float_t AliPMDcluster::GetClusCells() const
171 {
172   return fClusData[3];
173 }
174 // --------------------------------------------------------------------- //
175 Float_t AliPMDcluster::GetClusSigmaX() const
176 {
177   return fClusData[4];
178 }
179 // --------------------------------------------------------------------- //
180 Float_t AliPMDcluster::GetClusSigmaY() const
181 {
182   return fClusData[5];
183 }
184 // --------------------------------------------------------------------- //
185 Int_t AliPMDcluster::GetClusCellX(Int_t i) const
186 {
187   return fClusCellDataX[i];
188 }
189 // --------------------------------------------------------------------- //
190 Int_t AliPMDcluster::GetClusCellY(Int_t i) const
191 {
192   return fClusCellDataY[i];
193 }
194 // --------------------------------------------------------------------- //
195 Int_t AliPMDcluster::GetClusCellTrack(Int_t i) const
196 {
197   return fClusCellTrack[i];
198 }
199 // --------------------------------------------------------------------- //
200 Int_t AliPMDcluster::GetClusCellPid(Int_t i) const
201 {
202   return fClusCellPid[i];
203 }
204 // --------------------------------------------------------------------- //
205 Float_t AliPMDcluster::GetClusCellAdc(Int_t i) const
206 {
207   return fClusCellAdc[i];
208 }
209 // --------------------------------------------------------------------- //