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
12 changes: 6 additions & 6 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,18 +59,18 @@
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
DECLARE_SOA_COLUMN(DCATrackPiToSV, dcaTrackPiToSv, float); //! DCA of pion to SV
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
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(DCAVtxToDaughtersAv, dcaVtxToDaughtersAv, float); //! Quadratic sum of DCA between daughters at SV

// CosPA
DECLARE_SOA_COLUMN(CosPA, cosPA, float); //! Cosine of pointing angle of the 3body candidate
Expand Down Expand Up @@ -150,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 @@ -211,7 +211,7 @@
vtx3body::DCAXYTrackPrToPV, vtx3body::DCAXYTrackPiToPV, vtx3body::DCAXYTrackDeToPV,
vtx3body::DCAZTrackPrToPV, vtx3body::DCAZTrackPiToPV, vtx3body::DCAZTrackDeToPV,
vtx3body::DCATrackPrToSV, vtx3body::DCATrackPiToSV, vtx3body::DCATrackDeToSV,
vtx3body::DCAVtxDaughters,
vtx3body::DCAVtxToDaughtersAv,
vtx3body::CosPA, vtx3body::Ct,
vtx3body::TPCNSigmaPr, vtx3body::TPCNSigmaPi, vtx3body::TPCNSigmaDe, vtx3body::TPCNSigmaPiBach,
vtx3body::TOFNSigmaDe,
Expand Down Expand Up @@ -260,7 +260,7 @@
vtx3body::DCAXYTrackPrToPV, vtx3body::DCAXYTrackPiToPV, vtx3body::DCAXYTrackDeToPV,
vtx3body::DCAZTrackPrToPV, vtx3body::DCAZTrackPiToPV, vtx3body::DCAZTrackDeToPV,
vtx3body::DCATrackPrToSV, vtx3body::DCATrackPiToSV, vtx3body::DCATrackDeToSV,
vtx3body::DCAVtxDaughters,
vtx3body::DCAVtxToDaughtersAv,
vtx3body::CosPA, vtx3body::Ct,
vtx3body::TPCNSigmaPr, vtx3body::TPCNSigmaPi, vtx3body::TPCNSigmaDe, vtx3body::TPCNSigmaPiBach,
vtx3body::TOFNSigmaDe,
Expand Down
21 changes: 15 additions & 6 deletions PWGLF/TableProducer/Nuspex/decay3bodybuilder.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,9 @@ struct decay3bodyBuilder {
// building options
Configurable<bool> useKFParticle{"useKFParticle", false, "Use KFParticle for decay3body building"};
Configurable<bool> kfSetTopologicalConstraint{"kfSetTopologicalConstraint", false, "Set topological vertex constraint in case of KFParticle reconstruction"};
Configurable<bool> buildOnlyTracked{"buildOnlyTracked", false, "Build only tracked decay3bodys"};
Configurable<bool> useSelections{"useSelections", true, "Apply selections during decay3body building"};
Configurable<bool> useChi2Selection{"useChi2Selection", true, "Apply chi2 selection during decay3body building"};
Configurable<bool> useTPCforPion{"useTPCforPion", false, "Flag to ask for TPC info for pion track (PID, nClusters), false: pion track can be ITS only"};
Configurable<bool> acceptTPCOnly{"acceptTPCOnly", false, "Accept TPC only tracks as daughters"};
Configurable<bool> askOnlyITSMatch{"askOnlyITSMatch", true, "ask only ITS match to distinguish TPC only tracks"};
Expand All @@ -166,7 +168,7 @@ struct decay3bodyBuilder {
Configurable<float> minTOFnSigmaDeuteron{"minTOFnSigmaDeuteron", -5.0, "Min TOF nSigma of deuteron daughter"};
Configurable<float> maxTOFnSigmaDeuteron{"maxTOFnSigmaDeuteron", 5.0, "Max TOF nSigma of deuteron daughter"};
Configurable<float> minPDeuteronUseTOF{"minPDeuteronUseTOF", 1.0, "Min P of deuteron to use TOF PID"};
Configurable<float> maxDCADauAtSV{"maxDCADauAtSV", 0.5, "Max DCA of daughters at SV (quadratic sum of daughter DCAs between each other)"};
Configurable<float> maxDCADauToSVaverage{"maxDCADauToSVaverage", 0.5, "Max DCA of daughters to SV (quadratic sum of daughter DCAs to SV / 3)"};
// candidate selections
Configurable<float> maxRapidity{"maxRapidity", 1.0, "Max rapidity of decay3body vertex"};
Configurable<float> minPt{"minPt", 2.0, "Min Pt of decay3body candidate"};
Expand Down Expand Up @@ -326,7 +328,7 @@ struct decay3bodyBuilder {
helper.decay3bodyselections.minTOFnSigmaDeuteron = decay3bodyBuilderOpts.minTOFnSigmaDeuteron;
helper.decay3bodyselections.maxTOFnSigmaDeuteron = decay3bodyBuilderOpts.maxTOFnSigmaDeuteron;
helper.decay3bodyselections.minPDeuteronUseTOF = decay3bodyBuilderOpts.minPDeuteronUseTOF;
helper.decay3bodyselections.maxDCADauAtSV = decay3bodyBuilderOpts.maxDCADauAtSV;
helper.decay3bodyselections.maxDCADauToSVaverage = decay3bodyBuilderOpts.maxDCADauToSVaverage;
helper.decay3bodyselections.maxRapidity = decay3bodyBuilderOpts.maxRapidity;
helper.decay3bodyselections.minPt = decay3bodyBuilderOpts.minPt;
helper.decay3bodyselections.maxPt = decay3bodyBuilderOpts.maxPt;
Expand Down Expand Up @@ -393,7 +395,7 @@ struct decay3bodyBuilder {
LOGF(info, "-~> min TOF nSigma deuteron ......: %f", decay3bodyBuilderOpts.minTOFnSigmaDeuteron.value);
LOGF(info, "-~> max TOF nSigma deuteron ......: %f", decay3bodyBuilderOpts.maxTOFnSigmaDeuteron.value);
LOGF(info, "-~> min p bach use TOF ...........: %f", decay3bodyBuilderOpts.minPDeuteronUseTOF.value);
LOGF(info, "-~> max DCA dau at SV ............: %f", decay3bodyBuilderOpts.maxDCADauAtSV.value);
LOGF(info, "-~> max DCA dau at SV ............: %f", decay3bodyBuilderOpts.maxDCADauToSVaverage.value);
LOGF(info, "-~> max rapidity .................: %f", decay3bodyBuilderOpts.maxRapidity.value);
LOGF(info, "-~> min pT .......................: %f", decay3bodyBuilderOpts.minPt.value);
LOGF(info, "-~> max pT .......................: %f", decay3bodyBuilderOpts.maxPt.value);
Expand Down Expand Up @@ -720,6 +722,11 @@ struct decay3bodyBuilder {
registry.fill(HIST("Counters/hInputStatistics"), kVtx3BodyDatas, decay3bodys.size());
int lastRunNumber = -1;
for (const auto& decay3body : decay3bodys) {
// only build tracked decay3body if aksed
if (decay3bodyBuilderOpts.buildOnlyTracked && fTrackedClSizeVector[decay3body.globalIndex()] == 0) {
continue;
}

// skip decay3body without assigned collision
/// TODO: do we want this??
if (decay3body.collisionId() < 0) {
Expand Down Expand Up @@ -782,6 +789,7 @@ struct decay3bodyBuilder {
decay3bodyBuilderOpts.useKFParticle,
decay3bodyBuilderOpts.kfSetTopologicalConstraint,
decay3bodyBuilderOpts.useSelections,
decay3bodyBuilderOpts.useChi2Selection,
decay3bodyBuilderOpts.useTPCforPion,
decay3bodyBuilderOpts.acceptTPCOnly,
decay3bodyBuilderOpts.askOnlyITSMatch,
Expand Down Expand Up @@ -958,7 +966,7 @@ struct decay3bodyBuilder {
-1., -1., -1., // trackDCAxyToPV: 0 - proton, 1 - pion, 2 - deuteron
-1., -1., -1., // trackDCAzToPV: 0 - proton, 1 - pion, 2 - deuteron
-1., -1., -1., // daughterDCAtoSV: 0 - proton, 1 - pion, 2 - deuteron
-1., // daughterDCAatSV
-1., // daughterDCAtoSVaverage
-1., -1., // cosPA, ctau
-1., -1., -1., -1., // tpcNsigma: 0 - proton, 1 - pion, 2 - deuteron, 3 - bach with pion hyp
-1., // tofNsigmaDeuteron
Expand Down Expand Up @@ -1117,7 +1125,7 @@ struct decay3bodyBuilder {
helper.decay3body.trackDCAxyToPV[0], helper.decay3body.trackDCAxyToPV[1], helper.decay3body.trackDCAxyToPV[2], // 0 - proton, 1 - pion, 2 - deuteron
helper.decay3body.trackDCAzToPV[0], helper.decay3body.trackDCAzToPV[1], helper.decay3body.trackDCAzToPV[2], // 0 - proton, 1 - pion, 2 - deuteron
helper.decay3body.daughterDCAtoSV[0], helper.decay3body.daughterDCAtoSV[1], helper.decay3body.daughterDCAtoSV[2], // 0 - proton, 1 - pion, 2 - deuteron
helper.decay3body.daughterDCAatSV,
helper.decay3body.daughterDCAtoSVaverage,
helper.decay3body.cosPA, helper.decay3body.ctau,
helper.decay3body.tpcNsigma[0], helper.decay3body.tpcNsigma[1], helper.decay3body.tpcNsigma[2], helper.decay3body.tpcNsigma[2], // 0 - proton, 1 - pion, 2 - deuteron, 3 - bach with pion hyp
helper.decay3body.tofNsigmaDeuteron,
Expand Down Expand Up @@ -1146,7 +1154,7 @@ struct decay3bodyBuilder {
helper.decay3body.trackDCAxyToPV[0], helper.decay3body.trackDCAxyToPV[1], helper.decay3body.trackDCAxyToPV[2], // 0 - proton, 1 - pion, 2 - deuteron
helper.decay3body.trackDCAzToPV[0], helper.decay3body.trackDCAzToPV[1], helper.decay3body.trackDCAzToPV[2], // 0 - proton, 1 - pion, 2 - deuteron
helper.decay3body.daughterDCAtoSV[0], helper.decay3body.daughterDCAtoSV[1], helper.decay3body.daughterDCAtoSV[2], // 0 - proton, 1 - pion, 2 - deuteron
helper.decay3body.daughterDCAatSV,
helper.decay3body.daughterDCAtoSVaverage,
helper.decay3body.cosPA, helper.decay3body.ctau,
helper.decay3body.tpcNsigma[0], helper.decay3body.tpcNsigma[1], helper.decay3body.tpcNsigma[2], helper.decay3body.tpcNsigma[2], // 0 - proton, 1 - pion, 2 - deuteron, 3 - bach with pion hyp
helper.decay3body.tofNsigmaDeuteron,
Expand Down Expand Up @@ -1184,6 +1192,7 @@ struct decay3bodyBuilder {
decay3bodyBuilderOpts.useKFParticle,
decay3bodyBuilderOpts.kfSetTopologicalConstraint,
decay3bodyBuilderOpts.useSelections,
decay3bodyBuilderOpts.useChi2Selection,
decay3bodyBuilderOpts.useTPCforPion,
decay3bodyBuilderOpts.acceptTPCOnly,
decay3bodyBuilderOpts.askOnlyITSMatch,
Expand Down
31 changes: 11 additions & 20 deletions PWGLF/Utils/decay3bodyBuilderHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,11 @@ struct decay3bodyCandidate {
int sign;
float momentum[3];
float position[3];
// std::array<float, 3> momentum = {0.0f, 0.0f, 0.0f};
// std::array<float, 3> position = {0.0f, 0.0f, 0.0f};
// float dcaToPV = 0.0f;
// float dcaxyToPV = 0.0f;
float chi2 = 0.0f;
float trackedClSize = 0.0f;
float cosPA = 0.0f; // cosine of pointing angle
float ctau = 0.0f; // ctau of the candidate
float daughterDCAatSV = 0.0f; // quadratic sum of DCA between daughters at SV
float daughterDCAtoSVaverage = 0.0f; // average of quadratic sum of daughter DCAs to SV
std::array<float, 3> daughterDCAtoSV = {0.0f, 0.0f, 0.0f}; // 0 - pos, 1 - neg, 2 - bach

// covariance matrix
Expand Down Expand Up @@ -148,7 +144,7 @@ class decay3bodyBuilderHelper
double minTOFnSigmaDeuteron;
double maxTOFnSigmaDeuteron;
float minPDeuteronUseTOF;
float maxDCADauAtSV;
float maxDCADauToSVaverage;
// candidate
float maxRapidity;
float minPt;
Expand Down Expand Up @@ -188,6 +184,7 @@ class decay3bodyBuilderHelper
bool useKFParticle = false,
bool kfSetTopologicalConstraint = false,
bool useSelections = true,
bool useChi2Selection = true,
bool useTPCforPion = false,
bool acceptTPCOnly = false,
bool askOnlyITSMatch = true,
Expand Down Expand Up @@ -342,18 +339,6 @@ class decay3bodyBuilderHelper
auto trackPionPt = std::sqrt(decay3body.momPion[0] * decay3body.momPion[0] + decay3body.momPion[1] * decay3body.momPion[1]);
auto trackDeuteronPt = std::sqrt(decay3body.momDeuteron[0] * decay3body.momDeuteron[0] + decay3body.momDeuteron[1] * decay3body.momDeuteron[1]);

// DCA between daughters at SV
decay3body.daughterDCAatSV = std::hypot(
std::hypot(decay3body.posProton[0] - decay3body.posPion[0],
decay3body.posProton[1] - decay3body.posPion[1],
decay3body.posProton[2] - decay3body.posPion[2]),
std::hypot(decay3body.posProton[0] - decay3body.posDeuteron[0],
decay3body.posProton[1] - decay3body.posDeuteron[1],
decay3body.posProton[2] - decay3body.posDeuteron[2]),
std::hypot(decay3body.posPion[0] - decay3body.posProton[0],
decay3body.posPion[1] - decay3body.posProton[1],
decay3body.posPion[2] - decay3body.posProton[2]));

// daughter DCA to SV
// proton daughter
decay3body.daughterDCAtoSV[0] = std::hypot(
Expand All @@ -371,6 +356,12 @@ class decay3bodyBuilderHelper
decay3body.posDeuteron[1] - decay3body.position[1],
decay3body.posDeuteron[2] - decay3body.position[2]);

// DCA daughters to SV average of quadratic sum
decay3body.daughterDCAtoSVaverage = (decay3body.daughterDCAtoSV[0] * decay3body.daughterDCAtoSV[0] +
decay3body.daughterDCAtoSV[1] * decay3body.daughterDCAtoSV[1] +
decay3body.daughterDCAtoSV[2] * decay3body.daughterDCAtoSV[2]) /
3;

//_____________________________________________________
// selections after vertex fit
if (useSelections) {
Expand All @@ -392,7 +383,7 @@ class decay3bodyBuilderHelper
}

// daughter DCAs at SV
if (decay3body.daughterDCAatSV > decay3bodyselections.maxDCADauAtSV) {
if (decay3body.daughterDCAtoSVaverage > decay3bodyselections.maxDCADauToSVaverage) {
decay3body = {};
return false;
}
Expand All @@ -418,7 +409,7 @@ class decay3bodyBuilderHelper
}

// vertex chi2
if (decay3body.chi2 > decay3bodyselections.maxChi2) {
if (useChi2Selection && decay3body.chi2 > decay3bodyselections.maxChi2) {
decay3body = {};
return false;
}
Expand Down
Loading