Skip to content

Commit 66e8774

Browse files
wang-yuanzheshahor02
authored andcommitted
Add mass hypothesis for H4L, He4L, He5L and charge hypothesis for decays3Body
Fix the description of decays3Body Fix the charge of hyperhelium4 Set the ID of hyperhelium4 as the last one Enable H4L and He4L Add mass hypothesis of He5L Use the hypothesis of daughter's charge for mass check Add new calcMass function and code format fix Remove space Parameters fix Move the momentum calculation of candidate outside Only modify the charge hypothesis for bachelors Small updates Please consider the following formatting changes
1 parent 5189fa6 commit 66e8774

File tree

8 files changed

+74
-46
lines changed

8 files changed

+74
-46
lines changed

DataFormats/Reconstruction/include/ReconstructionDataFormats/Decay3Body.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class Decay3Body : public o2::track::TrackParCov /// TO BE DONE: extend to gener
2929
using PID = o2::track::PID;
3030

3131
Decay3Body() = default;
32-
Decay3Body(PID pid, const std::array<float, 3>& xyz, const std::array<float, 3>& pxyz, const std::array<float, 6>& covxyz, const Track& tr0, const Track& tr1, const Track& tr2);
32+
Decay3Body(const std::array<float, 3>& xyz, const std::array<float, 3>& pxyz, const std::array<float, 6>& covxyz, const Track& tr0, const Track& tr1, const Track& tr2, o2::track::PID pid = o2::track::PID::HyperTriton);
3333

3434
const Track& getProng(int i) const { return mProngs[i]; }
3535
Track& getProng(int i) { return mProngs[i]; }

DataFormats/Reconstruction/include/ReconstructionDataFormats/PID.h

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,19 @@ namespace o2cp = o2::constants::physics;
3333
namespace pid_constants // GPUs currently cannot have static constexpr array members
3434
{
3535
typedef uint8_t ID;
36-
static constexpr ID NIDsTot = 17;
36+
static constexpr ID NIDsTot = 19;
3737

3838
#if !defined(GPUCA_GPUCODE_DEVICE) || defined(GPUCA_GPU_DEBUG_PRINT)
3939
GPUconstexpr() const char* sNames[NIDsTot + 1] = ///< defined particle names
4040
{"Electron", "Muon", "Pion", "Kaon", "Proton", "Deuteron", "Triton", "He3", "Alpha",
41-
"Pion0", "Photon", "K0", "Lambda", "HyperTriton", "Hyperhydrog4", "XiMinus", "OmegaMinus", nullptr};
41+
"Pion0", "Photon", "K0", "Lambda", "HyperTriton", "Hyperhydrog4", "XiMinus", "OmegaMinus", "HyperHelium4", "HyperHelium5", nullptr};
4242
#endif
4343

4444
GPUconstexpr() const float sMasses[NIDsTot] = ///< defined particle masses
4545
{o2cp::MassElectron, o2cp::MassMuon, o2cp::MassPionCharged, o2cp::MassKaonCharged,
4646
o2cp::MassProton, o2cp::MassDeuteron, o2cp::MassTriton, o2cp::MassHelium3,
4747
o2cp::MassAlpha, o2cp::MassPionNeutral, o2cp::MassPhoton,
48-
o2cp::MassKaonNeutral, o2cp::MassLambda, o2cp::MassHyperTriton, o2cp::MassHyperhydrog4, o2cp::MassXiMinus, o2cp::MassOmegaMinus};
48+
o2cp::MassKaonNeutral, o2cp::MassLambda, o2cp::MassHyperTriton, o2cp::MassHyperhydrog4, o2cp::MassXiMinus, o2cp::MassOmegaMinus, o2cp::MassHyperHelium4, o2cp::MassHyperHelium5};
4949

5050
GPUconstexpr() const float sMasses2[NIDsTot] = ///< defined particle masses^2
5151
{o2cp::MassElectron * o2cp::MassElectron,
@@ -64,7 +64,9 @@ GPUconstexpr() const float sMasses2[NIDsTot] = ///< defined particle masses^2
6464
o2cp::MassHyperTriton* o2cp::MassHyperTriton,
6565
o2cp::MassHyperhydrog4* o2cp::MassHyperhydrog4,
6666
o2cp::MassXiMinus* o2cp::MassXiMinus,
67-
o2cp::MassOmegaMinus* o2cp::MassOmegaMinus};
67+
o2cp::MassOmegaMinus* o2cp::MassOmegaMinus,
68+
o2cp::MassHyperHelium4* o2cp::MassHyperHelium4,
69+
o2cp::MassHyperHelium5* o2cp::MassHyperHelium5};
6870

6971
GPUconstexpr() const float sMasses2Z[NIDsTot] = ///< defined particle masses / Z
7072
{o2cp::MassElectron, o2cp::MassMuon,
@@ -73,12 +75,14 @@ GPUconstexpr() const float sMasses2Z[NIDsTot] = ///< defined particle masses / Z
7375
o2cp::MassTriton, o2cp::MassHelium3 / 2.,
7476
o2cp::MassAlpha / 2.,
7577
0, 0, 0, 0, o2cp::MassHyperTriton, o2cp::MassHyperhydrog4,
76-
o2cp::MassXiMinus, o2cp::MassOmegaMinus};
78+
o2cp::MassXiMinus, o2cp::MassOmegaMinus,
79+
o2cp::MassHyperHelium4 / 2., o2cp::MassHyperHelium5 / 2.};
7780

7881
GPUconstexpr() const int sCharges[NIDsTot] = ///< defined particle charges
7982
{1, 1, 1, 1, 1, 1, 1, 2, 2,
8083
0, 0, 0, 0, 1, 1,
81-
1, 1};
84+
1, 1,
85+
2, 2};
8286
} // namespace pid_constants
8387

8488
class PID
@@ -110,8 +114,10 @@ class PID
110114
static constexpr ID Hyperhydrog4 = 14;
111115
static constexpr ID XiMinus = 15;
112116
static constexpr ID OmegaMinus = 16;
117+
static constexpr ID HyperHelium4 = 17;
118+
static constexpr ID HyperHelium5 = 18;
113119
static constexpr ID FirstExt = PI0;
114-
static constexpr ID LastExt = OmegaMinus;
120+
static constexpr ID LastExt = HyperHelium5;
115121
static constexpr ID NIDsTot = pid_constants::NIDsTot; ///< total number of defined IDs
116122
static_assert(NIDsTot == LastExt + 1, "Incorrect NIDsTot, please update!");
117123

DataFormats/Reconstruction/src/Decay3Body.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
using namespace o2::dataformats;
1515

16-
Decay3Body::Decay3Body(PID pid, const std::array<float, 3>& xyz, const std::array<float, 3>& pxyz, const std::array<float, 6>& covxyz, const Track& tr0, const Track& tr1, const Track& tr2)
16+
Decay3Body::Decay3Body(const std::array<float, 3>& xyz, const std::array<float, 3>& pxyz, const std::array<float, 6>& covxyz, const Track& tr0, const Track& tr1, const Track& tr2, o2::track::PID pid)
1717
: mProngs{tr0, tr1, tr2}
1818
{
1919
std::array<float, 21> cov{}, cov1{}, cov2{};

Detectors/Vertexing/include/DetectorsVertexing/SVertexHypothesis.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,14 @@ class SVertex3Hypothesis
131131
void set(PID v0, PID ppos, PID pneg, PID pbach, float sig, float nSig, float margin, float cpt, float bz = 0.f);
132132
void set(PID v0, PID ppos, PID pneg, PID pbach, const float pars[NPIDParams], float bz = 0.f);
133133

134+
PID getPIDHyp() const { return mPIDV0; }
134135
float getMassV0Hyp() const { return PID::getMass(mPIDV0); }
135136
float getMassPosProng() const { return PID::getMass(mPIDPosProng); }
136137
float getMassNegProng() const { return PID::getMass(mPIDNegProng); }
137138
float getMassBachProng() const { return PID::getMass(mPIDBachProng); }
139+
float getChargePosProng() const { return PID::getCharge(mPIDPosProng); }
140+
float getChargeNegProng() const { return PID::getCharge(mPIDNegProng); }
141+
float getChargeBachProng() const { return PID::getCharge(mPIDBachProng); }
138142

139143
float calcMass2(float p2Pos, float p2Neg, float p2Bach, float p2Tot) const
140144
{

Detectors/Vertexing/include/DetectorsVertexing/SVertexer.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ class SVertexer
8787
enum Hyp3body {
8888
H3L3body,
8989
AntiH3L3body,
90+
H4L3body,
91+
AntiH4L3body,
9092
He4L3body,
9193
AntiHe4L3body,
9294
He5L3body,

Detectors/Vertexing/include/DetectorsVertexing/SVertexerParams.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,9 @@ struct SVertexerParams : public o2::conf::ConfigurableParamHelper<SVertexerParam
138138
// cuts on different 3 body PID params
139139
bool check3bodyHypothesis = true;
140140
float pidCutsH3L3body[SVertex3Hypothesis::NPIDParams] = {0.0025, 14, 0.07, 0.5}; // H3L -> d p pi-
141+
float pidCutsH4L3body[SVertex3Hypothesis::NPIDParams] = {0.0025, 14, 0.07, 0.5}; // H4L -> t p pi-
141142
float pidCutsHe4L3body[SVertex3Hypothesis::NPIDParams] = {0.0025, 14, 0.07, 0.5}; // He4L -> He3 p pi-
143+
float pidCutsHe5L3body[SVertex3Hypothesis::NPIDParams] = {0.0025, 14, 0.07, 0.5}; // He5L -> He4 p pi-
142144

143145
O2ParamDef(SVertexerParams, "svertexer");
144146
};

Detectors/Vertexing/src/SVertexer.cxx

Lines changed: 50 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,12 @@ void SVertexer::updateTimeDependentParams()
298298

299299
m3bodyHyps[Hyp3body::H3L3body].set(PID::HyperTriton, PID::Proton, PID::Pion, PID::Deuteron, mSVParams->pidCutsH3L3body, bz);
300300
m3bodyHyps[Hyp3body::AntiH3L3body].set(PID::HyperTriton, PID::Pion, PID::Proton, PID::Deuteron, mSVParams->pidCutsH3L3body, bz);
301+
m3bodyHyps[Hyp3body::H4L3body].set(PID::Hyperhydrog4, PID::Proton, PID::Pion, PID::Triton, mSVParams->pidCutsH4L3body, bz);
302+
m3bodyHyps[Hyp3body::AntiH4L3body].set(PID::Hyperhydrog4, PID::Pion, PID::Proton, PID::Triton, mSVParams->pidCutsH4L3body, bz);
303+
m3bodyHyps[Hyp3body::He4L3body].set(PID::HyperHelium4, PID::Proton, PID::Pion, PID::Helium3, mSVParams->pidCutsHe4L3body, bz);
304+
m3bodyHyps[Hyp3body::AntiHe4L3body].set(PID::HyperHelium4, PID::Pion, PID::Proton, PID::Helium3, mSVParams->pidCutsHe4L3body, bz);
305+
m3bodyHyps[Hyp3body::He5L3body].set(PID::HyperHelium5, PID::Proton, PID::Pion, PID::Alpha, mSVParams->pidCutsHe5L3body, bz);
306+
m3bodyHyps[Hyp3body::AntiHe5L3body].set(PID::HyperHelium5, PID::Pion, PID::Proton, PID::Alpha, mSVParams->pidCutsHe5L3body, bz);
301307

302308
for (auto& ft : mFitterV0) {
303309
ft.setBz(bz);
@@ -1090,60 +1096,68 @@ int SVertexer::check3bodyDecays(const V0Index& v0Idx, const V0& v0, float rv0, s
10901096
tr0.getPxPyPzGlo(p0);
10911097
tr1.getPxPyPzGlo(p1);
10921098
tr2.getPxPyPzGlo(p2);
1093-
std::array<float, 3> p3B = {p0[0] + p1[0] + p2[0], p0[1] + p1[1] + p2[1], p0[2] + p1[2] + p2[2]};
10941099

1095-
float pt2candidate = p3B[0] * p3B[0] + p3B[1] * p3B[1], p2candidate = pt2candidate + p3B[2] * p3B[2];
1096-
if (pt2candidate < mMinPt23Body) { // pt cut
1097-
continue;
1098-
}
1099-
if (p3B[2] * p3B[2] / pt2candidate > mMaxTgl23Body) { // tgLambda cut
1100-
continue;
1101-
}
1102-
1103-
// compute primary vertex and cosPA of the 3-body decay
1104-
auto bestCosPA = mSVParams->minCosPA3body;
1100+
bool goodHyp = false;
1101+
o2::track::PID pidHyp = o2::track::PID::Electron; // Update if goodHyp is true
11051102
auto decay3bodyVtxID = -1;
1103+
auto vtxCosPA = -1;
1104+
1105+
std::array<float, 3> pbach = {0, 0, 0}, p3B = {0, 0, 0}; // Update during the check of invariant mass
1106+
for (int ipid = 0; ipid < NHyp3body; ipid++) {
1107+
// check mass based on hypothesis of charge of bachelor (pos and neg expected to be proton/pion)
1108+
float bachChargeFactor = m3bodyHyps[ipid].getChargeBachProng() / tr2.getAbsCharge();
1109+
pbach = {bachChargeFactor * p2[0], bachChargeFactor * p2[1], bachChargeFactor * p2[2]};
1110+
p3B = {p0[0] + p1[0] + pbach[0], p0[1] + p1[1] + pbach[1], p0[2] + p1[2] + pbach[2]};
1111+
float sqP0 = p0[0] * p0[0] + p0[1] * p0[1] + p0[2] * p0[2], sqP1 = p1[0] * p1[0] + p1[1] * p1[1] + p1[2] * p1[2], sqPBach = pbach[0] * pbach[0] + pbach[1] * pbach[1] + pbach[2] * pbach[2];
1112+
float pt2Candidate = p3B[0] * p3B[0] + p3B[1] * p3B[1], p2Candidate = pt2Candidate + p3B[2] * p3B[2];
1113+
float ptCandidate = std::sqrt(pt2Candidate);
1114+
if (m3bodyHyps[ipid].check(sqP0, sqP1, sqPBach, p2Candidate, ptCandidate)) {
1115+
if (pt2Candidate < mMinPt23Body) { // pt cut
1116+
continue;
1117+
}
1118+
if (p3B[2] * p3B[2] > pt2Candidate * mMaxTgl23Body) { // tgLambda cut
1119+
continue;
1120+
}
11061121

1107-
for (int iv = decay3bodyVlist.getMin(); iv <= decay3bodyVlist.getMax(); iv++) {
1108-
const auto& pv = mPVertices[iv];
1109-
// check cos of pointing angle
1110-
float dx = vertexXYZ[0] - pv.getX(), dy = vertexXYZ[1] - pv.getY(), dz = vertexXYZ[2] - pv.getZ(), prodXYZ3body = dx * p3B[0] + dy * p3B[1] + dz * p3B[2];
1111-
float cosPA = prodXYZ3body / std::sqrt((dx * dx + dy * dy + dz * dz) * p2candidate);
1112-
if (cosPA < bestCosPA) {
1113-
LOG(debug) << "Rej. cosPA: " << cosPA;
1114-
continue;
1115-
}
1116-
decay3bodyVtxID = iv;
1117-
bestCosPA = cosPA;
1118-
}
1119-
if (decay3bodyVtxID == -1) {
1120-
LOG(debug) << "3-body decay not compatible with any vertex";
1121-
continue;
1122-
}
1123-
1124-
const auto& decay3bodyPv = mPVertices[decay3bodyVtxID];
1125-
float sqP0 = p0[0] * p0[0] + p0[1] * p0[1] + p0[2] * p0[2], sqP1 = p1[0] * p1[0] + p1[1] * p1[1] + p1[2] * p1[2], sqP2 = p2[0] * p2[0] + p2[1] * p2[1] + p2[2] * p2[2];
1126-
float pt3B = std::sqrt(pt2candidate);
1122+
// compute primary vertex and cosPA of the 3-body decay
1123+
auto bestCosPA = mSVParams->minCosPA3body;
1124+
for (int iv = decay3bodyVlist.getMin(); iv <= decay3bodyVlist.getMax(); iv++) {
1125+
const auto& pv = mPVertices[iv];
1126+
// check cos of pointing angle
1127+
float dx = vertexXYZ[0] - pv.getX(), dy = vertexXYZ[1] - pv.getY(), dz = vertexXYZ[2] - pv.getZ(), prodXYZ3body = dx * p3B[0] + dy * p3B[1] + dz * p3B[2];
1128+
float cosPA = prodXYZ3body / std::sqrt((dx * dx + dy * dy + dz * dz) * p2Candidate);
1129+
if (cosPA < bestCosPA) {
1130+
LOG(debug) << "Rej. cosPA: " << cosPA;
1131+
continue;
1132+
}
1133+
decay3bodyVtxID = iv;
1134+
bestCosPA = cosPA;
1135+
}
1136+
if (decay3bodyVtxID == -1) {
1137+
LOG(debug) << "3-body decay not compatible with any vertex";
1138+
continue;
1139+
}
11271140

1128-
bool goodHyp = false;
1129-
for (int ipid = 0; ipid < 2; ipid++) { // TODO: expand this loop to cover all the 3body cases if (m3bodyHyps[ipid].check(sqP0, sqP1, sqP2, sqPtot, pt3B))
1130-
if (m3bodyHyps[ipid].check(sqP0, sqP1, sqP2, p2candidate, pt3B)) {
11311141
goodHyp = true;
1142+
pidHyp = m3bodyHyps[ipid].getPIDHyp();
1143+
vtxCosPA = bestCosPA;
11321144
break;
11331145
}
11341146
}
11351147
if (!goodHyp) {
11361148
continue;
11371149
}
1138-
Decay3Body candidate3B(PID::HyperTriton, vertexXYZ, p3B, fitter3body.calcPCACovMatrixFlat(cand3B), tr0, tr1, tr2);
1150+
1151+
const auto& decay3bodyPv = mPVertices[decay3bodyVtxID];
1152+
Decay3Body candidate3B(vertexXYZ, p3B, fitter3body.calcPCACovMatrixFlat(cand3B), tr0, tr1, tr2, pidHyp);
11391153
o2::track::TrackParCov trc = candidate3B;
11401154
o2::dataformats::DCA dca;
11411155
if (!trc.propagateToDCA(decay3bodyPv, fitter3body.getBz(), &dca, 5.) ||
11421156
std::abs(dca.getY()) > mSVParams->maxDCAXY3Body || std::abs(dca.getZ()) > mSVParams->maxDCAZ3Body) {
11431157
continue;
11441158
}
11451159
if (mSVParams->createFull3Bodies) {
1146-
candidate3B.setCosPA(bestCosPA);
1160+
candidate3B.setCosPA(vtxCosPA);
11471161
candidate3B.setDCA(fitter3body.getChi2AtPCACandidate());
11481162
m3bodyTmp[ithread].push_back(candidate3B);
11491163
}

Framework/Core/include/Framework/AnalysisDataModel.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1480,7 +1480,7 @@ DECLARE_SOA_INDEX_COLUMN_FULL(Track2, track2, int, Tracks, "_2"); //! Track 2 in
14801480
DECLARE_SOA_INDEX_COLUMN(Collision, collision); //! Collision index
14811481
} // namespace decay3body
14821482

1483-
DECLARE_SOA_TABLE(Decay3Bodys, "AOD", "DECAY3BODY", //! Run 2 cascade table
1483+
DECLARE_SOA_TABLE(Decay3Bodys, "AOD", "DECAY3BODY", //! 3-body decay table
14841484
o2::soa::Index<>, decay3body::CollisionId, decay3body::Track0Id, decay3body::Track1Id, decay3body::Track2Id);
14851485

14861486
using Decay3Bodys = Decay3Bodys; //! this defines the current default version

0 commit comments

Comments
 (0)