|
18 | 18 | #include <TH1F.h> |
19 | 19 | #include <TDirectory.h> |
20 | 20 | #include <THn.h> |
21 | | -#include <TLorentzVector.h> |
22 | 21 | #include <TMath.h> |
23 | 22 | #include <TObjArray.h> |
24 | 23 | #include <TFile.h> |
25 | 24 | #include <TH2F.h> |
26 | | -#include <TLorentzVector.h> |
27 | 25 |
|
28 | 26 | #include <cmath> |
29 | 27 | #include <string> |
|
33 | 31 | #include <cstdlib> |
34 | 32 | #include <iterator> // std::prev |
35 | 33 |
|
| 34 | +#include "Math/Vector4D.h" |
| 35 | +#include "Math/Boost.h" |
| 36 | + |
36 | 37 | #include "Framework/ASoAHelpers.h" |
37 | 38 | #include "Framework/runDataProcessing.h" |
38 | 39 | #include "Framework/AnalysisTask.h" |
@@ -731,21 +732,27 @@ struct PiDeuteronFemto { |
731 | 732 |
|
732 | 733 | double computeKstar(const PiDecandidate& piDecand) |
733 | 734 | { |
734 | | - TLorentzVector De, hadron; |
735 | | - float massDe = 1.8756; |
736 | | - float massHad = 0.1395704; |
737 | | - De.SetPtEtaPhiM(abs(piDecand.recoPtDe()), piDecand.recoEtaDe(), piDecand.recoPhiDe(), massDe); |
738 | | - hadron.SetPtEtaPhiM(abs(piDecand.recoPtPi()), piDecand.recoEtaPi(), piDecand.recoPhiPi(), massHad); |
739 | | - |
740 | | - TLorentzVector p_total_lab = De + hadron; |
741 | | - TVector3 v_cm = p_total_lab.BoostVector(); |
742 | | - TLorentzVector p1_cm = De; |
743 | | - TLorentzVector p2_cm = hadron; |
744 | | - p1_cm.Boost(-v_cm); |
745 | | - p2_cm.Boost(-v_cm); |
746 | | - TLorentzVector p_diff_cm = p1_cm - p2_cm; |
747 | | - double kStar = sqrt(p_diff_cm.X() * p_diff_cm.X() + p_diff_cm.Y() * p_diff_cm.Y() + p_diff_cm.Z() * p_diff_cm.Z()); |
748 | | - return kStar / 2.0; |
| 735 | + constexpr double massDe = 1.8756; |
| 736 | + constexpr double massHad = 0.1395704; |
| 737 | + |
| 738 | + const ROOT::Math::PtEtaPhiMVector De(std::abs(piDecand.recoPtDe()), piDecand.recoEtaDe(), piDecand.recoPhiDe(), massDe); |
| 739 | + const ROOT::Math::PtEtaPhiMVector Had(std::abs(piDecand.recoPtPi()), piDecand.recoEtaPi(), piDecand.recoPhiPi(), massHad); |
| 740 | + const ROOT::Math::PtEtaPhiMVector trackSum = De + Had; |
| 741 | + |
| 742 | + const float beta = trackSum.Beta(); |
| 743 | + const float betax = beta * std::cos(trackSum.Phi()) * std::sin(trackSum.Theta()); |
| 744 | + const float betay = beta * std::sin(trackSum.Phi()) * std::sin(trackSum.Theta()); |
| 745 | + const float betaz = beta * std::cos(trackSum.Theta()); |
| 746 | + |
| 747 | + ROOT::Math::PxPyPzMVector DeCMS(De); |
| 748 | + ROOT::Math::PxPyPzMVector HadCMS(Had); |
| 749 | + |
| 750 | + const ROOT::Math::Boost boostPRF = ROOT::Math::Boost(-betax, -betay, -betaz); |
| 751 | + DeCMS = boostPRF(DeCMS); |
| 752 | + HadCMS = boostPRF(HadCMS); |
| 753 | + |
| 754 | + const ROOT::Math::PxPyPzMVector RelKstar = DeCMS - HadCMS; |
| 755 | + return 0.5 * RelKstar.P(); |
749 | 756 | } |
750 | 757 |
|
751 | 758 | void fillKstar(const PiDecandidate& piDecand) |
|
0 commit comments