StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StuFtpcRefMult.hh
1 /***************************************************************************
2  * $Id: StuFtpcRefMult.hh,v 1.8 2018/06/29 17:21:24 perev Exp $
3  ***************************************************************************
4  *
5  * Description:
6  * Function to give a standard reference multiplicity (uncorrected) for
7  * an dAu mibias event [isTrigger(2001) || isTrigger(2003)] (preliminary !!!).
8  *
9  * The cuts are :
10  * ---------------
11  * minbias
12  * primary vertex found
13  * |vertex-z| < 50 cm
14  * isTrigger(2001) || isTrigger(2003)
15  *
16  * charged primary tracks only
17  * fit points >= 5 (>=6 included Vertex)
18  * 2.8 <= |eta| < 3.8
19  * pt < 3 GeV
20  * dca < 3 cm
21  *
22  * With the multiplicity in FTPC east 3 "centrality bins" are defined :
23  *
24  * centrality bin multiplicity FTPC east percentOfEvents
25  * 1 <10 100-40
26  * 2 <17 40-20
27  * 3 >=17 20-0
28  *
29  * This definition seems to be stable up to day 40 !!!
30  *
31  * return 9999 if event cuts failed and centrality bin 99 !!!
32  *
33  **************************************************************************
34  * $Log: StuFtpcRefMult.hh,v $
35  * Revision 1.8 2018/06/29 17:21:24 perev
36  * Irakli_Jun29
37  *
38  * Revision 1.7 2005/08/19 03:44:28 perev
39  * Marco updates
40  *
41  * Revision 1.6 2004/06/30 15:58:36 putschke
42  * Fix comments !
43  *
44  * Revision 1.5 2004/04/11 11:19:33 putschke
45  * Remove dAu minbias trigger cut
46  *
47  * Revision 1.4 2004/02/06 15:04:25 putschke
48  * Update and fix multiplicity cuts
49  *
50  * Revision 1.3 2003/12/04 03:55:08 perev
51  * Simplify code for compiler
52  *
53  * Revision 1.2 2003/04/29 13:20:18 putschke
54  * use now dca of global track
55  *
56  * Revision 1.1 2003/03/27 21:37:46 calderon
57  * Joern's code for reference multiplicity using the FTPC.
58  *
59  **************************************************************************/
60 
61 #ifndef StuRefFtpcMult_hh
62 #define StuRefFtpcMult_hh
63 
64 #include "StEventTypes.h"
65 
66 inline bool
67 multiplicityEventCutFtpc(const StPrimaryVertex*& primVtx)
68 {
69 
70  if (!primVtx) return false;
71  else if (fabs(primVtx->position().x())<10e-3 && fabs(primVtx->position().y())<10e-3 && fabs(primVtx->position().z())<10e-3) return false;
72  else if (fabs(primVtx->position().z())>=50) return false;
73  else return true;
74 
75  return false;
76 
77 }
78 
79 
80 inline unsigned int
81 uncorrectedNumberOfFtpcEastPrimaries(const StPrimaryVertex*& primVtx)
82 {
83  if (!multiplicityEventCutFtpc(primVtx)) return 9999;
84  const StSPtrVecPrimaryTrack& tracks = primVtx->daughters();
85 
86  size_t countedTracks = 0;
87  for (StSPtrVecPrimaryTrackConstIterator iter = tracks.begin(); iter != tracks.end(); iter++) {
88  StTrack* track = (*iter);
89  // check if possible FTPC tracks
90  if (track->fitTraits().numberOfFitPoints()<6 || (track->fitTraits().numberOfFitPoints()>11)) continue;
91  // check eta range and FTPC east
92  if (track->geometry()->momentum().pseudoRapidity()>-2.8 || track->geometry()->momentum().pseudoRapidity()<=-3.8) continue;
93  // check pt
94  if (track->geometry()->momentum().perp()>=3) continue;
95  // finally, check dca, if a track satisfies gets inside the if, count it.
96  StTrack *glt = (StTrack *) track->node()->track(global);
97  if (glt->geometry()->helix().distance(primVtx->position())<3) ++countedTracks;
98  }
99  return countedTracks;
100 }
101 
102 inline unsigned int
103 uncorrectedNumberOfFtpcEastPrimaries(const StEvent& evt, int vtx_id = 0)
104 {
105  const StPrimaryVertex* primVtx = evt.primaryVertex(vtx_id);
106  return uncorrectedNumberOfFtpcEastPrimaries(primVtx);
107 }
108 
109 inline unsigned int
110 uncorrectedNumberOfFtpcWestPrimaries(const StPrimaryVertex*& primVtx)
111 {
112 
113  if (!multiplicityEventCutFtpc(primVtx)) return 9999;
114  const StSPtrVecPrimaryTrack& tracks = primVtx->daughters();
115 
116  size_t countedTracks = 0;
117  for (StSPtrVecPrimaryTrackConstIterator iter = tracks.begin(); iter != tracks.end(); iter++) {
118  StTrack* track = (*iter);
119  // check if possible FTPC tracks
120  if (track->fitTraits().numberOfFitPoints()<6 || (track->fitTraits().numberOfFitPoints()>11)) continue;
121  // check eta range and FTPC west
122  if (track->geometry()->momentum().pseudoRapidity()<=2.8 || track->geometry()->momentum().pseudoRapidity()>3.8) continue;
123  // check pt
124  if (track->geometry()->momentum().perp()>=3) continue;
125  // finally, check dca, if a track satisfies gets inside the if, count it.
126  if (((StTrack *)track->node()->track(global))->geometry()->helix().distance(primVtx->position())<3) ++countedTracks;
127  }
128  return countedTracks;
129 }
130 
131 inline unsigned int
132 uncorrectedNumberOfFtpcWestPrimaries(const StEvent& evt, int vtx_id = 0)
133 {
134  const StPrimaryVertex* primVtx = evt.primaryVertex(vtx_id);
135  return uncorrectedNumberOfFtpcWestPrimaries(primVtx);
136 }
137 
138 
139 inline unsigned int
140 uncorrectedNumberOfFtpcPrimaries(const StEvent& evt, int vtx_id)
141 {
142  const StPrimaryVertex* primVtx = evt.primaryVertex(vtx_id);
143  if (!multiplicityEventCutFtpc(primVtx)) return 9999;
144 
145  return uncorrectedNumberOfFtpcWestPrimaries(primVtx) + uncorrectedNumberOfFtpcEastPrimaries(primVtx);
146 }
147 
148 inline unsigned int
149 uncorrectedBinOfFtpcEastCentrality(StEvent& evt)
150 {
151 
152  size_t countedTracks = uncorrectedNumberOfFtpcEastPrimaries(evt);
153 
154  unsigned int cent[] = {0,10,17};
155  if (countedTracks!=9999)
156  {
157  if (countedTracks < cent[1]) { return 1; }
158  else if (countedTracks < cent[2]) { return 2; }
159  else { return 3; }
160  }
161  else {return 99;}
162 
163 }
164 #endif
double distance(const StThreeVector< double > &p, bool scanPeriods=true) const
minimal distance between point and helix
Definition: StHelix.cc:240