]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TRD/AliTRDsimpleMC.cxx
Adding mask handling, where masks are read from the CDB
[u/mrichter/AliRoot.git] / TRD / AliTRDsimpleMC.cxx
index 8ec90ad6f4de0e3f0d3963798d163043792ab821..d4a1133153c2e832ba5db56fea40457a480b3077 100644 (file)
  
 #include "AliRun.h"
 #include "AliTRDgeometry.h"
-#include "AliTRDparameter.h"
 #include "AliTRDsimpleMC.h"
 #include "AliTRDv1.h"
-#include "AliTRDparameter.h"
+#include "AliMC.h"
+
 ClassImp(AliTRDsimpleMC)
  
 //_____________________________________________________________________________
@@ -59,13 +58,12 @@ AliTRDsimpleMC::AliTRDsimpleMC()
   fTrackEntering = kFALSE;   
 
   fTRD           = NULL;
-  fPar           = NULL;
-                                        
-}                                                                               
+
+}
 
 //_____________________________________________________________________________
 AliTRDsimpleMC::AliTRDsimpleMC(const char *name, const char *title)
-               :TVirtualMC(name,title)
+               :TVirtualMC(name,title,kFALSE)
 {                       
   //
   // AliTRDsimpleMC default constructor
@@ -89,12 +87,11 @@ AliTRDsimpleMC::AliTRDsimpleMC(const char *name, const char *title)
   fTrackEntering = kFALSE;   
 
   fTRD           = NULL;
-  fPar           = NULL;
-                                        
-}                                                                               
+
+}
  
 //_____________________________________________________________________________
-AliTRDsimpleMC::AliTRDsimpleMC(const AliTRDsimpleMC &m)
+AliTRDsimpleMC::AliTRDsimpleMC(const AliTRDsimpleMC &m):TVirtualMC(m)
 {
   //
   // AliTRDsimpleMC copy constructor
@@ -126,7 +123,7 @@ AliTRDsimpleMC &AliTRDsimpleMC::operator=(const AliTRDsimpleMC &m)
 }
  
 //_____________________________________________________________________________
-void AliTRDsimpleMC::Copy(TObject &m)
+void AliTRDsimpleMC::Copy(TObject &m) const
 {
   //
   // Copy function
@@ -159,13 +156,9 @@ void AliTRDsimpleMC::NewTrack(Int_t iTrack, Int_t pdg
   // Starts a new track.
   // 
 
-  if (!fPar) {
-    fPar = new AliTRDparameter("TRDparameter","Standard TRD parameter");
-  }
-
   if (!fTRD) {
     fTRD = (AliTRDv1 *) gAlice->GetDetector("TRD");   
-    fX0  = fPar->GetTime0(0) - AliTRDgeometry::DrThick(); 
+    fX0  = AliTRDgeometry::GetTime0(0) - AliTRDgeometry::DrThick();
   }
 
   fTRD->ResetHits();
@@ -202,7 +195,7 @@ void AliTRDsimpleMC::NewTrack(Int_t iTrack, Int_t pdg
   fTrackY    = 0.0;
   fTrackZ    = 0.0;
 
-  gAlice->SetCurrentTrack(0);
+  gAlice->GetMCApp()->SetCurrentTrack(0);
 
 }
                                                                                 
@@ -347,7 +340,7 @@ const char *AliTRDsimpleMC::CurrentVolName() const
   // Check for the current volume
   //
 
-  Char_t *volName = "UA00";
+  const char *volName = "UA00";
 
   // Drift region
   if      ((fTrackX-fX0) <  AliTRDgeometry::DrThick()) {
@@ -363,7 +356,7 @@ const char *AliTRDsimpleMC::CurrentVolName() const
 }
 
 //_____________________________________________________________________________
-Int_t AliTRDsimpleMC::CurrentVolOffID(Int_t off, Int_t &copyNo) const
+Int_t AliTRDsimpleMC::CurrentVolOffID(Int_t , Int_t &copyNo) const
 {
   //
   // Check for the current volume