StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StFlowCutTrack.cxx
1 //
3 // $Id: StFlowCutTrack.cxx,v 1.43 2007/02/06 18:57:49 posk Exp $
4 //
5 // Author: Art Poskanzer and Raimond Snellings, LBNL, Oct 1999
6 // FTPC added by Markus Oldenburg, MPI, Dec 2000
7 // MuDst enabled by Kirill Filimonov, LBNL, Jun 2002
8 //
9 // Description: Class for applying track cuts
10 //
12 
13 #include <Stiostream.h>
14 #include <stdlib.h>
15 #include "StEvent.h"
16 #include "StTrackTopologyMap.h"
17 #include "StFlowPicoEvent.h"
18 #include "StEventTypes.h"
19 #include "StFlowCutTrack.h"
20 #include "StFlowMaker.h"
21 #include "PhysicalConstants.h"
22 #include "StEnumerations.h"
23 #include "SystemOfUnits.h"
24 #include "StThreeVectorD.hh"
25 #include "StMuDSTMaker/COMMON/StMuTrack.h"
26 #define PR(x) cout << "##### FlowCutTrack: " << (#x) << " = " << (x) << endl;
27 
28 ClassImp(StFlowCutTrack)
29 
30 //-----------------------------------------------------------------------
31 
32 Bool_t StFlowCutTrack::mTpcTrackCut = kFALSE;
33 Int_t StFlowCutTrack::mFitPtsTpcCuts[2] = {15, 50};
34 Float_t StFlowCutTrack::mFitOverMaxCuts[2] = {0.52, 1.05}; // greater than one!
35 Float_t StFlowCutTrack::mChiSqTpcCuts[2] = {0., 0.};
36 Float_t StFlowCutTrack::mPtTpcCuts[2] = {0.15, 12.};
37 Float_t StFlowCutTrack::mEtaTpcCuts[2] = {-1.3, 1.3};
38 Int_t StFlowCutTrack::mChgTpcCuts[2] = {0, 0};
39 
40 Bool_t StFlowCutTrack::mFtpcTrackCut = kFALSE;
41 Int_t StFlowCutTrack::mFitPtsFtpcCuts[2] = {5, 11}; // FitPts DO NOT include the vertex ANYMORE (i.e. the range is from 5 to 10 FTPC points). Everything < 5 and >= 11 is cut.
42 Float_t StFlowCutTrack::mChiSqFtpcCuts[2] = {0., 0.};
43 Float_t StFlowCutTrack::mDcaFtpcCuts[2] = {0., 0.};
44 Float_t StFlowCutTrack::mDcaGlobalFtpcCuts[2] = {0., 2.};
45 Float_t StFlowCutTrack::mPtFtpcCuts[2] = {0.15, 6.};
46 Float_t StFlowCutTrack::mEtaFtpcCuts[4] = {-4.0, -2.5, 2.5, 4.0};
47 Int_t StFlowCutTrack::mChgFtpcCuts[2] = {0, 0};
48 
49 UInt_t StFlowCutTrack::mTrackN = 0;
50 UInt_t StFlowCutTrack::mTpcTrackN = 0;
51 UInt_t StFlowCutTrack::mFtpcTrackN = 0;
52 UInt_t StFlowCutTrack::mFtpcWestTrackN = 0;
53 UInt_t StFlowCutTrack::mFtpcEastTrackN = 0;
54 UInt_t StFlowCutTrack::mGoodTrackN = 0;
55 UInt_t StFlowCutTrack::mGoodTpcTrackN = 0;
56 UInt_t StFlowCutTrack::mGoodFtpcTrackN = 0;
57 UInt_t StFlowCutTrack::mEtaSymPosTpcN = 0;
58 UInt_t StFlowCutTrack::mEtaSymNegTpcN = 0;
59 UInt_t StFlowCutTrack::mEtaSymPosFtpcN = 0;
60 UInt_t StFlowCutTrack::mEtaSymNegFtpcN = 0;
61 UInt_t StFlowCutTrack::mFitPtsTpcCutN = 0;
62 UInt_t StFlowCutTrack::mFitPtsFtpcCutN = 0;
63 UInt_t StFlowCutTrack::mFitOverMaxCutN = 0;
64 UInt_t StFlowCutTrack::mFitOverMaxTpcCutN = 0;
65 UInt_t StFlowCutTrack::mFitOverMaxFtpcCutN = 0;
66 UInt_t StFlowCutTrack::mChiSqTpcCutN = 0;
67 UInt_t StFlowCutTrack::mChiSqFtpcCutN = 0;
68 UInt_t StFlowCutTrack::mDcaFtpcCutN = 0;
69 UInt_t StFlowCutTrack::mDcaGlobalFtpcCutN = 0;
70 UInt_t StFlowCutTrack::mPtTpcCutN = 0;
71 UInt_t StFlowCutTrack::mPtFtpcCutN = 0;
72 UInt_t StFlowCutTrack::mEtaTpcCutN = 0;
73 UInt_t StFlowCutTrack::mChgTpcCutN = 0;
74 UInt_t StFlowCutTrack::mEtaFtpcCutN = 0;
75 UInt_t StFlowCutTrack::mTpcTrackCutN = 0;
76 UInt_t StFlowCutTrack::mFtpcTrackCutN = 0;
77 UInt_t StFlowCutTrack::mChgFtpcCutN = 0;
78 
79 
80 //-----------------------------------------------------------------------
81 
82 StFlowCutTrack::StFlowCutTrack() {
83  // To apply track cuts
84 }
85 
86 //-----------------------------------------------------------------------
87 
88 StFlowCutTrack::~StFlowCutTrack() {
89 }
90 
91 //-----------------------------------------------------------------------
92 
93 Int_t StFlowCutTrack::CheckTrack(StTrack* pTrack) {
94  // Returns kTRUE if the StEvent track survives all the cuts
95 
96  StThreeVectorD p = pTrack->geometry()->momentum();
97 
98  float charge = pTrack->geometry()->charge();
99  float eta = p.pseudoRapidity();
100  float dca = pTrack->impactParameter();
101  float dcaGlobal = pTrack->node()->track(global)->impactParameter();
102  float pt = p.perp();
103  float chiSq = (float)(pTrack->fitTraits().chi2());
104  StTrackTopologyMap map = pTrack->topologyMap();
105  Int_t nFitPoints = pTrack->fitTraits().numberOfFitPoints() -
106  pTrack->fitTraits().numberOfFitPoints(kSvtId) -
107  pTrack->fitTraits().numberOfFitPoints(kSsdId) - 1; // remove additional vertex point
108  Int_t nMaxPoints = pTrack->numberOfPossiblePoints() -
109  pTrack->numberOfPossiblePoints(kSvtId) -
110  pTrack->numberOfPossiblePoints(kSsdId) - 1; // remove additional vertex point
111  float fitOverMax = (nMaxPoints) ? (float)nFitPoints/(float)nMaxPoints : 0.0;
112 
113  if (map.hasHitInDetector(kTpcId) || (map.data(0) == 0 && map.data(1) == 0)) {
114  // Tpc track, or no topologyMap
115  mTpcTrackN++;
116  } else if (map.trackFtpcEast()) {
117  mFtpcTrackN++;
118  mFtpcEastTrackN++;
119  } else if (map.trackFtpcWest()) {
120  mFtpcTrackN++;
121  mFtpcWestTrackN++;
122  }
123 
124  mTrackN++;
125 
126  if (map.hasHitInDetector(kTpcId) || (map.data(0) == 0 && map.data(1) == 0)) {
127  // Tpc track, or no topologyMap
128 
129  // tpc all cut
130  if (mTpcTrackCut) {
131  mTpcTrackCut++;
132  return kFALSE;
133  }
134 
135  // pt
136  if (mPtTpcCuts[1] > mPtTpcCuts[0] &&
137  (pt < mPtTpcCuts[0] || pt >= mPtTpcCuts[1])) {
138  mPtTpcCutN++;
139  return kFALSE;
140  }
141 
142  // ChiSq
143  if (mChiSqTpcCuts[1] > mChiSqTpcCuts[0] &&
144  (chiSq < mChiSqTpcCuts[0] || chiSq >= mChiSqTpcCuts[1])) {
145  mChiSqTpcCutN++;
146  return kFALSE;
147  }
148 
149  // Fit Points
150  if (mFitPtsTpcCuts[1] > mFitPtsTpcCuts[0] &&
151  (nFitPoints < mFitPtsTpcCuts[0] || nFitPoints >= mFitPtsTpcCuts[1])) {
152  mFitPtsTpcCutN++;
153  return kFALSE;
154  }
155 
156  // Fit points / max points
157  if (mFitOverMaxCuts[1] > mFitOverMaxCuts[0] &&
158  (fitOverMax < mFitOverMaxCuts[0] || fitOverMax >= mFitOverMaxCuts[1])) {
159  mFitOverMaxTpcCutN++;
160  mFitOverMaxCutN++;
161  return kFALSE;
162  }
163 
164  // eta
165  if (mEtaTpcCuts[1] > mEtaTpcCuts[0] &&
166  (eta < mEtaTpcCuts[0] || eta >= mEtaTpcCuts[1])) {
167  mEtaTpcCutN++;
168  return kFALSE;
169  }
170 
171  // charge
172  if (mChgTpcCuts[1] > mChgTpcCuts[0] &&
173  (charge < mChgTpcCuts[0] || charge > mChgTpcCuts[1])) {
174  mChgTpcCutN++;
175  return kFALSE;
176  }
177 
178  // Increment counters for Eta symmetry cut
179  if (eta > 0.) {
180  mEtaSymPosTpcN++;
181  } else {
182  mEtaSymNegTpcN++;
183  }
184 
185  mGoodTpcTrackN++;
186  }
187 
188  else if (map.trackFtpcEast() || map.trackFtpcWest()) {
189  // Ftpc track
190 
191  // Ftpc all cut
192  if (mFtpcTrackCut) {
193  mFtpcTrackCutN++;
194  return kFALSE;
195  }
196 
197  // dca
198  if (mDcaFtpcCuts[1] > mDcaFtpcCuts[0] &&
199  (dca < mDcaFtpcCuts[0] || dca >= mDcaFtpcCuts[1])) {
200  mDcaFtpcCutN++;
201  return kFALSE;
202  }
203 
204  // dca global
205  if (mDcaGlobalFtpcCuts[1] > mDcaGlobalFtpcCuts[0] &&
206  (dcaGlobal < mDcaGlobalFtpcCuts[0] || dcaGlobal >= mDcaGlobalFtpcCuts[1])) {
207  mDcaGlobalFtpcCutN++;
208  return kFALSE;
209  }
210 
211  // pt
212  if (mPtFtpcCuts[1] > mPtFtpcCuts[0] &&
213  (pt < mPtFtpcCuts[0] || pt >= mPtFtpcCuts[1])) {
214  mPtFtpcCutN++;
215  return kFALSE;
216  }
217 
218  // ChiSq
219  if (mChiSqFtpcCuts[1] > mChiSqFtpcCuts[0] &&
220  (chiSq < mChiSqFtpcCuts[0] || chiSq >= mChiSqFtpcCuts[1])) {
221  mChiSqFtpcCutN++;
222  return kFALSE;
223  }
224 
225  // Fit Points
226  if (mFitPtsFtpcCuts[1] > mFitPtsFtpcCuts[0] &&
227  (nFitPoints < mFitPtsFtpcCuts[0] || nFitPoints >= mFitPtsFtpcCuts[1])) {
228  mFitPtsFtpcCutN++;
229  return kFALSE;
230  }
231 
232  // Fit points / max points
233  if (mFitOverMaxCuts[1] > mFitOverMaxCuts[0] &&
234  (fitOverMax < mFitOverMaxCuts[0] || fitOverMax >= mFitOverMaxCuts[1])) {
235  mFitOverMaxFtpcCutN++;
236  mFitOverMaxCutN++;
237  return kFALSE;
238  }
239 
240  // eta
241  if ((eta < 0 && mEtaFtpcCuts[1] > mEtaFtpcCuts[0] &&
242  (eta < mEtaFtpcCuts[0] || eta >= mEtaFtpcCuts[1])) ||
243  (eta > 0 && mEtaFtpcCuts[3] > mEtaFtpcCuts[2] &&
244  (eta < mEtaFtpcCuts[2] || eta >= mEtaFtpcCuts[3]))) {
245  mEtaFtpcCutN++;
246  return kFALSE;
247  }
248 
249  // charge
250  if (mChgFtpcCuts[1] > mChgFtpcCuts[0] &&
251  (charge < mChgFtpcCuts[0] || charge > mChgFtpcCuts[1])) {
252  mChgFtpcCutN++;
253  return kFALSE;
254  }
255 
256  // Increment counters for Eta symmetry cut
257  if (eta > 0.) {
258  mEtaSymPosFtpcN++;
259  } else {
260  mEtaSymNegFtpcN++;
261  }
262 
263  mGoodFtpcTrackN++;
264  } else { // neither Tpc nor Ftpc track
265  return kFALSE;
266  }
267 
268  mGoodTrackN++;
269  return kTRUE;
270 }
271 
272 //-----------------------------------------------------------------------
273 
274 Int_t StFlowCutTrack::CheckTrack(StFlowPicoTrack* pPicoTrack) {
275  // Returns kTRUE if the picotrack survives all the cuts
276 
277  float charge = (float) (pPicoTrack->Charge());
278  float eta = pPicoTrack->Eta();
279  float dca = pPicoTrack->Dca();
280  float dcaGlobal = pPicoTrack->DcaGlobal();
281  float pt = pPicoTrack->Pt();
282  float chiSq = pPicoTrack->Chi2();
283  Int_t nFitPoints = pPicoTrack->FitPts() - 1; // remove additional vertex point
284  Int_t nMaxPoints = pPicoTrack->MaxPts();
285  float fitOverMax = (nMaxPoints) ? (float)nFitPoints/(float)nMaxPoints : 0.0;
286  StTrackTopologyMap map(pPicoTrack->TopologyMap0(), pPicoTrack->TopologyMap1());
287 
288  if (map.hasHitInDetector(kTpcId) || (map.data(0) == 0 && map.data(1) == 0)) {
289  // Tpc track, or no topologyMap
290  mTpcTrackN++;
291  } else if (map.trackFtpcEast()) {
292  mFtpcTrackN++;
293  mFtpcEastTrackN++;
294  } else if (map.trackFtpcWest()) {
295  mFtpcTrackN++;
296  mFtpcWestTrackN++;
297  }
298 
299  mTrackN++;
300 
301  if (map.hasHitInDetector(kTpcId) || (map.data(0) == 0 && map.data(1) == 0)) {
302  // Tpc track, or no topologyMap
303 
304  // Tpc all cut
305  if (mTpcTrackCut) {
306  mTpcTrackCutN++;
307  return kFALSE;
308  }
309 
310  // pt
311  if (mPtTpcCuts[1] > mPtTpcCuts[0] &&
312  (pt < mPtTpcCuts[0] || pt >= mPtTpcCuts[1])) {
313  mPtTpcCutN++;
314  return kFALSE;
315  }
316 
317  // ChiSq
318  if (mChiSqTpcCuts[1] > mChiSqTpcCuts[0] &&
319  (chiSq < mChiSqTpcCuts[0] || chiSq >= mChiSqTpcCuts[1])) {
320  mChiSqTpcCutN++;
321  return kFALSE;
322  }
323 
324  // Fit Points
325  if (mFitPtsTpcCuts[1] > mFitPtsTpcCuts[0] &&
326  (nFitPoints < mFitPtsTpcCuts[0] || nFitPoints >= mFitPtsTpcCuts[1])) {
327  mFitPtsTpcCutN++;
328  return kFALSE;
329  }
330 
331  // Fit points / max points
332  if (mFitOverMaxCuts[1] > mFitOverMaxCuts[0] &&
333  (fitOverMax < mFitOverMaxCuts[0] || fitOverMax >= mFitOverMaxCuts[1])) {
334  mFitOverMaxTpcCutN++;
335  mFitOverMaxCutN++;
336  return kFALSE;
337  }
338 
339  // eta
340  if (mEtaTpcCuts[1] > mEtaTpcCuts[0] &&
341  (eta < mEtaTpcCuts[0] || eta >= mEtaTpcCuts[1])) {
342  mEtaTpcCutN++;
343  return kFALSE;
344  }
345 
346  // charge
347  if (mChgTpcCuts[1] > mChgTpcCuts[0] &&
348  (charge < mChgTpcCuts[0] || charge > mChgTpcCuts[1])) {
349  mChgTpcCutN++;
350  return kFALSE;
351  }
352 
353  // Increment counters for Eta symmetry cut
354  if (eta > 0.) {
355  mEtaSymPosTpcN++;
356  } else {
357  mEtaSymNegTpcN++;
358  }
359 
360  mGoodTpcTrackN++;
361  }
362 
363  else if (map.trackFtpcEast() || map.trackFtpcWest()) {
364  // Ftpc track
365 
366  // Ftpc all cut
367  if (mFtpcTrackCut) {
368  mFtpcTrackCutN++;
369  return kFALSE;
370  }
371 
372  // dca
373  if (mDcaFtpcCuts[1] > mDcaFtpcCuts[0] &&
374  (dca < mDcaFtpcCuts[0] || dca >= mDcaFtpcCuts[1])) {
375  mDcaFtpcCutN++;
376  return kFALSE;
377  }
378 
379  // dca global
380  if (mDcaGlobalFtpcCuts[1] > mDcaGlobalFtpcCuts[0] &&
381  (dcaGlobal < mDcaGlobalFtpcCuts[0] || dcaGlobal >= mDcaGlobalFtpcCuts[1])) {
382  mDcaGlobalFtpcCutN++;
383  return kFALSE;
384  }
385 
386  // pt
387  if (mPtFtpcCuts[1] > mPtFtpcCuts[0] &&
388  (pt < mPtFtpcCuts[0] || pt >= mPtFtpcCuts[1])) {
389  mPtFtpcCutN++;
390  return kFALSE;
391  }
392 
393  // ChiSq
394  if (mChiSqFtpcCuts[1] > mChiSqFtpcCuts[0] &&
395  (chiSq < mChiSqFtpcCuts[0] || chiSq >= mChiSqFtpcCuts[1])) {
396  mChiSqFtpcCutN++;
397  return kFALSE;
398  }
399 
400  // Fit Points
401  if (mFitPtsFtpcCuts[1] > mFitPtsFtpcCuts[0] &&
402  (nFitPoints < mFitPtsFtpcCuts[0] || nFitPoints >= mFitPtsFtpcCuts[1])) {
403  mFitPtsFtpcCutN++;
404  return kFALSE;
405  }
406 
407  // Fit points / max points
408  if (mFitOverMaxCuts[1] > mFitOverMaxCuts[0] &&
409  (fitOverMax < mFitOverMaxCuts[0] || fitOverMax >= mFitOverMaxCuts[1])) {
410  mFitOverMaxFtpcCutN++;
411  mFitOverMaxCutN++;
412  return kFALSE;
413  }
414 
415  // eta
416  if ((eta < 0 && mEtaFtpcCuts[1] > mEtaFtpcCuts[0] &&
417  (eta < mEtaFtpcCuts[0] || eta >= mEtaFtpcCuts[1])) ||
418  (eta > 0 && mEtaFtpcCuts[3] > mEtaFtpcCuts[2] &&
419  (eta < mEtaFtpcCuts[2] || eta >= mEtaFtpcCuts[3]))) {
420  mEtaFtpcCutN++;
421  return kFALSE;
422  }
423 
424  // charge
425  if (mChgFtpcCuts[1] > mChgFtpcCuts[0] &&
426  (charge < mChgFtpcCuts[0] || charge > mChgFtpcCuts[1])) {
427  mChgFtpcCutN++;
428  return kFALSE;
429  }
430 
431  // Increment counters for Eta symmetry cut
432  if (eta > 0.) {
433  mEtaSymPosFtpcN++;
434  } else {
435  mEtaSymNegFtpcN++;
436  }
437 
438  mGoodFtpcTrackN++;
439  } else { // neither Tpc nor Ftpc track
440  return kFALSE;
441  }
442 
443  mGoodTrackN++;
444  return kTRUE;
445 }
446 
447 //-----------------------------------------------------------------------
448 
449 Int_t StFlowCutTrack::CheckTrack(StMuTrack* pMuTrack) {
450  // Returns kTRUE if the micotrack survives all the cuts
451 
452  float charge = (float) (pMuTrack->charge());
453  float eta = pMuTrack->eta();
454  float dca = pMuTrack->dca().mag();
455  float dcaGlobal = pMuTrack->dcaGlobal().mag();
456  float pt = pMuTrack->pt();
457  float chiSq = pMuTrack->chi2xy();
458  StTrackTopologyMap map(pMuTrack->topologyMap());
459  Int_t nFitPoints = pMuTrack->nHitsFit() -
460  pMuTrack->nHitsFit(kSvtId) -
461  pMuTrack->nHitsFit(kSsdId) - 1; // remove additional vertex point
462  Int_t nMaxPoints = pMuTrack->nHitsPoss() -
463  pMuTrack->nHitsPoss(kSvtId) -
464  pMuTrack->nHitsPoss(kSsdId) - 1; // remove additional vertex point
465  float fitOverMax = (nMaxPoints) ? (float)nFitPoints/(float)nMaxPoints : 0.0;
466 
467  if (map.hasHitInDetector(kTpcId) || (map.data(0) == 0 && map.data(1) == 0)) {
468  // Tpc track, or no topologyMap
469  mTpcTrackN++;
470  } else if (map.trackFtpcEast()) {
471  mFtpcTrackN++;
472  mFtpcEastTrackN++;
473  } else if (map.trackFtpcWest()) {
474  mFtpcTrackN++;
475  mFtpcWestTrackN++;
476  }
477 
478  mTrackN++;
479 
480  if (map.hasHitInDetector(kTpcId) || (map.data(0) == 0 && map.data(1) == 0)) {
481  // Tpc track, or no topologyMap
482 
483  // Tpc all cut
484  if (mTpcTrackCut) {
485  mTpcTrackCutN++;
486  return kFALSE;
487  }
488 
489  // pt
490  if (mPtTpcCuts[1] > mPtTpcCuts[0] &&
491  (pt < mPtTpcCuts[0] || pt >= mPtTpcCuts[1])) {
492  mPtTpcCutN++;
493  return kFALSE;
494  }
495 
496  // ChiSq
497  if (mChiSqTpcCuts[1] > mChiSqTpcCuts[0] &&
498  (chiSq < mChiSqTpcCuts[0] || chiSq >= mChiSqTpcCuts[1])) {
499  mChiSqTpcCutN++;
500  return kFALSE;
501  }
502 
503  // Fit Points
504  if (mFitPtsTpcCuts[1] > mFitPtsTpcCuts[0] &&
505  (nFitPoints < mFitPtsTpcCuts[0] || nFitPoints >= mFitPtsTpcCuts[1])) {
506  mFitPtsTpcCutN++;
507  return kFALSE;
508  }
509 
510  // Fit points / max points
511  if (mFitOverMaxCuts[1] > mFitOverMaxCuts[0] &&
512  (fitOverMax < mFitOverMaxCuts[0] || fitOverMax >= mFitOverMaxCuts[1])) {
513  mFitOverMaxTpcCutN++;
514  mFitOverMaxCutN++;
515  return kFALSE;
516  }
517 
518  // eta
519  if (mEtaTpcCuts[1] > mEtaTpcCuts[0] &&
520  (eta < mEtaTpcCuts[0] || eta >= mEtaTpcCuts[1])) {
521  mEtaTpcCutN++;
522  return kFALSE;
523  }
524 
525  // charge
526  if (mChgTpcCuts[1] > mChgTpcCuts[0] &&
527  (charge < mChgTpcCuts[0] || charge > mChgTpcCuts[1])) {
528  mChgTpcCutN++;
529  return kFALSE;
530  }
531 
532  // Increment counters for Eta symmetry cut
533  if (eta > 0.) {
534  mEtaSymPosTpcN++;
535  } else {
536  mEtaSymNegTpcN++;
537  }
538 
539  mGoodTpcTrackN++;
540  }
541 
542  else if (map.trackFtpcEast() || map.trackFtpcWest()) {
543  // Ftpc track
544 
545  // Ftpc all cut
546  if (mFtpcTrackCut) {
547  mFtpcTrackCutN++;
548  return kFALSE;
549  }
550 
551  // dca
552  if (mDcaFtpcCuts[1] > mDcaFtpcCuts[0] &&
553  (dca < mDcaFtpcCuts[0] || dca >= mDcaFtpcCuts[1])) {
554  mDcaFtpcCutN++;
555  return kFALSE;
556  }
557 
558  // dca global
559  if (mDcaGlobalFtpcCuts[1] > mDcaGlobalFtpcCuts[0] &&
560  (dcaGlobal < mDcaGlobalFtpcCuts[0] || dcaGlobal >= mDcaGlobalFtpcCuts[1])) {
561  mDcaGlobalFtpcCutN++;
562  return kFALSE;
563  }
564 
565  // pt
566  if (mPtFtpcCuts[1] > mPtFtpcCuts[0] &&
567  (pt < mPtFtpcCuts[0] || pt >= mPtFtpcCuts[1])) {
568  mPtFtpcCutN++;
569  return kFALSE;
570  }
571 
572  // ChiSq
573  if (mChiSqFtpcCuts[1] > mChiSqFtpcCuts[0] &&
574  (chiSq < mChiSqFtpcCuts[0] || chiSq >= mChiSqFtpcCuts[1])) {
575  mChiSqFtpcCutN++;
576  return kFALSE;
577  }
578 
579  // Fit Points
580  if (mFitPtsFtpcCuts[1] > mFitPtsFtpcCuts[0] &&
581  (nFitPoints < mFitPtsFtpcCuts[0] || nFitPoints >= mFitPtsFtpcCuts[1])) {
582  mFitPtsFtpcCutN++;
583  return kFALSE;
584  }
585 
586  // Fit points / max points
587  if (mFitOverMaxCuts[1] > mFitOverMaxCuts[0] &&
588  (fitOverMax < mFitOverMaxCuts[0] || fitOverMax >= mFitOverMaxCuts[1])) {
589  mFitOverMaxFtpcCutN++;
590  mFitOverMaxCutN++;
591  return kFALSE;
592  }
593 
594  // eta
595  if ((eta < 0 && mEtaFtpcCuts[1] > mEtaFtpcCuts[0] &&
596  (eta < mEtaFtpcCuts[0] || eta >= mEtaFtpcCuts[1])) ||
597  (eta > 0 && mEtaFtpcCuts[3] > mEtaFtpcCuts[2] &&
598  (eta < mEtaFtpcCuts[2] || eta >= mEtaFtpcCuts[3]))) {
599  mEtaFtpcCutN++;
600  return kFALSE;
601  }
602 
603  // charge
604  if (mChgFtpcCuts[1] > mChgFtpcCuts[0] &&
605  (charge < mChgFtpcCuts[0] || charge > mChgFtpcCuts[1])) {
606  mChgFtpcCutN++;
607  return kFALSE;
608  }
609 
610  // Increment counters for Eta symmetry cut
611  if (eta > 0.) {
612  mEtaSymPosFtpcN++;
613  } else {
614  mEtaSymNegFtpcN++;
615  }
616 
617  mGoodFtpcTrackN++;
618  } else { // neither Tpc nor Ftpc track
619  return kFALSE;
620  }
621 
622  mGoodTrackN++;
623  return kTRUE;
624 }
625 
626 //-----------------------------------------------------------------------
627 
628 void StFlowCutTrack::PrintCutList() {
629  // Prints the list of cuts
630  // Call in Finish
631 
632  cout << "#######################################################" << endl;
633  cout << "# Track Cut List:" << endl;
634 
635  if (mTpcTrackCut) {
636  cout << "# Include Tpc tracks= FALSE :\t\t ";
637  }
638  else {
639  cout << "# Include Tpc tracks= TRUE :\t\t ";
640  }
641  cout << setprecision(3) << (float)mTpcTrackCutN/(float)mTrackN/perCent << "%\t ("
642  << setprecision(3) << (float)mTpcTrackCutN/(float)mTpcTrackN/perCent << "% Tpc) cut" << endl;
643  cout << "# FitPts (Tpc) cuts= " << mFitPtsTpcCuts[0] << ", " << mFitPtsTpcCuts[1]
644  << " :\t\t " << setprecision(3) << (float)mFitPtsTpcCutN/(float)mTrackN/perCent
645  << "%\t (" << setprecision(3) << (float)mFitPtsTpcCutN/(float)mTpcTrackN/perCent << "% Tpc) cut" << endl;
646  cout << "# FitOverMax cuts= " << mFitOverMaxCuts[0] << ", " << mFitOverMaxCuts[1]
647  << " :\t " << setprecision(3) << (float)mFitOverMaxCutN/(float)mTrackN/perCent
648  << "%\t (" << setprecision(3) << (float)mFitOverMaxTpcCutN/(float)mTpcTrackN/perCent << "% Tpc, "
649  << setprecision(3) << ((mFtpcTrackN == 0)?0.:(float)mFitOverMaxFtpcCutN/(float)mFtpcTrackN/perCent)
650  << "% Ftpc) cut" << endl;
651  cout << "# ChiSq (Tpc) cuts= " << mChiSqTpcCuts[0] << ", " << mChiSqTpcCuts[1]
652  << " :\t\t " << setprecision(3) << (float)mChiSqTpcCutN/(float)mTrackN/perCent
653  << "%\t (" << setprecision(3) << (float)mChiSqTpcCutN/(float)mTpcTrackN/perCent <<"% Tpc) cut" << endl;
654  cout << "# Pt (Tpc) cuts= " << mPtTpcCuts[0] << ", " << mPtTpcCuts[1]
655  << " :\t\t " << setprecision(3) << (float)mPtTpcCutN/(float)mTrackN/perCent
656  << "%\t (" << setprecision(3) << (float)mPtTpcCutN/(float)mTpcTrackN/perCent <<"% Tpc) cut" << endl;
657  cout << "# Eta (Tpc) cuts= " << mEtaTpcCuts[0] << ", " << mEtaTpcCuts[1]
658  << " :\t\t " << setprecision(3) << (float)mEtaTpcCutN/(float)mTrackN/perCent
659  << "%\t (" << setprecision(3) << (float)mEtaTpcCutN/(float)mTpcTrackN/perCent << "% Tpc) cut" << endl;
660  cout << "# Chg (Tpc) cuts= " << mChgTpcCuts[0] << ", " << mChgTpcCuts[1]
661  << " :\t\t " << setprecision(3) << (float)mChgTpcCutN/(float)mTrackN/perCent
662  << "%\t (" << setprecision(3) << (float)mChgTpcCutN/(float)mTpcTrackN/perCent << "% Tpc) cut" << endl;
663 
664  if (mFtpcTrackCut) {
665  cout << "# Include Ftpc tracks= FALSE :\t\t ";
666  }
667  else {
668  cout << "# Include Ftpc tracks= TRUE :\t\t ";
669  }
670  cout << setprecision(3) << (float)mFtpcTrackCutN/(float)mTrackN/perCent << "%\t ("
671  << setprecision(3) << (float)mFtpcTrackCutN/(float)mFtpcTrackN/perCent << "% Ftpc) cut" << endl;
672  cout << "# FitPts (Ftpc) cuts= " << mFitPtsFtpcCuts[0] << ", " << mFitPtsFtpcCuts[1]
673  << " :\t\t " << setprecision(3) << (float)mFitPtsFtpcCutN/(float)mTrackN/perCent
674  << "%\t (" << setprecision(3) << ((mFtpcTrackN == 0)?0.:(float)mFitPtsFtpcCutN/(float)mFtpcTrackN/perCent)
675  << "% Ftpc) cut" << endl;
676  cout << "# ChiSq (Ftpc) cuts= " << mChiSqFtpcCuts[0] << ", " << mChiSqFtpcCuts[1]
677  << " :\t\t " << setprecision(3) << (float)mChiSqFtpcCutN/(float)mTrackN/perCent
678  << "%\t (" << setprecision(3) << ((mFtpcTrackN == 0)?0.:(float)mChiSqFtpcCutN/(float)mFtpcTrackN/perCent)
679  << "% Ftpc) cut" << endl;
680  cout << "# Dca (Ftpc) cuts= " << mDcaFtpcCuts[0] << ", " << mDcaFtpcCuts[1]
681  << " :\t\t " << setprecision(3) << (float)mDcaFtpcCutN/(float)mTrackN/perCent
682  << "%\t (" << setprecision(3) << ((mFtpcTrackN == 0)?0.:(float)mDcaFtpcCutN/(float)mFtpcTrackN/perCent)
683  <<"% Ftpc) cut" << endl;
684  cout << "# Dca global (Ftpc) cuts= " << mDcaGlobalFtpcCuts[0] << ", " << mDcaGlobalFtpcCuts[1]
685  << " :\t " << setprecision(3) << (float)mDcaGlobalFtpcCutN/(float)mTrackN/perCent
686  << "%\t (" << setprecision(3) << ((mFtpcTrackN == 0)?0.:(float)mDcaGlobalFtpcCutN/(float)mFtpcTrackN/perCent)
687  <<"% Ftpc) cut" << endl;
688  cout << "# Pt (Ftpc) cuts= " << mPtFtpcCuts[0] << ", " << mPtFtpcCuts[1]
689  << " :\t\t " << setprecision(3) << (float)mPtFtpcCutN/(float)mTrackN/perCent
690  << "%\t (" << setprecision(3) << ((mFtpcTrackN == 0)?0.:(float)mPtFtpcCutN/(float)mFtpcTrackN/perCent)
691  << "% Ftpc) cut" << endl;
692  cout << "# Eta (Ftpc) cuts= " << mEtaFtpcCuts[0] << ", " << mEtaFtpcCuts[1]
693  << "; " << mEtaFtpcCuts[2] << ", " << mEtaFtpcCuts[3]
694  << " :\t " << setprecision(3) << (float)mEtaFtpcCutN/(float)mTrackN/perCent
695  << "%\t (" << setprecision(3) << ((mFtpcTrackN == 0)?0.:(float)mEtaFtpcCutN/(float)mFtpcTrackN/perCent)
696  << "% Ftpc) cut" << endl;
697  cout << "# Chg (Ftpc) cuts= " << mChgFtpcCuts[0] << ", " << mChgFtpcCuts[1]
698  << " :\t\t " << setprecision(3) << (float)mChgFtpcCutN/(float)mTrackN/perCent
699  << "%\t (" << setprecision(3) << (float)mChgFtpcCutN/(float)mFtpcTrackN/perCent << "% Ftpc) cut" << endl;
700  cout << "# Good Tpc Tracks =\t " << (float)mGoodTpcTrackN/(float)mTpcTrackN/perCent
701  << "%" << endl;
702  cout << "# Good Ftpc Tracks =\t " << ((mFtpcTrackN == 0)?0.:(float)mGoodFtpcTrackN/(float)mFtpcTrackN/perCent)
703  << "%" << endl;
704  cout << "# Good Tracks =\t\t " << (float)mGoodTrackN/(float)mTrackN/perCent
705  << "%" << endl;
706  cout << "#######################################################" << endl;
707 
708 }
709 
711 //
712 // $Log: StFlowCutTrack.cxx,v $
713 // Revision 1.43 2007/02/06 18:57:49 posk
714 // In Lee Yang Zeros method, introduced recentering of Q vector.
715 // Reactivated eta symmetry cut.
716 //
717 // Revision 1.42 2004/12/09 23:43:34 posk
718 // Minor changes in code formatting.
719 //
720 // Revision 1.41 2004/08/18 00:19:17 oldi
721 // Several changes were necessary to comply with latest changes of MuDsts and StEvent:
722 //
723 // nHits, nFitPoints, nMaxPoints
724 // -----------------------------
725 // From now on
726 // - the fit points used in StFlowMaker are the fit points within the TPC xor FTPC (vertex excluded).
727 // - the max. possible points used in StFlowMAker are the max. possible points within the TPC xor FTPC (vertex excluded).
728 // - the number of points (nHits; not used for analyses so far) are the total number of points on a track, i. e.
729 // TPC + SVT + SSD + FTPCeast + FTPCwest [reading from HBT event gives a warning, but it seems like nobody uses it anyhow].
730 // - The fit/max plot (used to be (fit-1)/max) was updated accordingly.
731 // - The default cuts for fit points were changed (only for the FTPC, since TPC doesn't set default cuts).
732 // - All these changes are backward compatible, as long as you change your cuts for the fit points by 1 (the vertex used to
733 // be included and is not included anymore). In other words, your results won't depend on old or new MuDst, StEvent,
734 // PicoDsts as long as you use the new flow software (together with the latest MuDst and StEvent software version).
735 // - For backward compatibility reasons the number of fit points which is written out to the flowpicoevent.root file
736 // includes the vertex. It is subtracted internally while reading back the pico files. This is completely hidden from the
737 // user.
738 //
739 // zFirstPoint
740 // -----------
741 // 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
742 // the SVT or SSD now). In this case, the first point of the track is obtained by extrapolating the track helix to the inner
743 // radius of the TPC.
744 //
745 // Revision 1.40 2003/09/02 17:58:11 perev
746 // gcc 3.2 updates + WarnOff
747 //
748 // Revision 1.39 2003/06/11 00:51:25 oldi
749 // Default cut for FitPtsFtpc changed to correct values (long tracks were cut before).
750 //
751 // Revision 1.38 2003/02/25 19:28:39 posk
752 // Changed a few unimportant default cuts.
753 //
754 // Revision 1.37 2003/01/14 14:14:09 oldi
755 // Possibility to exclude TPC tracks completely (= FTPC only).
756 //
757 // Revision 1.36 2003/01/10 16:42:01 oldi
758 // Several changes to comply with FTPC tracks:
759 // - Switch to include/exclude FTPC tracks introduced.
760 // The same switch changes the range of the eta histograms.
761 // - Eta symmetry plots for FTPC tracks added and separated from TPC plots.
762 // - PhiWgts and related histograms for FTPC tracks split in FarEast, East,
763 // West, FarWest (depending on vertex.z()).
764 // - Psi_Diff plots for 2 different selections and the first 2 harmonics added.
765 // - Cut to exclude mu-events with no primary vertex introduced.
766 // (This is possible for UPC events and FTPC tracks.)
767 // - Global DCA cut for FTPC tracks added.
768 // - Global DCA cuts for event plane selection separated for TPC and FTPC tracks.
769 // - Charge cut for FTPC tracks added.
770 //
771 // Revision 1.35 2002/06/12 22:36:42 posk
772 // FitOverMax points cut/selection is now done on (FitPts - 1)/MaxPts.
773 //
774 // Revision 1.34 2002/06/10 22:50:58 posk
775 // pt and eta weighting now default.
776 // DcaGlobalPart default now 0 to 1 cm.
777 // Event cut order changed.
778 //
779 // Revision 1.33 2002/06/07 22:18:39 kirill
780 // Introduced MuDst reader
781 //
782 // Revision 1.32 2002/04/05 12:10:57 oldi
783 // Default values for FTPC eta cuts changed. FTPC is excluded now.
784 //
785 // Revision 1.31 2002/03/12 02:33:19 posk
786 // Now makes pico files in SL02c.
787 //
788 // Revision 1.30 2002/02/13 22:29:12 posk
789 // Pt Weight now also weights Phi Weights. Added Eta Weight, default=FALSE.
790 //
791 // Revision 1.29 2002/01/31 21:43:14 aihong
792 // add SetChgTpc()
793 //
794 // Revision 1.28 2001/11/13 22:43:50 posk
795 // Documentation updated.
796 //
797 // Revision 1.27 2001/11/09 21:10:27 posk
798 // Switched from CERNLIB to TMath. Little q is now normalized.
799 //
800 // Revision 1.26 2001/08/22 19:23:28 oldi
801 // Fix to avoid 'nan' in text output if no FTPC tracks found.
802 //
803 // Revision 1.25 2001/07/27 01:26:04 snelling
804 // Added and changed variables for picoEvent. Changed trackCut class to StTrack
805 //
806 // Revision 1.24 2001/07/24 22:29:06 snelling
807 // First attempt to get a standard root pico file again, added variables
808 //
809 // Revision 1.23 2001/05/22 20:17:17 posk
810 // Now can do pseudorapidity subevents.
811 //
812 // Revision 1.22 2000/12/12 20:22:05 posk
813 // Put log comments at end of files.
814 // Deleted persistent StFlowEvent (old micro DST).
815 //
816 // Revision 1.21 2000/12/10 02:01:13 oldi
817 // A new member (StTrackTopologyMap mTopology) was added to StFlowPicoTrack.
818 // The evaluation of either a track originates from the FTPC or not is
819 // unambiguous now. The evaluation itself is easily extendible for other
820 // detectors (e.g. SVT+TPC). Old flowpicoevent.root files are treated as if
821 // they contain TPC tracks only (backward compatibility).
822 //
823 // Revision 1.19 2000/12/08 17:03:38 oldi
824 // Phi weights for both FTPCs included.
825 //
826 // Revision 1.18 2000/12/06 15:38:46 oldi
827 // Including FTPC.
828 //
829 // Revision 1.17 2000/10/12 22:46:33 snelling
830 // Added support for the new pDST's and the probability pid method
831 //
832 // Revision 1.16 2000/08/31 18:58:19 posk
833 // For picoDST, added version number, runID, and multEta for centrality.
834 // Added centrality cut when reading picoDST.
835 // Added pt and eta selections for particles corr. wrt event plane.
836 //
837 // Revision 1.15 2000/08/10 23:00:20 posk
838 // New centralities. pt and eta cuts.
839 //
840 // Revision 1.13 2000/07/12 17:54:35 posk
841 // Added chi2 and dca cuts. Multiplied EtaSym by ::sqrt(mult).
842 // Apply cuts when reading picoevent file.
843 //
844 // Revision 1.12 2000/06/30 14:48:31 posk
845 // Using MessageMgr, changed Eta Symmetry cut.
846 //
847 // Revision 1.11 2000/06/01 18:26:34 posk
848 // Increased precision of Track integer data members.
849 //
850 // Revision 1.9 2000/03/15 23:28:49 posk
851 // Added StFlowSelection.
852 //
853 // Revision 1.8 2000/03/02 23:02:42 posk
854 // Changed extensions from .hh and .cc to .h and .cxx .
855 //
856 // Revision 1.7 2000/02/29 22:00:52 posk
857 // Made SetPhiWeight inline, changed ImpactPar to Dca, etc.
858 //
859 // Revision 1.4 1999/12/15 22:01:23 posk
860 // Added StFlowConstants.hh
861 //
862 // Revision 1.3 1999/11/30 18:52:49 snelling
863 // First modification for the new StEvent
864 //
865 // Revision 1.2 1999/11/24 18:17:11 posk
866 // Put the methods which act on the data in with the data in StFlowEvent.
867 //
868 // Revision 1.1 1999/11/05 00:06:44 posk
869 // First versions of Flow cut classes.
870 //
Double_t pt() const
Returns pT at point of dca to primary vertex.
Definition: StMuTrack.h:256
UShort_t nHitsFit() const
Return total number of hits used in fit.
Definition: StMuTrack.h:239
Short_t charge() const
Returns charge.
Definition: StMuTrack.h:255
Double_t eta() const
Returns pseudo rapidity at point of dca to primary vertex.
Definition: StMuTrack.h:257
UShort_t nHitsPoss() const
Return number of possible hits on track.
Definition: StMuTrack.cxx:242
Double_t chi2xy() const
Returns chi2 of fit. ATTENTIONS: does not return xy chi2 (historic)
Definition: StMuTrack.h:249
StThreeVectorF dca(Int_t vtx_id=-1) const
Returns 3D distance of closest approach to primary vertex.
Definition: StMuTrack.cxx:359
StThreeVectorF dcaGlobal(Int_t vtx_id=-1) const
Returns 3D distance of closest approach to primary vertex of associated global track.
Definition: StMuTrack.cxx:371
StTrackTopologyMap topologyMap() const
Returns topology map.
Definition: StMuTrack.h:254