]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGCF/FEMTOSCOPY/AliFemto/AliFemtoV0PairCut.cxx
Adding V0 femtoscopy analysis
[u/mrichter/AliRoot.git] / PWGCF / FEMTOSCOPY / AliFemto / AliFemtoV0PairCut.cxx
1 /////////////////////////////////////////////////////////////////////////////
2 //                                                                         //
3 // AliFemtoShareQualityPairCut - a pair cut which checks for some pair     //
4 // qualities that attempt to identify slit/doubly reconstructed tracks     //
5 //                                                                         //
6 /////////////////////////////////////////////////////////////////////////////
7 /***************************************************************************
8  *
9  * $Id: AliFemtoShareQualityPairCut.cxx 50722 2011-07-21 15:18:38Z akisiel $
10  *
11  * Author: Adam Kisiel, Ohio State, kisiel@mps.ohio-state.edu
12  ***************************************************************************
13  *
14  * Description: part of STAR HBT Framework: AliFemtoMaker package
15  *   a cut to remove "shared" and "split" pairs
16  *
17  ***************************************************************************
18  *
19  *
20  **************************************************************************/
21
22 #include "AliFemtoV0PairCut.h"
23 #include <string>
24 #include <cstdio>
25
26 #ifdef __ROOT__
27 ClassImp(AliFemtoV0PairCut)
28 #endif
29
30 //__________________
31 AliFemtoV0PairCut::AliFemtoV0PairCut():
32   fNPairsPassed(0),
33   fNPairsFailed(0),
34   fV0Max(1.0),
35   fShareFractionMax(1.0),
36   fRemoveSameLabel(0)
37 {
38   // Default constructor
39   // Nothing to do
40 }
41 //__________________
42 AliFemtoV0PairCut::~AliFemtoV0PairCut(){
43   /* no-op */
44 }
45 //__________________
46 bool AliFemtoV0PairCut::Pass(const AliFemtoPair* pair){
47   // Check for pairs that are possibly shared/double reconstruction
48
49   bool temp = true;
50
51   /*cout<<"pair->Track1(): "<<pair->Track1()<<endl;
52   cout<<"pair->Track2(): "<<pair->Track2()<<endl;
53   cout<<"pair->Track1()->V0(): "<<pair->Track1()->V0()<<endl;
54   cout<<"pair->Track2()->V0(): "<<pair->Track2()->V0()<<endl;
55   cout<<"pair->Track1()->V0()->IdNeg(): "<<pair->Track1()->V0()->IdNeg()<<endl;
56   cout<<"pair->Track2()->V0()->IdNeg(): "<<pair->Track2()->V0()->IdNeg()<<endl;
57   cout<<"pair->Track1()->V0()->IdPos(): "<<pair->Track1()->V0()->IdPos()<<endl;
58   cout<<"pair->Track2()->V0()->IdPos(): "<<pair->Track2()->V0()->IdPos()<<endl;*/
59
60   if(!(pair->Track1()->V0() && pair->Track2()->V0()))
61     {
62       return false;
63     }
64   if(pair->Track1()->V0()->IdNeg()==pair->Track2()->V0()->IdNeg() || pair->Track1()->V0()->IdPos()==pair->Track2()->V0()->IdPos())
65     {
66
67       return false;
68     }
69   
70
71   return temp;
72 }
73 //__________________
74 AliFemtoString AliFemtoV0PairCut::Report(){
75   // Prepare the report from the execution
76   string stemp = "AliFemtoV0 Pair Cut - remove shared and split pairs\n";  char ctemp[100];
77   snprintf(ctemp , 100, "Number of pairs which passed:\t%ld  Number which failed:\t%ld\n",fNPairsPassed,fNPairsFailed);
78   stemp += ctemp;
79   AliFemtoString returnThis = stemp;
80   return returnThis;}
81 //__________________
82
83 void AliFemtoV0PairCut::SetV0Max(Double_t aV0Max) {
84   fV0Max = aV0Max;
85 }
86
87 Double_t AliFemtoV0PairCut::GetAliFemtoV0Max() const {
88   return fV0Max;
89 }
90
91
92 TList *AliFemtoV0PairCut::ListSettings()
93 {
94   // return a list of settings in a writable form
95   TList *tListSetttings = new TList();
96   char buf[200];
97   snprintf(buf, 200, "AliFemtoV0PairCut.sharequalitymax=%f", fV0Max);
98   snprintf(buf, 200, "AliFemtoV0PairCut.sharefractionmax=%f", fShareFractionMax);
99   tListSetttings->AddLast(new TObjString(buf));
100
101   return tListSetttings;
102 }
103
104 void     AliFemtoV0PairCut::SetRemoveSameLabel(Bool_t aRemove)
105 {
106   fRemoveSameLabel = aRemove;
107 }