Skip to content
Merged
Show file tree
Hide file tree
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
111 changes: 55 additions & 56 deletions EventFiltering/PWGHF/HFFilter.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -149,14 +149,13 @@ struct HfFilter { // Main struct for HF triggers

// parameters for Sigma_C proton trigger
Configurable<LabeledArray<float>> cutsSigmaCPr{
"cutsSigmaCPr",
{cutsSigmaCPrDefault[0],
static_cast<uint32_t>(labelsRowsSigmaCPr.size()),
static_cast<uint32_t>(labelsColumnsSigmaCPr.size()),
labelsRowsSigmaCPr,
labelsColumnsSigmaCPr},
"Cuts for SigmaCPr trigger (proton pT and TOF threshold pT)"
};
"cutsSigmaCPr",
{cutsSigmaCPrDefault[0],
static_cast<uint32_t>(labelsRowsSigmaCPr.size()),
static_cast<uint32_t>(labelsColumnsSigmaCPr.size()),
labelsRowsSigmaCPr,
labelsColumnsSigmaCPr},
"Cuts for SigmaCPr trigger (proton pT and TOF threshold pT)"};
Configurable<bool> forceTofProtonForSigmaCPr{"forceTofProtonForSigmaCPr", true, "flag to force TOF PID for protons in SigmaCPr trigger"};

// parameters for charm baryons to Xi bachelor
Expand Down Expand Up @@ -301,10 +300,10 @@ struct HfFilter { // Main struct for HF triggers
cutsPtDeltaMassCharmReso->get(0u, 13u), // min ΔM
cutsPtDeltaMassCharmReso->get(1u, 13u), // max ΔM
cutsPtDeltaMassCharmReso->get(2u, 13u), // min pT SigmaC
cutsSigmaCPr->get(0u, 0u), // min pT proton
cutsSigmaCPr->get(1u, 0u), // max pT proton
cutsSigmaCPr->get(2u, 2u), // TOF pT threshold
forceTofProtonForSigmaCPr //set True for force TOF on proton candidate after threshold
cutsSigmaCPr->get(0u, 0u), // min pT proton
cutsSigmaCPr->get(1u, 0u), // max pT proton
cutsSigmaCPr->get(2u, 2u), // TOF pT threshold
forceTofProtonForSigmaCPr // set True for force TOF on proton candidate after threshold
);
dfStrangeness.setMatCorrType(matCorr);
dfStrangeness3.setMatCorrType(matCorr);
Expand Down Expand Up @@ -392,7 +391,7 @@ struct HfFilter { // Main struct for HF triggers
// ThetaC
hMassVsPtC[kNCharmParticles + 21] = registry.add<TH2>("fMassVsPtCharmBaryonToDstarP", "#it{M} vs. #it{p}_{T} distribution of triggered D^{*0}#p candidates;#it{p}_{T} (GeV/#it{c});#it{M} (GeV/#it{c}^{2});counts", HistType::kTH2D, {ptAxis, massAxisC[kNCharmParticles + 21]});
hMassVsPtC[kNCharmParticles + 22] = registry.add<TH2>("fMassVsPtCharmBaryonToDstarPWrongSign", "#it{M} vs. #it{p}_{T} distribution of triggered D^{*0}#p wrong sign candidates;#it{p}_{T} (GeV/#it{c});#it{M} (GeV/#it{c}^{2});counts", HistType::kTH2D, {ptAxis, massAxisC[kNCharmParticles + 22]});
//SigmaC-p
// SigmaC-p
hMassVsPtC[kNCharmParticles + 23] = registry.add<TH2>("fMassVsPtSigmaCPr", "#it{M} vs. #it{p}_{T} distribution of #Sigma_{c} for SigmaCPr trigger;#it{p}_{T} (GeV/#it{c});#it{M} (GeV/#it{c}^{2});counts", HistType::kTH2D, {ptAxis, massAxisC[kNCharmParticles + 23]});

for (int iBeautyPart{0}; iBeautyPart < kNBeautyParticles; ++iBeautyPart) {
Expand Down Expand Up @@ -482,7 +481,7 @@ struct HfFilter { // Main struct for HF triggers
bool isSelectedITSROFBorder = evSel.applyITSROFBorderCut ? collision.selection_bit(o2::aod::evsel::kNoITSROFrameBorder) : true;
bool isSelectedPvZ = (std::fabs(collision.posZ()) < evSel.maxPvZ);
if (!isSelectedTVX || !isSelectedTFBorder || !isSelectedITSROFBorder || !isSelectedPvZ) {
tags(keepEvent[kHighPt2P], keepEvent[kHighPt3P], keepEvent[kBeauty3P], keepEvent[kBeauty4P], keepEvent[kFemto2P], keepEvent[kFemto3P], keepEvent[kDoubleCharm2P], keepEvent[kDoubleCharm3P], keepEvent[kDoubleCharmMix], keepEvent[kV0Charm2P], keepEvent[kV0Charm3P], keepEvent[kCharmBarToXiBach], keepEvent[kSigmaCPPK], keepEvent[kSigmaC0K0], keepEvent[kPhotonCharm2P], keepEvent[kPhotonCharm3P], keepEvent[kSingleCharm2P], keepEvent[kSingleCharm3P], keepEvent[kSingleNonPromptCharm2P], keepEvent[kSingleNonPromptCharm3P], keepEvent[kCharmBarToXi2Bach], keepEvent[kPrCharm2P], keepEvent[kBtoJPsiKa], keepEvent[kBtoJPsiKstar], keepEvent[kBtoJPsiPhi], keepEvent[kBtoJPsiPrKa], keepEvent[kBtoJPsiPi], keepEvent[kSigmaCPr]);
tags(keepEvent[kHighPt2P], keepEvent[kHighPt3P], keepEvent[kBeauty3P], keepEvent[kBeauty4P], keepEvent[kFemto2P], keepEvent[kFemto3P], keepEvent[kDoubleCharm2P], keepEvent[kDoubleCharm3P], keepEvent[kDoubleCharmMix], keepEvent[kV0Charm2P], keepEvent[kV0Charm3P], keepEvent[kCharmBarToXiBach], keepEvent[kSigmaCPPK], keepEvent[kSigmaC0K0], keepEvent[kPhotonCharm2P], keepEvent[kPhotonCharm3P], keepEvent[kSingleCharm2P], keepEvent[kSingleCharm3P], keepEvent[kSingleNonPromptCharm2P], keepEvent[kSingleNonPromptCharm3P], keepEvent[kCharmBarToXi2Bach], keepEvent[kPrCharm2P], keepEvent[kBtoJPsiKa], keepEvent[kBtoJPsiKstar], keepEvent[kBtoJPsiPhi], keepEvent[kBtoJPsiPrKa], keepEvent[kBtoJPsiPi], keepEvent[kSigmaCPr]);
continue;
}

Expand Down Expand Up @@ -1594,65 +1593,65 @@ struct HfFilter { // Main struct for HF triggers
// check the mass of the SigmaC++ candidate
auto pVecSigmaC = RecoDecay::pVec(pVecFirst, pVecSecond, pVecThird, pVecSoftPi);
auto ptSigmaC = RecoDecay::pt(pVecSigmaC);
int8_t whichSigmaC = helper.isSelectedSigmaCInDeltaMassRange<2>(pVecFirst, pVecThird, pVecSecond, pVecSoftPi, ptSigmaC, is3Prong[2], hMassVsPtC[kNCharmParticles + 9], activateQA); //put charge = -1, it ensure the function is not looking charge and calculate the bit for ground state of SigmaC in the specified mass range
int8_t whichSigmaC = helper.isSelectedSigmaCInDeltaMassRange<2>(pVecFirst, pVecThird, pVecSecond, pVecSoftPi, ptSigmaC, is3Prong[2], hMassVsPtC[kNCharmParticles + 9], activateQA); // put charge = -1, it ensure the function is not looking charge and calculate the bit for ground state of SigmaC in the specified mass range
if (whichSigmaC > 0) {
/// let's build a candidate SigmaC++K- pair
/// and keep it only if:
/// - it has the correct charge (±1)
/// - it is in the correct mass range
// check the charge for SigmaC++K- candidates
if(!keepEvent[kSigmaCPPK] && (std::abs(chargeSc + track.sign()) == 1 && std::abs(chargeSc) == 2 )){
// check the invariant mass
float massSigmaCPKPi{-999.}, massSigmaCPiKP{-999.}, deltaMassXicResoPKPi{-999.}, deltaMassXicResoPiKP{-999.};
float ptSigmaCKaon = RecoDecay::pt(pVecSigmaC, pVecFourth);

if (ptSigmaCKaon > cutsPtDeltaMassCharmReso->get(2u, 10u)) {
if (TESTBIT(whichSigmaC, 0)) {
massSigmaCPKPi = RecoDecay::m(std::array{pVecFirst, pVecSecond, pVecThird, pVecSoftPi}, std::array{massProton, massKa, massPi, massPi});
deltaMassXicResoPKPi = RecoDecay::m(std::array{pVecFirst, pVecSecond, pVecThird, pVecSoftPi, pVecFourth}, std::array{massProton, massKa, massPi, massPi, massKa}) - massSigmaCPKPi;
}
if (TESTBIT(whichSigmaC, 1)) {
massSigmaCPiKP = RecoDecay::m(std::array{pVecFirst, pVecSecond, pVecThird, pVecSoftPi}, std::array{massPi, massKa, massProton, massPi});
deltaMassXicResoPiKP = RecoDecay::m(std::array{pVecFirst, pVecSecond, pVecThird, pVecSoftPi, pVecFourth}, std::array{massPi, massKa, massProton, massPi, massKa}) - massSigmaCPiKP;
}
bool isPKPiOk = (cutsPtDeltaMassCharmReso->get(0u, 10u) < deltaMassXicResoPKPi && deltaMassXicResoPKPi < cutsPtDeltaMassCharmReso->get(1u, 10u));
bool isPiKPOk = (cutsPtDeltaMassCharmReso->get(0u, 10u) < deltaMassXicResoPiKP && deltaMassXicResoPiKP < cutsPtDeltaMassCharmReso->get(1u, 10u));
if ((isPKPiOk || isPiKPOk) && isTrackKaon) {
/// This is a good SigmaC++K- event
keepEvent[kSigmaCPPK] = true;
if (!keepEvent[kSigmaCPPK] && (std::abs(chargeSc + track.sign()) == 1 && std::abs(chargeSc) == 2)) {
// check the invariant mass
float massSigmaCPKPi{-999.}, massSigmaCPiKP{-999.}, deltaMassXicResoPKPi{-999.}, deltaMassXicResoPiKP{-999.};
float ptSigmaCKaon = RecoDecay::pt(pVecSigmaC, pVecFourth);

/// QA plot
if (activateQA) {
if (isPKPiOk) {
if (TESTBIT(whichSigmaC, 2)) {
hMassVsPtC[kNCharmParticles + 11]->Fill(ptSigmaCKaon, deltaMassXicResoPKPi);
}
if (TESTBIT(whichSigmaC, 3)) {
hMassVsPtC[kNCharmParticles + 12]->Fill(ptSigmaCKaon, deltaMassXicResoPKPi);
}
}
if (isPiKPOk) {
if (TESTBIT(whichSigmaC, 2)) {
hMassVsPtC[kNCharmParticles + 11]->Fill(ptSigmaCKaon, deltaMassXicResoPiKP);
if (ptSigmaCKaon > cutsPtDeltaMassCharmReso->get(2u, 10u)) {
if (TESTBIT(whichSigmaC, 0)) {
massSigmaCPKPi = RecoDecay::m(std::array{pVecFirst, pVecSecond, pVecThird, pVecSoftPi}, std::array{massProton, massKa, massPi, massPi});
deltaMassXicResoPKPi = RecoDecay::m(std::array{pVecFirst, pVecSecond, pVecThird, pVecSoftPi, pVecFourth}, std::array{massProton, massKa, massPi, massPi, massKa}) - massSigmaCPKPi;
}
if (TESTBIT(whichSigmaC, 1)) {
massSigmaCPiKP = RecoDecay::m(std::array{pVecFirst, pVecSecond, pVecThird, pVecSoftPi}, std::array{massPi, massKa, massProton, massPi});
deltaMassXicResoPiKP = RecoDecay::m(std::array{pVecFirst, pVecSecond, pVecThird, pVecSoftPi, pVecFourth}, std::array{massPi, massKa, massProton, massPi, massKa}) - massSigmaCPiKP;
}
bool isPKPiOk = (cutsPtDeltaMassCharmReso->get(0u, 10u) < deltaMassXicResoPKPi && deltaMassXicResoPKPi < cutsPtDeltaMassCharmReso->get(1u, 10u));
bool isPiKPOk = (cutsPtDeltaMassCharmReso->get(0u, 10u) < deltaMassXicResoPiKP && deltaMassXicResoPiKP < cutsPtDeltaMassCharmReso->get(1u, 10u));
if ((isPKPiOk || isPiKPOk) && isTrackKaon) {
/// This is a good SigmaC++K- event
keepEvent[kSigmaCPPK] = true;

/// QA plot
if (activateQA) {
if (isPKPiOk) {
if (TESTBIT(whichSigmaC, 2)) {
hMassVsPtC[kNCharmParticles + 11]->Fill(ptSigmaCKaon, deltaMassXicResoPKPi);
}
if (TESTBIT(whichSigmaC, 3)) {
hMassVsPtC[kNCharmParticles + 12]->Fill(ptSigmaCKaon, deltaMassXicResoPKPi);
}
}
if (TESTBIT(whichSigmaC, 3)) {
hMassVsPtC[kNCharmParticles + 12]->Fill(ptSigmaCKaon, deltaMassXicResoPiKP);
if (isPiKPOk) {
if (TESTBIT(whichSigmaC, 2)) {
hMassVsPtC[kNCharmParticles + 11]->Fill(ptSigmaCKaon, deltaMassXicResoPiKP);
}
if (TESTBIT(whichSigmaC, 3)) {
hMassVsPtC[kNCharmParticles + 12]->Fill(ptSigmaCKaon, deltaMassXicResoPiKP);
}
}
}
}
}
}
}
}
//now from here we are looking for SigmaC-proton trigger
//DeltaEta is the difference in Eta between SigmaC candiate and proton
// now from here we are looking for SigmaC-proton trigger
// DeltaEta is the difference in Eta between SigmaC candiate and proton
float deltaEta = std::abs(RecoDecay::eta(pVecSigmaC) - track.eta());
if (!keepEvent[kSigmaCPr] && (isTrackProton && deltaEta < 1.0)) {
auto tagBDT = helper.isBDTSelected(scores[2], thresholdBDTScoreScForSigmaCPr.value);
int8_t whichSigmaC = helper.isSelectedSigmaCInDeltaMassRange<-1>(pVecFirst, pVecThird, pVecSecond, pVecSoftPi, ptSigmaC, is3Prong[2], hMassVsPtC[kNCharmParticles + 23], activateQA); //put charge {-1} for not looking charge specific SigmaC ground state, it will return bit 4 corresponding to it
if (TESTBIT(whichSigmaC, 4) && TESTBIT(tagBDT, RecoDecay::OriginType::Prompt)) {
auto tagBDT = helper.isBDTSelected(scores[2], thresholdBDTScoreScForSigmaCPr.value);
int8_t whichSigmaC = helper.isSelectedSigmaCInDeltaMassRange<-1>(pVecFirst, pVecThird, pVecSecond, pVecSoftPi, ptSigmaC, is3Prong[2], hMassVsPtC[kNCharmParticles + 23], activateQA); // put charge {-1} for not looking charge specific SigmaC ground state, it will return bit 4 corresponding to it
if (TESTBIT(whichSigmaC, 4) && TESTBIT(tagBDT, RecoDecay::OriginType::Prompt)) {
keepEvent[kSigmaCPr] = true;
}
}
}
} // end SigmaC++ candidate
} // end loop over tracks (soft pi)
Expand Down
Loading
Loading