ROOT logo
/**************************************************************************
 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
 *                                                                        *
 * Author: The ALICE Off-line Project.                                    *
 * Contributors are mentioned in the code where appropriate.              *
 *                                                                        *
 * Permission to use, copy, modify and distribute this software and its   *
 * documentation strictly for non-commercial purposes is hereby granted   *
 * without fee, provided that the above copyright notice appears in all   *
 * copies and that both the copyright notice and this permission notice   *
 * appear in the supporting documentation. The authors make no claims     *
 * about the suitability of this software for any purpose. It is          *
 * provided "as is" without express or implied warranty.                  *
 **************************************************************************/

/* $Id$ */

//-----------------------------------------------------------------------
//    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)

//_______________________________________________________________________
AliHit::AliHit():
  fTrack(0),
  fX(0),
  fY(0),
  fZ(0)
{
  //
  // Default constructor
  //
}

//_______________________________________________________________________
AliHit::AliHit(Int_t shunt, Int_t track):
  fTrack(0),
  fX(0),
  fY(0),
  fZ(0)
{
  //
  // Standard constructor
  //
  if(shunt == 1) {
    int primary = gAlice->GetMCApp()->GetPrimary(track);
    gAlice->GetMCApp()->Particle(primary)->SetBit(kKeepBit);
    fTrack=primary;
  } 

  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->GetMCApp()->Particle(current);
      parent=part->GetFirstMother();    
      if(parent<0 || part->TestBit(kKeepBit))
	break;
    }
    fTrack=current;   
  } else {
    fTrack=track;
    gAlice->GetMCApp()->FlagTrack(fTrack);
  }
}
 AliHit.cxx:1
 AliHit.cxx:2
 AliHit.cxx:3
 AliHit.cxx:4
 AliHit.cxx:5
 AliHit.cxx:6
 AliHit.cxx:7
 AliHit.cxx:8
 AliHit.cxx:9
 AliHit.cxx:10
 AliHit.cxx:11
 AliHit.cxx:12
 AliHit.cxx:13
 AliHit.cxx:14
 AliHit.cxx:15
 AliHit.cxx:16
 AliHit.cxx:17
 AliHit.cxx:18
 AliHit.cxx:19
 AliHit.cxx:20
 AliHit.cxx:21
 AliHit.cxx:22
 AliHit.cxx:23
 AliHit.cxx:24
 AliHit.cxx:25
 AliHit.cxx:26
 AliHit.cxx:27
 AliHit.cxx:28
 AliHit.cxx:29
 AliHit.cxx:30
 AliHit.cxx:31
 AliHit.cxx:32
 AliHit.cxx:33
 AliHit.cxx:34
 AliHit.cxx:35
 AliHit.cxx:36
 AliHit.cxx:37
 AliHit.cxx:38
 AliHit.cxx:39
 AliHit.cxx:40
 AliHit.cxx:41
 AliHit.cxx:42
 AliHit.cxx:43
 AliHit.cxx:44
 AliHit.cxx:45
 AliHit.cxx:46
 AliHit.cxx:47
 AliHit.cxx:48
 AliHit.cxx:49
 AliHit.cxx:50
 AliHit.cxx:51
 AliHit.cxx:52
 AliHit.cxx:53
 AliHit.cxx:54
 AliHit.cxx:55
 AliHit.cxx:56
 AliHit.cxx:57
 AliHit.cxx:58
 AliHit.cxx:59
 AliHit.cxx:60
 AliHit.cxx:61
 AliHit.cxx:62
 AliHit.cxx:63
 AliHit.cxx:64
 AliHit.cxx:65
 AliHit.cxx:66
 AliHit.cxx:67
 AliHit.cxx:68
 AliHit.cxx:69
 AliHit.cxx:70
 AliHit.cxx:71
 AliHit.cxx:72
 AliHit.cxx:73
 AliHit.cxx:74
 AliHit.cxx:75
 AliHit.cxx:76
 AliHit.cxx:77
 AliHit.cxx:78
 AliHit.cxx:79
 AliHit.cxx:80
 AliHit.cxx:81
 AliHit.cxx:82