StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StuRefCentrality2.hh
1 /***************************************************************************
2  *
3  * $Id: StuRefCentrality2.hh,v 1.1 2001/12/18 03:11:39 ychen Exp $
4  *
5  * Author: Yu Chen / UCLA Sep 2001
6  ***************************************************************************
7  *
8  * Description:
9  * Function to give a standard uncorrected reference multiplicity for
10  * an event according to the definition in STAR flow paper. The purpose is
11  * to give a reference centrality bin.
12  * The agreed upon track cuts are:
13  * a) primary tracks only
14  * b) flag > 0
15  * c) abs(eta) < 0.75
16  * d) no cuts on either number of hits or number of fit points
17  * The event cut:
18  * PrimaryVertex pVertex->numberOfDaughters() > 10
19  * is suggested to be used.
20  *
21  * The functions are:
22  * 1) uncorrectedMultiplicity
23  * return uncorrected multiplicity as a measure of centrality;
24  * 2) binOfCentrality
25  * return the number of centrality bins:
26  * 1-- most peripheral; ... ; 10-- most central
27  * 3) percentOfCentrality
28  * return the higher edge of percentages that centrality bin covers
29  * (based on published STAR h- paper, normalized):
30  * 1-- 100% (to 80%); ... ; 10-- 5% (to 0%)
31  *
32  * binOfCentrality percentOfCentrality uncorrectedMultiplicity
33  * 1 1.00 0
34  * 2 0.80 14
35  * 3 0.70 30
36  * 4 0.60 60
37  * 5 0.50 107
38  * 6 0.40 176
39  * 7 0.30 271
40  * 8 0.20 400
41  * 9 0.10 569
42  * 10 0.05 675
43  ***************************************************************************
44  *
45  * $Log: StuRefCentrality2.hh,v $
46  * Revision 1.1 2001/12/18 03:11:39 ychen
47  * Added two files to get Nch defined in flow paper. Yu Chen
48  *
49  *
50  **************************************************************************/
51 #ifndef StuRefCentrality2_hh
52 #define StuRefCentrality2_hh
53 
54 #include "StEventTypes.h"
55 inline unsigned int
56 uncorrectedMultiplicity(StEvent& evt)
57 {
58  StPrimaryVertex* primVtx = evt.primaryVertex();
59 
60  if (!primVtx) return 0;
61 
62  const StSPtrVecPrimaryTrack& tracks = primVtx->daughters();
63  size_t countedTracks = 0;
64  for (StSPtrVecPrimaryTrackConstIterator iter = tracks.begin(); iter != tracks.end(); iter++) {
65  StTrack* track = (*iter);
66  if (track->flag()<=0 ) continue;
67  if (fabs(track->geometry()->momentum().pseudoRapidity())<0.75) ++countedTracks;
68  }
69  return countedTracks;
70 }
71 inline unsigned int
72 binOfCentrality(StEvent& evt)
73 {
74  StPrimaryVertex* primVtx = evt.primaryVertex();
75 
76  if (!primVtx) return 0;
77 
78  size_t countedTracks = uncorrectedMultiplicity(evt);
79 
80  unsigned int cent[] = {0,14,30,60,107,176,271,400,569,675};
81 // float percent[] = {0.80,0.70,0.60,0.50,0.40,0.30,0.20,0.10,0.05,0.00};
82 
83  if (countedTracks < cent[1]) { return 1; }
84  else if (countedTracks < cent[2]) { return 2; }
85  else if (countedTracks < cent[3]) { return 3; }
86  else if (countedTracks < cent[4]) { return 4; }
87  else if (countedTracks < cent[5]) { return 5; }
88  else if (countedTracks < cent[6]) { return 6; }
89  else if (countedTracks < cent[7]) { return 7; }
90  else if (countedTracks < cent[8]) { return 8; }
91  else if (countedTracks < cent[9]) { return 9; }
92  else { return 10; }
93 }
94 inline float
95 percentOfCentrality(StEvent& evt)
96 {
97  StPrimaryVertex* primVtx = evt.primaryVertex();
98 
99  if (!primVtx) return -1.;
100 
101  size_t countedTracks = uncorrectedMultiplicity(evt);
102 
103  unsigned int cent[] = {0,14,30,60,107,176,271,400,569,675};
104  float percent[] ={1.00,0.80,0.70,0.60,0.50,0.40,0.30,0.20,0.10,0.05,0.00};
105 
106  if (countedTracks < cent[1]) { return percent[0]; }
107  else if (countedTracks < cent[2]) { return percent[1]; }
108  else if (countedTracks < cent[3]) { return percent[2]; }
109  else if (countedTracks < cent[4]) { return percent[3]; }
110  else if (countedTracks < cent[5]) { return percent[4]; }
111  else if (countedTracks < cent[6]) { return percent[5]; }
112  else if (countedTracks < cent[7]) { return percent[6]; }
113  else if (countedTracks < cent[8]) { return percent[7]; }
114  else if (countedTracks < cent[9]) { return percent[8]; }
115  else { return percent[9]; }
116 }
117 
118 #endif
119 
120 
121