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: AliTPCclusterKr.cxx,v 1.7 2008/01/22 17:24:53 matyja Exp $ */
18 //-----------------------------------------------------------------
19 // Implementation of the TPC Kr cluster class
21 // Origin: Adam Matyja, INP PAN, adam.matyja@ifj.edu.pl
22 //-----------------------------------------------------------------
24 #include "AliTPCclusterKr.h"
25 #include "AliCluster.h"
26 #include "AliTPCvtpr.h"
27 #include "TObjArray.h"
29 ClassImp(AliTPCclusterKr)
32 AliTPCclusterKr::AliTPCclusterKr()
46 // default constructor
48 fCluster=new TObjArray();
51 AliTPCclusterKr::AliTPCclusterKr(const AliTPCclusterKr ¶m)
67 fADCcluster = param.fADCcluster;
69 fNPads = param.fNPads;
70 fNRows = param.fNRows;
72 // fCluster = param.fCluster;
73 fCenterX = param.fCenterX;
74 fCenterY = param.fCenterY;
75 fCenterT = param.fCenterT;
76 fCluster=new TObjArray(*(param.fCluster));
80 AliTPCclusterKr &AliTPCclusterKr::operator = (const AliTPCclusterKr & param)
83 // assignment operator
85 (AliCluster&)(*this) = (AliCluster&)param;
86 fADCcluster = param.fADCcluster;
88 fNPads = param.fNPads;
89 fNRows = param.fNRows;
91 // fCluster=param.fCluster;
92 fCenterX = param.fCenterX;
93 fCenterY = param.fCenterY;
94 fCenterT = param.fCenterT;
96 fCluster=new TObjArray(*(param.fCluster));
101 AliTPCclusterKr::~AliTPCclusterKr()
106 if(fCluster)delete fCluster;
110 ////____________________________________________________________________________
111 void AliTPCclusterKr::SetCenter(){
113 // calculate geometrical center of the cluster
121 for(Int_t iter = 0; iter < fCluster->GetEntriesFast(); ++iter) {
122 AliTPCvtpr *iclus=(AliTPCvtpr *)fCluster->At(iter);
124 //for( std::vector<AliTPCvtpr*>::iterator iclus = fCluster.begin();
125 //iclus != fCluster.end(); ++iclus ) {
126 adc = (iclus)->GetAdc();
128 rX += ((iclus)->GetX() * adc);
129 rY += ((iclus)->GetY() * adc);
130 rT += ((iclus)->GetTime() * adc);
132 fCenterX=rX/fADCcluster;
133 fCenterY=rY/fADCcluster;
134 fCenterT=rT/fADCcluster;