]> git.uio.no Git - u/mrichter/AliRoot.git/blame - STEER/AliHit.cxx
Introducing Header instead of Log
[u/mrichter/AliRoot.git] / STEER / AliHit.cxx
CommitLineData
4c039060 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
15
fb17acd4 16/* $Header$ */
4c039060 17
1578254f 18#include "TParticle.h"
e2afb3b6 19
20#include "AliHit.h"
fe4da5cc 21#include "AliRun.h"
effc3ed5 22
fe4da5cc 23ClassImp(AliHit)
24
e2afb3b6 25//_______________________________________________________________________
26AliHit::AliHit():
27 fTrack(0),
28 fX(0),
29 fY(0),
30 fZ(0)
fe4da5cc 31{
8918e700 32 //
33 // Default constructor
34 //
fe4da5cc 35}
36
e2afb3b6 37//_______________________________________________________________________
38AliHit::AliHit(Int_t shunt, Int_t track):
39 fTrack(0),
40 fX(0),
41 fY(0),
42 fZ(0)
fe4da5cc 43{
8918e700 44 //
45 // Standard constructor
46 //
effc3ed5 47 if(shunt == 1) {
fe4da5cc 48 int primary = gAlice->GetPrimary(track);
2ab0c725 49 gAlice->Particle(primary)->SetBit(kKeepBit);
fe4da5cc 50 fTrack=primary;
effc3ed5 51 }
52
53 else if (shunt == 2) {
54 // the "primary" particle associated to the hit is
55 // the last track that has been flagged in the StepManager
56 // used by PHOS to associate the hit with the decay gamma
57 // rather than with the original pi0
58 TParticle *part;
59 Int_t current;
60 Int_t parent=track;
61 while (1) {
62 current=parent;
63 part = gAlice->Particle(current);
64 parent=part->GetFirstMother();
65 if(parent<0 || part->TestBit(kKeepBit))
66 break;
67 }
68 fTrack=current;
69 }
70
71 else {
fe4da5cc 72 fTrack=track;
73 gAlice->FlagTrack(fTrack);
74 }
75}