trackCutMonitor_P_vs_Dedx.cxx 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. #include "StHbtMaker/Infrastructure/StHbtTrack.hh"
  2. #include "StHbtMaker/Infrastructure/StHbtTypes.hh"
  3. #include "StHbtMaker/Cut/trackCutMonitor_P_vs_Dedx.h"
  4. #ifdef __ROOT__
  5. ClassImp(trackCutMonitor_P_vs_Dedx)
  6. #endif
  7. //_________________
  8. trackCutMonitor_P_vs_Dedx::trackCutMonitor_P_vs_Dedx() { // default constructor
  9. mHisto = new TH2F("trackCutMonitor_P_vs_Dedx",
  10. "Momentum (GeV/c) vs Energy loss (a.u.)",
  11. 200,0.,2.,100,0.,10e-6);
  12. mCharge = 0;
  13. }
  14. //_________________
  15. trackCutMonitor_P_vs_Dedx::trackCutMonitor_P_vs_Dedx(int charge) {
  16. mHisto = new TH2F("trackCutMonitor_P_vs_Dedx",
  17. "Momentum (GeV/c) vs Energy loss (a.u.)",
  18. 200,0.,2.,100,0.,10e-6);
  19. mCharge = charge;
  20. }
  21. //_________________
  22. trackCutMonitor_P_vs_Dedx::trackCutMonitor_P_vs_Dedx(int charge,
  23. const char* TitCutMoni){
  24. mHisto = new TH2F(TitCutMoni,
  25. "Momentum (GeV/c) vs Energy loss (a.u.)",
  26. 200,0.,2.,100,0.,10e-6);
  27. mCharge = charge;
  28. }
  29. //_________________
  30. trackCutMonitor_P_vs_Dedx::trackCutMonitor_P_vs_Dedx(int charge,
  31. const char* TitCutMoni,
  32. const char* title,
  33. int nbins1, double min1,
  34. double max1,
  35. int nbins2, double min2,
  36. double max2){
  37. mHisto= new TH2F(title, TitCutMoni, nbins1 , min1, max1, nbins2 , min2, max2);
  38. mCharge = charge;
  39. }
  40. //_________________
  41. trackCutMonitor_P_vs_Dedx::trackCutMonitor_P_vs_Dedx(const trackCutMonitor_P_vs_Dedx& cutMoni){
  42. mCharge = cutMoni.mCharge;
  43. mHisto = new TH2F(*(cutMoni.mHisto));
  44. }
  45. //_________________
  46. trackCutMonitor_P_vs_Dedx::trackCutMonitor_P_vs_Dedx(const trackCutMonitor_P_vs_Dedx& cutMoni,
  47. int charge) {
  48. mCharge = charge;
  49. mHisto = new TH2F(*(cutMoni.mHisto));
  50. }
  51. //_________________
  52. trackCutMonitor_P_vs_Dedx::~trackCutMonitor_P_vs_Dedx(){
  53. delete mHisto;
  54. }
  55. //_________________
  56. void trackCutMonitor_P_vs_Dedx::Fill(const StHbtTrack* track){
  57. if (track->Charge() == mCharge || mCharge == 0)
  58. mHisto->Fill( track->P().mag() , track->dEdx(), 1.);
  59. }