1919#include < TH1D.h>
2020#include < TDirectory.h>
2121#include < THn.h>
22- #include < TLorentzVector.h>
22+ // #include <TLorentzVector.h>
2323#include < TMath.h>
2424#include < TObjArray.h>
2525#include < TFile.h>
3939#include " TVector2.h"
4040#include " Math/Vector3D.h"
4141#include " Math/Vector4D.h"
42+ #include " Math/RotationZ.h"
4243#include " Math/GenVector/Boost.h"
4344#include < TMath.h>
4445
@@ -105,6 +106,7 @@ struct Chk892pp {
105106 using MCEventCandidates = soa::Join<EventCandidates, aod::McCollisionLabels>;
106107 using MCTrackCandidates = soa::Join<TrackCandidates, aod::McTrackLabels>;
107108 using MCV0Candidates = soa::Join<V0Candidates, aod::McV0Labels>;
109+ using LorentzVectorSetXYZM = ROOT::Math::LorentzVector<ROOT::Math::PxPyPzM4D<float >>;
108110
109111 HistogramRegistry histos{" histos" , {}, OutputObjHandlingPolicy::AnalysisObject};
110112
@@ -159,7 +161,7 @@ struct Chk892pp {
159161 Configurable<int> cfgMinOccupancy{"cfgMinOccupancy", -100, "maximum occupancy of tracks in neighbouring collisions in a given time range"};
160162 Configurable<bool> cfgNCollinTR{"cfgNCollinTR", false, "Additional selection for the number of coll in time range"};
161163*/
162- Configurable<int > cfgCentEst{" cfgCentEst" , 1 , " Centrality estimator, 1: FT0C, 2: FT0M" };
164+ Configurable<int > cfgCentEst{" cfgCentEst" , 2 , " Centrality estimator, 1: FT0C, 2: FT0M" };
163165
164166 // / PID Selections, pion
165167 struct : ConfigurableGroup {
@@ -442,15 +444,19 @@ struct Chk892pp {
442444 histos.print ();
443445 }
444446
447+ const int kCentFT0C = 1 ;
448+ const int kCentFT0M = 2 ;
449+ const float kInvalidCentrality = -999 .f;
450+
445451 template <typename CollisionType>
446452 float getCentrality (CollisionType const & collision)
447453 {
448- if (cfgCentEst == 1 ) {
454+ if (cfgCentEst == kCentFT0C ) {
449455 return collision.multFT0C ();
450- } else if (cfgCentEst == 2 ) {
456+ } else if (cfgCentEst == kCentFT0M ) {
451457 return collision.multFT0M ();
452458 } else {
453- return - 999 ;
459+ return kInvalidCentrality ;
454460 }
455461 }
456462
@@ -697,7 +703,7 @@ struct Chk892pp {
697703 {
698704 histos.fill (HIST (" QA/before/CentDist" ), lCentrality);
699705
700- TLorentzVector lDecayDaughter1, lDecayDaughter2, lResoSecondary, lDecayDaughter_bach, lResoKstar, lDaughterRot, lResonanceRot;
706+ LorentzVectorSetXYZM lDecayDaughter1, lDecayDaughter2, lResoSecondary, lDecayDaughter_bach, lResoKstar, lDaughterRot, lResonanceRot;
701707 std::vector<int > trackIndicies = {};
702708 std::vector<int > k0sIndicies = {};
703709
@@ -849,8 +855,8 @@ struct Chk892pp {
849855 auto k0sCand = dTracks2.rawIteratorAt (k0sIndex);
850856 auto trkkMass = k0sCand.mK0Short ();
851857
852- lDecayDaughter_bach. SetXYZM (bTrack.px (), bTrack.py (), bTrack.pz (), MassPionCharged);
853- lResoSecondary. SetXYZM (k0sCand.px (), k0sCand.py (), k0sCand.pz (), trkkMass);
858+ lDecayDaughter_bach = LorentzVectorSetXYZM (bTrack.px (), bTrack.py (), bTrack.pz (), MassPionCharged);
859+ lResoSecondary = LorentzVectorSetXYZM (k0sCand.px (), k0sCand.py (), k0sCand.pz (), trkkMass);
854860 lResoKstar = lResoSecondary + lDecayDaughter_bach;
855861
856862 // QA plots
@@ -875,11 +881,17 @@ struct Chk892pp {
875881 histos.fill (HIST (" QA/RotBkg/hRotBkg" ), lRotAngle);
876882 if (BkgEstimationConfig.cfgRotPion ) {
877883 lDaughterRot = lDecayDaughter_bach;
878- lDaughterRot.RotateZ (lRotAngle);
884+ // lDaughterRot.RotateZ(lRotAngle);
885+ ROOT::Math::RotationZ rot (lRotAngle);
886+ auto p3 = rot * lDaughterRot.Vect ();
887+ lDaughterRot = LorentzVectorSetXYZM (p3.X (),p3.Y (),p3.Z (),lDaughterRot.M ());
879888 lResonanceRot = lDaughterRot + lResoSecondary;
880889 } else {
881890 lDaughterRot = lResoSecondary;
882- lDaughterRot.RotateZ (lRotAngle);
891+ // lDaughterRot.RotateZ(lRotAngle);
892+ ROOT::Math::RotationZ rot (lRotAngle);
893+ auto p3 = rot * lDaughterRot.Vect ();
894+ lDaughterRot = LorentzVectorSetXYZM (p3.X (),p3.Y (),p3.Z (),lDaughterRot.M ());
883895 lResonanceRot = lDecayDaughter_bach + lDaughterRot;
884896 }
885897 typeKstar = bTrack.sign () > 0 ? BinType::kKstarP_Rot : BinType::kKstarN_Rot ;
0 commit comments