]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG2/FEMTOSCOPY/AliFemtoUser/AliFemtoESDTrackCut.cxx
749c20738fb194d00c2dcfa3145c60a66db2d1d8
[u/mrichter/AliRoot.git] / PWG2 / FEMTOSCOPY / AliFemtoUser / AliFemtoESDTrackCut.cxx
1 /***************************************************************************
2  *
3  * $Id$ 
4  *
5  * 
6  ***************************************************************************
7  *
8  * 
9  *              
10  *
11  ***************************************************************************
12  *
13  * $Log$
14  * Revision 1.3  2007/05/22 09:01:42  akisiel
15  * Add the possibiloity to save cut settings in the ROOT file
16  *
17  * Revision 1.2  2007/05/21 10:38:25  akisiel
18  * More coding rule conformance
19  *
20  * Revision 1.1  2007/05/16 10:25:06  akisiel
21  * Making the directory structure of AliFemtoUser flat. All files go into one common directory
22  *
23  * Revision 1.4  2007/05/03 09:46:10  akisiel
24  * Fixing Effective C++ warnings
25  *
26  * Revision 1.3  2007/04/27 07:25:59  akisiel
27  * Make revisions needed for compilation from the main AliRoot tree
28  *
29  * Revision 1.1.1.1  2007/04/25 15:38:41  panos
30  * Importing the HBT code dir
31  *
32  * Revision 1.4  2007-04-03 16:00:08  mchojnacki
33  * Changes to iprove memory managing
34  *
35  * Revision 1.3  2007/03/13 15:30:03  mchojnacki
36  * adding reader for simulated data
37  *
38  * Revision 1.2  2007/03/08 14:58:03  mchojnacki
39  * adding some alice stuff
40  *
41  * Revision 1.1.1.1  2007/03/07 10:14:49  mchojnacki
42  * First version on CVS
43  *
44  **************************************************************************/
45
46 #include "AliFemtoESDTrackCut.h"
47 #include <cstdio>
48
49 #ifdef __ROOT__ 
50 ClassImp(AliFemtoESDTrackCut)
51 #endif
52
53
54 // electron
55 // 0.13 - 1.8
56 // 0       7.594129e-02    8.256141e-03
57 // 1       -5.535827e-01   8.170825e-02
58 // 2       1.728591e+00    3.104210e-01
59 // 3       -2.827893e+00   5.827802e-01
60 // 4       2.503553e+00    5.736207e-01
61 // 5       -1.125965e+00   2.821170e-01
62 // 6       2.009036e-01    5.438876e-02
63
64 // pion
65 // 0.13 - 2.0
66 // 0       1.063457e+00    8.872043e-03
67 // 1       -4.222208e-01   2.534402e-02
68 // 2       1.042004e-01    1.503945e-02
69
70 // kaon
71 // 0.18 - 2.0
72 // 0       -7.289406e-02   1.686074e-03
73 // 1       4.415666e-01    1.143939e-02
74 // 2       -2.996790e-01   1.840964e-02
75 // 3       6.704652e-02    7.783990e-03
76
77 // proton
78 // 0.26 - 2.0
79 // 0       -3.730200e-02   2.347311e-03
80 // 1       1.163684e-01    1.319316e-02
81 // 2       8.354116e-02    1.997948e-02
82 // 3       -4.608098e-02   8.336400e-03
83
84
85 AliFemtoESDTrackCut::AliFemtoESDTrackCut() :
86     fCharge(0),
87     fLabel(0),
88     fStatus(0),
89     fminTPCclsF(0),
90     fminTPCncls(0),
91     fminITScls(0),
92     fMaxITSchiNdof(1000.0),
93     fMaxTPCchiNdof(1000.0),
94     fMaxSigmaToVertex(1000.0),
95     fNTracksPassed(0),
96     fNTracksFailed(0),
97     fRemoveKinks(kFALSE),
98     fMostProbable(0), 
99     fMaxImpactXY(1000.0),
100     fMaxImpactZ(1000.0),
101     fMinPforTOFpid(0.0),
102     fMaxPforTOFpid(10000.0),
103     fMinPforTPCpid(0.0),
104     fMaxPforTPCpid(10000.0),
105     fMinPforITSpid(0.0),
106     fMaxPforITSpid(10000.0)
107 {
108   // Default constructor
109   fNTracksPassed = fNTracksFailed = 0;
110   fCharge = 0;  // takes both charges 0
111   fPt[0]=0.0;              fPt[1] = 100.0;//100
112   fRapidity[0]=-2;       fRapidity[1]=2;//-2 2
113   fEta[0]=-2;       fEta[1]=2;//-2 2
114   fPidProbElectron[0]=-1;fPidProbElectron[1]=2;
115   fPidProbPion[0]=-1;    fPidProbPion[1]=2;
116   fPidProbKaon[0]=-1;fPidProbKaon[1]=2;
117   fPidProbProton[0]=-1;fPidProbProton[1]=2;
118   fPidProbMuon[0]=-1;fPidProbMuon[1]=2;
119   fLabel=false;
120   fStatus=0;
121   fminTPCclsF=0;
122   fminITScls=0;
123 }
124 //------------------------------
125 AliFemtoESDTrackCut::~AliFemtoESDTrackCut(){
126   /* noop */
127 }
128 //------------------------------
129 bool AliFemtoESDTrackCut::Pass(const AliFemtoTrack* track)
130 {
131   // test the particle and return 
132   // true if it meets all the criteria
133   // false if it doesn't meet at least one of the criteria
134   float tMost[5];
135   
136   //cout<<"AliFemtoESD  cut"<<endl;
137   //cout<<fPidProbPion[0]<<" < pi ="<<track->PidProbPion()<<" <"<<fPidProbPion[1]<<endl;
138   if (fStatus!=0)
139     {
140       //cout<<" status "<<track->Label()<<" "<<track->Flags()<<" "<<track->TPCnclsF()<<" "<<track->ITSncls()<<endl;
141       if ((track->Flags()&fStatus)!=fStatus)
142         {
143           //      cout<<track->Flags()<<" "<<fStatus<<" no go through status"<<endl;
144           return false;
145         }
146         
147     }
148   if (fRemoveKinks) {
149     if ((track->KinkIndex(0)) || (track->KinkIndex(1)) || (track->KinkIndex(2)))
150       return false;
151   }
152   if (fminTPCclsF>track->TPCnclsF())
153     {
154       //cout<<" No go because TPC Number of ClsF"<<fminTPCclsF<< " "<<track->TPCnclsF()<<endl;
155       return false;
156     }
157   if (fminTPCncls>track->TPCncls())
158     {
159       //cout<<" No go because TPC Number of ClsF"<<fminTPCclsF<< " "<<track->TPCnclsF()<<endl;
160       return false;
161     }
162   if (fminITScls>track->ITSncls())
163     {
164       //cout<<" No go because ITS Number of Cls"<<fminITScls<< " "<<track->ITSncls()<<endl;
165       return false;
166     }
167         
168   if (fMaxImpactXY < TMath::Abs(track->ImpactD()))
169     return false;
170
171   if (fMaxImpactZ < TMath::Abs(track->ImpactZ()))
172     return false;
173   
174   if (fMaxSigmaToVertex < track->SigmaToVertex()) {
175     return false;
176   }
177   
178   if (track->ITSncls() > 0) 
179     if ((track->ITSchi2()/track->ITSncls()) > fMaxITSchiNdof) {
180       return false;
181     }
182
183   if (track->TPCncls() > 0)
184     if ((track->TPCchi2()/track->TPCncls()) > fMaxTPCchiNdof) {
185       return false;
186     }
187
188   if (fLabel)
189     {
190       //cout<<"labels"<<endl;
191       if(track->Label()<0)
192         {
193           fNTracksFailed++;
194           //   cout<<"No Go Through the cut"<<endl;
195           //  cout<<fLabel<<" Label="<<track->Label()<<endl;
196           return false;
197         }    
198     }
199   if (fCharge!=0)
200     {              
201       //cout<<"AliFemtoESD  cut ch "<<endl;
202       //cout<<fCharge<<" Charge="<<track->Charge()<<endl;
203       if (track->Charge()!= fCharge)    
204         {
205           fNTracksFailed++;
206           //  cout<<"No Go Through the cut"<<endl;
207           // cout<<fCharge<<" Charge="<<track->Charge()<<endl;
208           return false;
209         }
210     }
211   Bool_t tTPCPidIn = (track->Flags()&AliFemtoTrack::kTPCpid)>0;
212   Bool_t tITSPidIn = (track->Flags()&AliFemtoTrack::kITSpid)>0;
213   Bool_t tTOFPidIn = (track->Flags()&AliFemtoTrack::kTOFpid)>0;
214   
215   if(fMinPforTOFpid > 0 && track->P().Mag() > fMinPforTOFpid &&
216      track->P().Mag() < fMaxPforTOFpid && !tTOFPidIn)
217     {
218       fNTracksFailed++;
219       return false;
220     }
221   
222   if(fMinPforTPCpid > 0 && track->P().Mag() > fMinPforTPCpid &&
223      track->P().Mag() < fMaxPforTPCpid && !tTPCPidIn)
224     {
225       fNTracksFailed++;
226       return false;
227     }
228   
229   if(fMinPforITSpid > 0 && track->P().Mag() > fMinPforITSpid &&
230      track->P().Mag() < fMaxPforITSpid && !tITSPidIn)
231     {
232       fNTracksFailed++;
233       return false;
234     }
235   
236
237   float tEnergy = ::sqrt(track->P().Mag2()+fMass*fMass);
238   float tRapidity = 0.5*::log((tEnergy+track->P().z())/(tEnergy-track->P().z()));
239   float tPt = ::sqrt((track->P().x())*(track->P().x())+(track->P().y())*(track->P().y()));
240   float tEta = track->P().PseudoRapidity();
241   if ((tRapidity<fRapidity[0])||(tRapidity>fRapidity[1]))
242     {
243       fNTracksFailed++;
244       //cout<<"No Go Through the cut"<<endl;   
245       //cout<<fRapidity[0]<<" < Rapidity ="<<tRapidity<<" <"<<fRapidity[1]<<endl;
246       return false;
247     }
248   if ((tEta<fEta[0])||(tEta>fEta[1]))
249     {
250       fNTracksFailed++;
251       //cout<<"No Go Through the cut"<<endl;   
252       //cout<<fEta[0]<<" < Eta ="<<tEta<<" <"<<fEta[1]<<endl;
253       return false;
254     }
255   if ((tPt<fPt[0])||(tPt>fPt[1]))
256     {
257       fNTracksFailed++;
258       //cout<<"No Go Through the cut"<<endl;
259       //cout<<fPt[0]<<" < Pt ="<<Pt<<" <"<<fPt[1]<<endl;
260       return false;
261     }
262 //   cout << "Track has pids: " 
263 //        << track->PidProbElectron() << " " 
264 //        << track->PidProbMuon() << " " 
265 //        << track->PidProbPion() << " " 
266 //        << track->PidProbKaon() << " " 
267 //        << track->PidProbProton() << " " 
268 //        << track->PidProbElectron()+track->PidProbMuon()+track->PidProbPion()+track->PidProbKaon()+track->PidProbProton() << endl;
269
270     
271   if ((track->PidProbElectron()<fPidProbElectron[0])||(track->PidProbElectron()>fPidProbElectron[1]))
272     {
273       fNTracksFailed++;
274       //cout<<"No Go Through the cut"<<endl;
275       //cout<<fPidProbElectron[0]<<" < e ="<<track->PidProbElectron()<<" <"<<fPidProbElectron[1]<<endl;
276       return false;
277     }
278   if ((track->PidProbPion()<fPidProbPion[0])||(track->PidProbPion()>fPidProbPion[1]))
279     {
280       fNTracksFailed++;
281       //cout<<"No Go Through the cut"<<endl;
282       //cout<<fPidProbPion[0]<<" < pi ="<<track->PidProbPion()<<" <"<<fPidProbPion[1]<<endl;
283       return false;
284     }
285   if ((track->PidProbKaon()<fPidProbKaon[0])||(track->PidProbKaon()>fPidProbKaon[1]))
286     {
287       fNTracksFailed++;
288       //cout<<"No Go Through the cut"<<endl;
289       //cout<<fPidProbKaon[0]<<" < k ="<<track->PidProbKaon()<<" <"<<fPidProbKaon[1]<<endl;
290       return false;
291     }
292   if ((track->PidProbProton()<fPidProbProton[0])||(track->PidProbProton()>fPidProbProton[1]))
293     {
294       fNTracksFailed++;
295       //cout<<"No Go Through the cut"<<endl;
296       //cout<<fPidProbProton[0]<<" < p  ="<<track->PidProbProton()<<" <"<<fPidProbProton[1]<<endl;
297       return false;
298     }
299   if ((track->PidProbMuon()<fPidProbMuon[0])||(track->PidProbMuon()>fPidProbMuon[1]))
300     {
301       fNTracksFailed++;
302       //cout<<"No Go Through the cut"<<endl;
303       //cout<<fPidProbMuon[0]<<" <  mi="<<track->PidProbMuon()<<" <"<<fPidProbMuon[1]<<endl;
304       return false;
305     }
306
307   if (fMostProbable) {
308     int imost=0;
309     if (fMostProbable == 2) {
310       if (IsPionTPCdEdx(track->P().Mag(), track->TPCsignal()))
311         imost = 2;
312     }
313     else if (fMostProbable == 3) {
314       if (IsKaonTPCdEdx(track->P().Mag(), track->TPCsignal()))
315         imost = 3;
316     }
317     else {
318       tMost[0] = track->PidProbElectron()*PidFractionElectron(track->P().Mag());
319       tMost[1] = 0.0;
320       tMost[2] = track->PidProbPion()*PidFractionPion(track->P().Mag());
321       tMost[3] = track->PidProbKaon()*PidFractionKaon(track->P().Mag());
322       tMost[4] = track->PidProbProton()*PidFractionProton(track->P().Mag());
323       float ipidmax = 0.0;
324       for (int ip=0; ip<5; ip++)
325         if (tMost[ip] > ipidmax) { ipidmax = tMost[ip]; imost = ip; };
326     }
327     if (imost != fMostProbable) return false;
328   }
329   
330   // cout<<"Go Through the cut"<<endl;
331   // cout<<fLabel<<" Label="<<track->Label()<<endl;
332   // cout<<fCharge<<" Charge="<<track->Charge()<<endl;
333   // cout<<fPt[0]<<" < Pt ="<<Pt<<" <"<<fPt[1]<<endl;
334   //cout<<fRapidity[0]<<" < Rapidity ="<<tRapidity<<" <"<<fRapidity[1]<<endl;
335   //cout<<fPidProbElectron[0]<<" <  e="<<track->PidProbElectron()<<" <"<<fPidProbElectron[1]<<endl;
336   //cout<<fPidProbPion[0]<<" <  pi="<<track->PidProbPion()<<" <"<<fPidProbPion[1]<<endl;
337   //cout<<fPidProbKaon[0]<<" <  k="<<track->PidProbKaon()<<" <"<<fPidProbKaon[1]<<endl;
338   //cout<<fPidProbProton[0]<<" <  p="<<track->PidProbProton()<<" <"<<fPidProbProton[1]<<endl;
339   //cout<<fPidProbMuon[0]<<" <  mi="<<track->PidProbMuon()<<" <"<<fPidProbMuon[1]<<endl;
340   fNTracksPassed++ ;
341   return true;
342     
343     
344 }
345 //------------------------------
346 AliFemtoString AliFemtoESDTrackCut::Report()
347 {
348   // Prepare report from the execution
349   string tStemp;
350   char tCtemp[100];
351   sprintf(tCtemp,"Particle mass:\t%E\n",this->Mass());
352   tStemp=tCtemp;
353   sprintf(tCtemp,"Particle charge:\t%d\n",fCharge);
354   tStemp+=tCtemp;
355   sprintf(tCtemp,"Particle pT:\t%E - %E\n",fPt[0],fPt[1]);
356   tStemp+=tCtemp;
357   sprintf(tCtemp,"Particle rapidity:\t%E - %E\n",fRapidity[0],fRapidity[1]);
358   tStemp+=tCtemp; 
359   sprintf(tCtemp,"Particle eta:\t%E - %E\n",fEta[0],fEta[1]);
360   tStemp+=tCtemp;
361  sprintf(tCtemp,"Number of tracks which passed:\t%ld  Number which failed:\t%ld\n",fNTracksPassed,fNTracksFailed);
362   tStemp += tCtemp;
363   AliFemtoString returnThis = tStemp;
364   return returnThis;
365 }
366 TList *AliFemtoESDTrackCut::ListSettings()
367 {
368   // return a list of settings in a writable form
369   TList *tListSetttings = new TList();
370   char buf[200];
371   snprintf(buf, 200, "AliFemtoESDTrackCut.mass=%f", this->Mass());
372   tListSetttings->AddLast(new TObjString(buf));
373
374   snprintf(buf, 200, "AliFemtoESDTrackCut.charge=%i", fCharge);
375   tListSetttings->AddLast(new TObjString(buf));
376   snprintf(buf, 200, "AliFemtoESDTrackCut.pidprobpion.minimum=%f", fPidProbPion[0]);
377   tListSetttings->AddLast(new TObjString(buf));
378   snprintf(buf, 200, "AliFemtoESDTrackCut.pidprobpion.maximum=%f", fPidProbPion[1]);
379   tListSetttings->AddLast(new TObjString(buf));
380   snprintf(buf, 200, "AliFemtoESDTrackCut.pidprobkaon.minimum=%f", fPidProbKaon[0]);
381   tListSetttings->AddLast(new TObjString(buf));
382   snprintf(buf, 200, "AliFemtoESDTrackCut.pidprobkaon.maximum=%f", fPidProbKaon[1]);
383   tListSetttings->AddLast(new TObjString(buf));
384   snprintf(buf, 200, "AliFemtoESDTrackCut.pidprobproton.minimum=%f", fPidProbProton[0]);
385   tListSetttings->AddLast(new TObjString(buf));
386   snprintf(buf, 200, "AliFemtoESDTrackCut.pidprobproton.maximum=%f", fPidProbProton[1]);
387   tListSetttings->AddLast(new TObjString(buf));
388   snprintf(buf, 200, "AliFemtoESDTrackCut.pidprobelectron.minimum=%f", fPidProbElectron[0]);
389   tListSetttings->AddLast(new TObjString(buf));
390   snprintf(buf, 200, "AliFemtoESDTrackCut.pidprobelectron.maximum=%f", fPidProbElectron[1]);
391   tListSetttings->AddLast(new TObjString(buf));
392   snprintf(buf, 200, "AliFemtoESDTrackCut.pidprobMuon.minimum=%f", fPidProbMuon[0]);
393   tListSetttings->AddLast(new TObjString(buf));
394   snprintf(buf, 200, "AliFemtoESDTrackCut.pidprobMuon.maximum=%f", fPidProbMuon[1]);
395   tListSetttings->AddLast(new TObjString(buf));
396   snprintf(buf, 200, "AliFemtoESDTrackCut.minimumtpcclusters=%i", fminTPCclsF);
397   tListSetttings->AddLast(new TObjString(buf));
398   snprintf(buf, 200, "AliFemtoESDTrackCut.minimumitsclusters=%i", fminTPCclsF);
399   tListSetttings->AddLast(new TObjString(buf));
400   snprintf(buf, 200, "AliFemtoESDTrackCut.pt.minimum=%f", fPt[0]);
401   tListSetttings->AddLast(new TObjString(buf));
402   snprintf(buf, 200, "AliFemtoESDTrackCut.pt.maximum=%f", fPt[1]);
403   tListSetttings->AddLast(new TObjString(buf));
404   snprintf(buf, 200, "AliFemtoESDTrackCut.rapidity.minimum=%f", fRapidity[0]);
405   tListSetttings->AddLast(new TObjString(buf));
406   snprintf(buf, 200, "AliFemtoESDTrackCut.rapidity.maximum=%f", fRapidity[1]);
407   tListSetttings->AddLast(new TObjString(buf));
408   snprintf(buf, 200, "AliFemtoESDTrackCut.removekinks=%i", fRemoveKinks);
409   tListSetttings->AddLast(new TObjString(buf));
410   snprintf(buf, 200, "AliFemtoESDTrackCut.maxitschindof=%f", fMaxITSchiNdof);
411   tListSetttings->AddLast(new TObjString(buf));
412   snprintf(buf, 200, "AliFemtoESDTrackCut.maxtpcchindof=%f", fMaxTPCchiNdof);
413   tListSetttings->AddLast(new TObjString(buf));
414   snprintf(buf, 200, "AliFemtoESDTrackCut.maxsigmatovertex=%f", fMaxSigmaToVertex);
415   tListSetttings->AddLast(new TObjString(buf));
416   snprintf(buf, 200, "AliFemtoESDTrackCut.maximpactxy=%f", fMaxImpactXY);
417   tListSetttings->AddLast(new TObjString(buf));
418   snprintf(buf, 200, "AliFemtoESDTrackCut.maximpactz=%f", fMaxImpactZ);
419   tListSetttings->AddLast(new TObjString(buf));
420   if (fMostProbable) {
421     if (fMostProbable == 2)
422       snprintf(buf, 200, "AliFemtoESDTrackCut.mostprobable=%s", "Pion");
423     if (fMostProbable == 3)
424       snprintf(buf, 200, "AliFemtoESDTrackCut.mostprobable=%s", "Kaon");
425     if (fMostProbable == 4)
426       snprintf(buf, 200, "AliFemtoESDTrackCut.mostprobable=%s", "Proton");
427     tListSetttings->AddLast(new TObjString(buf));
428   }
429   return tListSetttings;
430 }
431 void AliFemtoESDTrackCut::SetRemoveKinks(const bool& flag)
432 {
433   fRemoveKinks = flag;
434 }
435                             
436                             // electron
437 // 0.13 - 1.8
438 // 0       7.594129e-02    8.256141e-03
439 // 1       -5.535827e-01   8.170825e-02
440 // 2       1.728591e+00    3.104210e-01
441 // 3       -2.827893e+00   5.827802e-01
442 // 4       2.503553e+00    5.736207e-01
443 // 5       -1.125965e+00   2.821170e-01
444 // 6       2.009036e-01    5.438876e-02
445 float AliFemtoESDTrackCut::PidFractionElectron(float mom) const
446 {
447   // Provide a parameterized fraction of electrons dependent on momentum
448   if (mom<0.13) return 0.0;
449   if (mom>1.8) return 0.0;
450   return (7.594129e-02 
451           -5.535827e-01*mom        
452           +1.728591e+00*mom*mom    
453           -2.827893e+00*mom*mom*mom 
454           +2.503553e+00*mom*mom*mom*mom    
455           -1.125965e+00*mom*mom*mom*mom*mom      
456           +2.009036e-01*mom*mom*mom*mom*mom*mom);   
457 }
458
459 // pion
460 // 0.13 - 2.0
461 // 0       1.063457e+00    8.872043e-03
462 // 1       -4.222208e-01   2.534402e-02
463 // 2       1.042004e-01    1.503945e-02
464 float AliFemtoESDTrackCut::PidFractionPion(float mom) const
465 {
466   // Provide a parameterized fraction of pions dependent on momentum
467   if (mom<0.13) return 0.0;
468   if (mom>2.0) return 0.0;
469   return ( 1.063457e+00
470            -4.222208e-01*mom
471            +1.042004e-01*mom*mom);
472 }
473
474 // kaon
475 // 0.18 - 2.0
476 // 0       -7.289406e-02   1.686074e-03
477 // 1       4.415666e-01    1.143939e-02
478 // 2       -2.996790e-01   1.840964e-02
479 // 3       6.704652e-02    7.783990e-03
480 float AliFemtoESDTrackCut::PidFractionKaon(float mom) const
481 {
482   // Provide a parameterized fraction of kaons dependent on momentum
483   if (mom<0.18) return 0.0;
484   if (mom>2.0) return 0.0;
485   return (-7.289406e-02
486           +4.415666e-01*mom        
487           -2.996790e-01*mom*mom    
488           +6.704652e-02*mom*mom*mom);
489 }
490
491 // proton
492 // 0.26 - 2.0
493 // 0       -3.730200e-02   2.347311e-03
494 // 1       1.163684e-01    1.319316e-02
495 // 2       8.354116e-02    1.997948e-02
496 // 3       -4.608098e-02   8.336400e-03
497 float AliFemtoESDTrackCut::PidFractionProton(float mom) const
498 {
499   // Provide a parameterized fraction of protons dependent on momentum
500   if (mom<0.26) return  0.0;
501   if (mom>2.0) return 0.0;
502   return (-3.730200e-02  
503           +1.163684e-01*mom           
504           +8.354116e-02*mom*mom       
505           -4.608098e-02*mom*mom*mom);  
506 }
507
508 void AliFemtoESDTrackCut::SetMomRangeTOFpidIs(const float& minp, const float& maxp)
509 {
510   fMinPforTOFpid = minp;
511   fMaxPforTOFpid = maxp;
512 }
513
514 void AliFemtoESDTrackCut::SetMomRangeTPCpidIs(const float& minp, const float& maxp)
515 {
516   fMinPforTPCpid = minp;
517   fMaxPforTPCpid = maxp;
518 }
519
520 void AliFemtoESDTrackCut::SetMomRangeITSpidIs(const float& minp, const float& maxp)
521 {
522   fMinPforITSpid = minp;
523   fMaxPforITSpid = maxp;
524 }
525
526 bool AliFemtoESDTrackCut::IsPionTPCdEdx(float mom, float dEdx)
527 {
528   double a1 = -95.4545, b1 = 86.5455;
529   double a2 = 0.0,      b2 = 56.0;
530
531   if (mom < 0.32) {
532     if (dEdx < a1*mom+b1) return true;
533   }
534   if (dEdx < a2*mom+b2) return true;
535
536   return false;
537 }
538
539 bool AliFemtoESDTrackCut::IsKaonTPCdEdx(float mom, float dEdx)
540 {
541   double a1 = -159.1, b1 = 145.9;
542   double a2 = 0.0,    b2 = 60.0;
543   double a3 = -138.235, b3 = 166.44;
544   double a4 = -2015.79, b4 = 973.789;
545   
546   if (mom < 0.24) {
547     if (dEdx > a1*mom+b1) return true;
548   }    
549   else if (mom < 0.43) {
550     if ((dEdx > a1*mom+b1) && (dEdx < a4*mom+b4)) return true;
551   }
552   else if (mom < 0.54) {
553     if ((dEdx > a1*mom+b1) && (dEdx < a3*mom+b3)) return true;
554   }
555   else if (mom < 0.77) {
556     if ((dEdx > a2*mom+b2) && (dEdx < a3*mom+b3)) return true;
557   }
558   
559   return false;
560 }
561