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 2000/04/19 13:32:48 morsch
19 Data classes for RICH (completely updated) (JB,AM)
24 #include "DataStructures.h"
26 #include <TObjArray.h>
27 #include <TParticle.h>
29 ClassImp(AliRICHPadHit)
33 //___________________________________________
34 AliRICHHit::AliRICHHit(Int_t shunt, Int_t track, Int_t *vol, Float_t *hits):
46 fPHfirst=(Int_t) hits[8];
47 fPHlast=(Int_t) hits[9];
54 ClassImp(AliRICHCerenkov)
55 //___________________________________________
56 AliRICHCerenkov::AliRICHCerenkov(Int_t shunt, Int_t track, Int_t *vol, Float_t *hits):
66 fPHfirst=(Int_t) hits[8];
67 fPHlast=(Int_t) hits[9];
68 fCMother=Int_t(hits[10]);
70 fProduction = hits[12];
75 fCerenkovAngle=hits[17];
78 //___________________________________________
79 AliRICHPadHit::AliRICHPadHit(Int_t *clhits)
90 ClassImp(AliRICHDigit)
91 //_____________________________________________________________________________
92 AliRICHDigit::AliRICHDigit(Int_t *digits)
95 // Creates a RICH digit object to be updated
102 //_____________________________________________________________________________
103 AliRICHDigit::AliRICHDigit(Int_t *tracks, Int_t *charges, Int_t *digits)
106 // Creates a RICH digit object
111 for(Int_t i=0; i<100; i++) {
112 fTcharges[i] = charges[i];
113 fTracks[i] = tracks[i];
117 ClassImp(AliRICHTransientDigit)
119 //____________________________________________________________________________
120 AliRICHTransientDigit::AliRICHTransientDigit(Int_t ich, Int_t *digits):
124 // Creates a RICH digit list object
128 fTrackList = new TObjArray;
131 //_____________________________________________________________________________
134 ClassImp(AliRICHRawCluster)
135 Int_t AliRICHRawCluster::Compare(TObject *obj)
137 AliRICHRawCluster *raw=(AliRICHRawCluster *)obj;
141 else if (y<yo) return -1;
146 Int_t AliRICHRawCluster::
147 BinarySearch(Float_t y, TArrayF coord, Int_t from, Int_t upto)
149 // Find object using a binary search. Array must first have been sorted.
150 // Search can be limited by setting upto to desired index.
152 Int_t low=from, high=upto-1, half;
155 if(y>coord[half]) low=half;
161 void AliRICHRawCluster::SortMin(Int_t *idx,Float_t *xdarray,Float_t *xarray,Float_t *yarray,Float_t *qarray, Int_t ntr)
164 // Get the 3 closest points(cog) one can find on the second cathode
165 // starting from a given cog on first cathode
169 // Loop over deltax, only 3 times
174 Int_t id[3] = {-2,-2,-2};
175 Float_t jx[3] = {0.,0.,0.};
176 Float_t jy[3] = {0.,0.,0.};
177 Float_t jq[3] = {0.,0.,0.};
178 Int_t jid[3] = {-2,-2,-2};
188 if ((i == 1 && j == id[i-1])
189 ||(i == 2 && (j == id[i-1] || j == id[i-2]))) continue;
190 if (TMath::Abs(xdarray[j]) < xmin) {
191 xmin = TMath::Abs(xdarray[j]);
222 Int_t AliRICHRawCluster::PhysicsContribution()
227 for (Int_t i=0; i<fMultiplicity; i++) {
228 if (fPhysicsMap[i]==2) iPhys++;
229 if (fPhysicsMap[i]==1) iMixed++;
230 if (fPhysicsMap[i]==0) iBg++;
232 if (iMixed==0 && iBg==0) {
234 } else if ((iPhys != 0 && iBg !=0) || iMixed != 0) {
240 //_____________________________________________________________________________
243 ClassImp(AliRICHRecHit)
246 //_____________________________________________________________________________
247 AliRICHRecHit::AliRICHRecHit(Int_t id, Float_t *rechit)
250 // Creates a RICH rec. hit object