Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions PWGLF/DataModel/Vtx3BodyTables.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
DECLARE_SOA_INDEX_COLUMN_FULL(TrackPi, trackPi, int, Tracks, "_pi"); //!
DECLARE_SOA_INDEX_COLUMN_FULL(TrackDe, trackDe, int, Tracks, "_de"); //!
DECLARE_SOA_INDEX_COLUMN(Collision, collision); //!
DECLARE_SOA_INDEX_COLUMN(Decay3Body, decay3body); //!

Check failure on line 36 in PWGLF/DataModel/Vtx3BodyTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-column]

Use UpperCamelCase for names of O2 columns and matching lowerCamelCase names for their getters.

// General 3 body Vtx properties
DECLARE_SOA_COLUMN(Mass, mass, float); //! candidate mass (with H3L or Anti-H3L mass hypothesis depending on deuteron charge)
Expand All @@ -59,16 +59,16 @@
DECLARE_SOA_COLUMN(PzTrackDe, pzTrackDe, float); //! track2 pz at min

// DCAs to PV
DECLARE_SOA_COLUMN(DCAXYTrackPrToPV, dcaXYtrackPrToPv, float); //! DCAXY of proton to PV

Check failure on line 62 in PWGLF/DataModel/Vtx3BodyTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-column]

Use UpperCamelCase for names of O2 columns and matching lowerCamelCase names for their getters.
DECLARE_SOA_COLUMN(DCAXYTrackPiToPV, dcaXYtrackPiToPv, float); //! DCAXY of pion to PV

Check failure on line 63 in PWGLF/DataModel/Vtx3BodyTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-column]

Use UpperCamelCase for names of O2 columns and matching lowerCamelCase names for their getters.
DECLARE_SOA_COLUMN(DCAXYTrackDeToPV, dcaXYtrackDeToPv, float); //! DCAXY of deuteron to PV

Check failure on line 64 in PWGLF/DataModel/Vtx3BodyTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-column]

Use UpperCamelCase for names of O2 columns and matching lowerCamelCase names for their getters.
DECLARE_SOA_COLUMN(DCAZTrackPrToPV, dcaZtrackPrToPv, float); //! DCAZ of proton to PV

Check failure on line 65 in PWGLF/DataModel/Vtx3BodyTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-column]

Use UpperCamelCase for names of O2 columns and matching lowerCamelCase names for their getters.
DECLARE_SOA_COLUMN(DCAZTrackPiToPV, dcaZtrackPiToPv, float); //! DCAZ of pion to PV

Check failure on line 66 in PWGLF/DataModel/Vtx3BodyTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-column]

Use UpperCamelCase for names of O2 columns and matching lowerCamelCase names for their getters.
DECLARE_SOA_COLUMN(DCAZTrackDeToPV, dcaZtrackDeToPv, float); //! DCAZ of deuteron to PV

Check failure on line 67 in PWGLF/DataModel/Vtx3BodyTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-column]

Use UpperCamelCase for names of O2 columns and matching lowerCamelCase names for their getters.

// DCAs to SV
DECLARE_SOA_COLUMN(DCATrackPrToSV, dcaTrackPrToSv, float); //! DCA of proton to SV

Check failure on line 70 in PWGLF/DataModel/Vtx3BodyTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-column]

Use UpperCamelCase for names of O2 columns and matching lowerCamelCase names for their getters.
DECLARE_SOA_COLUMN(DCATrackPiToSV, dcaTrackPiToSv, float); //! DCA of pion to SV

Check failure on line 71 in PWGLF/DataModel/Vtx3BodyTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-column]

Use UpperCamelCase for names of O2 columns and matching lowerCamelCase names for their getters.
DECLARE_SOA_COLUMN(DCATrackDeToSV, dcaTrackDeToSv, float); //! DCA of deuteron to SV
DECLARE_SOA_COLUMN(DCAVtxDaughters, dcaVtxdaughters, float); //! Quadratic sum of DCA between daughters at SV

Expand Down Expand Up @@ -122,6 +122,7 @@
DECLARE_SOA_COLUMN(GenPtDe, genPtDe, float); //! generated transverse momentum deuteron daughter particle
DECLARE_SOA_COLUMN(IsTrueH3L, isTrueH3l, bool); //! flag for true hypertriton candidate
DECLARE_SOA_COLUMN(IsTrueAntiH3L, isTrueAntiH3l, bool); //! flag for true anti-hypertriton candidate
DECLARE_SOA_COLUMN(MotherPdgCode, motherPdgCode, int); //! PDG code of the mother particle
DECLARE_SOA_COLUMN(PrPdgCode, prPdgCode, int); //! MC particle proton PDG code
DECLARE_SOA_COLUMN(PiPdgCode, piPdgCode, int); //! MC particle pion PDG code
DECLARE_SOA_COLUMN(DePdgCode, dePdgCode, int); //! MC particle deuteron PDG code
Expand Down Expand Up @@ -149,7 +150,7 @@
// Distance Over To Mom
DECLARE_SOA_DYNAMIC_COLUMN(DistOverTotMom, distovertotmom, //! PV to 3 body decay distance over total momentum
[](float X, float Y, float Z, float Px, float Py, float Pz, float pvX, float pvY, float pvZ) {
float P = RecoDecay::sqrtSumOfSquares(Px, Py, Pz);

Check failure on line 153 in PWGLF/DataModel/Vtx3BodyTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/function-variable]

Use lowerCamelCase for names of functions and variables.
return std::sqrt(std::pow(X - pvX, 2) + std::pow(Y - pvY, 2) + std::pow(Z - pvZ, 2)) / (P + 1E-10);
});

Expand Down Expand Up @@ -276,6 +277,7 @@
vtx3body::GenPtPr, vtx3body::GenPtPi, vtx3body::GenPtDe,
vtx3body::IsTrueH3L, vtx3body::IsTrueAntiH3L,
vtx3body::IsReco,
vtx3body::MotherPdgCode,
vtx3body::PrPdgCode, vtx3body::PiPdgCode, vtx3body::DePdgCode,
vtx3body::IsDePrimary,
vtx3body::IsSurvEvSel,
Expand Down
16 changes: 10 additions & 6 deletions PWGLF/TableProducer/Nuspex/decay3bodybuilder.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ struct decay3bodyBuilder {
bool isTrueH3L;
bool isTrueAntiH3L;
bool isReco;
int motherPdgCode;
int daughterPrPdgCode;
int daughterPiPdgCode;
int daughterDePdgCode;
Expand Down Expand Up @@ -849,16 +850,16 @@ struct decay3bodyBuilder {
// get generated mother MC info
if (motherID > 0) {
auto mcTrackH3L = mcParticles.rawIteratorAt(motherID);
int chargeFactor = mcTrackH3L.pdgCode() > 0 ? 1 : -1;
this3BodyMCInfo.motherPdgCode = mcTrackH3L.pdgCode();
this3BodyMCInfo.label = motherID;
this3BodyMCInfo.genMomentum = {mcTrackH3L.px(), mcTrackH3L.py(), mcTrackH3L.pz()};
this3BodyMCInfo.genDecVtx = {mcTrackProton.vx(), mcTrackProton.vy(), mcTrackProton.vz()};
this3BodyMCInfo.genCt = RecoDecay::sqrtSumOfSquares(mcTrackProton.vx() - mcTrackH3L.vx(), mcTrackProton.vy() - mcTrackH3L.vy(), mcTrackProton.vz() - mcTrackH3L.vz()) * o2::constants::physics::MassHyperTriton / mcTrackH3L.p();
this3BodyMCInfo.genPhi = mcTrackH3L.phi();
this3BodyMCInfo.genEta = mcTrackH3L.eta();
this3BodyMCInfo.genRapidity = mcTrackH3L.y();
this3BodyMCInfo.isTrueH3L = chargeFactor > 0;
this3BodyMCInfo.isTrueAntiH3L = chargeFactor < 0;
this3BodyMCInfo.isTrueH3L = this3BodyMCInfo.motherPdgCode > 0 ? true : false;
this3BodyMCInfo.isTrueAntiH3L = this3BodyMCInfo.motherPdgCode < 0 ? true : false;
}

// fill analysis tables (only McVtx3BodyDatas is filled here)
Expand All @@ -878,12 +879,12 @@ struct decay3bodyBuilder {
for (const auto& mcparticle : mcParticles) {
// MC info
resetMCInfo(this3BodyMCInfo);
this3BodyMCInfo.isReco = false;

// skip MC particle if reconstructed and already filled previously
if (mcParticleIsReco[mcparticle.globalIndex()] == true) {
continue;
}
this3BodyMCInfo.isReco = false;

// set flag if corresponding MC collision has matched reconstructed collision which passed event selection
this3BodyMCInfo.survivedEventSel = isGoodCollision[mcparticle.mcCollisionId()];
Expand Down Expand Up @@ -912,7 +913,7 @@ struct decay3bodyBuilder {
}

// check if hypertriton decayed via 3-body decay and is particle or anti-particle
if ((haveProton && haveAntiPion && haveDeuteron) || (haveAntiProton && havePion && haveAntiDeuteron)) {
if ((haveProton && haveAntiPion && haveDeuteron && !(haveAntiProton || havePion || haveAntiDeuteron)) || (haveAntiProton && havePion && haveAntiDeuteron && !(haveProton || haveAntiPion || haveDeuteron))) {
if (mcparticle.pdgCode() > 0) {
this3BodyMCInfo.isTrueH3L = true;
} else if (mcparticle.pdgCode() < 0) {
Expand Down Expand Up @@ -973,6 +974,7 @@ struct decay3bodyBuilder {
this3BodyMCInfo.genPtProton, this3BodyMCInfo.genPtPion, this3BodyMCInfo.genPtDeuteron,
this3BodyMCInfo.isTrueH3L, this3BodyMCInfo.isTrueAntiH3L,
this3BodyMCInfo.isReco,
mcparticle.pdgCode(),
this3BodyMCInfo.daughterPrPdgCode, this3BodyMCInfo.daughterPiPdgCode, this3BodyMCInfo.daughterDePdgCode,
this3BodyMCInfo.isDeuteronPrimary,
this3BodyMCInfo.survivedEventSel);
Expand Down Expand Up @@ -1160,6 +1162,7 @@ struct decay3bodyBuilder {
this3BodyMCInfo.genPtProton, this3BodyMCInfo.genPtPion, this3BodyMCInfo.genPtDeuteron,
this3BodyMCInfo.isTrueH3L, this3BodyMCInfo.isTrueAntiH3L,
this3BodyMCInfo.isReco,
this3BodyMCInfo.motherPdgCode,
this3BodyMCInfo.daughterPrPdgCode, this3BodyMCInfo.daughterPiPdgCode, this3BodyMCInfo.daughterDePdgCode,
this3BodyMCInfo.isDeuteronPrimary,
this3BodyMCInfo.survivedEventSel);
Expand Down Expand Up @@ -1240,7 +1243,7 @@ struct decay3bodyBuilder {

// ______________________________________________________________
// function to reset MCInfo
void resetMCInfo(mc3Bodyinfo mcInfo)
void resetMCInfo(mc3Bodyinfo& mcInfo)
{
mcInfo.label = -1;
mcInfo.genMomentum[0] = -1., mcInfo.genMomentum[1] = -1., mcInfo.genMomentum[2] = -1.;
Expand All @@ -1251,6 +1254,7 @@ struct decay3bodyBuilder {
mcInfo.genPtProton = -1., mcInfo.genPtPion = -1., mcInfo.genPtDeuteron = -1.;
mcInfo.isTrueH3L = false, mcInfo.isTrueAntiH3L = false;
mcInfo.isReco = false;
mcInfo.motherPdgCode = -1;
mcInfo.daughterPrPdgCode = -1, mcInfo.daughterPiPdgCode = -1, mcInfo.daughterDePdgCode = -1;
mcInfo.isDeuteronPrimary = false;
mcInfo.survivedEventSel = false;
Expand Down
Loading