]>
Commit | Line | Data |
---|---|---|
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 | |
29 | ClassImp(AliTPCclusterKr) | |
30 | ||
31 | ||
32 | AliTPCclusterKr::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 | ||
51 | AliTPCclusterKr::AliTPCclusterKr(const AliTPCclusterKr ¶m) | |
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 | ||
80 | AliTPCclusterKr &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 | ||
101 | AliTPCclusterKr::~AliTPCclusterKr() | |
102 | { | |
103 | // | |
104 | // destructor | |
105 | // | |
26a97212 | 106 | if(fCluster) { |
107 | fCluster->SetOwner(kTRUE); | |
108 | fCluster->Delete(); | |
109 | delete fCluster; | |
110 | } | |
26c9927d | 111 | fCluster=0; |
9a1e27fe | 112 | } |
b67657b5 | 113 | |
114 | ////____________________________________________________________________________ | |
115 | void AliTPCclusterKr::SetCenter(){ | |
26c9927d | 116 | // |
117 | // calculate geometrical center of the cluster | |
118 | // | |
b67657b5 | 119 | Double_t rX=0; |
120 | Double_t rY=0; | |
121 | Double_t rT=0; | |
122 | ||
123 | Short_t adc; | |
124 | fADCcluster=0; | |
26c9927d | 125 | for(Int_t iter = 0; iter < fCluster->GetEntriesFast(); ++iter) { |
126 | AliTPCvtpr *iclus=(AliTPCvtpr *)fCluster->At(iter); | |
127 | ||
128 | //for( std::vector<AliTPCvtpr*>::iterator iclus = fCluster.begin(); | |
129 | //iclus != fCluster.end(); ++iclus ) { | |
130 | adc = (iclus)->GetAdc(); | |
b67657b5 | 131 | fADCcluster+=adc; |
26c9927d | 132 | rX += ((iclus)->GetX() * adc); |
133 | rY += ((iclus)->GetY() * adc); | |
87ef42d4 | 134 | rT += ((iclus)->GetT() * adc); |
b67657b5 | 135 | } |
136 | fCenterX=rX/fADCcluster; | |
137 | fCenterY=rY/fADCcluster; | |
138 | fCenterT=rT/fADCcluster; | |
139 | ||
140 | return; | |
141 | } |