]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
New fIshunt=2 option that allows to associate to a hit the particle that first entere...
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 10 Jan 2002 09:32:06 +0000 (09:32 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 10 Jan 2002 09:32:06 +0000 (09:32 +0000)
STEER/AliHit.cxx

index 3878070772c308edf10f9abae6d7d7454dfb440e..af79dd879023ba8b9197e384a875b83165bbbdb3 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+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
 
@@ -29,7 +32,7 @@ Introduction of the Copyright and cvs Log
 #include "AliHit.h"
 #include "TParticle.h"
 #include "AliRun.h"
+
 ClassImp(AliHit)
 
 AliHit::AliHit()
@@ -45,11 +48,31 @@ AliHit::AliHit(Int_t shunt, Int_t track)
   //
   // Standard constructor
   //
-  if(shunt) {
+  if(shunt == 1) {
     int primary = gAlice->GetPrimary(track);
     gAlice->Particle(primary)->SetBit(kKeepBit);
     fTrack=primary;
-  } else {
+  } 
+
+  else if (shunt == 2) {
+    // the "primary" particle associated to the hit is
+    // the last track that has been flagged in the StepManager
+    // used by PHOS to associate the hit with the decay gamma
+    // rather than with the original pi0 
+    TParticle *part;
+    Int_t current;
+    Int_t parent=track;
+    while (1) {
+      current=parent;
+      part = gAlice->Particle(current);
+      parent=part->GetFirstMother();    
+      if(parent<0 || part->TestBit(kKeepBit))
+       break;
+    }
+    fTrack=current;   
+  }
+
+  else {
     fTrack=track;
     gAlice->FlagTrack(fTrack);
   }