mikesStarStandardEventCut.cxx 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. /***************************************************************************
  2. *
  3. * $Id: mikesStarStandardEventCut.cxx,v 1.1 2000/09/04 16:27:15 lisa Exp $
  4. *
  5. * Author: Mike Lisa, Ohio State, lisa@mps.ohio-state.edu
  6. ***************************************************************************
  7. *
  8. * Description: part of STAR HBT Framework: StHbtMaker package
  9. * A simple event-wise cut that selects on multiplicity and z-position
  10. * of primary vertex. This one calculates and then cuts on the number of
  11. * negative primary tracks with -0.5<eta<0.5, which is the STAR standard.
  12. * The cuts are (copied from StEventUtilities/StuRefMult.hh
  13. * primary tracks only
  14. * flag > 0
  15. * charge < 0
  16. * fit points >= 10
  17. * abs(eta) < 0.5
  18. * dca < 3 cm
  19. *
  20. * Also, this cut was used to check the correlation between the "old"
  21. * HBT multiplicity and the "new" STAR standard multiplicity definition,
  22. * by way of an output ASCII file. I have commented this part out, but
  23. * just uncomment it in the constructor (where the file is openned) and
  24. * in the Pass() method (where the file is written to) and you will get
  25. * the file.
  26. *
  27. ***************************************************************************
  28. *
  29. * $Log: mikesStarStandardEventCut.cxx,v $
  30. * Revision 1.1 2000/09/04 16:27:15 lisa
  31. * added StarStandard multiplicity cut and modified mikesTrackCut to allow NOT cutting on charge sign
  32. *
  33. *
  34. **************************************************************************/
  35. #include "StHbtMaker/Cut/mikesStarStandardEventCut.h"
  36. #include <cstdio>
  37. #ifdef __ROOT__
  38. ClassImp(mikesStarStandardEventCut)
  39. #endif
  40. mikesStarStandardEventCut::mikesStarStandardEventCut(){
  41. mNEventsPassed = mNEventsFailed = 0;
  42. // mOutFile = new ofstream("Mult_vs_mult.dat");
  43. }
  44. //------------------------------
  45. //mikesStarStandardEventCut::~mikesStarStandardEventCut(){
  46. // mOutFile->close();
  47. // delete mOutFile;
  48. // /* noop */
  49. //}
  50. //------------------------------
  51. bool mikesStarStandardEventCut::Pass(const StHbtEvent* event){
  52. double VertexZPos = event->PrimVertPos().z();
  53. cout << "mikesStarStandardEventCut:: VertexZPos: " << mVertZPos[0] << " < " << VertexZPos << " < " << mVertZPos[1] << endl;
  54. bool goodEvent =
  55. ((VertexZPos > mVertZPos[0]) &&
  56. (VertexZPos < mVertZPos[1]));
  57. if (goodEvent){
  58. // int mult = event->NumberOfTracks();
  59. int mult = 0;
  60. StHbtTrack* track;
  61. for (StHbtTrackIterator pIter=event->TrackCollection()->begin();pIter!=event->TrackCollection()->end();pIter++){
  62. track = *pIter;
  63. if ((track->Charge()<0)&&(track->NHits()>=10)&&(track->DCAxy()<3.0)&&(fabs(track->P().pseudoRapidity())<0.5)){
  64. mult++;
  65. }
  66. }
  67. // (*mOutFile) << event->NumberOfTracks() << " " << mult << " " << VertexZPos << endl;
  68. cout << "mikesStarStandardEventCut:: mult: " << mEventMult[0] << " < " << mult << " < " << mEventMult[1] << endl;
  69. goodEvent = (goodEvent&& (mult > mEventMult[0]) && (mult < mEventMult[1]));
  70. }
  71. goodEvent ? mNEventsPassed++ : mNEventsFailed++ ;
  72. cout << "mikesStarStandardEventCut:: return : " << goodEvent << endl;
  73. return (goodEvent);
  74. }
  75. //------------------------------
  76. StHbtString mikesStarStandardEventCut::Report(){
  77. string Stemp;
  78. char Ctemp[100];
  79. sprintf(Ctemp,"\nMultiplicity:\t %d-%d",mEventMult[0],mEventMult[1]);
  80. Stemp = Ctemp;
  81. sprintf(Ctemp,"\nVertex Z-position:\t %E-%E",mVertZPos[0],mVertZPos[1]);
  82. Stemp += Ctemp;
  83. sprintf(Ctemp,"\nNumber of events which passed:\t%ld Number which failed:\t%ld",mNEventsPassed,mNEventsFailed);
  84. Stemp += Ctemp;
  85. StHbtString returnThis = Stemp;
  86. return returnThis;
  87. }