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 Revision 1.1.2.1 2000/06/09 22:04:50 morsch
19 Was before in DataStructures.cxx
23 #include "AliMUONRawCluster.h"
24 #include <TObjArray.h>
27 ClassImp(AliMUONRawCluster);
30 AliMUONRawCluster::AliMUONRawCluster() {
32 fTracks[0]=fTracks[1]=fTracks[2]=-1;
33 for (int j=0;j<2;j++) {
41 for (int k=0;k<50;k++) {
48 fNcluster[0]=fNcluster[1]=-1;
51 Int_t AliMUONRawCluster::Compare(TObject *obj)
54 AliMUONRawCluster *raw=(AliMUONRawCluster *)obj;
55 Float_t r=GetRadius();
56 Float_t ro=raw->GetRadius();
58 else if (r<ro) return -1;
61 AliMUONRawCluster *raw=(AliMUONRawCluster *)obj;
63 Float_t yo=raw->fY[0];
65 else if (y<yo) return -1;
70 Int_t AliMUONRawCluster::
71 BinarySearch(Float_t y, TArrayF coord, Int_t from, Int_t upto)
73 // Find object using a binary search. Array must first have been sorted.
74 // Search can be limited by setting upto to desired index.
76 Int_t low=from, high=upto-1, half;
79 if(y>coord[half]) low=half;
85 void AliMUONRawCluster::SortMin(Int_t *idx,Float_t *xdarray,Float_t *xarray,Float_t *yarray,Float_t *qarray, Int_t ntr)
88 // Get the 3 closest points(cog) one can find on the second cathode
89 // starting from a given cog on first cathode
93 // Loop over deltax, only 3 times
98 Int_t id[3] = {-2,-2,-2};
99 Float_t jx[3] = {0.,0.,0.};
100 Float_t jy[3] = {0.,0.,0.};
101 Float_t jq[3] = {0.,0.,0.};
102 Int_t jid[3] = {-2,-2,-2};
112 if ((i == 1 && j == id[i-1])
113 ||(i == 2 && (j == id[i-1] || j == id[i-2]))) continue;
114 if (TMath::Abs(xdarray[j]) < xmin) {
115 xmin = TMath::Abs(xdarray[j]);
146 Int_t AliMUONRawCluster::PhysicsContribution()
148 // Evaluate physics contribution to cluster
152 for (Int_t i=0; i<fMultiplicity[0]; i++) {
153 if (fPhysicsMap[i]==2) iPhys++;
154 if (fPhysicsMap[i]==1) iMixed++;
155 if (fPhysicsMap[i]==0) iBg++;
157 if (iMixed==0 && iBg==0) {
159 } else if ((iPhys != 0 && iBg !=0) || iMixed != 0) {