]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONSegmentationSlatModuleN.cxx
Update of SSD simulation and reconstruction code by Boris and Enrico.
[u/mrichter/AliRoot.git] / MUON / AliMUONSegmentationSlatModuleN.cxx
index fd0d7529413e9c745b4007afbc17df9d4fe8fd41..080c253152f07e46aa2c8d67e15d75a882492137 100644 (file)
 
 /*
 $Log$
+Revision 1.6  2000/12/21 22:12:41  morsch
+Clean-up of coding rule violations,
+
+Revision 1.5  2000/10/26 19:32:04  morsch
+Problem with iteration over y-pads for 2nd cathode corrected.
+
+Revision 1.4  2000/10/25 19:56:55  morsch
+Handle correctly slats with less than 3 segmentation zones.
+
+Revision 1.3  2000/10/22 16:56:33  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)
+
 */
 
 /////////////////////////////////////////////////////
@@ -37,6 +56,12 @@ AliMUONSegmentationSlatModuleN::AliMUONSegmentationSlatModuleN()
 // Default constructor
 }
 
+AliMUONSegmentationSlatModuleN::AliMUONSegmentationSlatModuleN(Int_t nsec) 
+ : AliMUONSegmentationSlatModule(nsec) 
+{
+// Non default constructor
+}
+
 
 Float_t AliMUONSegmentationSlatModuleN::Dpx(Int_t isec) const
 {
@@ -66,11 +91,13 @@ 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;
        }
     }
 //
 //
+
     if (isec == -1) {
        ix = 0;
        iy = 0;
@@ -118,16 +145,17 @@ void AliMUONSegmentationSlatModuleN::NextPad()
 
     if (fIy > fNpyS[fSector])  printf("\n this pad %f %f %d %d \n",fX,fY,fIx,fIy);
     GetPadC(fIx, fIy, xc, yc);
-//    printf("\n Next Pad (n)%d %d %f %f %d", fIx,fIy,fX,fY,fSector);
+//    printf("\n Next Pad (n)%d %d %f %f %d %f %d ", fIx,fIy,fX,fY,fSector, fYmax, fIxmax);
 }
 
 Int_t AliMUONSegmentationSlatModuleN::MorePads()
+{
 // Stopping condition for the iterator over pads
 //
 //
 // Are there more pads in the integration region
-{
-    if ((fY >= fYmax  && fIx >= fIxmax) || fIy == -1) {
+
+    if (fIy == -1) {
        return 0;
     } else {
        return 1;
@@ -137,8 +165,6 @@ Int_t AliMUONSegmentationSlatModuleN::MorePads()
 void AliMUONSegmentationSlatModuleN::
 Neighbours(Int_t iX, Int_t iY, Int_t* Nlist, Int_t Xlist[10], Int_t Ylist[10])
 {
-
-    
 // Returns list of next neighbours for given Pad (iX, iY)
 //
 //
@@ -201,7 +227,6 @@ Neighbours(Int_t iX, Int_t iY, Int_t* Nlist, Int_t Xlist[10], Int_t Ylist[10])
 
 void AliMUONSegmentationSlatModuleN::Init(Int_t chamber)
 {
-    printf("\n Initialise segmentation SlatModuleN \n");
 //
 //  Fill the arrays fCx (x-contour) for each sector
 //  These arrays help in converting from real to pad co-ordinates and
@@ -211,6 +236,10 @@ void AliMUONSegmentationSlatModuleN::Init(Int_t chamber)
 //  concentric circles as shown below
 //
 //  PCB module size in cm
+
+    printf("\n Initialise Segmentation SlatModuleN \n");
+
+
     fDxPCB=40;
     fDyPCB=40;
 //
@@ -223,7 +252,6 @@ void AliMUONSegmentationSlatModuleN::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]);
        }
     }
 //
@@ -240,9 +268,6 @@ void AliMUONSegmentationSlatModuleN::Init(Int_t chamber)
        } else {
            fNpxS[isec] = fNpxS[isec-1] + fPcbBoards[isec]*fNpxPCB;
            fNpyS[isec] = Int_t(fDyPCB/fDpy)*(*fNDiv)[isec];
-
-           printf("\n %d %d ",isec, fNpxS[isec]);
-           
            fCx[isec] = fCx[isec-1] + fPcbBoards[isec]*fDxPCB;
            fNpx += fPcbBoards[isec] * fNpxPCB;
        }
@@ -250,6 +275,9 @@ void AliMUONSegmentationSlatModuleN::Init(Int_t chamber)
 
     fNpx=fNpxS[3];
     fNpy=Int_t(fDyPCB/fDpy)*(*fNDiv)[1];
+//  
+    fId = chamber;
+    
 }