/*
$Log$
+ Revision 1.6 2001/01/24 21:00:29 jbarbosa
+ Redefinition of sectors and pad coordinates/real coordinates transformations.
+
+ Revision 1.5 2001/01/22 21:37:39 jbarbosa
+ Added parametrised definiton sectors
+
Revision 1.4 2001/01/22 21:35:39 jbarbosa
Added deadzone size to data members
// Default constructor for AliRICHSegmantionV1 (with dead zones)
- fNpx=160;
- fNpy=144;
+ fNpx=144;
+ fNpy=160;
//fNpx=80;
//fNpy=48;
fDeadZone=2.6;
fSector=-1;
}
-//________________________________________________________________________________
-AliRICHSegmentationV1::~AliRICHSegmentationV1()
-{
-// Destructor
+void AliRICHSegmentationV1::Init(Int_t id)
+{
-}
+// Initialisation of chambers
+
+ //printf("* Initialising SegmentationV1 (dead zones) in chamber %d *\n",id+1);
+
+ // parametrised definition
+
+ Float_t csi_length = fNpy*fDpy + fDeadZone;
+ Float_t csi_width = fNpx*fDpx + 2*fDeadZone;
+ fPadPlane_Width = (csi_width - 2*fDeadZone)/3;
+ fPadPlane_Length = (csi_length - fDeadZone)/2;
+
+}
// calculate sector from x-y coordinates
}
}*/
-
- // parametrised definition
-
- Float_t csi_length = fNpx*Dpx() + fDeadZone;
- Float_t csi_width = fNpy*Dpy() + 2*fDeadZone;
-
- fPadPlane_Width = (csi_width - 2*fDeadZone)/3;
- fPadPlane_Length = (csi_length - fDeadZone)/2;
+ //Parametrized definition
- //printf("\n\n\n\n\n\n padplane w: %f l:%f wr: %f \n\n\n\n\n\n\n\n", fPadPlane_Width,fPadPlane_Length,63.1-22.75);
-
- if (x<-fDeadZone/2)
+ if (y<-fDeadZone/2)
{
- if (y> fPadPlane_Width/2 +fDeadZone)
+ if (x> fPadPlane_Width/2 +fDeadZone)
{
- if ( fPadPlane_Width/2 +fDeadZone + fPadPlane_Width)
+ if ( x<fPadPlane_Width/2 +fDeadZone + fPadPlane_Width)
fSector=0;
}
- if (y< fPadPlane_Width/2)
+ if (x< fPadPlane_Width/2)
{
- if (y> -( fPadPlane_Width/2))
+ if (x> -( fPadPlane_Width/2))
fSector=2;
}
- if (y< -( fPadPlane_Width/2 +fDeadZone))
+ if (x< -( fPadPlane_Width/2 +fDeadZone))
{
- if (y> -( fPadPlane_Width/2 +fDeadZone + fPadPlane_Width))
+ if (x> -( fPadPlane_Width/2 +fDeadZone + fPadPlane_Width))
fSector=4;
}
}
- else if (x>fDeadZone/2)
+ else if (y>fDeadZone/2)
{
- if (y> fPadPlane_Width/2 +fDeadZone)
+ if (x> fPadPlane_Width/2 +fDeadZone)
{
- if ( fPadPlane_Width/2 +fDeadZone + fPadPlane_Width)
- fSector=0;
+ if (x< fPadPlane_Width/2 +fDeadZone + fPadPlane_Width)
+ fSector=1;
}
- if (y< fPadPlane_Width/2)
+ if (x< fPadPlane_Width/2)
{
- if (y> -( fPadPlane_Width/2))
- fSector=2;
+ if (x> -( fPadPlane_Width/2))
+ fSector=3;
}
- if (y< -( fPadPlane_Width/2 +fDeadZone))
+ if (x< -( fPadPlane_Width/2 +fDeadZone))
{
- if (y> -( fPadPlane_Width/2 +fDeadZone + fPadPlane_Width))
- fSector=4;
+ if (x> -( fPadPlane_Width/2 +fDeadZone + fPadPlane_Width))
+ fSector=5;
}
}
+
//if (fSector==2)
//printf("x:%f, y:%f, sector:%d\n",x,y,fSector);
//printf("Sector: %d\n",sector);
-
if (sector==0)
{
//ix = (x>0)? Int_t(x/fDpx)+1 : Int_t(x/fDpx);
//iy = (y>0)? Int_t(y/fDpy)+1 : Int_t(y/fDpy);
- ix = Int_t (x/fDpx+fDeadZone/2);
- iy = Int_t (y/fDpy-fDeadZone);
+ ix = Int_t ((x-fDeadZone)/fDpx);
+ iy = Int_t ((y+fDeadZone/2)/fDpy)-1;
}
if (sector==1)
{
- ix = Int_t (x/fDpx-fDeadZone/2);
- iy = Int_t (y/fDpy-fDeadZone);
+ ix = Int_t ((x-fDeadZone)/fDpx);
+ iy = Int_t ((y-fDeadZone/2)/fDpy);
}
if (sector==2)
{
- ix = Int_t (x/fDpx+fDeadZone/2);
- iy = Int_t (y/fDpy);
+ ix = (x>=0)? ix = Int_t (x/fDpx) : ix = Int_t (x/fDpx)-1;
+ iy = Int_t ((y+fDeadZone/2)/fDpy)-1;
}
if (sector==3)
{
- ix = Int_t (x/fDpx-fDeadZone);
- iy = Int_t (y/fDpy);
+ ix = (x>=0)? ix = Int_t (x/fDpx) : ix = Int_t (x/fDpx)-1;
+ iy = Int_t ((y-fDeadZone/2)/fDpy);
}
if (sector==4)
{
- ix = Int_t (x/fDpx+fDeadZone/2);
- iy = Int_t (y/fDpy+fDeadZone);
+ ix = Int_t ((x+fDeadZone)/fDpx)-1;
+ iy = Int_t ((y+fDeadZone/2)/fDpy)-1;
}
if (sector==5)
{
- ix = Int_t (x/fDpx-fDeadZone/2);
- iy = Int_t (y/fDpy+fDeadZone);
+ ix = Int_t ((x+fDeadZone)/fDpx)-1;
+ iy = Int_t ((y-fDeadZone/2)/fDpy);
}
+
//ix = Int_t (x/fDpx);
//iy = Int_t (y/fDpy);
// parametrised definition
+ Float_t padplane_width = fNpx/3;
- Float_t padplane_width = fNpy/3;
-
- if (ix<=0)
+ if (iy<0)
{
- if (iy <= fNpy/2)
+ if (ix < fNpx/2)
{
- if (iy > fNpy/2 - padplane_width)
+ if (ix >= padplane_width/2)
sector=0;
}
- if (iy<= padplane_width/2)
+ if (ix< padplane_width/2)
{
- if (iy > -(padplane_width/2))
+ if (ix >= -(padplane_width/2))
sector=2;
}
- if (iy <= -(padplane_width/2))
+ if (ix >= -(fNpx/2))
{
- if (iy > -(fNpy/2))
+ if (ix < -(padplane_width/2))
sector=4;
}
}
- if (ix>0)
+ if (iy>=0)
{
- if (iy <= fNpy/2)
+ if (ix < fNpx/2)
{
- if (iy > fNpy/2 - padplane_width)
- sector=0;
+ if (ix >= padplane_width/2)
+ sector=1;
}
- if (iy<= padplane_width/2)
+ if (ix< padplane_width/2)
{
- if (iy > -(padplane_width/2))
- sector=2;
+ if (ix >= -(padplane_width/2))
+ sector=3;
}
- if (iy <= -(padplane_width/2))
+ if (ix >= -(fNpx/2))
{
- if (iy > -(fNpy/2))
- sector=4;
+ if (ix < -(padplane_width/2))
+ sector=5;
}
}
{
//x = (ix>0) ? Float_t(ix*fDpx)-fDpx/2. : Float_t(ix*fDpx)-fDpx/2.;
//y = (iy>0) ? Float_t(iy*fDpy)-fDpy/2. : Float_t(iy*fDpy)-fDpy/2.;
- x = Float_t(ix*fDpx)-fDpx/2.-fDeadZone/2;
- y = Float_t(iy*fDpy)-fDpy/2.+fDeadZone;
+ x = Float_t(ix)*fDpx+fDpx/2+fDeadZone;
+ y = Float_t(iy)*fDpy+fDpy/2-fDeadZone/2;
}
if (sector==1)
{
- x = Float_t(ix*fDpx)-fDpx/2.+fDeadZone/2;
- y = Float_t(iy*fDpy)-fDpy/2.+fDeadZone;
+ x = Float_t(ix)*fDpx+fDpx/2+fDeadZone;
+ y = Float_t(iy)*fDpy+fDpy/2+fDeadZone/2;
}
if (sector==2)
{
- x = Float_t(ix*fDpx)-fDpx/2.-fDeadZone/2;
- y = Float_t(iy*fDpy)-fDpy/2.;
+ x = (ix>=0) ? x = Float_t(ix)*fDpx+fDpx/2 : x = Float_t(ix)*fDpx+fDpx/2;
+ y = Float_t(iy)*fDpy+fDpy/2-fDeadZone/2;
}
if (sector==3)
{
- x = Float_t(ix*fDpx)-fDpx/2.+fDeadZone;
- y = Float_t(iy*fDpy)-fDpy/2.;
+ x = (ix>=0) ? x = Float_t(ix)*fDpx+fDpx/2 : x = Float_t(ix)*fDpx+fDpx/2;
+ y = Float_t(iy)*fDpy+fDpy/2+fDeadZone/2;
}
if (sector==4)
{
- x = Float_t(ix*fDpx)-fDpx/2.-fDeadZone/2;
- y = Float_t(iy*fDpy)-fDpy/2.-fDeadZone;
+ x = Float_t(ix)*fDpx+fDpx/2-fDeadZone;
+ y = Float_t(iy)*fDpy+fDpy/2-fDeadZone/2;
}
if (sector==5)
{
- x = Float_t(ix*fDpx)-fDpx/2.+fDeadZone/2;
- y = Float_t(iy*fDpy)-fDpy/2.-fDeadZone;
+ x = Float_t(ix)*fDpx+fDpx/2-fDeadZone;
+ y = Float_t(iy)*fDpy+fDpy/2+fDeadZone/2;
}
+
//if (sector==2)
//printf("fSector:%d x:%f y:%f\n",fSector,x,y);