Skip to content

Commit 4453df1

Browse files
committed
Change DCA at vtx quantity
Add option to select chi2 Add option to only build tracked 3bodys
1 parent 822373c commit 4453df1

File tree

3 files changed

+32
-32
lines changed

3 files changed

+32
-32
lines changed

PWGLF/DataModel/Vtx3BodyTables.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@ DECLARE_SOA_COLUMN(DCAZTrackPiToPV, dcaZtrackPiToPv, float); //! DCAZ of pion
6767
DECLARE_SOA_COLUMN(DCAZTrackDeToPV, dcaZtrackDeToPv, float); //! DCAZ of deuteron to PV
6868

6969
// DCAs to SV
70-
DECLARE_SOA_COLUMN(DCATrackPrToSV, dcaTrackPrToSv, float); //! DCA of proton to SV
71-
DECLARE_SOA_COLUMN(DCATrackPiToSV, dcaTrackPiToSv, float); //! DCA of pion to SV
72-
DECLARE_SOA_COLUMN(DCATrackDeToSV, dcaTrackDeToSv, float); //! DCA of deuteron to SV
73-
DECLARE_SOA_COLUMN(DCAVtxDaughters, dcaVtxdaughters, float); //! Quadratic sum of DCA between daughters at SV
70+
DECLARE_SOA_COLUMN(DCATrackPrToSV, dcaTrackPrToSv, float); //! DCA of proton to SV
71+
DECLARE_SOA_COLUMN(DCATrackPiToSV, dcaTrackPiToSv, float); //! DCA of pion to SV
72+
DECLARE_SOA_COLUMN(DCATrackDeToSV, dcaTrackDeToSv, float); //! DCA of deuteron to SV
73+
DECLARE_SOA_COLUMN(DCAVtxToDaughtersAv, dcaVtxToDaughtersAv, float); //! Quadratic sum of DCA between daughters at SV
7474

7575
// CosPA
7676
DECLARE_SOA_COLUMN(CosPA, cosPA, float); //! Cosine of pointing angle of the 3body candidate
@@ -211,7 +211,7 @@ DECLARE_SOA_TABLE(Vtx3BodyDatas, "AOD", "VTX3BODYDATA", //!
211211
vtx3body::DCAXYTrackPrToPV, vtx3body::DCAXYTrackPiToPV, vtx3body::DCAXYTrackDeToPV,
212212
vtx3body::DCAZTrackPrToPV, vtx3body::DCAZTrackPiToPV, vtx3body::DCAZTrackDeToPV,
213213
vtx3body::DCATrackPrToSV, vtx3body::DCATrackPiToSV, vtx3body::DCATrackDeToSV,
214-
vtx3body::DCAVtxDaughters,
214+
vtx3body::DCAVtxToDaughtersAv,
215215
vtx3body::CosPA, vtx3body::Ct,
216216
vtx3body::TPCNSigmaPr, vtx3body::TPCNSigmaPi, vtx3body::TPCNSigmaDe, vtx3body::TPCNSigmaPiBach,
217217
vtx3body::TOFNSigmaDe,
@@ -260,7 +260,7 @@ DECLARE_SOA_TABLE(McVtx3BodyDatas, "AOD", "MC3BODYDATA", //!
260260
vtx3body::DCAXYTrackPrToPV, vtx3body::DCAXYTrackPiToPV, vtx3body::DCAXYTrackDeToPV,
261261
vtx3body::DCAZTrackPrToPV, vtx3body::DCAZTrackPiToPV, vtx3body::DCAZTrackDeToPV,
262262
vtx3body::DCATrackPrToSV, vtx3body::DCATrackPiToSV, vtx3body::DCATrackDeToSV,
263-
vtx3body::DCAVtxDaughters,
263+
vtx3body::DCAVtxToDaughtersAv,
264264
vtx3body::CosPA, vtx3body::Ct,
265265
vtx3body::TPCNSigmaPr, vtx3body::TPCNSigmaPi, vtx3body::TPCNSigmaDe, vtx3body::TPCNSigmaPiBach,
266266
vtx3body::TOFNSigmaDe,

PWGLF/TableProducer/Nuspex/decay3bodybuilder.cxx

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,9 @@ struct decay3bodyBuilder {
143143
// building options
144144
Configurable<bool> useKFParticle{"useKFParticle", false, "Use KFParticle for decay3body building"};
145145
Configurable<bool> kfSetTopologicalConstraint{"kfSetTopologicalConstraint", false, "Set topological vertex constraint in case of KFParticle reconstruction"};
146+
Configurable<bool> buildOnlyTracked{"buildOnlyTracked", false, "Build only tracked decay3bodys"};
146147
Configurable<bool> useSelections{"useSelections", true, "Apply selections during decay3body building"};
148+
Configurable<bool> useChi2Selection{"useChi2Selection", true, "Apply chi2 selection during decay3body building"};
147149
Configurable<bool> useTPCforPion{"useTPCforPion", false, "Flag to ask for TPC info for pion track (PID, nClusters), false: pion track can be ITS only"};
148150
Configurable<bool> acceptTPCOnly{"acceptTPCOnly", false, "Accept TPC only tracks as daughters"};
149151
Configurable<bool> askOnlyITSMatch{"askOnlyITSMatch", true, "ask only ITS match to distinguish TPC only tracks"};
@@ -166,7 +168,7 @@ struct decay3bodyBuilder {
166168
Configurable<float> minTOFnSigmaDeuteron{"minTOFnSigmaDeuteron", -5.0, "Min TOF nSigma of deuteron daughter"};
167169
Configurable<float> maxTOFnSigmaDeuteron{"maxTOFnSigmaDeuteron", 5.0, "Max TOF nSigma of deuteron daughter"};
168170
Configurable<float> minPDeuteronUseTOF{"minPDeuteronUseTOF", 1.0, "Min P of deuteron to use TOF PID"};
169-
Configurable<float> maxDCADauAtSV{"maxDCADauAtSV", 0.5, "Max DCA of daughters at SV (quadratic sum of daughter DCAs between each other)"};
171+
Configurable<float> maxDCADauToSVaverage{"maxDCADauToSVaverage", 0.5, "Max DCA of daughters to SV (quadratic sum of daughter DCAs to SV / 3)"};
170172
// candidate selections
171173
Configurable<float> maxRapidity{"maxRapidity", 1.0, "Max rapidity of decay3body vertex"};
172174
Configurable<float> minPt{"minPt", 2.0, "Min Pt of decay3body candidate"};
@@ -326,7 +328,7 @@ struct decay3bodyBuilder {
326328
helper.decay3bodyselections.minTOFnSigmaDeuteron = decay3bodyBuilderOpts.minTOFnSigmaDeuteron;
327329
helper.decay3bodyselections.maxTOFnSigmaDeuteron = decay3bodyBuilderOpts.maxTOFnSigmaDeuteron;
328330
helper.decay3bodyselections.minPDeuteronUseTOF = decay3bodyBuilderOpts.minPDeuteronUseTOF;
329-
helper.decay3bodyselections.maxDCADauAtSV = decay3bodyBuilderOpts.maxDCADauAtSV;
331+
helper.decay3bodyselections.maxDCADauToSVaverage = decay3bodyBuilderOpts.maxDCADauToSVaverage;
330332
helper.decay3bodyselections.maxRapidity = decay3bodyBuilderOpts.maxRapidity;
331333
helper.decay3bodyselections.minPt = decay3bodyBuilderOpts.minPt;
332334
helper.decay3bodyselections.maxPt = decay3bodyBuilderOpts.maxPt;
@@ -393,7 +395,7 @@ struct decay3bodyBuilder {
393395
LOGF(info, "-~> min TOF nSigma deuteron ......: %f", decay3bodyBuilderOpts.minTOFnSigmaDeuteron.value);
394396
LOGF(info, "-~> max TOF nSigma deuteron ......: %f", decay3bodyBuilderOpts.maxTOFnSigmaDeuteron.value);
395397
LOGF(info, "-~> min p bach use TOF ...........: %f", decay3bodyBuilderOpts.minPDeuteronUseTOF.value);
396-
LOGF(info, "-~> max DCA dau at SV ............: %f", decay3bodyBuilderOpts.maxDCADauAtSV.value);
398+
LOGF(info, "-~> max DCA dau at SV ............: %f", decay3bodyBuilderOpts.maxDCADauToSVaverage.value);
397399
LOGF(info, "-~> max rapidity .................: %f", decay3bodyBuilderOpts.maxRapidity.value);
398400
LOGF(info, "-~> min pT .......................: %f", decay3bodyBuilderOpts.minPt.value);
399401
LOGF(info, "-~> max pT .......................: %f", decay3bodyBuilderOpts.maxPt.value);
@@ -720,6 +722,11 @@ struct decay3bodyBuilder {
720722
registry.fill(HIST("Counters/hInputStatistics"), kVtx3BodyDatas, decay3bodys.size());
721723
int lastRunNumber = -1;
722724
for (const auto& decay3body : decay3bodys) {
725+
// only build tracked decay3body if aksed
726+
if (decay3bodyBuilderOpts.buildOnlyTracked && fTrackedClSizeVector[decay3body.globalIndex()] == 0) {
727+
continue;
728+
}
729+
723730
// skip decay3body without assigned collision
724731
/// TODO: do we want this??
725732
if (decay3body.collisionId() < 0) {
@@ -782,6 +789,7 @@ struct decay3bodyBuilder {
782789
decay3bodyBuilderOpts.useKFParticle,
783790
decay3bodyBuilderOpts.kfSetTopologicalConstraint,
784791
decay3bodyBuilderOpts.useSelections,
792+
decay3bodyBuilderOpts.useChi2Selection,
785793
decay3bodyBuilderOpts.useTPCforPion,
786794
decay3bodyBuilderOpts.acceptTPCOnly,
787795
decay3bodyBuilderOpts.askOnlyITSMatch,
@@ -958,7 +966,7 @@ struct decay3bodyBuilder {
958966
-1., -1., -1., // trackDCAxyToPV: 0 - proton, 1 - pion, 2 - deuteron
959967
-1., -1., -1., // trackDCAzToPV: 0 - proton, 1 - pion, 2 - deuteron
960968
-1., -1., -1., // daughterDCAtoSV: 0 - proton, 1 - pion, 2 - deuteron
961-
-1., // daughterDCAatSV
969+
-1., // daughterDCAtoSVaverage
962970
-1., -1., // cosPA, ctau
963971
-1., -1., -1., -1., // tpcNsigma: 0 - proton, 1 - pion, 2 - deuteron, 3 - bach with pion hyp
964972
-1., // tofNsigmaDeuteron
@@ -1117,7 +1125,7 @@ struct decay3bodyBuilder {
11171125
helper.decay3body.trackDCAxyToPV[0], helper.decay3body.trackDCAxyToPV[1], helper.decay3body.trackDCAxyToPV[2], // 0 - proton, 1 - pion, 2 - deuteron
11181126
helper.decay3body.trackDCAzToPV[0], helper.decay3body.trackDCAzToPV[1], helper.decay3body.trackDCAzToPV[2], // 0 - proton, 1 - pion, 2 - deuteron
11191127
helper.decay3body.daughterDCAtoSV[0], helper.decay3body.daughterDCAtoSV[1], helper.decay3body.daughterDCAtoSV[2], // 0 - proton, 1 - pion, 2 - deuteron
1120-
helper.decay3body.daughterDCAatSV,
1128+
helper.decay3body.daughterDCAtoSVaverage,
11211129
helper.decay3body.cosPA, helper.decay3body.ctau,
11221130
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
11231131
helper.decay3body.tofNsigmaDeuteron,
@@ -1146,7 +1154,7 @@ struct decay3bodyBuilder {
11461154
helper.decay3body.trackDCAxyToPV[0], helper.decay3body.trackDCAxyToPV[1], helper.decay3body.trackDCAxyToPV[2], // 0 - proton, 1 - pion, 2 - deuteron
11471155
helper.decay3body.trackDCAzToPV[0], helper.decay3body.trackDCAzToPV[1], helper.decay3body.trackDCAzToPV[2], // 0 - proton, 1 - pion, 2 - deuteron
11481156
helper.decay3body.daughterDCAtoSV[0], helper.decay3body.daughterDCAtoSV[1], helper.decay3body.daughterDCAtoSV[2], // 0 - proton, 1 - pion, 2 - deuteron
1149-
helper.decay3body.daughterDCAatSV,
1157+
helper.decay3body.daughterDCAtoSVaverage,
11501158
helper.decay3body.cosPA, helper.decay3body.ctau,
11511159
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
11521160
helper.decay3body.tofNsigmaDeuteron,
@@ -1184,6 +1192,7 @@ struct decay3bodyBuilder {
11841192
decay3bodyBuilderOpts.useKFParticle,
11851193
decay3bodyBuilderOpts.kfSetTopologicalConstraint,
11861194
decay3bodyBuilderOpts.useSelections,
1195+
decay3bodyBuilderOpts.useChi2Selection,
11871196
decay3bodyBuilderOpts.useTPCforPion,
11881197
decay3bodyBuilderOpts.acceptTPCOnly,
11891198
decay3bodyBuilderOpts.askOnlyITSMatch,

PWGLF/Utils/decay3bodyBuilderHelper.h

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,11 @@ struct decay3bodyCandidate {
7474
int sign;
7575
float momentum[3];
7676
float position[3];
77-
// std::array<float, 3> momentum = {0.0f, 0.0f, 0.0f};
78-
// std::array<float, 3> position = {0.0f, 0.0f, 0.0f};
79-
// float dcaToPV = 0.0f;
80-
// float dcaxyToPV = 0.0f;
8177
float chi2 = 0.0f;
8278
float trackedClSize = 0.0f;
8379
float cosPA = 0.0f; // cosine of pointing angle
8480
float ctau = 0.0f; // ctau of the candidate
85-
float daughterDCAatSV = 0.0f; // quadratic sum of DCA between daughters at SV
81+
float daughterDCAtoSVaverage = 0.0f; // average of quadratic sum of daughter DCAs to SV
8682
std::array<float, 3> daughterDCAtoSV = {0.0f, 0.0f, 0.0f}; // 0 - pos, 1 - neg, 2 - bach
8783

8884
// covariance matrix
@@ -148,7 +144,7 @@ class decay3bodyBuilderHelper
148144
double minTOFnSigmaDeuteron;
149145
double maxTOFnSigmaDeuteron;
150146
float minPDeuteronUseTOF;
151-
float maxDCADauAtSV;
147+
float maxDCADauToSVaverage;
152148
// candidate
153149
float maxRapidity;
154150
float minPt;
@@ -188,6 +184,7 @@ class decay3bodyBuilderHelper
188184
bool useKFParticle = false,
189185
bool kfSetTopologicalConstraint = false,
190186
bool useSelections = true,
187+
bool useChi2Selection = true,
191188
bool useTPCforPion = false,
192189
bool acceptTPCOnly = false,
193190
bool askOnlyITSMatch = true,
@@ -342,18 +339,6 @@ class decay3bodyBuilderHelper
342339
auto trackPionPt = std::sqrt(decay3body.momPion[0] * decay3body.momPion[0] + decay3body.momPion[1] * decay3body.momPion[1]);
343340
auto trackDeuteronPt = std::sqrt(decay3body.momDeuteron[0] * decay3body.momDeuteron[0] + decay3body.momDeuteron[1] * decay3body.momDeuteron[1]);
344341

345-
// DCA between daughters at SV
346-
decay3body.daughterDCAatSV = std::hypot(
347-
std::hypot(decay3body.posProton[0] - decay3body.posPion[0],
348-
decay3body.posProton[1] - decay3body.posPion[1],
349-
decay3body.posProton[2] - decay3body.posPion[2]),
350-
std::hypot(decay3body.posProton[0] - decay3body.posDeuteron[0],
351-
decay3body.posProton[1] - decay3body.posDeuteron[1],
352-
decay3body.posProton[2] - decay3body.posDeuteron[2]),
353-
std::hypot(decay3body.posPion[0] - decay3body.posProton[0],
354-
decay3body.posPion[1] - decay3body.posProton[1],
355-
decay3body.posPion[2] - decay3body.posProton[2]));
356-
357342
// daughter DCA to SV
358343
// proton daughter
359344
decay3body.daughterDCAtoSV[0] = std::hypot(
@@ -371,6 +356,12 @@ class decay3bodyBuilderHelper
371356
decay3body.posDeuteron[1] - decay3body.position[1],
372357
decay3body.posDeuteron[2] - decay3body.position[2]);
373358

359+
// DCA daughters to SV average of quadratic sum
360+
decay3body.daughterDCAtoSVaverage = (decay3body.daughterDCAtoSV[0] * decay3body.daughterDCAtoSV[0] +
361+
decay3body.daughterDCAtoSV[1] * decay3body.daughterDCAtoSV[1] +
362+
decay3body.daughterDCAtoSV[2] * decay3body.daughterDCAtoSV[2]) /
363+
3;
364+
374365
//_____________________________________________________
375366
// selections after vertex fit
376367
if (useSelections) {
@@ -392,7 +383,7 @@ class decay3bodyBuilderHelper
392383
}
393384

394385
// daughter DCAs at SV
395-
if (decay3body.daughterDCAatSV > decay3bodyselections.maxDCADauAtSV) {
386+
if (decay3body.daughterDCAtoSVaverage > decay3bodyselections.maxDCADauToSVaverage) {
396387
decay3body = {};
397388
return false;
398389
}
@@ -418,7 +409,7 @@ class decay3bodyBuilderHelper
418409
}
419410

420411
// vertex chi2
421-
if (decay3body.chi2 > decay3bodyselections.maxChi2) {
412+
if (useChi2Selection && decay3body.chi2 > decay3bodyselections.maxChi2) {
422413
decay3body = {};
423414
return false;
424415
}

0 commit comments

Comments
 (0)