]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PMD/AliPMDcluster.cxx
Warning fTime initialization fixed
[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 }
703b5eb7 62 if(fClusData[3]>19){
63 AliError(Form("Too many clusters %d >= 19",fClusData[3]));
64 fClusData[3] = 19;
65 }
66
37edc588 67 for (Int_t i = 0; i < 19; i++)
dc9f9910 68 {
69 fClusCellDataX[i] = celldataX[i];
70 fClusCellDataY[i] = celldataY[i];
920e13db 71 fClusCellTrack[i] = celltrack[i];
72 fClusCellPid[i] = cellpid[i];
b0e4d1e1 73 fClusCellAdc[i] = celladc[i];
dc9f9910 74 }
75
1cbf30ea 76}
a48edddd 77// --------------------------------------------------------------------- //
78AliPMDcluster::AliPMDcluster(AliPMDcluster *pmdcluster):
79 fDet(0),
80 fSMN(0)
81{
82 *this = *pmdcluster;
83}
84// --------------------------------------------------------------------- //
85
86AliPMDcluster::AliPMDcluster(const AliPMDcluster &pmdcluster):
87 TObject(pmdcluster),
88 fDet(pmdcluster.fDet),
89 fSMN(pmdcluster.fSMN)
a918d77a 90{
91 //Copy Constructor
dc9f9910 92 for(Int_t i=0; i<6; i++)
a918d77a 93 {
94 this->fClusData[i] = pmdcluster.fClusData[i];
95 }
703b5eb7 96 if(fClusData[3]>19){
97 AliError(Form("Too many clusters %d >= 19",fClusData[3]));
98 fClusData[3] = 19;
99 }
37edc588 100 for(Int_t i=0; i<19; i++)
dc9f9910 101 {
102 this->fClusCellDataX[i] = pmdcluster.fClusCellDataX[i];
103 this->fClusCellDataY[i] = pmdcluster.fClusCellDataY[i];
920e13db 104 this->fClusCellTrack[i] = pmdcluster.fClusCellTrack[i];
105 this->fClusCellPid[i] = pmdcluster.fClusCellPid[i];
b0e4d1e1 106 this->fClusCellAdc[i] = pmdcluster.fClusCellAdc[i];
dc9f9910 107 }
a918d77a 108}
a48edddd 109// --------------------------------------------------------------------- //
a918d77a 110
111AliPMDcluster & AliPMDcluster::operator=(const AliPMDcluster &pmdcluster)
1cbf30ea 112{
a918d77a 113 // Assignment operator
a48edddd 114 if(this != &pmdcluster)
a918d77a 115 {
a48edddd 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 }
703b5eb7 122 if(fClusData[3]>19){
123 AliError(Form("Too many clusters %d >= 19",fClusData[3]));
124 fClusData[3] = 19;
125 }
37edc588 126 for(Int_t i=0; i<19; i++)
a48edddd 127 {
128 this->fClusCellDataX[i] = pmdcluster.fClusCellDataX[i];
129 this->fClusCellDataY[i] = pmdcluster.fClusCellDataY[i];
920e13db 130 this->fClusCellTrack[i] = pmdcluster.fClusCellTrack[i];
131 this->fClusCellPid[i] = pmdcluster.fClusCellPid[i];
b0e4d1e1 132 this->fClusCellAdc[i] = pmdcluster.fClusCellAdc[i];
a48edddd 133 }
dc9f9910 134 }
a918d77a 135 return *this;
136}
a48edddd 137// --------------------------------------------------------------------- //
1cbf30ea 138
a918d77a 139AliPMDcluster::~AliPMDcluster()
140{
141 // Destructor
1cbf30ea 142}
a48edddd 143// --------------------------------------------------------------------- //
afef6247 144
145Int_t AliPMDcluster::GetDetector() const
146{
147 return fDet;
148}
a48edddd 149// --------------------------------------------------------------------- //
afef6247 150Int_t AliPMDcluster::GetSMN() const
151{
152 return fSMN;
153}
a48edddd 154// --------------------------------------------------------------------- //
1cbf30ea 155Float_t AliPMDcluster::GetClusX() const
156{
157 return fClusData[0];
158}
a48edddd 159// --------------------------------------------------------------------- //
1cbf30ea 160Float_t AliPMDcluster::GetClusY() const
161{
162 return fClusData[1];
163}
a48edddd 164// --------------------------------------------------------------------- //
1cbf30ea 165Float_t AliPMDcluster::GetClusADC() const
166{
167 return fClusData[2];
168}
a48edddd 169// --------------------------------------------------------------------- //
1cbf30ea 170Float_t AliPMDcluster::GetClusCells() const
171{
172 return fClusData[3];
173}
a48edddd 174// --------------------------------------------------------------------- //
dc9f9910 175Float_t AliPMDcluster::GetClusSigmaX() const
1cbf30ea 176{
177 return fClusData[4];
178}
a48edddd 179// --------------------------------------------------------------------- //
dc9f9910 180Float_t AliPMDcluster::GetClusSigmaY() const
181{
182 return fClusData[5];
183}
a48edddd 184// --------------------------------------------------------------------- //
dc9f9910 185Int_t AliPMDcluster::GetClusCellX(Int_t i) const
186{
187 return fClusCellDataX[i];
188}
a48edddd 189// --------------------------------------------------------------------- //
dc9f9910 190Int_t AliPMDcluster::GetClusCellY(Int_t i) const
191{
192 return fClusCellDataY[i];
193}
a48edddd 194// --------------------------------------------------------------------- //
920e13db 195Int_t AliPMDcluster::GetClusCellTrack(Int_t i) const
196{
197 return fClusCellTrack[i];
198}
199// --------------------------------------------------------------------- //
200Int_t AliPMDcluster::GetClusCellPid(Int_t i) const
201{
202 return fClusCellPid[i];
203}
204// --------------------------------------------------------------------- //
b0e4d1e1 205Float_t AliPMDcluster::GetClusCellAdc(Int_t i) const
206{
207 return fClusCellAdc[i];
208}
209// --------------------------------------------------------------------- //