]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliTrackReference.cxx
pyquen added.
[u/mrichter/AliRoot.git] / STEER / AliTrackReference.cxx
index 34bc53d5b8c8bf6eda67a4ece71879fdabeabd6f..504960186d194c4dc9e734e013b96fc69a538aef 100644 (file)
 
 /* $Id$ */
 
-//----------------------------------------------------------------------
-//  Class containing the kinematic information of tracks at various
-//  points in the simulation to check the reconstruction
-//  Origin: M.Ivanov
-//----------------------------------------------------------------------
+#include "TLorentzVector.h"
+#include "TVirtualMC.h"
 
+#include "AliRun.h"
 #include "AliTrackReference.h"
 
+// 
+// Track Reference object is created every time particle is 
+// crossing detector bounds. The object is created by Step Manager
+//
+// The class stores the following informations:
+// track label, 
+// track position: X,Y,X
+// track momentum px, py, pz
+// track length and time of fligth: both in cm
+// status bits from Monte Carlo
+//
+
+
 ClassImp(AliTrackReference)
 
 //_______________________________________________________________________
@@ -38,5 +49,54 @@ ClassImp(AliTrackReference)
 {
   //
   // Default constructor
+  // Creates empty object
+
+  for(Int_t i=0; i<16; i++) ResetBit(BIT(i));
+}
+
+//_______________________________________________________________________
+AliTrackReference::AliTrackReference(Int_t label) {
+  //
+  // Create Reference object out of label and
+  // data in TVirtualMC object
+  //
+  // Creates an object and fill all parameters 
+  // from data in VirtualMC
   //
+  // Sylwester Radomski, (S.Radomski@gsi.de)
+  // GSI, Jan 31, 2003
+  //
+    
+  TLorentzVector vec;
+  
+  fTrack = label;
+  fLength = gMC->TrackLength();
+  fTime = gMC->TrackTime();
+
+  gMC->TrackPosition(vec);
+
+  fX = vec[0];
+  fY = vec[1];
+  fZ = vec[2];
+  
+  gMC->TrackMomentum(vec);
+  
+  fPx = vec[0];
+  fPy = vec[1];
+  fPz = vec[2];
+
+  // Set Up status code 
+  // Copy Bits from virtual MC
+
+  for(Int_t i=0; i<16; i++) ResetBit(BIT(i));
+
+  SetBit(BIT(0), gMC->IsNewTrack());
+  SetBit(BIT(1), gMC->IsTrackAlive());
+  SetBit(BIT(2), gMC->IsTrackDisappeared());
+  SetBit(BIT(3), gMC->IsTrackEntering());
+  SetBit(BIT(4), gMC->IsTrackExiting());
+  SetBit(BIT(5), gMC->IsTrackInside());
+  SetBit(BIT(6), gMC->IsTrackOut());
+  SetBit(BIT(7), gMC->IsTrackStop()); 
 }
+//_______________________________________________________________________