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 **************************************************************************/
18 // -------------------------
19 // Class AliMUONRawCluster
20 // -------------------------
21 // Class for the MUON RecPoint
22 // It contains the properties of the physics cluters found in the tracking chambers
23 // RawCluster contains also the information from the both cathode of the chambers.
27 #include "AliMUONRawCluster.h"
29 ClassImp(AliMUONRawCluster)
32 AliMUONRawCluster::AliMUONRawCluster()
36 fTracks[0]=fTracks[1]=fTracks[2]=-1;
37 for (int j=0;j<2;j++) {
45 for (int k=0;k<50;k++) {
52 fNcluster[0]=fNcluster[1]=-1;
58 //____________________________________________________
59 Int_t AliMUONRawCluster::Compare(const TObject *obj) const
64 AliMUONRawCluster *raw=(AliMUONRawCluster *)obj;
65 Float_t r=GetRadius();
66 Float_t ro=raw->GetRadius();
68 else if (r<ro) return -1;
71 AliMUONRawCluster *raw=(AliMUONRawCluster *)obj;
73 Float_t yo=raw->fY[0];
75 else if (y<yo) return -1;
79 //____________________________________________________
80 Int_t AliMUONRawCluster::BinarySearch(Float_t y, TArrayF coord, Int_t from, Int_t upto)
82 /// Find object using a binary search. Array must first have been sorted.
83 /// Search can be limited by setting upto to desired index.
85 Int_t low=from, high=upto-1, half;
88 if(y>coord[half]) low=half;
93 //____________________________________________________
94 void AliMUONRawCluster::SortMin(Int_t *idx,Float_t *xdarray,Float_t *xarray,Float_t *yarray,Float_t *qarray, Int_t ntr)
96 /// Get the 3 closest points(cog) one can find on the second cathode
97 /// starting from a given cog on first cathode
100 // Loop over deltax, only 3 times
105 Int_t id[3] = {-2,-2,-2};
106 Float_t jx[3] = {0.,0.,0.};
107 Float_t jy[3] = {0.,0.,0.};
108 Float_t jq[3] = {0.,0.,0.};
109 Int_t jid[3] = {-2,-2,-2};
119 if ((i == 1 && j == id[i-1])
120 ||(i == 2 && (j == id[i-1] || j == id[i-2]))) continue;
121 if (TMath::Abs(xdarray[j]) < xmin) {
122 xmin = TMath::Abs(xdarray[j]);
152 //____________________________________________________
153 Int_t AliMUONRawCluster::PhysicsContribution() const
155 /// Evaluate physics contribution to cluster
159 for (Int_t i=0; i<fMultiplicity[0]; i++) {
160 if (fPhysicsMap[i]==2) iPhys++;
161 if (fPhysicsMap[i]==1) iMixed++;
162 if (fPhysicsMap[i]==0) iBg++;
164 if (iMixed==0 && iBg==0) {
166 } else if ((iPhys != 0 && iBg !=0) || iMixed != 0) {
172 //____________________________________________________
173 void AliMUONRawCluster::DumpIndex(void)
175 /// Dumping IdexMap of the cluster
177 for (Int_t icat=0;icat<2;icat++) {
178 printf ("Mult %d\n",fMultiplicity[icat]);
179 for (Int_t idig=0;idig<fMultiplicity[icat];idig++){
180 printf("Index %d",fIndexMap[idig][icat]);
185 //____________________________________________________
186 Int_t AliMUONRawCluster::AddCharge(Int_t i, Int_t Q)
188 /// Adding Q to the fQ value
195 //____________________________________________________
196 Int_t AliMUONRawCluster::AddX(Int_t i, Float_t X)
198 /// Adding X to the fX value
205 //____________________________________________________
206 Int_t AliMUONRawCluster::AddY(Int_t i, Float_t Y)
208 /// Adding Y to the fY value
215 //____________________________________________________
216 Int_t AliMUONRawCluster::AddZ(Int_t i, Float_t Z)
218 /// Adding Z to the fZ value
225 //____________________________________________________
226 Int_t AliMUONRawCluster::GetCharge(Int_t i) const
228 /// Getting the charge of the cluster
229 if (i==0 || i==1) return fQ[i];
232 //____________________________________________________
233 Float_t AliMUONRawCluster::GetX(Int_t i) const
235 /// Getting X value of the cluster
236 if (i==0 || i==1) return fX[i];
239 //____________________________________________________
240 Float_t AliMUONRawCluster::GetY(Int_t i) const
242 /// Getting Y value of the cluster
243 if (i==0 || i==1) return fY[i];
246 //____________________________________________________
247 Float_t AliMUONRawCluster::GetZ(Int_t i) const
249 /// Getting Z value of the cluster
250 if (i==0 || i==1) return fZ[i];
253 //____________________________________________________
254 Int_t AliMUONRawCluster::GetTrack(Int_t i) const
256 /// Getting track i contributing to the cluster
257 if (i==0 || i==1 || i==2) return fTracks[i];
260 //____________________________________________________
261 Int_t AliMUONRawCluster::GetPeakSignal(Int_t i) const
263 /// Getting cluster peaksignal
264 if (i==0 || i==1 ) return fPeakSignal[i];
267 //____________________________________________________
268 Int_t AliMUONRawCluster::GetMultiplicity(Int_t i) const
270 /// Getting cluster multiplicity
271 if (i==0 || i==1 ) return fMultiplicity[i];
274 //____________________________________________________
275 Int_t AliMUONRawCluster::GetClusterType() const
277 /// Getting Cluster Type
280 //____________________________________________________
281 Int_t AliMUONRawCluster::GetGhost() const
286 //____________________________________________________
287 Int_t AliMUONRawCluster::GetNcluster(Int_t i) const
289 /// Getting number of clusters
290 if (i==0 || i==1 ) return fNcluster[i];
293 //____________________________________________________
294 Float_t AliMUONRawCluster::GetChi2(Int_t i) const
296 /// Getting chi2 value of the cluster
297 if (i==0 || i==1) return fChi2[i];
300 //____________________________________________________
301 Int_t AliMUONRawCluster::SetCharge(Int_t i, Int_t Q)
303 /// Setting Charge of the cluster
310 //____________________________________________________
311 Int_t AliMUONRawCluster::SetX(Int_t i, Float_t X)
313 /// Setting X value of the cluster
320 //____________________________________________________
321 Int_t AliMUONRawCluster::SetY(Int_t i, Float_t Y)
323 /// Setting Y value of the cluster
330 //____________________________________________________
331 Int_t AliMUONRawCluster::SetZ(Int_t i, Float_t Z)
333 /// Setting Z value of the cluste
340 //____________________________________________________
341 Int_t AliMUONRawCluster::SetTrack(Int_t i, Int_t track)
343 /// Setting tracks contributing to the cluster
344 if (i==0 || i==1 || i==2) {
350 //____________________________________________________
351 Int_t AliMUONRawCluster::SetPeakSignal(Int_t i, Int_t peaksignal)
353 /// Setting PeakSignal of the cluster
355 fPeakSignal[i]=peaksignal;
360 //____________________________________________________
361 Int_t AliMUONRawCluster::SetMultiplicity(Int_t i, Int_t mul)
363 /// Setting multiplicity of the cluster
365 fMultiplicity[i]=mul;
370 //____________________________________________________
371 Int_t AliMUONRawCluster::SetClusterType(Int_t type)
373 /// Setting the cluster type
377 //____________________________________________________
378 Int_t AliMUONRawCluster::SetGhost(Int_t ghost)
380 /// Setting the ghost
384 //____________________________________________________
385 Int_t AliMUONRawCluster::SetNcluster(Int_t i, Int_t ncluster)
387 /// Setting number the cluster
389 fNcluster[i]=ncluster;
394 //____________________________________________________
395 Int_t AliMUONRawCluster::SetChi2(Int_t i, Float_t chi2)
397 /// Setting chi2 of the cluster