]>
Commit | Line | Data |
---|---|---|
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 | ||
acd84897 | 16 | /* $Id$ */ |
4c039060 | 17 | |
116cbefd | 18 | //----------------------------------------------------------------------- |
116cbefd | 19 | // Base Hit class for all detectors |
5d8718b8 | 20 | // Contains the coordinates of the hit (single energy deposition) |
21 | // and the number of correspondent track | |
22 | // Author: | |
116cbefd | 23 | //----------------------------------------------------------------------- |
24 | ||
1578254f | 25 | #include "TParticle.h" |
e2afb3b6 | 26 | |
27 | #include "AliHit.h" | |
fe4da5cc | 28 | #include "AliRun.h" |
effc3ed5 | 29 | |
fe4da5cc | 30 | ClassImp(AliHit) |
31 | ||
e2afb3b6 | 32 | //_______________________________________________________________________ |
33 | AliHit::AliHit(): | |
34 | fTrack(0), | |
35 | fX(0), | |
36 | fY(0), | |
37 | fZ(0) | |
fe4da5cc | 38 | { |
8918e700 | 39 | // |
40 | // Default constructor | |
41 | // | |
fe4da5cc | 42 | } |
43 | ||
e2afb3b6 | 44 | //_______________________________________________________________________ |
45 | AliHit::AliHit(Int_t shunt, Int_t track): | |
46 | fTrack(0), | |
47 | fX(0), | |
48 | fY(0), | |
49 | fZ(0) | |
fe4da5cc | 50 | { |
8918e700 | 51 | // |
52 | // Standard constructor | |
53 | // | |
effc3ed5 | 54 | if(shunt == 1) { |
fe4da5cc | 55 | int primary = gAlice->GetPrimary(track); |
2ab0c725 | 56 | gAlice->Particle(primary)->SetBit(kKeepBit); |
fe4da5cc | 57 | fTrack=primary; |
effc3ed5 | 58 | } |
59 | ||
60 | else if (shunt == 2) { | |
61 | // the "primary" particle associated to the hit is | |
62 | // the last track that has been flagged in the StepManager | |
63 | // used by PHOS to associate the hit with the decay gamma | |
64 | // rather than with the original pi0 | |
65 | TParticle *part; | |
66 | Int_t current; | |
67 | Int_t parent=track; | |
68 | while (1) { | |
69 | current=parent; | |
70 | part = gAlice->Particle(current); | |
71 | parent=part->GetFirstMother(); | |
72 | if(parent<0 || part->TestBit(kKeepBit)) | |
73 | break; | |
74 | } | |
75 | fTrack=current; | |
76 | } | |
77 | ||
78 | else { | |
fe4da5cc | 79 | fTrack=track; |
80 | gAlice->FlagTrack(fTrack); | |
81 | } | |
82 | } |