trackCutMonitor_Y_vs_Pt.cxx 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #include "StHbtMaker/Infrastructure/StHbtTrack.hh"
  2. #include "StHbtMaker/Infrastructure/StHbtTypes.hh"
  3. #include "StHbtMaker/Cut/trackCutMonitor_Y_vs_Pt.h"
  4. #include <cstdio>
  5. #ifdef __ROOT__
  6. ClassImp(trackCutMonitor_Y_vs_Pt)
  7. #endif
  8. trackCutMonitor_Y_vs_Pt::trackCutMonitor_Y_vs_Pt(){
  9. mHisto = new StHbt2DHisto("Y_vs_Pt","y vs Pt (GeV/c)",50,-2.,2,50,0.,2.);
  10. cout << " this " << this << endl;
  11. mHisto->SetDirectory(0);
  12. }
  13. //------------------------------
  14. trackCutMonitor_Y_vs_Pt::trackCutMonitor_Y_vs_Pt(double aMass, const char* TitCutMoni, const char* title,
  15. int nbins1, double min1, double max1,
  16. int nbins2, double min2, double max2):mMass(aMass){
  17. mHisto = new StHbt2DHisto(TitCutMoni, title, nbins1 , min1, max1, nbins2 , min2, max2);
  18. mHisto->SetDirectory(0);
  19. }
  20. //------------------------------
  21. trackCutMonitor_Y_vs_Pt::trackCutMonitor_Y_vs_Pt(const char* TitCutMoni, const char* title,
  22. int nbins1, double min1, double max1,
  23. int nbins2, double min2, double max2):mMass(0.139){
  24. mHisto = new StHbt2DHisto(TitCutMoni, title, nbins1 , min1, max1, nbins2 , min2, max2);
  25. mHisto->SetDirectory(0);
  26. }
  27. //------------------------------
  28. trackCutMonitor_Y_vs_Pt::~trackCutMonitor_Y_vs_Pt(){
  29. delete mHisto;
  30. }
  31. //------------------------------
  32. void trackCutMonitor_Y_vs_Pt::Fill(const StHbtTrack* track){
  33. StHbtLorentzVector L;
  34. L.setVect(track->P());
  35. L.setE(track->P().massHypothesis(mMass));
  36. mHisto->Fill( L.rapidity(), L.vect().perp(), 1.);
  37. }