fxtTrackCutMonitor.cxx 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. #include "StHbtMaker/Infrastructure/StHbtTrack.hh"
  2. #include "StHbtMaker/Cut/fxtTrackCutMonitor.h"
  3. #include <cstdio>
  4. #include <string>
  5. #include "StLorentzVector.hh"
  6. #ifdef __ROOT__
  7. ClassImp(fxtTrackCutMonitor)
  8. #endif
  9. //_________________
  10. fxtTrackCutMonitor::fxtTrackCutMonitor(const char* name,
  11. const double ParticleMass){ // default constructor
  12. monMass = ParticleMass;
  13. string s("fxtTrackCutMonitor");
  14. string n(name);
  15. mDCAGlobal= new StHbt1FHisto( (s+n+"mDCAGlobal").c_str(),
  16. "DCA Global; DCA Global (cm)",
  17. 100,0.,5.);
  18. mNhits = new StHbt1FHisto( (s+n+"mNhits").c_str(),"nHits;nHits",
  19. 50, 0., 50.);
  20. mP = new StHbt1FHisto( (s+n+"mP").c_str(),"Momentum;P (GeV/c)",
  21. 180,0.,1.8);
  22. mPt = new StHbt1FHisto( (s+n+"mPt").c_str(),
  23. "Transverse momentum; Pt (GeV/c)",
  24. 180,0.,1.8);
  25. mPtVsNsigmaPion = new StHbt2FHisto( (s+n+"mPtVsNsigmaPion").c_str(),
  26. "p{T} vs n#sigma(#pi);p_{T} (GeV/c);n#sigma(#pi)",
  27. 36,0.1,1.9,100,-10.,10.);
  28. mPtVsNsigmaKaon = new StHbt2FHisto( (s+n+"mPtVsNsigmaKaon").c_str(),
  29. "p_{T} vs n#sigma(K);p_{T} (GeV/c);n#sigma(K)",
  30. 36,0.1,1.9,100,-10.,10.);
  31. mPtVsNsigmaProton = new StHbt2FHisto( (s+n+"mPtVsNsigmaProton").c_str(),
  32. "p_{T} vs n#sigma(p);p_{T} (GeV/c);n#sigma(p)",
  33. 36,0.1,1.9,100,-10.,10.);
  34. mPvsDedx= new StHbt2FHisto( (s+n+"mPvsDedx").c_str(),
  35. "p vs dE/dx (a.u.);p (GeV/c); dE/dx (a.u.)",
  36. 180, 0.1, 1.9, 100, 0., 10.);
  37. mRapidity = new StHbt1FHisto( (s+n+"mRapidity").c_str(),
  38. "Rapidity;y",
  39. 70, -1.2, 1.2);
  40. mPseudoRapidity = new StHbt1FHisto( (s+n+"mPseudoRapidity").c_str(),
  41. "PseudoRapidity;#eta",
  42. 120, -1.2, 1.2);
  43. mPvsMassSqr = new StHbt2FHisto( (s+n+"mPvsMassSqr").c_str(),
  44. "p_{T} vs m^{2};p_{T} (GeV/c);m^{2} (GeV/c^{2})^{2}",
  45. 180,0.1,1.9,120, -0.1, 1.1);
  46. mPvsInvBeta = new StHbt2FHisto( (s+n+"mPvsInvBeta").c_str(),
  47. "1/#beta vs P;p (GeV/c);1/#beta",
  48. 180, 0.1, 1.9, 60, 0.8, 2.);
  49. #ifdef TPC_DNDX
  50. mPtVsDndxNsigmaPion = new StHbt2FHisto( (s+n+"mPtVsDndxNsigmaPion").c_str(),
  51. "p_{T} vs n#sigma^{dN/dx}(#pi);p_{T} (GeV/c);n#sigma^{dN/dx}(#pi)",
  52. 36,0.1,1.9, 100, -10., 10.);
  53. mPtVsDndxNsigmaKaon = new StHbt2FHisto( (s+n+"mPtVsDndxNsigmaKaon").c_str(),
  54. "p_{T} vs n#sigma^{dN/dx}(K);p_{T} (GeV/c);n#sigma^{dN/dx}(K)",
  55. 36,0.1,1.9, 100, -10., 10.);
  56. mPtVsDndxNsigmaProton = new StHbt2FHisto( (s+n+"mPtVsDndxNsigmaProton").c_str(),
  57. "p_{T} vs n#sigma^{dN/dx}(p);p_{T} (GeV/c);n#sigma^{dN/dx}(p)",
  58. 36,0.1,1.9, 100, -10., 10.);
  59. mPvsDndx= new StHbt2FHisto( (s+n+"mPvsDndx").c_str(),
  60. "p vs dN/dx (a.u.);p (GeV/c); dN/dx (a.u.)",
  61. 180, 0.1, 1.9, 400, 20., 100.);
  62. #endif
  63. }
  64. //_________________
  65. fxtTrackCutMonitor::fxtTrackCutMonitor( const fxtTrackCutMonitor& cutMoni) {
  66. mDCAGlobal =new StHbt1FHisto(*(cutMoni.mDCAGlobal));
  67. mNhits = new StHbt1FHisto(*(cutMoni.mNhits));
  68. mP = new StHbt1FHisto(*(cutMoni.mP));
  69. mPt = new StHbt1FHisto(*(cutMoni.mPt));
  70. mPtVsNsigmaPion = new StHbt2FHisto(*(cutMoni.mPtVsNsigmaPion));
  71. mPtVsNsigmaKaon = new StHbt2FHisto(*(cutMoni.mPtVsNsigmaKaon));
  72. mPtVsNsigmaProton = new StHbt2FHisto(*(cutMoni.mPtVsNsigmaProton));
  73. mPvsDedx =new StHbt2FHisto(*(cutMoni.mPvsDedx));
  74. mRapidity= new StHbt1FHisto(*(cutMoni.mRapidity));
  75. mPseudoRapidity= new StHbt1FHisto(*(cutMoni.mPseudoRapidity));
  76. mPvsMassSqr = new StHbt2FHisto(*(cutMoni.mPvsMassSqr));
  77. mPvsInvBeta = new StHbt2FHisto(*(cutMoni.mPvsInvBeta));
  78. #ifdef TPC_DNDX
  79. mPtVsDndxNsigmaPion = new StHbt2FHisto(*(cutMoni.mPtVsDndxNsigmaPion));
  80. mPtVsDndxNsigmaKaon = new StHbt2FHisto(*(cutMoni.mPtVsDndxNsigmaKaon));
  81. mPtVsDndxNsigmaProton = new StHbt2FHisto(*(cutMoni.mPtVsDndxNsigmaProton));
  82. mPvsDndx =new StHbt2FHisto(*(cutMoni.mPvsDndx));
  83. #endif
  84. }
  85. //_________________
  86. fxtTrackCutMonitor::~fxtTrackCutMonitor(){
  87. delete mDCAGlobal;
  88. delete mNhits;
  89. delete mP;
  90. delete mPt;
  91. delete mPtVsNsigmaPion;
  92. delete mPtVsNsigmaKaon;
  93. delete mPtVsNsigmaProton;
  94. delete mPvsDedx ;
  95. delete mRapidity;
  96. delete mPseudoRapidity;
  97. delete mPvsMassSqr;
  98. delete mPvsInvBeta;
  99. #ifdef TPC_DNDX
  100. delete mPtVsDndxNsigmaPion;
  101. delete mPtVsDndxNsigmaKaon;
  102. delete mPtVsDndxNsigmaProton;
  103. delete mPvsDndx;
  104. #endif
  105. }
  106. //_________________
  107. void fxtTrackCutMonitor::Fill(const StHbtTrack* track){
  108. float TEnergy = ::sqrt(track->P().mag2()+monMass*monMass);
  109. float TRapidity = 0.5*::log((TEnergy+track->P().z())/
  110. (TEnergy-track->P().z()));
  111. /*
  112. float TPhi = atan2(track->P().y(),track->P().x());
  113. if(TPhi<0.0) { TPhi += 2.*TMath::Pi(); }
  114. TPhi *= 180./TMath::Pi();
  115. */
  116. mDCAGlobal->Fill( track->DCAxyGlobal(), 1.); //using for DCAxyz global
  117. mNhits->Fill(track->NHits(), 1.);
  118. mP->Fill(track->P().mag(), 1.);
  119. mPt->Fill(track->Pt(), 1.);
  120. mPtVsNsigmaPion->Fill(track->Pt(), track->NSigmaPion(), 1.);
  121. mPtVsNsigmaKaon->Fill(track->Pt(), track->NSigmaKaon(), 1.);
  122. mPtVsNsigmaProton->Fill(track->Pt(), track->NSigmaProton(), 1.);
  123. mPvsDedx->Fill( fabs(track->P().mag()), track->dEdx()*1000000, 1.);
  124. mRapidity->Fill(TRapidity, 1.);
  125. mPseudoRapidity->Fill(track->Eta(), 1.);
  126. mPvsMassSqr->Fill(track->P().mag(), track->TofMassSqr(), 1.);
  127. mPvsInvBeta->Fill( fabs(track->P().mag()), (1./track->TofBeta()), 1.);
  128. #ifdef TPC_DNDX
  129. mPvsDndx->Fill(track->P().mag(), track->dNdx()*1000000, 1.);
  130. mPtVsDndxNsigmaPion->Fill(track->Pt(), track->DndxNSigmaPion(), 1.);
  131. mPtVsDndxNsigmaKaon->Fill(track->Pt(), track->DndxNSigmaKaon(), 1.);
  132. mPtVsDndxNsigmaProton->Fill(track->Pt(), track->DndxNSigmaProton(), 1.);
  133. #endif
  134. }