]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TRD/AliTRDv1.cxx
Fix of TOF problem, Calculation of dEdx and PID during propagation to TOF, Writing...
[u/mrichter/AliRoot.git] / TRD / AliTRDv1.cxx
index e61b4150b23ae338cf4444b5251faa50b5c18334..19b1a7e4beb092999648b0bf7365e01a26ef511e 100644 (file)
 #include <TVector.h>
 #include <TVirtualMC.h>
 #include <TGeoManager.h>
+#include <TGeoMatrix.h>
 #include <TGeoPhysicalNode.h>
 
 #include "AliConst.h"
 #include "AliLog.h"
+#include "AliTrackReference.h"
 #include "AliMC.h"
 #include "AliRun.h"
 
 #include "AliTRDgeometry.h"
 #include "AliTRDhit.h"
-#include "AliTRDsim.h"
+#include "AliTRDsimTR.h"
 #include "AliTRDv1.h"
 
 ClassImp(AliTRDv1)
@@ -118,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
@@ -155,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++) {
 
@@ -165,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;
 
@@ -180,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();
@@ -196,6 +218,7 @@ void AliTRDv1::AddAlignableVolumes() const
        else {
          AliError(Form("Alignable entry %s is not valid!",symName.Data()));
        }
+
       }
     }
   }
@@ -343,7 +366,7 @@ void AliTRDv1::Init()
     AliInfo("TR simulation off");
   }
   else {
-    fTR = new AliTRDsim();
+    fTR = new AliTRDsimTR();
   }
 
   // First ionization potential (eV) for the gas mixture (90% Xe + 10% CO2)
@@ -529,7 +552,7 @@ void AliTRDv1::StepManagerGeant()
         // Create a track reference at the entrance of each
         // chamber that contains the momentum components of the particle
         gMC->TrackMomentum(mom);
-        AddTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber());
+        AddTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber(), AliTrackReference::kTRD);
 
         // Create the hits from TR photons if electron/positron is
         // entering the drift volume
@@ -545,7 +568,7 @@ void AliTRDv1::StepManagerGeant()
         // Create a track reference at the exit of each
         // chamber that contains the momentum components of the particle
         gMC->TrackMomentum(mom);
-        AddTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber());
+        AddTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber(), AliTrackReference::kTRD);
 
       }
 
@@ -776,7 +799,7 @@ void AliTRDv1::StepManagerErmilova()
         // Create a track reference at the entrance of each
         // chamber that contains the momentum components of the particle
         gMC->TrackMomentum(mom);
-        AddTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber());
+        AddTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber(), AliTrackReference::kTRD);
 
         // Create the hits from TR photons if electron/positron is
         // entering the drift volume
@@ -792,7 +815,7 @@ void AliTRDv1::StepManagerErmilova()
         // Create a track reference at the exit of each
         // chamber that contains the momentum components of the particle
         gMC->TrackMomentum(mom);
-        AddTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber());
+        AddTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber(), AliTrackReference::kTRD);
 
       }
 
@@ -971,7 +994,7 @@ void AliTRDv1::StepManagerFixedStep()
     // Create a track reference at the entrance of each
     // chamber that contains the momentum components of the particle
     gMC->TrackMomentum(mom);
-    AddTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber());
+    AddTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber(), AliTrackReference::kTRD);
     trkStat = 1;
 
     // Create the hits from TR photons if electron/positron is
@@ -988,7 +1011,7 @@ void AliTRDv1::StepManagerFixedStep()
     // Create a track reference at the exit of each
     // chamber that contains the momentum components of the particle
     gMC->TrackMomentum(mom);
-    AddTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber());
+    AddTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber(), AliTrackReference::kTRD);
     trkStat = 2;
 
   }
@@ -1204,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;