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 // Class for the MUON RecPoint
19 // It contains the properties of the physics cluters found in the tracking chambers
20 // RawCluster contains also the information from the both cathode of the chambers.
26 #include "AliMUONRawCluster.h"
28 ClassImp(AliMUONRawCluster)
31 AliMUONRawCluster::AliMUONRawCluster()
35 fTracks[0]=fTracks[1]=fTracks[2]=-1;
36 for (int j=0;j<2;j++) {
44 for (int k=0;k<50;k++) {
51 fNcluster[0]=fNcluster[1]=-1;
54 //____________________________________________________
55 Int_t AliMUONRawCluster::Compare(const TObject *obj) const
58 AliMUONRawCluster *raw=(AliMUONRawCluster *)obj;
59 Float_t r=GetRadius();
60 Float_t ro=raw->GetRadius();
62 else if (r<ro) return -1;
65 AliMUONRawCluster *raw=(AliMUONRawCluster *)obj;
67 Float_t yo=raw->fY[0];
69 else if (y<yo) return -1;
73 //____________________________________________________
74 Int_t AliMUONRawCluster::BinarySearch(Float_t y, TArrayF coord, Int_t from, Int_t upto)
76 // Find object using a binary search. Array must first have been sorted.
77 // Search can be limited by setting upto to desired index.
79 Int_t low=from, high=upto-1, half;
82 if(y>coord[half]) low=half;
87 //____________________________________________________
88 void AliMUONRawCluster::SortMin(Int_t *idx,Float_t *xdarray,Float_t *xarray,Float_t *yarray,Float_t *qarray, Int_t ntr)
91 // Get the 3 closest points(cog) one can find on the second cathode
92 // starting from a given cog on first cathode
96 // Loop over deltax, only 3 times
101 Int_t id[3] = {-2,-2,-2};
102 Float_t jx[3] = {0.,0.,0.};
103 Float_t jy[3] = {0.,0.,0.};
104 Float_t jq[3] = {0.,0.,0.};
105 Int_t jid[3] = {-2,-2,-2};
115 if ((i == 1 && j == id[i-1])
116 ||(i == 2 && (j == id[i-1] || j == id[i-2]))) continue;
117 if (TMath::Abs(xdarray[j]) < xmin) {
118 xmin = TMath::Abs(xdarray[j]);
148 //____________________________________________________
149 Int_t AliMUONRawCluster::PhysicsContribution() const
151 // Evaluate physics contribution to cluster
155 for (Int_t i=0; i<fMultiplicity[0]; i++) {
156 if (fPhysicsMap[i]==2) iPhys++;
157 if (fPhysicsMap[i]==1) iMixed++;
158 if (fPhysicsMap[i]==0) iBg++;
160 if (iMixed==0 && iBg==0) {
162 } else if ((iPhys != 0 && iBg !=0) || iMixed != 0) {
168 //____________________________________________________
169 void AliMUONRawCluster::DumpIndex(void)
171 // Dumping IdexMap of the cluster
173 for (Int_t icat=0;icat<2;icat++) {
174 printf ("Mult %d\n",fMultiplicity[icat]);
175 for (Int_t idig=0;idig<fMultiplicity[icat];idig++){
176 printf("Index %d",fIndexMap[idig][icat]);
181 //____________________________________________________
182 Int_t AliMUONRawCluster::AddCharge(Int_t i, Int_t Q)
184 // Adding Q to the fQ value
191 //____________________________________________________
192 Int_t AliMUONRawCluster::AddX(Int_t i, Float_t X)
194 // Adding X to the fX value
201 //____________________________________________________
202 Int_t AliMUONRawCluster::AddY(Int_t i, Float_t Y)
204 // Adding Y to the fY value
211 //____________________________________________________
212 Int_t AliMUONRawCluster::AddZ(Int_t i, Float_t Z)
214 // Adding Z to the fZ value
221 //____________________________________________________
222 Int_t AliMUONRawCluster::GetCharge(Int_t i) const
224 // Getting the charge of the cluster
225 if (i==0 || i==1) return fQ[i];
228 //____________________________________________________
229 Float_t AliMUONRawCluster::GetX(Int_t i) const
231 // Getting X value of the cluster
232 if (i==0 || i==1) return fX[i];
235 //____________________________________________________
236 Float_t AliMUONRawCluster::GetY(Int_t i) const
238 // Getting Y value of the cluster
239 if (i==0 || i==1) return fY[i];
242 //____________________________________________________
243 Float_t AliMUONRawCluster::GetZ(Int_t i) const
245 // Getting Z value of the cluster
246 if (i==0 || i==1) return fZ[i];
249 //____________________________________________________
250 Int_t AliMUONRawCluster::GetTrack(Int_t i) const
252 // Getting track i contributing to the cluster
253 if (i==0 || i==1 || i==2) return fTracks[i];
256 //____________________________________________________
257 Int_t AliMUONRawCluster::GetPeakSignal(Int_t i) const
259 // Getting cluster peaksignal
260 if (i==0 || i==1 ) return fPeakSignal[i];
263 //____________________________________________________
264 Int_t AliMUONRawCluster::GetMultiplicity(Int_t i) const
266 // Getting cluster multiplicity
267 if (i==0 || i==1 ) return fMultiplicity[i];
270 //____________________________________________________
271 Int_t AliMUONRawCluster::GetClusterType() const
273 // Getting Cluster Type
276 //____________________________________________________
277 Int_t AliMUONRawCluster::GetGhost() const
282 //____________________________________________________
283 Int_t AliMUONRawCluster::GetNcluster(Int_t i) const
285 // Getting number of clusters
286 if (i==0 || i==1 ) return fNcluster[i];
289 //____________________________________________________
290 Float_t AliMUONRawCluster::GetChi2(Int_t i) const
292 // Getting chi2 value of the cluster
293 if (i==0 || i==1) return fChi2[i];
296 //____________________________________________________
297 Int_t AliMUONRawCluster::SetCharge(Int_t i, Int_t Q)
299 // Setting Charge of the cluster
306 //____________________________________________________
307 Int_t AliMUONRawCluster::SetX(Int_t i, Float_t X)
309 // Setting X value of the cluster
316 //____________________________________________________
317 Int_t AliMUONRawCluster::SetY(Int_t i, Float_t Y)
319 // Setting Y value of the cluster
326 //____________________________________________________
327 Int_t AliMUONRawCluster::SetZ(Int_t i, Float_t Z)
329 // Setting Z value of the cluste
336 //____________________________________________________
337 Int_t AliMUONRawCluster::SetTrack(Int_t i, Int_t track)
339 // Setting tracks contributing to the cluster
340 if (i==0 || i==1 || i==2) {
346 //____________________________________________________
347 Int_t AliMUONRawCluster::SetPeakSignal(Int_t i, Int_t peaksignal)
349 // Setting PeakSignal of the cluster
351 fPeakSignal[i]=peaksignal;
356 //____________________________________________________
357 Int_t AliMUONRawCluster::SetMultiplicity(Int_t i, Int_t mul)
359 // Setting multiplicity of the cluster
361 fMultiplicity[i]=mul;
366 //____________________________________________________
367 Int_t AliMUONRawCluster::SetClusterType(Int_t type)
369 // Setting the cluster type
373 //____________________________________________________
374 Int_t AliMUONRawCluster::SetGhost(Int_t ghost)
380 //____________________________________________________
381 Int_t AliMUONRawCluster::SetNcluster(Int_t i, Int_t ncluster)
383 // Setting number the cluster
385 fNcluster[i]=ncluster;
390 //____________________________________________________
391 Int_t AliMUONRawCluster::SetChi2(Int_t i, Float_t chi2)
393 // Setting chi2 of the cluster