mikesEventCut.cxx 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. /***************************************************************************
  2. *
  3. * $Id: mikesEventCut.cxx,v 1.7 2000/02/18 21:27:10 laue 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
  11. *
  12. ***************************************************************************
  13. *
  14. * $Log: mikesEventCut.cxx,v $
  15. * Revision 1.7 2000/02/18 21:27:10 laue
  16. * franksTrackCut changed. If mCharge is set to '0' there will be no cut
  17. * on charge. This is important for front-loaded cuts.
  18. *
  19. * Revision 1.6 2000/01/25 17:35:02 laue
  20. * I. In order to run the stand alone version of the StHbtMaker the following
  21. * changes have been done:
  22. * a) all ClassDefs and ClassImps have been put into #ifdef __ROOT__ statements
  23. * b) unnecessary includes of StMaker.h have been removed
  24. * c) the subdirectory StHbtMaker/doc/Make has been created including everything
  25. * needed for the stand alone version
  26. *
  27. * II. To reduce the amount of compiler warning
  28. * a) some variables have been type casted
  29. * b) some destructors have been declared as virtual
  30. *
  31. * Revision 1.5 1999/10/15 01:57:03 lisa
  32. * Important enhancement of StHbtMaker - implement Franks CutMonitors
  33. * ----------------------------------------------------------
  34. * This means 3 new files in Infrastructure area (CutMonitor),
  35. * several specific CutMonitor classes in the Cut area
  36. * and a new base class in the Base area (StHbtCutMonitor).
  37. * This means also changing all Cut Base class header files from .hh to .h
  38. * so we have access to CutMonitor methods from Cint command line.
  39. * This last means
  40. * 1) files which include these header files are slightly modified
  41. * 2) a side benefit: the TrackCuts and V0Cuts no longer need
  42. * a SetMass() implementation in each Cut class, which was stupid.
  43. * Also:
  44. * -----
  45. * Include Franks StHbtAssociationReader
  46. * ** None of these changes should affect any user **
  47. *
  48. * Revision 1.4 1999/07/24 16:24:20 lisa
  49. * adapt StHbtMaker to dev version of library - solaris still gives problems with strings
  50. *
  51. * Revision 1.3 1999/07/19 14:24:04 hardtke
  52. * modifications to implement uDST
  53. *
  54. * Revision 1.2 1999/07/06 22:33:21 lisa
  55. * Adjusted all to work in pro and new - dev itself is broken
  56. *
  57. * Revision 1.1.1.1 1999/06/29 16:02:56 lisa
  58. * Installation of StHbtMaker
  59. *
  60. **************************************************************************/
  61. #include "StHbtMaker/Cut/mikesEventCut.h"
  62. #include <cstdio>
  63. #ifdef __ROOT__
  64. ClassImp(mikesEventCut)
  65. #endif
  66. mikesEventCut::mikesEventCut(){
  67. mNEventsPassed = mNEventsFailed = 0;
  68. }
  69. //------------------------------
  70. //mikesEventCut::~mikesEventCut(){
  71. // /* noop */
  72. //}
  73. //------------------------------
  74. bool mikesEventCut::Pass(const StHbtEvent* event){
  75. int mult = event->NumberOfTracks();
  76. double VertexZPos = event->PrimVertPos().z();
  77. cout << "mikesEventCut:: mult: " << mEventMult[0] << " < " << mult << " < " << mEventMult[1] << endl;
  78. cout << "mikesEventCut:: VertexZPos: " << mVertZPos[0] << " < " << VertexZPos << " < " << mVertZPos[1] << endl;
  79. bool goodEvent =
  80. ((mult > mEventMult[0]) &&
  81. (mult < mEventMult[1]) &&
  82. (VertexZPos > mVertZPos[0]) &&
  83. (VertexZPos < mVertZPos[1]));
  84. goodEvent ? mNEventsPassed++ : mNEventsFailed++ ;
  85. cout << "mikesEventCut:: return : " << goodEvent << endl;
  86. return (goodEvent);
  87. }
  88. //------------------------------
  89. StHbtString mikesEventCut::Report(){
  90. string Stemp;
  91. char Ctemp[100];
  92. sprintf(Ctemp,"\nMultiplicity:\t %d-%d",mEventMult[0],mEventMult[1]);
  93. Stemp = Ctemp;
  94. sprintf(Ctemp,"\nVertex Z-position:\t %E-%E",mVertZPos[0],mVertZPos[1]);
  95. Stemp += Ctemp;
  96. sprintf(Ctemp,"\nNumber of events which passed:\t%ld Number which failed:\t%ld",mNEventsPassed,mNEventsFailed);
  97. Stemp += Ctemp;
  98. StHbtString returnThis = Stemp;
  99. return returnThis;
  100. }