Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PWGLF/NuSpEx: Add hLnnCandLoss and h3HLoss plots #8215

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 44 additions & 2 deletions PWGLF/TableProducer/Nuspex/lnnRecoTask.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ std::shared_ptr<TH1> hDecayChannel;
std::shared_ptr<TH1> hIsMatterGen;
std::shared_ptr<TH1> hIsMatterGenTwoBody;
std::shared_ptr<TH2> hDCAxy3H;
std::shared_ptr<TH1> hLnnCandLoss;
std::shared_ptr<TH1> h3HLoss;

float alphaAP(std::array<float, 3> const& momB, std::array<float, 3> const& momC)
{
Expand Down Expand Up @@ -251,9 +253,30 @@ struct lnnRecoTask {
h3HSignalPtTOF = qaRegistry.add<TH2>("h3HSignalPtTOF", "; #it{p}_{T}({}^{3}H) (GeV/#it{c}); #beta (TOF)", HistType::kTH2F, {PtTrAxis, BetaAxis});
hDCAxy3H = qaRegistry.add<TH2>("hDCAxy3H", "; #it{p}_{T}({}^{3}H) (GeV/#it{c}); #it{DCA}_{xy} 3H", HistType::kTH2F, {PtPosTrAxis, DCAxyAxis});
hEvents = qaRegistry.add<TH1>("hEvents", ";Events; ", HistType::kTH1D, {{2, -0.5, 1.5}});
hLnnCandLoss = qaRegistry.add<TH1>("hLnnCandLoss", ";CandLoss; ", HistType::kTH1D, {{7, -0.5, 6.5}});
h3HLoss = qaRegistry.add<TH1>("h3HLoss", ";3HLoss; ", HistType::kTH1D, {{5, -0.5, 4.5}});

hEvents->GetXaxis()->SetBinLabel(1, "All");
hEvents->GetXaxis()->SetBinLabel(2, "sel8");

hLnnCandLoss->GetYaxis()->SetTitle("#it{N}_{candidates}");
hLnnCandLoss->GetXaxis()->SetTitle("Cuts");
hLnnCandLoss->GetXaxis()->SetBinLabel(1, "Initial LnnCandidates");
hLnnCandLoss->GetXaxis()->SetBinLabel(2, "not 3H");
hLnnCandLoss->GetXaxis()->SetBinLabel(3, "not anti3H");
hLnnCandLoss->GetXaxis()->SetBinLabel(4, "#it{p}_{Tmin}");
hLnnCandLoss->GetXaxis()->SetBinLabel(5, "!isLnnMass");
hLnnCandLoss->GetXaxis()->SetBinLabel(6, "DCA #it{V}_{0} daughter");
hLnnCandLoss->GetXaxis()->SetBinLabel(7, "cosPA");

h3HLoss->GetYaxis()->SetTitle("Counts");
h3HLoss->GetXaxis()->SetTitle("Cuts");
h3HLoss->GetXaxis()->SetBinLabel(1, "Initial 3HTracks");
h3HLoss->GetXaxis()->SetBinLabel(2, "Track selection");
h3HLoss->GetXaxis()->SetBinLabel(3, "#it{p}_{T} Min TOF");
h3HLoss->GetXaxis()->SetBinLabel(4, "!hasTOF");
h3HLoss->GetXaxis()->SetBinLabel(5, "Mass2 Triton");

if (doprocessMC) {
hDecayChannel = qaRegistry.add<TH1>("hDecayChannel", ";Decay channel; ", HistType::kTH1D, {{2, -0.5, 1.5}});
hDecayChannel->GetXaxis()->SetBinLabel(1, "2-body");
Expand Down Expand Up @@ -361,14 +384,27 @@ struct lnnRecoTask {
float alpha = alphaAP(momPos, momNeg);
lnnCandidate lnnCand;
lnnCand.isMatter = alpha > 0;
hLnnCandLoss->Fill(0.);
if ((lnnCand.isMatter && !is3H) || (!lnnCand.isMatter && !isAnti3H)) {
if (lnnCand.isMatter && !is3H) {
hLnnCandLoss->Fill(1.);
}
if (!lnnCand.isMatter && !isAnti3H) {
hLnnCandLoss->Fill(2.);
}
continue;
}

auto& h3track = lnnCand.isMatter ? posTrack : negTrack;
auto& h3Rigidity = lnnCand.isMatter ? posRigidity : negRigidity;
h3HLoss->Fill(0.);

if (h3Rigidity < TPCRigidityMin3H ||
h3track.tpcNClsFound() < nTPCClusMin3H ||
h3track.tpcChi2NCl() < Chi2nClusTPCMin ||
h3track.tpcChi2NCl() > Chi2nClusTPCMax ||
h3track.itsChi2NCl() > Chi2nClusITS) {
h3HLoss->Fill(1.);
continue;
}

Expand All @@ -392,12 +428,15 @@ struct lnnRecoTask {

float beta = -1.f;
if (h3track.pt() >= ptMinTOF) {
h3HLoss->Fill(2.);
if (!h3track.hasTOF()) {
h3HLoss->Fill(3.);
continue;
}
beta = h3track.beta();
lnnCand.mass2TrTOF = h3track.mass() * h3track.mass();
if (lnnCand.mass2TrTOF < TrTOFMass2Cut) {
h3HLoss->Fill(4.);
continue;
}
}
Expand Down Expand Up @@ -436,6 +475,7 @@ struct lnnRecoTask {

float lnnPt = std::hypot(lnnMom[0], lnnMom[1]);
if (lnnPt < ptMin) {
hLnnCandLoss->Fill(4.);
continue;
}

Expand All @@ -447,19 +487,22 @@ struct lnnRecoTask {
isLNNMass = true;
}
if (!isLNNMass) {
hLnnCandLoss->Fill(5.);
continue;
}

// V0, primary vertex and poiting angle
lnnCand.dcaV0dau = std::sqrt(fitter.getChi2AtPCACandidate());
if (lnnCand.dcaV0dau > dcav0dau) {
hLnnCandLoss->Fill(6.);
continue;
}

std::array<float, 3> primVtx = {collision.posX(), collision.posY(), collision.posZ()};

double cosPA = RecoDecay::cpa(primVtx, lnnCand.decVtx, lnnMom);
if (cosPA < v0cospa) {
hLnnCandLoss->Fill(7.);
continue;
}

Expand Down Expand Up @@ -505,7 +548,6 @@ struct lnnRecoTask {
if (mcLabPos.has_mcParticle() && mcLabNeg.has_mcParticle()) {
auto mcTrackPos = mcLabPos.mcParticle_as<aod::McParticles>();
auto mcTrackNeg = mcLabNeg.mcParticle_as<aod::McParticles>();

if (mcTrackPos.has_mothers() && mcTrackNeg.has_mothers()) {
for (auto& negMother : mcTrackNeg.mothers_as<aod::McParticles>()) {
for (auto& posMother : mcTrackPos.mothers_as<aod::McParticles>()) {
Expand Down Expand Up @@ -715,4 +757,4 @@ WorkflowSpec
{
return WorkflowSpec{
adaptAnalysisTask<lnnRecoTask>(cfgc)};
}
}
Loading