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