Skip to content

Commit 1827204

Browse files
committed
Add cosPA and ct in datamodel for h3l_3body
1 parent e0b6647 commit 1827204

File tree

3 files changed

+45
-28
lines changed

3 files changed

+45
-28
lines changed

PWGLF/DataModel/Vtx3BodyTables.h

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,12 @@
1717
#ifndef PWGLF_DATAMODEL_VTX3BODYTABLES_H_
1818
#define PWGLF_DATAMODEL_VTX3BODYTABLES_H_
1919

20-
#include <cmath>
21-
#include "Framework/AnalysisDataModel.h"
2220
#include "Common/Core/RecoDecay.h"
21+
2322
#include "CommonConstants/PhysicsConstants.h"
23+
#include "Framework/AnalysisDataModel.h"
24+
25+
#include <cmath>
2426

2527
namespace o2::aod
2628
{
@@ -30,8 +32,8 @@ namespace vtx3body
3032
DECLARE_SOA_INDEX_COLUMN_FULL(TrackPr, trackPr, int, Tracks, "_pr"); //!
3133
DECLARE_SOA_INDEX_COLUMN_FULL(TrackPi, trackPi, int, Tracks, "_pi"); //!
3234
DECLARE_SOA_INDEX_COLUMN_FULL(TrackDe, trackDe, int, Tracks, "_de"); //!
33-
DECLARE_SOA_INDEX_COLUMN(Collision, collision); //!
34-
DECLARE_SOA_INDEX_COLUMN(Decay3Body, decay3body); //!
35+
DECLARE_SOA_INDEX_COLUMN(Collision, collision); //!
36+
DECLARE_SOA_INDEX_COLUMN(Decay3Body, decay3body); //!
3537

3638
// General 3 body Vtx properties
3739
DECLARE_SOA_COLUMN(Mass, mass, float); //! candidate mass (with H3L or Anti-H3L mass hypothesis depending on deuteron charge)
@@ -70,6 +72,12 @@ DECLARE_SOA_COLUMN(DCATrackPiToSV, dcaTrackPiToSv, float); //! DCA of pion to
7072
DECLARE_SOA_COLUMN(DCATrackDeToSV, dcaTrackDeToSv, float); //! DCA of deuteron to SV
7173
DECLARE_SOA_COLUMN(DCAVtxDaughters, dcaVtxdaughters, float); //! Quadratic sum of DCA between daughters at SV
7274

75+
// CosPA
76+
DECLARE_SOA_COLUMN(CosPA, cosPA, float); //! Cosine of pointing angle of the 3body candidate
77+
78+
// Ct
79+
DECLARE_SOA_COLUMN(Ct, ct, float); //! Reconstruction Ct of 3body candidate
80+
7381
// Strangeness tracking
7482
DECLARE_SOA_COLUMN(TrackedClSize, trackedClSize, float); //! Average ITS cluster size of strangeness tracked 3body
7583

@@ -145,10 +153,6 @@ DECLARE_SOA_DYNAMIC_COLUMN(DistOverTotMom, distovertotmom, //! PV to 3 body deca
145153
return std::sqrt(std::pow(X - pvX, 2) + std::pow(Y - pvY, 2) + std::pow(Z - pvZ, 2)) / (P + 1E-10);
146154
});
147155

148-
// CosPA
149-
DECLARE_SOA_DYNAMIC_COLUMN(VtxCosPA, vtxcosPA, //! 3 body vtx CosPA
150-
[](float X, float Y, float Z, float Px, float Py, float Pz, float pvX, float pvY, float pvZ) -> float { return RecoDecay::cpa(std::array{pvX, pvY, pvZ}, std::array{X, Y, Z}, std::array{Px, Py, Pz}); });
151-
152156
// Dca to PV
153157
DECLARE_SOA_DYNAMIC_COLUMN(DCAVtxToPV, dcavtxtopv, //! DCA of 3 body vtx to PV
154158
[](float X, float Y, float Z, float Px, float Py, float Pz, float pvX, float pvY, float pvZ) -> float { return std::sqrt((std::pow((pvY - Y) * Pz - (pvZ - Z) * Py, 2) + std::pow((pvX - X) * Pz - (pvZ - Z) * Px, 2) + std::pow((pvX - X) * Py - (pvY - Y) * Px, 2)) / (Px * Px + Py * Py + Pz * Pz)); });
@@ -207,6 +211,7 @@ DECLARE_SOA_TABLE(Vtx3BodyDatas, "AOD", "VTX3BODYDATA", //!
207211
vtx3body::DCAZTrackPrToPV, vtx3body::DCAZTrackPiToPV, vtx3body::DCAZTrackDeToPV,
208212
vtx3body::DCATrackPrToSV, vtx3body::DCATrackPiToSV, vtx3body::DCATrackDeToSV,
209213
vtx3body::DCAVtxDaughters,
214+
vtx3body::CosPA, vtx3body::Ct,
210215
vtx3body::TPCNSigmaPr, vtx3body::TPCNSigmaPi, vtx3body::TPCNSigmaDe, vtx3body::TPCNSigmaPiBach,
211216
vtx3body::TOFNSigmaDe,
212217
vtx3body::ITSClSizePr, vtx3body::ITSClSizePi, vtx3body::ITSClSizeDe,
@@ -218,7 +223,6 @@ DECLARE_SOA_TABLE(Vtx3BodyDatas, "AOD", "VTX3BODYDATA", //!
218223
vtx3body::Pt<vtx3body::Px, vtx3body::Py>,
219224
vtx3body::VtxRadius<vtx3body::X, vtx3body::Y>,
220225
vtx3body::DistOverTotMom<vtx3body::X, vtx3body::Y, vtx3body::Z, vtx3body::Px, vtx3body::Py, vtx3body::Pz>,
221-
vtx3body::VtxCosPA<vtx3body::X, vtx3body::Y, vtx3body::Z, vtx3body::Px, vtx3body::Py, vtx3body::Pz>,
222226
vtx3body::DCAVtxToPV<vtx3body::X, vtx3body::Y, vtx3body::Z, vtx3body::Px, vtx3body::Py, vtx3body::Pz>,
223227

224228
// Longitudinal
@@ -256,6 +260,7 @@ DECLARE_SOA_TABLE(McVtx3BodyDatas, "AOD", "MC3BODYDATA", //!
256260
vtx3body::DCAZTrackPrToPV, vtx3body::DCAZTrackPiToPV, vtx3body::DCAZTrackDeToPV,
257261
vtx3body::DCATrackPrToSV, vtx3body::DCATrackPiToSV, vtx3body::DCATrackDeToSV,
258262
vtx3body::DCAVtxDaughters,
263+
vtx3body::CosPA, vtx3body::Ct,
259264
vtx3body::TPCNSigmaPr, vtx3body::TPCNSigmaPi, vtx3body::TPCNSigmaDe, vtx3body::TPCNSigmaPiBach,
260265
vtx3body::TOFNSigmaDe,
261266
vtx3body::ITSClSizePr, vtx3body::ITSClSizePi, vtx3body::ITSClSizeDe,
@@ -283,7 +288,6 @@ DECLARE_SOA_TABLE(McVtx3BodyDatas, "AOD", "MC3BODYDATA", //!
283288
vtx3body::VtxRadius<vtx3body::X, vtx3body::Y>,
284289
vtx3body::GenRadius<vtx3body::GenX, vtx3body::GenY>,
285290
vtx3body::DistOverTotMom<vtx3body::X, vtx3body::Y, vtx3body::Z, vtx3body::Px, vtx3body::Py, vtx3body::Pz>,
286-
vtx3body::VtxCosPA<vtx3body::X, vtx3body::Y, vtx3body::Z, vtx3body::Px, vtx3body::Py, vtx3body::Pz>,
287291
vtx3body::DCAVtxToPV<vtx3body::X, vtx3body::Y, vtx3body::Z, vtx3body::Px, vtx3body::Py, vtx3body::Pz>,
288292

289293
// Longitudinal

PWGLF/TableProducer/Nuspex/decay3bodybuilder.cxx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -958,6 +958,7 @@ struct decay3bodyBuilder {
958958
-1., -1., -1., // trackDCAzToPV: 0 - proton, 1 - pion, 2 - deuteron
959959
-1., -1., -1., // daughterDCAtoSV: 0 - proton, 1 - pion, 2 - deuteron
960960
-1., // daughterDCAatSV
961+
-1., -1., // cosPA, ctau
961962
-1., -1., -1., -1., // tpcNsigma: 0 - proton, 1 - pion, 2 - deuteron, 3 - bach with pion hyp
962963
-1., // tofNsigmaDeuteron
963964
-1., -1., -1., // average ITS cluster sizes: proton, pion, deuteron
@@ -1115,6 +1116,7 @@ struct decay3bodyBuilder {
11151116
helper.decay3body.trackDCAzToPV[0], helper.decay3body.trackDCAzToPV[1], helper.decay3body.trackDCAzToPV[2], // 0 - proton, 1 - pion, 2 - deuteron
11161117
helper.decay3body.daughterDCAtoSV[0], helper.decay3body.daughterDCAtoSV[1], helper.decay3body.daughterDCAtoSV[2], // 0 - proton, 1 - pion, 2 - deuteron
11171118
helper.decay3body.daughterDCAatSV,
1119+
helper.decay3body.cosPA, helper.decay3body.ctau,
11181120
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
11191121
helper.decay3body.tofNsigmaDeuteron,
11201122
helper.decay3body.averageITSClSize[0], helper.decay3body.averageITSClSize[1], helper.decay3body.averageITSClSize[2], // 0 - proton, 1 - pion, 2 - deuteron
@@ -1143,6 +1145,7 @@ struct decay3bodyBuilder {
11431145
helper.decay3body.trackDCAzToPV[0], helper.decay3body.trackDCAzToPV[1], helper.decay3body.trackDCAzToPV[2], // 0 - proton, 1 - pion, 2 - deuteron
11441146
helper.decay3body.daughterDCAtoSV[0], helper.decay3body.daughterDCAtoSV[1], helper.decay3body.daughterDCAtoSV[2], // 0 - proton, 1 - pion, 2 - deuteron
11451147
helper.decay3body.daughterDCAatSV,
1148+
helper.decay3body.cosPA, helper.decay3body.ctau,
11461149
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
11471150
helper.decay3body.tofNsigmaDeuteron,
11481151
helper.decay3body.averageITSClSize[0], helper.decay3body.averageITSClSize[1], helper.decay3body.averageITSClSize[2], // 0 - proton, 1 - pion, 2 - deuteron

PWGLF/Utils/decay3bodyBuilderHelper.h

Lines changed: 28 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,27 +12,29 @@
1212
#ifndef PWGLF_UTILS_DECAY3BODYBUILDERHELPER_H_
1313
#define PWGLF_UTILS_DECAY3BODYBUILDERHELPER_H_
1414

15-
#include <cstdlib>
16-
#include <cmath>
17-
#include <array>
15+
#include "Common/Core/RecoDecay.h"
16+
#include "Common/Core/trackUtilities.h"
17+
#include "Tools/KFparticle/KFUtilities.h"
18+
19+
#include "CommonConstants/PhysicsConstants.h"
1820
#include "DCAFitter/DCAFitterN.h"
19-
#include "Framework/AnalysisDataModel.h"
20-
#include "ReconstructionDataFormats/Track.h"
2121
#include "DetectorsBase/GeometryManager.h"
2222
#include "DetectorsVertexing/SVertexHypothesis.h"
23-
#include "CommonConstants/PhysicsConstants.h"
24-
#include "Common/Core/trackUtilities.h"
25-
#include "Common/Core/RecoDecay.h"
26-
#include "Tools/KFparticle/KFUtilities.h"
23+
#include "Framework/AnalysisDataModel.h"
24+
#include "ReconstructionDataFormats/Track.h"
25+
26+
#include <array>
27+
#include <cmath>
28+
#include <cstdlib>
2729

2830
#ifndef HomogeneousField
2931
#define HomogeneousField
3032
#endif
3133

3234
/// includes KFParticle
33-
#include "KFParticle.h"
3435
#include "KFPTrack.h"
3536
#include "KFPVertex.h"
37+
#include "KFParticle.h"
3638
#include "KFParticleBase.h"
3739
#include "KFVertex.h"
3840

@@ -78,6 +80,8 @@ struct decay3bodyCandidate {
7880
// float dcaxyToPV = 0.0f;
7981
float chi2 = 0.0f;
8082
float trackedClSize = 0.0f;
83+
float cosPA = 0.0f; // cosine of pointing angle
84+
float ctau = 0.0f; // ctau of the candidate
8185
float daughterDCAatSV = 0.0f; // quadratic sum of DCA between daughters at SV
8286
std::array<float, 3> daughterDCAtoSV = {0.0f, 0.0f, 0.0f}; // 0 - pos, 1 - neg, 2 - bach
8387

@@ -413,27 +417,33 @@ class decay3bodyBuilderHelper
413417
return false;
414418
}
415419

416-
// pointing angle
417-
float cpa = RecoDecay::cpa(std::array{pvX, pvY, pvZ}, std::array{decay3body.position[0], decay3body.position[1], decay3body.position[2]}, std::array{decay3body.momentum[0], decay3body.momentum[1], decay3body.momentum[2]});
418-
if (cpa < decay3bodyselections.minCosPA) {
420+
// vertex chi2
421+
if (decay3body.chi2 > decay3bodyselections.maxChi2) {
419422
decay3body = {};
420423
return false;
421424
}
425+
}
422426

423-
// vertex chi2
424-
if (decay3body.chi2 > decay3bodyselections.maxChi2) {
427+
// pointing angle
428+
float cpa = RecoDecay::cpa(std::array{pvX, pvY, pvZ}, std::array{decay3body.position[0], decay3body.position[1], decay3body.position[2]}, std::array{decay3body.momentum[0], decay3body.momentum[1], decay3body.momentum[2]});
429+
if (useSelections) {
430+
if (cpa < decay3bodyselections.minCosPA) {
425431
decay3body = {};
426432
return false;
427433
}
434+
}
435+
decay3body.cosPA = cpa;
428436

429-
// ctau
430-
float P = RecoDecay::sqrtSumOfSquares(decay3body.momentum[0], decay3body.momentum[1], decay3body.momentum[2]);
431-
float ctau = std::sqrt(std::pow(decay3body.position[0] - pvX, 2) + std::pow(decay3body.position[1] - pvY, 2) + std::pow(decay3body.position[2] - pvZ, 2)) / (P + 1E-10) * o2::constants::physics::MassHyperTriton;
437+
// ctau
438+
float P = RecoDecay::sqrtSumOfSquares(decay3body.momentum[0], decay3body.momentum[1], decay3body.momentum[2]);
439+
float ctau = std::sqrt(std::pow(decay3body.position[0] - pvX, 2) + std::pow(decay3body.position[1] - pvY, 2) + std::pow(decay3body.position[2] - pvZ, 2)) / (P + 1E-10) * o2::constants::physics::MassHyperTriton;
440+
if (useSelections) {
432441
if (ctau < decay3bodyselections.minCtau || ctau > decay3bodyselections.maxCtau) {
433442
decay3body = {};
434443
return false;
435444
}
436445
}
446+
decay3body.ctau = ctau;
437447

438448
//_______________________________________________________________________
439449
// SVertexer selections in case of event mixing

0 commit comments

Comments
 (0)