Chamber half-planes of stations 3-5 at different z-positions.
authormorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 8 Nov 2000 13:01:40 +0000 (13:01 +0000)
committermorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 8 Nov 2000 13:01:40 +0000 (13:01 +0000)
MUON/AliMUONSegmentationSlat.cxx
MUON/AliMUONv1.cxx

index e4681d2a7294c0abd13a95a4055a2185724e4a9d..5a6ca849f92a369aba433b88a0843567cd5ed14e 100644 (file)
 
 /*
 $Log$
+Revision 1.6  2000/11/06 09:20:43  morsch
+AliMUON delegates part of BuildGeometry() to AliMUONSegmentation using the
+Draw() method. This avoids code and parameter replication.
+
 Revision 1.5  2000/10/23 13:37:40  morsch
 Correct z-position of slat planes.
 
@@ -115,6 +119,7 @@ void AliMUONSegmentationSlat::GlobalToLocal(
 //                                                 positive side is shifted up
 // by half the overlap
     zlocal = z-fChamber->Z();
+    zlocal = (x>0) ? zlocal-2.*fDz : zlocal+2.*fDz;
 //  Set the signs for the symmetry transformation and transform to first quadrant
     SetSymmetry(x);
     Float_t xabs=TMath::Abs(x);
@@ -177,7 +182,9 @@ LocalToGlobal(Int_t islat, Float_t  xlocal, Float_t  ylocal, Float_t  &x, Float_
     x = (xlocal+fXPosition[islat])*fSym;
     y=(ylocal+fYPosition[islat]);
 
-    z = (TMath::Even(islat)) ? -fDz : fDz ; 
+    z = (TMath::Even(islat)) ?     -fDz : fDz ; 
+    z = (x>0)                ? z+2.*fDz : z-2.*fDz ; 
+
     z+=fChamber->Z();
 }
 
@@ -249,7 +256,8 @@ GetPadC(Int_t ix, Int_t iy, Float_t &x, Float_t &y, Float_t &z)
     x=x*TMath::Sign(1,ix);
 
 // z-position
-    z = (TMath::Even(islat)) ? -fDz : fDz ; 
+    z = (TMath::Even(islat)) ?      -fDz : fDz ; 
+    z = (x>0)                ?  z+2.*fDz : z-2.*fDz ; 
     z += fChamber->Z();
 }
 
index 2c0d3390be0c66633e3097f9c6caba2a0b59be18..14e521dac94572ef74bb54a9c4f2b44b23f69f9e 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+Revision 1.15  2000/11/06 11:39:02  morsch
+Bug in StepManager() corrected.
+
 Revision 1.14  2000/11/06 09:16:50  morsch
 Avoid overlap of slat volumes.
 
@@ -615,21 +618,22 @@ void AliMUONv1::CreateGeometry()
         spar[0] = slatLength3[i]/2.; 
         spar[1] = slatHeight/2.;
         spar[2] = slatWidth/2.; 
+        Float_t dzCh3=spar[2];
         // zSlat to be checked (odd downstream or upstream?)
         Float_t zSlat = (i%2 ==0)? -slatWidth/2. : slatWidth/2.; 
         zSlat*=1.01;
         sprintf(volNam5,"S05%d",i);
         gMC->Gsvolu(volNam5,"BOX",slatMaterial,spar,3);
-        gMC->Gspos(volNam5, i*4+1,"C05M", xSlat3, ySlat31, zSlat, 0, "ONLY");
-        gMC->Gspos(volNam5, i*4+2,"C05M",-xSlat3, ySlat31, zSlat, 0, "ONLY");
-        gMC->Gspos(volNam5, i*4+3,"C05M", xSlat3, ySlat32,-zSlat, 0, "ONLY");
-        gMC->Gspos(volNam5, i*4+4,"C05M",-xSlat3, ySlat32,-zSlat, 0, "ONLY");
+        gMC->Gspos(volNam5, i*4+1,"C05M", xSlat3, ySlat31, zSlat+2.*dzCh3, 0, "ONLY");
+        gMC->Gspos(volNam5, i*4+2,"C05M",-xSlat3, ySlat31, zSlat-2.*dzCh3, 0, "ONLY");
+        gMC->Gspos(volNam5, i*4+3,"C05M", xSlat3, ySlat32,-zSlat+2.*dzCh3, 0, "ONLY");
+        gMC->Gspos(volNam5, i*4+4,"C05M",-xSlat3, ySlat32,-zSlat-2.*dzCh3, 0, "ONLY");
         sprintf(volNam6,"S06%d",i);
         gMC->Gsvolu(volNam6,"BOX",slatMaterial,spar,3);
-        gMC->Gspos(volNam6, i*4+1,"C06M", xSlat3, ySlat31, zSlat, 0, "ONLY");
-        gMC->Gspos(volNam6, i*4+2,"C06M",-xSlat3, ySlat31, zSlat, 0, "ONLY");
-        gMC->Gspos(volNam6, i*4+3,"C06M", xSlat3, ySlat32,-zSlat, 0, "ONLY");
-        gMC->Gspos(volNam6, i*4+4,"C06M",-xSlat3, ySlat32,-zSlat, 0, "ONLY");
+        gMC->Gspos(volNam6, i*4+1,"C06M", xSlat3, ySlat31, zSlat+2.*dzCh3, 0, "ONLY");
+        gMC->Gspos(volNam6, i*4+2,"C06M",-xSlat3, ySlat31, zSlat-2.*dzCh3, 0, "ONLY");
+        gMC->Gspos(volNam6, i*4+3,"C06M", xSlat3, ySlat32,-zSlat+2.*dzCh3, 0, "ONLY");
+        gMC->Gspos(volNam6, i*4+4,"C06M",-xSlat3, ySlat32,-zSlat-2.*dzCh3, 0, "ONLY");
         // 1st pcb in 1st slat made by some rectangular divisions
 /*
         if (i==0) {                        
@@ -842,24 +846,25 @@ void AliMUONv1::CreateGeometry()
         spar[0] = slatLength4[i]/2.; 
         spar[1] = slatHeight/2.;
         spar[2] = slatWidth/2.; 
+        Float_t dzCh4=spar[2];
         // zSlat to be checked (odd downstream or upstream?)
-        Float_t zSlat = (i%2 ==0)? slatWidth/2. : -slatWidth/2.
+        Float_t zSlat = (i%2 ==0)? dzCh4 : -dzCh4
         zSlat*=1.01;
         sprintf(volNam7,"S07%d",i);
         gMC->Gsvolu(volNam7,"BOX",slatMaterial,spar,3);
-        gMC->Gspos(volNam7, i*4+1,"C07M", xSlat4, ySlat4, zSlat, 0, "ONLY");
-        gMC->Gspos(volNam7, i*4+2,"C07M",-xSlat4, ySlat4, zSlat, 0, "ONLY");
+        gMC->Gspos(volNam7, i*4+1,"C07M", xSlat4, ySlat4, zSlat+2.*dzCh4, 0, "ONLY");
+        gMC->Gspos(volNam7, i*4+2,"C07M",-xSlat4, ySlat4, zSlat-2.*dzCh4, 0, "ONLY");
         if (i>0) { 
-          gMC->Gspos(volNam7, i*4+3,"C07M", xSlat4,-ySlat4, zSlat, 0, "ONLY");
-          gMC->Gspos(volNam7, i*4+4,"C07M",-xSlat4,-ySlat4, zSlat, 0, "ONLY");
+          gMC->Gspos(volNam7, i*4+3,"C07M", xSlat4,-ySlat4, zSlat+2.*dzCh4, 0, "ONLY");
+          gMC->Gspos(volNam7, i*4+4,"C07M",-xSlat4,-ySlat4, zSlat-2.*dzCh4, 0, "ONLY");
         }
         sprintf(volNam8,"S08%d",i);
         gMC->Gsvolu(volNam8,"BOX",slatMaterial,spar,3);
-        gMC->Gspos(volNam8, i*4+1,"C08M", xSlat4, ySlat4, zSlat, 0, "ONLY");
-        gMC->Gspos(volNam8, i*4+2,"C08M",-xSlat4, ySlat4, zSlat, 0, "ONLY");
+        gMC->Gspos(volNam8, i*4+1,"C08M", xSlat4, ySlat4, zSlat+2.*dzCh4, 0, "ONLY");
+        gMC->Gspos(volNam8, i*4+2,"C08M",-xSlat4, ySlat4, zSlat-2.*dzCh4, 0, "ONLY");
         if (i>0) { 
-          gMC->Gspos(volNam8, i*4+3,"C08M", xSlat4,-ySlat4, zSlat, 0, "ONLY");
-          gMC->Gspos(volNam8, i*4+4,"C08M",-xSlat4,-ySlat4, zSlat, 0, "ONLY");
+          gMC->Gspos(volNam8, i*4+3,"C08M", xSlat4,-ySlat4, zSlat+2.*dzCh4, 0, "ONLY");
+          gMC->Gspos(volNam8, i*4+4,"C08M",-xSlat4,-ySlat4, zSlat-2.*dzCh4, 0, "ONLY");
         }
      }
 
@@ -1004,7 +1009,7 @@ void AliMUONv1::CreateGeometry()
      zpos2=iChamber2->Z();
      dstation = zpos2 - zpos1;
      zfpos=-(iChamber->DGas()+dframez+iChamber->DAlu())/2;
-     
+     printf("\n %f %f %f", zpos1, zpos2, dstation);
 //
 //   Mother volume
      tpar[0] = iChamber->RInner()-dframep; 
@@ -1035,24 +1040,26 @@ void AliMUONv1::CreateGeometry()
        spar[0] = slatLength5[i]/2.; 
        spar[1] = slatHeight/2.;
        spar[2] = slatWidth/2.; 
+       Float_t dzCh5=spar[2];
        // zSlat to be checked (odd downstream or upstream?)
-       Float_t zSlat = (i%2 ==0)? -slatWidth/2. : slatWidth/2.
+       Float_t zSlat = (i%2 ==0)? -dzCh5 : dzCh5
        zSlat*=1.01;
        sprintf(volNam9,"S09%d",i);
        gMC->Gsvolu(volNam9,"BOX",slatMaterial,spar,3);
-       gMC->Gspos(volNam9, i*4+1,"C09M", xSlat5, ySlat5, zSlat, 0, "ONLY");
-       gMC->Gspos(volNam9, i*4+2,"C09M",-xSlat5, ySlat5, zSlat, 0, "ONLY");
+       gMC->Gspos(volNam9, i*4+1,"C09M", xSlat5, ySlat5, zSlat+2.*dzCh5, 0, "ONLY");
+       gMC->Gspos(volNam9, i*4+2,"C09M",-xSlat5, ySlat5, zSlat-2.*dzCh5, 0, "ONLY");
        if (i>0) { 
-        gMC->Gspos(volNam9, i*4+3,"C09M", xSlat5,-ySlat5, zSlat, 0, "ONLY");
-        gMC->Gspos(volNam9, i*4+4,"C09M",-xSlat5,-ySlat5, zSlat, 0, "ONLY");
+        gMC->Gspos(volNam9, i*4+3,"C09M", xSlat5,-ySlat5, zSlat+2.*dzCh5, 0, "ONLY");
+        gMC->Gspos(volNam9, i*4+4,"C09M",-xSlat5,-ySlat5, zSlat-2.*dzCh5, 0, "ONLY");
        }
+
        sprintf(volNam10,"S10%d",i);
        gMC->Gsvolu(volNam10,"BOX",slatMaterial,spar,3);
-       gMC->Gspos(volNam10, i*4+1,"C10M", xSlat5, ySlat5, zSlat, 0, "ONLY");
-       gMC->Gspos(volNam10, i*4+2,"C10M",-xSlat5, ySlat5, zSlat, 0, "ONLY");
+       gMC->Gspos(volNam10, i*4+1,"C10M", xSlat5, ySlat5, zSlat+2.*dzCh5, 0, "ONLY");
+       gMC->Gspos(volNam10, i*4+2,"C10M",-xSlat5, ySlat5, zSlat-2.*dzCh5, 0, "ONLY");
        if (i>0) { 
-        gMC->Gspos(volNam10, i*4+3,"C10M", xSlat5,-ySlat5, zSlat, 0, "ONLY");
-        gMC->Gspos(volNam10, i*4+4,"C10M",-xSlat5,-ySlat5, zSlat, 0, "ONLY");
+        gMC->Gspos(volNam10, i*4+3,"C10M", xSlat5,-ySlat5, zSlat+2.*dzCh5, 0, "ONLY");
+        gMC->Gspos(volNam10, i*4+4,"C10M",-xSlat5,-ySlat5, zSlat-2.*dzCh5, 0, "ONLY");
        }
      }