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