]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVE/EveBase/blacklisted-classes/AliEveV0.h
Fix order of public/protected/private sections to conform with coding
[u/mrichter/AliRoot.git] / EVE / EveBase / blacklisted-classes / AliEveV0.h
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 V0List;
34
35 class AliEveV0 : public TEveElement,
36            public TPolyMarker3D
37 {
38   friend class V0List;
39
40 public:
41   AliEveV0();
42   AliEveV0(TEveRecTrack* tNeg, TEveRecTrack* tPos, TEveRecV0* v0,
43      TEveTrackPropagator* rs);
44   virtual ~AliEveV0();
45
46   typedef std::vector<TEvePathMark*>           vpPathMark_t;
47   typedef std::vector<TEvePathMark*>::iterator vpPathMark_i;
48   void  AddPathMarkPos(TEvePathMark* pm) { fPathMarksPos.push_back(pm); }
49   void  AddPathMarkNeg(TEvePathMark* pm) { fPathMarksNeg.push_back(pm); }
50
51   void Reset(TPolyLine3D* polyLine);
52
53   void MakeTrack(vpPathMark_t& pathMark, TEveVector& vtx,  TEveVector& p,
54                  Int_t charge, Float_t beta, TPolyLine3D& polyLine);
55
56   void MakeV0path();
57   void MakeV0();
58
59   virtual void PaintDaughters(Option_t* option="") {
60     if(fRnrSelf) {fPolyLineNeg.Paint(option);fPolyLinePos.Paint(option);} }
61   virtual void Paint(Option_t* option="") {
62     if(fRnrSelf) TPolyMarker3D::Paint(option);}
63   virtual void PaintPath(Option_t* option="") {
64     if(fRnrSelf) fPolyLineV0.Paint(option);}
65
66   virtual void  SetMainColor(Color_t col) {
67     fMarkerColor = col; fMainColorPtr = &fMarkerColor;
68     fPolyLineV0.SetLineColor(fMarkerColor);}
69   virtual void  SetTracksColor(Color_t cNeg, Color_t cPos) {
70     fPolyLineNeg.SetLineColor(cNeg); fPolyLinePos.SetLineColor(cPos); }
71   void          SetRnrStyle(TEveTrackPropagator* rs) { fRnrStyle = rs; }
72   void          SetESDIndex(Int_t ind) { fESDIndex = ind;}
73   void          SetDaughterDCA(Float_t dca);
74   void          SetCosPointingAngle(Float_t cos);
75   void          SetDecayLength(Float_t len);
76   void          SetDecayLength(Float_t primx, Float_t primy, Float_t primz);
77
78   Float_t GetDaughterDCA() const;
79   Float_t GetCosPointingAngle() const;
80   Float_t GetRadius() const;
81   Float_t GetDecayLength() const;
82
83   Float_t GetP2() const;
84   Float_t GetMomentum() const;
85   Float_t GetPt() const;
86   Float_t GetPt2() const;
87   Float_t GetPx() const;
88   Float_t GetPy() const;
89   Float_t GetPz() const;
90   Float_t GetPseudoRapidity() const;
91   Float_t GetAlphaArmenteros() const;
92   Float_t GetPtArmenteros() const;
93
94   Float_t GetK0sE() const {return 0;};
95   Float_t GetLamE() const {return 0;};
96   Float_t GetAntiLamE() const {return 0;};
97   Float_t GetK0mass() const;
98   Float_t GetLamMass() const;
99   Float_t GetAntiLamMass() const;
100
101   Float_t GetPionMinusE() const;
102   Float_t GetPionPlusE() const;
103   Float_t GetProtonE() const;
104   Float_t GetPBarE() const;
105
106   Float_t GetPosDCAtoPrim() const;
107   Float_t GetPosP2() const;
108   Float_t GetPosP() const;
109   Float_t GetPosPt() const;
110   Float_t GetPosPseudoRapidity() const;
111
112   Float_t GetNegDCAtoPrim() const;
113   Float_t GetNegP2() const;
114   Float_t GetNegP() const;
115   Float_t GetNegPt() const;
116   Float_t GetNegPseudoRapidity() const;
117   Int_t   GetESDIndex() const {return fESDIndex;};
118
119   virtual const Text_t* GetName() const    { return Form("ESDv0_%i",fESDIndex); }
120   virtual const Text_t* GetTitle() const   { return Form("ESDv0_%i",fESDIndex); }
121   Int_t          GetLabelPos() const { return fLabel_pos; }
122   Int_t          GetLabelNeg() const { return fLabel_neg; }
123   TEveTrackPropagator* GetPropagator() const  { return fRnrStyle; }
124   TPolyLine3D*   GetPolyLineNeg() {return &fPolyLineNeg;}
125   TPolyLine3D*   GetPolyLinePos() {return &fPolyLinePos;}
126   TPolyLine3D*   GetPolyLineV0() {return &fPolyLineV0;}
127
128 protected:
129
130   TEveVector fV_neg;       // Vertex of negative track
131   TEveVector fP_neg;       // Momentum of negative track
132   TEveVector fV_pos;       // Vertex of positive track
133   TEveVector fP_pos;       // Momentum of positive track
134
135   TEveVector fV_v0;        // Point of closest approach
136   TEveVector fV0_birth;    // Reconstucted birth point of neutral particle
137
138   Float_t           fBeta_neg;
139   Float_t           fBeta_pos;
140
141   Int_t             fLabel_neg;
142   Int_t             fLabel_pos;
143
144   vpPathMark_t         fPathMarksNeg;
145   vpPathMark_t         fPathMarksPos;
146   TEveTrackPropagator *fRnrStyle;
147
148   TPolyLine3D       fPolyLineNeg;
149   TPolyLine3D       fPolyLinePos;
150   TPolyLine3D       fPolyLineV0;
151
152   Int_t             fESDIndex;
153   Float_t           fDaughterDCA;
154   Float_t           fCosPointingAngle;
155   Float_t           fDecayLength;
156
157   static const Float_t fgkMassPion2;
158   static const Float_t fgkMassProton2;
159
160 private:
161   AliEveV0(const AliEveV0&);            // Not implemented
162   AliEveV0& operator=(const AliEveV0&); // Not implemented
163
164   ClassDef(AliEveV0, 0); // Visual representation of a AliEveV0.
165 };
166
167
168 //______________________________________________________________________________
169 inline void AliEveV0::SetDaughterDCA(Float_t dca) {
170   fDaughterDCA = dca;
171 }
172
173 inline void AliEveV0::SetCosPointingAngle(Float_t cos) {
174   fCosPointingAngle = cos;
175 }
176
177 inline void AliEveV0::SetDecayLength(Float_t len) {
178   fDecayLength = len;
179 }
180
181
182 //______________________________________________________________________________
183 inline Float_t AliEveV0::GetPt2() const {
184   Float_t px = fP_neg.x+fP_pos.x, py = fP_neg.y+fP_pos.y;
185   return (px*px+py*py);
186 }
187
188 inline Float_t AliEveV0::GetP2() const {
189
190   Float_t px = fP_neg.x+fP_pos.x, py = fP_neg.y+fP_pos.y, pz = fP_neg.z+fP_pos.z;
191   return (px*px+py*py+pz*pz);
192 }
193
194 inline Float_t AliEveV0::GetPt() const {
195   return sqrt(GetPt2());
196 }
197
198 inline Float_t AliEveV0::GetMomentum() const {
199   return sqrt(GetP2());
200 }
201
202 inline Float_t AliEveV0::GetPx() const {
203   return (fP_neg.x+fP_pos.x);
204 }
205
206 inline Float_t AliEveV0::GetPy() const {
207   return (fP_neg.y+fP_pos.y);
208 }
209
210 inline Float_t AliEveV0::GetPz() const {
211   return (fP_neg.z+fP_pos.z);
212 }
213
214 //______________________________________________________________________________
215
216 inline Float_t AliEveV0::GetDaughterDCA() const {
217   return fDaughterDCA;
218 }
219
220 inline Float_t AliEveV0::GetCosPointingAngle() const {
221 return fCosPointingAngle;
222 }
223
224 inline Float_t AliEveV0::GetRadius() const {
225   return sqrt(fV_v0.x*fV_v0.x + fV_v0.y*fV_v0.y);
226 }
227
228 inline Float_t AliEveV0::GetDecayLength() const {
229 return fDecayLength;
230 }
231
232 inline Float_t AliEveV0::GetPseudoRapidity() const {
233   Float_t theta = acos( GetPz()/GetMomentum() );
234   return ( -log(tan(theta/2.)) );
235 }
236
237 //______________________________________________________________________________
238
239 inline Float_t AliEveV0::GetPionMinusE() const {
240   return sqrt(fgkMassPion2+GetNegP2());
241 }
242
243 inline Float_t AliEveV0::GetPionPlusE() const {
244   return sqrt(fgkMassPion2+GetPosP2());
245 }
246 inline Float_t AliEveV0::GetProtonE() const {
247   return sqrt(fgkMassProton2+GetPosP2());
248
249 }
250 inline Float_t AliEveV0::GetPBarE() const {
251   return sqrt(fgkMassProton2+GetNegP2());
252 }
253
254 //______________________________________________________________________________
255
256 inline Float_t AliEveV0::GetPosP2() const {
257   return (fP_pos.x*fP_pos.x + fP_pos.y*fP_pos.y + fP_pos.z*fP_pos.z);
258 }
259
260 inline Float_t AliEveV0::GetPosP() const {
261   return sqrt(GetPosP2());
262 }
263
264 inline Float_t AliEveV0::GetPosPt() const {
265   return sqrt(fP_pos.x*fP_pos.x + fP_pos.y*fP_pos.y);
266 }
267
268 inline Float_t AliEveV0::GetPosPseudoRapidity() const {
269   Float_t theta = acos( fP_pos.z/GetPosP() );
270   return ( -log(tan(theta/2.)) );
271 }
272
273 inline Float_t AliEveV0::GetPosDCAtoPrim() const {
274   return 0;
275 }
276
277 //______________________________________________________________________________
278 inline Float_t AliEveV0::GetNegP2() const {
279   return (fP_neg.x*fP_neg.x + fP_neg.y*fP_neg.y + fP_neg.z*fP_neg.z);
280 }
281
282 inline Float_t AliEveV0::GetNegP() const {
283   return sqrt(GetNegP2());
284 }
285
286 inline Float_t AliEveV0::GetNegPt() const {
287   return sqrt(fP_neg.x*fP_neg.x + fP_neg.y*fP_neg.y);
288 }
289
290 inline Float_t AliEveV0::GetNegPseudoRapidity() const {
291   Float_t theta = acos( fP_neg.z/GetNegP() );
292   return ( -log(tan(theta/2.)) );
293 }
294
295 inline Float_t AliEveV0::GetNegDCAtoPrim() const {
296   return 0;
297 }
298
299 //______________________________________________________________________________
300
301 inline Float_t AliEveV0::GetK0mass() const {
302   Float_t energy = GetPionMinusE() + GetPionPlusE();
303   return sqrt( energy*energy - GetP2() );
304 }
305
306 inline Float_t AliEveV0::GetLamMass() const {
307   Float_t energy = GetPionMinusE() + GetProtonE();
308   return sqrt( energy*energy - GetP2() );
309 }
310
311 inline Float_t AliEveV0::GetAntiLamMass() const {
312   Float_t energy = GetPionPlusE() + GetPBarE();
313   return sqrt( energy*energy - GetP2() );
314 }
315
316
317
318 /******************************************************************************/
319 // V0List
320 /******************************************************************************/
321
322 class V0List : public TEveElementList
323 {
324 public:
325   V0List();
326   V0List(TEveTrackPropagator* rs);
327   V0List(const Text_t* name, TEveTrackPropagator* rs=0);
328   virtual ~V0List();
329
330   virtual const Text_t* GetTitle() const { return fTitle; }
331   virtual void SetTitle(const Text_t* t) { fTitle = t; }
332   virtual void SetTracksColor(Color_t cNeg, Color_t cPos) {
333     fNegColor = cNeg; fPosColor = cPos;}
334
335   virtual Bool_t CanEditMainColor()  { return kTRUE; }
336
337   virtual void Paint(Option_t* option="");
338
339   void  SetRnrStyle(TEveTrackPropagator* rst) { fRnrStyle= rst; }
340   TEveTrackPropagator* GetPropagator()          { 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(AliEveV0* v0);
377   void Filter(AliEveV0* 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 protected:
395   TString              fTitle;
396
397   TEveTrackPropagator *fRnrStyle;
398
399   Bool_t               fRnrDaughters;
400   Bool_t               fRnrV0vtx;
401   Bool_t               fRnrV0path;
402
403   Color_t              fNegColor;
404   Color_t              fPosColor;
405
406   static const Int_t fgkNcutVar = 13;
407   TH1F *fHist[fgkNcutVar];
408   Float_t fMin[fgkNcutVar];
409   Float_t fMax[fgkNcutVar];
410
411   static const Int_t fgkNcutVar2D = 1;
412   TH2F *fHist2D[fgkNcutVar2D];
413   Float_t fMinX[fgkNcutVar2D];
414   Float_t fMinY[fgkNcutVar2D];
415   Float_t fMaxX[fgkNcutVar2D];
416   Float_t fMaxY[fgkNcutVar2D];
417
418 private:
419   void  Init();
420
421   V0List(const V0List&);            // Not implemented
422   V0List& operator=(const V0List&); // Not implemented
423
424   ClassDef(V0List, 0); // A list of AliEveV0 objecs.
425 };
426
427
428 #endif