Add option to also import tracks created by special function in AliESDtrack. Controll...
authormtadel <mtadel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 5 Feb 2008 19:46:48 +0000 (19:46 +0000)
committermtadel <mtadel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 5 Feb 2008 19:46:48 +0000 (19:46 +0000)
EVE/alice-macros/esd_tracks.C

index 3cbe7a8..a6f9930 100644 (file)
@@ -44,7 +44,25 @@ TEveTrack* esd_make_track(TEveTrackPropagator*   rnrStyle,
   return track;
 }
 
-Bool_t gkFixFailedITSExtr = kFALSE;
+void esd_track_add_param(TEveTrack* track, AliExternalTrackParam* tp)
+{
+  if (tp == 0)
+    return;
+
+  Double_t      pbuf[3], vbuf[3];
+  tp->GetXYZ(vbuf);
+  tp->GetPxPyPz(pbuf);
+
+  TEvePathMark* pm = new TEvePathMark(TEvePathMark::kReference);
+  pm->fV.Set(vbuf);
+  pm->fP.Set(pbuf);
+  track->AddPathMark(pm);
+}
+
+/******************************************************************************/
+
+Bool_t gkFixFailedITSExtr    = kFALSE;
+Bool_t gkMakeTrackParamLines = kTRUE;
 
 TEveTrackList* esd_tracks(Double_t min_pt=0.1, Double_t max_pt=100)
 {
@@ -61,6 +79,13 @@ TEveTrackList* esd_tracks(Double_t min_pt=0.1, Double_t max_pt=100)
 
   gEve->AddElement(cont);
 
+  TEveElementList* contLines = 0;
+  if (gkMakeTrackParamLines)
+  {
+    contLines = new TEveElementList("MyTracks");  
+    gEve->AddElement(contLines);
+  }
+
   Int_t    count = 0;
   Double_t pbuf[3];
   for (Int_t n=0; n<esd->GetNumberOfTracks(); n++)
@@ -77,14 +102,31 @@ TEveTrackList* esd_tracks(Double_t min_pt=0.1, Double_t max_pt=100)
 
     // If gkFixFailedITSExtr is TRUE (FALSE by default) and
     // if ITS refit failed, take track parameters at inner TPC radius.
+    Bool_t innerTaken = kFALSE;
     AliExternalTrackParam* tp = at;
     if (gkFixFailedITSExtr && !at->IsOn(AliESDtrack::kITSrefit)) {
-       tp = at->GetInnerParam();
+      tp = at->GetInnerParam();
+      innerTaken = kTRUE;
     }
 
     TEveTrack* track = esd_make_track(rnrStyle, n, at, tp);
     track->SetAttLineAttMarker(cont);
+
+    // Needs eve development brach from ROOT. 
+    // if (!innerTaken) {
+    //   esd_track_add_param(track, at->GetInnerParam());
+    // }
+    // esd_track_add_param(track, at->GetOuterParam());
+
     gEve->AddElement(track, cont);
+
+    if (gkMakeTrackParamLines) {
+      TEveLine* l = new TEveLine; 
+      l->SetName(Form("Track%d", count));
+      l->SetLineColor((Color_t)5);
+      at->FillPolymarker(l, esd->GetMagneticField(), 0, 250, 5);
+      contLines->AddElement(l);
+    }
   }
 
   //PH The line below is replaced waiting for a fix in Root