fxtEventCutMonitor.cxx 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. #include "StHbtMaker/Infrastructure/StHbtEvent.hh"
  2. #include "StHbtMaker/Infrastructure/StHbtTypes.hh"
  3. #include "StHbtMaker/Cut/fxtEventCutMonitor.h"
  4. #include <cstdio>
  5. #include <cmath>
  6. #ifdef __ROOT__
  7. ClassImp(fxtEventCutMonitor)
  8. #endif
  9. //_________________
  10. fxtEventCutMonitor::fxtEventCutMonitor(){
  11. mVertexYvsVertexX = new StHbt2FHisto("VertexYvsVertexX",
  12. "VertexYvsVertexX;x (cm);y (cm)",
  13. 300, -6.,6., 300, -6.,6.);
  14. mVertexZ = new StHbt1FHisto("VertexZ", "VertexZ; z (cm)",
  15. 320, -80., 80.);
  16. mRefMult = new StHbt1FHisto("RefMult", "RefMult;RefMult",
  17. 600, -0.5, 599.5);
  18. mVpdVzDiff = new StHbt1FHisto("VpdVzDiff", "mVpdVzDiff",
  19. 40, -20., 20.);
  20. }
  21. //_________________
  22. fxtEventCutMonitor::fxtEventCutMonitor(const char* title1, const char* title2){
  23. char tit1[100];
  24. sprintf(tit1,"%s%s_VertexYvsVertexX",title1,title2);
  25. mVertexYvsVertexX = new StHbt2FHisto(tit1, "VertexYvsVertexX;x (cm);y (cm)",
  26. 300, -6.,6., 300, -6.,6.);
  27. sprintf(tit1,"%s%s_VertexZ",title1,title2);
  28. mVertexZ = new StHbt1FHisto(tit1, "VertexZ;z (cm)",
  29. 320, -80., 80.);
  30. sprintf(tit1,"%s%s_RefMult",title1,title2);
  31. mRefMult = new StHbt1FHisto(tit1, "RefMult;RefMult", 600, 0., 600.);
  32. sprintf(tit1,"%s%s_VpdVzDiff",title1,title2);
  33. mVpdVzDiff = new StHbt1FHisto(tit1, "VpdVzDiff", 40, -20., 20.);
  34. }
  35. //_________________
  36. fxtEventCutMonitor::~fxtEventCutMonitor(){
  37. // delete mScaler;
  38. delete mVertexYvsVertexX;
  39. delete mVertexZ;
  40. delete mRefMult;
  41. delete mVpdVzDiff;
  42. }
  43. //_________________
  44. void fxtEventCutMonitor::Fill(const StHbtEvent* event){
  45. mVertexYvsVertexX->Fill( event->PrimVertPos().x(), event->PrimVertPos().y(), 1.);
  46. mVertexZ->Fill( event->PrimVertPos().z(), 1.);
  47. mRefMult->Fill( event->UncorrectedNumberOfPrimaries(), 1.);
  48. mVpdVzDiff->Fill( (event->PrimVertPos().z() - event->VpdVz()), 1.);
  49. }
  50. //_________________
  51. void fxtEventCutMonitor::Finish(){
  52. std::cout << " entries in histogram mVertexYvsVertexX : "
  53. << mVertexYvsVertexX->Integral() << std::endl;
  54. std::cout << " entries in histogram mVertexZ : "
  55. << mVertexZ->Integral() << std::endl;
  56. std::cout << " entries in histogram mRefMult : "
  57. << mRefMult->Integral() << std::endl;
  58. std::cout << " entries in histogram mVpdVzDiff : "
  59. << mVpdVzDiff->Integral() << std::endl;
  60. }
  61. //_________________
  62. StHbtString fxtEventCutMonitor::Report(){
  63. string Stemp;
  64. char Ctemp[100];
  65. sprintf(Ctemp," fxtEventCutMonitor");
  66. Stemp=Ctemp;
  67. StHbtString returnThis = Stemp;
  68. return returnThis;
  69. }