#ifndef AliHMPIDDigit_h #define AliHMPIDDigit_h /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * See cxx source for full Copyright notice */ // Class of HMPID to manage digits ---> pads // // #include //base class #include "TMath.h" //Mathieson() #include "TRandom.h" //IsOverTh() #include //Raw() class TClonesArray; //Hit2Sdi() class AliHMPIDDigit :public AliDigit //TObject-AliDigit-AliHMPIDDigit { public: enum EChamberData{kMinCh=0,kMaxCh=6,kMinPc=0,kMaxPc=5}; //Segmenation enum EPadxData{kPadPcX=80,kMinPx=0,kMaxPx=79,kMaxPcx=159}; //Segmentation structure along x enum EPadyData{kPadPcY=48,kMinPy=0,kMaxPy=47,kMaxPcy=143}; //Segmentation structure along y //ctor&dtor AliHMPIDDigit( ):AliDigit( ),fPad(Abs(-1,-1,-1,-1)),fQ(-1) {} //default ctor AliHMPIDDigit(Int_t pad,Int_t q,Int_t *t):AliDigit(t),fPad(pad ),fQ(q ) {} //digit ctor AliHMPIDDigit(const AliHMPIDDigit &d ):AliDigit(d),fPad(d.fPad),fQ(d.fQ) {} //copy ctor virtual ~AliHMPIDDigit() {} //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 Draw (Option_t *opt="" ); //TObject::Draw() overloaded void Print (Option_t *opt="" )const; //TObject::Print() overloaded //private part static Int_t Abs (Int_t ch,Int_t pc,Int_t x,Int_t y) {return ch*100000000+pc*1000000+x*1000+y; } //(ch,pc,padx,pady)-> abs pad static Int_t A2C (Int_t pad ) {return pad/100000000; } //abs pad -> chamber static Int_t A2P (Int_t pad ) {return pad%100000000/1000000; } //abs pad -> pc static Int_t A2X (Int_t pad ) {return pad%1000000/1000; } //abs pad -> pad X static Int_t A2Y (Int_t pad ) {return pad%1000; } //abs pad -> pad Y 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 static Bool_t IsOverTh (Float_t q ) {return q >= fgSigmas; } //is digit over threshold???? static Bool_t IsInside (Float_t x,Float_t y,Float_t margin=0){return x>-margin&&y>-margin&&x(w32,ddl,r,d,a) inline void Raw (UInt_t w32,Int_t ddl ); //(w32,ddl)->digit inline Bool_t Set (Int_t c,Int_t p,Int_t x,Int_t y,Int_t tid=0); //manual creation void SetQ (Float_t q ) {fQ=q;} //manual creation void SetSigmas (Int_t sigmas ) {fgSigmas=sigmas;} //manual creation static void WriteRaw (TObjArray *pDigLst ); //write as raw stream static Float_t CathAnoCath ( ) {return 0.445;} //Cathode-Anode-cathode pitch static Float_t MaxPcX (Int_t iPc ) {return fgkMaxPcX[iPc];} // PC limits static Float_t MaxPcY (Int_t iPc ) {return fgkMaxPcY[iPc];} // PC limits static Float_t MinPcX (Int_t iPc ) {return fgkMinPcX[iPc];} // PC limits static Float_t MinPcY (Int_t iPc ) {return fgkMinPcY[iPc];} // PC limits static Int_t Sigmas ( ) {return fgSigmas;} // Getter n. sigmas for noise static Float_t SizeAllX ( ) {return fgkMaxPcX[5];} //all PCs size x, [cm] static Float_t SizeAllY ( ) {return fgkMaxPcY[5];} //all PCs size y, [cm] static Float_t SizeArea ( ) {return SizePcX()*SizePcY()*(kMaxPc-kMinPc+1);} //sence area, [cm^2] static Float_t SizeDead ( ) {return 2.6;} //dead zone size x, [cm] static Float_t SizeGap ( ) {return 8; } static Float_t SizePadX ( ) {return 0.8;} //pad size x, [cm] static Float_t SizePadY ( ) {return 0.84;} //pad size y, [cm] static Float_t SizePcX ( ) {return fgkMaxPcX[0];} //PC size x, [cm] static Float_t SizePcY ( ) {return fgkMaxPcY[0];} //PC size y, [cm] static Float_t SizeWin ( ) {return 0.5;} //Quartz window width static Float_t SizeRad ( ) {return 1.5;} //Rad width inline static Bool_t IsInDead(Float_t x,Float_t y ); //is point in dead area? inline static void Lors2Pad(Float_t x,Float_t y,Int_t &pc,Int_t &px,Int_t &py); //(x,y)->(pc,px,py) protected: //AliDigit has fTracks[3] static Int_t fgSigmas; //sigma cut on charge static const Float_t fgkMinPcX[6]; //limits PC static const Float_t fgkMinPcY[6]; //limits PC static const Float_t fgkMaxPcX[6]; //limits PC static const Float_t fgkMaxPcY[6]; //limits PC static const Float_t fgk1; //Mathieson parameters static const Float_t fgk2; // static const Float_t fgkSqrtK3; // static const Float_t fgk4; // Int_t fPad; //absolute pad number Float_t fQ; //QDC value, fractions are permitted for summable procedure ClassDef(AliHMPIDDigit,4) //HMPID digit class };//class AliHMPIDDigit //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ void AliHMPIDDigit::Lors2Pad(Float_t x,Float_t y,Int_t &pc,Int_t &px,Int_t &py) { // Check the pad of given position // Arguments: x,y- position [cm] in LORS; pc,px,py- pad where to store the result // Returns: none pc=px=py=-1; if (x>= 0 && x<= SizePcX() ) {pc=0; px=Int_t( x / SizePadX());}//PC 0 or 2 or 4 else if(x>=SizePcX()+SizeDead() && x<= SizeAllX() ) {pc=1; px=Int_t((x- SizePcX()- SizeDead()) / SizePadX());}//PC 2 or 4 or 6 else return; if (y>= 0 && y<= SizePcY() ) { py=Int_t( y / SizePadY());}//PC 0 or 1 else if(y>=SizePcY()+SizeDead() && y<=2*SizePcY()+SizeDead() ) {pc+=2;py=Int_t((y- SizePcY()- SizeDead()) / SizePadY());}//PC 2 or 3 else if(y>=SizeAllY()-SizePcY() && y<= SizeAllY() ) {pc+=4;py=Int_t((y-2*SizePcY()-2*SizeDead()) / SizePadY());}//PC 4 or 5 else return; } //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Int_t AliHMPIDDigit::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==((AliHMPIDDigit*)pObj)->Pad()) return 0; else if(fPad >((AliHMPIDDigit*)pObj)->Pad()) return 1; else return -1; } //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Bool_t AliHMPIDDigit::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() && ykMaxPx) return kTRUE; if(pykMaxPy) return kTRUE; fPad=Abs(ch,pc,px,py);fTracks[0]=tid; fQ=0; return kFALSE; } #endif