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