]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TRD/AliTRDgeometry.cxx
Fix coding rule violations
[u/mrichter/AliRoot.git] / TRD / AliTRDgeometry.cxx
index fd1efea67fda53bd18eebd0ffb969a6552323a74..05307cda73df426852ac22a2335ce43df42638bf 100644 (file)
 
 #include <TGeoManager.h>
 #include <TGeoPhysicalNode.h>
-#include <TGeoMatrix.h>
+#include <TVirtualMC.h>
 
-#include "AliLog.h"
-#include "AliRunLoader.h"
-#include "AliAlignObj.h"
 #include "AliAlignObjParams.h"
-#include "AliRun.h"
 
-#include "AliTRD.h"
 #include "AliTRDcalibDB.h"
 #include "AliTRDgeometry.h"
 #include "AliTRDpadPlane.h"
-#include "AliTRDSimParam.h"
 
 ClassImp(AliTRDgeometry)
 
@@ -272,12 +266,12 @@ void AliTRDgeometry::Init()
     fRotB21[isector] = TMath::Sin(phi);
     fRotB22[isector] = TMath::Cos(phi);
   }
-
-  // Initialize the SM status
-  for (isector = 0; isector < fgkNsector; isector++) {
-    SetSMstatus(isector,1);
-  }
  
+  // SM status
+  for (Int_t i = 0; i < kNsector; i++) {
+    fSMstatus[i] = 1;
+  }
+
 }
 
 //_____________________________________________________________________________
@@ -575,10 +569,8 @@ void AliTRDgeometry::CreateGeometry(Int_t *idtmed)
   Float_t parTrd[kNparTrd];
   Float_t parCha[kNparCha];
 
-  Char_t  cTagV[6];
-  Char_t  cTagM[5];
-
-  AliTRDSimParam *simParam = AliTRDSimParam::Instance();
+  Char_t  cTagV[100];
+  Char_t  cTagM[100];
 
   // There are three TRD volumes for the supermodules in order to accomodate
   // the different arrangements in front of PHOS
@@ -910,7 +902,7 @@ void AliTRDgeometry::CreateGeometry(Int_t *idtmed)
   ypos = 0.0;
   zpos = 0.0;
   for (Int_t isector = 0; isector < kNsector; isector++) {
-    if (fSMstatus[isector]) {
+    if (GetSMstatus(isector)) {
       sprintf(cTagV,"BTRD%d",isector);
       switch (isector) {
       case 13:
@@ -937,7 +929,7 @@ void AliTRDgeometry::CreateGeometry(Int_t *idtmed)
   ypos = 0.5*fgkSlength + 0.5*fgkFlength;
   zpos = 0.0;
   for (Int_t isector = 0; isector < kNsector; isector++) {
-    if (fSMstatus[isector]) {
+    if (GetSMstatus(isector)) {
       sprintf(cTagV,"BTRD%d",isector);
       gMC->Gspos("UTF1",1,cTagV,xpos, ypos,zpos,0,"ONLY");
       gMC->Gspos("UTF2",1,cTagV,xpos,-ypos,zpos,0,"ONLY");
@@ -966,8 +958,8 @@ void AliTRDgeometry::CreateFrame(Int_t *idtmed)
   Float_t ypos  = 0.0;
   Float_t zpos  = 0.0;
 
-  Char_t  cTagV[5];
-  Char_t  cTagM[5];
+  Char_t  cTagV[100];
+  Char_t  cTagM[100];
 
   const Int_t kNparTRD = 4;
   Float_t parTRD[kNparTRD];
@@ -1378,8 +1370,8 @@ void AliTRDgeometry::CreateFrame(Int_t *idtmed)
   //
 
   // The envelope volume (aluminum)
-  parTRD[0]  =  90.00/2.0;
-  parTRD[1]  = 114.00/2.0;
+  parTRD[0]  =  90.00/2.0 - 0.1;
+  parTRD[1]  = 114.00/2.0 - 0.1;
   parTRD[2]  =   1.50/2.0;
   parTRD[3]  =  70.30/2.0;
   gMC->Gsvolu("USCB","TRD1",idtmed[1301-1],parTRD,kNparTRD);
@@ -1654,7 +1646,7 @@ void AliTRDgeometry::CreateServices(Int_t *idtmed)
   Float_t ypos  = 0.0;
   Float_t zpos  = 0.0;
 
-  Char_t  cTagV[5];
+  Char_t  cTagV[100];
 
   const Int_t kNparBox  = 3;
   Float_t parBox[kNparBox];
@@ -2483,8 +2475,8 @@ void AliTRDgeometry::GroupChamber(Int_t ilayer, Int_t istack, Int_t *idtmed)
   Float_t xyzOrig[3];
   Float_t xyzBoxd[3];
 
-  Char_t  cTagV[5];
-  Char_t  cTagM[5];
+  Char_t  cTagV[100];
+  Char_t  cTagM[100];
 
   for (Int_t i = 0; i < 3; i++) {
     xyzMin[i] = +9999.0; 
@@ -2509,7 +2501,7 @@ void AliTRDgeometry::GroupChamber(Int_t ilayer, Int_t istack, Int_t *idtmed)
     xyzBoxd[i] = 0.5*(xyzMax[i]-xyzMin[i]);
 
   }
-  
+
   sprintf(cTagM,"UT%02d",iDet);
   gMC->Gsvolu(cTagM,"BOX ",idtmed[1302-1],xyzBoxd,kNparCha);
 
@@ -2627,7 +2619,7 @@ Int_t AliTRDgeometry::GetLayer(Int_t det)
 }
 
 //_____________________________________________________________________________
-Int_t AliTRDgeometry::GetStack(Int_t det) const
+Int_t AliTRDgeometry::GetStack(Int_t det)
 {
   //
   // Reconstruct the stack number from the detector number
@@ -2669,7 +2661,7 @@ Int_t AliTRDgeometry::GetStack(Double_t z, Int_t layer)
 }
 
 //_____________________________________________________________________________
-Int_t AliTRDgeometry::GetSector(Int_t det) const
+Int_t AliTRDgeometry::GetSector(Int_t det)
 {
   //
   // Reconstruct the sector number from the detector number
@@ -2751,6 +2743,14 @@ Bool_t AliTRDgeometry::CreateClusterMatrixArray()
     return kFALSE;
   }
 
+  TString volPath;
+  TString vpStr   = "ALIC_1/B077_1/BSEGMO";
+  TString vpApp1  = "_1/BTRD";
+  TString vpApp2  = "_1";
+  TString vpApp3a = "/UTR1_1/UTS1_1/UTI1_1";
+  TString vpApp3b = "/UTR2_1/UTS2_1/UTI2_1";
+  TString vpApp3c = "/UTR3_1/UTS3_1/UTI3_1";
+
   fClusterMatrixArray = new TObjArray(kNdet);
   AliAlignObjParams o;
 
@@ -2762,9 +2762,37 @@ Bool_t AliTRDgeometry::CreateClusterMatrixArray()
       Int_t        iLayerTRD = iLayer - AliGeomManager::kTRD1;
       Int_t        lid       = GetDetector(iLayerTRD,istack,isector);    
 
-      // Taking holes into account
+      // Check for disabled supermodules
+      volPath  = vpStr;
+      volPath += isector;
+      volPath += vpApp1;
+      volPath += isector;
+      volPath += vpApp2;
+      switch (isector) {
+      case 13:
+      case 14:
+      case 15:
+        if (istack == 2) {
+          continue;
+       }
+        volPath += vpApp3c;
+        break;
+      case 11:
+      case 12:
+        volPath += vpApp3b;
+        break;
+      default:
+        volPath += vpApp3a;
+      };
+      if (!gGeoManager->CheckPath(volPath)) {
+       continue;
+      }
+
+      // Check for holes in from of PHOS
       if (((isector == 13) || (isector == 14) || (isector == 15)) && 
-          (istack == 2)) continue; 
+          (istack == 2)) {
+        continue; 
+      }
 
       UShort_t     volid   = AliGeomManager::LayerToVolUID(iLayer,iModule);
       const char  *symname = AliGeomManager::SymName(volid);
@@ -2828,3 +2856,18 @@ Bool_t AliTRDgeometry::ChamberInGeometry(Int_t det)
   }
 
 }
+
+//_____________________________________________________________________________
+Bool_t AliTRDgeometry::IsHole(Int_t /*la*/, Int_t st, Int_t se) const
+{
+  //
+  // Checks for holes in front of PHOS
+  //
+
+  if (((se == 13) || (se == 14) || (se == 15)) && 
+      (st == 2)) {
+    return kTRUE; 
+  }
+  return kFALSE;
+
+}