StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StuRefCentrality.hh
1 /***************************************************************************
2  *
3  * $Id: StuRefCentrality.hh,v 1.1 2001/12/18 03:11:38 ychen Exp $
4  *
5  * Author: Yu Chen / UCLA Feb 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  * should be used for giving percentages below.
20  *
21  * The functions are:
22  * 1) uncorrectedMultiplicity
23  * return uncorrected multiplicity as a measure of centrality;
24  * 2) meanScaledMultiplicity
25  * return mean Nch/Nch(max) for 8 centrality bins;
26  * 3) binOfCentrality
27  * return the number of centrality bins:
28  * 1-- most peripheral; ... ; 8-- most central
29  * 4) percentOfCentrality
30  * return the higher edge of percentages that centrality bin covers:
31  * 1-- 85% (to 58%); ... ; 8-- 6% (to 0%)
32  ***************************************************************************
33  *
34  * $Log: StuRefCentrality.hh,v $
35  * Revision 1.1 2001/12/18 03:11:38 ychen
36  * Added two files to get Nch defined in flow paper. Yu Chen
37  *
38  *
39  **************************************************************************/
40 #ifndef StuRefCentrality_hh
41 #define StuRefCentrality_hh
42 
43 #include "StEventTypes.h"
44 inline unsigned int
45 uncorrectedMultiplicity(StEvent& evt)
46 {
47  StPrimaryVertex* primVtx = evt.primaryVertex();
48 
49  if (!primVtx) return 0;
50 
51  const StSPtrVecPrimaryTrack& tracks = primVtx->daughters();
52  size_t countedTracks = 0;
53  for (StSPtrVecPrimaryTrackConstIterator iter = tracks.begin(); iter != tracks.end(); iter++) {
54  StTrack* track = (*iter);
55  if (track->flag()<=0 ) continue;
56  if (fabs(track->geometry()->momentum().pseudoRapidity())<0.75) ++countedTracks;
57  }
58  return countedTracks;
59 }
60 inline float
61 meanScaledMultiplicity(StEvent& evt)
62 {
63  StPrimaryVertex* primVtx = evt.primaryVertex();
64 
65  if (!primVtx) return -1.;
66 
67  size_t countedTracks = uncorrectedMultiplicity(evt);
68 
69  unsigned int cent[] = {20,100,180,270,360,460,560,660,870};
70  float meanNch[] = {0.067,0.175,0.282,0.391,0.502,0.615,0.730,0.877,1.00};
71 // float percent[] = {0.85,0.58,0.45,0.34,0.26,0.18,0.11,0.06,0.00};
72 
73  if (countedTracks < cent[0]) { return 0.00; }
74  else if (countedTracks < cent[1]) { return meanNch[0]; }
75  else if (countedTracks < cent[2]) { return meanNch[1]; }
76  else if (countedTracks < cent[3]) { return meanNch[2]; }
77  else if (countedTracks < cent[4]) { return meanNch[3]; }
78  else if (countedTracks < cent[5]) { return meanNch[4]; }
79  else if (countedTracks < cent[6]) { return meanNch[5]; }
80  else if (countedTracks < cent[7]) { return meanNch[6]; }
81  else if (countedTracks < cent[8]) { return meanNch[7]; }
82  else { return meanNch[8]; }
83 }
84 inline unsigned int
85 binOfCentrality(StEvent& evt)
86 {
87  StPrimaryVertex* primVtx = evt.primaryVertex();
88 
89  if (!primVtx) return 10;
90 
91  size_t countedTracks = uncorrectedMultiplicity(evt);
92 
93  unsigned int cent[] = {20,100,180,270,360,460,560,660,870};
94 // float percent[] = {0.85,0.58,0.45,0.34,0.26,0.18,0.11,0.06,0.00};
95 
96  if (countedTracks < cent[0]) { return 0; }
97  else if (countedTracks < cent[1]) { return 1; }
98  else if (countedTracks < cent[2]) { return 2; }
99  else if (countedTracks < cent[3]) { return 3; }
100  else if (countedTracks < cent[4]) { return 4; }
101  else if (countedTracks < cent[5]) { return 5; }
102  else if (countedTracks < cent[6]) { return 6; }
103  else if (countedTracks < cent[7]) { return 7; }
104  else if (countedTracks < cent[8]) { return 8; }
105  else { return 9; }
106 }
107 inline float
108 percentOfCentrality(StEvent& evt)
109 {
110  StPrimaryVertex* primVtx = evt.primaryVertex();
111 
112  if (!primVtx) return -1.;
113 
114  size_t countedTracks = uncorrectedMultiplicity(evt);
115 
116  unsigned int cent[] = {20,100,180,270,360,460,560,660,870};
117  float percent[] = {0.85,0.58,0.45,0.34,0.26,0.18,0.11,0.06,0.00};
118 
119  if (countedTracks < cent[0]) { return 1.00; }
120  else if (countedTracks < cent[1]) { return percent[0]; }
121  else if (countedTracks < cent[2]) { return percent[1]; }
122  else if (countedTracks < cent[3]) { return percent[2]; }
123  else if (countedTracks < cent[4]) { return percent[3]; }
124  else if (countedTracks < cent[5]) { return percent[4]; }
125  else if (countedTracks < cent[6]) { return percent[5]; }
126  else if (countedTracks < cent[7]) { return percent[6]; }
127  else if (countedTracks < cent[8]) { return percent[7]; }
128  else { return percent[8]; }
129 }
130 
131 #endif
132 
133 
134