Skip to content

Commit 322aa31

Browse files
authored
[DPG] Add ccosThetaStar in D0 derived data creator for calibration studies (#15346)
1 parent ef0039e commit 322aa31

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

DPG/Tasks/AOTTrack/D0CalibTables.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,8 @@ DECLARE_SOA_COLUMN(Eta, eta, float); /
444444
DECLARE_SOA_COLUMN(Phi, phi, float); //! D0-candidate phi
445445
DECLARE_SOA_COLUMN(InvMassD0, invMassD0, float); //! invariant mass (D0 hypothesis)
446446
DECLARE_SOA_COLUMN(InvMassD0bar, invMassD0bar, float); //! invariant mass (D0bar hypothesis)
447+
DECLARE_SOA_COLUMN(CosThetaStarD0, cosThetaStarD0, float); //! D0-candidate cost* (Helicity frame, D0 mass hypothesis)
448+
DECLARE_SOA_COLUMN(CosThetaStarD0bar, cosThetaStarD0bar, float); //! D0-candidate cost* (Helicity frame, D0bar mass hypthesis)
447449
DECLARE_SOA_COLUMN(DecLength, decLength, uint8_t); //! compressed decay length
448450
DECLARE_SOA_COLUMN(DecLengthXY, decLengthXY, uint8_t); //! compressed decay length XY
449451
DECLARE_SOA_COLUMN(NormDecLength, normDecLength, uint8_t); //! compressed normalised decay length
@@ -472,6 +474,8 @@ DECLARE_SOA_TABLE(D0CalibCands, "AOD", "D0CALIBCAND",
472474
hf_calib::Phi,
473475
hf_calib::InvMassD0,
474476
hf_calib::InvMassD0bar,
477+
hf_calib::CosThetaStarD0,
478+
hf_calib::CosThetaStarD0bar,
475479
hf_calib::DecLength,
476480
hf_calib::DecLengthXY,
477481
hf_calib::NormDecLength,

DPG/Tasks/AOTTrack/derivedDataCreatorD0Calibration.cxx

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@
4141
#include <MathUtils/detail/TypeTruncation.h>
4242
#include <ReconstructionDataFormats/DCA.h>
4343

44+
#include <Math/GenVector/Boost.h>
45+
#include <Math/Vector3D.h> // IWYU pragma: keep (do not replace with Math/Vector3Dfwd.h)
46+
#include <Math/Vector3Dfwd.h>
47+
#include <Math/Vector4D.h> // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h)
48+
#include <Math/Vector4Dfwd.h>
4449
#include <TH1D.h>
4550
#include <TRandom3.h>
4651

@@ -412,6 +417,7 @@ struct DerivedDataCreatorD0Calibration {
412417
}
413418

414419
float invMassD0{0.f}, invMassD0bar{0.f};
420+
float cosThetaStarD0{0.f}, cosThetaStarD0bar{0.f};
415421
std::vector<float> bdtScoresD0{0.f, 1.f, 1.f}, bdtScoresD0bar{0.f, 1.f, 1.f}; // always selected a priori
416422
if (massHypo == D0MassHypo::D0 || massHypo == D0MassHypo::D0AndD0Bar) {
417423
invMassD0 = RecoDecay::m(std::array{pVecPos, pVecNeg}, std::array{o2::constants::physics::MassPiPlus, o2::constants::physics::MassKPlus});
@@ -424,6 +430,14 @@ struct DerivedDataCreatorD0Calibration {
424430
std::vector<float> featuresCandD0 = {dcaPos.getY(), dcaNeg.getY(), chi2PCA, cosPaD0, cosPaXYD0, decLenXYD0, decLenD0, dcaPos.getY() * dcaNeg.getY(), aod::pid_tpc_tof_utils::combineNSigma<false>(trackPos.tpcNSigmaPi(), trackPos.tofNSigmaPi()), aod::pid_tpc_tof_utils::combineNSigma<false>(trackNeg.tpcNSigmaKa(), trackNeg.tofNSigmaKa()), trackPos.tpcNSigmaPi(), trackPos.tpcNSigmaKa(), aod::pid_tpc_tof_utils::combineNSigma<false>(trackPos.tpcNSigmaKa(), trackPos.tofNSigmaKa()), trackNeg.tpcNSigmaPi(), trackNeg.tpcNSigmaKa(), aod::pid_tpc_tof_utils::combineNSigma<false>(trackNeg.tpcNSigmaPi(), trackNeg.tofNSigmaPi())};
425431
if (!mlResponse.isSelectedMl(featuresCandD0, ptD0, bdtScoresD0)) {
426432
massHypo -= D0MassHypo::D0;
433+
} else { // selected, we compute cost*
434+
ROOT::Math::PxPyPzMVector const fourVecPi = ROOT::Math::PxPyPzMVector(pVecPos[0], pVecPos[1], pVecPos[2], o2::constants::physics::MassPiPlus);
435+
ROOT::Math::PxPyPzMVector const fourVecMother = ROOT::Math::PxPyPzMVector(pVecD0[0], pVecD0[1], pVecD0[2], invMassD0);
436+
ROOT::Math::Boost const boost{fourVecMother.BoostToCM()};
437+
ROOT::Math::PxPyPzMVector const fourVecPiCM = boost(fourVecPi);
438+
ROOT::Math::XYZVector const threeVecPiCM = fourVecPiCM.Vect();
439+
ROOT::Math::XYZVector const helicityVec = fourVecMother.Vect();
440+
cosThetaStarD0 = helicityVec.Dot(threeVecPiCM) / std::sqrt(threeVecPiCM.Mag2()) / std::sqrt(helicityVec.Mag2());
427441
}
428442
}
429443
}
@@ -439,6 +453,14 @@ struct DerivedDataCreatorD0Calibration {
439453
std::vector<float> featuresCandD0bar = {dcaPos.getY(), dcaNeg.getY(), chi2PCA, cosPaD0, cosPaXYD0, decLenXYD0, decLenD0, dcaPos.getY() * dcaNeg.getY(), aod::pid_tpc_tof_utils::combineNSigma<false>(trackNeg.tpcNSigmaPi(), trackNeg.tofNSigmaPi()), aod::pid_tpc_tof_utils::combineNSigma<false>(trackPos.tpcNSigmaKa(), trackPos.tofNSigmaKa()), trackNeg.tpcNSigmaPi(), trackNeg.tpcNSigmaKa(), aod::pid_tpc_tof_utils::combineNSigma<false>(trackNeg.tpcNSigmaKa(), trackNeg.tofNSigmaKa()), trackPos.tpcNSigmaPi(), trackPos.tpcNSigmaKa(), aod::pid_tpc_tof_utils::combineNSigma<false>(trackPos.tpcNSigmaPi(), trackPos.tofNSigmaPi())};
440454
if (!mlResponse.isSelectedMl(featuresCandD0bar, ptD0, bdtScoresD0bar)) {
441455
massHypo -= D0MassHypo::D0Bar;
456+
} else { // selected, we compute cost*
457+
ROOT::Math::PxPyPzMVector const fourVecPi = ROOT::Math::PxPyPzMVector(pVecNeg[0], pVecNeg[1], pVecNeg[2], o2::constants::physics::MassPiPlus);
458+
ROOT::Math::PxPyPzMVector const fourVecMother = ROOT::Math::PxPyPzMVector(pVecD0[0], pVecD0[1], pVecD0[2], invMassD0bar);
459+
ROOT::Math::Boost const boost{fourVecMother.BoostToCM()};
460+
ROOT::Math::PxPyPzMVector const fourVecPiCM = boost(fourVecPi);
461+
ROOT::Math::XYZVector const threeVecPiCM = fourVecPiCM.Vect();
462+
ROOT::Math::XYZVector const helicityVec = fourVecMother.Vect();
463+
cosThetaStarD0bar = helicityVec.Dot(threeVecPiCM) / std::sqrt(threeVecPiCM.Mag2()) / std::sqrt(helicityVec.Mag2());
442464
}
443465
}
444466
}
@@ -813,6 +835,8 @@ struct DerivedDataCreatorD0Calibration {
813835
phiD0,
814836
invMassD0,
815837
invMassD0bar,
838+
cosThetaStarD0,
839+
cosThetaStarD0bar,
816840
getCompressedDecayLength(decLenD0),
817841
getCompressedDecayLength(decLenXYD0),
818842
getCompressedNormDecayLength(decLenD0 / errorDecayLengthD0),

0 commit comments

Comments
 (0)