fabricesPairCut.cxx 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. /***************************************************************************
  2. *
  3. * $Id: fabricesPairCut.cxx,v 1.3 2003/09/02 17:58:21 perev 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 do-nothing pair cut that simply says "true" to every pair
  10. *
  11. ***************************************************************************
  12. *
  13. * $Log: fabricesPairCut.cxx,v $
  14. * Revision 1.3 2003/09/02 17:58:21 perev
  15. * gcc 3.2 updates + WarnOff
  16. *
  17. * Revision 1.2 2002/12/12 17:03:51 kisiel
  18. * Add NDedxHits cut, slight modification for Y cuts and Fabrices probability
  19. *
  20. * Revision 1.1 2001/12/14 23:11:27 fretiere
  21. * Add class HitMergingCut. Add class fabricesPairCut = HitMerginCut + pair purity cuts. Add TpcLocalTransform function which convert to local tpc coord (not pretty). Modify StHbtTrack, StHbtParticle, StHbtHiddenInfo, StHbtPair to handle the hit information and cope with my code
  22. *
  23. * Revision 1.3 2000/01/25 17:35:02 laue
  24. * I. In order to run the stand alone version of the StHbtMaker the following
  25. * changes have been done:
  26. * a) all ClassDefs and ClassImps have been put into #ifdef __ROOT__ statements
  27. * b) unnecessary includes of StMaker.h have been removed
  28. * c) the subdirectory StHbtMaker/doc/Make has been created including everything
  29. * needed for the stand alone version
  30. *
  31. * II. To reduce the amount of compiler warning
  32. * a) some variables have been type casted
  33. * b) some destructors have been declared as virtual
  34. *
  35. * Revision 1.2 1999/07/06 22:33:21 lisa
  36. * Adjusted all to work in pro and new - dev itself is broken
  37. *
  38. * Revision 1.1.1.1 1999/06/29 16:02:56 lisa
  39. * Installation of StHbtMaker
  40. *
  41. **************************************************************************/
  42. #include "StHbtMaker/Cut/fabricesPairCut.h"
  43. #include <string>
  44. #include <cstdio>
  45. #include <Stsstream.h>
  46. #ifdef __ROOT__
  47. ClassImp(fabricesPairCut)
  48. #endif
  49. //__________________
  50. fabricesPairCut::fabricesPairCut():HitMergingPairCut(){
  51. mNPairsPassed = mNPairsFailed = 0;
  52. mPiKPairMinProb=0.;
  53. mPiPPairMinProb=0.;
  54. mElPairMaxProb=1.;
  55. mPiPiPairMaxProb=1.;
  56. mKKPairMaxProb=1.;
  57. }
  58. //__________________
  59. //fabricesPairCut::~fabricesPairCut(){
  60. // /* no-op */
  61. //}
  62. //__________________
  63. bool fabricesPairCut::Pass(const StHbtPair* pair){
  64. bool temp = ( pair->track1()->TrackId()!=pair->track2()->TrackId() &&
  65. pair->ElectronPairProbability() < mElPairMaxProb &&
  66. ((pair->track1()->Track()->PidProbPion()) *
  67. (pair->track2()->Track()->PidProbPion()))<=mPiPiPairMaxProb &&
  68. ((pair->track1()->Track()->PidProbKaon()) *
  69. (pair->track2()->Track()->PidProbKaon()))<=mKKPairMaxProb &&
  70. ((pair->track1()->Track()->PidProbPion()) *
  71. (pair->track2()->Track()->PidProbKaon()))>=mPiKPairMinProb &&
  72. ((pair->track1()->Track()->PidProbPion()) *
  73. (pair->track2()->Track()->PidProbProton()))>=mPiPPairMinProb &&
  74. pair->getFracOfMergedRow()<mMaxFracPair
  75. );
  76. temp ? mNPairsPassed++ : mNPairsFailed++;
  77. return temp;
  78. }
  79. //__________________
  80. StHbtString fabricesPairCut::Report(){
  81. string Stemp = "Fabrices Pair Cut - total dummy-- always returns true\n";
  82. char Ctemp[100];
  83. sprintf(Ctemp,"Number of pairs which passed:\t%ld Number which failed:\t%ld\n",mNPairsPassed,mNPairsFailed);
  84. Stemp += Ctemp;
  85. StHbtString returnThis = Stemp;
  86. return returnThis;
  87. }
  88. //__________________
  89. ostrstream* fabricesPairCut::finalReport() const{
  90. ostrstream* tFinalReport = new ostrstream;
  91. (*tFinalReport) << "_____ Fabrices pair Cut _____ " << endl
  92. << " N pairs passed : " << mNPairsPassed << endl
  93. << " N pairs failed : " << mNPairsFailed << endl
  94. << ends;
  95. return tFinalReport;
  96. }