This commit was generated by cvs2svn to compensate for changes in r18145,
[u/mrichter/AliRoot.git] / PWG2 / FEMTOSCOPY / AliFemto / Cut / AliFemtoBasicTrackCut.cxx
CommitLineData
67427ff7 1/***************************************************************************
2 *
3 * $Id:
4 *
5 * Author: Mike Lisa, Ohio State, lisa@mps.ohio-state.edu
6 ***************************************************************************
7 *
8 * Description: part of STAR HBT Framework: AliFemtoMaker package
9 * a simple particle cut that selects on phasespace, #hits, DCA, and PID
10 *
11 ***************************************************************************
12 *
13 * $Log:
14 **************************************************************************/
15
16#include "Cut/AliFemtoBasicTrackCut.h"
17#include <cstdio>
18
19#ifdef __ROOT__
20ClassImp(AliFemtoBasicTrackCut)
21#endif
22
23AliFemtoBasicTrackCut::AliFemtoBasicTrackCut(){
24 fNTracksPassed = fNTracksFailed = 0;
25 fCharge = 1; // takes both charges 0
26 fNSigmaPion[0] = -100.0; fNSigmaPion[1] = 100.0;
27 fNSigmaKaon[0] = -100.0; fNSigmaKaon[1] = 100.0;
28 fNSigmaProton[0] = -100.0; fNSigmaProton[1] = 100.0;
29 fNHits[0] = 10; fNHits[1] = 180;
30 fPt[0]=0.0; fPt[1] = 100.0;//100
31 fRapidity[0]=-2; fRapidity[1]=2;//-2 2
32 fDCA[0] = -1.0; fDCA[1] = 20.0;
33
34}
35//------------------------------
36//AliFemtoBasicTrackCut::~AliFemtoBasicTrackCut(){
37// /* noop */
38//}
39//------------------------------
40bool AliFemtoBasicTrackCut::Pass(const AliFemtoTrack* track){
41
42
43 // return true ; // THIS CUT IS A STHBTDUMMY!!
44
45 /*
46 cout << endl;
47 cout << "#track " << trackCount++;
48 cout << " * pion " << (track->NSigmaPion() > fNSigmaPion[0]) && (track->NSigmaPion() < fNSigmaPion[1]);
49 cout << " * kaon " << (track->NSigmaKaon() > fNSigmaKaon[0]) && (track->NSigmaKaon() < fNSigmaKaon[1]);
50 cout << " * proton " << (track->NSigmaProton() > fNSigmaProton[0]) && (track->NSigmaProton() < fNSigmaProton[1]);
51 cout << " * charge " << (track->Charge() == fCharge);
52 */
53 bool goodPID = 1;
54 /* ----- NOT DOING PID CUTS !!!! ------
55 bool goodPID = ((track->NSigmaPion() > fNSigmaPion[0]) &&
56 (track->NSigmaPion() < fNSigmaPion[1]) &&
57 (track->NSigmaKaon() > fNSigmaKaon[0]) &&
58 (track->NSigmaKaon() < fNSigmaKaon[1]) &&
59 (track->NSigmaProton() > fNSigmaProton[0]) &&
60 (track->NSigmaProton() < fNSigmaProton[1]));
61 ----- NOT DOING PID CUTS !!!! ------ */
62 if (fCharge !=0){ // if user requests "charge=0" then that means ignore charge
63 goodPID = (goodPID&&(track->Charge() == fCharge));
64 }
65 if (goodPID){
66 float TEnergy = ::sqrt(track->P().mag2()+fMass*fMass);
67 float TRapidity = 0.5*::log((TEnergy+track->P().z())/
68 (TEnergy-track->P().z()));
69
70 float Pt = ::sqrt((track->P().x())*(track->P().x())+
71 (track->P().y())*(track->P().y()));
72
73
74 /*
75 cout << " * DCAxy " << (track->DCAxy() > fDCA[0]) && (track->DCAxy() < fDCA[1]);
76 cout << " * fDCA[0] " << fDCA[0];
77 cout << " * fDCA[1] " << fDCA[1];
78 cout << " * track->DCAxy " << track->DCAxy();
79 cout << " * NHits " << (track->NHits() > fNHits[0]) && (track->NHits() < fNHits[1]);
80 cout << " * Pt " << (Pt > fPt[0]) && (Pt < fPt[1]);
81 cout << " * y " << (TRapidity > fRapidity[0]) && (TRapidity < fRapidity[1]);
82 cout << endl;
83 */
84
85 bool goodTrack=
86 (//(track->DCAxy() > fDCA[0]) &&
87 // (track->DCAxy() < fDCA[1]) &&
88 // (track->NHits() > fNHits[0]) &&
89 // (track->NHits() < fNHits[1]) &&
90 (Pt > fPt[0]) &&
91 (Pt < fPt[1]) &&
92 (TRapidity > fRapidity[0]) &&
93 (TRapidity < fRapidity[1]))&&
94 (track->PidProbPion()>0.5)&&//moje
95 (track->PidProbMuon()<0.47)&&//moje
96 (track->Label()>0);//moje
97
98 // cout << track->DCAxy() << " " << track->NHits() << " " << Pt << " " << TRapidity << " " << TEnergy << endl;
99
100 goodTrack ? fNTracksPassed++ : fNTracksFailed++;
101 return (goodTrack);
102 }
103 else{
104 fNTracksFailed++;
105 return (goodPID);
106 }
107}
108//------------------------------
109AliFemtoString AliFemtoBasicTrackCut::Report(){
110 string Stemp;
111 char Ctemp[100];
112 sprintf(Ctemp,"Particle mass:\t%E\n",this->Mass());
113 Stemp=Ctemp;
114 sprintf(Ctemp,"Particle charge:\t%d\n",fCharge);
115 Stemp=Ctemp;
116 sprintf(Ctemp,"Particle Nsigma from pion:\t%E - %E\n",fNSigmaPion[0],fNSigmaPion[1]);
117 Stemp+=Ctemp;
118 sprintf(Ctemp,"Particle Nsigma from kaon:\t%E - %E\n",fNSigmaKaon[0],fNSigmaKaon[1]);
119 Stemp+=Ctemp;
120 sprintf(Ctemp,"Particle Nsigma from proton:\t%E - %E\n",fNSigmaProton[0],fNSigmaProton[1]);
121 Stemp+=Ctemp;
122 sprintf(Ctemp,"Particle #hits:\t%d - %d\n",fNHits[0],fNHits[1]);
123 Stemp+=Ctemp;
124 sprintf(Ctemp,"Particle pT:\t%E - %E\n",fPt[0],fPt[1]);
125 Stemp+=Ctemp;
126 sprintf(Ctemp,"Particle rapidity:\t%E - %E\n",fRapidity[0],fRapidity[1]);
127 Stemp+=Ctemp;
128 sprintf(Ctemp,"Particle DCA:\t%E - %E\n",fDCA[0],fDCA[1]);
129 Stemp+=Ctemp;
130 sprintf(Ctemp,"Number of tracks which passed:\t%ld Number which failed:\t%ld\n",fNTracksPassed,fNTracksFailed);
131 Stemp += Ctemp;
132 AliFemtoString returnThis = Stemp;
133 return returnThis;
134}