]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TRD/AliTRDv1.cxx
Include the bug fixes by Oliver in the TR simulation
[u/mrichter/AliRoot.git] / TRD / AliTRDv1.cxx
index a09b25beb58d732627ba021c39e6e26ef564f890..b6b4cd13790822b0b27ac2a888dfa7132cc6b4c7 100644 (file)
 
 /*
 $Log$
+Revision 1.41  2003/04/23 15:19:48  cblume
+Fix bug in absorbtion length of photons
+
+Revision 1.40  2003/04/08 08:14:53  morsch
+AddTrackReference moved to AliModule.
+
+Revision 1.39  2003/02/11 16:54:07  hristov
+Updated AliTrackReference class (S.Radomski)
+
+Revision 1.38  2003/01/31 11:41:06  cblume
+Fix bug in StepManager in treating geometry with holes
+
+Revision 1.37  2003/01/28 14:38:18  cblume
+Add track length to track references
+
+Revision 1.36  2002/11/21 22:38:47  alibrary
+Removing AliMC and AliMCProcess
+
+Revision 1.35  2002/10/14 14:57:44  hristov
+Merging the VirtualMC branch to the main development branch (HEAD)
+
 Revision 1.33.6.2  2002/07/24 10:09:31  alibrary
 Updating VirtualMC
 
@@ -135,7 +156,6 @@ Introduction of the Copyright and cvs Log
 #include <TLorentzVector.h>
 
 #include "AliRun.h"
-#include "AliMC.h"
 #include "AliConst.h"
 
 #include "AliTRDv1.h"
@@ -319,27 +339,37 @@ void AliTRDv1::CreateTRhit(Int_t det)
       // Take the absorbtion in the entrance window into account
       Double_t muMy = fTR->GetMuMy(energyMeV);
       sigma = muMy * fFoilDensity;
-      absLength = gRandom->Exp(sigma);
-      if (absLength < AliTRDgeometry::MyThick()) continue;
+      if (sigma > 0.0) {
+        absLength = gRandom->Exp(1.0/sigma);
+        if (absLength < AliTRDgeometry::MyThick()) continue;
+      }
+      else {
+        continue;
+      }
 
       // The absorbtion cross sections in the drift gas
       if (fGasMix == 1) {
         // Gas-mixture (Xe/CO2)
         Double_t muXe = fTR->GetMuXe(energyMeV);
         Double_t muCO = fTR->GetMuCO(energyMeV);
-        sigma = (0.85 * muXe + 0.15 * muCO) * fGasDensity;
+        sigma = (0.85 * muXe + 0.15 * muCO) * fGasDensity * fTR->GetTemp();
       }
       else {
         // Gas-mixture (Xe/Isobutane) 
         Double_t muXe = fTR->GetMuXe(energyMeV);
         Double_t muBu = fTR->GetMuBu(energyMeV);
-        sigma = (0.97 * muXe + 0.03 * muBu) * fGasDensity;
+        sigma = (0.97 * muXe + 0.03 * muBu) * fGasDensity * fTR->GetTemp();
       }
 
       // The distance after which the energy of the TR photon
       // is deposited.
-      absLength = gRandom->Exp(sigma);
-      if (absLength > AliTRDgeometry::DrThick()) continue;
+      if (sigma > 0.0) {
+        absLength = gRandom->Exp(1.0/sigma);
+        if (absLength > AliTRDgeometry::DrThick()) continue;
+      }
+      else {
+        continue;
+      }
 
       // The position of the absorbtion
       Float_t posHit[3];
@@ -542,6 +572,9 @@ void AliTRDv1::StepManager()
   TLorentzVector pos, mom;
 
   const Int_t    kNplan       = AliTRDgeometry::Nplan();
+  const Int_t    kNcham       = AliTRDgeometry::Ncham();
+  const Int_t    kNdetsec     = kNplan * kNcham;
+
   const Double_t kBig         = 1.0E+12;
 
   // Ionization energy
@@ -602,7 +635,7 @@ void AliTRDv1::StepManager()
       // The plane and chamber number
       cIdChamber[0] = cIdCurrent[2];
       cIdChamber[1] = cIdCurrent[3];
-      Int_t idChamber = atoi(cIdChamber);
+      Int_t idChamber = (atoi(cIdChamber) % kNdetsec);
       cha = ((Int_t) idChamber / kNplan);
       pla = ((Int_t) idChamber % kNplan);
 
@@ -639,7 +672,7 @@ void AliTRDv1::StepManager()
          // momentum components of the particle
           if (gMC->IsTrackEntering() || gMC->IsTrackExiting()) {
             gMC->TrackMomentum(mom);
-            AddTrackReference(gAlice->CurrentTrack(),mom,pos);
+            AddTrackReference(gAlice->CurrentTrack());
           }
 
           // Create the hits from TR photons