1 /**************************************************************************
\r
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
\r
4 * Author: The ALICE Off-line Project. *
\r
5 * Contributors are mentioned in the code where appropriate. *
\r
7 * Permission to use, copy, modify and distribute this software and its *
\r
8 * documentation strictly for non-commercial purposes is hereby granted *
\r
9 * without fee, provided that the above copyright notice appears in all *
\r
10 * copies and that both the copyright notice and this permission notice *
\r
11 * appear in the supporting documentation. The authors make no claims *
\r
12 * about the suitability of this software for any purpose. It is *
\r
13 * provided "as is" without express or implied warranty. *
\r
14 **************************************************************************/
\r
16 /* $Id: AliTPCclusterKr.cxx,v 1.7 2008/01/22 17:24:53 matyja Exp $ */
\r
18 //-----------------------------------------------------------------
\r
19 // Implementation of the TPC Kr cluster class
\r
21 // Origin: Adam Matyja, INP PAN, adam.matyja@ifj.edu.pl
\r
22 //-----------------------------------------------------------------
\r
24 #include "AliTPCclusterKr.h"
\r
25 #include "AliCluster.h"
\r
26 #include "AliTPCvtpr.h"
\r
27 #include "TObjArray.h"
\r
30 #include "TArrayI.h"
\r
32 ClassImp(AliTPCclusterKr)
\r
35 AliTPCclusterKr::AliTPCclusterKr()
\r
54 // default constructor
\r
56 fCluster=new TObjArray();
\r
59 AliTPCclusterKr::AliTPCclusterKr(const AliTPCclusterKr ¶m)
\r
80 fADCcluster = param.fADCcluster;
\r
82 fNPads = param.fNPads;
\r
83 fNRows = param.fNRows;
\r
85 // fCluster = param.fCluster;
\r
86 fCenterX = param.fCenterX;
\r
87 fCenterY = param.fCenterY;
\r
88 fCenterT = param.fCenterT;
\r
89 fCluster=new TObjArray(*(param.fCluster));
\r
90 fSize = param.fSize;
\r
91 fTimebins1D = param.fTimebins1D;
\r
92 fPads1D = param.fPads1D;
\r
93 fPadRMS = param.fPadRMS;
\r
94 fRowRMS = param.fRowRMS;
\r
95 fTimebinRMS = param.fTimebinRMS;
\r
98 AliTPCclusterKr &AliTPCclusterKr::operator = (const AliTPCclusterKr & param)
\r
101 // assignment operator
\r
103 (AliCluster&)(*this) = (AliCluster&)param;
\r
104 fADCcluster = param.fADCcluster;
\r
105 fSec = param.fSec ;
\r
106 fNPads = param.fNPads;
\r
107 fNRows = param.fNRows;
\r
109 // fCluster=param.fCluster;
\r
110 fCenterX = param.fCenterX;
\r
111 fCenterY = param.fCenterY;
\r
112 fCenterT = param.fCenterT;
\r
114 fCluster=new TObjArray(*(param.fCluster));
\r
116 fTimebins1D = param.fTimebins1D;
\r
117 fPads1D = param.fPads1D;
\r
118 fPadRMS = param.fPadRMS;
\r
119 fRowRMS = param.fRowRMS;
\r
120 fTimebinRMS = param.fTimebinRMS;
\r
124 AliTPCclusterKr::~AliTPCclusterKr()
\r
130 fCluster->SetOwner(kTRUE);
\r
131 fCluster->Delete();
\r
137 ////____________________________________________________________________________
\r
138 void AliTPCclusterKr::SetCenter(){
\r
140 // calculate geometrical center of the cluster
\r
148 for(Int_t iter = 0; iter < fCluster->GetEntriesFast(); ++iter) {
\r
149 AliTPCvtpr *iclus=(AliTPCvtpr *)fCluster->At(iter);
\r
151 //for( std::vector<AliTPCvtpr*>::iterator iclus = fCluster.begin();
\r
152 //iclus != fCluster.end(); ++iclus ) {
\r
153 adc = (iclus)->GetAdc();
\r
155 rX += ((iclus)->GetX() * adc);
\r
156 rY += ((iclus)->GetY() * adc);
\r
157 rT += ((iclus)->GetT() * adc);
\r
159 fCenterX=rX/fADCcluster;
\r
160 fCenterY=rY/fADCcluster;
\r
161 fCenterT=rT/fADCcluster;
\r
166 void AliTPCclusterKr::SetPadRMS(){
\r
168 // calculate RMS in pad direction
\r
170 // TH1F *histo= new TH1F("","",200,0,200);
\r
171 TArrayI *array= new TArrayI(fCluster->GetEntriesFast());
\r
172 for(Int_t i=0;i<fCluster->GetEntriesFast();i++)
\r
174 array->SetAt(((AliTPCvtpr *)(fCluster->At(i)))->GetPad(),i);
\r
175 //histo->Fill( ((AliTPCvtpr *)(fCluster->At(i)))->GetPad() );
\r
177 // fPadRMS=histo->GetRMS();
\r
178 fPadRMS=TMath::RMS(array->GetSize(),array->GetArray());
\r
184 void AliTPCclusterKr::SetRowRMS(){
\r
186 // calculate RMS in row direction
\r
188 TArrayI *array= new TArrayI(fCluster->GetEntriesFast());
\r
189 // TH1F *histo= new TH1F("","",120,0,120);
\r
190 for(Int_t i=0;i<fCluster->GetEntriesFast();i++)
\r
192 array->SetAt(((AliTPCvtpr *)(fCluster->At(i)))->GetRow(),i);
\r
193 // histo->Fill( ((AliTPCvtpr *)(fCluster->At(i)))->GetRow() );
\r
195 // fRowRMS=histo->GetRMS();
\r
196 fRowRMS=TMath::RMS(array->GetSize(),array->GetArray());
\r
202 void AliTPCclusterKr::SetTimebinRMS(){
\r
204 // calculate RMS in timebin direction
\r
206 TArrayI *array= new TArrayI(fCluster->GetEntriesFast());
\r
207 // TH1F *histo= new TH1F("","",1000,0,1000);
\r
208 for(Int_t i=0;i<fCluster->GetEntriesFast();i++)
\r
210 array->SetAt(((AliTPCvtpr *)(fCluster->At(i)))->GetTime(),i);
\r
211 // histo->Fill( ((AliTPCvtpr *)(fCluster->At(i)))->GetTime() );
\r
213 fTimebinRMS=TMath::RMS(array->GetSize(),array->GetArray());
\r
220 void AliTPCclusterKr::SetRMS(){
\r
222 // calculate RMS in pad,row,timebin direction
\r
224 TArrayI *arrayPad = new TArrayI(fCluster->GetEntriesFast());
\r
225 TArrayI *arrayRow = new TArrayI(fCluster->GetEntriesFast());
\r
226 TArrayI *arrayTime= new TArrayI(fCluster->GetEntriesFast());
\r
227 // TH1F *histoPad= new TH1F("p","p",200,0,200);
\r
228 // TH1F *histoRow= new TH1F("r","r",120,0,120);
\r
229 // TH1F *histoTime= new TH1F("t","t",1000,0,1000);
\r
230 for(Int_t i=0;i<fCluster->GetEntriesFast();i++)
\r
232 arrayPad->SetAt(((AliTPCvtpr *)(fCluster->At(i)))->GetPad(),i);
\r
233 arrayRow->SetAt(((AliTPCvtpr *)(fCluster->At(i)))->GetRow(),i);
\r
234 arrayTime->SetAt(((AliTPCvtpr *)(fCluster->At(i)))->GetTime(),i);
\r
236 //histoPad->Fill( ((AliTPCvtpr *)(fCluster->At(i)))->GetPad() );
\r
237 //histoRow->Fill( ((AliTPCvtpr *)(fCluster->At(i)))->GetRow() );
\r
238 //histoTime->Fill( ((AliTPCvtpr *)(fCluster->At(i)))->GetTime() );
\r
240 // fPadRMS=histoPad->GetRMS();
\r
241 fPadRMS=TMath::RMS(arrayPad->GetSize(),arrayPad->GetArray());
\r
242 fRowRMS=TMath::RMS(arrayRow->GetSize(),arrayRow->GetArray());
\r
243 //histoRow->GetRMS();
\r
244 fTimebinRMS=TMath::RMS(arrayTime->GetSize(),arrayTime->GetArray());
\r
245 //histoTime->GetRMS();
\r
250 // delete histoPad;
\r
251 // delete histoRow;
\r
252 // delete histoTime;
\r
258 void AliTPCclusterKr::Set1D(){
\r
263 Short_t minTime=1000;
\r
265 Short_t minPad=1000;
\r
267 for(Int_t i=0;i<fCluster->GetEntriesFast();i++)
\r
269 if(((AliTPCvtpr *)(fCluster->At(i)))->GetPad()>maxPad)maxPad =((AliTPCvtpr *)(fCluster->At(i)))->GetPad();
\r
270 if(((AliTPCvtpr *)(fCluster->At(i)))->GetPad()<minPad)minPad =((AliTPCvtpr *)(fCluster->At(i)))->GetPad();
\r
271 if(((AliTPCvtpr *)(fCluster->At(i)))->GetTime()>maxTime)maxTime=((AliTPCvtpr *)(fCluster->At(i)))->GetTime();
\r
272 if(((AliTPCvtpr *)(fCluster->At(i)))->GetTime()<minTime)minTime=((AliTPCvtpr *)(fCluster->At(i)))->GetTime();
\r
274 fPads1D=maxPad-minPad+1;
\r
275 fTimebins1D=maxTime-minTime+1;
\r