StFlowSelection.cxx 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273
  1. ////////////////////////////////////////////////////////////////////////////
  2. //
  3. // $Id: StFlowSelection.cxx,v 1.24 2004/12/09 23:43:38 posk Exp $
  4. //
  5. // Author: Art Poskanzer and Raimond Snellings, LBNL, Mar 2000
  6. // FTPC added by Markus Oldenburg, MPI, Dec 2000
  7. //
  8. // Description: Class for making selections
  9. //
  10. ////////////////////////////////////////////////////////////////////////////
  11. #include <Stiostream.h>
  12. #include <stdlib.h>
  13. #include "StFlowSelection.h"
  14. #include "StFlowEvent.h"
  15. #include "StFlowTrack.h"
  16. #define PR(x) cout << "##### FlowSelection: " << (#x) << " = " << (x) << endl;
  17. ClassImp(StFlowSelection)
  18. //-----------------------------------------------------------------------
  19. StFlowSelection::StFlowSelection() : mSubevent(-1) {
  20. // To make selections
  21. mPidPart[0] = '\0';
  22. mPtPart[0] = 0.;
  23. mPtPart[1] = 0.;
  24. mPtBinsPart = 0;
  25. mPPart[0] = 0.;
  26. mPPart[1] = 0.;
  27. mEtaPart[0] = 0.;
  28. mEtaPart[1] = 0.;
  29. mFitPtsPart[0] = 0;
  30. mFitPtsPart[1] = 0;
  31. mDedxPtsPart[0] = 0;
  32. mDedxPtsPart[1] = 0;
  33. mFitOverMaxPtsPart[0] = 0.;
  34. mFitOverMaxPtsPart[1] = 0.;
  35. mChiSqPart[0] = 0.;
  36. mChiSqPart[1] = 0.;
  37. mDcaGlobalPart[0] = 0.;
  38. mDcaGlobalPart[1] = 2.;
  39. mYPart[0] = 0.;
  40. mYPart[1] = 0.;
  41. }
  42. //-----------------------------------------------------------------------
  43. StFlowSelection::~StFlowSelection() {
  44. }
  45. //-----------------------------------------------------------------------
  46. Bool_t StFlowSelection::Select(StFlowEvent* pFlowEvent) {
  47. // Returns kTRUE if the event is selected
  48. return kTRUE;
  49. }
  50. //-----------------------------------------------------------------------
  51. Bool_t StFlowSelection::Select(StFlowTrack* pFlowTrack) {
  52. // Selects particles for event plane determination
  53. // Returns kTRUE if the track is selected
  54. // Selected for event plane
  55. if (!pFlowTrack->Select(mHarmonic, mSelection, mSubevent)) return kFALSE;
  56. return kTRUE;
  57. }
  58. //-----------------------------------------------------------------------
  59. Bool_t StFlowSelection::SelectPart(StFlowTrack* pFlowTrack) {
  60. // Selects particles for correlation with the event plane
  61. // Returns kTRUE if the track is selected
  62. // PID
  63. if (mPidPart[0] != '\0') {
  64. if (strstr(mPidPart, "h")!=0) {
  65. int charge = pFlowTrack->Charge();
  66. if (strcmp("h+", mPidPart)==0 && charge != 1) return kFALSE;
  67. if (strcmp("h-", mPidPart)==0 && charge != -1) return kFALSE;
  68. } else {
  69. const Char_t* pid = pFlowTrack->Pid();
  70. if (strstr(pid, mPidPart)==0) return kFALSE;
  71. }
  72. }
  73. // Pt
  74. float pt = pFlowTrack->Pt();
  75. if (mPtPart[1] > mPtPart[0] &&
  76. (pt < mPtPart[0] || pt >= mPtPart[1])) return kFALSE;
  77. // P
  78. float totalp = pFlowTrack->P();
  79. if (mPPart[1] > mPPart[0] &&
  80. (totalp < mPPart[0] || totalp >= mPPart[1])) return kFALSE;
  81. // Eta
  82. float eta = pFlowTrack->Eta();
  83. if (mEtaPart[1] > mEtaPart[0] &&
  84. (eta < mEtaPart[0] || eta >= mEtaPart[1])) return kFALSE;
  85. // Fit Points
  86. int fitPts = pFlowTrack->FitPts();
  87. if (mFitPtsPart[1] > mFitPtsPart[0] &&
  88. (fitPts < mFitPtsPart[0] || fitPts >= mFitPtsPart[1])) return kFALSE;
  89. // Dedx Points
  90. int dedxPts = pFlowTrack->NdedxPts();
  91. if (mDedxPtsPart[1] > mDedxPtsPart[0] &&
  92. (dedxPts < mDedxPtsPart[0] || dedxPts >= mDedxPtsPart[1])) return kFALSE;
  93. // Fit Points over Max Points
  94. int maxPts = pFlowTrack->MaxPts();
  95. float fitOverMaxPts = (float)fitPts/(float)maxPts;
  96. if (mFitOverMaxPtsPart[1] > mFitOverMaxPtsPart[0] &&
  97. (fitOverMaxPts < mFitOverMaxPtsPart[0] ||
  98. fitOverMaxPts >= mFitOverMaxPtsPart[1])) return kFALSE;
  99. // Chi Squared
  100. float chiSq = pFlowTrack->Chi2();
  101. if (mChiSqPart[1] > mChiSqPart[0] &&
  102. (chiSq < mChiSqPart[0] ||
  103. chiSq >= mChiSqPart[1])) return kFALSE;
  104. // Dca Global
  105. float globdca = pFlowTrack->DcaGlobal();
  106. if (mDcaGlobalPart[1] > mDcaGlobalPart[0] &&
  107. (globdca < mDcaGlobalPart[0] ||
  108. globdca >= mDcaGlobalPart[1])) return kFALSE;
  109. // Rapidity
  110. float Y = pFlowTrack->Y();
  111. if (mYPart[1] > mYPart[0] &&
  112. (Y < mYPart[0] || Y >= mYPart[1])) return kFALSE;
  113. return kTRUE;
  114. }
  115. //-----------------------------------------------------------------------
  116. void StFlowSelection::PrintList() const {
  117. cout << "#################################################################"
  118. << endl;
  119. cout << "# Selection List:" << endl;
  120. cout << "# Particles correlated with the event plane: " << mPidPart << endl;
  121. cout << "# Pt for particles correlated with the event plane: " <<
  122. mPtPart[0] << " to " << mPtPart[1] << " GeV/c" <<endl;
  123. cout << "# P for particles correlated with the event plane: " <<
  124. mPPart[0] << " to " << mPPart[1] << " GeV/c" <<endl;
  125. cout << "# Eta for particles correlated with the event plane: " <<
  126. mEtaPart[0] << " to " << mEtaPart[1] <<endl;
  127. cout << "# Y for particles correlated with the event plane: " <<
  128. mYPart[0] << " to " << mYPart[1] <<endl;
  129. cout << "# Fit Points for particles correlated with the event plane: " <<
  130. mFitPtsPart[0] << " to " << mFitPtsPart[1] <<endl;
  131. cout << "# Dedx Points for particles correlated with the event plane: " <<
  132. mDedxPtsPart[0] << " to " << mDedxPtsPart[1] <<endl;
  133. cout << "# Fit/Max Points for particles correlated with the event plane: "
  134. << mFitOverMaxPtsPart[0] << " to " << mFitOverMaxPtsPart[1] <<endl;
  135. cout << "# Chi2 for particles correlated with the event plane: " <<
  136. mChiSqPart[0] << " to " << mChiSqPart[1] <<endl;
  137. cout << "# Global Dca for particles correlated with the event plane: " <<
  138. mDcaGlobalPart[0] << " to " << mDcaGlobalPart[1] <<endl;
  139. cout << "#################################################################"
  140. << endl;
  141. }
  142. ////////////////////////////////////////////////////////////////////////////
  143. //
  144. // $Log: StFlowSelection.cxx,v $
  145. // Revision 1.24 2004/12/09 23:43:38 posk
  146. // Minor changes in code formatting.
  147. //
  148. // Revision 1.23 2004/12/07 17:01:13 posk
  149. // Changed the default value of the dca selection for particles correlated with
  150. // the event plane from 1 cm back to 2 cm.
  151. //
  152. // Revision 1.22 2004/08/18 00:19:21 oldi
  153. // Several changes were necessary to comply with latest changes of MuDsts and StEvent:
  154. //
  155. // nHits, nFitPoints, nMaxPoints
  156. // -----------------------------
  157. // From now on
  158. // - the fit points used in StFlowMaker are the fit points within the TPC xor FTPC (vertex excluded).
  159. // - the max. possible points used in StFlowMAker are the max. possible points within the TPC xor FTPC (vertex excluded).
  160. // - the number of points (nHits; not used for analyses so far) are the total number of points on a track, i. e.
  161. // TPC + SVT + SSD + FTPCeast + FTPCwest [reading from HBT event gives a warning, but it seems like nobody uses it anyhow].
  162. // - The fit/max plot (used to be (fit-1)/max) was updated accordingly.
  163. // - The default cuts for fit points were changed (only for the FTPC, since TPC doesn't set default cuts).
  164. // - All these changes are backward compatible, as long as you change your cuts for the fit points by 1 (the vertex used to
  165. // be included and is not included anymore). In other words, your results won't depend on old or new MuDst, StEvent,
  166. // PicoDsts as long as you use the new flow software (together with the latest MuDst and StEvent software version).
  167. // - For backward compatibility reasons the number of fit points which is written out to the flowpicoevent.root file
  168. // includes the vertex. It is subtracted internally while reading back the pico files. This is completely hidden from the
  169. // user.
  170. //
  171. // zFirstPoint
  172. // -----------
  173. // The positions of the first point of tracks which have points in the TPC can lie outside of the TPC (the tracks can start in
  174. // the SVT or SSD now). In this case, the first point of the track is obtained by extrapolating the track helix to the inner
  175. // radius of the TPC.
  176. //
  177. // Revision 1.21 2004/02/03 22:36:37 posk
  178. // Initialzed mPtBinsPart.
  179. //
  180. // Revision 1.20 2003/09/02 17:58:12 perev
  181. // gcc 3.2 updates + WarnOff
  182. //
  183. // Revision 1.19 2003/05/15 06:08:41 aihong
  184. // default PID is changed from none to NA, SetDedxPtsPart() added
  185. //
  186. // Revision 1.18 2002/06/12 22:36:44 posk
  187. // FitOverMax points cut/selection is now done on (FitPts - 1)/MaxPts.
  188. //
  189. // Revision 1.17 2002/06/10 22:51:02 posk
  190. // pt and eta weighting now default.
  191. // DcaGlobalPart default now 0 to 1 cm.
  192. // Event cut order changed.
  193. //
  194. // Revision 1.16 2002/01/31 01:04:52 posk
  195. // *** empty log message ***
  196. //
  197. // Revision 1.15 2001/11/09 21:10:57 posk
  198. // Switched from CERNLIB to TMath. Little q is now normalized.
  199. //
  200. // Revision 1.14 2001/05/22 20:17:58 posk
  201. // Now can do pseudorapidity subevents.
  202. //
  203. // Revision 1.13 2000/12/12 20:22:06 posk
  204. // Put log comments at end of files.
  205. // Deleted persistent StFlowEvent (old micro DST).
  206. //
  207. // Revision 1.12 2000/12/08 17:03:39 oldi
  208. // Phi weights for both FTPCs included.
  209. //
  210. // Revision 1.10 2000/09/16 22:20:32 snelling
  211. // Added selection on P and global DCA and fixed rapidity calulation
  212. //
  213. // Revision 1.9 2000/09/15 22:51:34 posk
  214. // Added pt weighting for event plane calcualtion.
  215. //
  216. // Revision 1.8 2000/09/15 01:20:02 snelling
  217. // Added methods for P and Y and added selection on Y
  218. //
  219. // Revision 1.7 2000/09/13 00:32:27 snelling
  220. // Added selections for particles correlated with reaction plane
  221. //
  222. // Revision 1.6 2000/08/31 18:58:26 posk
  223. // For picoDST, added version number, runID, and multEta for centrality.
  224. // Added centrality cut when reading picoDST.
  225. // Added pt and eta selections for particles corr. wrt event plane.
  226. //
  227. // Revision 1.5 2000/08/12 20:22:21 posk
  228. // Recalculate centrality in read from pico.
  229. //
  230. // Revision 1.4 2000/05/26 21:29:32 posk
  231. // Protected Track data members from overflow.
  232. //
  233. // Revision 1.2 2000/03/28 23:21:04 posk
  234. // Allow multiple instances of the AnalysisMaker.
  235. //
  236. // Revision 1.1 2000/03/15 23:28:53 posk
  237. // Added StFlowSelection.
  238. //
  239. ////////////////////////////////////////////////////////////////////////////