X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=HMPID%2FAliHMPIDDigit.h;h=3beda52d89f1d188be4352a6b6a8ccce5b99bf1e;hb=90bec8c53fe4099c9a53c39efb382b0a6066333d;hp=0efc0f88909e00a5c1c3b19685579ae0758cb353;hpb=a1d55ff3c823aa78b70d3b7eb31cde79d45527bc;p=u%2Fmrichter%2FAliRoot.git diff --git a/HMPID/AliHMPIDDigit.h b/HMPID/AliHMPIDDigit.h index 0efc0f88909..3beda52d89f 100644 --- a/HMPID/AliHMPIDDigit.h +++ b/HMPID/AliHMPIDDigit.h @@ -3,100 +3,106 @@ /* 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 //Mathieson() -#include //IsOverTh() +#include +#include +#include "TMath.h" //Mathieson() #include //Raw() - +#include "AliHMPIDParam.h" +//#include "AliHMPIDRawStream.h" 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 +AliHMPIDDigit(): + AliDigit( ), + fPad(AliHMPIDParam::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) + {if(fQ>4095) fQ=4095;} //digit ctor +//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +AliHMPIDDigit(Int_t pad,Int_t q): + AliDigit( ), + fPad(pad), + fQ(q ) + {if(fQ>4095) fQ=4095;} //digit ctor +//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +AliHMPIDDigit& operator=(const AliHMPIDDigit& d) +{ + // + // Assignment operator + // + if(this!=&d){ + AliDigit::operator=(d); + fPad = d.fPad; + fQ = d.fQ; + } + return *this; +} +//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +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 c,Int_t s,Int_t x,Int_t y) {return c*100000000+s*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 >= 4; } //is digit over threshold???? - static Bool_t IsInside (Float_t x,Float_t y ) {return x>0&&y>0&&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,Float_t q=0,Int_t tid=0); //manual creation - static void WriteRaw (TObjArray *pDigLst ); //write as raw stream - - static Float_t SizeAllX ( ) {return fMaxPcX[5];} //all PCs size x, [cm] - static Float_t SizeAllY ( ) {return fMaxPcY[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 fMaxPcX[0];} //PC size x, [cm] - static Float_t SizePcY ( ) {return fMaxPcY[0];} //PC size y, [cm] - static Float_t SizeWin ( ) {return 0.5;} //Quartz window width - static Float_t SizeRad ( ) {return 1.5;} //Rad width - static const Float_t fMinPcX[6]; - static const Float_t fMinPcY[6]; - static const Float_t fMaxPcX[6]; - static const Float_t fMaxPcY[6]; - - 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] - Int_t fPad; //absolute pad number - Float_t fQ; //QDC value, fractions are permitted for summable procedure - ClassDef(AliHMPIDDigit,4) //HMPID digit class -};//class AliHMPIDDigitN + inline void Raw(UInt_t &w32,Int_t &ddl,Int_t &r,Int_t &d,Int_t &a)const; + 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;if(fQ>4095)fQ=4095;} //setter for charge + void SetPad (Int_t pad ) {fPad=pad;} //setter for pad + +protected: //AliDigit has fTracks[3] + -typedef AliHMPIDDigit AliRICHDigit; // for backward compatibility + 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. @@ -108,32 +114,82 @@ Int_t AliHMPIDDigit::Compare(const TObject *pObj) const else return -1; } //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -Bool_t AliHMPIDDigit::IsInDead(Float_t x,Float_t y) + +Double_t AliHMPIDDigit::MathiesonX(Double_t x)const { -// 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 +// Mathieson function. +// This is the answer to electrostatic problem of charge distrubution in MWPC described elsewhere. (NIM A370(1988)602-603) +// Arguments: x- position of the center of Mathieson distribution +// Returns: value of the Mathieson function - if(x>SizePcX() && xSizePcY() && ySizeAllY()-SizePcY()-SizeDead() && y24 || d<1 || d>10 || a<0 || a>47) {w32=0;ddl=-1;r=-1;d=-1;a=-1; return;} //clm: the assert is removed not to break the reconstruction code + AliBitPacking::PackWord((UInt_t)fQ,w32, 0,11); // 0000 0rrr rrdd ddaa aaaa qqqq qqqq qqqq Qdc bits (00..11) counts (0..4095) + AliBitPacking::PackWord( a ,w32,12,17); // 3322 2222 2222 1111 1111 1000 0000 0000 DILOGIC address bits (12..17) counts (0..47) + AliBitPacking::PackWord( d ,w32,18,21); // 1098 7654 3210 9876 5432 1098 7654 3210 DILOGIC number bits (18..21) counts (1..10) + AliBitPacking::PackWord( r ,w32,22,26); // Row number bits (22..26) counts (1..24) + AliBitPacking::PackWord((UInt_t)0, w32,27,27); //To make sure set the 27th bit to Zero so we can distinguis it from the EoE } //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -Bool_t AliHMPIDDigit::Set(Int_t ch,Int_t pc,Int_t px,Int_t py,Float_t qdc,Int_t tid) +Bool_t AliHMPIDDigit::Set(Int_t ch,Int_t pc,Int_t px,Int_t py,Int_t tid) { // Manual creation of digit // Arguments: ch,pc,px,py,qdc,tid -// Returns: none - if(pxkMaxPx) return kTRUE; - if(pykMaxPy) return kTRUE; +// Returns: kTRUE if wrong digit + if(chAliHMPIDParam::kMaxCh) return kTRUE; + if(pcAliHMPIDParam::kMaxPc) return kTRUE; + if(pxAliHMPIDParam::kMaxPx) return kTRUE; + if(pyAliHMPIDParam::kMaxPy) return kTRUE; + - fPad=Abs(ch,pc,px,py);fQ=qdc;fTracks[0]=tid; + fPad=AliHMPIDParam::Abs(ch,pc,px,py);fTracks[0]=tid; + fQ=0; return kFALSE; } +//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + #endif