]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVE/Alieve/blacklisted-classes/AliEveV0.cxx
Remove trailing whitespace.
[u/mrichter/AliRoot.git] / EVE / Alieve / blacklisted-classes / AliEveV0.cxx
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 /**************************************************************************
10  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
11  *                                                                        *
12  * Author: The ALICE Off-line Project.                                    *
13  * Contributors are mentioned in the code where appropriate.              *
14  *                                                                        *
15  * Permission to use, copy, modify and distribute this software and its   *
16  * documentation strictly for non-commercial purposes is hereby granted   *
17  * without fee, provided that the above copyright notice appears in all   *
18  * copies and that both the copyright notice and this permission notice   *
19  * appear in the supporting documentation. The authors make no claims     *
20  * about the suitability of this software for any purpose. It is          *
21  * provided "as is" without express or implied warranty.                  *
22  **************************************************************************/
23
24
25 /***********************************************************************
26 *  This code defines the reconstructed v0 visualized with EVE
27 *
28 * Ludovic Gaudichet (gaudichet@to.infn.it)
29 ************************************************************************/
30
31 #include "AliEveV0.h"
32
33 #include <TEveTrack.h>
34 #include <MCHelixLine.hi>
35
36 #include <TPolyLine3D.h>
37 #include <TPolyMarker3D.h>
38 #include <TColor.h>
39
40 #include <TEveManager.h>
41 #include <TCanvas.h>
42 #include <TH1F.h>
43 #include <TH2F.h>
44
45 #include <vector>
46
47
48
49 /***********************************************************************
50 *
51 *  AliEveV0 class
52 *
53 ************************************************************************/
54
55 const Float_t AliEveV0::fgkMassPion2 = 0.13956995*0.13956995;
56 const Float_t AliEveV0::fgkMassProton2 = 0.93827231*0.93827231;
57
58 ClassImp(AliEveV0)
59
60 AliEveV0::AliEveV0() :
61   TEveElement(),
62   TPolyMarker3D(1),
63   fV_neg(),
64   fP_neg(),
65   fV_pos(),
66   fP_pos(),
67   fV_v0(),
68   fV0_birth(),
69   fBeta_neg(0),
70   fBeta_pos(0),
71   fLabel_neg(0),
72   fLabel_pos(0),
73   fPathMarksNeg(),
74   fPathMarksPos(),
75   fRnrStyle(0),
76   fPolyLineNeg(),
77   fPolyLinePos(),
78   fPolyLineV0(),
79   fESDIndex(-1),
80   fDaughterDCA(999),
81   fCosPointingAngle(999),
82   fDecayLength(0)
83 {}
84
85
86 AliEveV0::AliEveV0(TEveRecTrack* tNeg, TEveRecTrack* tPos,
87        TEveRecV0* v0, TEveTrackPropagator* rs) :
88   TEveElement(),
89   TPolyMarker3D(1),
90   fV_neg(v0->V_neg),
91   fP_neg(v0->P_neg ),
92   fV_pos(v0->V_pos ),
93   fP_pos(v0->P_pos),
94   fV_v0(v0->V_ca),
95   fV0_birth(v0->V0_birth),
96   fBeta_neg(tNeg->beta),
97   fBeta_pos(tPos->beta),
98   fLabel_neg(v0->d_label[0]),
99   fLabel_pos(v0->d_label[1]),
100   fPathMarksNeg(),
101   fPathMarksPos(),
102   fRnrStyle(rs),
103   fPolyLineNeg(),
104   fPolyLinePos(),
105   fPolyLineV0(),
106   fESDIndex(-1),
107   fDaughterDCA(999),
108   fCosPointingAngle(999),
109   fDecayLength(0)
110 {
111   fPolyLineV0.SetLineColor(fMarkerColor);
112   fPolyLinePos.SetLineColor(2);  // red
113   fPolyLineNeg.SetLineColor(7);  // light blue
114
115   fMainColorPtr = &fMarkerColor;
116   fMarkerStyle = 20;
117   fMarkerColor = 5;
118   fMarkerSize = 0.3;
119 }
120
121
122 AliEveV0::~AliEveV0()
123 {
124   for (vpPathMark_i i=fPathMarksNeg.begin(); i!=fPathMarksNeg.end(); ++i)
125     delete *i;
126   for (vpPathMark_i i=fPathMarksPos.begin(); i!=fPathMarksPos.end(); ++i)
127     delete *i;
128 }
129
130
131 void AliEveV0::Reset(TPolyLine3D* polyLine) {
132   //polyLine->SetPolyLine(n_points);
133   polyLine->SetPolyLine(0);
134 }
135
136 //______________________________________________________________________
137 void AliEveV0::SetDecayLength(Float_t primx, Float_t primy, Float_t primz) {
138
139   Float_t dx = fV_v0.x-primx;
140   Float_t dy = fV_v0.y-primy;
141   Float_t dz = fV_v0.z-primz;
142
143   fDecayLength = sqrt(dx*dx+dy*dy+dz*dz);
144
145   // This is probably wrong but I can only do this for now
146   Float_t distNorm = fDecayLength/GetMomentum();
147   fV0_birth.x = fV_v0.x - distNorm*GetPx();
148   fV0_birth.y = fV_v0.y - distNorm*GetPy();
149   fV0_birth.z = fV_v0.z - distNorm*GetPz();
150 }
151
152
153
154 //______________________________________________________________________
155 void AliEveV0::MakeTrack(vpPathMark_t& pathMark, TEveVector& vtx,  TEveVector& p,
156                    Int_t charge, Float_t beta, TPolyLine3D& polyLine) {
157
158   TEveTrackPropagator& RS((fRnrStyle != 0) ? *fRnrStyle : TEveTrackPropagator::fgDefStyle);
159
160   Float_t px = p.x, py = p.y, pz = p.z;
161
162   MCVertex  mc_v0;
163   mc_v0.x = vtx.x;
164   mc_v0.y = vtx.y;
165   mc_v0.z = vtx.z;
166   mc_v0.t = 0;
167
168   std::vector<MCVertex> track_points;
169   Bool_t decay = kFALSE;
170
171   if ((TMath::Abs(vtx.z) > RS.fMaxZ) || (vtx.x*vtx.x + vtx.y*vtx.y > RS.fMaxR*RS.fMaxR))
172     goto make_polyline;
173
174   if (TMath::Abs(RS.fMagField) > 1e-5) {
175
176     // Charged particle in magnetic field
177
178     Float_t a = RS.fgkB2C * RS.fMagField * charge;
179
180     MCHelix helix(fRnrStyle, &mc_v0, TMath::C()*beta, &track_points, a); //m->cm
181     helix.Init(TMath::Sqrt(px*px+py*py), pz);
182
183     if(!pathMark.empty()){
184       for(std::vector<TEvePathMark*>::iterator i=pathMark.begin();
185           i!=pathMark.end(); ++i) {
186
187         TEvePathMark* pm = *i;
188
189         if(RS.fFitDaughters &&  pm->type == TEvePathMark::Daughter){
190           if(TMath::Abs(pm->V.z) > RS.fMaxZ
191              || TMath::Sqrt(pm->V.x*pm->V.x + pm->V.y*pm->V.y) > RS.fMaxR )
192             goto helix_bounds;
193
194           //printf("%s fit daughter  \n", fName.Data());
195           helix.LoopToVertex(p.x, p.y, p.z, pm->V.x, pm->V.y, pm->V.z);
196           p.x -=  pm->P.x;
197           p.y -=  pm->P.y;
198           p.z -=  pm->P.z;
199         }
200         if(RS.fFitDecay &&  pm->type == TEvePathMark::Decay){
201
202           if(TMath::Abs(pm->V.z) > RS.fMaxZ
203              || TMath::Sqrt(pm->V.x*pm->V.x + pm->V.y*pm->V.y) > RS.fMaxR )
204             goto helix_bounds;
205           helix.LoopToVertex(p.x, p.y, p.z, pm->V.x, pm->V.y, pm->V.z);
206           decay = true;
207           break;
208         }
209       }
210     }
211   helix_bounds:
212     //go to bounds
213     if(!decay || RS.fFitDecay == kFALSE){
214       helix.LoopToBounds(px,py,pz);
215       // printf("%s loop to bounds  \n",fName.Data() );
216     }
217
218   } else {
219
220     // Neutral particle or no field
221
222     MCLine line(fRnrStyle, &mc_v0, TMath::C()*beta, &track_points);
223
224     if(!pathMark.empty()) {
225       for(std::vector<TEvePathMark*>::iterator i=pathMark.begin();
226           i!=pathMark.end(); ++i) {
227         TEvePathMark* pm = *i;
228
229         if(RS.fFitDaughters &&  pm->type == TEvePathMark::Daughter){
230           if(TMath::Abs(pm->V.z) > RS.fMaxZ
231              || TMath::Sqrt(pm->V.x*pm->V.x + pm->V.y*pm->V.y) > RS.fMaxR )
232             goto line_bounds;
233           line.GotoVertex(pm->V.x, pm->V.y, pm->V.z);
234           p.x -=  pm->P.x;
235           p.y -=  pm->P.y;
236           p.z -=  pm->P.z;
237         }
238
239         if(RS.fFitDecay &&  pm->type == TEvePathMark::Decay){
240           if(TMath::Abs(pm->V.z) > RS.fMaxZ
241              || TMath::Sqrt(pm->V.x*pm->V.x + pm->V.y*pm->V.y) > RS.fMaxR )
242             goto line_bounds;
243           line.GotoVertex(pm->V.x, pm->V.y, pm->V.z);
244           decay = true;
245           break;
246         }
247       }
248     }
249
250   line_bounds:
251     if(!decay || RS.fFitDecay == kFALSE)
252       line.GotoBounds(px,py,pz);
253
254   }
255 make_polyline:
256   Reset(&polyLine);
257   for(std::vector<MCVertex>::iterator i=track_points.begin();
258       i!=track_points.end(); ++i) {
259     polyLine.SetNextPoint(i->x,i->y, i->z);
260   }
261
262 }
263
264
265 //______________________________________________________________________
266 void AliEveV0::MakeV0path() {
267
268   MCVertex  mc_v0;
269   mc_v0.x = fV_v0.x;
270   mc_v0.y = fV_v0.y;
271   mc_v0.z = fV_v0.z;
272   mc_v0.t = 0;
273
274   std::vector<MCVertex> track_points;
275   MCLine line(fRnrStyle, &mc_v0, TMath::C()*0.99, &track_points);
276
277  line.GotoVertex(fV0_birth.x,fV0_birth.y,fV0_birth.z);
278
279   Reset(&fPolyLineV0);
280   for(std::vector<MCVertex>::iterator i=track_points.begin();
281       i!=track_points.end(); ++i) {
282     fPolyLineV0.SetNextPoint(i->x,i->y, i->z);
283   }
284 }
285
286
287 //______________________________________________________________________
288 void AliEveV0::MakeV0()
289 {
290   SetNextPoint(fV_v0.x, fV_v0.y, fV_v0.z);
291   MakeTrack(fPathMarksNeg, fV_neg, fP_neg, -1, fBeta_neg, fPolyLineNeg);
292   MakeTrack(fPathMarksPos, fV_pos, fP_pos,  1, fBeta_pos, fPolyLinePos);
293   MakeV0path();
294   //fN = fPolyLineNeg.GetN();
295 }
296
297
298 //______________________________________________________________________
299 Float_t AliEveV0::GetAlphaArmenteros() const
300 {
301   Float_t  posXv0 = fP_pos.x*GetPx() + fP_pos.y*GetPy() + fP_pos.z*GetPz();
302   Float_t  negXv0 = fP_neg.x*GetPx() + fP_neg.y*GetPy() + fP_neg.z*GetPz();
303
304   if (posXv0+negXv0 > 1.e-39)
305     return (posXv0-negXv0)/(posXv0+negXv0);
306   else return -999;
307 }
308
309 //______________________________________________________________________
310 Float_t AliEveV0::GetPtArmenteros() const
311 {
312   Float_t  posXv0 = fP_pos.x*GetPx() + fP_pos.y*GetPy() + fP_pos.z*GetPz();
313   Float_t  v0mom2  = GetP2();
314
315   if (v0mom2 > 1.e-39)
316     return  TMath::Sqrt( GetPosP2() - posXv0*posXv0/v0mom2 ) ;
317   else return -999;
318 }
319
320
321
322 /***********************************************************************
323 *
324 *  V0List class
325 *
326 ************************************************************************/
327
328 ClassImp(V0List)
329
330 //______________________________________________________________________
331 V0List::V0List() :
332   TEveElementList(),
333   fTitle(),
334   fRnrStyle(0),
335   fRnrDaughters(kTRUE),
336   fRnrV0vtx(kTRUE),
337   fRnrV0path(kTRUE),
338   fNegColor(0),
339   fPosColor(0)
340 {
341   fChildClass = AliEveV0::Class(); // override member from base TEveElementList
342
343   for (Int_t i=0; i<fgkNcutVar; i++)
344     fHist[i] = 0;
345   for (Int_t i=0; i<fgkNcutVar2D; i++)
346     fHist2D[i] = 0;
347 }
348
349 //______________________________________________________________________
350 V0List::V0List(TEveTrackPropagator* rs) :
351   TEveElementList(),
352   fTitle(),
353   fRnrStyle(rs),
354   fRnrDaughters(kTRUE),
355   fRnrV0vtx(kTRUE),
356   fRnrV0path(kTRUE),
357   fNegColor(0),
358   fPosColor(0)
359 {
360   fChildClass = AliEveV0::Class(); // override member from base TEveElementList
361
362   Init();
363 }
364
365 //______________________________________________________________________
366 V0List::V0List(const Text_t* name, TEveTrackPropagator* rs) :
367   TEveElementList(),
368   fTitle(),
369   fRnrStyle(rs),
370   fRnrDaughters(kTRUE),
371   fRnrV0vtx(kTRUE),
372   fRnrV0path(kTRUE),
373   fNegColor(0),
374   fPosColor(0)
375 {
376   fChildClass = AliEveV0::Class(); // override member from base TEveElementList
377
378   Init();
379   SetName(name);
380 }
381
382 //______________________________________________________________________
383 void V0List::Init()
384 {
385   if (fRnrStyle== 0) fRnrStyle = new TEveTrackPropagator;
386
387   fMin[0]  = 0;   fMax[0] = 10; // pt
388   fMin[1]  = 0;   fMax[1] = 10; // K0s mass
389   fMin[2]  = 0;   fMax[2] = 10; // lambda mass
390   fMin[3]  = 0;   fMax[3] = 10; // anti-lambda mass
391   fMin[4]  = 0;   fMax[4] = 10; // daughter DCA
392   fMin[5]  = 0.8; fMax[5] = 1;  // cos of pointing angle
393
394   fMin[6]  =  0;   fMax[6] = 200;  // radius
395   fMin[7]  = -2;   fMax[7] =   2;  // PseudoRapidity
396   fMin[8]  =  0;   fMax[8] =  10;  // NegPt
397   fMin[9]  = -2;   fMax[9] =   2;  // NegPseudoRapidity
398   fMin[10] =  0;   fMax[10] = 10;  // PosPt
399   fMin[11] = -2;   fMax[11] =  2;  // PosPseudoRapidity
400   fMin[12] =  0;   fMax[12] =  1e5;  // index, would be good to be able to adjust it
401
402   char *ch = "ptV0";
403   fHist[0] = new TH1F(ch,ch, 100, fMin[0], fMax[0]);
404   ch = "K0sMass";
405   fHist[1] = new TH1F(ch,ch, 100, fMin[1], fMax[1]);
406   ch = "LambdaMass";
407   fHist[2] = new TH1F(ch,ch, 100, fMin[2], fMax[2]);
408   ch = "AntiLambdaMass";
409   fHist[3] = new TH1F(ch,ch, 100, fMin[3], fMax[3]);
410   ch = "daughterDCA";
411   fHist[4] = new TH1F(ch,ch, 100, fMin[4], fMax[4]);
412   ch = "cosPointingAngle";
413   fHist[5] = new TH1F(ch,ch, 100, fMin[5], fMax[5]);
414   ch = "radius";
415   fHist[6] = new TH1F(ch,ch, 100, fMin[6], fMax[6]);
416   ch = "PseudoRapidity";
417   fHist[7] = new TH1F(ch,ch, 100, fMin[7], fMax[7]);
418
419   ch = "NegPt";
420   fHist[8] = new TH1F(ch,ch, 100, fMin[8], fMax[8]);
421   ch = "NegPseudoRapidity";
422   fHist[9] = new TH1F(ch,ch, 100, fMin[9], fMax[9]);
423   ch = "PosPt";
424   fHist[10] = new TH1F(ch,ch, 100, fMin[10], fMax[10]);
425   ch = "PosPseudoRapidity";
426   fHist[11] = new TH1F(ch,ch, 100, fMin[11], fMax[11]);
427   ch = "v0Index";
428   fHist[12] = new TH1F(ch,ch, 100, fMin[12], fMax[12]);
429
430
431   fMinX[0] = -1.2;
432   fMaxX[0] = 1.2;
433   fMinY[0] = 0;
434   fMaxY[0] = 0.4;
435   ch = "ArmenterosPodolansky";
436   fHist2D[0] = new TH2F(ch,ch, 70, fMinX[0], fMaxX[0], 70,
437                         fMinY[0], fMaxY[0]);
438
439   for (Int_t i=0; i<fgkNcutVar; i++) {
440     fHist[i]->GetXaxis()->SetLabelSize(0.07);
441     fHist[i]->GetYaxis()->SetLabelSize(0.07);
442     fHist[i]->SetStats(0);
443   }
444   for (Int_t i=0; i<fgkNcutVar2D; i++) {
445     fHist2D[i]->GetXaxis()->SetLabelSize(0.07);
446     fHist2D[i]->GetYaxis()->SetLabelSize(0.07);
447     fHist2D[i]->SetStats(0);
448   }
449 }
450
451 //______________________________________________________________________
452 V0List::~V0List() {
453
454   for (Int_t i=0; i<fgkNcutVar; i++)
455     if (fHist[i]) delete fHist[i];
456   for (Int_t i=0; i<fgkNcutVar2D; i++)
457     if (fHist2D[i]) delete fHist2D[i];
458
459 }
460
461 //______________________________________________________________________
462 void V0List::Paint(Option_t* option) {
463   if(fRnrSelf) {
464
465     if(fRnrV0vtx) {
466       for(List_i i=fChildren.begin(); i!=fChildren.end(); ++i) {
467         if((*i)->GetRnrSelf()) {
468           ((AliEveV0*)(*i))->Paint(option);
469         }
470       }
471     }
472
473     if(fRnrDaughters) {
474       for(List_i i=fChildren.begin(); i!=fChildren.end(); ++i) {
475         if((*i)->GetRnrSelf()) {
476           ((AliEveV0*)(*i))->PaintDaughters(option);
477         }
478       }
479     }
480
481     if(fRnrV0path) {
482       for(List_i i=fChildren.begin(); i!=fChildren.end(); ++i) {
483         if((*i)->GetRnrSelf()) {
484           ((AliEveV0*)(*i))->PaintPath(option);
485         }
486       }
487     }
488   }
489 }
490
491
492 //______________________________________________________________________
493
494 void V0List::SetRnrV0vtx(Bool_t rnr) {
495   fRnrV0vtx = rnr;
496   gEve->Redraw3D();
497 }
498
499 void V0List::SetRnrV0path(Bool_t rnr) {
500   fRnrV0path = rnr;
501   gEve->Redraw3D();
502 }
503
504 void V0List::SetRnrDaughters(Bool_t rnr) {
505   fRnrDaughters = rnr;
506   gEve->Redraw3D();
507 }
508
509
510 //______________________________________________________________________
511
512 void V0List::MakeV0s() {
513   for(List_i i=fChildren.begin(); i!=fChildren.end(); ++i) {
514     ((AliEveV0*)(*i))->MakeV0();
515   }
516   gEve->Redraw3D();
517 }
518
519
520 void V0List::MakeMarkers() {
521   gEve->Redraw3D();
522 }
523
524
525 //_________________________________________________________________________
526 void V0List::AdjustHist(Int_t iHist) {
527
528   if ((iHist<0)||(iHist>=fgkNcutVar)) return;
529   if (! fHist[iHist]) return;
530
531   TString name = fHist[iHist]->GetName();
532   Int_t nBin = fHist[iHist]->GetXaxis()->GetNbins();
533   delete fHist[iHist];
534   fHist[iHist] = new TH1F(name.Data(), name.Data(), nBin, GetMin(iHist),
535                           GetMax(iHist));
536   fHist[iHist]->GetXaxis()->SetLabelSize(0.07);
537   fHist[iHist]->GetYaxis()->SetLabelSize(0.07);
538   fHist[iHist]->SetStats(0);
539
540 }
541
542
543 //______________________________________________________________________
544 void V0List::UnFill(AliEveV0* v0) {
545
546     Int_t bin = fHist[0]->GetXaxis()->FindBin(v0->GetPt());
547     fHist[0]->SetBinContent( bin, fHist[0]->GetBinContent(bin)-1 );
548
549     bin = fHist[1]->GetXaxis()->FindBin( v0->GetK0mass() );
550     fHist[1]->SetBinContent( bin, fHist[1]->GetBinContent(bin)-1 );
551
552     bin = fHist[2]->GetXaxis()->FindBin( v0->GetLamMass() );
553     fHist[2]->SetBinContent( bin, fHist[2]->GetBinContent(bin)-1 );
554
555     bin = fHist[3]->GetXaxis()->FindBin( v0->GetAntiLamMass() );
556     fHist[3]->SetBinContent( bin, fHist[3]->GetBinContent(bin)-1 );
557
558     bin = fHist[4]->GetXaxis()->FindBin( v0->GetDaughterDCA() );
559     fHist[4]->SetBinContent( bin, fHist[4]->GetBinContent(bin)-1 );
560
561     bin = fHist[5]->GetXaxis()->FindBin( v0->GetCosPointingAngle() );
562     fHist[5]->SetBinContent( bin, fHist[5]->GetBinContent(bin)-1 );
563
564
565     bin = fHist[6]->GetXaxis()->FindBin( v0->GetRadius() );// radius
566     fHist[6]->SetBinContent( bin, fHist[6]->GetBinContent(bin)-1 );
567
568     bin = fHist[7]->GetXaxis()->FindBin( v0->GetPseudoRapidity() ); // PseudoRapidity
569     fHist[7]->SetBinContent( bin, fHist[7]->GetBinContent(bin)-1 );
570
571     bin = fHist[8]->GetXaxis()->FindBin( v0->GetNegPt() );// NegPt
572     fHist[8]->SetBinContent( bin, fHist[8]->GetBinContent(bin)-1 );
573
574     bin = fHist[9]->GetXaxis()->FindBin( v0->GetNegPseudoRapidity() );// NegPseudoRapidity
575     fHist[9]->SetBinContent( bin, fHist[9]->GetBinContent(bin)-1 );
576
577     bin = fHist[10]->GetXaxis()->FindBin( v0->GetPosPt() ); // PosPt
578     fHist[10]->SetBinContent( bin, fHist[10]->GetBinContent(bin)-1 );
579
580     bin = fHist[11]->GetXaxis()->FindBin( v0->GetPosPseudoRapidity() ); // PosPseudoRapidity
581     fHist[11]->SetBinContent( bin, fHist[11]->GetBinContent(bin)-1 );
582
583     bin = fHist[12]->GetXaxis()->FindBin( v0->GetESDIndex() ); // ESD index
584     fHist[12]->SetBinContent( bin, fHist[12]->GetBinContent(bin)-1 );
585
586     //---
587           bin  = fHist2D[0]->GetXaxis()->FindBin( v0->GetAlphaArmenteros() );
588     Int_t binY = fHist2D[0]->GetYaxis()->FindBin( v0->GetPtArmenteros() );
589     fHist2D[0]->SetBinContent( bin, binY, fHist2D[0]->GetBinContent(bin,binY)-1 );
590 }
591
592
593 //______________________________________________________________________
594 void V0List::Filter(AliEveV0* v0) {
595
596   Float_t pt = v0->GetPt();
597   if ((pt<fMin[0])||(pt>fMax[0])) return;
598
599   Float_t k0sMass = v0->GetK0mass();
600   if ( (k0sMass<fMin[1])||(k0sMass>fMax[1]) ) return;
601
602   Float_t lamMass = v0->GetLamMass();
603   if ( (lamMass<fMin[2])||(lamMass>fMax[2]) ) return;
604
605   Float_t alamMass = v0->GetAntiLamMass();
606   if ( (alamMass<fMin[3])||(alamMass>fMax[3]) ) return;
607
608   Float_t daughtDCA = v0->GetDaughterDCA();
609   if ( (daughtDCA<fMin[4])||(daughtDCA>fMax[4]) ) return;
610
611   Float_t cosPointing = v0->GetCosPointingAngle();
612   if ( (cosPointing<fMin[5])||(cosPointing>fMax[5]) ) return;
613
614
615   Float_t radius = v0->GetRadius();
616   if ( (radius<fMin[6])||(radius>fMax[6]) ) return;
617
618   Float_t pseudoRapidity = v0->GetPseudoRapidity();
619   if ( (pseudoRapidity<fMin[7])||(pseudoRapidity>fMax[7]) ) return;
620
621   Float_t negPt = v0->GetNegPt();
622   if ( (negPt<fMin[8])||(negPt>fMax[8]) ) return;
623
624   Float_t negPseudoRapidity = v0->GetNegPseudoRapidity();
625   if ( (negPseudoRapidity<fMin[9])||(negPseudoRapidity>fMax[9]) ) return;
626
627   Float_t posPt = v0->GetPosPt();
628   if ( (posPt<fMin[10])||(posPt>fMax[10]) ) return;
629
630   Float_t posPseudoRapidity = v0->GetPosPseudoRapidity();
631   if ( (posPseudoRapidity<fMin[11])||(posPseudoRapidity>fMax[11]) ) return;
632
633    Float_t esdIndex = v0->GetESDIndex();
634    if ( (esdIndex<fMin[12])||(esdIndex>fMax[12]) ) return;
635
636    Float_t alphaArm = v0->GetAlphaArmenteros();
637 //   if ( (alphaArm<fMinX[0])||(alphaArm>fMaxX[0]) ) return;
638
639    Float_t ptArm = v0->GetPtArmenteros();
640 //   if ( (ptArm<fMinY[0])||(ptArm>fMaxY[0]) ) return;
641
642   v0->SetRnrSelf(kTRUE);
643   fHist[0]->Fill(pt);
644   fHist[1]->Fill(k0sMass);
645   fHist[2]->Fill(lamMass);
646   fHist[3]->Fill(alamMass);
647   fHist[4]->Fill(daughtDCA);
648   fHist[5]->Fill(cosPointing);
649   fHist[6]->Fill(radius);
650   fHist[7]->Fill(pseudoRapidity);
651   fHist[8]->Fill(negPt);
652   fHist[9]->Fill(negPseudoRapidity);
653   fHist[10]->Fill(posPt);
654   fHist[11]->Fill(posPseudoRapidity);
655   fHist[12]->Fill(esdIndex);
656   fHist2D[0]->Fill(alphaArm, ptArm);
657 }
658
659 //______________________________________________________________________
660 void V0List::FilterAll() {
661
662   for (Int_t i=0; i<fgkNcutVar; i++)
663     fHist[i]->Reset();
664
665   for (Int_t i=0; i<fgkNcutVar2D; i++)
666     fHist2D[i]->Reset();
667
668   AliEveV0* myV0;
669   for(List_i i=fChildren.begin(); i!=fChildren.end(); ++i) {
670
671     myV0 = (AliEveV0*)(*i);
672     Filter(myV0);
673   }
674 }
675
676
677 //______________________________________________________________________
678 void V0List::GetV0IndexRange(Int_t &imin, Int_t &imax) {
679
680   Int_t index;
681   AliEveV0* myV0;
682   List_i i=fChildren.begin();
683   myV0 = (AliEveV0*)(*i);
684   index = myV0->GetESDIndex();
685   imin = index;
686   imax = index;
687
688   for(; i!=fChildren.end(); ++i) {
689
690     myV0 = (AliEveV0*)(*i);
691     index = myV0->GetESDIndex();
692     if (index<imin) imin = index;
693     if (index>imax) imax = index;
694   }
695 }
696
697
698 //______________________________________________________________________
699 void V0List::PtFilter(Float_t min, Float_t max) {
700
701   fMin[0] = min;
702   fMax[0] = max;
703
704   Float_t val;
705   Bool_t wasSelected;
706   Bool_t isSelected;
707   AliEveV0* myV0;
708
709   for(List_i i=fChildren.begin(); i!=fChildren.end(); ++i) {
710
711     myV0 = (AliEveV0*)(*i);
712     val = myV0->GetPt();
713     wasSelected = myV0->GetRnrSelf();
714     isSelected = ( (val>=min) && (val<=max) );
715
716     if (wasSelected) {
717       if (! isSelected) {
718         UnFill(myV0);
719         myV0->SetRnrSelf(isSelected);
720       }
721     } else {
722       if (isSelected) Filter(myV0);
723     }
724   }
725 }
726
727
728 //______________________________________________________________________
729 void V0List::K0sMFilter(Float_t min, Float_t max) {
730
731   fMin[1] = min;
732   fMax[1] = max;
733
734   Float_t val;
735   Bool_t wasSelected;
736   Bool_t isSelected;
737   AliEveV0* myV0;
738
739   for(List_i i=fChildren.begin(); i!=fChildren.end(); ++i) {
740
741     myV0 = (AliEveV0*)(*i);
742     val = myV0->GetK0mass();
743     wasSelected = myV0->GetRnrSelf();
744     isSelected = ( (val>=min) && (val<=max) );
745
746     if (wasSelected) {
747       if (! isSelected) {
748         UnFill(myV0);
749         myV0->SetRnrSelf(isSelected);
750       }
751     } else {
752       if (isSelected) Filter(myV0);
753     }
754   }
755 }
756
757 //______________________________________________________________________
758 void V0List::LamMFilter(Float_t min, Float_t max) {
759
760   fMin[2] = min;
761   fMax[2] = max;
762
763   Float_t val;
764   Bool_t wasSelected;
765   Bool_t isSelected;
766   AliEveV0* myV0;
767
768   for(List_i i=fChildren.begin(); i!=fChildren.end(); ++i) {
769
770     myV0 = (AliEveV0*)(*i);
771     val = myV0->GetLamMass();
772     wasSelected = myV0->GetRnrSelf();
773     isSelected = ( (val>=min) && (val<=max) );
774
775     if (wasSelected) {
776       if (! isSelected) {
777         UnFill(myV0);
778         myV0->SetRnrSelf(isSelected);
779       }
780     } else {
781       if (isSelected) Filter(myV0);
782     }
783   }
784 }
785
786
787
788 //______________________________________________________________________
789 void V0List::ALamMFilter(Float_t min, Float_t max) {
790
791   fMin[3] = min;
792   fMax[3] = max;
793
794   Float_t val;
795   Bool_t wasSelected;
796   Bool_t isSelected;
797   AliEveV0* myV0;
798
799   for(List_i i=fChildren.begin(); i!=fChildren.end(); ++i) {
800
801     myV0 = (AliEveV0*)(*i);
802     val = myV0->GetAntiLamMass();
803     wasSelected = myV0->GetRnrSelf();
804     isSelected = ( (val>=min) && (val<=max) );
805
806     if (wasSelected) {
807       if (! isSelected) {
808         UnFill(myV0);
809         myV0->SetRnrSelf(isSelected);
810       }
811     } else {
812       if (isSelected) Filter(myV0);
813     }
814   }
815 }
816
817 //______________________________________________________________________
818 void V0List::CosPointingFilter(Float_t min, Float_t max) {
819
820   fMin[5] = min;
821   fMax[5] = max;
822
823   Float_t val;
824   Bool_t wasSelected;
825   Bool_t isSelected;
826   AliEveV0* myV0;
827
828   for(List_i i=fChildren.begin(); i!=fChildren.end(); ++i) {
829
830     myV0 = (AliEveV0*)(*i);
831     val = myV0->GetCosPointingAngle();
832     wasSelected = myV0->GetRnrSelf();
833     isSelected = ( (val>=min) && (val<=max) );
834
835     if (wasSelected) {
836       if (! isSelected) {
837         UnFill(myV0);
838         myV0->SetRnrSelf(isSelected);
839       }
840     } else {
841       if (isSelected) Filter(myV0);
842     }
843   }
844 }
845
846 //______________________________________________________________________
847 void V0List::DaughterDCAFilter(Float_t min, Float_t max) {
848
849   fMin[4] = min;
850   fMax[4] = max;
851
852   Float_t val;
853   Bool_t wasSelected;
854   Bool_t isSelected;
855   AliEveV0* myV0;
856
857   for(List_i i=fChildren.begin(); i!=fChildren.end(); ++i) {
858
859     myV0 = (AliEveV0*)(*i);
860     val = myV0->GetDaughterDCA();
861     wasSelected = myV0->GetRnrSelf();
862     isSelected = ( (val>=min) && (val<=max) );
863
864     if (wasSelected) {
865       if (! isSelected) {
866         UnFill(myV0);
867         myV0->SetRnrSelf(isSelected);
868       }
869     } else {
870       if (isSelected) Filter(myV0);
871     }
872   }
873 }
874
875 //______________________________________________________________________
876 void V0List::RadiusFilter(Float_t min, Float_t max) {
877
878   fMin[6] = min;
879   fMax[6] = max;
880
881   Float_t val;
882   Bool_t wasSelected;
883   Bool_t isSelected;
884   AliEveV0* myV0;
885
886   for(List_i i=fChildren.begin(); i!=fChildren.end(); ++i) {
887
888     myV0 = (AliEveV0*)(*i);
889     val = myV0->GetRadius();
890     wasSelected = myV0->GetRnrSelf();
891     isSelected = ( (val>=min) && (val<=max) );
892
893     if (wasSelected) {
894       if (! isSelected) {
895         UnFill(myV0);
896         myV0->SetRnrSelf(isSelected);
897       }
898     } else {
899       if (isSelected) Filter(myV0);
900     }
901   }
902 }
903
904 //______________________________________________________________________
905 void V0List::EtaFilter(Float_t min, Float_t max) {
906
907   fMin[7] = min;
908   fMax[7] = max;
909
910   Float_t val;
911   Bool_t wasSelected;
912   Bool_t isSelected;
913   AliEveV0* myV0;
914
915   for(List_i i=fChildren.begin(); i!=fChildren.end(); ++i) {
916
917     myV0 = (AliEveV0*)(*i);
918     val = myV0->GetPseudoRapidity();
919     wasSelected = myV0->GetRnrSelf();
920     isSelected = ( (val>=min) && (val<=max) );
921
922     if (wasSelected) {
923       if (! isSelected) {
924         UnFill(myV0);
925         myV0->SetRnrSelf(isSelected);
926       }
927     } else {
928       if (isSelected) Filter(myV0);
929     }
930   }
931 }
932
933 //______________________________________________________________________
934 void V0List::NegPtFilter(Float_t min, Float_t max) {
935
936   fMin[8] = min;
937   fMax[8] = max;
938
939   Float_t val;
940   Bool_t wasSelected;
941   Bool_t isSelected;
942   AliEveV0* myV0;
943
944   for(List_i i=fChildren.begin(); i!=fChildren.end(); ++i) {
945
946     myV0 = (AliEveV0*)(*i);
947     val = myV0->GetNegPt();
948     wasSelected = myV0->GetRnrSelf();
949     isSelected = ( (val>=min) && (val<=max) );
950
951     if (wasSelected) {
952       if (! isSelected) {
953         UnFill(myV0);
954         myV0->SetRnrSelf(isSelected);
955       }
956     } else {
957       if (isSelected) Filter(myV0);
958     }
959   }
960 }
961
962 //______________________________________________________________________
963 void V0List::NegEtaFilter(Float_t min, Float_t max) {
964
965   fMin[9] = min;
966   fMax[9] = max;
967
968   Float_t val;
969   Bool_t wasSelected;
970   Bool_t isSelected;
971   AliEveV0* myV0;
972
973   for(List_i i=fChildren.begin(); i!=fChildren.end(); ++i) {
974
975     myV0 = (AliEveV0*)(*i);
976     val = myV0->GetNegPseudoRapidity();
977     wasSelected = myV0->GetRnrSelf();
978     isSelected = ( (val>=min) && (val<=max) );
979
980     if (wasSelected) {
981       if (! isSelected) {
982         UnFill(myV0);
983         myV0->SetRnrSelf(isSelected);
984       }
985     } else {
986       if (isSelected) Filter(myV0);
987     }
988   }
989 }
990
991 //______________________________________________________________________
992 void V0List::PosPtFilter(Float_t min, Float_t max) {
993
994   fMin[10] = min;
995   fMax[10] = max;
996
997   Float_t val;
998   Bool_t wasSelected;
999   Bool_t isSelected;
1000   AliEveV0* myV0;
1001
1002   for(List_i i=fChildren.begin(); i!=fChildren.end(); ++i) {
1003
1004     myV0 = (AliEveV0*)(*i);
1005     val = myV0->GetPosPt();
1006     wasSelected = myV0->GetRnrSelf();
1007     isSelected = ( (val>=min) && (val<=max) );
1008
1009     if (wasSelected) {
1010       if (! isSelected) {
1011         UnFill(myV0);
1012         myV0->SetRnrSelf(isSelected);
1013       }
1014     } else {
1015       if (isSelected) Filter(myV0);
1016     }
1017   }
1018 }
1019
1020 //______________________________________________________________________
1021 void V0List::PosEtaFilter(Float_t min, Float_t max) {
1022
1023   fMin[11] = min;
1024   fMax[11] = max;
1025
1026   Float_t val;
1027   Bool_t wasSelected;
1028   Bool_t isSelected;
1029   AliEveV0* myV0;
1030
1031   for(List_i i=fChildren.begin(); i!=fChildren.end(); ++i) {
1032
1033     myV0 = (AliEveV0*)(*i);
1034     val = myV0->GetPosPseudoRapidity();
1035     wasSelected = myV0->GetRnrSelf();
1036     isSelected = ( (val>=min) && (val<=max) );
1037
1038     if (wasSelected) {
1039       if (! isSelected) {
1040         UnFill(myV0);
1041         myV0->SetRnrSelf(isSelected);
1042       }
1043     } else {
1044       if (isSelected) Filter(myV0);
1045     }
1046   }
1047 }
1048
1049 //______________________________________________________________________
1050 void V0List::IndexFilter(Float_t min, Float_t max) {
1051
1052   fMin[12] = min;
1053   fMax[12] = max;
1054
1055   Float_t val;
1056   Bool_t wasSelected;
1057   Bool_t isSelected;
1058   AliEveV0* myV0;
1059
1060   for(List_i i=fChildren.begin(); i!=fChildren.end(); ++i) {
1061
1062     myV0 = (AliEveV0*)(*i);
1063     val = myV0->GetESDIndex();
1064     wasSelected = myV0->GetRnrSelf();
1065     isSelected = ( (val>=min) && (val<=max) );
1066
1067     if (wasSelected) {
1068       if (! isSelected) {
1069         UnFill(myV0);
1070         myV0->SetRnrSelf(isSelected);
1071       }
1072     } else {
1073       if (isSelected) Filter(myV0);
1074     }
1075   }
1076 }
1077