]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVE/EveDet/blacklisted-classes/AliEveCascade.h
Move contents of EVE/Alieve to EVE/EveDet as most code will remain there.
[u/mrichter/AliRoot.git] / EVE / EveDet / blacklisted-classes / AliEveCascade.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 ALIEVE_Cascade_H
10 #define ALIEVE_Cascade_H
11
12 /***********************************************************************
13 *  This code defines the reconstructed cascades visualized with EVE
14 *
15 * Ludovic Gaudichet (gaudichet@to.infn.it)
16 ************************************************************************/
17
18 #include <TEveVSDStructs.h>
19 #include <TEveElement.h>
20 #include <TEveTrack.h>
21
22 #include <TPolyMarker3D.h>
23 #include <TPolyLine3D.h>
24
25 class TH1F;
26 class TH2F;
27
28
29 class CascadeList;
30
31 class AliEveCascade : public TEveElement,
32                 public TPolyMarker3D
33 {
34 public:
35   typedef std::vector<TEvePathMark*>           vpPathMark_t;
36
37 private:
38   friend class CascadeList;
39
40   AliEveCascade(const AliEveCascade&);            // Not implemented
41   AliEveCascade& operator=(const AliEveCascade&); // Not implemented
42
43 protected:
44   typedef std::vector<TEvePathMark*>::iterator vpPathMark_i;
45
46   TEveVector fV_neg;       // Vertex of negative track
47   TEveVector fP_neg;       // Momentum of negative track
48   TEveVector fV_pos;       // Vertex of positive track
49   TEveVector fP_pos;       // Momentum of positive track
50   TEveVector fV_bach;      // Vertex of positive track
51   TEveVector fP_bach;      // Momentum of positive track
52
53   TEveVector fV_decay;     //decay point of the cascade
54   TEveVector fV_birth;    // Reconstructed birth point of neutral particle
55
56   vpPathMark_t         fPathMarksNeg;
57   vpPathMark_t         fPathMarksPos;
58   vpPathMark_t         fPathMarksBach;
59   TEveTrackPropagator *fRnrStyle;
60
61   TPolyLine3D       fPolyLineNeg;
62   TPolyLine3D       fPolyLinePos;
63   TPolyLine3D       fPolyLineBach;
64   TPolyLine3D       fPolyLineV0;   // line of AliEveV0 travel
65   TPolyLine3D       fPolyLineCas;  // line of cascade travel
66
67   Float_t           fBeta_neg;
68   Float_t           fBeta_pos;
69   Float_t           fBeta_bach;
70
71   Int_t             fESDIndex;
72
73   Float_t           fDCA_v0_Bach;
74   Float_t           fCasCosPointingAngle;
75   Float_t           fCasDecayLength;
76
77   static const Float_t fgkMassPion2;
78   static const Float_t fgkMassKaon2;
79   static const Float_t fgkMassProton2;
80   static const Float_t fgkMassLambda2;
81
82 public:
83   AliEveCascade();
84   AliEveCascade(TEveTrackPropagator* rs);
85   virtual ~AliEveCascade();
86
87   virtual void  SetESDIndex(Int_t ind) { fESDIndex = ind;}
88   virtual void  SetMainColor(Color_t col)
89   {
90     fMarkerColor = col; fMainColorPtr = &fMarkerColor;
91     fPolyLineV0.SetLineColor(fMarkerColor);
92   }
93   virtual void  SetTracksColor(Color_t cNeg, Color_t cPos, Color_t cBach)
94   {
95     fPolyLineNeg.SetLineColor(cNeg); fPolyLinePos.SetLineColor(cPos);
96     fPolyLineBach.SetLineColor(cBach);
97   }
98   void        SetRnrStyle(TEveTrackPropagator* rs) { fRnrStyle = rs; }
99
100   void  AddPathMarkPos(TEvePathMark* pm) { fPathMarksPos.push_back(pm); }
101   void  AddPathMarkNeg(TEvePathMark* pm) { fPathMarksNeg.push_back(pm); }
102   void  AddPathMarkBach(TEvePathMark* pm) { fPathMarksBach.push_back(pm); }
103
104   virtual void PaintV0Daughters(Option_t* option="") {
105     if(fRnrSelf) {fPolyLineNeg.Paint(option);fPolyLinePos.Paint(option); } }
106   virtual void PaintBachelor(Option_t* option="") {
107     if(fRnrSelf) fPolyLineBach.Paint(option); }
108   virtual void Paint(Option_t* option="") {
109     if(fRnrSelf) TPolyMarker3D::Paint(option);}
110   virtual void PaintV0Path(Option_t* option="") {
111     if(fRnrSelf) fPolyLineV0.Paint(option);}
112   virtual void PaintCasPath(Option_t* option="") {
113     if(fRnrSelf) fPolyLineCas.Paint(option);}
114
115   void Reset(TPolyLine3D* polyLine);
116   void MakeTrack(vpPathMark_t& pathMark, TEveVector& vtx,  TEveVector& p,
117                  Int_t charge, Float_t beta, TPolyLine3D& polyLine);
118   void MakeV0path();
119   void MakeCasPath();
120   void MakeCascade();
121
122   void SetBeta(Float_t betaNeg, Float_t betaPos, Float_t betaBach);
123   void SetDCA_v0_Bach(Float_t dca) {fDCA_v0_Bach = dca;}
124   void SetCasCosPointingAngle(Float_t cos) {fCasCosPointingAngle = cos;}
125   void SetNegP(Float_t px, Float_t py, Float_t pz) {fP_neg.x = px; fP_neg.y = py; fP_neg.z = pz;}
126   void SetPosP(Float_t px, Float_t py, Float_t pz) {fP_pos.x = px; fP_pos.y = py; fP_pos.z = pz;}
127   void SetBachP(Float_t px, Float_t py, Float_t pz) {fP_bach.x = px; fP_bach.y = py; fP_bach.z = pz;}
128
129   void SetV0vtx(Float_t vx, Float_t vy, Float_t vz)  {
130     fV_neg.x = vx; fV_neg.y = vy; fV_neg.z = vz;
131     fV_pos.x = vx; fV_pos.y = vy; fV_pos.z = vz;
132   }
133   void SetCascadeVtx(Float_t vx, Float_t vy, Float_t vz) {
134     fV_decay.x = vx; fV_decay.y = vy; fV_decay.z = vz; }
135
136   void SetDecayLength(Float_t primx, Float_t primy, Float_t primz);
137
138   Int_t   GetESDIndex() const { return fESDIndex; }
139   virtual const Text_t* GetName()  const { return Form("ESDcascade_%i",fESDIndex); }
140   virtual const Text_t* GetTitle() const { return Form("ESDcascade_%i",fESDIndex); }
141
142   Float_t GetDCA_v0_Bach() const;
143   Float_t GetCasCosPointingAngle() const;
144   Float_t GetRadius() const;
145   Float_t GetPseudoRapidity() const;
146   Float_t GetPt2() const;
147   Float_t GetPt() const;
148   Float_t GetP2() const;
149   Float_t GetMomentum() const;
150   Float_t GetPx() const;
151   Float_t GetPy() const;
152   Float_t GetPz() const;
153   Float_t GetCasAlphaArmenteros() const;
154   Float_t GetCasPtArmenteros() const;
155   Float_t GetPosP2() const;
156   Float_t GetPosP() const;
157   Float_t GetPosPt() const;
158   Float_t GetPosPseudoRapidity() const;
159   Float_t GetNegP2() const;
160   Float_t GetNegP() const;
161   Float_t GetNegPt() const;
162   Float_t GetNegPseudoRapidity() const;
163   Float_t GetBachP2() const;
164   Float_t GetBachP() const;
165   Float_t GetBachPt() const;
166   Float_t GetBachPseudoRapidity() const;
167
168   Float_t GetV0P2() const;
169   Float_t GetLambdaE() const;
170   Float_t GetXiE() const;
171   Float_t GetOmegaE() const;
172   Float_t GetXiMass() const;
173   Float_t GetAntiXiMass() const;
174   Float_t GetOmegaMass() const;
175   Float_t GetAntiOmegaMass() const;
176
177   ClassDef(AliEveCascade, 1); // Visual representation of a cascade.
178 }; // endclass AliEveCascade
179
180
181
182 //______________________________________________________________________________
183
184 inline void AliEveCascade::SetBeta(Float_t betaNeg, Float_t betaPos, Float_t betaBach) {
185    fBeta_neg = betaNeg;
186    fBeta_pos = betaPos;
187    fBeta_bach = betaBach;
188  }
189
190
191 //______________________________________________________________________________
192
193 inline Float_t AliEveCascade::GetV0P2() const {
194   Float_t px = fP_neg.x + fP_pos.x, py = fP_neg.y + fP_pos.y,
195     pz = fP_neg.z+fP_pos.z;
196   return px*px + py*py + pz*pz;
197 }
198
199
200 inline Float_t AliEveCascade::GetLambdaE() const {
201   return sqrt(fgkMassLambda2+GetV0P2());
202 }
203
204 inline Float_t AliEveCascade::GetXiE() const {
205   Float_t e = GetLambdaE() +
206     sqrt(fgkMassPion2 + fP_bach.x*fP_bach.x + fP_bach.y*fP_bach.y +
207          fP_bach.z*fP_bach.z);
208   return e;
209 }
210
211 inline Float_t AliEveCascade::GetOmegaE() const {
212   Float_t e = GetLambdaE() +
213     sqrt(fgkMassKaon2 + fP_bach.x*fP_bach.x + fP_bach.y*fP_bach.y +
214          fP_bach.z*fP_bach.z);
215   return e;
216 }
217
218 inline Float_t AliEveCascade::GetXiMass() const {
219   Float_t e = GetXiE();
220   return sqrt(e*e - GetP2());
221 }
222
223 inline Float_t AliEveCascade::GetAntiXiMass() const { return GetXiMass();}
224
225 inline Float_t AliEveCascade::GetOmegaMass() const {
226   Float_t e = GetOmegaE();
227   return sqrt(e*e - GetP2());
228 }
229
230 inline Float_t AliEveCascade::GetAntiOmegaMass() const { return GetOmegaMass();}
231
232
233 //______________________________________________________________________________
234
235 inline Float_t AliEveCascade::GetDCA_v0_Bach() const {
236   return fDCA_v0_Bach;
237 }
238
239 inline Float_t AliEveCascade::GetCasCosPointingAngle() const {
240 return fCasCosPointingAngle;
241 }
242
243 inline Float_t AliEveCascade::GetRadius() const {
244   return sqrt(fV_birth.x*fV_birth.x + fV_birth.y*fV_birth.y);
245 }
246
247 //inline Float_t AliEveCascade::GetDecayLength() const {
248 //return fDecayLength;
249 //}
250
251 inline Float_t AliEveCascade::GetPseudoRapidity() const {
252   Float_t theta = acos( GetPz()/GetMomentum() );
253   return ( -log(tan(theta/2.)) );
254 }
255
256
257 //______________________________________________________________________________
258 inline Float_t AliEveCascade::GetPt2() const {
259   Float_t px = GetPx(), py = GetPy();
260   return (px*px+py*py);
261 }
262
263 inline Float_t AliEveCascade::GetP2() const {
264
265   Float_t px = GetPx(), py = GetPy(), pz = GetPz();
266   return (px*px+py*py+pz*pz);
267 }
268
269 inline Float_t AliEveCascade::GetPt() const {
270   return sqrt(GetPt2());
271 }
272
273 inline Float_t AliEveCascade::GetMomentum() const {
274   return sqrt(GetP2());
275 }
276
277 inline Float_t AliEveCascade::GetPx() const {
278   return (fP_neg.x + fP_pos.x + fP_bach.x);
279 }
280
281 inline Float_t AliEveCascade::GetPy() const {
282   return (fP_neg.y + fP_pos.y + fP_bach.y);
283 }
284
285 inline Float_t AliEveCascade::GetPz() const {
286   return (fP_neg.z + fP_pos.z + fP_bach.z);
287 }
288
289 //______________________________________________________________________________
290
291 inline Float_t AliEveCascade::GetPosP2() const {
292   return (fP_pos.x*fP_pos.x + fP_pos.y*fP_pos.y + fP_pos.z*fP_pos.z);
293 }
294
295 inline Float_t AliEveCascade::GetPosP() const {
296   return sqrt(GetPosP2());
297 }
298
299 inline Float_t AliEveCascade::GetPosPt() const {
300   return sqrt(fP_pos.x*fP_pos.x + fP_pos.y*fP_pos.y);
301 }
302
303 inline Float_t AliEveCascade::GetPosPseudoRapidity() const {
304   Float_t theta = acos( fP_pos.z/GetPosP() );
305   return ( -log(tan(theta/2.)) );
306 }
307
308 //______________________________________________________________________________
309 inline Float_t AliEveCascade::GetNegP2() const {
310   return (fP_neg.x*fP_neg.x + fP_neg.y*fP_neg.y + fP_neg.z*fP_neg.z);
311 }
312
313 inline Float_t AliEveCascade::GetNegP() const {
314   return sqrt(GetNegP2());
315 }
316
317 inline Float_t AliEveCascade::GetNegPt() const {
318   return sqrt(fP_neg.x*fP_neg.x + fP_neg.y*fP_neg.y);
319 }
320
321 inline Float_t AliEveCascade::GetNegPseudoRapidity() const {
322   Float_t theta = acos( fP_neg.z/GetNegP() );
323   return ( -log(tan(theta/2.)) );
324 }
325
326
327 //______________________________________________________________________________
328 inline Float_t AliEveCascade::GetBachP2() const {
329   return (fP_bach.x*fP_bach.x + fP_bach.y*fP_bach.y + fP_bach.z*fP_bach.z);
330 }
331
332 inline Float_t AliEveCascade::GetBachP() const {
333   return sqrt(GetBachP2());
334 }
335
336 inline Float_t AliEveCascade::GetBachPt() const {
337   return sqrt(fP_bach.x*fP_bach.x + fP_bach.y*fP_bach.y);
338 }
339
340 inline Float_t AliEveCascade::GetBachPseudoRapidity() const {
341   Float_t theta = acos( fP_bach.z/GetBachP() );
342   return ( -log(tan(theta/2.)) );
343 }
344
345
346 /***********************************************************************
347 *
348 *  CascadeList class
349 *
350 ************************************************************************/
351
352 class CascadeList : public TEveElementList
353 {
354   CascadeList(const CascadeList&);            // Not implemented
355   CascadeList& operator=(const CascadeList&); // Not implemented
356
357 private:
358   void  Init();
359
360 protected:
361   TString              fTitle;
362
363   TEveTrackPropagator *fRnrStyle;
364
365   Bool_t               fRnrBach;
366   Bool_t               fRnrV0Daughters;
367   Bool_t               fRnrV0vtx;
368   Bool_t               fRnrV0path;
369   Bool_t               fRnrCasVtx;
370   Bool_t               fRnrCasPath;
371
372   Color_t              fNegColor;
373   Color_t              fPosColor;
374   Color_t              fBachColor;
375
376   static const Int_t fgkNcutVar = 14;
377   TH1F *fHist[fgkNcutVar];
378   Float_t fMin[fgkNcutVar];
379   Float_t fMax[fgkNcutVar];
380
381   static const Int_t fgkNcutVar2D = 1;
382   TH2F *fHist2D[fgkNcutVar2D];
383   Float_t fMinX[fgkNcutVar2D];
384   Float_t fMinY[fgkNcutVar2D];
385   Float_t fMaxX[fgkNcutVar2D];
386   Float_t fMaxY[fgkNcutVar2D];
387
388 public:
389   CascadeList(TEveTrackPropagator* rs=0);
390   CascadeList(const Text_t* name, TEveTrackPropagator* rs=0);
391
392   virtual const Text_t* GetTitle() const { return fTitle; }
393   virtual void SetTitle(const Text_t* t) { fTitle = t; }
394   virtual void SetTracksColor(Color_t cNeg, Color_t cPos, Color_t cBach)
395   { fNegColor = cNeg; fPosColor = cPos; fBachColor = cBach; }
396
397   virtual Bool_t CanEditMainColor()  { return kTRUE; }
398
399   virtual void Paint(Option_t* option="");
400
401   void  SetRnrStyle(TEveTrackPropagator* rst) { fRnrStyle= rst; }
402   TEveTrackPropagator* GetPropagator()          { return fRnrStyle; }
403
404   Bool_t GetRnrCasVtx() const { return fRnrCasVtx; }
405   Bool_t GetRnrCasPath() const { return fRnrCasPath; }
406   Bool_t GetRnrV0vtx() const { return fRnrV0vtx; }
407   Bool_t GetRnrV0path() const { return fRnrV0path; }
408   Bool_t GetRnrV0Daughters() const { return fRnrV0Daughters; }
409   Bool_t GetRnrBachelor() const { return fRnrBach; }
410
411   void   SetRnrV0vtx(Bool_t);
412   void   SetRnrV0path(Bool_t);
413   void   SetRnrV0Daughters(Bool_t);
414   void   SetRnrBachelor(Bool_t);
415   void   SetRnrCasPath(Bool_t);
416   void   SetRnrCasVtx(Bool_t);
417   void   SetMin(Int_t i, Float_t val) {
418     if ((i>=0)&&(i<fgkNcutVar)) fMin[i]=val;}
419   void   SetMax(Int_t i, Float_t val) {
420     if ((i>=0)&&(i<fgkNcutVar)) fMax[i]=val;}
421
422   void   MakeCascades();
423
424   TH1F*   GetHist(Int_t i) {
425     if ((i>=0)&&(i<fgkNcutVar)) return fHist[i]; else return 0;}
426   TH2F*   GetHist2D(Int_t i) {
427     if ((i>=0)&&(i<fgkNcutVar2D)) return fHist2D[i]; else return 0;}
428   Float_t GetMin(Int_t i) {
429     if ((i>=0)&&(i<fgkNcutVar)) return fMin[i]; else return 0;}
430   Float_t GetMax(Int_t i) {
431     if ((i>=0)&&(i<fgkNcutVar)) return fMax[i]; else return 0;}
432   void GetCasIndexRange(Int_t &imin, Int_t &imax);
433
434   void AdjustHist(Int_t iHist);
435   void UnFill(AliEveCascade* cas);
436   void Filter(AliEveCascade* cas);
437   void FilterAll();
438
439   void XiMassFilter(Float_t min, Float_t max);
440   void OmegaMassFilter(Float_t min, Float_t max);
441   void IndexFilter(Float_t min, Float_t max);
442   void CosPointingFilter(Float_t min, Float_t max);
443   void BachV0DCAFilter(Float_t min, Float_t max);
444   void RadiusFilter(Float_t min, Float_t max);
445   void PtFilter(Float_t min, Float_t max);
446   void PseudoRapFilter(Float_t min, Float_t max);
447   void NegPtFilter(Float_t min, Float_t max);
448   void NegEtaFilter(Float_t min, Float_t max);
449   void PosPtFilter(Float_t min, Float_t max);
450   void PosEtaFilter(Float_t min, Float_t max);
451   void BachPtFilter(Float_t min, Float_t max);
452   void BachEtaFilter(Float_t min, Float_t max);
453
454   //--------------------------------
455
456   ClassDef(CascadeList, 1); // A list of AliEveCascade objects.
457 };
458
459 #endif