]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONSlatGeometryBuilder.cxx
code cleanup: renaming functions; adding prototype code for later development; no...
[u/mrichter/AliRoot.git] / MUON / AliMUONSlatGeometryBuilder.cxx
index aa0cdd6b03c312f838a5b054199536467e83dc41..c5df6525edbea9e44d8c153129b2c13a9e52cdc7 100644 (file)
@@ -53,6 +53,8 @@
 #include <TGeoTube.h>
 #include <Riostream.h>
 
+using std::endl;
+using std::cout;
 /// \cond CLASSIMP
 ClassImp(AliMUONSlatGeometryBuilder)
 /// \endcond
@@ -657,22 +659,22 @@ void AliMUONSlatGeometryBuilder::CreateGeometry()
          // position the vertical frames 
          if ( i > 2) { 
            GetEnvelopes(moduleSlatCh5)->AddEnvelopeConstituent("S05V", idSlatCh5, 
-                                                   (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
+                                                   (2*i+1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
            GetEnvelopes(moduleSlatCh5)->AddEnvelopeConstituent("S05V", idSlatCh5, 
                                                    (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
            GetEnvelopes(moduleSlatCh6)->AddEnvelopeConstituent("S06V", idSlatCh6, 
-                                                   (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
+                                                   (2*i+1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
            GetEnvelopes(moduleSlatCh6)->AddEnvelopeConstituent("S06V", idSlatCh6, 
                                                    (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));   
          } 
 
          if (i == 2) {
            GetEnvelopes(moduleSlatCh5)->AddEnvelopeConstituent("S05V", idSlatCh5, 
-                                                   (2*i-1)*10+quadrant,TGeoTranslation(xvFrame2,0.,0.)); 
+                                                   (2*i+1)*10+quadrant,TGeoTranslation(xvFrame2,0.,0.)); 
            GetEnvelopes(moduleSlatCh5)->AddEnvelopeConstituent("S05V", idSlatCh5, 
                                                    (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
            GetEnvelopes(moduleSlatCh6)->AddEnvelopeConstituent("S06V", idSlatCh6, 
-                                                   (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
+                                                   (2*i+1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
            GetEnvelopes(moduleSlatCh6)->AddEnvelopeConstituent("S06V", idSlatCh6, 
                                                    (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
          }
@@ -680,9 +682,9 @@ void AliMUONSlatGeometryBuilder::CreateGeometry()
          // Different rotation due to new mapping convention
          if (i == 0 || i == 1) { // first vertical spacers
            GetEnvelopes(moduleSlatCh5)->AddEnvelopeConstituent("S05V", idSlatCh5, 
-                                                   (2*i-1)*10+quadrant,TGeoTranslation(-xvFrame2,0.,0.),TGeoRotation("rotAbX",90,180+angle,90,90+angle,180,0)); 
+                                                   (2*i+1)*10+quadrant,TGeoTranslation(-xvFrame2,0.,0.),TGeoRotation("rotAbX",90,180+angle,90,90+angle,180,0)); 
            GetEnvelopes(moduleSlatCh6)->AddEnvelopeConstituent("S06V", idSlatCh6, 
-                                                   (2*i-1)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.),TGeoRotation("rotAbX",90,180+angle,90,90+angle,180,0));   
+                                                   (2*i+1)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.),TGeoRotation("rotAbX",90,180+angle,90,90+angle,180,0));   
            if (i == 0) { // rounded spacer for central slat (J.C.)
              GetEnvelopes(moduleSlatCh5)->AddEnvelopeConstituent("SC5D", idSlatCh5, 
                                                                  (2*i)*10+quadrant,TGeoTranslation(xvFrame,0.,0.),TGeoRotation("rotAbX",90,180+angle,90,90+angle,180,0));
@@ -924,7 +926,7 @@ void AliMUONSlatGeometryBuilder::CreateGeometry()
        lCableY = ySlat3;
 
        // Cables going out from the start of slat
-       if(kNPCB3[i]>=4){ // Only if 4 or more pcb
+       if(kNPCB3[i]>=4 && i<kNslats3-2){ // Only if 4 or more pcb
          // First top cables
          cablepar[0] = supporthlength/2.;
          lCableX = 0.;
@@ -1378,14 +1380,14 @@ void AliMUONSlatGeometryBuilder::CreateGeometry()
 
        // position the vertical frames 
        if (i != 1) { 
-         GetEnvelopes(moduleSlatCh7)->AddEnvelopeConstituent("S07V", idSlatCh7, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
+         GetEnvelopes(moduleSlatCh7)->AddEnvelopeConstituent("S07V", idSlatCh7, (2*i+1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
          GetEnvelopes(moduleSlatCh7)->AddEnvelopeConstituent("S07V", idSlatCh7, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
-         GetEnvelopes(moduleSlatCh8)->AddEnvelopeConstituent("S08V", idSlatCh8, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
+         GetEnvelopes(moduleSlatCh8)->AddEnvelopeConstituent("S08V", idSlatCh8, (2*i+1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
          GetEnvelopes(moduleSlatCh8)->AddEnvelopeConstituent("S08V", idSlatCh8, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
        } else { // Vertical and Rounded+Vertical spacer - Different rotation due to new mapping convention
-         GetEnvelopes(moduleSlatCh7)->AddEnvelopeConstituent("S07V", idSlatCh7, (2*i-1)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.),TGeoRotation("rotAbX",90,180+angle,90,90+angle,180,0));
+         GetEnvelopes(moduleSlatCh7)->AddEnvelopeConstituent("S07V", idSlatCh7, (2*i+1)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.),TGeoRotation("rotAbX",90,180+angle,90,90+angle,180,0));
          GetEnvelopes(moduleSlatCh7)->AddEnvelopeConstituent("SD7D", idSlatCh7, (2*i)*10+quadrant,TGeoTranslation(xvFrame,-kYpos41[1],0.),TGeoRotation("rotAbX",90,180+angle,90,90+angle,180,0));
-         GetEnvelopes(moduleSlatCh8)->AddEnvelopeConstituent("S08V", idSlatCh8, (2*i-1)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.),TGeoRotation("rotAbX",90,180+angle,90,90+angle,180,0));
+         GetEnvelopes(moduleSlatCh8)->AddEnvelopeConstituent("S08V", idSlatCh8, (2*i+1)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.),TGeoRotation("rotAbX",90,180+angle,90,90+angle,180,0));
          GetEnvelopes(moduleSlatCh8)->AddEnvelopeConstituent("SD8D", idSlatCh8, (2*i)*10+quadrant,TGeoTranslation(+xvFrame,-kYpos42[1],0.),TGeoRotation("rotAbX",90,180+angle,90,90+angle,180,0));
        }
        // position the panels and the insulating material 
@@ -1537,7 +1539,7 @@ void AliMUONSlatGeometryBuilder::CreateGeometry()
       lCableY8 = ySlat42;
 
       // Cables going out from the start of slat
-      if(kNPCB4[i]>=4){ // Only if 4 or more pcb
+      if(kNPCB4[i]>=4 && i<kNslats4-2){ // Only if 4 or more pcb
        // First top cables
        cablepar[0] = (supporthlength-kXpos4[i])/2.;
        lCableX = kXpos4[i]/2.;
@@ -1979,14 +1981,14 @@ void AliMUONSlatGeometryBuilder::CreateGeometry()
 
        // position the vertical frames (spacers)
        if (i != 1) { 
-         GetEnvelopes(moduleSlatCh9)->AddEnvelopeConstituent("S09V", idSlatCh9, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
+         GetEnvelopes(moduleSlatCh9)->AddEnvelopeConstituent("S09V", idSlatCh9, (2*i+1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
          GetEnvelopes(moduleSlatCh9)->AddEnvelopeConstituent("S09V", idSlatCh9, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
-         GetEnvelopes(moduleSlatCh10)->AddEnvelopeConstituent("S10V", idSlatCh10, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
+         GetEnvelopes(moduleSlatCh10)->AddEnvelopeConstituent("S10V", idSlatCh10, (2*i+1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
          GetEnvelopes(moduleSlatCh10)->AddEnvelopeConstituent("S10V", idSlatCh10, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
        } else {  // Vertical and Rounded+Vertical spacer - Different rotation due to new mapping convention
-         GetEnvelopes(moduleSlatCh9)->AddEnvelopeConstituent("S09V", idSlatCh9, (2*i-1)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.),TGeoRotation("rotAbX",90,180+angle,90,90+angle,180,0));
+         GetEnvelopes(moduleSlatCh9)->AddEnvelopeConstituent("S09V", idSlatCh9, (2*i+1)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.),TGeoRotation("rotAbX",90,180+angle,90,90+angle,180,0));
          GetEnvelopes(moduleSlatCh9)->AddEnvelopeConstituent("SD9D", idSlatCh9, (2*i)*10+quadrant,TGeoTranslation(xvFrame,-kYpos5[1],0.),TGeoRotation("rotAbX",90,180+angle,90,90+angle,180,0));
-         GetEnvelopes(moduleSlatCh10)->AddEnvelopeConstituent("S10V", idSlatCh10, (2*i-1)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.),TGeoRotation("rotAbX",90,180+angle,90,90+angle,180,0));
+         GetEnvelopes(moduleSlatCh10)->AddEnvelopeConstituent("S10V", idSlatCh10, (2*i+1)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.),TGeoRotation("rotAbX",90,180+angle,90,90+angle,180,0));
          GetEnvelopes(moduleSlatCh10)->AddEnvelopeConstituent("SD0D", idSlatCh10, (2*i)*10+quadrant,TGeoTranslation(xvFrame,-kYpos5[1],0.),TGeoRotation("rotAbX",90,180+angle,90,90+angle,180,0));
        }