]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Add the track references
authorcblume <cblume@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 13 Jun 2002 08:11:56 +0000 (08:11 +0000)
committercblume <cblume@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 13 Jun 2002 08:11:56 +0000 (08:11 +0000)
TRD/AliTRD.cxx
TRD/AliTRD.h
TRD/AliTRDv1.cxx

index 94971d745fc536f5b12ae167f9b8e67a38dabf0e..9194953671d8630b9490c14afa79bd02520ea650 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+Revision 1.39  2002/06/12 09:54:35  cblume
+Update of tracking code provided by Sergei
+
 Revision 1.38  2002/03/28 14:59:07  cblume
 Coding conventions
 
@@ -156,12 +159,14 @@ Introduction of the Copyright and cvs Log
 #include <TFile.h>
 #include <TROOT.h>
 #include <TParticle.h>
+#include <TLorentzVector.h>
 
 #include "AliRun.h"
 #include "AliConst.h"
 #include "AliDigit.h"
 #include "AliMagF.h"
 #include "AliMC.h"                                                              
+#include "AliTrackReference.h"
  
 #include "AliTRD.h"
 #include "AliTRDhit.h"
@@ -343,6 +348,27 @@ void AliTRD::AddCluster(Float_t *pos, Int_t det, Float_t amp
 
 }
 
+//_____________________________________________________________________________
+void  AliTRD::AddTrackReference(Int_t label, TLorentzVector p, TLorentzVector x)
+{
+  //
+  // Add a trackrefernce to the list
+  //
+
+  if (!fTrackReferences) {
+    Error("AddTrackReference","Container fTrackRefernce not active\n");
+    return;
+  }
+
+  Int_t nref = fTrackReferences->GetEntriesFast();
+  TClonesArray &lref = *fTrackReferences;
+  AliTrackReference * ref =  new(lref[nref]) AliTrackReference();
+  ref->SetMomentum(p[0],p[1],p[2]);
+  ref->SetPosition(x[0],x[1],x[2]);
+  ref->SetTrack(label);
+
+}
+
 //_____________________________________________________________________________
 void AliTRD::Hits2Digits()
 {
index e6ee05be33942912dee0929aec990e8ecc6c4042..a5c92bea7467411c9c31e5f6cdefaa396e4788cc 100644 (file)
@@ -12,6 +12,7 @@
 #include "AliDetector.h"
 
 class TFile;
+class TLorentzVector;
 
 class AliRun;
 class AliDigit;
@@ -36,6 +37,7 @@ class AliTRD : public AliDetector {
   virtual void       AddHit(Int_t track, Int_t det, Float_t *hits, Int_t q, Bool_t inDrift); 
   virtual void       AddCluster(Float_t *pos, Int_t det, Float_t amp, Int_t *tracks
                               , Float_t *sig, Int_t iType);
+  virtual void       AddTrackReference(Int_t label, TLorentzVector p, TLorentzVector x);
   virtual void       BuildGeometry();
   virtual void       Copy(TObject &trd);
   virtual void       CreateGeometry();
index 25b95fc066b2107c5d9dff0e38fbf493da3a8685..7c88a156ca09e30dd1862450fcf4b001c94c8a64 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+Revision 1.33  2002/02/20 14:01:40  hristov
+Compare a TString with a string, otherwise the conversion cannot be done on Sun
+
 Revision 1.32  2002/02/13 16:58:37  cblume
 Bug fix reported by Jiri. Make atoi input zero terminated in StepManager()
 
@@ -512,7 +515,6 @@ void AliTRDv1::StepManager()
   Int_t    qTot;
 
   Float_t  hits[3];
-  Float_t  moms[3];
   Float_t  random[1];
   Float_t  charge;
   Float_t  aMass;
@@ -626,15 +628,12 @@ void AliTRDv1::StepManager()
        // Special hits and TR photons only in the drift region
         if (drRegion) {
 
-          // Create some special hits with amplitude 0 at the entrance and
-          // exit of each chamber that contain the momentum components of the particle
+          // Create a track reference at the entrance and
+          // exit of each chamber that contain the 
+         // momentum components of the particle
           if (gMC->IsTrackEntering() || gMC->IsTrackExiting()) {
             gMC->TrackMomentum(mom);
-            moms[0] = mom[0];
-            moms[1] = mom[1];
-            moms[2] = mom[2];
-            AddHit(gAlice->CurrentTrack(),det,moms,0,kTRUE);
-            AddHit(gAlice->CurrentTrack(),det,hits,0,kTRUE); 
+            AddTrackReference(gAlice->CurrentTrack(),mom,pos);
           }
 
           // Create the hits from TR photons