]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG2/FEMTOSCOPY/AliFemtoUser/AliFemtoPairCutAntiGamma.cxx
Lines getting the matched track moved to a method in AliCalorimeterUtils. Lines copie...
[u/mrichter/AliRoot.git] / PWG2 / 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   fUseAOD(kFALSE)
40 {
41 }
42 //__________________
43 AliFemtoPairCutAntiGamma::AliFemtoPairCutAntiGamma(const AliFemtoPairCutAntiGamma& c) : 
44   AliFemtoShareQualityPairCut(c),
45   fMaxEEMinv(0.0),
46   fMaxDTheta(0.0),
47   fDTPCMin(0),
48   fUseAOD(kFALSE)
49
50   fMaxEEMinv = c.fMaxEEMinv;
51   fMaxDTheta = c.fMaxDTheta;
52   fDTPCMin = c.fDTPCMin;
53   fUseAOD = c.fUseAOD;
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     fUseAOD = c.fUseAOD;
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   double me = 0.000511;
79
80   if ((pair->Track1()->Track()->Charge() * pair->Track2()->Track()->Charge()) < 0.0) {
81     double theta1 = pair->Track1()->Track()->P().Theta();
82     double theta2 = pair->Track2()->Track()->P().Theta();
83     double dtheta = TMath::Abs(theta1 - theta2);
84     
85     double e1 = TMath::Sqrt(me*me + pair->Track1()->Track()->P().Mag2());
86     double e2 = TMath::Sqrt(me*me + pair->Track2()->Track()->P().Mag2());
87     
88     double minv = 2*me*me + 2*(e1*e2 - 
89                                pair->Track1()->Track()->P().x()*pair->Track2()->Track()->P().x() -
90                                pair->Track1()->Track()->P().y()*pair->Track2()->Track()->P().y() -
91                                pair->Track1()->Track()->P().z()*pair->Track2()->Track()->P().z());
92     
93     if ((minv < fMaxEEMinv) && (dtheta < fMaxDTheta)) temp = false;
94   }
95
96   bool tempTPCEntrance = true;
97  
98   if(!fUseAOD)
99     {
100       double distx = pair->Track1()->Track()->NominalTpcEntrancePoint().x() - pair->Track2()->Track()->NominalTpcEntrancePoint().x();
101       double disty = pair->Track1()->Track()->NominalTpcEntrancePoint().y() - pair->Track2()->Track()->NominalTpcEntrancePoint().y();
102       double distz = pair->Track1()->Track()->NominalTpcEntrancePoint().z() - pair->Track2()->Track()->NominalTpcEntrancePoint().z();
103       double dist = sqrt(distx*distx + disty*disty + distz*distz);
104
105       tempTPCEntrance = dist > fDTPCMin;
106     }
107
108
109   if (temp && tempTPCEntrance) {
110     temp = AliFemtoShareQualityPairCut::Pass(pair);
111     if (temp) fNPairsPassed++;
112     else fNPairsFailed++;
113     return temp;
114   }
115   else
116     {
117     fNPairsFailed++;
118     return false;
119     }
120
121 }
122 //__________________
123 AliFemtoString AliFemtoPairCutAntiGamma::Report(){
124   // Prepare a report from the execution
125   string stemp = "AliFemtoPairCutAntiGamma Pair Cut - remove pairs possibly coming from Gamma conversions\n";  
126   char ctemp[100];
127   stemp += ctemp;
128   snprintf(ctemp , 100, "Number of pairs which passed:\t%ld  Number which failed:\t%ld\n",fNPairsPassed,fNPairsFailed);
129   stemp += ctemp;
130   AliFemtoString returnThis = stemp;
131   return returnThis;}
132 //__________________
133
134 TList *AliFemtoPairCutAntiGamma::ListSettings()
135 {
136   // return a list of settings in a writable form
137   TList *tListSetttings =  AliFemtoShareQualityPairCut::ListSettings();
138   char buf[200];
139   snprintf(buf, 200, "AliFemtoPairCutAntiGamma.maxeeminv=%f", fMaxEEMinv);
140   snprintf(buf, 200, "AliFemtoPairCutAntiGamma.maxdtheta=%f", fMaxDTheta);
141   tListSetttings->AddLast(new TObjString(buf));
142
143   return tListSetttings;
144 }
145
146 void AliFemtoPairCutAntiGamma::SetMaxEEMinv(Double_t maxeeminv)
147 {
148   fMaxEEMinv = maxeeminv;
149 }
150
151  
152 void AliFemtoPairCutAntiGamma::SetMaxThetaDiff(Double_t maxdtheta)
153 {
154   fMaxDTheta = maxdtheta;
155 }
156
157 void AliFemtoPairCutAntiGamma::SetTPCEntranceSepMinimum(double dtpc)
158 {
159   fDTPCMin = dtpc;
160 }
161
162 void AliFemtoPairCutAntiGamma::SetUseAOD(Bool_t UseAOD)
163 {
164   fUseAOD = UseAOD;
165 }