X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=RICH%2FAliRICHDigit.h;h=91e7c69e3393deae3e7fc1d4b469921787a4df66;hb=327eaf462c2e9e7adb351493fd5de41fb9c63bae;hp=041a52c9165d0bd661e81b5164b4a2762a169d9d;hpb=543d522478704219be031d1710bf145f56bd24e1;p=u%2Fmrichter%2FAliRoot.git diff --git a/RICH/AliRICHDigit.h b/RICH/AliRICHDigit.h index 041a52c9165..91e7c69e339 100644 --- a/RICH/AliRICHDigit.h +++ b/RICH/AliRICHDigit.h @@ -1,52 +1,176 @@ -#ifndef ALIRICHDIGIT_H -#define ALIRICHDIGIT_H - - +#ifndef AliRICHDigit_h +#define AliRICHDigit_h /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * See cxx source for full Copyright notice */ -/* $Id$ */ - -#include "AliDigit.h" +#include //base class +#include //Mathieson() +#include //IsOverTh() +#include //Raw() -static const Int_t kMAXTRACKSPERRICHDIGIT = 10; +class AliRICHHit; //Hit2Sdi() +class TClonesArray; //Hit2Sdi() + +class AliRICHDigit :public AliDigit //TObject-AliDigit-AliRICHDigit +{ +public: + enum EAbsPad {kChAbs=100000000,kPcAbs=1000000,kPadAbsX=1000,kPadAbsY=1}; //absolute pad number structure + enum ERawData{kDilX=8,kDilY=6,kNdil=10,kNrow=24,kNddls=14}; //RAW data structure + enum EPadData{kPcX=2,kPcY=3,kPad1=0,kPadPcX=80,kPadPcY=48,kPadAllX=kPadPcX*kPcX,kPadAllY=kPadPcY*kPcY,kPcAll=kPcX*kPcY,kPadAll=kPadAllX*kPadAllY}; //Segmentation structure + enum EPadShif{kC=0,kU=1,kUR=2,kR=3,kDR=4,kD=5,kDL=6,kL=7,kUL=8}; +//ctor&dtor + AliRICHDigit( ):AliDigit( ),fPad(Abs(-1,-1,-1,-1)),fQ(-1) {} //default ctor + AliRICHDigit(Int_t pad,Int_t q,Int_t *t ):AliDigit(t),fPad(pad ),fQ(q ) {} //digit ctor + inline AliRICHDigit(Int_t c,Float_t q,Int_t t,Float_t x,Float_t y,Int_t f=0); //sdigit ctor + virtual ~AliRICHDigit() {} //dtor +//framework part + Bool_t IsSortable ( )const{return kTRUE;} //provision to use TObject::Sort() + inline Int_t Compare (const TObject *pObj )const; //provision to use TObject::Sort() + void Print (Option_t *opt="" )const; //TObject::Print() overloaded +//private part + static Int_t Abs (Int_t c,Int_t s,Int_t x,Int_t y) {return c*kChAbs+s*kPcAbs+x*kPadAbsX+y*kPadAbsY; } //(ch,pc,padx,pady)-> abs pad + static Int_t A2C (Int_t pad ) {return pad/kChAbs; } //abs pad -> chamber + static Int_t A2P (Int_t pad ) {return pad%kChAbs/kPcAbs; } //abs pad -> pc + static Int_t A2X (Int_t pad ) {return pad%kPcAbs/kPadAbsX; } //abs pad -> pad X + static Int_t A2Y (Int_t pad ) {return pad%kPadAbsX; } //abs pad -> pad Y + Int_t Addr ( )const{Int_t mapY2A[kDilY]={5,3,1,0,2,4}; return mapY2A[A2Y(fPad)%kDilY]+kDilY*(A2X(fPad)%kDilX);}//raw a=0..47 + void AddTidOffset(Int_t offset ) {for (Int_t i=0; i<3; i++) if (fTracks[i]>0) fTracks[i]+=offset;}; //needed for merging + Int_t Ch ( )const{return A2C(fPad); } //chamber number + Int_t Dilogic ( )const{return 10-PadX()/kDilX; } //raw d=1..10 + static void DrawPc (Bool_t isFill=kTRUE ); //draw PCs + Int_t Ddl ( )const{return (PadX() 9 sdigits, returns total QDC + static Bool_t IsOverTh (Float_t q ) {return q > 6; } //is digit over threshold???? + static Bool_t IsInside (Float_t x,Float_t y ) {return x>0&&y>0&&x= 0 && x<= SizePcX() ) {pc=0; padx=Int_t( x / SizePadX());}//PC 0 or 2 or 4 + else if(x>=SizePcX()+SizeDead() && x<= SizeAllX() ) {pc=1; padx=Int_t((x- SizePcX()- SizeDead()) / SizePadX());}//PC 2 or 4 or 6 + else return; + if (y>= 0 && y<= SizePcY() ) { pady=Int_t( y / SizePadY());}//PC 0 or 1 + else if(y>=SizePcY()+SizeDead() && y<=2*SizePcY()+SizeDead() ) {pc+=2;pady=Int_t((y- SizePcY()- SizeDead()) / SizePadY());}//PC 2 or 3 + else if(y>=SizeAllY()-SizePcY() && y<= SizeAllY() ) {pc+=4;pady=Int_t((y-2*SizePcY()-2*SizeDead()) / SizePadY());}//PC 4 or 5 + else return; + + switch(flag){ + case kUL:padx--;pady++;break; case kU:pady++;break; case kUR:padx++; pady++;break; + + case kL: padx--; break; case kC: break; case kR:padx++; break; + + case kDL:padx--;pady--;break; case kD:pady--;break; case kDR:padx++; pady--;break; + } + if(padx<0 || padx>=kPadPcX) return; + if(pady<0 || pady>=kPadPcY) return; + fPad=Abs(c,pc,padx,pady); + fQ=q*Mathieson(x,y); + fTracks[0]=t; +} +//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +Int_t AliRICHDigit::Compare(const TObject *pObj) const +{ +// Used in Sort() method to compare to objects. Note that abs pad structure is first x then y, hence will be sorted on column basis. +// This feature is used in digitizer to facilitate finding of sdigits for the same pad since they all will come together after sorting. +// Arguments: pObj - pointer to object to compare with +// Retunrs: -1 if AbsPad less then in pObj, 1 if more and 0 if they are the same + if (fPad==((AliRICHDigit*)pObj)->Pad()) return 0; + else if(fPad >((AliRICHDigit*)pObj)->Pad()) return 1; + else return -1; +} +//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +Bool_t AliRICHDigit::IsInDead(Float_t x,Float_t y) +{ +// Check is the current point is outside of sensitive area or in dead zones +// Arguments: x,y -position +// Returns: 1 if not in sensitive zone + if(x<0 || x>SizeAllX() || y<0 || y>SizeAllY()) return kTRUE; //out of pc + + if(x>SizePcX() && xSizePcY() && ySizeAllY()-SizePcY()-SizeDead() && y