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.
26 #include "Riostream.h"
31 #include "AliMUONRawCluster.h"
34 ClassImp(AliMUONRawCluster)
37 AliMUONRawCluster::AliMUONRawCluster()
44 fTracks[0]=fTracks[1]=fTracks[2]=-1;
45 for (int j=0;j<2;j++) {
53 for (int k=0;k<50;k++) {
60 fNcluster[0]=fNcluster[1]=-1;
64 //____________________________________________________
65 Int_t AliMUONRawCluster::Compare(const TObject *obj) const
70 AliMUONRawCluster *raw=(AliMUONRawCluster *)obj;
71 Float_t r=GetRadius();
72 Float_t ro=raw->GetRadius();
74 else if (r<ro) return -1;
77 AliMUONRawCluster *raw=(AliMUONRawCluster *)obj;
79 Float_t yo=raw->fY[0];
81 else if (y<yo) return -1;
85 //____________________________________________________
86 Int_t AliMUONRawCluster::BinarySearch(Float_t y, TArrayF coord, Int_t from, Int_t upto)
88 /// Find object using a binary search. Array must first have been sorted.
89 /// Search can be limited by setting upto to desired index.
91 Int_t low=from, high=upto-1, half;
94 if(y>coord[half]) low=half;
99 //____________________________________________________
100 void AliMUONRawCluster::SortMin(Int_t *idx,Float_t *xdarray,Float_t *xarray,Float_t *yarray,Float_t *qarray, Int_t ntr)
102 /// Get the 3 closest points(cog) one can find on the second cathode
103 /// starting from a given cog on first cathode
106 // Loop over deltax, only 3 times
111 Int_t id[3] = {-2,-2,-2};
112 Float_t jx[3] = {0.,0.,0.};
113 Float_t jy[3] = {0.,0.,0.};
114 Float_t jq[3] = {0.,0.,0.};
115 Int_t jid[3] = {-2,-2,-2};
125 if ((i == 1 && j == id[i-1])
126 ||(i == 2 && (j == id[i-1] || j == id[i-2]))) continue;
127 if (TMath::Abs(xdarray[j]) < xmin) {
128 xmin = TMath::Abs(xdarray[j]);
158 //____________________________________________________
159 Int_t AliMUONRawCluster::PhysicsContribution() const
161 /// Evaluate physics contribution to cluster
165 for (Int_t i=0; i<fMultiplicity[0]; i++) {
166 if (fPhysicsMap[i]==2) iPhys++;
167 if (fPhysicsMap[i]==1) iMixed++;
168 if (fPhysicsMap[i]==0) iBg++;
170 if (iMixed==0 && iBg==0) {
172 } else if ((iPhys != 0 && iBg !=0) || iMixed != 0) {
179 //____________________________________________________
180 void AliMUONRawCluster::Print(Option_t* opt) const
183 // Printing Raw Cluster (Rec Point) information
184 // "full" option for printing all the information about the raw cluster
189 if ( sopt.Contains("FULL") ) {
190 cout << "<AliMUONRawCluster>: DetEle=" << setw(4) << GetDetElemId() <<
191 ", (x,y,z)=(" << setw(8) << setprecision(5) << GetX() << "," << setw(8) << setprecision(5) << GetY() << "," << setw(8) << setprecision(5) << GetZ() <<
192 ") cm, Chi2=" << setw(8) << setprecision(3) << GetChi2() <<
193 ", Q=" << setw(4) << GetCharge() <<
194 ", Hit=" << setw(4) << GetTrack(0) <<
195 ", Track1=" << setw(4) << GetTrack(1) <<
196 ", Track2=" << setw(4) << GetTrack(2) <<endl;
199 cout << "<AliMUONRawCluster>: DetEle=" << setw(4) << GetDetElemId() <<
200 ", (x,y,z)=(" << setw(8) << setprecision(5) << GetX() << "," << setw(8) << setprecision(5) << GetY() << "," << setw(8) << setprecision(5) << GetZ()
204 //____________________________________________________
205 void AliMUONRawCluster::DumpIndex(void)
207 /// Dumping IdexMap of the cluster
209 for (Int_t icat=0;icat<2;icat++) {
210 printf ("Mult %d\n",fMultiplicity[icat]);
211 for (Int_t idig=0;idig<fMultiplicity[icat];idig++){
212 printf("Index %d",fIndexMap[idig][icat]);
217 //____________________________________________________
218 Int_t AliMUONRawCluster::AddCharge(Int_t i, Float_t Q)
220 /// Adding Q to the fQ value
227 //____________________________________________________
228 Int_t AliMUONRawCluster::AddX(Int_t i, Float_t X)
230 /// Adding X to the fX value
237 //____________________________________________________
238 Int_t AliMUONRawCluster::AddY(Int_t i, Float_t Y)
240 /// Adding Y to the fY value
247 //____________________________________________________
248 Int_t AliMUONRawCluster::AddZ(Int_t i, Float_t Z)
250 /// Adding Z to the fZ value
257 //____________________________________________________
258 Float_t AliMUONRawCluster::GetCharge(Int_t i) const
260 /// Getting the charge of the cluster
261 if (i==0 || i==1) return fQ[i];
264 //____________________________________________________
265 Float_t AliMUONRawCluster::GetX(Int_t i) const
267 /// Getting X value of the cluster
268 if (i==0 || i==1) return fX[i];
271 //____________________________________________________
272 Float_t AliMUONRawCluster::GetY(Int_t i) const
274 /// Getting Y value of the cluster
275 if (i==0 || i==1) return fY[i];
278 //____________________________________________________
279 Float_t AliMUONRawCluster::GetZ(Int_t i) const
281 /// Getting Z value of the cluster
282 if (i==0 || i==1) return fZ[i];
285 //____________________________________________________
286 Int_t AliMUONRawCluster::GetTrack(Int_t i) const
288 /// Getting track i contributing to the cluster
289 if (i==0 || i==1 || i==2) return fTracks[i];
292 //____________________________________________________
293 Float_t AliMUONRawCluster::GetPeakSignal(Int_t i) const
295 /// Getting cluster peaksignal
296 if (i==0 || i==1 ) return fPeakSignal[i];
299 //____________________________________________________
300 Int_t AliMUONRawCluster::GetMultiplicity(Int_t i) const
302 /// Getting cluster multiplicity
303 if (i==0 || i==1 ) return fMultiplicity[i];
306 //____________________________________________________
307 Int_t AliMUONRawCluster::GetClusterType() const
309 /// Getting Cluster Type
312 //____________________________________________________
313 Int_t AliMUONRawCluster::GetGhost() const
318 //____________________________________________________
319 Int_t AliMUONRawCluster::GetNcluster(Int_t i) const
321 /// Getting number of clusters
322 if (i==0 || i==1 ) return fNcluster[i];
325 //____________________________________________________
326 Float_t AliMUONRawCluster::GetChi2(Int_t i) const
328 /// Getting chi2 value of the cluster
329 if (i==0 || i==1) return fChi2[i];
332 //____________________________________________________
333 Int_t AliMUONRawCluster::SetCharge(Int_t i, Float_t Q)
335 /// Setting Charge of the cluster
342 //____________________________________________________
343 Int_t AliMUONRawCluster::SetX(Int_t i, Float_t X)
345 /// Setting X value of the cluster
352 //____________________________________________________
353 Int_t AliMUONRawCluster::SetY(Int_t i, Float_t Y)
355 /// Setting Y value of the cluster
362 //____________________________________________________
363 Int_t AliMUONRawCluster::SetZ(Int_t i, Float_t Z)
365 /// Setting Z value of the cluste
372 //____________________________________________________
373 Int_t AliMUONRawCluster::SetTrack(Int_t i, Int_t track)
375 /// Setting tracks contributing to the cluster
376 if (i==0 || i==1 || i==2) {
382 //____________________________________________________
383 Int_t AliMUONRawCluster::SetPeakSignal(Int_t i, Float_t peaksignal)
385 /// Setting PeakSignal of the cluster
387 fPeakSignal[i]=peaksignal;
392 //____________________________________________________
393 Int_t AliMUONRawCluster::SetMultiplicity(Int_t i, Int_t mul)
395 /// Setting multiplicity of the cluster
397 fMultiplicity[i]=mul;
402 //____________________________________________________
403 Int_t AliMUONRawCluster::SetClusterType(Int_t type)
405 /// Setting the cluster type
409 //____________________________________________________
410 Int_t AliMUONRawCluster::SetGhost(Int_t ghost)
412 /// Setting the ghost
416 //____________________________________________________
417 Int_t AliMUONRawCluster::SetNcluster(Int_t i, Int_t ncluster)
419 /// Setting number the cluster
421 fNcluster[i]=ncluster;
426 //____________________________________________________
427 Int_t AliMUONRawCluster::SetChi2(Int_t i, Float_t chi2)
429 /// Setting chi2 of the cluster