TEveTrack.h

Go to the documentation of this file.
00001 // @(#)root/eve:$Id: TEveTrack.h 33864 2010-06-14 09:47:19Z matevz $
00002 // Authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers.               *
00006  * All rights reserved.                                                  *
00007  *                                                                       *
00008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00010  *************************************************************************/
00011 
00012 #ifndef ROOT_TEveTrack
00013 #define ROOT_TEveTrack
00014 
00015 #include <vector>
00016 
00017 #include "TEveVector.h"
00018 #include "TEvePathMark.h"
00019 #include "TEveElement.h"
00020 #include "TEveLine.h"
00021 
00022 #include "TPolyMarker3D.h"
00023 #include "TMarker.h"
00024 
00025 class TEveTrackPropagator;
00026 class TEveTrackList;
00027 
00028 class TEveRecTrack;
00029 class TEveMCTrack;
00030 class TParticle;
00031 
00032 class TEveTrack : public TEveLine
00033 {
00034    friend class TEveTrackPropagator;
00035    friend class TEveTrackList;
00036    friend class TEveTrackGL;
00037 
00038 private:
00039    TEveTrack& operator=(const TEveTrack&); // Not implemented
00040 
00041 public:
00042    typedef std::vector<TEvePathMark>    vPathMark_t;
00043    typedef vPathMark_t::iterator        vPathMark_i;
00044    typedef vPathMark_t::const_iterator  vPathMark_ci;
00045 
00046    // Deprecated -- to be removed.
00047    enum EBreakProjectedTracks_e { kBPTDefault, kBPTAlways, kBPTNever };
00048 
00049 protected:
00050    TEveVector         fV;          // Starting vertex
00051    TEveVector         fP;          // Starting momentum
00052    TEveVector         fPEnd;       // Momentum at the last point of extrapolation
00053    Double_t           fBeta;       // Relativistic beta factor
00054    Int_t              fPdg;        // PDG code
00055    Int_t              fCharge;     // Charge in units of e0
00056    Int_t              fLabel;      // Simulation label
00057    Int_t              fIndex;      // Reconstruction index
00058    Int_t              fStatus;     // Status-word, user-defined.
00059    Bool_t             fLockPoints; // Lock points that are currently in - do nothing in MakeTrack().
00060    vPathMark_t        fPathMarks;  // TEveVector of known points along the track
00061    Int_t              fLastPMIdx;  //!Last path-mark index tried in track-propagation.
00062 
00063    TEveTrackPropagator *fPropagator;   // Pointer to shared render-style
00064 
00065 public:
00066    TEveTrack();
00067    TEveTrack(TParticle* t, Int_t label, TEveTrackPropagator* prop=0);
00068    TEveTrack(TEveMCTrack*  t, TEveTrackPropagator* prop=0);
00069    TEveTrack(TEveRecTrack* t, TEveTrackPropagator* prop=0);
00070    TEveTrack(const TEveTrack& t);
00071    virtual ~TEveTrack();
00072 
00073    virtual void ComputeBBox();
00074 
00075    virtual void SetStdTitle();
00076 
00077    virtual void SetTrackParams(const TEveTrack& t);
00078    virtual void SetPathMarks  (const TEveTrack& t);
00079 
00080    virtual void MakeTrack(Bool_t recurse=kTRUE);
00081 
00082    TEveTrackPropagator* GetPropagator() const  { return fPropagator; }
00083    Int_t GetLastPMIdx() const { return fLastPMIdx; }
00084    void  SetPropagator(TEveTrackPropagator* prop);
00085    void  SetAttLineAttMarker(TEveTrackList* tl);
00086 
00087    const TEveVector& GetVertex()      const { return fV;    }
00088    const TEveVector& GetMomentum()    const { return fP;    }
00089    const TEveVector& GetEndMomentum() const { return fPEnd; }
00090 
00091    Int_t GetPdg()    const    { return fPdg;    }
00092    void  SetPdg(Int_t pdg)    { fPdg = pdg;     }
00093    Int_t GetCharge() const    { return fCharge; }
00094    void  SetCharge(Int_t chg) { fCharge = chg;  }
00095    Int_t GetLabel()  const    { return fLabel;  }
00096    void  SetLabel(Int_t lbl)  { fLabel = lbl;   }
00097    Int_t GetIndex()  const    { return fIndex;  }
00098    void  SetIndex(Int_t idx)  { fIndex = idx;   }
00099    Int_t GetStatus()  const   { return fStatus; }
00100    void  SetStatus(Int_t idx) { fStatus = idx;  }
00101 
00102    void  AddPathMark(const TEvePathMark& pm) { fPathMarks.push_back(pm); }
00103    void  SortPathMarksByTime();
00104          vPathMark_t& RefPathMarks()       { return fPathMarks; }
00105    const vPathMark_t& RefPathMarks() const { return fPathMarks; }
00106 
00107    void  PrintPathMarks(); // *MENU*
00108 
00109    void   SetLockPoints(Bool_t l) { fLockPoints = l;    }
00110    Bool_t GetLockPoints()   const { return fLockPoints; }
00111 
00112    //-------------------------------------------------------------------
00113 
00114    virtual void SecSelected(TEveTrack*); // *SIGNAL*
00115 
00116    virtual const TGPicture* GetListTreeIcon(Bool_t open=kFALSE);
00117 
00118    virtual void CopyVizParams(const TEveElement* el);
00119    virtual void WriteVizParams(ostream& out, const TString& var);
00120 
00121    virtual TClass* ProjectedClass(const TEveProjection* p) const;
00122 
00123    // These functions are deprecated -- use TEveTrackPropagator functions.
00124    // Will be removed after 5.28.
00125    Bool_t        ShouldBreakTrack() const;
00126    UChar_t       GetBreakProjectedTracks() const;
00127    void          SetBreakProjectedTracks(UChar_t bt);
00128    static Bool_t GetDefaultBreakProjectedTracks();
00129    static void   SetDefaultBreakProjectedTracks(Bool_t bt);
00130 
00131    ClassDef(TEveTrack, 1); // Track with given vertex, momentum and optional referece-points (path-marks) along its path.
00132 };
00133 
00134 /******************************************************************************/
00135 // TEveTrackList
00136 /******************************************************************************/
00137 
00138 class TEveTrackList : public TEveElementList,
00139                       public TAttMarker,
00140                       public TAttLine
00141 {
00142    friend class TEveTrackListEditor;
00143 
00144 private:
00145    TEveTrackList(const TEveTrackList&);            // Not implemented
00146    TEveTrackList& operator=(const TEveTrackList&); // Not implemented
00147 
00148 protected:
00149    TEveTrackPropagator* fPropagator;   // Basic track rendering parameters, not enforced to elements.
00150 
00151    Bool_t               fRecurse;    // Recurse when propagating marker/line/etc attributes to tracks.
00152 
00153    Bool_t               fRnrLine;    // Render track as line.
00154    Bool_t               fRnrPoints;  // Render track as points.
00155 
00156    Float_t              fMinPt;      // Minimum track pT for display selection.
00157    Float_t              fMaxPt;      // Maximum track pT for display selection.
00158    Float_t              fLimPt;      // Highest track pT in the container.
00159    Float_t              fMinP;       // Minimum track p for display selection.
00160    Float_t              fMaxP;       // Maximum track p for display selection.
00161    Float_t              fLimP;       // Highest track p in the container.
00162 
00163    void    FindMomentumLimits(TEveElement* el, Bool_t recurse=kTRUE);
00164    Float_t RoundMomentumLimit(Float_t x);
00165    void    SanitizeMinMaxCuts();
00166 
00167 public:
00168    TEveTrackList(TEveTrackPropagator* prop=0);
00169    TEveTrackList(const char* name, TEveTrackPropagator* prop=0);
00170    virtual ~TEveTrackList();
00171 
00172    void  MakeTracks(Bool_t recurse=kTRUE);
00173    void  FindMomentumLimits(Bool_t recurse=kTRUE);
00174 
00175    void  SetPropagator(TEveTrackPropagator* prop);
00176    TEveTrackPropagator* GetPropagator() { return fPropagator; }
00177 
00178    Bool_t GetRecurse() const   { return fRecurse; }
00179    void   SetRecurse(Bool_t x) { fRecurse = x; }
00180 
00181    //--------------------------------
00182 
00183    virtual void   SetMainColor(Color_t c);
00184    virtual void   SetLineColor(Color_t c) { SetMainColor(c); }
00185    virtual void   SetLineColor(Color_t c, TEveElement* el);
00186    virtual void   SetLineWidth(Width_t w);
00187    virtual void   SetLineWidth(Width_t w, TEveElement* el);
00188    virtual void   SetLineStyle(Style_t s);
00189    virtual void   SetLineStyle(Style_t s, TEveElement* el);
00190 
00191    virtual void   SetMarkerColor(Color_t c);
00192    virtual void   SetMarkerColor(Color_t c, TEveElement* el);
00193    virtual void   SetMarkerSize(Size_t s);
00194    virtual void   SetMarkerSize(Size_t s, TEveElement* el);
00195    virtual void   SetMarkerStyle(Style_t s);
00196    virtual void   SetMarkerStyle(Style_t s, TEveElement* el);
00197 
00198    void   SetRnrLine(Bool_t rnr);
00199    void   SetRnrLine(Bool_t rnr, TEveElement* el);
00200    Bool_t GetRnrLine() const { return fRnrLine; }
00201 
00202    void   SetRnrPoints(Bool_t r);
00203    void   SetRnrPoints(Bool_t r, TEveElement* el);
00204    Bool_t GetRnrPoints() const { return fRnrPoints; }
00205 
00206    void SelectByPt(Float_t min_pt, Float_t max_pt);
00207    void SelectByPt(Float_t min_pt, Float_t max_pt, TEveElement* el);
00208    void SelectByP (Float_t min_p,  Float_t max_p);
00209    void SelectByP (Float_t min_p,  Float_t max_p,  TEveElement* el);
00210 
00211    Float_t GetMinPt() const { return fMinPt; }
00212    Float_t GetMaxPt() const { return fMaxPt; }
00213    Float_t GetLimPt() const { return fLimPt; }
00214    Float_t GetMinP()  const { return fMinP;  }
00215    Float_t GetMaxP()  const { return fMaxP;  }
00216    Float_t GetLimP()  const { return fLimP;  }
00217 
00218    //-------------------------------------------------------------------
00219 
00220    TEveTrack* FindTrackByLabel(Int_t label); // *MENU*
00221    TEveTrack* FindTrackByIndex(Int_t index); // *MENU*
00222 
00223    virtual void CopyVizParams(const TEveElement* el);
00224    virtual void WriteVizParams(ostream& out, const TString& var);
00225 
00226    virtual TClass* ProjectedClass(const TEveProjection* p) const;
00227 
00228    ClassDef(TEveTrackList, 1); // A list of tracks supporting change of common attributes and selection based on track parameters.
00229 };
00230 
00231 #endif

Generated on Tue Jul 5 14:15:01 2011 for ROOT_528-00b_version by  doxygen 1.5.1