2 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * See cxx source for full Copyright notice */
6 /***********************************************************************
7 * This code defines the reconstructed v0 visualized with EVE
9 * Ludovic Gaudichet (gaudichet@to.infn.it)
10 ************************************************************************/
16 #include <Reve/PODs.h>
17 #include <Reve/RenderElement.h>
18 #include <Reve/Track.h>
20 #include <TPolyMarker3D.h>
21 #include <TPolyLine3D.h>
31 class V0 : public RenderElement, public TPolyMarker3D
35 V0(const V0&); // Not implemented
36 V0& operator=(const V0&); // Not implemented
40 V0(Reve::RecTrack* tNeg, Reve::RecTrack* tPos,Reve::RecV0* v0, TrackRnrStyle* rs);
43 typedef std::vector<Reve::PathMark*> vpPathMark_t;
44 typedef std::vector<Reve::PathMark*>::iterator vpPathMark_i;
45 void AddPathMarkPos(Reve::PathMark* pm) { fPathMarksPos.push_back(pm); }
46 void AddPathMarkNeg(Reve::PathMark* pm) { fPathMarksNeg.push_back(pm); }
48 void Reset(TPolyLine3D* polyLine);
50 void MakeTrack(vpPathMark_t& pathMark, Reve::Vector& vtx, Reve::Vector& p,
51 Int_t charge, Float_t beta, TPolyLine3D& polyLine);
56 virtual void PaintDaughters(Option_t* option="") {
57 if(fRnrElement) {fPolyLineNeg.Paint(option);fPolyLinePos.Paint(option);} }
58 virtual void Paint(Option_t* option="") {
59 if(fRnrElement) TPolyMarker3D::Paint(option);}
60 virtual void PaintPath(Option_t* option="") {
61 if(fRnrElement) fPolyLineV0.Paint(option);}
63 virtual void SetMainColor(Color_t col) {
64 fMarkerColor = col; fMainColorPtr = &fMarkerColor;
65 fPolyLineV0.SetLineColor(fMarkerColor);}
66 virtual void SetTracksColor(Color_t cNeg, Color_t cPos) {
67 fPolyLineNeg.SetLineColor(cNeg); fPolyLinePos.SetLineColor(cPos); }
68 void SetRnrStyle(TrackRnrStyle* rs) { fRnrStyle = rs; }
69 void SetESDIndex(Int_t ind) { fESDIndex = ind;}
70 void SetDaughterDCA(Float_t dca);
71 void SetCosPointingAngle(Float_t cos);
72 void SetDecayLength(Float_t len);
73 void SetDecayLength(Float_t primx, Float_t primy, Float_t primz);
75 Float_t const GetDaughterDCA();
76 Float_t const GetCosPointingAngle();
77 Float_t const GetRadius();
78 Float_t const GetDecayLength();
80 Float_t const GetP2();
81 Float_t const GetMomentum();
82 Float_t const GetPt();
83 Float_t const GetPt2();
84 Float_t const GetPx();
85 Float_t const GetPy();
86 Float_t const GetPz();
87 Float_t const GetPseudoRapidity();
88 Float_t const GetAlphaArmenteros();
89 Float_t const GetPtArmenteros();
91 Float_t const GetK0sE() {return 0;};
92 Float_t const GetLamE() {return 0;};
93 Float_t const GetAntiLamE() {return 0;};
94 Float_t const GetK0mass();
95 Float_t const GetLamMass();
96 Float_t const GetAntiLamMass();
98 Float_t const GetPionMinusE();
99 Float_t const GetPionPlusE();
100 Float_t const GetProtonE();
101 Float_t const GetPBarE();
103 Float_t const GetPosDCAtoPrim();
104 Float_t const GetPosP2();
105 Float_t const GetPosP();
106 Float_t const GetPosPt();
107 Float_t const GetPosPseudoRapidity();
109 Float_t const GetNegDCAtoPrim();
110 Float_t const GetNegP2();
111 Float_t const GetNegP();
112 Float_t const GetNegPt();
113 Float_t const GetNegPseudoRapidity();
114 Int_t const GetESDIndex() {return fESDIndex;};
116 virtual const Text_t* GetName() const { return Form("ESDv0_%i",fESDIndex); }
117 virtual const Text_t* GetTitle() const { return Form("ESDv0_%i",fESDIndex); }
118 Int_t GetLabelPos() const { return fLabel_pos; }
119 Int_t GetLabelNeg() const { return fLabel_neg; }
120 TrackRnrStyle* GetRnrStyle() const { return fRnrStyle; }
121 TPolyLine3D* GetPolyLineNeg() {return &fPolyLineNeg;}
122 TPolyLine3D* GetPolyLinePos() {return &fPolyLinePos;}
123 TPolyLine3D* GetPolyLineV0() {return &fPolyLineV0;}
127 Reve::Vector fV_neg; // Vertex of negative track
128 Reve::Vector fP_neg; // Momentum of negative track
129 Reve::Vector fV_pos; // Vertex of positive track
130 Reve::Vector fP_pos; // Momentum of positive track
132 Reve::Vector fV_v0; // Point of closest approach
133 Reve::Vector fV0_birth; // Reconstucted birth point of neutral particle
141 vpPathMark_t fPathMarksNeg;
142 vpPathMark_t fPathMarksPos;
143 TrackRnrStyle* fRnrStyle;
145 TPolyLine3D fPolyLineNeg;
146 TPolyLine3D fPolyLinePos;
147 TPolyLine3D fPolyLineV0;
150 Float_t fDaughterDCA;
151 Float_t fCosPointingAngle;
152 Float_t fDecayLength;
154 static const Float_t fgkMassPion2;
155 static const Float_t fgkMassProton2;
162 //______________________________________________________________________
163 inline void V0::SetDaughterDCA(Float_t dca) {
167 inline void V0::SetCosPointingAngle(Float_t cos) {
168 fCosPointingAngle = cos;
171 inline void V0::SetDecayLength(Float_t len) {
176 //______________________________________________________________________
177 inline Float_t const V0::GetPt2() {
178 Float_t px = fP_neg.x+fP_pos.x, py = fP_neg.y+fP_pos.y;
179 return (px*px+py*py);
182 inline Float_t const V0::GetP2() {
184 Float_t px = fP_neg.x+fP_pos.x, py = fP_neg.y+fP_pos.y, pz = fP_neg.z+fP_pos.z;
185 return (px*px+py*py+pz*pz);
188 inline Float_t const V0::GetPt() {
189 return sqrt(GetPt2());
192 inline Float_t const V0::GetMomentum() {
193 return sqrt(GetP2());
196 inline Float_t const V0::GetPx() {
197 return (fP_neg.x+fP_pos.x);
200 inline Float_t const V0::GetPy() {
201 return (fP_neg.y+fP_pos.y);
204 inline Float_t const V0::GetPz() {
205 return (fP_neg.z+fP_pos.z);
208 //______________________________________________________________________
210 inline Float_t const V0::GetDaughterDCA() {
214 inline Float_t const V0::GetCosPointingAngle() {
215 return fCosPointingAngle;
218 inline Float_t const V0::GetRadius() {
219 return sqrt(fV_v0.x*fV_v0.x + fV_v0.y*fV_v0.y);
222 inline Float_t const V0::GetDecayLength() {
226 inline Float_t const V0::GetPseudoRapidity() {
227 Float_t theta = acos( GetPz()/GetMomentum() );
228 return ( -log(tan(theta/2.)) );
231 //______________________________________________________________________
233 inline Float_t const V0::GetPionMinusE() {
234 return sqrt(fgkMassPion2+GetNegP2());
237 inline Float_t const V0::GetPionPlusE() {
238 return sqrt(fgkMassPion2+GetPosP2());
240 inline Float_t const V0::GetProtonE() {
241 return sqrt(fgkMassProton2+GetPosP2());
244 inline Float_t const V0::GetPBarE() {
245 return sqrt(fgkMassProton2+GetNegP2());
248 //______________________________________________________________________
250 inline Float_t const V0::GetPosP2() {
251 return (fP_pos.x*fP_pos.x + fP_pos.y*fP_pos.y + fP_pos.z*fP_pos.z);
254 inline Float_t const V0::GetPosP() {
255 return sqrt(GetPosP2());
258 inline Float_t const V0::GetPosPt() {
259 return sqrt(fP_pos.x*fP_pos.x + fP_pos.y*fP_pos.y);
262 inline Float_t const V0::GetPosPseudoRapidity() {
263 Float_t theta = acos( fP_pos.z/GetPosP() );
264 return ( -log(tan(theta/2.)) );
267 inline Float_t const V0::GetPosDCAtoPrim() {
271 //______________________________________________________________________
272 inline Float_t const V0::GetNegP2() {
273 return (fP_neg.x*fP_neg.x + fP_neg.y*fP_neg.y + fP_neg.z*fP_neg.z);
276 inline Float_t const V0::GetNegP() {
277 return sqrt(GetNegP2());
280 inline Float_t const V0::GetNegPt() {
281 return sqrt(fP_neg.x*fP_neg.x + fP_neg.y*fP_neg.y);
284 inline Float_t const V0::GetNegPseudoRapidity() {
285 Float_t theta = acos( fP_neg.z/GetNegP() );
286 return ( -log(tan(theta/2.)) );
289 inline Float_t const V0::GetNegDCAtoPrim() {
293 //______________________________________________________________________
295 inline Float_t const V0::GetK0mass() {
296 Float_t energy = GetPionMinusE() + GetPionPlusE();
297 return sqrt( energy*energy - GetP2() );
300 inline Float_t const V0::GetLamMass() {
301 Float_t energy = GetPionMinusE() + GetProtonE();
302 return sqrt( energy*energy - GetP2() );
305 inline Float_t const V0::GetAntiLamMass() {
306 Float_t energy = GetPionPlusE() + GetPBarE();
307 return sqrt( energy*energy - GetP2() );
313 /**************************************************************************/
315 /**************************************************************************/
317 class V0List : public TNamed, public RenderElementListBase
319 V0List(const V0List&); // Not implemented
320 V0List& operator=(const V0List&); // Not implemented
324 V0List(TrackRnrStyle* rs);
325 V0List(const Text_t* name, TrackRnrStyle* rs=0);
328 virtual const Text_t* GetTitle() const { return fTitle; }
329 virtual void SetTitle(const Text_t* t) { fTitle = t; }
330 virtual void SetTracksColor(Color_t cNeg, Color_t cPos) {
331 fNegColor = cNeg; fPosColor = cPos;}
333 virtual Bool_t CanEditMainColor() { return kTRUE; }
335 virtual void Paint(Option_t* option="");
337 virtual void AddElement(RenderElement* el);
339 void SetRnrStyle(TrackRnrStyle* rst) { fRnrStyle= rst; }
340 TrackRnrStyle* GetRnrStyle() { return fRnrStyle; }
342 Bool_t GetRnrV0vtx() const { return fRnrV0vtx; }
343 Bool_t GetRnrV0path() const { return fRnrV0path; }
344 Bool_t GetRnrDaughters() const { return fRnrDaughters; }
346 void SetRnrV0vtx(Bool_t);
347 void SetRnrV0path(Bool_t);
348 void SetRnrDaughters(Bool_t);
349 void SetMin(Int_t i, Float_t val) {
350 if ((i>=0)&&(i<fgkNcutVar)) fMin[i]=val;}
351 void SetMax(Int_t i, Float_t val) {
352 if ((i>=0)&&(i<fgkNcutVar)) fMax[i]=val;}
357 TH1F* GetHist(Int_t i) {
358 if ((i>=0)&&(i<fgkNcutVar)) return fHist[i]; else return 0;}
359 TH2F* GetHist2D(Int_t i) {
360 if ((i>=0)&&(i<fgkNcutVar2D)) return fHist2D[i]; else return 0;}
361 Float_t GetMin(Int_t i) {
362 if ((i>=0)&&(i<fgkNcutVar)) return fMin[i]; else return 0;}
363 Float_t GetMax(Int_t i) {
364 if ((i>=0)&&(i<fgkNcutVar)) return fMax[i]; else return 0;}
365 void GetV0IndexRange(Int_t &imin, Int_t &imax);
367 Float_t GetMaxR() const { return fRnrStyle->fMaxZ; }
368 Float_t GetMaxZ() const { return fRnrStyle->fMaxR; }
369 Float_t GetMaxOrbs() const { return fRnrStyle->fMaxOrbs; }
370 Float_t GetMinAng() const { return fRnrStyle->fMinAng; }
371 Float_t GetDelta() const { return fRnrStyle->fDelta; }
372 Bool_t GetFitDaughters() const { return fRnrStyle->fFitDaughters; }
373 Bool_t GetFitDecay() const { return fRnrStyle->fFitDecay; }
375 void AdjustHist(Int_t iHist);
379 void PtFilter(Float_t min, Float_t max);
381 void K0sMFilter(Float_t min, Float_t max);
382 void LamMFilter(Float_t min, Float_t max);
383 void ALamMFilter(Float_t min, Float_t max);
384 void CosPointingFilter(Float_t min, Float_t max);
385 void DaughterDCAFilter(Float_t min, Float_t max);
386 void RadiusFilter(Float_t min, Float_t max);
387 void EtaFilter(Float_t min, Float_t max);
388 void NegPtFilter(Float_t min, Float_t max);
389 void NegEtaFilter(Float_t min, Float_t max);
390 void PosPtFilter(Float_t min, Float_t max);
391 void PosEtaFilter(Float_t min, Float_t max);
392 void IndexFilter(Float_t min, Float_t max);
401 TrackRnrStyle* fRnrStyle;
403 Bool_t fRnrDaughters;
410 static const Int_t fgkNcutVar = 13;
411 TH1F *fHist[fgkNcutVar];
412 Float_t fMin[fgkNcutVar];
413 Float_t fMax[fgkNcutVar];
415 static const Int_t fgkNcutVar2D = 1;
416 TH2F *fHist2D[fgkNcutVar2D];
417 Float_t fMinX[fgkNcutVar2D];
418 Float_t fMinY[fgkNcutVar2D];
419 Float_t fMaxX[fgkNcutVar2D];
420 Float_t fMaxY[fgkNcutVar2D];