]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TRD/AliTRDv1.cxx
Fixing segmentation fault. https://savannah.cern.ch/bugs/?81598
[u/mrichter/AliRoot.git] / TRD / AliTRDv1.cxx
index 9d16f949b1c2d39c21894f341992c433b2a8c73a..3669e67034a2d8a24bf43193d73b48ce48ff5137 100644 (file)
 //                                                                        //
 ////////////////////////////////////////////////////////////////////////////
 
-#include <stdlib.h> 
-
 #include <TLorentzVector.h>
 #include <TMath.h>
 #include <TRandom.h>
-#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"
@@ -41,7 +36,6 @@
 
 #include "AliTRDgeometry.h"
 #include "AliTRDCommonParam.h"
-#include "AliTRDhit.h"
 #include "AliTRDsimTR.h"
 #include "AliTRDv1.h"
 
@@ -50,7 +44,7 @@ ClassImp(AliTRDv1)
 //_____________________________________________________________________________
 AliTRDv1::AliTRDv1()
   :AliTRD()
-  ,fTRon(kFALSE)
+  ,fTRon(kTRUE)
   ,fTR(NULL)
   ,fStepSize(0)
   ,fWion(0)
@@ -421,7 +415,7 @@ void AliTRDv1::StepManager()
 
   // Set the maximum step size to a very large number for all 
   // neutral particles and those outside the driftvolume
-  gMC->SetMaxStep(kBig); 
+  if (!fPrimaryIonisation) gMC->SetMaxStep(kBig); 
 
   // If not charged track or already stopped or disappeared, just return.
   if ((!gMC->TrackCharge()) || 
@@ -481,7 +475,8 @@ void AliTRDv1::StepManager()
 
     // Create the hits from TR photons if electron/positron is
     // entering the drift volume
-    if ((fTR) && 
+    if ((fTR)   &&
+        (fTRon) &&
         (TMath::Abs(gMC->TrackPid()) == kPdgElectron)) {
       CreateTRhit(det);
     }
@@ -517,6 +512,6 @@ void AliTRDv1::StepManager()
   if ((gMC->Etot() - gMC->TrackMass()) < kEkinMinStep) {
     return;
   }
-  gMC->SetMaxStep(fStepSize);
+  if (!fPrimaryIonisation) gMC->SetMaxStep(fStepSize);
 
 }