StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
CutRc.cxx
1 #include "CutRc.h"
2 
3 //------------------------------------------------------------
4 //This is the STANDARD Event Cut - Should always be used
5 //definitions of internal cuts are listed in order beneath
6 //------------------------------------------------------------
7 bool
8 CutRc::Accept(StHiMicroEvent* event)
9 {
10 
11  return(
12  AcceptVertexZ(event) && AcceptCent(event) && AcceptTrgWord(event)
13  );
14 }
15 //--------------
16 
17 bool
18 CutRc::AcceptVertexZ(StHiMicroEvent* event)
19 {
20 
21  return(
22  event->VertexZ() >= mVertexZ[0] &&
23  event->VertexZ() <= mVertexZ[1]
24  );
25 }
26 //--------------
27 
28 bool
29 CutRc::AcceptEastSideVertexZ(StHiMicroEvent* event)
30 {
31  //East is negative
32  return( event->VertexZ() < 0 );
33 }
34 //--------------
35 
36 bool
37 CutRc::AcceptWestSideVertexZ(StHiMicroEvent* event)
38 {
39  //West is positive
40  return( event->VertexZ() > 0 );
41 }
42 //--------------
43 
44 bool
45 CutRc::AcceptCent(StHiMicroEvent* event)
46 {
47  bool acceptCent = false;
48  if (mFlowCent[0] >= 0 && mFlowCent[1] >= 0)
49  { acceptCent=AcceptFlowCent(event); }
50  else
51  { acceptCent=AcceptZDCCent(event); }
52 
53  return acceptCent;
54 }
55 //--------------
56 
57 bool
58 CutRc::AcceptFlowCent(StHiMicroEvent* event)
59 {
60  return (
61  flowCentrality(event->NUncorrectedPrimaries()) >= mFlowCent[0] &&
62  flowCentrality(event->NUncorrectedPrimaries()) <= mFlowCent[1]
63  );
64 }
65 //----------------
66 
67 bool
68 CutRc::AcceptZDCCent(StHiMicroEvent* event)
69 {
70  return (
71  event->ZDCe()+event->ZDCw() >= mZDCSum[0] &&
72  event->ZDCe()+event->ZDCw() <= mZDCSum[1]
73  );
74 }
75 //----------------
76 
77 bool
78 CutRc::AcceptTrgWord(StHiMicroEvent* event)
79 {
80  bool acceptTrgWord = false;
81 
82  if (event->L3UnbiasedTrigger()) { //First check for bias, then check the word
83 // if (mFlowCent[0] >= 0 && mFlowCent[1] >= 0) {
84  if (event->L0TriggerWord() == 4096) acceptTrgWord = true; //Hadronic Minbias
85 // } else {
86  if (event->L0TriggerWord() == 4352) acceptTrgWord = true; //Hadronic Central
87 // }
88  }
89 
90  return acceptTrgWord;
91 
92 }
93 //---------------
94 
95 //--------------------------------
96 //Composite Track Cuts
97 //Individual cuts listed beneath
98 //--------------------------------
99 bool
100 CutRc::Accept(StHiMicroTrack* track)
101 {
102  return (
103  track
104  && AcceptFitPts(track)
105  && AcceptEta(track)
106  && AcceptSDcaGl(track)
107  && AcceptFirstPadrow(track)
108  && AcceptSameSector(track)
109  );
110 }
111 //--------------
112 
113 bool
114 CutRc::AcceptNoDca(StHiMicroTrack* track)
115 {
116  return (
117  track
118  && AcceptFitPts(track)
119  && AcceptEta(track)
120  && AcceptFirstPadrow(track)
121  && AcceptSameSector(track)
122  );
123 }
124 //----------------
125 
126 bool
127 CutRc::AcceptNoEta(StHiMicroTrack* track)
128 {
129  return (
130  track
131  && AcceptFitPts(track)
132  && AcceptSDcaGl(track)
133  && AcceptFirstPadrow(track)
134  && AcceptSameSector(track)
135  );
136 }
137 //----------------
138 
139 //-------------------------
140 //Individual Track Cuts
141 //-------------------------
142 bool
143 CutRc::AcceptFitPts(StHiMicroTrack* track)
144 {
145  return(
146  track->FitPts() >= mFitPts[0] &&
147  track->FitPts() <= mFitPts[1]
148  );
149 }
150 //---------------
151 
152 bool
153 CutRc::AcceptEta(StHiMicroTrack* track)
154 {
155  return(
156  track->EtaPr() >= mEta[0] &&
157  track->EtaPr() <= mEta[1]
158  );
159 }
160 //---------------
161 
162 bool
163 CutRc::AcceptSDcaGl(StHiMicroTrack* track)
164 {
165  return(
166  track->DcaGl() >= mSDcaGl[0] &&
167  track->DcaGl() <= mSDcaGl[1] &&
168  track->DcaXYGl() >= mDcaXYGl[0] &&
169  track->DcaXYGl() <= mDcaXYGl[1]
170  );
171 }
172 //---------------
173 
174 bool
175 CutRc::AcceptFirstPadrow(StHiMicroTrack* track)
176 {
177  int firstPadrow = track->FirstPadRow();
178 
179  return (track && firstPadrow>=mFirstPadrow[0]
180  && firstPadrow<=mFirstPadrow[1]);
181 
182 }
183 //----------------
184 
185 bool
186 CutRc::AcceptSameSector(StHiMicroTrack* track)
187 {
188 
189  //The track begins and ends in the same sector
190  //but only if we select for that in the cuts,
191  //otherwise, pass on through...
192  if (mSameSector) {
193  return (track && track->FirstSector() == track->LastSector());
194  } else {
195  return true;
196  }
197 
198 }
199 //----------------
200 
201 bool
202 CutRc::AcceptWestSideTrack(StHiMicroTrack* track)
203 {
204  //The track was on the west side only
205  //Sectors 1-12 are on the West side
206  return (track && track->FirstSector() <= 12 && track->LastSector() <= 12);
207 
208 }
209 //----------------
210 
211 bool
212 CutRc::AcceptEastSideTrack(StHiMicroTrack* track)
213 {
214  //The track was on the east side only
215  //Sectors 13-24 are on the East side
216  return (track && track->FirstSector() >= 13 && track->LastSector() >= 13);
217 
218 }
219 //----------------
220 
221 bool
222 CutRc::AcceptTrackVtxZHalf(StHiMicroTrack* track, Float_t vtxZ)
223 {
224  //Track and vertex on the same side of the central membrane
225  if ((AcceptWestSideTrack(track) && vtxZ > 0) || (AcceptEastSideTrack(track) && vtxZ < 0))
226  { return true; } else { return false; }
227 
228 }
229 
230 bool
231 CutRc::AcceptTrackHalf(StHiMicroTrack* track)
232 {
233  //Track only on one side of the central membrane
234  if (mCrossCM) {
235  return true;
236  } else {
237  if (AcceptWestSideTrack(track) || AcceptEastSideTrack(track))
238  { return true; } else { return false; }
239  }
240 }
241