Minor corrections on the display (adc counts readable, ...).
[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
16/*
17$Log$
effc3ed5 18Revision 1.6 2001/01/26 19:58:48 hristov
19Major upgrade of AliRoot code
20
2ab0c725 21Revision 1.5 2000/07/12 08:56:25 fca
22Coding convention correction and warning removal
23
8918e700 24Revision 1.4 2000/07/11 18:24:59 fca
25Coding convention corrections + few minor bug fixes
26
aee8290b 27Revision 1.3 1999/09/29 09:24:29 fca
28Introduction of the Copyright and cvs Log
29
4c039060 30*/
31
fe4da5cc 32#include "AliHit.h"
1578254f 33#include "TParticle.h"
fe4da5cc 34#include "AliRun.h"
effc3ed5 35
fe4da5cc 36ClassImp(AliHit)
37
38AliHit::AliHit()
39{
8918e700 40 //
41 // Default constructor
42 //
43 fTrack=0;
fe4da5cc 44}
45
46AliHit::AliHit(Int_t shunt, Int_t track)
47{
8918e700 48 //
49 // Standard constructor
50 //
effc3ed5 51 if(shunt == 1) {
fe4da5cc 52 int primary = gAlice->GetPrimary(track);
2ab0c725 53 gAlice->Particle(primary)->SetBit(kKeepBit);
fe4da5cc 54 fTrack=primary;
effc3ed5 55 }
56
57 else if (shunt == 2) {
58 // the "primary" particle associated to the hit is
59 // the last track that has been flagged in the StepManager
60 // used by PHOS to associate the hit with the decay gamma
61 // rather than with the original pi0
62 TParticle *part;
63 Int_t current;
64 Int_t parent=track;
65 while (1) {
66 current=parent;
67 part = gAlice->Particle(current);
68 parent=part->GetFirstMother();
69 if(parent<0 || part->TestBit(kKeepBit))
70 break;
71 }
72 fTrack=current;
73 }
74
75 else {
fe4da5cc 76 fTrack=track;
77 gAlice->FlagTrack(fTrack);
78 }
79}
80
81