Skip to content

Commit a02aaac

Browse files
authored
[PWGLF] added reweighting for secondary lambdas (#9654)
1 parent 1e49651 commit a02aaac

File tree

1 file changed

+99
-8
lines changed

1 file changed

+99
-8
lines changed

PWGLF/Tasks/Strangeness/strangenessInJets.cxx

Lines changed: 99 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
/// \file strangenessInJets.cxx
1313
///
1414
/// \brief task for analysis of strangeness in jets
15-
/// \author Alberto Caliva (alberto.caliva@cern.ch), Francesca Ercolessi (francesca.ercolessi@cern.ch)
15+
/// \author Alberto Caliva (alberto.caliva@cern.ch), Francesca Ercolessi (francesca.ercolessi@cern.ch), Nicolò Jacazio (nicolo.jacazio@cern.ch)
1616
/// \since May 22, 2024
1717

1818
#include <TLorentzVector.h>
@@ -132,6 +132,10 @@ struct StrangenessInJets {
132132
Configurable<std::string> histoNameWeightLambdaUe{"histoNameWeightLambdaUe", "", "reweighting histogram: lambda in ue"};
133133
Configurable<std::string> histoNameWeightAntilambdaJet{"histoNameWeightAntilambdaJet", "", "reweighting histogram: antilambda in jet"};
134134
Configurable<std::string> histoNameWeightAntilambdaUe{"histoNameWeightAntilambdaUe", "", "reweighting histogram: antilambda in ue"};
135+
Configurable<std::string> histoNameWeightsXiInJet{"histoNameWeightsXiInJet", "", "reweighting histogram: xi in jet"};
136+
Configurable<std::string> histoNameWeightsXiInUe{"histoNameWeightsXiInUe", "", "reweighting histogram: xi in ue"};
137+
Configurable<std::string> histoNameWeightsAntiXiInJet{"histoNameWeightsAntiXiInJet", "", "reweighting histogram: antixi in jet"};
138+
Configurable<std::string> histoNameWeightsAntiXiInUe{"histoNameWeightsAntiXiInUe", "", "reweighting histogram: antixi in ue"};
135139

136140
// Two-dimensional weights
137141
TH2F* twodWeightsPiplusJet = nullptr;
@@ -144,6 +148,10 @@ struct StrangenessInJets {
144148
TH2F* twodWeightsLambdaUe;
145149
TH2F* twodWeightsAntilambdaJet;
146150
TH2F* twodWeightsAntilambdaUe;
151+
TH1F* weightsXiInJet;
152+
TH1F* weightsXiInUe;
153+
TH1F* weightsAntiXiInJet;
154+
TH1F* weightsAntiXiInUe;
147155

148156
Service<o2::ccdb::BasicCCDBManager> ccdb;
149157
o2::ccdb::CcdbApi ccdbApi;
@@ -162,14 +170,18 @@ struct StrangenessInJets {
162170
ccdb->setFatalWhenNull(false);
163171

164172
if (applyReweighting) {
165-
getReweightingHistograms(ccdb, TString(pathToFile), TString(histoNameWeightK0Jet), TString(histoNameWeightK0Ue), TString(histoNameWeightLambdaJet), TString(histoNameWeightLambdaUe), TString(histoNameWeightAntilambdaJet), TString(histoNameWeightAntilambdaUe));
173+
getReweightingHistograms(ccdb, TString(pathToFile), TString(histoNameWeightK0Jet), TString(histoNameWeightK0Ue), TString(histoNameWeightLambdaJet), TString(histoNameWeightLambdaUe), TString(histoNameWeightAntilambdaJet), TString(histoNameWeightAntilambdaUe), TString(histoNameWeightsXiInJet), TString(histoNameWeightsXiInUe), TString(histoNameWeightsAntiXiInJet), TString(histoNameWeightsAntiXiInUe));
166174
} else {
167175
twodWeightsK0Jet = nullptr;
168176
twodWeightsK0Ue = nullptr;
169177
twodWeightsLambdaJet = nullptr;
170178
twodWeightsLambdaUe = nullptr;
171179
twodWeightsAntilambdaJet = nullptr;
172180
twodWeightsAntilambdaUe = nullptr;
181+
weightsXiInJet = nullptr;
182+
weightsXiInUe = nullptr;
183+
weightsAntiXiInJet = nullptr;
184+
weightsAntiXiInUe = nullptr;
173185
}
174186

175187
// Event Counters
@@ -281,6 +293,12 @@ struct StrangenessInJets {
281293
registryMC.add("Lambda_reconstructed_incl", "Lambda_reconstructed_incl", HistType::kTH2F, {multBinning, ptAxis});
282294
registryMC.add("AntiLambda_reconstructed_incl", "AntiLambda_reconstructed_incl", HistType::kTH2F, {multBinning, ptAxis});
283295

296+
// Histograms for secondary lambda in jet and UE
297+
registryMC.add("Secondary_Lambda_InJet", "Secondary_Lambda_InJet", HistType::kTH1F, {ptAxis});
298+
registryMC.add("Secondary_Lambda_InUe", "Secondary_Lambda_InUe", HistType::kTH1F, {ptAxis});
299+
registryMC.add("Secondary_AntiLambda_InJet", "Secondary_AntiLambda_InJet", HistType::kTH1F, {ptAxis});
300+
registryMC.add("Secondary_AntiLambda_InUe", "Secondary_AntiLambda_InUe", HistType::kTH1F, {ptAxis});
301+
284302
// Histograms for 2d reweighting (pion)
285303
registryMC.add("pi_plus_eta_pt_jet", "pi_plus_eta_pt_jet", HistType::kTH2F, {ptAxisPi, etaAxis});
286304
registryMC.add("pi_plus_eta_pt_ue", "pi_plus_eta_pt_ue", HistType::kTH2F, {ptAxisPi, etaAxis});
@@ -874,7 +892,7 @@ struct StrangenessInJets {
874892
return false;
875893
}
876894

877-
void getReweightingHistograms(o2::framework::Service<o2::ccdb::BasicCCDBManager> const& ccdbObj, TString filepath, TString histname_k0_jet, TString histname_k0_ue, TString histname_lambda_jet, TString histname_lambda_ue, TString histname_antilambda_jet, TString histname_antilambda_ue)
895+
void getReweightingHistograms(o2::framework::Service<o2::ccdb::BasicCCDBManager> const& ccdbObj, TString filepath, TString histname_k0_jet, TString histname_k0_ue, TString histname_lambda_jet, TString histname_lambda_ue, TString histname_antilambda_jet, TString histname_antilambda_ue, TString histname_xi_jet, TString histname_xi_ue, TString histname_antixi_jet, TString histname_antixi_ue)
878896
{
879897
TList* l = ccdbObj->get<TList>(filepath.Data());
880898
if (!l) {
@@ -930,12 +948,38 @@ struct StrangenessInJets {
930948
return;
931949
}
932950

951+
// Secondary Lambda
952+
weightsXiInJet = static_cast<TH1F*>(l->FindObject(Form("%s", histname_xi_jet.Data())));
953+
if (!weightsXiInJet) {
954+
LOGP(error, "Could not open histogram {}", Form("%s", histname_xi_jet.Data()));
955+
return;
956+
}
957+
weightsXiInUe = static_cast<TH1F*>(l->FindObject(Form("%s", histname_xi_ue.Data())));
958+
if (!weightsXiInUe) {
959+
LOGP(error, "Could not open histogram {}", Form("%s", histname_xi_ue.Data()));
960+
return;
961+
}
962+
weightsAntiXiInJet = static_cast<TH1F*>(l->FindObject(Form("%s", histname_antixi_jet.Data())));
963+
if (!weightsAntiXiInJet) {
964+
LOGP(error, "Could not open histogram {}", Form("%s", histname_antixi_jet.Data()));
965+
return;
966+
}
967+
weightsAntiXiInUe = static_cast<TH1F*>(l->FindObject(Form("%s", histname_antixi_ue.Data())));
968+
if (!weightsAntiXiInUe) {
969+
LOGP(error, "Could not open histogram {}", Form("%s", histname_antixi_ue.Data()));
970+
return;
971+
}
972+
933973
LOGP(info, "Opened histogram {}", Form("%s", histname_k0_jet.Data()));
934974
LOGP(info, "Opened histogram {}", Form("%s", histname_k0_ue.Data()));
935975
LOGP(info, "Opened histogram {}", Form("%s", histname_lambda_jet.Data()));
936976
LOGP(info, "Opened histogram {}", Form("%s", histname_lambda_ue.Data()));
937977
LOGP(info, "Opened histogram {}", Form("%s", histname_antilambda_jet.Data()));
938978
LOGP(info, "Opened histogram {}", Form("%s", histname_antilambda_ue.Data()));
979+
LOGP(info, "Opened histogram {}", Form("%s", histname_xi_jet.Data()));
980+
LOGP(info, "Opened histogram {}", Form("%s", histname_xi_ue.Data()));
981+
LOGP(info, "Opened histogram {}", Form("%s", histname_antixi_jet.Data()));
982+
LOGP(info, "Opened histogram {}", Form("%s", histname_antixi_ue.Data()));
939983
}
940984

941985
void processData(SelCollisions::iterator const& collision, aod::V0Datas const& fullV0s, aod::CascDataExt const& Cascades, StrHadronDaughterTracks const& tracks)
@@ -1101,8 +1145,14 @@ struct StrangenessInJets {
11011145
for (int j = 0; j < static_cast<int>(jet.size()); j++) {
11021146
if (isSelected[j] == 0 || i == j)
11031147
continue;
1148+
if (overlap(jet[i], jet[j], rJet))
1149+
nOverlaps++;
11041150
if (overlap(jet[i], ue1[j], rJet) || overlap(jet[i], ue2[j], rJet))
11051151
nOverlaps++;
1152+
if (overlap(ue1[i], ue1[j], rJet) || overlap(ue1[i], ue2[j], rJet))
1153+
nOverlaps++;
1154+
if (overlap(ue2[i], ue2[j], rJet))
1155+
nOverlaps++;
11061156
}
11071157
}
11081158
registryQC.fill(HIST("jet_ue_overlaps"), nJetsSelected, nOverlaps);
@@ -1464,6 +1514,52 @@ struct StrangenessInJets {
14641514
if (pdgParent == 0)
14651515
continue;
14661516

1517+
// Generated Momentum of V0
1518+
TVector3 momentumPos(posParticle.px(), posParticle.py(), posParticle.pz());
1519+
TVector3 momentumNeg(negParticle.px(), negParticle.py(), negParticle.pz());
1520+
TVector3 momentumV0 = momentumPos + momentumNeg;
1521+
1522+
// Feed-down for lambda
1523+
if (passedLambdaSelection(v0, pos, neg) && pdgParent == 3122) {
1524+
if (!isPhysPrim) {
1525+
double wSecLambdaInJet(1.0);
1526+
double wSecLambdaInUe(1.0);
1527+
int idMother = posParticle.mothersIds()[0];
1528+
auto mother = mcParticles.iteratorAt(idMother);
1529+
int idGrandMother = mother.mothersIds()[0];
1530+
auto grandMother = mcParticles.iteratorAt(idGrandMother);
1531+
int ibinXiInJet = weightsXiInJet->GetXaxis()->FindBin(grandMother.pt());
1532+
int ibinXiInUe = weightsXiInUe->GetXaxis()->FindBin(grandMother.pt());
1533+
if (std::fabs(grandMother.pdgCode()) == 3312 || std::fabs(grandMother.pdgCode()) == 3322) {
1534+
wSecLambdaInJet = weightsXiInJet->GetBinContent(ibinXiInJet);
1535+
wSecLambdaInUe = weightsXiInUe->GetBinContent(ibinXiInUe);
1536+
}
1537+
registryMC.fill(HIST("Secondary_Lambda_InJet"), v0.pt(), wSecLambdaInJet);
1538+
registryMC.fill(HIST("Secondary_Lambda_InUe"), v0.pt(), wSecLambdaInUe);
1539+
}
1540+
}
1541+
1542+
// Feed-down for antilambda
1543+
if (passedAntiLambdaSelection(v0, pos, neg) && pdgParent == -3122) {
1544+
if (!isPhysPrim) {
1545+
double wSecAntiLambdaInJet(1.0);
1546+
double wSecAntiLambdaInUe(1.0);
1547+
1548+
int idMother = posParticle.mothersIds()[0];
1549+
auto mother = mcParticles.iteratorAt(idMother);
1550+
int idGrandMother = mother.mothersIds()[0];
1551+
auto grandMother = mcParticles.iteratorAt(idGrandMother);
1552+
int ibinAntiXiInJet = weightsAntiXiInJet->GetXaxis()->FindBin(grandMother.pt());
1553+
int ibinAntiXiInUe = weightsAntiXiInUe->GetXaxis()->FindBin(grandMother.pt());
1554+
if (std::fabs(grandMother.pdgCode()) == 3312 || std::fabs(grandMother.pdgCode()) == 3322) {
1555+
wSecAntiLambdaInJet = weightsAntiXiInJet->GetBinContent(ibinAntiXiInJet);
1556+
wSecAntiLambdaInUe = weightsAntiXiInUe->GetBinContent(ibinAntiXiInUe);
1557+
}
1558+
registryMC.fill(HIST("Secondary_AntiLambda_InJet"), v0.pt(), wSecAntiLambdaInJet);
1559+
registryMC.fill(HIST("Secondary_AntiLambda_InUe"), v0.pt(), wSecAntiLambdaInUe);
1560+
}
1561+
}
1562+
14671563
if (passedK0ShortSelection(v0, pos, neg) && pdgParent == 310) {
14681564
registryMC.fill(HIST("K0s_reconstructed_incl"), multiplicity, v0.pt());
14691565
}
@@ -1476,11 +1572,6 @@ struct StrangenessInJets {
14761572
if (!isPhysPrim)
14771573
continue;
14781574

1479-
// Momentum of V0
1480-
TVector3 momentumPos(posParticle.px(), posParticle.py(), posParticle.pz());
1481-
TVector3 momentumNeg(negParticle.px(), negParticle.py(), negParticle.pz());
1482-
TVector3 momentumV0 = momentumPos + momentumNeg;
1483-
14841575
double wK0jet(1.0), wK0Ue(1.0), wLambdaJet(1.0), wLambdaUe(1.0), wAntilambdaJet(1.0), wAntilambdaUe(1.0);
14851576
if (applyReweighting) {
14861577
int ix = twodWeightsK0Jet->GetXaxis()->FindBin(momentumV0.Pt());

0 commit comments

Comments
 (0)