StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
CutRc.cxx
1 #include "CutRc.h"
2 
3 bool
4 CutRc::AcceptTrackHalf(StHiMicroTrack* track, float vtxZ)
5 {
6  if(VertexSkipOn() &&
7  !IsOutSide(track->mFirstZ,track->mLastZ,mVertexZSkip)) return false;
8  if(mHitAvoid &&
9  !IsOutSide(track->mFirstZ,track->mLastZ,mHitAvoid)) return false;
10  if(Half() && !IsSameSide(vtxZ,track->mFirstZ,track->mLastZ)) return false;
11  if(HitHalf() && !IsHitSameSide(track->mFirstZ,track->mLastZ))
12  return false;
13  if(GeomHalf() && !IsGeomSameSide(vtxZ,track->mDipAngleGl))
14  return false;
15 
16  return true;
17 }
18 
19 bool
20 CutRc::AcceptCent(StHiMicroEvent* event)
21 {
22  bool acceptCent = false;
23  if(mDoFlowCent) acceptCent=AcceptFlowCent(event);
24  else if(mDoZdcCtbCent) acceptCent=AcceptZdcCtbCent(event);
25  else if(mDoHMinusCent) acceptCent=AcceptHMinusCent(event);
26  else if(mDoNchCent || mDoNchCentKludge) acceptCent=AcceptNchCent(event);
27  else acceptCent = false;
28 
29  return acceptCent;
30 }
31 
32 bool
33 CutRc::Accept(StHiMicroEvent* event)
34 {
35 
36 
37  return(
38  AcceptVertexZ(event) && AcceptCent(event)
39  );
40 }
41 
42 bool
43 CutRc::AcceptFlowCent(StHiMicroEvent* event)
44 {
45  return (
46  event->mCentrality >= mFlowCent[0] &&
47  event->mCentrality <= mFlowCent[1]
48  );
49 }
50 
51 bool
52 CutRc::AcceptZdcCtbCent(StHiMicroEvent* event)
53 {
54  float zdcSum = event->mZDCe + event->mZDCw;
55  float ctb = event->mCTB;
56  NchCentrality zdcCent = centrality(zdcSum,ctb);
57 
58  return(
59  zdcCent >= mZdcCtbCent[1] && // less central has higher value
60  zdcCent <= mZdcCtbCent[0]
61  );
62 }
63 
64 bool
65 CutRc::AcceptHMinusCent(StHiMicroEvent* event)
66 {
67  int nHMinus = event->mNUncorrectedNegativePrimaries;
68  NchCentrality cent = centralityHMinus(nHMinus);
69 
70  return(
71  cent >= mHMinusCent[1] && // less central has higher value
72  cent <= mHMinusCent[0]
73  );
74 }
75 
76 bool
77 CutRc::AcceptNchCent(StHiMicroEvent* event)
78 {
79  int nCh = event->mNUncorrectedPrimaries;
80  NchCentrality cent = centralityNch(nCh);
81  if(mDoNchCentKludge) cent = centralityNchKludge(nCh);
82 
83  return(
84  cent >= mNchCent[1] && // less central has higher value
85  cent <= mNchCent[0]
86  );
87 }
88 
89 bool
90 CutRc::AcceptVertexZ(StHiMicroEvent* event)
91 {
92 
93  return(
94  event->mVertexZ >= mVertexZ[0] &&
95  event->mVertexZ <= mVertexZ[1] &&
96  ( (!mVertexZSkip) ? true : fabs(event->mVertexZ)>mVertexZSkip )
97  );
98 }
99 
100 bool
101 CutRc::Accept(StHiMicroTrack* track)
102 {
103  return (
104  track &&
105  AcceptFitPts(track) &&
106  AcceptEta(track) &&
107  AcceptSDcaGl(track)
108  );
109 }
110 
111 bool
112 CutRc::AcceptNoEta(StHiMicroTrack* track)
113 {
114  return (
115  track &&
116  AcceptFitPts(track) &&
117  AcceptSDcaGl(track)
118  );
119 }
120 
121 bool
122 CutRc::AcceptFitPts(StHiMicroTrack* track)
123 {
124  return(
125  track->mFitPts >= mFitPts[0] &&
126  track->mFitPts <= mFitPts[1]
127  );
128 }
129 
130 bool
131 CutRc::AcceptEta(StHiMicroTrack* track)
132 {
133  return(
134  track->mEtaPr >= mEta[0] &&
135  track->mEtaPr <= mEta[1]
136  );
137 }
138 
139 bool
140 CutRc::AcceptSDcaGl(StHiMicroTrack* track)
141 {
142  return(
143  track->mDcaGl >= mSDcaGl[0] &&
144  track->mDcaGl <= mSDcaGl[1]
145  );
146 }