]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TRD/AliTRDv1.cxx
ALIfied Pythia version for PYQUEN.
[u/mrichter/AliRoot.git] / TRD / AliTRDv1.cxx
index 7f7534541b5b403213390f48a57106516744a1cf..19b1a7e4beb092999648b0bf7365e01a26ef511e 100644 (file)
@@ -30,6 +30,7 @@
 #include <TVector.h>
 #include <TVirtualMC.h>
 #include <TGeoManager.h>
+#include <TGeoMatrix.h>
 #include <TGeoPhysicalNode.h>
 
 #include "AliConst.h"
@@ -119,14 +120,16 @@ void AliTRDv1::AddAlignableVolumes() const
   TString volPath;
   TString symName;
 
-  TString vpStr  = "ALIC_1/B077_1/BSEGMO";
-  TString vpApp1 = "_1/BTRD";
-  TString vpApp2 = "_1";
-  TString vpApp3 = "/UTR1_1/UTS1_1/UTI1_1/UT";
+  TString vpStr   = "ALIC_1/B077_1/BSEGMO";
+  TString vpApp1  = "_1/BTRD";
+  TString vpApp2  = "_1";
+  TString vpApp3a = "/UTR1_1/UTS1_1/UTI1_1/UT";
+  TString vpApp3b = "/UTR2_1/UTS2_1/UTI2_1/UT";
+  TString vpApp3c = "/UTR3_1/UTS3_1/UTI3_1/UT";
 
-  TString snStr  = "TRD/sm";
-  TString snApp1 = "/st";
-  TString snApp2 = "/pl";
+  TString snStr   = "TRD/sm";
+  TString snApp1  = "/st";
+  TString snApp2  = "/pl";
 
   //
   // The super modules
@@ -156,6 +159,9 @@ void AliTRDv1::AddAlignableVolumes() const
   //                         TRD/sm17/st4/pl5
   //
   for (Int_t isect = 0; isect < AliTRDgeometry::Nsect(); isect++) {
+
+    if (fGeometry->GetSMstatus(isect) == 0) continue;
+
     for (Int_t icham = 0; icham < AliTRDgeometry::Ncham(); icham++) {
       for (Int_t iplan = 0; iplan < AliTRDgeometry::Nplan(); iplan++) {
 
@@ -166,7 +172,22 @@ void AliTRDv1::AddAlignableVolumes() const
         volPath += vpApp1;
         volPath += isect;
         volPath += vpApp2;
-        volPath += vpApp3;
+        switch (isect) {
+        case 13:
+        case 14:
+        case 15:
+          if (icham == 2) {
+            continue;
+         }
+          volPath += vpApp3c;
+          break;
+        case 11:
+        case 12:
+          volPath += vpApp3b;
+          break;
+        default:
+          volPath += vpApp3a;
+       };
         volPath += Form("%02d",idet);
         volPath += vpApp2;
 
@@ -181,12 +202,12 @@ void AliTRDv1::AddAlignableVolumes() const
          gGeoManager->SetAlignableEntry(symName.Data(),volPath.Data());
 
        // Add the tracking to local matrix following the TPC example
-
        if (alignableEntry) {
          const char *path = alignableEntry->GetTitle();
          if (!gGeoManager->cd(path)) {
            AliFatal(Form("Volume path %s not valid!",path));
          }
+         // Is this correct still????
          TGeoHMatrix *globMatrix = gGeoManager->GetCurrentMatrix();
          Double_t sectorAngle = 20.0 * (isect % 18) + 10.0;
          TGeoHMatrix *t2lMatrix  = new TGeoHMatrix();
@@ -197,6 +218,7 @@ void AliTRDv1::AddAlignableVolumes() const
        else {
          AliError(Form("Alignable entry %s is not valid!",symName.Data()));
        }
+
       }
     }
   }
@@ -1205,6 +1227,10 @@ Double_t IntSpecGeant(Double_t *x, Double_t *)
   Int_t    i;
   Double_t energy = x[0];
 
+  if (energy >= arre[npts-1]) {
+    return 0.0;
+  }
+
   for (i = 0; i < npts; i++) {
     if (energy < arre[i]) {
       break;