]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliHit.cxx
protect against invoking MC Handler for AOD
[u/mrichter/AliRoot.git] / STEER / AliHit.cxx
index dcb29ca29006a85f88eb48ef4458983425f4eb30..1b180deb97e004b0075f4a53e1137d1a48a3068b 100644 (file)
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
-/*
-$Log$
-Revision 1.7  2002/01/10 09:32:06  hristov
-New fIshunt=2 option that allows to associate to a hit the particle that first entered in the cell where the hit occurred (Y.Schutz)
+/* $Id$ */
 
-Revision 1.6  2001/01/26 19:58:48  hristov
-Major upgrade of AliRoot code
-
-Revision 1.5  2000/07/12 08:56:25  fca
-Coding convention correction and warning removal
-
-Revision 1.4  2000/07/11 18:24:59  fca
-Coding convention corrections + few minor bug fixes
-
-Revision 1.3  1999/09/29 09:24:29  fca
-Introduction of the Copyright and cvs Log
-
-*/
+//-----------------------------------------------------------------------
+//    Base Hit class for all detectors
+//    Contains the coordinates of the hit (single energy deposition)
+//    and the number of correspondent track
+//    Author:
+//-----------------------------------------------------------------------
 
 #include "TParticle.h"
 
 #include "AliHit.h"
 #include "AliRun.h"
+#include "AliMC.h"
+#include "AliStack.h"
 
 ClassImp(AliHit)
 
@@ -62,8 +54,8 @@ AliHit::AliHit(Int_t shunt, Int_t track):
   // Standard constructor
   //
   if(shunt == 1) {
-    int primary = gAlice->GetPrimary(track);
-    gAlice->Particle(primary)->SetBit(kKeepBit);
+    int primary = gAlice->GetMCApp()->GetPrimary(track);
+    gAlice->GetMCApp()->Particle(primary)->SetBit(kKeepBit);
     fTrack=primary;
   } 
 
@@ -77,16 +69,14 @@ AliHit::AliHit(Int_t shunt, Int_t track):
     Int_t parent=track;
     while (1) {
       current=parent;
-      part = gAlice->Particle(current);
+      part = gAlice->GetMCApp()->Particle(current);
       parent=part->GetFirstMother();    
       if(parent<0 || part->TestBit(kKeepBit))
        break;
     }
     fTrack=current;   
-  }
-
-  else {
+  } else {
     fTrack=track;
-    gAlice->FlagTrack(fTrack);
+    gAlice->GetMCApp()->FlagTrack(fTrack);
   }
 }