]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONSegmentationSlatModule.cxx
Correct x-position of slats in station 5.
[u/mrichter/AliRoot.git] / MUON / AliMUONSegmentationSlatModule.cxx
index 48ea96eccc2afbbe759b18c68d43f4122403f951..ef63343ddd21cad86893a3d52819900c65b4cb41 100644 (file)
 
 /*
 $Log$
+Revision 1.3  2000/10/22 16:56:32  morsch
+- Store chamber number as slat id.
+
+Revision 1.2  2000/10/18 11:42:06  morsch
+- AliMUONRawCluster contains z-position.
+- Some clean-up of useless print statements during initialisations.
+
+Revision 1.1  2000/10/06 08:59:03  morsch
+Segmentation classes for bending and non bending plane slat modules (A. de Falco, A. Morsch)
+
 */
 
 /////////////////////////////////////////////////////
@@ -92,6 +102,7 @@ GetPadI(Float_t x, Float_t y, Int_t &ix, Int_t &iy)
     for (Int_t i=fNsec-1; i > 0; i--) {
        if (x >= fCx[i-1]) {
            isec=i;
+           if (fCx[isec] == fCx[isec-1]  && isec > 1) isec--;
            break;
        }
     }
@@ -116,7 +127,7 @@ GetPadC(Int_t ix, Int_t iy, Float_t &x, Float_t &y)
 //
 //  Find sector isec
     Int_t isec=AliMUONSegmentationSlatModule::Sector(ix,iy);
-    if (isec == -1) printf("\n PadC %d %d %d  \n ", isec, ix, iy);
+    if (isec == -1) printf("\n PadC %d %d %d  %d \n ", isec, fId, ix, iy);
 //
     if (isec>0) {
        x = fCx[isec-1]+(ix-fNpxS[isec-1])*(*fDpxD)[isec];
@@ -168,24 +179,27 @@ FirstPad(Float_t xhit, Float_t yhit, Float_t dx, Float_t dy)
     Float_t x02=x0a  + dx;
     Float_t y01=yhit - dy;
     Float_t y02=yhit + dy;
-    
     if (x01 < 0) x01 = 0;
     if (y01 < 0) y01 = 0;
+
+    if (x02 >= fCx[fNsec-1]) x02 = fCx[fNsec-1];
+    if (y02 >= fDyPCB) y02 = fDyPCB;
     
+
     Int_t isec=-1;
     for (Int_t i=fNsec-1; i > 0; i--) {
        if (x02 >= fCx[i-1]) {
            isec=i;
+           if (fCx[isec] == fCx[isec-1] && isec > 1) isec--;
            break;
        }
     }
    
-    if (x02 >= fCx[fNsec-1]) x02 = fCx[fNsec-1];
-    if (y02 >= fDyPCB) y02 = fDyPCB;
     //
     // find the pads over which the charge distributes
     GetPadI(x01,y01,fIxmin,fIymin);
     GetPadI(x02,y02,fIxmax,fIymax);
+    
     if (fIxmax > fNpx) fIxmax=fNpx;
     if (fIymax > fNpyS[isec]) fIymax = fNpyS[isec];    
     fXmin=x01;
@@ -205,7 +219,7 @@ FirstPad(Float_t xhit, Float_t yhit, Float_t dx, Float_t dy)
 //    printf("\n \n First Pad: %d %d %f %f %d %d %d %f" , 
 //        fIxmin, fIxmax, fXmin, fXmax, fNpx, fId, isec, Dpy(isec));    
 //    printf("\n \n First Pad: %d %d %f %f %d %d %d %f",
-//        fIymin, fIymax, fYmin, fYmax, fNpy, fId, isec, Dpy(isec));
+//        fIymin, fIymax, fYmin, fYmax,  fNpyS[isec], fId, isec, Dpy(isec));
 }
 
 void AliMUONSegmentationSlatModule::NextPad()
@@ -315,7 +329,7 @@ Neighbours(Int_t iX, Int_t iY, Int_t* Nlist, Int_t Xlist[10], Int_t Ylist[10])
 
 void AliMUONSegmentationSlatModule::Init(Int_t chamber)
 {
-    printf("\n Initialise segmentation SlatModule \n");
+    printf("\n Initialise Segmentation SlatModule \n");
 //
 //  Fill the arrays fCx (x-contour) and fNpxS (ix-contour) for each sector
 //  These arrays help in converting from real to pad co-ordinates and
@@ -340,7 +354,6 @@ void AliMUONSegmentationSlatModule::Init(Int_t chamber)
     if (fNsec > 1) {
        for (Int_t i=fNsec-2; i>=0; i--){
            (*fDpxD)[i]=(*fDpxD)[fNsec-1]/(*fNDiv)[i];
-           printf("\n test ---dx %d %f \n",i,(*fDpxD)[i]);
        }
     }
 //
@@ -362,6 +375,9 @@ void AliMUONSegmentationSlatModule::Init(Int_t chamber)
 // maximum number of pad rows    
     fNpy=nPyPCB;
     fNpx=fNpxS[3];
+//
+    fId = chamber;
+    
 }