Mainly cosmetics.
[u/mrichter/AliRoot.git] / STEER / AliTrackReference.cxx
CommitLineData
aab9c8d5 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
0742d588 16/* $Id$ */
116cbefd 17
2cad796f 18#include "TVirtualMC.h"
0742d588 19
2d74ba4f 20#include "AliRun.h"
0742d588 21#include "AliTrackReference.h"
2d74ba4f 22
23//
24// Track Reference object is created every time particle is
25// crossing detector bounds. The object is created by Step Manager
26//
27// The class stores the following informations:
28// track label,
29// track position: X,Y,X
30// track momentum px, py, pz
31// track length and time of fligth: both in cm
32// status bits from Monte Carlo
33//
34
aab9c8d5 35
36ClassImp(AliTrackReference)
37
e2afb3b6 38//_______________________________________________________________________
39 AliTrackReference::AliTrackReference():
448312df 40 TObject(),
e2afb3b6 41 fTrack(0),
42 fX(0),
43 fY(0),
44 fZ(0),
45 fPx(0),
46 fPy(0),
47 fPz(0),
448312df 48 fLength(0),
49 fTime(0)
aab9c8d5 50{
51 //
52 // Default constructor
2d74ba4f 53 // Creates empty object
54
55 for(Int_t i=0; i<16; i++) ResetBit(BIT(i));
56}
57
58//_______________________________________________________________________
448312df 59AliTrackReference::AliTrackReference(Int_t label) :
90e48c0c 60 TObject(),
61 fTrack(label),
62 fX(0),
63 fY(0),
64 fZ(0),
65 fPx(0),
66 fPy(0),
67 fPz(0),
68 fLength(gMC->TrackLength()),
69 fTime(gMC->TrackTime())
448312df 70{
2d74ba4f 71 //
72 // Create Reference object out of label and
73 // data in TVirtualMC object
74 //
75 // Creates an object and fill all parameters
76 // from data in VirtualMC
aab9c8d5 77 //
2d74ba4f 78 // Sylwester Radomski, (S.Radomski@gsi.de)
79 // GSI, Jan 31, 2003
80 //
2cad796f 81
90e48c0c 82 Double_t vec[4];
2d74ba4f 83
90e48c0c 84 gMC->TrackPosition(vec[0],vec[1],vec[2]);
2d74ba4f 85
86 fX = vec[0];
87 fY = vec[1];
88 fZ = vec[2];
89
90e48c0c 90 gMC->TrackMomentum(vec[0],vec[1],vec[2],vec[3]);
2d74ba4f 91
92 fPx = vec[0];
93 fPy = vec[1];
b745fc4c 94 fPz = vec[2];
2d74ba4f 95
96 // Set Up status code
97 // Copy Bits from virtual MC
98
99 for(Int_t i=0; i<16; i++) ResetBit(BIT(i));
100
2cad796f 101 SetBit(BIT(0), gMC->IsNewTrack());
102 SetBit(BIT(1), gMC->IsTrackAlive());
103 SetBit(BIT(2), gMC->IsTrackDisappeared());
104 SetBit(BIT(3), gMC->IsTrackEntering());
105 SetBit(BIT(4), gMC->IsTrackExiting());
106 SetBit(BIT(5), gMC->IsTrackInside());
107 SetBit(BIT(6), gMC->IsTrackOut());
108 SetBit(BIT(7), gMC->IsTrackStop());
aab9c8d5 109}
2d74ba4f 110//_______________________________________________________________________