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.2 2000/05/26 17:31:04 jbarbosa
19 New data member (cerenkov angle) in Cerenkov data structure.
21 Revision 1.1 2000/04/19 13:32:48 morsch
22 Data classes for RICH (completely updated) (JB,AM)
27 #include "DataStructures.h"
29 #include <TObjArray.h>
30 #include <TParticle.h>
32 ClassImp(AliRICHPadHit)
36 //___________________________________________
37 AliRICHHit::AliRICHHit(Int_t shunt, Int_t track, Int_t *vol, Float_t *hits):
49 fPHfirst=(Int_t) hits[8];
50 fPHlast=(Int_t) hits[9];
58 ClassImp(AliRICHCerenkov)
59 //___________________________________________
60 AliRICHCerenkov::AliRICHCerenkov(Int_t shunt, Int_t track, Int_t *vol, Float_t *hits):
70 fPHfirst=(Int_t) hits[8];
71 fPHlast=(Int_t) hits[9];
72 fCMother=Int_t(hits[10]);
74 fProduction = hits[12];
80 fCerenkovAngle=hits[18];
83 //___________________________________________
84 AliRICHPadHit::AliRICHPadHit(Int_t *clhits)
95 ClassImp(AliRICHDigit)
96 //_____________________________________________________________________________
97 AliRICHDigit::AliRICHDigit(Int_t *digits)
100 // Creates a RICH digit object to be updated
107 //_____________________________________________________________________________
108 AliRICHDigit::AliRICHDigit(Int_t *tracks, Int_t *charges, Int_t *digits)
111 // Creates a RICH digit object
116 for(Int_t i=0; i<100; i++) {
117 fTcharges[i] = charges[i];
118 fTracks[i] = tracks[i];
122 ClassImp(AliRICHTransientDigit)
124 //____________________________________________________________________________
125 AliRICHTransientDigit::AliRICHTransientDigit(Int_t ich, Int_t *digits):
129 // Creates a RICH digit list object
133 fTrackList = new TObjArray;
136 //_____________________________________________________________________________
139 ClassImp(AliRICHRawCluster)
140 Int_t AliRICHRawCluster::Compare(TObject *obj)
142 AliRICHRawCluster *raw=(AliRICHRawCluster *)obj;
146 else if (y<yo) return -1;
151 Int_t AliRICHRawCluster::
152 BinarySearch(Float_t y, TArrayF coord, Int_t from, Int_t upto)
154 // Find object using a binary search. Array must first have been sorted.
155 // Search can be limited by setting upto to desired index.
157 Int_t low=from, high=upto-1, half;
160 if(y>coord[half]) low=half;
166 void AliRICHRawCluster::SortMin(Int_t *idx,Float_t *xdarray,Float_t *xarray,Float_t *yarray,Float_t *qarray, Int_t ntr)
169 // Get the 3 closest points(cog) one can find on the second cathode
170 // starting from a given cog on first cathode
174 // Loop over deltax, only 3 times
179 Int_t id[3] = {-2,-2,-2};
180 Float_t jx[3] = {0.,0.,0.};
181 Float_t jy[3] = {0.,0.,0.};
182 Float_t jq[3] = {0.,0.,0.};
183 Int_t jid[3] = {-2,-2,-2};
193 if ((i == 1 && j == id[i-1])
194 ||(i == 2 && (j == id[i-1] || j == id[i-2]))) continue;
195 if (TMath::Abs(xdarray[j]) < xmin) {
196 xmin = TMath::Abs(xdarray[j]);
227 Int_t AliRICHRawCluster::PhysicsContribution()
232 for (Int_t i=0; i<fMultiplicity; i++) {
233 if (fPhysicsMap[i]==2) iPhys++;
234 if (fPhysicsMap[i]==1) iMixed++;
235 if (fPhysicsMap[i]==0) iBg++;
237 if (iMixed==0 && iBg==0) {
239 } else if ((iPhys != 0 && iBg !=0) || iMixed != 0) {
245 //_____________________________________________________________________________
248 ClassImp(AliRICHRecHit)
251 //_____________________________________________________________________________
252 AliRICHRecHit::AliRICHRecHit(Int_t id, Float_t *rechit)
255 // Creates a RICH rec. hit object