]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TPC/AliTPCclusterKr.cxx
DA component using exactly the same DA
[u/mrichter/AliRoot.git] / TPC / AliTPCclusterKr.cxx
CommitLineData
9a1e27fe 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: AliTPCclusterKr.cxx,v 1.7 2008/01/22 17:24:53 matyja Exp $ */
17
18//-----------------------------------------------------------------
19// Implementation of the TPC Kr cluster class
20//
21// Origin: Adam Matyja, INP PAN, adam.matyja@ifj.edu.pl
22//-----------------------------------------------------------------
23
24#include "AliTPCclusterKr.h"
26c9927d 25#include "AliCluster.h"
9a1e27fe 26#include "AliTPCvtpr.h"
26c9927d 27#include "TObjArray.h"
9a1e27fe 28
29ClassImp(AliTPCclusterKr)
30
31
32AliTPCclusterKr::AliTPCclusterKr()
26c9927d 33:AliCluster(),
34 fMax(),
b67657b5 35 fADCcluster(0),
36 fSec(0),
37 fNPads(0),
38 fNRows(0),
39 fSize(0),
40 fCenterX(0),
41 fCenterY(0),
26c9927d 42 fCenterT(0),
43 fCluster(0)
9a1e27fe 44{
45//
46// default constructor
47//
26c9927d 48 fCluster=new TObjArray();
9a1e27fe 49}
50
51AliTPCclusterKr::AliTPCclusterKr(const AliTPCclusterKr &param)
26c9927d 52:AliCluster(param),
53 fMax(),
b67657b5 54 fADCcluster(0),
55 fSec(0),
56 fNPads(0),
57 fNRows(0),
58 fSize(0),
59 fCenterX(0),
60 fCenterY(0),
26c9927d 61 fCenterT(0),
62 fCluster(0)
9a1e27fe 63{
64//
65// copy constructor
66//
67 fADCcluster = param.fADCcluster;
b67657b5 68 fSec = param.fSec ;
69 fNPads = param.fNPads;
70 fNRows = param.fNRows;
9a1e27fe 71 fMax = param.fMax;
26c9927d 72 // fCluster = param.fCluster;
b67657b5 73 fCenterX = param.fCenterX;
74 fCenterY = param.fCenterY;
75 fCenterT = param.fCenterT;
26c9927d 76 fCluster=new TObjArray(*(param.fCluster));
77 fSize = param.fSize;
9a1e27fe 78}
79
80AliTPCclusterKr &AliTPCclusterKr::operator = (const AliTPCclusterKr & param)
81{
26c9927d 82 //
83 // assignment operator
84 //
85 (AliCluster&)(*this) = (AliCluster&)param;
9a1e27fe 86 fADCcluster = param.fADCcluster;
b67657b5 87 fSec = param.fSec ;
88 fNPads = param.fNPads;
89 fNRows = param.fNRows;
9a1e27fe 90 fMax = param.fMax;
26c9927d 91 // fCluster=param.fCluster;
b67657b5 92 fCenterX = param.fCenterX;
93 fCenterY = param.fCenterY;
94 fCenterT = param.fCenterT;
26c9927d 95 delete fCluster;
96 fCluster=new TObjArray(*(param.fCluster));
97 fSize=param.fSize;
9a1e27fe 98 return (*this);
99}
100
101AliTPCclusterKr::~AliTPCclusterKr()
102{
103 //
104 // destructor
105 //
26c9927d 106 if(fCluster)delete fCluster;
107 fCluster=0;
9a1e27fe 108}
b67657b5 109
110////____________________________________________________________________________
111void AliTPCclusterKr::SetCenter(){
26c9927d 112 //
113 // calculate geometrical center of the cluster
114 //
b67657b5 115 Double_t rX=0;
116 Double_t rY=0;
117 Double_t rT=0;
118
119 Short_t adc;
120 fADCcluster=0;
26c9927d 121 for(Int_t iter = 0; iter < fCluster->GetEntriesFast(); ++iter) {
122 AliTPCvtpr *iclus=(AliTPCvtpr *)fCluster->At(iter);
123
124 //for( std::vector<AliTPCvtpr*>::iterator iclus = fCluster.begin();
125 //iclus != fCluster.end(); ++iclus ) {
126 adc = (iclus)->GetAdc();
b67657b5 127 fADCcluster+=adc;
26c9927d 128 rX += ((iclus)->GetX() * adc);
129 rY += ((iclus)->GetY() * adc);
130 rT += ((iclus)->GetTime() * adc);
b67657b5 131 }
132 fCenterX=rX/fADCcluster;
133 fCenterY=rY/fADCcluster;
134 fCenterT=rT/fADCcluster;
135
136 return;
137}