#ifndef AliHMPIDDigitN_h #define AliHMPIDDigitN_h /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * See cxx source for full Copyright notice */ #include //base class class AliHMPIDDigitN :public AliDigit //TObject-AliDigit-AliHMPIDDigit { 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{kPadsPcX=80,kPadsPcY=48,kPadsChamX=160,kPadsChamY=144,kNpc=6}; //Segmentation structure //ctor&dtor AliHMPIDDigitN( ):AliDigit(),fPad(Abs(-1,-1,-1,-1)) ,fQdc(-1) {} //default ctor inline AliHMPIDDigitN(Int_t c,Float_t x,Float_t y,Float_t q); //ctor virtual ~AliHMPIDDigitN() {} //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 ( ); //draw PCs Int_t Ddl ( )const{return (PadX()Pad()) return 0; else if(fPad >((AliHMPIDDigitN*)pObj)->Pad()) return 1; else return -1; } //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ AliHMPIDDigitN::AliHMPIDDigitN(Int_t c,Float_t x,Float_t y,Float_t q):AliDigit(),fPad(Abs(-1,-1,-1,-1)),fQdc(-1) { // Determines abs pad number containing the given point (x,y) defined in the chamber RS. // Pad count starts in lower left corner from 1,1 to 144,160 in upper right corner of a chamber. // y ^ 4 5 // | 2 3 // | 0 1 // -------> x Int_t pc,padx,pady; if (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; fPad=Abs(c,pc,padx,pady); fQdc=q; } #endif