]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVE/Reve/V0.h
Add Getters and Setters in TrackRnrStyle and TrackList to define rendering of path...
[u/mrichter/AliRoot.git] / EVE / Reve / V0.h
1
2 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  * See cxx source for full Copyright notice                               */
4
5
6 /***********************************************************************
7 *  This code defines the reconstructed v0 visualized with EVE
8 *
9 * Ludovic Gaudichet (gaudichet@to.infn.it)
10 ************************************************************************/
11
12
13 #ifndef REVE_V0_H
14 #define REVE_V0_H
15
16 #include <Reve/PODs.h>
17 #include <Reve/RenderElement.h>
18 #include <Reve/Track.h>
19
20 #include <TPolyMarker3D.h>
21 #include <TPolyLine3D.h>
22
23 class TH1F;
24 class TH2F;
25
26
27 namespace Reve {
28
29 class V0List;
30
31 class V0 : public RenderElement, public TPolyMarker3D
32 {
33   friend class V0List;
34
35   V0(const V0&);            // Not implemented
36   V0& operator=(const V0&); // Not implemented
37
38 public: 
39   V0();
40   V0(Reve::RecTrack* tNeg, Reve::RecTrack* tPos,Reve::RecV0* v0, TrackRnrStyle* rs);
41   virtual ~V0();
42
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); }
47
48   void Reset(TPolyLine3D* polyLine);
49
50   void MakeTrack(vpPathMark_t& pathMark, Reve::Vector& vtx,  Reve::Vector& p,
51                  Int_t charge, Float_t beta, TPolyLine3D& polyLine);
52
53   void MakeV0path();
54   void MakeV0();
55
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);}
62
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);
74
75   Float_t const GetDaughterDCA();
76   Float_t const GetCosPointingAngle();
77   Float_t const GetRadius();
78   Float_t const GetDecayLength();
79
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();
90
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();
97
98   Float_t const GetPionMinusE();
99   Float_t const GetPionPlusE();
100   Float_t const GetProtonE();
101   Float_t const GetPBarE();
102
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();
108
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;};
115
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;}
124
125 protected:
126
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
131
132   Reve::Vector fV_v0;        // Point of closest approach
133   Reve::Vector fV0_birth;    // Reconstucted birth point of neutral particle
134
135   Float_t           fBeta_neg;
136   Float_t           fBeta_pos;
137
138   Int_t             fLabel_neg;
139   Int_t             fLabel_pos;
140
141   vpPathMark_t      fPathMarksNeg;
142   vpPathMark_t      fPathMarksPos;
143   TrackRnrStyle*    fRnrStyle;
144
145   TPolyLine3D       fPolyLineNeg;
146   TPolyLine3D       fPolyLinePos;
147   TPolyLine3D       fPolyLineV0;
148
149   Int_t             fESDIndex;
150   Float_t           fDaughterDCA;
151   Float_t           fCosPointingAngle;
152   Float_t           fDecayLength;
153
154   static const Float_t fgkMassPion2;
155   static const Float_t fgkMassProton2;
156
157   ClassDef(V0, 1)
158 }; // endclass V0
159
160
161
162 //______________________________________________________________________
163 inline void V0::SetDaughterDCA(Float_t dca) { 
164   fDaughterDCA = dca; 
165 }
166
167 inline void V0::SetCosPointingAngle(Float_t cos) { 
168   fCosPointingAngle = cos; 
169 }
170
171 inline void V0::SetDecayLength(Float_t len) {
172   fDecayLength = len;
173 }
174
175
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);
180 }
181
182 inline Float_t const V0::GetP2() {
183
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);
186 }
187
188 inline Float_t const V0::GetPt() {
189   return sqrt(GetPt2());
190 }
191
192 inline Float_t const V0::GetMomentum() {
193   return sqrt(GetP2());
194 }
195
196 inline Float_t const V0::GetPx() {
197   return (fP_neg.x+fP_pos.x);
198 }
199
200 inline Float_t const V0::GetPy() {
201   return (fP_neg.y+fP_pos.y);
202 }
203
204 inline Float_t const V0::GetPz() {
205   return (fP_neg.z+fP_pos.z);
206 }
207
208 //______________________________________________________________________
209
210 inline Float_t const V0::GetDaughterDCA() {
211 return fDaughterDCA;
212 }
213
214 inline Float_t const V0::GetCosPointingAngle() {
215 return fCosPointingAngle;
216 }
217
218 inline Float_t const V0::GetRadius() {
219   return sqrt(fV_v0.x*fV_v0.x + fV_v0.y*fV_v0.y);
220 }
221
222 inline Float_t const V0::GetDecayLength() {
223 return fDecayLength;
224 }
225
226 inline Float_t const V0::GetPseudoRapidity() {
227   Float_t theta = acos( GetPz()/GetMomentum() );
228   return ( -log(tan(theta/2.)) );
229 }
230
231 //______________________________________________________________________
232
233 inline Float_t const V0::GetPionMinusE() {
234   return sqrt(fgkMassPion2+GetNegP2());
235 }
236
237 inline Float_t const V0::GetPionPlusE() {
238   return sqrt(fgkMassPion2+GetPosP2());
239 }
240 inline Float_t const V0::GetProtonE() {
241   return sqrt(fgkMassProton2+GetPosP2());
242
243 }
244 inline Float_t const V0::GetPBarE() {
245   return sqrt(fgkMassProton2+GetNegP2());
246 }
247
248 //______________________________________________________________________
249
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);
252 }
253
254 inline Float_t const V0::GetPosP() {
255   return sqrt(GetPosP2());
256 }
257
258 inline Float_t const V0::GetPosPt() {
259   return sqrt(fP_pos.x*fP_pos.x + fP_pos.y*fP_pos.y);
260 }
261
262 inline Float_t const V0::GetPosPseudoRapidity() {
263   Float_t theta = acos( fP_pos.z/GetPosP() );
264   return ( -log(tan(theta/2.)) );
265 }
266
267 inline Float_t const V0::GetPosDCAtoPrim() {
268   return 0;
269 }
270
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);
274 }
275
276 inline Float_t const V0::GetNegP() {
277   return sqrt(GetNegP2());
278 }
279
280 inline Float_t const V0::GetNegPt() {
281   return sqrt(fP_neg.x*fP_neg.x + fP_neg.y*fP_neg.y);
282 }
283
284 inline Float_t const V0::GetNegPseudoRapidity() {
285   Float_t theta = acos( fP_neg.z/GetNegP() );
286   return ( -log(tan(theta/2.)) );
287 }
288
289 inline Float_t const V0::GetNegDCAtoPrim() {
290   return 0;
291 }
292
293 //______________________________________________________________________
294
295 inline Float_t const V0::GetK0mass() {
296   Float_t energy = GetPionMinusE() + GetPionPlusE();
297   return sqrt( energy*energy - GetP2() );
298 }
299
300 inline Float_t const V0::GetLamMass() {
301   Float_t energy = GetPionMinusE() + GetProtonE();
302   return sqrt( energy*energy - GetP2() );
303 }
304
305 inline Float_t const V0::GetAntiLamMass() {
306   Float_t energy = GetPionPlusE() + GetPBarE();
307   return sqrt( energy*energy - GetP2() );
308 }
309
310
311
312
313 /**************************************************************************/
314 // V0List
315 /**************************************************************************/
316
317 class V0List : public TNamed, public RenderElementListBase
318 {
319   V0List(const V0List&);            // Not implemented
320   V0List& operator=(const V0List&); // Not implemented
321
322 public:
323   V0List();
324   V0List(TrackRnrStyle* rs);
325   V0List(const Text_t* name, TrackRnrStyle* rs=0);
326   virtual ~V0List();
327
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;}
332
333   virtual Bool_t CanEditMainColor()  { return kTRUE; }
334
335   virtual void Paint(Option_t* option="");
336
337   virtual void AddElement(RenderElement* el);
338
339   void  SetRnrStyle(TrackRnrStyle* rst) { fRnrStyle= rst; }
340   TrackRnrStyle* GetRnrStyle()          { return fRnrStyle; } 
341
342   Bool_t GetRnrV0vtx() const { return fRnrV0vtx; }
343   Bool_t GetRnrV0path() const { return fRnrV0path; }
344   Bool_t GetRnrDaughters() const { return fRnrDaughters; }
345
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;}
353
354   void   MakeV0s();
355   void   MakeMarkers();
356
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);
366
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; }
374
375   void AdjustHist(Int_t iHist);
376   void UnFill(V0* v0);
377   void Filter(V0* v0);
378   void FilterAll();
379   void PtFilter(Float_t min, Float_t max);
380
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);
393
394
395 private:
396   void  Init();
397
398 protected:
399   TString              fTitle;
400
401   TrackRnrStyle*       fRnrStyle;
402
403   Bool_t               fRnrDaughters;
404   Bool_t               fRnrV0vtx;
405   Bool_t               fRnrV0path;
406
407   Color_t              fNegColor;
408   Color_t              fPosColor;
409
410   static const Int_t fgkNcutVar = 13;
411   TH1F *fHist[fgkNcutVar];
412   Float_t fMin[fgkNcutVar];
413   Float_t fMax[fgkNcutVar];
414
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];
421
422   ClassDef(V0List, 1)
423 };
424
425
426 } // namespace Reve
427
428 #endif