| 1 | // $Id$ |
| 2 | // Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007 |
| 3 | |
| 4 | /************************************************************************** |
| 5 | * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. * |
| 6 | * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for * |
| 7 | * full copyright notice. * |
| 8 | **************************************************************************/ |
| 9 | #ifndef AliEveV0_H |
| 10 | #define AliEveV0_H |
| 11 | |
| 12 | /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * |
| 13 | * See cxx source for full Copyright notice */ |
| 14 | |
| 15 | |
| 16 | /*********************************************************************** |
| 17 | * This code defines the reconstructed v0 visualized with EVE |
| 18 | * |
| 19 | * Ludovic Gaudichet (gaudichet@to.infn.it) |
| 20 | ************************************************************************/ |
| 21 | |
| 22 | #include <TEveVSDStructs.h> |
| 23 | #include <TEveElement.h> |
| 24 | #include <TEveTrack.h> |
| 25 | |
| 26 | #include <TPolyMarker3D.h> |
| 27 | #include <TPolyLine3D.h> |
| 28 | |
| 29 | class TH1F; |
| 30 | class TH2F; |
| 31 | |
| 32 | |
| 33 | class AliEveV0List; |
| 34 | |
| 35 | class AliEveV0 : public TEvePointSet |
| 36 | { |
| 37 | friend class AliEveV0List; |
| 38 | |
| 39 | public: |
| 40 | AliEveV0(); |
| 41 | AliEveV0(TEveRecTrack* tNeg, TEveRecTrack* tPos, TEveRecV0* v0, |
| 42 | TEveTrackPropagator* rs); |
| 43 | virtual ~AliEveV0(); |
| 44 | |
| 45 | //void AddPathMarkPos(TEvePathMark* pm) { fPathMarksPos.push_back(pm); } |
| 46 | //void AddPathMarkNeg(TEvePathMark* pm) { fPathMarksNeg.push_back(pm); } |
| 47 | |
| 48 | void Reset(TPolyLine3D* polyLine); |
| 49 | |
| 50 | void MakeV0path(); |
| 51 | void MakeV0(); |
| 52 | |
| 53 | virtual void PaintDaughters(Option_t* option="") |
| 54 | { |
| 55 | if (fRnrSelf) { fNegTrack->Paint(option); fPosTrack->Paint(option);} |
| 56 | } |
| 57 | |
| 58 | virtual void Paint(Option_t* option="") |
| 59 | { |
| 60 | if (fRnrSelf) TEvePointSet::Paint(option); |
| 61 | } |
| 62 | |
| 63 | virtual void PaintPath(Option_t* option="") |
| 64 | { |
| 65 | if (fRnrSelf) fPolyLineV0.Paint(option); |
| 66 | } |
| 67 | |
| 68 | virtual void SetMainColor(Color_t col) |
| 69 | { |
| 70 | fMarkerColor = col; fMainColorPtr = &fMarkerColor; |
| 71 | fPolyLineV0.SetLineColor(fMarkerColor); |
| 72 | } |
| 73 | |
| 74 | void SetRnrStyle(TEveTrackPropagator* rs) { fRnrStyle = rs; } |
| 75 | |
| 76 | Float_t GetDaughterDCA() const { return fDaughterDCA; } |
| 77 | void SetDaughterDCA(Float_t dca) { fDaughterDCA = dca; } |
| 78 | |
| 79 | Float_t GetRadius() const { return fRecDecayV.Perp(); } |
| 80 | |
| 81 | Int_t GetESDIndex() const { return fESDIndex; } |
| 82 | void SetESDIndex(Int_t ind) { fESDIndex = ind;} |
| 83 | |
| 84 | virtual const Text_t* GetName() const { return Form("ESDv0_%i",fESDIndex); } |
| 85 | virtual const Text_t* GetTitle() const { return Form("ESDv0_%i",fESDIndex); } |
| 86 | |
| 87 | //Int_t GetLabelPos() const { return fLabel_pos; } |
| 88 | //Int_t GetLabelNeg() const { return fLabel_neg; } |
| 89 | TEveTrackPropagator* GetPropagator() const { return fRnrStyle; } |
| 90 | |
| 91 | TEveTrack* GetNegTrack() { return fNegTrack; } |
| 92 | TEveTrack* GetPosTrack() { return fPosTrack; } |
| 93 | |
| 94 | TPolyLine3D* GetPolyLineV0() { return &fPolyLineV0; } |
| 95 | |
| 96 | protected: |
| 97 | TEveVector fRecBirthV; // Reconstucted birth point of neutral particle |
| 98 | TEveVector fRecDecayV; // Point of closest approach |
| 99 | TEveVector fRecDecayP; |
| 100 | |
| 101 | TEveTrack *fNegTrack; |
| 102 | TEveTrack *fPosTrack; |
| 103 | |
| 104 | TEveTrackPropagator *fRnrStyle; |
| 105 | |
| 106 | TPolyLine3D fPolyLineV0; |
| 107 | |
| 108 | Int_t fESDIndex; |
| 109 | Float_t fDaughterDCA; |
| 110 | Float_t fChi2V0; |
| 111 | |
| 112 | private: |
| 113 | AliEveV0(const AliEveV0&); // Not implemented |
| 114 | AliEveV0& operator=(const AliEveV0&); // Not implemented |
| 115 | |
| 116 | ClassDef(AliEveV0, 0); // Visual representation of a AliEveV0. |
| 117 | }; |
| 118 | |
| 119 | |
| 120 | /******************************************************************************/ |
| 121 | // AliEveV0List |
| 122 | /******************************************************************************/ |
| 123 | |
| 124 | class AliEveV0List : public TEveElementList |
| 125 | { |
| 126 | public: |
| 127 | AliEveV0List(); |
| 128 | AliEveV0List(TEveTrackPropagator* rs); |
| 129 | AliEveV0List(const Text_t* name, TEveTrackPropagator* rs=0); |
| 130 | virtual ~AliEveV0List(); |
| 131 | |
| 132 | virtual const Text_t* GetTitle() const { return fTitle; } |
| 133 | virtual void SetTitle(const Text_t* t) { fTitle = t; } |
| 134 | virtual void SetTracksColor(Color_t cNeg, Color_t cPos) { |
| 135 | fNegColor = cNeg; fPosColor = cPos;} |
| 136 | |
| 137 | virtual Bool_t CanEditMainColor() const { return kTRUE; } |
| 138 | |
| 139 | virtual void Paint(Option_t* option=""); |
| 140 | |
| 141 | void SetRnrStyle(TEveTrackPropagator* rst) { fRnrStyle = rst; } |
| 142 | TEveTrackPropagator* GetPropagator() { return fRnrStyle; } |
| 143 | |
| 144 | Bool_t GetRnrV0vtx() const { return fRnrV0vtx; } |
| 145 | Bool_t GetRnrV0path() const { return fRnrV0path; } |
| 146 | Bool_t GetRnrDaughters() const { return fRnrDaughters; } |
| 147 | |
| 148 | void SetRnrV0vtx(Bool_t); |
| 149 | void SetRnrV0path(Bool_t); |
| 150 | void SetRnrDaughters(Bool_t); |
| 151 | |
| 152 | void MakeV0s(); |
| 153 | void MakeMarkers(); |
| 154 | |
| 155 | protected: |
| 156 | TString fTitle; |
| 157 | |
| 158 | TEveTrackPropagator *fRnrStyle; |
| 159 | |
| 160 | Bool_t fRnrDaughters; |
| 161 | Bool_t fRnrV0vtx; |
| 162 | Bool_t fRnrV0path; |
| 163 | |
| 164 | Color_t fNegColor; |
| 165 | Color_t fPosColor; |
| 166 | |
| 167 | private: |
| 168 | void Init(); |
| 169 | |
| 170 | AliEveV0List(const AliEveV0List&); // Not implemented |
| 171 | AliEveV0List& operator=(const AliEveV0List&); // Not implemented |
| 172 | |
| 173 | ClassDef(AliEveV0List, 0); // A list of AliEveV0 objecs. |
| 174 | }; |
| 175 | |
| 176 | |
| 177 | #endif |