update version number
[u/mrichter/AliRoot.git] / RICH / AliRICHMap.h
CommitLineData
a8d26a29 1#ifndef AliRICHMap_h
2#define AliRICHMap_h
a8d26a29 3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
6#include "AliHitMap.h"
7#include <TMatrix.h>
8#include <TMath.h>
9#include <TClonesArray.h>
10
11class AliRICHMap : public AliHitMap
12{
13public:
14 AliRICHMap(TClonesArray *pDig);
15 virtual ~AliRICHMap() {delete fMap;}
d4c94996 16 void FillHits(); //virtual
17 void Clear(const char *) {fMap->Zero();} //virtual
18 void DeleteHit(Int_t ix,Int_t iy) {(*fMap)(ix,iy)=0;} //virtual
19 void SetHit(Int_t ix,Int_t iy,Int_t idigit){(*fMap)(ix,iy)=idigit+1;} //virtual
20 Int_t GetHitIndex(Int_t ix,Int_t iy) const{return (Int_t)TMath::Abs((*fMap)(ix, iy))-1;} //virtual
a8d26a29 21 TObject* GetHit(Int_t ix,Int_t iy) const{Int_t idx=GetHitIndex(ix,iy);return(idx <0)?0:fDigits->At(idx);} //virtual
d4c94996 22 void FlagHit(Int_t ix,Int_t iy) {(*fMap)(ix, iy)=-TMath::Abs((*fMap)(ix,iy));} //virtual
23 Bool_t ValidateHit(Int_t,Int_t) {return 1;} //virtual
24 inline FlagType TestHit(Int_t ix,Int_t iy); //virtual
d3eb6079 25 void Print(const Option_t *) const{fMap->Print();}
a8d26a29 26protected:
27 TClonesArray *fDigits; //List of digits
28 Int_t fNdigits; //Number of digits
29 TMatrix *fMap; //hit map
30 ClassDef(AliRICHMap,0) //Implements map as TMatrix
31};
d4c94996 32//__________________________________________________________________________________________________
33FlagType AliRICHMap::TestHit(Int_t padx,Int_t pady)
34{
35//Is there a hit for given pad?
36 Int_t inf=(Int_t)(*fMap)(padx,pady);
a8d26a29 37 if(inf<0){//flaged as used
38 return kUsed;
39 }else if(inf==0){//no hit
40 return kEmpty;
41 }else{//index of not yet used hit
42 return kUnused;
43 }
d4c94996 44}//TestHit()
a8d26a29 45#endif