StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StFlowSelection.cxx
1 //
3 // $Id: StFlowSelection.cxx,v 1.24 2004/12/09 23:43:38 posk Exp $
4 //
5 // Author: Art Poskanzer and Raimond Snellings, LBNL, Mar 2000
6 // FTPC added by Markus Oldenburg, MPI, Dec 2000
7 //
8 // Description: Class for making selections
9 //
11 
12 #include <Stiostream.h>
13 #include <stdlib.h>
14 #include "StFlowSelection.h"
15 #include "StFlowEvent.h"
16 #include "StFlowTrack.h"
17 #define PR(x) cout << "##### FlowSelection: " << (#x) << " = " << (x) << endl;
18 
19 ClassImp(StFlowSelection)
20 
21 //-----------------------------------------------------------------------
22 
23 
24 StFlowSelection::StFlowSelection() : mSubevent(-1) {
25  // To make selections
26  mPidPart[0] = '\0';
27  mPtPart[0] = 0.;
28  mPtPart[1] = 0.;
29  mPtBinsPart = 0;
30  mPPart[0] = 0.;
31  mPPart[1] = 0.;
32  mEtaPart[0] = 0.;
33  mEtaPart[1] = 0.;
34  mFitPtsPart[0] = 0;
35  mFitPtsPart[1] = 0;
36  mDedxPtsPart[0] = 0;
37  mDedxPtsPart[1] = 0;
38  mFitOverMaxPtsPart[0] = 0.;
39  mFitOverMaxPtsPart[1] = 0.;
40  mChiSqPart[0] = 0.;
41  mChiSqPart[1] = 0.;
42  mDcaGlobalPart[0] = 0.;
43  mDcaGlobalPart[1] = 2.;
44  mYPart[0] = 0.;
45  mYPart[1] = 0.;
46 }
47 
48 //-----------------------------------------------------------------------
49 
50 StFlowSelection::~StFlowSelection() {
51 }
52 
53 //-----------------------------------------------------------------------
54 
55 Bool_t StFlowSelection::Select(StFlowEvent* pFlowEvent) {
56  // Returns kTRUE if the event is selected
57 
58  return kTRUE;
59 }
60 
61 //-----------------------------------------------------------------------
62 
63 Bool_t StFlowSelection::Select(StFlowTrack* pFlowTrack) {
64  // Selects particles for event plane determination
65  // Returns kTRUE if the track is selected
66 
67  // Selected for event plane
68  if (!pFlowTrack->Select(mHarmonic, mSelection, mSubevent)) return kFALSE;
69 
70  return kTRUE;
71 }
72 
73 //-----------------------------------------------------------------------
74 
75 Bool_t StFlowSelection::SelectPart(StFlowTrack* pFlowTrack) {
76  // Selects particles for correlation with the event plane
77  // Returns kTRUE if the track is selected
78 
79  // PID
80  if (mPidPart[0] != '\0') {
81  if (strstr(mPidPart, "h")!=0) {
82  int charge = pFlowTrack->Charge();
83  if (strcmp("h+", mPidPart)==0 && charge != 1) return kFALSE;
84  if (strcmp("h-", mPidPart)==0 && charge != -1) return kFALSE;
85  } else {
86  const Char_t* pid = pFlowTrack->Pid();
87  if (strstr(pid, mPidPart)==0) return kFALSE;
88  }
89  }
90 
91  // Pt
92  float pt = pFlowTrack->Pt();
93  if (mPtPart[1] > mPtPart[0] &&
94  (pt < mPtPart[0] || pt >= mPtPart[1])) return kFALSE;
95 
96  // P
97  float totalp = pFlowTrack->P();
98  if (mPPart[1] > mPPart[0] &&
99  (totalp < mPPart[0] || totalp >= mPPart[1])) return kFALSE;
100 
101  // Eta
102  float eta = pFlowTrack->Eta();
103  if (mEtaPart[1] > mEtaPart[0] &&
104  (eta < mEtaPart[0] || eta >= mEtaPart[1])) return kFALSE;
105 
106  // Fit Points
107  int fitPts = pFlowTrack->FitPts();
108  if (mFitPtsPart[1] > mFitPtsPart[0] &&
109  (fitPts < mFitPtsPart[0] || fitPts >= mFitPtsPart[1])) return kFALSE;
110 
111  // Dedx Points
112  int dedxPts = pFlowTrack->NdedxPts();
113  if (mDedxPtsPart[1] > mDedxPtsPart[0] &&
114  (dedxPts < mDedxPtsPart[0] || dedxPts >= mDedxPtsPart[1])) return kFALSE;
115 
116 
117  // Fit Points over Max Points
118  int maxPts = pFlowTrack->MaxPts();
119  float fitOverMaxPts = (float)fitPts/(float)maxPts;
120  if (mFitOverMaxPtsPart[1] > mFitOverMaxPtsPart[0] &&
121  (fitOverMaxPts < mFitOverMaxPtsPart[0] ||
122  fitOverMaxPts >= mFitOverMaxPtsPart[1])) return kFALSE;
123 
124  // Chi Squared
125  float chiSq = pFlowTrack->Chi2();
126  if (mChiSqPart[1] > mChiSqPart[0] &&
127  (chiSq < mChiSqPart[0] ||
128  chiSq >= mChiSqPart[1])) return kFALSE;
129 
130  // Dca Global
131  float globdca = pFlowTrack->DcaGlobal();
132  if (mDcaGlobalPart[1] > mDcaGlobalPart[0] &&
133  (globdca < mDcaGlobalPart[0] ||
134  globdca >= mDcaGlobalPart[1])) return kFALSE;
135 
136  // Rapidity
137  float Y = pFlowTrack->Y();
138  if (mYPart[1] > mYPart[0] &&
139  (Y < mYPart[0] || Y >= mYPart[1])) return kFALSE;
140 
141  return kTRUE;
142 }
143 
144 //-----------------------------------------------------------------------
145 
146 void StFlowSelection::PrintList() const {
147 
148  cout << "#################################################################"
149  << endl;
150  cout << "# Selection List:" << endl;
151  cout << "# Particles correlated with the event plane: " << mPidPart << endl;
152  cout << "# Pt for particles correlated with the event plane: " <<
153  mPtPart[0] << " to " << mPtPart[1] << " GeV/c" <<endl;
154  cout << "# P for particles correlated with the event plane: " <<
155  mPPart[0] << " to " << mPPart[1] << " GeV/c" <<endl;
156  cout << "# Eta for particles correlated with the event plane: " <<
157  mEtaPart[0] << " to " << mEtaPart[1] <<endl;
158  cout << "# Y for particles correlated with the event plane: " <<
159  mYPart[0] << " to " << mYPart[1] <<endl;
160  cout << "# Fit Points for particles correlated with the event plane: " <<
161  mFitPtsPart[0] << " to " << mFitPtsPart[1] <<endl;
162  cout << "# Dedx Points for particles correlated with the event plane: " <<
163  mDedxPtsPart[0] << " to " << mDedxPtsPart[1] <<endl;
164  cout << "# Fit/Max Points for particles correlated with the event plane: "
165  << mFitOverMaxPtsPart[0] << " to " << mFitOverMaxPtsPart[1] <<endl;
166  cout << "# Chi2 for particles correlated with the event plane: " <<
167  mChiSqPart[0] << " to " << mChiSqPart[1] <<endl;
168  cout << "# Global Dca for particles correlated with the event plane: " <<
169  mDcaGlobalPart[0] << " to " << mDcaGlobalPart[1] <<endl;
170  cout << "#################################################################"
171  << endl;
172 
173 }
174 
176 //
177 // $Log: StFlowSelection.cxx,v $
178 // Revision 1.24 2004/12/09 23:43:38 posk
179 // Minor changes in code formatting.
180 //
181 // Revision 1.23 2004/12/07 17:01:13 posk
182 // Changed the default value of the dca selection for particles correlated with
183 // the event plane from 1 cm back to 2 cm.
184 //
185 // Revision 1.22 2004/08/18 00:19:21 oldi
186 // Several changes were necessary to comply with latest changes of MuDsts and StEvent:
187 //
188 // nHits, nFitPoints, nMaxPoints
189 // -----------------------------
190 // From now on
191 // - the fit points used in StFlowMaker are the fit points within the TPC xor FTPC (vertex excluded).
192 // - the max. possible points used in StFlowMAker are the max. possible points within the TPC xor FTPC (vertex excluded).
193 // - the number of points (nHits; not used for analyses so far) are the total number of points on a track, i. e.
194 // TPC + SVT + SSD + FTPCeast + FTPCwest [reading from HBT event gives a warning, but it seems like nobody uses it anyhow].
195 // - The fit/max plot (used to be (fit-1)/max) was updated accordingly.
196 // - The default cuts for fit points were changed (only for the FTPC, since TPC doesn't set default cuts).
197 // - All these changes are backward compatible, as long as you change your cuts for the fit points by 1 (the vertex used to
198 // be included and is not included anymore). In other words, your results won't depend on old or new MuDst, StEvent,
199 // PicoDsts as long as you use the new flow software (together with the latest MuDst and StEvent software version).
200 // - For backward compatibility reasons the number of fit points which is written out to the flowpicoevent.root file
201 // includes the vertex. It is subtracted internally while reading back the pico files. This is completely hidden from the
202 // user.
203 //
204 // zFirstPoint
205 // -----------
206 // The positions of the first point of tracks which have points in the TPC can lie outside of the TPC (the tracks can start in
207 // the SVT or SSD now). In this case, the first point of the track is obtained by extrapolating the track helix to the inner
208 // radius of the TPC.
209 //
210 // Revision 1.21 2004/02/03 22:36:37 posk
211 // Initialzed mPtBinsPart.
212 //
213 // Revision 1.20 2003/09/02 17:58:12 perev
214 // gcc 3.2 updates + WarnOff
215 //
216 // Revision 1.19 2003/05/15 06:08:41 aihong
217 // default PID is changed from none to NA, SetDedxPtsPart() added
218 //
219 // Revision 1.18 2002/06/12 22:36:44 posk
220 // FitOverMax points cut/selection is now done on (FitPts - 1)/MaxPts.
221 //
222 // Revision 1.17 2002/06/10 22:51:02 posk
223 // pt and eta weighting now default.
224 // DcaGlobalPart default now 0 to 1 cm.
225 // Event cut order changed.
226 //
227 // Revision 1.16 2002/01/31 01:04:52 posk
228 // *** empty log message ***
229 //
230 // Revision 1.15 2001/11/09 21:10:57 posk
231 // Switched from CERNLIB to TMath. Little q is now normalized.
232 //
233 // Revision 1.14 2001/05/22 20:17:58 posk
234 // Now can do pseudorapidity subevents.
235 //
236 // Revision 1.13 2000/12/12 20:22:06 posk
237 // Put log comments at end of files.
238 // Deleted persistent StFlowEvent (old micro DST).
239 //
240 // Revision 1.12 2000/12/08 17:03:39 oldi
241 // Phi weights for both FTPCs included.
242 //
243 // Revision 1.10 2000/09/16 22:20:32 snelling
244 // Added selection on P and global DCA and fixed rapidity calulation
245 //
246 // Revision 1.9 2000/09/15 22:51:34 posk
247 // Added pt weighting for event plane calcualtion.
248 //
249 // Revision 1.8 2000/09/15 01:20:02 snelling
250 // Added methods for P and Y and added selection on Y
251 //
252 // Revision 1.7 2000/09/13 00:32:27 snelling
253 // Added selections for particles correlated with reaction plane
254 //
255 // Revision 1.6 2000/08/31 18:58:26 posk
256 // For picoDST, added version number, runID, and multEta for centrality.
257 // Added centrality cut when reading picoDST.
258 // Added pt and eta selections for particles corr. wrt event plane.
259 //
260 // Revision 1.5 2000/08/12 20:22:21 posk
261 // Recalculate centrality in read from pico.
262 //
263 // Revision 1.4 2000/05/26 21:29:32 posk
264 // Protected Track data members from overflow.
265 //
266 // Revision 1.2 2000/03/28 23:21:04 posk
267 // Allow multiple instances of the AnalysisMaker.
268 //
269 // Revision 1.1 2000/03/15 23:28:53 posk
270 // Added StFlowSelection.
271 //