]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
With Boris and Antonin:
authormtadel <mtadel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 16 Apr 2008 17:24:04 +0000 (17:24 +0000)
committermtadel <mtadel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 16 Apr 2008 17:24:04 +0000 (17:24 +0000)
AliEveV0 - new implementation of V0 visualization class, preliminary
version.

esd_V0.C - macro to display the V0s.

SplitGLView.C - bypass crash during extraction of event summary table.

EVE/EveBase/AliEveV0.cxx [new file with mode: 0644]
EVE/EveBase/AliEveV0.h [new file with mode: 0644]
EVE/EveBase/LinkDef.h
EVE/alice-macros/SplitGLView.C
EVE/alice-macros/esd_V0.C

diff --git a/EVE/EveBase/AliEveV0.cxx b/EVE/EveBase/AliEveV0.cxx
new file mode 100644 (file)
index 0000000..c3ee8fe
--- /dev/null
@@ -0,0 +1,248 @@
+// $Id$
+// Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
+
+/**************************************************************************
+ * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
+ * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for          *
+ * full copyright notice.                                                 *
+ **************************************************************************/
+
+/***********************************************************************
+*  This code defines the reconstructed v0 visualized with EVE
+*
+* Ludovic Gaudichet (gaudichet@to.infn.it)
+************************************************************************/
+
+#include "AliEveV0.h"
+
+#include <TEveTrack.h>
+#include <TEveTrackPropagator.h>
+#include <TEveManager.h>
+
+#include <TPolyLine3D.h>
+#include <TPolyMarker3D.h>
+#include <TColor.h>
+
+#include <vector>
+
+
+/***********************************************************************
+*
+*  AliEveV0 class
+*
+************************************************************************/
+
+ClassImp(AliEveV0)
+
+AliEveV0::AliEveV0() :
+  TEvePointSet(),
+
+  fRecBirthV(),
+  fRecDecayV(),
+  fRecDecayP(),
+  fNegTrack(0),
+  fPosTrack(0),
+  fRnrStyle(0),
+  fPolyLineV0(),
+  fESDIndex(-1),
+  fDaughterDCA(999),
+  fChi2V0(-1)
+{}
+
+
+AliEveV0::AliEveV0(TEveRecTrack* tNeg, TEveRecTrack* tPos,
+                  TEveRecV0* v0, TEveTrackPropagator* rs) :
+  TEvePointSet(),
+
+  fRecBirthV(v0->fV0Birth),
+  fRecDecayV(v0->fVCa),
+  fRecDecayP(v0->fPNeg + v0->fPPos),
+
+  fNegTrack(new TEveTrack(tNeg, rs)),
+  fPosTrack(new TEveTrack(tPos, rs)),
+
+  fRnrStyle(rs),
+  fPolyLineV0(),
+  fESDIndex(-1),
+  fDaughterDCA(999),
+  fChi2V0(-1)
+{
+  fPolyLineV0.SetLineColor(fMarkerColor);
+  fPosTrack->SetLineColor(2);  // red
+  fNegTrack->SetLineColor(7);  // light blue
+
+  fMainColorPtr = &fMarkerColor;
+  fMarkerStyle = 20;
+  fMarkerColor = 5;
+  fMarkerSize  = 0.3;
+
+  AddElement(fNegTrack);
+  AddElement(fPosTrack);
+}
+
+AliEveV0::~AliEveV0()
+{}
+
+
+void AliEveV0::Reset(TPolyLine3D* polyLine)
+{
+  //polyLine->SetPolyLine(n_points);
+  polyLine->SetPolyLine(0);
+}
+
+//______________________________________________________________________________
+void AliEveV0::MakeV0path()
+{
+  fPolyLineV0.SetPoint(0, fRecBirthV.fX, fRecBirthV.fY, fRecBirthV.fZ);
+  fPolyLineV0.SetPoint(1, fRecDecayV.fX, fRecDecayV.fY, fRecDecayV.fZ);
+}
+
+
+//______________________________________________________________________________
+void AliEveV0::MakeV0()
+{
+  SetPoint(0, fRecDecayV.fX, fRecDecayV.fY, fRecDecayV.fZ);
+
+  fNegTrack->MakeTrack();
+  fPosTrack->MakeTrack();
+  MakeV0path();
+}
+
+
+/***********************************************************************
+*
+*  AliEveV0List class
+*
+************************************************************************/
+
+ClassImp(AliEveV0List)
+
+//______________________________________________________________________________
+AliEveV0List::AliEveV0List() :
+  TEveElementList(),
+  fTitle(),
+  fRnrStyle(0),
+  fRnrDaughters(kTRUE),
+  fRnrV0vtx(kTRUE),
+  fRnrV0path(kTRUE),
+  fNegColor(0),
+  fPosColor(0)
+{
+  fChildClass = AliEveV0::Class(); // override member from base TEveElementList
+}
+
+//______________________________________________________________________________
+AliEveV0List::AliEveV0List(TEveTrackPropagator* rs) :
+  TEveElementList(),
+  fTitle(),
+  fRnrStyle(rs),
+  fRnrDaughters(kTRUE),
+  fRnrV0vtx(kTRUE),
+  fRnrV0path(kTRUE),
+  fNegColor(0),
+  fPosColor(0)
+{
+  fChildClass = AliEveV0::Class(); // override member from base TEveElementList
+
+  Init();
+}
+
+//______________________________________________________________________________
+AliEveV0List::AliEveV0List(const Text_t* name, TEveTrackPropagator* rs) :
+  TEveElementList(),
+  fTitle(),
+  fRnrStyle(rs),
+  fRnrDaughters(kTRUE),
+  fRnrV0vtx(kTRUE),
+  fRnrV0path(kTRUE),
+  fNegColor(0),
+  fPosColor(0)
+{
+  fChildClass = AliEveV0::Class(); // override member from base TEveElementList
+
+  Init();
+  SetName(name);
+}
+
+//______________________________________________________________________________
+void AliEveV0List::Init()
+{
+  if (fRnrStyle== 0) fRnrStyle = new TEveTrackPropagator;
+
+}
+
+//______________________________________________________________________________
+AliEveV0List::~AliEveV0List()
+{
+
+}
+
+//______________________________________________________________________________
+void AliEveV0List::Paint(Option_t* option)
+{
+  if(fRnrSelf) {
+
+    if(fRnrV0vtx) {
+      for(List_i i=fChildren.begin(); i!=fChildren.end(); ++i) {
+       if((*i)->GetRnrSelf()) {
+         ((AliEveV0*)(*i))->Paint(option);
+       }
+      }
+    }
+
+    if(fRnrDaughters) {
+      for(List_i i=fChildren.begin(); i!=fChildren.end(); ++i) {
+       if((*i)->GetRnrSelf()) {
+         ((AliEveV0*)(*i))->PaintDaughters(option);
+       }
+      }
+    }
+
+    if(fRnrV0path) {
+      for(List_i i=fChildren.begin(); i!=fChildren.end(); ++i) {
+       if((*i)->GetRnrSelf()) {
+         ((AliEveV0*)(*i))->PaintPath(option);
+       }
+      }
+    }
+  }
+}
+
+
+//______________________________________________________________________________
+
+void AliEveV0List::SetRnrV0vtx(Bool_t rnr)
+{
+  fRnrV0vtx = rnr;
+  gEve->Redraw3D();
+}
+
+void AliEveV0List::SetRnrV0path(Bool_t rnr)
+{
+  fRnrV0path = rnr;
+  gEve->Redraw3D();
+}
+
+void AliEveV0List::SetRnrDaughters(Bool_t rnr)
+{
+  fRnrDaughters = rnr;
+  gEve->Redraw3D();
+}
+
+
+//______________________________________________________________________________
+
+void AliEveV0List::MakeV0s()
+{
+  for(List_i i=fChildren.begin(); i!=fChildren.end(); ++i) {
+    ((AliEveV0*)(*i))->MakeV0();
+  }
+  gEve->Redraw3D();
+}
+
+
+void AliEveV0List::MakeMarkers()
+{
+  gEve->Redraw3D();
+}
diff --git a/EVE/EveBase/AliEveV0.h b/EVE/EveBase/AliEveV0.h
new file mode 100644 (file)
index 0000000..a037d71
--- /dev/null
@@ -0,0 +1,177 @@
+// $Id$
+// Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
+
+/**************************************************************************
+ * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
+ * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for          *
+ * full copyright notice.                                                 *
+ **************************************************************************/
+#ifndef AliEveV0_H
+#define AliEveV0_H
+
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+
+/***********************************************************************
+* This code defines the reconstructed v0 visualized with EVE
+*
+* Ludovic Gaudichet (gaudichet@to.infn.it)
+************************************************************************/
+
+#include <TEveVSDStructs.h>
+#include <TEveElement.h>
+#include <TEveTrack.h>
+
+#include <TPolyMarker3D.h>
+#include <TPolyLine3D.h>
+
+class TH1F;
+class TH2F;
+
+
+class AliEveV0List;
+
+class AliEveV0 : public TEvePointSet
+{
+  friend class AliEveV0List;
+
+public:
+  AliEveV0();
+  AliEveV0(TEveRecTrack* tNeg, TEveRecTrack* tPos, TEveRecV0* v0,
+     TEveTrackPropagator* rs);
+  virtual ~AliEveV0();
+
+  //void  AddPathMarkPos(TEvePathMark* pm) { fPathMarksPos.push_back(pm); }
+  //void  AddPathMarkNeg(TEvePathMark* pm) { fPathMarksNeg.push_back(pm); }
+
+  void Reset(TPolyLine3D* polyLine);
+
+  void MakeV0path();
+  void MakeV0();
+
+  virtual void PaintDaughters(Option_t* option="")
+  {
+    if (fRnrSelf) { fNegTrack->Paint(option); fPosTrack->Paint(option);}
+  }
+
+  virtual void Paint(Option_t* option="")
+  {
+    if (fRnrSelf) TEvePointSet::Paint(option);
+  }
+
+  virtual void PaintPath(Option_t* option="")
+  {
+    if (fRnrSelf) fPolyLineV0.Paint(option);
+  }
+
+  virtual void  SetMainColor(Color_t col)
+  {
+    fMarkerColor = col; fMainColorPtr = &fMarkerColor;
+    fPolyLineV0.SetLineColor(fMarkerColor);
+  }
+
+  void SetRnrStyle(TEveTrackPropagator* rs) { fRnrStyle = rs; }
+
+  Float_t GetDaughterDCA() const { return fDaughterDCA; }
+  void SetDaughterDCA(Float_t dca) { fDaughterDCA = dca; }
+
+  Float_t GetRadius() const { return fRecDecayV.Perp(); }
+
+  Int_t GetESDIndex() const { return fESDIndex; }
+  void  SetESDIndex(Int_t ind) { fESDIndex = ind;}
+
+  virtual const Text_t* GetName() const    { return Form("ESDv0_%i",fESDIndex); }
+  virtual const Text_t* GetTitle() const   { return Form("ESDv0_%i",fESDIndex); }
+
+  //Int_t          GetLabelPos() const { return fLabel_pos; }
+  //Int_t          GetLabelNeg() const { return fLabel_neg; }
+  TEveTrackPropagator* GetPropagator() const  { return fRnrStyle; }
+
+  TEveTrack*   GetNegTrack() { return fNegTrack; }
+  TEveTrack*   GetPosTrack() { return fPosTrack; }
+
+  TPolyLine3D*  GetPolyLineV0() { return &fPolyLineV0; }
+
+protected:
+  TEveVector fRecBirthV;    // Reconstucted birth point of neutral particle
+  TEveVector fRecDecayV;    // Point of closest approach
+  TEveVector fRecDecayP;
+
+  TEveTrack        *fNegTrack;
+  TEveTrack        *fPosTrack;
+
+  TEveTrackPropagator *fRnrStyle;
+
+  TPolyLine3D       fPolyLineV0;
+
+  Int_t             fESDIndex;
+  Float_t           fDaughterDCA;
+  Float_t           fChi2V0;
+
+private:
+  AliEveV0(const AliEveV0&);            // Not implemented
+  AliEveV0& operator=(const AliEveV0&); // Not implemented
+
+  ClassDef(AliEveV0, 0); // Visual representation of a AliEveV0.
+};
+
+
+/******************************************************************************/
+// AliEveV0List
+/******************************************************************************/
+
+class AliEveV0List : public TEveElementList
+{
+public:
+  AliEveV0List();
+  AliEveV0List(TEveTrackPropagator* rs);
+  AliEveV0List(const Text_t* name, TEveTrackPropagator* rs=0);
+  virtual ~AliEveV0List();
+
+  virtual const Text_t* GetTitle() const { return fTitle; }
+  virtual void SetTitle(const Text_t* t) { fTitle = t; }
+  virtual void SetTracksColor(Color_t cNeg, Color_t cPos) {
+    fNegColor = cNeg; fPosColor = cPos;}
+
+  virtual Bool_t CanEditMainColor() const { return kTRUE; }
+
+  virtual void Paint(Option_t* option="");
+
+  void  SetRnrStyle(TEveTrackPropagator* rst) { fRnrStyle = rst; }
+  TEveTrackPropagator* GetPropagator()        { return fRnrStyle; }
+
+  Bool_t GetRnrV0vtx()     const { return fRnrV0vtx; }
+  Bool_t GetRnrV0path()    const { return fRnrV0path; }
+  Bool_t GetRnrDaughters() const { return fRnrDaughters; }
+
+  void   SetRnrV0vtx(Bool_t);
+  void   SetRnrV0path(Bool_t);
+  void   SetRnrDaughters(Bool_t);
+
+  void   MakeV0s();
+  void   MakeMarkers();
+
+protected:
+  TString              fTitle;
+
+  TEveTrackPropagator *fRnrStyle;
+
+  Bool_t               fRnrDaughters;
+  Bool_t               fRnrV0vtx;
+  Bool_t               fRnrV0path;
+
+  Color_t              fNegColor;
+  Color_t              fPosColor;
+
+private:
+  void  Init();
+
+  AliEveV0List(const AliEveV0List&);            // Not implemented
+  AliEveV0List& operator=(const AliEveV0List&); // Not implemented
+
+  ClassDef(AliEveV0List, 0); // A list of AliEveV0 objecs.
+};
+
+
+#endif
index 9f7b1452c4a6d6d2e942dfb284f5235dd8c181ac..c93552b9888d2043923d57390536b4eb180f02b8 100644 (file)
@@ -43,7 +43,6 @@
 // #pragma link C++ class CascadeListEditor+;
 //
 // AliEveV0
-// #pragma link C++ class AliEveV0+;
-// #pragma link C++ class V0List+;
-// #pragma link C++ class V0ListEditor+;
-
+#pragma link C++ class AliEveV0+;
+#pragma link C++ class AliEveV0List+;
+//#pragma link C++ class AliEveV0ListEditor+;
index a4484b5d806043fb649898c7ef61145b3d4ae55b..b7e122e948d953a8c9452abf6c325fea48d8f71d 100644 (file)
@@ -1342,23 +1342,24 @@ void SplitGLView::UpdateSummary()
    TEveEventManager *mgr = gEve ? gEve->GetCurrentEvent() : 0;
    if (mgr) {
       fgHtmlSummary->Clear("D");
-      for (i=mgr->BeginChildren(); i!=mgr->EndChildren(); ++i) {
+      for (i=mgr->BeginChildren(); i!=mgr->EndChildren(); ++i)
+      {
          el = ((TEveElement*)(*i));
          if (el->IsA() == TEvePointSet::Class()) {
             TEvePointSet *ps = (TEvePointSet *)el;
             TString ename  = ps->GetElementName();
             TString etitle = ps->GetElementTitle();
-            ename.Remove(ename.First('\''));
-            etitle.Remove(0, 2);
+            //ename.Remove(ename.First('\''));
+            //etitle.Remove(0, 2);
             Int_t nel = atoi(etitle.Data());
             table = fgHtmlSummary->AddTable(ename, 0, nel);
          }
          else if (el->IsA() == TEveTrackList::Class()) {
             TEveTrackList *tracks = (TEveTrackList *)el;
             TString ename  = tracks->GetElementName();
-            ename.Remove(ename.First('\''));
+            // ename.Remove(ename.First('\''));
             table = fgHtmlSummary->AddTable(ename.Data(), 5, 
-                     tracks->GetNChildren(), kTRUE, "first");
+                                            tracks->GetNChildren(), kTRUE, "first");
             table->SetLabel(0, "Momentum");
             table->SetLabel(1, "P_t");
             table->SetLabel(2, "Phi");
index 8b9b01978103d5ff978fd3853cc2107b29952273..401a994ce4dd93aef1422d4826f16c67dd2b5ee0 100644 (file)
@@ -7,6 +7,17 @@
  * full copyright notice.                                                 *
  **************************************************************************/
 
+void esd_v0_init_rectrack(TEveRecTrack& rt, AliExternalTrackParam* tp)
+{
+  Double_t      pbuf[3], vbuf[3];
+
+  rt.fSign = tp->GetSign();
+  tp->GetXYZ(vbuf);     rt.fV.Set(vbuf);
+  tp->GetPxPyPz(pbuf);  rt.fP.Set(pbuf);
+  // Double_t ep = at->GetP(), mc = at->GetMass();
+  rt.fBeta = 1; // ep/TMath::Sqrt(ep*ep + mc*mc);
+}
+
 AliEveV0* esd_make_v0(TEveTrackPropagator* rnrStyle, AliESDVertex* primVtx,
                      AliESDtrack* neg, AliESDtrack* pos, AliESDv0* v0, Int_t i)
 {
@@ -18,30 +29,26 @@ AliEveV0* esd_make_v0(TEveTrackPropagator* rnrStyle, AliESDVertex* primVtx,
 
     Double_t p[3];
     v0->GetNPxPyPz(p[0], p[1], p[2]);
-    rcV0.P_pos.Set(p);
+    rcV0.fPPos.Set(p);
     v0->GetPPxPyPz(p[0], p[1], p[2]);
-    rcV0.P_neg.Set(p);
+    rcV0.fPNeg.Set(p);
 
     v0->GetPxPyPz(p[0], p[1], p[2]);
     Double_t v[3];
     v0->GetXYZ(v[0], v[1], v[2]);
 
-
     //   printf(" %f %f %f / %f %f %f    %i\n",p[0], p[1], p[2],
     //          v[0], v[1], v[2], v0->GetOnFlyStatus());
 
-    rcV0.V_neg.Set(v); //original track vertices at dca not stored
-    rcV0.V_pos.Set(v);
-    rcV0.V_ca.Set(v);
+    rcV0.fVNeg.Set(v); //original track vertices at dca not stored
+    rcV0.fVPos.Set(v);
+    rcV0.fVCa.Set(v);
 
-    rcV0.d_label[0] = v0->GetNindex();
-    rcV0.d_label[1] = v0->GetPindex();
-
-    Double_t ep = neg->GetP(), mc = neg->GetMass();
-    rcNeg.beta = ep/TMath::Sqrt(ep*ep + mc*mc);
-    ep = pos->GetP(); mc = pos->GetMass();
-    rcPos.beta = ep/TMath::Sqrt(ep*ep + mc*mc);
+    rcV0.fDLabel[0] = v0->GetNindex();
+    rcV0.fDLabel[1] = v0->GetPindex();
 
+    esd_v0_init_rectrack(rcNeg, v0->GetParamN());
+    esd_v0_init_rectrack(rcPos, v0->GetParamP());
 
     AliEveV0* myV0 = new AliEveV0(&rcNeg, &rcPos, &rcV0, rnrStyle);
     char ch[50];
@@ -51,32 +58,19 @@ AliEveV0* esd_make_v0(TEveTrackPropagator* rnrStyle, AliESDVertex* primVtx,
     myV0->SetESDIndex(i);
     myV0->SetDaughterDCA(v0->GetDcaV0Daughters());
 
-    Double_t primx = primVtx->GetXv(),
-      primy = primVtx->GetYv(),
-      primz = primVtx->GetZv();
-    myV0->SetCosPointingAngle(v0->GetV0CosineOfPointingAngle(primx,primy,primz));
-
-    myV0->SetDecayLength(primVtx->GetXv(), primVtx->GetYv(), primVtx->GetZv());
-
     return myV0;
   } else {
     return 0;
   }
-
 }
 
 
-V0List* esd_AliEveV0(Double_t min_pt=0.1, Double_t max_pt=100)
+AliEveV0List* esd_V0(Double_t min_pt=0.1, Double_t max_pt=100)
 {
-  printf("THIS SCRIPT DOES NOT WORK.\n"
-        "AliEveV0 classes have been temporarily removed.\n"
-        "They need to be cleaned up.\n");
-  return;
-
   AliESDEvent* esd = AliEveEventManager::AssertESD();
   AliESDVertex* primVertex =(AliESDVertex*) esd->GetVertex();
 
-  V0List* cont = new V0List("ESD v0");
+  AliEveV0List* cont = new AliEveV0List("ESD v0");
   cont->SetMainColor(Color_t(3)); // green
   TEveTrackPropagator* rnrStyle = cont->GetPropagator();
   rnrStyle->SetMagField( 0.1*esd->GetMagneticField() );
@@ -102,7 +96,7 @@ V0List* esd_AliEveV0(Double_t min_pt=0.1, Double_t max_pt=100)
     }
   }
 
-  cont->SetTitle("testV0List ");
+  cont->SetTitle("test");
   cont->UpdateItems();
 
   cont->MakeV0s();