22-dec-2003 NvE Event selection introduced in AliCollider.
[u/mrichter/AliRoot.git] / RICH / AliRICH.h
CommitLineData
2f614988 1#ifndef AliRICH_h
2#define AliRICH_h
2e5f0f7b 3
3da30618 4/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
6
c11ee6f0 7#include <TObjArray.h>
853634d3 8#include <TClonesArray.h>
c021cb15 9#include <TLorentzVector.h>
c11ee6f0 10#include <AliDetector.h>
853634d3 11#include <AliHit.h>
12#include <AliDigit.h>
543d5224 13
cb8189e7 14#include "AliRICHParam.h"
15
c60862bf 16#include "AliRICHSDigit.h"
853634d3 17
c021cb15 18//__________________AliRICHhit______________________________________________________________________
853634d3 19class AliRICHhit : public AliHit
20{
21public:
22 inline AliRICHhit();
23 inline AliRICHhit(Int_t fIshunt, Int_t track, Int_t *vol, Float_t *hits);
bc3c4bbf 24 inline AliRICHhit(Int_t tid,TVector3 x3);
af3d25a6 25 inline AliRICHhit(Int_t tid,TVector3 x3in,TVector3 x3out,Double_t eloss);
853634d3 26 virtual ~AliRICHhit() {;}
af3d25a6 27
53fd478b 28 Int_t C() const{return fChamber;}
29 Int_t Chamber() const{return fChamber;}
30 Int_t Pid() const{return fPid;}
31 Int_t Particle() const{return fPid;}
53fd478b 32 Float_t Eloss() const{return fEloss;}
53fd478b 33 Float_t MomX() const{return fMomX;}
34 Float_t MomY() const{return fMomY;}
35 Float_t MomZ() const{return fMomZ;}
36 Float_t CerenkovAngle() const{return fCerenkovAngle;}
37 Float_t MomFreoX() const{return fMomFreoX;}
38 Float_t MomFreoY() const{return fMomFreoY;}
39 Float_t MomFreoZ() const{return fMomFreoZ;}
6865fb8d 40 TVector3 InX3() const{return fInX3;}
41 TVector3 OutX3() const{return fOutX3;}
543d5224 42 void Print(Option_t *option="")const; //virtual
853634d3 43protected:
c021cb15 44 Int_t fChamber; //chamber number
c60862bf 45 Int_t fPid; //particle code
ed3ceb24 46 Double_t fEloss; //ionisation energy loss in gas
c021cb15 47 Float_t fMomX,fMomY,fMomZ; //momentum at photochatode entry point
af3d25a6 48 Float_t fNPads; //Pads hit
49 Float_t fCerenkovAngle; //Dummy cerenkov angle
c021cb15 50 Float_t fMomFreoX,fMomFreoY,fMomFreoZ; //momentum at freon entry point
af3d25a6 51 TVector3 fInX3,fOutX3; //3-vectors at the entrance and exit of the GAP
ed3ceb24 52 ClassDef(AliRICHhit,2) //RICH hit class
853634d3 53};//class AliRICHhit
c021cb15 54
55 //__________________________________________________________________________________________________
853634d3 56AliRICHhit::AliRICHhit()
57 :AliHit()
58{//default ctor
c60862bf 59 fChamber=fPid=kBad;
ed3ceb24 60 fEloss=kBad;
c021cb15 61 fMomX=fMomY=fMomZ=fNPads=fCerenkovAngle=fMomFreoX=fMomFreoY=fMomFreoZ=kBad;
af3d25a6 62 fInX3.SetXYZ(0,0,0);fOutX3.SetXYZ(0,0,0);
543d5224 63}
c021cb15 64//__________________________________________________________________________________________________
ed3ceb24 65AliRICHhit::AliRICHhit(Int_t shunt, Int_t track, Int_t *vol, Float_t *hit)
66 :AliHit(shunt, track)
853634d3 67{//ctor
68 fChamber=vol[0];
c60862bf 69 fPid=(Int_t)hit[0];
c021cb15 70 fX=hit[1];fY=hit[2];fZ=hit[3];
c021cb15 71 fEloss=hit[7];
c021cb15 72 fMomX=hit[14];fMomY=hit[15];fMomZ=hit[16];
c021cb15 73 fCerenkovAngle=hit[18];
74 fMomFreoX=hit[19];fMomFreoY=hit[20];fMomFreoZ=hit[21];
bc3c4bbf 75}
76 //__________________________________________________________________________________________________
77AliRICHhit::AliRICHhit(Int_t tid,TVector3 x3) :AliHit(0,tid)
78{//default ctor
79 fChamber=fPid=kBad;
80 fEloss=kBad;
81 fMomX=fMomY=fMomZ=fNPads=fCerenkovAngle=fMomFreoX=fMomFreoY=fMomFreoZ=kBad;
82 fInX3=x3;fOutX3.SetXYZ(0,0,0);
543d5224 83}
c021cb15 84//__________________________________________________________________________________________________
af3d25a6 85AliRICHhit::AliRICHhit(Int_t tid,TVector3 x3in,TVector3 x3out,Double_t eloss)
ed3ceb24 86 :AliHit(0,tid)
c021cb15 87{//ctor
af3d25a6 88 fX=x3out.X();fY=x3out.Y();fZ=x3out.Z();
89 fInX3=x3in;
90 fOutX3=x3out;
c021cb15 91 fEloss=eloss;
543d5224 92}
c021cb15 93
94//__________________AliRICHCerenkov_________________________________________________________________
853634d3 95class AliRICHCerenkov: public AliHit
96{
97public:
98 inline AliRICHCerenkov();
99 inline AliRICHCerenkov(Int_t fIshunt, Int_t track, Int_t *vol, Float_t *Cerenkovs);
100 virtual ~AliRICHCerenkov() {;}
53fd478b 101protected:
c021cb15 102 Int_t fChamber; //chamber number
103 Float_t fTheta,fPhi; //incident theta phi angles in degrees
104 Float_t fTlength; //track length inside the chamber
105 Float_t fEloss; //ionisation energy loss in gas
106 Int_t fPHfirst; //first padhit
107 Int_t fPHlast; //last padhit
108 Int_t fCMother; //index of mother particle
109 Float_t fLoss; //nature of particle loss
110 Float_t fIndex; //index of photon
111 Float_t fProduction; //point of production
112 Float_t fMomX,fMomY,fMomZ; //local Momentum
853634d3 113 Float_t fNPads; // Pads hit
114 Float_t fCerenkovAngle; // Cerenkov Angle
115
116 ClassDef(AliRICHCerenkov,1) //RICH cerenkov class
117};//class AliRICHCerenkov
c021cb15 118
119//__________________________________________________________________________________________________
853634d3 120AliRICHCerenkov::AliRICHCerenkov()
121{//ctor
c021cb15 122 fChamber=kBad;
123 fX=fY=fZ=fTheta=fPhi=fTlength=fEloss=kBad;
124 fPHfirst=fPHlast=fCMother=kBad;
125 fLoss=fIndex=fProduction=fMomX=fMomY=fMomZ=fNPads=fCerenkovAngle=kBad;
543d5224 126}
c021cb15 127//__________________________________________________________________________________________________
853634d3 128AliRICHCerenkov::AliRICHCerenkov(Int_t shunt, Int_t track, Int_t *vol, Float_t *hits)
129 :AliHit(shunt, track)
130{//ctor
131 fChamber=vol[0];
c021cb15 132 fX=hits[1];fY=hits[2];fZ=hits[3];
133 fTheta=hits[4];fPhi=hits[5];
853634d3 134 fTlength=hits[6];
135 fEloss=hits[7];
c021cb15 136 fPHfirst=(Int_t)hits[8];fPHlast=(Int_t)hits[9];
853634d3 137 fCMother=Int_t(hits[10]);
138 fIndex = hits[11];
139 fProduction = hits[12];
140 fLoss=hits[13];
c021cb15 141 fMomX=hits[14];fMomY=hits[15];fMomZ=hits[16];
853634d3 142 fNPads=hits[17];
143 fCerenkovAngle=hits[18];
543d5224 144}
c021cb15 145
146//__________________AliRICHdigit____________________________________________________________________
853634d3 147class AliRICHdigit :public AliDigit
148{
149public:
ed3ceb24 150 AliRICHdigit() {fCombiPid=fChamber=fPadX=fPadY=fTracks[0]=fTracks[1]=fTracks[2]=kBad;fQdc=kBad;}
151 AliRICHdigit(Int_t c,Int_t x,Int_t y,Double_t q,Int_t cpid,Int_t tid0,Int_t tid1,Int_t tid2)
152 {fPadX=x;fPadY=y;fQdc=q;fChamber=10*c+AliRICHParam::Pad2Sec(x,y);fCombiPid=cpid;fTracks[0]=tid0;fTracks[1]=tid1;fTracks[2]=tid2;}
853634d3 153 virtual ~AliRICHdigit() {;}
ed3ceb24 154 Int_t Compare(const TObject *pObj) const //virtual
155 {if(Id()==((AliRICHdigit*)pObj)->Id()) return 0; else if(Id()>((AliRICHdigit*)pObj)->Id()) return 1; else return -1;}
156
c1863e3c 157 Bool_t IsSortable() const{return kTRUE;}//virtual
ed3ceb24 158 Int_t CombiPid() const{return fCombiPid;}
cb8189e7 159 Int_t C() const{return fChamber/10;}
160 Int_t S() const{return fChamber-(fChamber/10)*10;}
161 Int_t Chamber() const{return C();}
162 Int_t Sector() const{return S();}
c1863e3c 163 Int_t X() const{return fPadX;}
164 Int_t Y() const{return fPadY;}
cb8189e7 165 Int_t Id() const{return fChamber*10000000+fPadX*1000+fPadY;}
c1863e3c 166 Double_t Q() const{return fQdc;}
ed3ceb24 167 Int_t Tid(Int_t i) const{return fTracks[i];}
cb8189e7 168 void Print(Option_t *option="")const; //virtual
853634d3 169protected:
ed3ceb24 170 Int_t fCombiPid; //1000000*Ncerenkovs+1000*Nfeedbacks+Nmips
171 Int_t fChamber; //10*chamber number+ sector number
c1863e3c 172 Int_t fPadX; //pad number along X
173 Int_t fPadY; //pad number along Y
ed3ceb24 174 Double_t fQdc; //QDC value, fractions are permitted for summable procedure
175 ClassDef(AliRICHdigit,2) //RICH digit class
853634d3 176};//class AliRICHdigit
cbaf35fb 177
ed3ceb24 178//__________________AliRICHcluster__________________________________________________________________
c1863e3c 179class AliRICHcluster :public TObject
180{
181public:
6865fb8d 182 enum ClusterStatus {kEdge,kShape,kSize,kRaw,kResolved};
183 AliRICHcluster() {fSize=fQdc=fStatus=fChamber=fDimXY=0;fX=fY=kBad;fDigits=0;}
53fd478b 184 virtual ~AliRICHcluster() {delete fDigits;}
185 AliRICHcluster& operator=(const AliRICHcluster&) {return *this;}
6865fb8d 186 Int_t Nlocals() const{return fSize - 10000*(fSize/10000);} //
187 Int_t Size() const{return fSize/10000;} //
188 Int_t Fsize() const{return fSize;} //
cb8189e7 189 Int_t DimXY() const{return fDimXY;} //
190 Int_t C() const{return fChamber/10;} //
191 Int_t S() const{return fChamber-(fChamber/10)*10;} //
6865fb8d 192 Int_t Fchamber() const{return fChamber;} //
cb8189e7 193 Int_t Chamber() const{return C();} //
194 Int_t Sector() const{return S();} //
195 Int_t Q() const{return fQdc;} //
196 Double_t X() const{return fX;} //
197 Double_t Y() const{return fY;} //
198 Int_t Status() const{return fStatus;} //
199 void SetStatus(Int_t status) {fStatus=status;} //
ed3ceb24 200 Int_t Nmips() const{return fCombiPid-1000000*Ncerenkovs()-1000*Nfeedbacks();} //
201 Int_t Ncerenkovs() const{return fCombiPid/1000000;} //
202 Int_t Nfeedbacks() const{return (fCombiPid-1000000*Ncerenkovs())/1000;} //
203 Bool_t IsPureMip() const{return fCombiPid<1000;}
204 Bool_t IsPureCerenkov() const{return Nmips()==0&&Nfeedbacks()==0;} //
205 Bool_t IsPureFeedback() const{return Nmips()==0&&Ncerenkovs()==0;} //
6865fb8d 206 Int_t CombiPid() const{return fCombiPid;} //
ed3ceb24 207 void SetCombiPid(Int_t ckov,Int_t feeds,Int_t mips) {fCombiPid=1000000*ckov+1000*feeds+mips;} //
6865fb8d 208 void Fill(AliRICHcluster *pRaw,Double_t x,Double_t y, Double_t q, Int_t combipid)
209 {fCombiPid=combipid;fChamber=pRaw->Fchamber();fSize=pRaw->Fsize();
210 fQdc=(Int_t)(q*pRaw->Q());fX=x;fY=y;fStatus=kResolved;} //
cb8189e7 211 TObjArray* Digits() const{return fDigits;} //
212 void Print(Option_t *option="")const; //virtual
213 inline void AddDigit(AliRICHdigit *pDig); //
6865fb8d 214 inline void CoG(Int_t nLocals); //
ed3ceb24 215 void Reset() {fSize=fQdc=fStatus=fChamber=fDimXY=kBad;fX=fY=kBad;delete fDigits;fDigits=0;} //
c1863e3c 216protected:
ed3ceb24 217 Int_t fCombiPid; //1000000*Ncerenkovs+1000*Nfeedbacks+Nmips
6865fb8d 218 Int_t fSize; //10000*(how many digits belong to this cluster) + nLocalMaxima
c1863e3c 219 Int_t fDimXY; //100*xdim+ydim box containing the cluster
220 Int_t fQdc; //QDC value
221 Int_t fChamber; //10*module number+sector number
222 Double_t fX; //local x postion
223 Double_t fY; //local y postion
224 Int_t fStatus; //flag to mark the quality of the cluster
225 TObjArray *fDigits; //! list of digits forming this cluster
ed3ceb24 226 ClassDef(AliRICHcluster,2) //RICH cluster class
c1863e3c 227};//class AliRICHcluster
228//__________________________________________________________________________________________________
229void AliRICHcluster::AddDigit(AliRICHdigit *pDig)
cb8189e7 230{//
ed3ceb24 231 if(!fDigits) {fQdc=fSize=fCombiPid=0;fDigits = new TObjArray;}
cbaf35fb 232 fQdc+=(Int_t)pDig->Q(); fDigits->Add(pDig);
cb8189e7 233 fChamber=10*pDig->C()+pDig->S();
6865fb8d 234 fSize+=10000;
cbaf35fb 235}
236//__________________________________________________________________________________________________
6865fb8d 237void AliRICHcluster::CoG(Int_t nLocals)
cb8189e7 238{//
239 Int_t xmin=999,ymin=999,xmax=0,ymax=0;
240 Double_t x,y;
241 fX=fY=0;
242 for(Int_t iDig=0;iDig<Size();iDig++) {
243 AliRICHdigit *pDig=(AliRICHdigit*)fDigits->At(iDig);
244 Int_t padX = pDig->X();Int_t padY = pDig->Y();Double_t q=pDig->Q();
245 AliRICHParam::Pad2Loc(padX,padY,x,y);
246 fX += x*q;fY +=y*q;
247 if(padX<xmin)xmin=padX;if(padX>xmax)xmax=padX;if(padY<ymin)ymin=padY;if(padY>ymax)ymax=padY;
cbaf35fb 248 }
cb8189e7 249 fX/=fQdc;fY/=fQdc;//Center of Gravity
250 fDimXY = 100*(xmax-xmin+1)+ymax-ymin+1;//find box containing cluster
6865fb8d 251 fSize+=nLocals;
cb8189e7 252 fStatus=kRaw;
253}//CoG()
af3d25a6 254class AliRICHreco: public TObject
255{
256public:
257 AliRICHreco() {fTid=fNphotons=kBad; fThetaCherenkov=kBad;}
258 AliRICHreco(Int_t tid,Double_t thetaCherenkov,Int_t nPhotons) {fTid=tid;fThetaCherenkov=thetaCherenkov;fNphotons=nPhotons;}
ed3ceb24 259
af3d25a6 260 virtual ~AliRICHreco() {;}
261
262 void Print(Option_t *option="")const; //virtual print
263
264protected:
265 Int_t fTid; // track Id reference
266 Int_t fNphotons; // number of photons contributed to the recontruction
267 Double_t fThetaCherenkov; // reconstructed Theta Cerenkov for a given charged track
268
269 ClassDef(AliRICHreco,1) //RICH reco class
270
271};//class AliRICHreco
c021cb15 272//__________________AliRICH_________________________________________________________________________
3ea9cb08 273class AliRICHParam;
ed3ceb24 274class AliRICHChamber;
3ea9cb08 275class AliRICHSDigit;
276
2f614988 277class AliRICH : public AliDetector
278{
2f614988 279public:
853634d3 280 AliRICH();
af3d25a6 281 AliRICH(const char *name, const char *title);
942194a4 282 AliRICH(const AliRICH& RICH):AliDetector(RICH) {;}
853634d3 283 virtual ~AliRICH();
dfb4e77d 284
942194a4 285 AliRICH& operator=(const AliRICH&) {return *this;}
c60862bf 286 virtual Int_t IsVersion() const =0;
287 void Hits2SDigits(); //virtual
288 void SDigits2Digits(); //virtual
c021cb15 289
c60862bf 290 inline void CreateHits();
c1863e3c 291 inline void CreateSDigits();
c60862bf 292 inline void CreateDigits();
293 inline void CreateClusters();
af3d25a6 294 inline void CreateRecos();
295 void AddHit(Int_t track, Int_t *vol, Float_t *hits) {TClonesArray &tmp=*fHits; new(tmp[fNhits++])AliRICHhit(fIshunt,track,vol,hits);}//virtual
296 void AddHit(Int_t tid,TVector3 x3) {TClonesArray &tmp=*fHits;new(tmp[fNhits++])AliRICHhit(tid,x3);}
297 void AddHit(Int_t tid,TVector3 x3in,TVector3 x3out,Double_t eloss) {TClonesArray &tmp=*fHits;new(tmp[fNhits++])AliRICHhit(tid,x3in,x3out,eloss);}
ed3ceb24 298 inline void AddSDigit(int c,int x,int y,int q,int pid,int tid);
299 void AddDigit(int c,int x,int y,int q,int cpid,int *tid){TClonesArray &tmp=*((TClonesArray*)fDigitsNew->At(c-1));new(tmp[fNdigitsNew[c-1]++])AliRICHdigit(c,x,y,q,cpid,tid[0],tid[1],tid[2]);}
300 void AddCluster(AliRICHcluster &cl) {TClonesArray &tmp=*((TClonesArray*)fClusters->At(cl.C()-1));new(tmp[fNclusters[cl.C()-1]++])AliRICHcluster(cl);}
af3d25a6 301 void AddReco(Int_t tid,Double_t thetaCherenkov,Int_t nPhotons) {TClonesArray &tmp=*(TClonesArray*)fRecos;new(tmp[fNrecos++])AliRICHreco(tid,thetaCherenkov,nPhotons);}
ed3ceb24 302 void ResetHits() {AliDetector::ResetHits();fNcerenkovs=0;if(fCerenkovs)fCerenkovs->Clear();fNspecials=0;if(fSpecials)fSpecials->Clear();} //virtual
303 void ResetSDigits() {fNsdigits=0; if(fSdigits) fSdigits ->Clear();}
304 void ResetDigits() {if(fDigitsNew)for(int i=0;i<kNCH;i++){fDigitsNew->At(i)->Clear();fNdigitsNew[i]=0;}}
305 void ResetClusters() {if(fClusters) for(int i=0;i<kNCH;i++){fClusters ->At(i)->Clear();fNclusters[i]=0;}}
af3d25a6 306 void ResetRecos() {if(fRecos) fRecos->Clear();fNrecos=0;}
c60862bf 307 //Hits provided by AliDetector
c1863e3c 308 TClonesArray* SDigits() const{return fSdigits;}
543d5224 309 TClonesArray* Digits(Int_t iC) const{if(fDigitsNew) return (TClonesArray *)fDigitsNew->At(iC-1);else return 0;}
c60862bf 310 TClonesArray* Clusters(Int_t iC) const{if(fClusters) return (TClonesArray *)fClusters->At(iC-1);else return 0;}
af3d25a6 311 TClonesArray* Recos() const{return fRecos;}
c60862bf 312
313 AliRICHChamber* C(Int_t iC) const{return (AliRICHChamber*)fChambers->At(iC-1);}
314 AliRICHParam* Param() const{return fpParam;}
ed3ceb24 315 AliRICHParam* P() const{return fpParam;}
3ea9cb08 316 void CreateChambers();
c60862bf 317 void CreateMaterials(); //virtual
318 virtual void BuildGeometry(); //virtual
319 virtual void CreateGeometry(); //virtual
53fd478b 320 Float_t AbsoCH4(Float_t x)const;
321 Float_t Fresnel(Float_t ene,Float_t pdoti, Bool_t pola)const;
3ea9cb08 322
c021cb15 323 virtual void StepManager()=0;
c60862bf 324 void GenerateFeedbacks(Int_t iChamber,Float_t eloss);
325 void Print(Option_t *option)const;//virtual
326 void MakeBranch(Option_t *opt=" ");
327 void SetTreeAddress();//virtual
543d5224 328// OLD staff OLD staff
329 inline void AddCerenkov(Int_t track, Int_t *vol, Float_t *cerenkovs);
53fd478b 330 inline void AddSpecialOld(Int_t *array);
543d5224 331
332 inline void CreateCerenkovsOld();
333 inline void CreateSpecialsOld();
543d5224 334 void ResetSpecialsOld(){fNspecials=0; if(fSpecials) fSpecials->Clear();}
543d5224 335 TClonesArray* Specials() const{return fSpecials;}
336 TClonesArray* Cerenkovs() const{return fCerenkovs;}
c60862bf 337
3ea9cb08 338
c60862bf 339
340 AliRICHChamber& Chamber(Int_t id) {return *((AliRICHChamber *) (*fChambers)[id]);}
c60862bf 341// Int_t DistancetoPrimitive(Int_t /*px*/, Int_t /*py*/) {return 9999;}
2f614988 342
c60862bf 343protected:
53fd478b 344 enum {kCSI=6,kGAP=9};
c021cb15 345 AliRICHParam *fpParam; //main RICH parametrization
346 TObjArray *fChambers; //list of RICH chambers
c60862bf 347 //fHits and fDigits belong to AliDetector
348 TClonesArray *fSdigits; //! List of sdigits
aed240d4 349 Int_t fNsdigits; //! Current number of sdigits
c60862bf 350 TObjArray *fDigitsNew; //! Each chamber holds it's one lists of digits
aed240d4 351 Int_t fNdigitsNew[kNCH]; //! Array of current numbers of digits
c60862bf 352 TObjArray *fClusters; //! Each chamber holds it's one lists of clusters
aed240d4 353 Int_t fNclusters[kNCH]; //! Array of current numbers of raw clusters
af3d25a6 354 TClonesArray *fRecos; //! pointer to the list of recos
355 Int_t fNrecos; //! number of recos
c60862bf 356
357 TClonesArray *fCerenkovs; //! ??? List of cerenkovs
aed240d4 358 Int_t fNcerenkovs; //! ??? Current number of cerenkovs
c60862bf 359 TClonesArray *fSpecials; //! ??? List of specials
aed240d4 360 Int_t fNspecials; //! ??? Current number of specials
dfb4e77d 361 Int_t fCkovNumber; // Number of Cerenkov photons
dfb4e77d 362 Int_t fFreonProd; // Cerenkovs produced in freon
dfb4e77d 363 Int_t fFeedbacks; // Number of feedback photons
ddae0931 364
aed240d4 365 ClassDef(AliRICH,4) //Main RICH class
c60862bf 366};//class AliRICH
ed3ceb24 367
c1863e3c 368//__________________________________________________________________________________________________
c60862bf 369void AliRICH::CreateHits()
370{
371 if(fHits) return;
372 if(GetDebug())Info("CreateHits","creating hits container.");
373 fHits=new TClonesArray("AliRICHhit",10000); fNhits=0;
543d5224 374}
c60862bf 375//__________________________________________________________________________________________________
c1863e3c 376void AliRICH::CreateSDigits()
c60862bf 377{
378 if(fSdigits) return;
c1863e3c 379 if(GetDebug())Info("CreateSDigits","creating sdigits container.");
c60862bf 380 fSdigits=new TClonesArray("AliRICHdigit",10000); fNsdigits=0;
543d5224 381}
c60862bf 382//__________________________________________________________________________________________________
383void AliRICH::CreateDigits()
384{
385 if(fDigitsNew) return;
386 if(GetDebug())Info("CreateDigits","creating digits containers.");
387 fDigitsNew = new TObjArray(kNCH);
388 for(Int_t i=0;i<kNCH;i++) {fDigitsNew->AddAt(new TClonesArray("AliRICHdigit",10000), i); fNdigitsNew[i]=0;}
543d5224 389}
c60862bf 390//__________________________________________________________________________________________________
391void AliRICH::CreateClusters()
392{
393 if(fClusters) return;
394 if(GetDebug())Info("CreateClusters","creating clusters containers.");
395 fClusters = new TObjArray(kNCH);
396 for(Int_t i=0;i<kNCH;i++) {fClusters->AddAt(new TClonesArray("AliRICHcluster",10000), i); fNclusters[i]=0;}
543d5224 397}
ed3ceb24 398//__________________________________________________________________________________________________
af3d25a6 399void AliRICH::CreateRecos()
400{
401 if(fRecos) return;
402 if(GetDebug())Info("CreateRecos","creating recos containers.");
403 fRecos = new TClonesArray("AliRICHreco",1000);fNrecos=0;
404}
405//__________________________________________________________________________________________________
ed3ceb24 406void AliRICH::AddSDigit(int c,int x,int y,int q,int pid,int tid)
407{
408 switch(pid){
409 case 50000048: pid=1000000;break;
410 case 50000052: pid=1000; break;
411 default: pid=1; break;
412 }
413 TClonesArray &tmp=*fSdigits;
414 new(tmp[fNsdigits++])AliRICHdigit(c,x,y,q,pid,tid,kBad,kBad);
415}//AddSDigit()
c60862bf 416
417
ed3ceb24 418//______OLD OLD OLD OLD_____________________________________________________________________________
c60862bf 419void AliRICH::CreateCerenkovsOld()
420{
421 if(fCerenkovs) return;
422 if(GetDebug())Info("CreateCerenkovs","creating cerenkovs container.");
423 fCerenkovs=new TClonesArray("AliRICHCerenkov",10000); fNcerenkovs=0;
543d5224 424}
c60862bf 425//__________________________________________________________________________________________________
426void AliRICH::CreateSpecialsOld()
427{
428 if(fSpecials) return;
429 if(GetDebug())Info("CreateSpecialsOld","creating SDigits special container.");
430 fSpecials=new TClonesArray("AliRICHSDigit",100000); fNspecials=0;
543d5224 431}
c60862bf 432//__________________________________________________________________________________________________
853634d3 433void AliRICH::AddCerenkov(Int_t track, Int_t *vol, Float_t *cerenkovs)
434{//Adds the current RICH cerenkov hit to the Cerenkovs list
435 TClonesArray &tmp=*fCerenkovs;
436 new(tmp[fNcerenkovs++]) AliRICHCerenkov(fIshunt,track,vol,cerenkovs);
437}
c021cb15 438//__________________________________________________________________________________________________
543d5224 439void AliRICH::AddSpecialOld(Int_t *aiSDigit)
c60862bf 440{// Adds the current Sdigit to the RICH list of Specials
441 TClonesArray &lSDigits = *fSpecials;
543d5224 442 new(lSDigits[fNspecials++]) AliRICHSDigit(aiSDigit);
443}
c60862bf 444#endif//#ifndef AliRICH_h