Skip to content

Commit 6563723

Browse files
authored
[PWGLF] revert and add trackID in output table (#13156)
1 parent e8c5fc8 commit 6563723

File tree

2 files changed

+11
-98
lines changed

2 files changed

+11
-98
lines changed

PWGLF/DataModel/LFhe3HadronTables.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ DECLARE_SOA_COLUMN(MassTOFHe3, massTOFHe3, float);
5151
DECLARE_SOA_COLUMN(MassTOFHad, massTOFHad, float);
5252
DECLARE_SOA_COLUMN(PIDtrkHe3, pidTrkHe3, uint32_t);
5353
DECLARE_SOA_COLUMN(PIDtrkHad, pidTrkHad, uint32_t);
54+
DECLARE_SOA_COLUMN(TrackIDHe3, trackIDHe3, int);
55+
DECLARE_SOA_COLUMN(TrackIDHad, trackIDHad, int);
5456

5557
DECLARE_SOA_COLUMN(ItsClusterSizeHe3, itsClusterSizeHe3, uint32_t);
5658
DECLARE_SOA_COLUMN(ItsClusterSizeHad, itsClusterSizeHad, uint32_t);
@@ -115,7 +117,9 @@ DECLARE_SOA_TABLE(he3HadronTable, "AOD", "HE3HADTABLE",
115117
he3HadronTablesNS::SharedClustersHe3,
116118
he3HadronTablesNS::SharedClustersHad,
117119
he3HadronTablesNS::IsBkgUS,
118-
he3HadronTablesNS::IsBkgEM)
120+
he3HadronTablesNS::IsBkgEM,
121+
he3HadronTablesNS::TrackIDHe3,
122+
he3HadronTablesNS::TrackIDHad)
119123
DECLARE_SOA_TABLE(he3HadronTableMC, "AOD", "HE3HADTABLEMC",
120124
he3HadronTablesNS::PtMCHe3,
121125
he3HadronTablesNS::EtaMCHe3,

PWGLF/TableProducer/Nuspex/he3HadronFemto.cxx

Lines changed: 6 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
/// \author Your Name (your.email@cern.ch)
1616
/// \since April 2025
1717

18-
#include "PWGCF/FemtoWorld/Core/FemtoWorldMath.h"
1918
#include "PWGLF/DataModel/EPCalibrationTables.h"
2019
#include "PWGLF/DataModel/LFhe3HadronTables.h"
2120
#include "PWGLF/Utils/svPoolCreator.h"
@@ -182,8 +181,6 @@ struct He3HadCandidate {
182181

183182
// collision information
184183
int32_t collisionID = 0;
185-
186-
float kstarfem = 1.f;
187184
};
188185

189186
struct he3HadronFemto {
@@ -198,12 +195,10 @@ struct he3HadronFemto {
198195
Configurable<float> settingCutRigidityMinHe3{"settingCutRigidityMinHe3", 0.8f, "Minimum rigidity for He3"};
199196
Configurable<float> settingCutEta{"settingCutEta", 0.9f, "Eta cut on daughter track"};
200197
Configurable<float> settingCutDCAxy{"settingCutDCAxy", 2.0f, "DCAxy range for tracks"};
201-
Configurable<float> settingCutDCAz{"settingCutDCAz", 3.0f, "DCAz range for tracks"};
198+
Configurable<float> settingCutDCAz{"settingCutDCAz", 2.0f, "DCAz range for tracks"};
202199
Configurable<float> settingCutChi2tpcLow{"settingCutChi2tpcLow", 0.5f, "Low cut on TPC chi2"};
203200
Configurable<float> settingCutInvMass{"settingCutInvMass", 0.0f, "Invariant mass upper limit"};
204201
Configurable<float> settingCutPtMinhe3Had{"settingCutPtMinhe3Had", 0.0f, "Minimum PT cut on he3Had4"};
205-
Configurable<float> settingCutPtMinHad{"settingCutPtMinHad", 0.0f, "Minimum PT cut on Hadron"};
206-
Configurable<float> settingCutPtMaxHad{"settingCutPtMaxHad", 0.0f, "Maximum PT cut on Hadron"};
207202
Configurable<float> settingCutClSizeItsHe3{"settingCutClSizeItsHe3", 4.0f, "Minimum ITS cluster size for He3"};
208203
Configurable<float> settingCutNCls{"settingCutNCls", 5.0f, "Minimum ITS Ncluster for tracks"};
209204
Configurable<float> settingCutChi2NClITS{"settingCutChi2NClITS", 36.f, "Maximum ITS Chi2 for tracks"};
@@ -292,14 +287,6 @@ struct he3HadronFemto {
292287
{"h2NsigmaHadronTPC_preselection", "NsigmaHe3 TPC distribution; #it{p}_{T} (GeV/#it{c}); n#sigma_{TPC}(had)", {HistType::kTH2F, {{100, -5.0f, 5.0f}, {400, -10.0f, 10.0f}}}},
293288
{"h2NsigmaHadronTOF", "NsigmaHadron TOF distribution; #it{p}_{T} (GeV/#it{c}); n#sigma_{TOF}(had)", {HistType::kTH2F, {{20, -5.0f, 5.0f}, {200, -5.0f, 5.0f}}}},
294289
{"h2NsigmaHadronTOF_preselection", "NsigmaHadron TOF distribution; #it{p}_{T} (GeV/#it{c}); n#sigma_{TOF}(had)", {HistType::kTH2F, {{100, -5.0f, 5.0f}, {400, -10.0f, 10.0f}}}},
295-
{"hKstarLSmatter", ";kStar (GeV/c)", {HistType::kTH1F, {{300, 0.0f, 3.0f}}}},
296-
{"hKstarLSantimatter", ";kStar (GeV/c)", {HistType::kTH1F, {{300, 0.0f, 3.0f}}}},
297-
{"hKstarUSmatter", ";kStar (GeV/c)", {HistType::kTH1F, {{300, 0.0f, 3.0f}}}},
298-
{"hKstarUSantimatter", ";kStar (GeV/c)", {HistType::kTH1F, {{300, 0.0f, 3.0f}}}},
299-
{"hKstarLSmatter_femto", ";kStar (GeV/c)", {HistType::kTH1F, {{300, 0.0f, 3.0f}}}},
300-
{"hKstarLSantimatter_femto", ";kStar (GeV/c)", {HistType::kTH1F, {{300, 0.0f, 3.0f}}}},
301-
{"hKstarUSmatter_femto", ";kStar (GeV/c)", {HistType::kTH1F, {{300, 0.0f, 3.0f}}}},
302-
{"hKstarUSantimatter_femto", ";kStar (GeV/c)", {HistType::kTH1F, {{300, 0.0f, 3.0f}}}},
303290
},
304291
OutputObjHandlingPolicy::AnalysisObject,
305292
false,
@@ -440,8 +427,7 @@ struct he3HadronFemto {
440427
candidate.tpcNClsCrossedRows() < crossedRowsToFindableRatio * candidate.tpcNClsFindable() ||
441428
candidate.tpcChi2NCl() > maxChi2NCl ||
442429
candidate.tpcChi2NCl() < settingCutChi2tpcLow ||
443-
candidate.itsChi2NCl() > settingCutChi2NClITS || std::abs(candidate.dcaXY()) > settingCutDCAxy ||
444-
std::abs(candidate.dcaZ()) > settingCutDCAz) {
430+
candidate.itsChi2NCl() > settingCutChi2NClITS) {
445431
return false;
446432
}
447433

@@ -622,9 +608,6 @@ struct he3HadronFemto {
622608
return false;
623609
}
624610

625-
if (std::abs(he3Hadcand.recoPtHad()) < settingCutPtMinHad || std::abs(he3Hadcand.recoPtHad()) > settingCutPtMaxHad)
626-
return false;
627-
628611
he3Hadcand.signHe3 = trackHe3.sign();
629612
he3Hadcand.signHad = trackHad.sign();
630613
if (!settingEnableDCAfitter) {
@@ -693,7 +676,6 @@ struct he3HadronFemto {
693676
beta = std::min(1.f - 1.e-6f, std::max(1.e-4f, beta)); /// sometimes beta > 1 or < 0, to be checked
694677
he3Hadcand.massTOFHad = trackHad.tpcInnerParam() * std::sqrt(1.f / (beta * beta) - 1.f);
695678
}
696-
he3Hadcand.kstarfem = o2::analysis::femtoWorld::FemtoWorldMath::getkstar(trackHad, o2::constants::physics::MassPiPlus, trackHe3, o2::constants::physics::MassHelium3, 1, 2);
697679

698680
return true;
699681
}
@@ -820,7 +802,9 @@ struct he3HadronFemto {
820802
he3Hadcand.sharedClustersHe3,
821803
he3Hadcand.sharedClustersHad,
822804
he3Hadcand.isBkgUS,
823-
he3Hadcand.isBkgEM);
805+
he3Hadcand.isBkgEM,
806+
he3Hadcand.trackIDHe3,
807+
he3Hadcand.trackIDHad);
824808
if (isMC) {
825809
outputMcTable(
826810
he3Hadcand.momHe3MC,
@@ -857,81 +841,6 @@ struct he3HadronFemto {
857841
}
858842

859843
// ==================================================================================================================
860-
double computePrTPCnsig(double InnerParamTPCHad, double SignalTPCHad)
861-
{
862-
double m_BBparamsProton[6] = {-54.42066571222577, 0.2857381250239097, 1.247140602468868, 0.6297483918147729, 2.985438833884555, 0.09};
863-
864-
float TPCinnerParam = InnerParamTPCHad;
865-
float expTPCSignal = o2::tpc::BetheBlochAleph((TPCinnerParam / 0.9382721), m_BBparamsProton[0], m_BBparamsProton[1], m_BBparamsProton[2], m_BBparamsProton[3], m_BBparamsProton[4]);
866-
double resoTPC{expTPCSignal * m_BBparamsProton[5]};
867-
return ((SignalTPCHad - expTPCSignal) / resoTPC);
868-
}
869-
870-
double tofNSigmaCalculation(double MassTOFHad, double ptHad)
871-
{
872-
double fExpTOFMassHad = 0.9487; // Proton mass in TOF
873-
const float kp0 = 1.22204e-02;
874-
const float kp1 = 7.48467e-01;
875-
876-
double fSigmaTOFMassHad = (kp0 * TMath::Exp(kp1 * TMath::Abs(ptHad))) * fExpTOFMassHad;
877-
double fNSigmaTOFHad = (MassTOFHad - fExpTOFMassHad) / fSigmaTOFMassHad;
878-
return fNSigmaTOFHad;
879-
}
880-
881-
static float computeKstar(const He3HadCandidate& he3Hadcand)
882-
{
883-
const float massHe = o2::constants::physics::MassHelium3;
884-
const float massHad = o2::constants::physics::MassPiPlus;
885-
886-
const ROOT::Math::PtEtaPhiMVector He(std::abs(he3Hadcand.recoPtHe3()), he3Hadcand.recoEtaHe3(), he3Hadcand.recoPhiHe3(), massHe);
887-
const ROOT::Math::PtEtaPhiMVector Had(std::abs(he3Hadcand.recoPtHad()), he3Hadcand.recoEtaHad(), he3Hadcand.recoPhiHad(), massHad);
888-
const ROOT::Math::PtEtaPhiMVector trackSum = He + Had;
889-
890-
const float beta = trackSum.Beta();
891-
const float betax = beta * std::cos(trackSum.Phi()) * std::sin(trackSum.Theta());
892-
const float betay = beta * std::sin(trackSum.Phi()) * std::sin(trackSum.Theta());
893-
const float betaz = beta * std::cos(trackSum.Theta());
894-
895-
ROOT::Math::PxPyPzMVector HeCMS(He);
896-
ROOT::Math::PxPyPzMVector HadCMS(Had);
897-
898-
const ROOT::Math::Boost boostPRF = ROOT::Math::Boost(-betax, -betay, -betaz);
899-
HeCMS = boostPRF(HeCMS);
900-
HadCMS = boostPRF(HadCMS);
901-
902-
const ROOT::Math::PxPyPzMVector RelKstar = HeCMS - HadCMS;
903-
return 0.5 * RelKstar.P();
904-
}
905-
906-
void fillKstar(const He3HadCandidate& he3Hadcand)
907-
{
908-
double PrTPCnsigma = computePrTPCnsig(he3Hadcand.momHadTPC, he3Hadcand.tpcSignalHad);
909-
double PrTOFnsigma = tofNSigmaCalculation(he3Hadcand.massTOFHad, he3Hadcand.recoPtHad());
910-
if (std::abs(PrTPCnsigma) < 3)
911-
return;
912-
if (std::abs(PrTOFnsigma) < 3)
913-
return;
914-
915-
float kstar = computeKstar(he3Hadcand);
916-
if (he3Hadcand.isBkgUS == 0) {
917-
if (he3Hadcand.recoPtHe3() > 0) {
918-
mQaRegistry.fill(HIST("hKstarLSmatter"), kstar);
919-
mQaRegistry.fill(HIST("hKstarLSmatter_femto"), he3Hadcand.kstarfem);
920-
} else {
921-
mQaRegistry.fill(HIST("hKstarLSantimatter"), kstar);
922-
mQaRegistry.fill(HIST("hKstarLSantimatter_femto"), he3Hadcand.kstarfem);
923-
}
924-
} else {
925-
if (he3Hadcand.recoPtHe3() > 0) {
926-
mQaRegistry.fill(HIST("hKstarUSmatter"), kstar);
927-
mQaRegistry.fill(HIST("hKstarUSmatter_femto"), he3Hadcand.kstarfem);
928-
} else {
929-
mQaRegistry.fill(HIST("hKstarUSantimatter"), kstar);
930-
mQaRegistry.fill(HIST("hKstarUSantimatter_femto"), he3Hadcand.kstarfem);
931-
}
932-
}
933-
fillHistograms(he3Hadcand);
934-
}
935844

936845
template <typename Tcollisions, typename Ttracks>
937846
void fillPairs(const Tcollisions& collisions, const Ttracks& tracks, const bool isMixedEvent)
@@ -946,7 +855,7 @@ struct he3HadronFemto {
946855
if (!fillCandidateInfo(heTrack, hadTrack, collBracket, collisions, he3Hadcand, tracks, isMixedEvent)) {
947856
continue;
948857
}
949-
fillKstar(he3Hadcand);
858+
fillHistograms(he3Hadcand);
950859
auto collision = collisions.rawIteratorAt(he3Hadcand.collisionID);
951860
fillTable(he3Hadcand, collision, /*isMC*/ false);
952861
}

0 commit comments

Comments
 (0)