]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoPairCutAntiGamma.cxx
Merge branch 'feature-movesplit'
[u/mrichter/AliRoot.git] / PWGCF / FEMTOSCOPY / AliFemtoUser / AliFemtoPairCutAntiGamma.cxx
1 /////////////////////////////////////////////////////////////////////////////
2 //                                                                         //
3 // AliFemtoPairCutAntiGamma - a pair cut which checks     //
4 // for some pair qualities that attempt to identify slit/doubly            //
5 // reconstructed tracks and also selects pairs based on their separation   //
6 // at the entrance to the TPC                                              //
7 //                                                                         //
8 /////////////////////////////////////////////////////////////////////////////
9 /***************************************************************************
10  *
11  * $Id: AliFemtoPairCutAntiGamma.cxx,v 1.1.2.1 2007/10/19 13:35:33 akisiel Exp $
12  *
13  * Author: Adam Kisiel, Ohio State, kisiel@mps.ohio-state.edu
14  ***************************************************************************
15  *
16  * Description: part of STAR HBT Framework: AliFemtoMaker package
17  *   a cut to remove "shared" and "split" pairs
18  *
19  ***************************************************************************
20  *
21  *
22  **************************************************************************/
23
24 #include "AliFemtoPairCutAntiGamma.h"
25 #include <string>
26 #include <cstdio>
27 #include <TMath.h>
28
29 #ifdef __ROOT__
30 ClassImp(AliFemtoPairCutAntiGamma)
31 #endif
32
33 //__________________
34 AliFemtoPairCutAntiGamma::AliFemtoPairCutAntiGamma():
35   AliFemtoShareQualityPairCut(),
36   fMaxEEMinv(0.0),
37   fMaxDTheta(0.0),
38   fDTPCMin(0),
39   fDataType(kESD)
40 {
41 }
42 //__________________
43 AliFemtoPairCutAntiGamma::AliFemtoPairCutAntiGamma(const AliFemtoPairCutAntiGamma& c) : 
44   AliFemtoShareQualityPairCut(c),
45   fMaxEEMinv(0.0),
46   fMaxDTheta(0.0),
47   fDTPCMin(0),
48   fDataType(kESD)
49
50   fMaxEEMinv = c.fMaxEEMinv;
51   fMaxDTheta = c.fMaxDTheta;
52   fDTPCMin = c.fDTPCMin;
53   fDataType = c.fDataType;
54 }
55
56 AliFemtoPairCutAntiGamma& AliFemtoPairCutAntiGamma::operator=(const AliFemtoPairCutAntiGamma& c)
57 {
58   if (this != &c) {
59     fMaxEEMinv = c.fMaxEEMinv;
60     fMaxDTheta = c.fMaxDTheta;
61     fDTPCMin = c.fDTPCMin;
62     fDataType = c.fDataType;
63   }
64
65   return *this;
66
67 }
68 //__________________
69 AliFemtoPairCutAntiGamma::~AliFemtoPairCutAntiGamma(){
70   /* no-op */
71 }
72 //__________________
73 bool AliFemtoPairCutAntiGamma::Pass(const AliFemtoPair* pair){
74   // Accept pairs based on their TPC entrance separation and
75   // quality and sharity
76   bool temp = true;
77
78   if(fDataType==kKine)
79     return true;
80
81   double me = 0.000511;
82
83   if ((pair->Track1()->Track()->Charge() * pair->Track2()->Track()->Charge()) < 0.0) {
84     double theta1 = pair->Track1()->Track()->P().Theta();
85     double theta2 = pair->Track2()->Track()->P().Theta();
86     double dtheta = TMath::Abs(theta1 - theta2);
87     
88     double e1 = TMath::Sqrt(me*me + pair->Track1()->Track()->P().Mag2());
89     double e2 = TMath::Sqrt(me*me + pair->Track2()->Track()->P().Mag2());
90     
91     double minv = 2*me*me + 2*(e1*e2 - 
92                                pair->Track1()->Track()->P().x()*pair->Track2()->Track()->P().x() -
93                                pair->Track1()->Track()->P().y()*pair->Track2()->Track()->P().y() -
94                                pair->Track1()->Track()->P().z()*pair->Track2()->Track()->P().z());
95     
96     if ((minv < fMaxEEMinv) && (dtheta < fMaxDTheta)) temp = false;
97   }
98
99   bool tempTPCEntrance = true;
100   
101   if(fDataType==kESD || fDataType==kAOD)
102     {
103       double distx = pair->Track1()->Track()->NominalTpcEntrancePoint().x() - pair->Track2()->Track()->NominalTpcEntrancePoint().x();
104       double disty = pair->Track1()->Track()->NominalTpcEntrancePoint().y() - pair->Track2()->Track()->NominalTpcEntrancePoint().y();
105       double distz = pair->Track1()->Track()->NominalTpcEntrancePoint().z() - pair->Track2()->Track()->NominalTpcEntrancePoint().z();
106       double dist = sqrt(distx*distx + disty*disty + distz*distz);
107
108       tempTPCEntrance = dist > fDTPCMin;
109     }
110  
111
112   if (temp && tempTPCEntrance) {
113     
114     temp = AliFemtoShareQualityPairCut::Pass(pair);
115     if (temp) {fNPairsPassed++;}
116     else fNPairsFailed++;
117     return temp;
118   }
119   else
120     {
121     fNPairsFailed++;
122     return false;
123     }
124
125 }
126 //__________________
127 AliFemtoString AliFemtoPairCutAntiGamma::Report(){
128   // Prepare a report from the execution
129   string stemp = "AliFemtoPairCutAntiGamma Pair Cut - remove pairs possibly coming from Gamma conversions\n";  
130   char ctemp[100];
131   stemp += ctemp;
132   snprintf(ctemp , 100, "Number of pairs which passed:\t%ld  Number which failed:\t%ld\n",fNPairsPassed,fNPairsFailed);
133   stemp += ctemp;
134   AliFemtoString returnThis = stemp;
135   return returnThis;}
136 //__________________
137
138 TList *AliFemtoPairCutAntiGamma::ListSettings()
139 {
140   // return a list of settings in a writable form
141   TList *tListSetttings =  AliFemtoShareQualityPairCut::ListSettings();
142   char buf[200];
143   snprintf(buf, 200, "AliFemtoPairCutAntiGamma.maxeeminv=%f", fMaxEEMinv);
144   snprintf(buf, 200, "AliFemtoPairCutAntiGamma.maxdtheta=%f", fMaxDTheta);
145   tListSetttings->AddLast(new TObjString(buf));
146
147   return tListSetttings;
148 }
149
150 void AliFemtoPairCutAntiGamma::SetMaxEEMinv(Double_t maxeeminv)
151 {
152   fMaxEEMinv = maxeeminv;
153 }
154
155  
156 void AliFemtoPairCutAntiGamma::SetMaxThetaDiff(Double_t maxdtheta)
157 {
158   fMaxDTheta = maxdtheta;
159 }
160
161 void AliFemtoPairCutAntiGamma::SetTPCEntranceSepMinimum(double dtpc)
162 {
163   fDTPCMin = dtpc;
164 }
165
166 void AliFemtoPairCutAntiGamma::SetDataType(AliFemtoDataType type)
167 {
168   fDataType = type;
169 }