Skip to content

Commit d65a829

Browse files
committed
[PWGHF] removing check in accept. for recMC
1 parent c29bb51 commit d65a829

File tree

1 file changed

+13
-31
lines changed

1 file changed

+13
-31
lines changed

PWGHF/D2H/Tasks/taskXic.cxx

Lines changed: 13 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,18 @@
1919
/// \author Himanshu Sharma <himanshu.sharma@cern.ch>, University and INFN Padova
2020
/// \author Cristina Terrevoli <cristina.terrevoli@cern.ch>, INFN Bari
2121

22-
#include <vector>
22+
#include "PWGHF/Core/HfHelper.h"
23+
#include "PWGHF/Core/SelectorCuts.h"
24+
#include "PWGHF/DataModel/CandidateReconstructionTables.h"
25+
#include "PWGHF/DataModel/CandidateSelectionTables.h"
2326

2427
#include "CommonConstants/PhysicsConstants.h"
2528
#include "Framework/AnalysisTask.h"
2629
#include "Framework/HistogramRegistry.h"
2730
#include "Framework/O2DatabasePDGPlugin.h"
2831
#include "Framework/runDataProcessing.h"
2932

30-
#include "PWGHF/Core/HfHelper.h"
31-
#include "PWGHF/Core/SelectorCuts.h"
32-
#include "PWGHF/DataModel/CandidateReconstructionTables.h"
33-
#include "PWGHF/DataModel/CandidateSelectionTables.h"
33+
#include <vector>
3434

3535
using namespace o2;
3636
using namespace o2::analysis;
@@ -234,9 +234,9 @@ struct HfTaskXic {
234234
const AxisSpec thnAxisMCAllProngAccepted{2, -0.5, 1.5, "All MC prongs accepted"};
235235

236236
if (doprocessDataWithMl || doprocessMcWithMl) { // with ML
237-
registry.add("hnXicVarsWithBdt", "THn for Xic candidates with BDT scores", HistType::kTHnSparseF, {thnAxisMass, thnAxisPt, thnAxisBdtScoreXicBkg, thnAxisBdtScoreXicPrompt, thnAxisBdtScoreXicNonPrompt, thnAxisMcOrigin, thnAxisPtMC, thnAxisYMC, thnAxisMCAllProngAccepted});
237+
registry.add("hnXicVarsWithBdt", "THn for Xic candidates with BDT scores", HistType::kTHnSparseF, {thnAxisMass, thnAxisPt, thnAxisBdtScoreXicBkg, thnAxisBdtScoreXicPrompt, thnAxisBdtScoreXicNonPrompt, thnAxisMcOrigin});
238238
} else {
239-
registry.add("hnXicVars", "THn for Xic candidates", HistType::kTHnSparseF, {thnAxisMass, thnAxisPt, thnAxisChi2PCA, thnAxisDecLength, thnAxisDecLengthXY, thnAxisCPA, thnAxisMcOrigin, thnAxisPtMC, thnAxisYMC, thnAxisMCAllProngAccepted});
239+
registry.add("hnXicVars", "THn for Xic candidates", HistType::kTHnSparseF, {thnAxisMass, thnAxisPt, thnAxisChi2PCA, thnAxisDecLength, thnAxisDecLengthXY, thnAxisCPA, thnAxisMcOrigin});
240240
}
241241
}
242242
} // end init
@@ -430,7 +430,6 @@ struct HfTaskXic {
430430
// Get the corresponding MC particle.
431431
auto mcParticleProng0 = candidate.template prong0_as<aod::TracksWMc>().template mcParticle_as<soa::Join<aod::McParticles, aod::HfCand3ProngMcGen>>();
432432
auto pdgCodeProng0 = std::abs(mcParticleProng0.pdgCode());
433-
auto yProng0 = RecoDecay::y(mcParticleProng0.pVector(), o2::constants::physics::MassXiCPlus);
434433
std::array<float, 3> ptProngs;
435434
std::array<float, 3> etaProngs;
436435
// Signal
@@ -464,7 +463,8 @@ struct HfTaskXic {
464463
registry.fill(HIST("MC/reconstructed/signal/hEtaVsPtRecSig"), candidate.eta(), ptCandidate);
465464

466465
/// reconstructed signal prompt
467-
if (candidate.originMcRec() == RecoDecay::OriginType::Prompt) {
466+
int origin = candidate.originMcRec();
467+
if (origin == RecoDecay::OriginType::Prompt) {
468468
if ((candidate.isSelXicToPKPi() >= selectionFlagXic) && pdgCodeProng0 == kProton) {
469469
registry.fill(HIST("MC/reconstructed/prompt/hMassRecSigPrompt"), massXicToPKPi);
470470
registry.fill(HIST("MC/reconstructed/prompt/hMassVsPtRecSigPrompt"), massXicToPKPi, ptCandidate);
@@ -489,40 +489,22 @@ struct HfTaskXic {
489489
}
490490

491491
if (enableTHn) {
492-
double massXic(-1);
493492
double outputBkg(-1), outputPrompt(-1), outputFD(-1);
494493
const int ternaryCl = 3;
495-
bool allProngsInAcceptance = false;
496494
if ((candidate.isSelXicToPKPi() >= selectionFlagXic) && pdgCodeProng0 == kProton) {
497-
massXic = hfHelper.invMassXicToPKPi(candidate);
498-
int counter = 0;
499-
for (const auto& daught : mcParticleProng0.template daughters_as<soa::Join<aod::McParticles, aod::HfCand3ProngMcGen>>()) {
500-
ptProngs[counter] = daught.pt();
501-
etaProngs[counter] = daught.eta();
502-
counter++;
503-
}
504-
allProngsInAcceptance = isProngInAcceptance(etaProngs[0], ptProngs[0]) && isProngInAcceptance(etaProngs[1], ptProngs[1]) && isProngInAcceptance(etaProngs[2], ptProngs[2]);
505495
if constexpr (useMl) {
506496
if (candidate.mlProbXicToPKPi().size() == ternaryCl) {
507497
outputBkg = candidate.mlProbXicToPKPi()[0]; /// bkg score
508498
outputPrompt = candidate.mlProbXicToPKPi()[1]; /// prompt score
509499
outputFD = candidate.mlProbXicToPKPi()[2]; /// non-prompt score
510500
}
511501
/// Fill the ML outputScores and variables of candidate (todo: add multiplicity)
512-
registry.get<THnSparse>(HIST("hnXicVarsWithBdt"))->Fill(massXic, ptCandidate, outputBkg, outputPrompt, outputFD, candidate.originMcRec(), mcParticleProng0.pt(), yProng0, allProngsInAcceptance);
502+
registry.get<THnSparse>(HIST("hnXicVarsWithBdt"))->Fill(massXicToPiKP, ptCandidate, outputBkg, outputPrompt, outputFD, origin);
513503
} else {
514-
registry.get<THnSparse>(HIST("hnXicVars"))->Fill(massXic, ptCandidate, candidate.chi2PCA(), candidate.decayLength(), candidate.decayLengthXY(), candidate.cpa(), candidate.originMcRec(), mcParticleProng0.pt(), yProng0, allProngsInAcceptance);
504+
registry.get<THnSparse>(HIST("hnXicVars"))->Fill(massXicToPiKP, ptCandidate, candidate.chi2PCA(), candidate.decayLength(), candidate.decayLengthXY(), candidate.cpa(), origin);
515505
}
516506
}
517507
if ((candidate.isSelXicToPiKP() >= selectionFlagXic) && pdgCodeProng0 == kPiPlus) {
518-
massXic = hfHelper.invMassXicToPiKP(candidate);
519-
int counter = 0;
520-
for (const auto& daught : mcParticleProng0.template daughters_as<soa::Join<aod::McParticles, aod::HfCand3ProngMcGen>>()) {
521-
ptProngs[counter] = daught.pt();
522-
etaProngs[counter] = daught.eta();
523-
counter++;
524-
}
525-
allProngsInAcceptance = isProngInAcceptance(etaProngs[0], ptProngs[0]) && isProngInAcceptance(etaProngs[1], ptProngs[1]) && isProngInAcceptance(etaProngs[2], ptProngs[2]);
526508
if constexpr (useMl) {
527509
if (candidate.mlProbXicToPiKP().size() == ternaryCl) {
528510
outputBkg = candidate.mlProbXicToPiKP()[0]; /// bkg score
@@ -531,9 +513,9 @@ struct HfTaskXic {
531513
}
532514
/// Fill the ML outputScores and variables of candidate (todo: add multiplicity)
533515
// add here the pT_Mother, y_Mother, level (reco, Gen, Gen + Acc)
534-
registry.get<THnSparse>(HIST("hnXicVarsWithBdt"))->Fill(massXic, ptCandidate, outputBkg, outputPrompt, outputFD, candidate.originMcRec(), mcParticleProng0.pt(), yProng0, allProngsInAcceptance);
516+
registry.get<THnSparse>(HIST("hnXicVarsWithBdt"))->Fill(massXicToPiKP, ptCandidate, outputBkg, outputPrompt, outputFD, origin);
535517
} else {
536-
registry.get<THnSparse>(HIST("hnXicVars"))->Fill(massXic, ptCandidate, candidate.chi2PCA(), candidate.decayLength(), candidate.decayLengthXY(), candidate.cpa(), candidate.originMcRec(), mcParticleProng0.pt(), yProng0, allProngsInAcceptance);
518+
registry.get<THnSparse>(HIST("hnXicVars"))->Fill(massXicToPiKP, ptCandidate, candidate.chi2PCA(), candidate.decayLength(), candidate.decayLengthXY(), candidate.cpa(), origin);
537519
}
538520
}
539521
} // enable THn

0 commit comments

Comments
 (0)