Skip to content

Commit f5f0584

Browse files
committed
Add the Bs selector
1 parent d8a4253 commit f5f0584

2 files changed

Lines changed: 170 additions & 0 deletions

File tree

PWGHF/TableProducer/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,11 @@ o2physics_add_dpl_workflow(bplus-tod0pi-candidate-selector
144144
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::DetectorsVertexing
145145
COMPONENT_NAME Analysis)
146146

147+
o2physics_add_dpl_workflow(bs-todspi-candidate-selector
148+
SOURCES HFBsToDsPiCandidateSelector.cxx
149+
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::DetectorsVertexing
150+
COMPONENT_NAME Analysis)
151+
147152
o2physics_add_dpl_workflow(lb-tolcpi-candidate-selector
148153
SOURCES HFLbToLcPiCandidateSelector.cxx
149154
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::DetectorsVertexing
Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
// Copyright CERN and copyright holders of ALICE O2. This software is
2+
// distributed under the terms of the GNU General Public License v3 (GPL
3+
// Version 3), copied verbatim in the file "COPYING".
4+
//
5+
// See http://alice-o2.web.cern.ch/license for full licensing information.
6+
//
7+
// In applying this license CERN does not waive the privileges and immunities
8+
// granted to it by virtue of its status as an Intergovernmental Organization
9+
// or submit itself to any jurisdiction.
10+
11+
/// \file HFLbToLcPiCandidateSelector.cxx
12+
/// \brief Bs → Ds+ π- candidate selector
13+
///
14+
/// \author Panos Christakoglou <panos.christakoglou@cern.ch>, Nikhef
15+
16+
#include "Framework/runDataProcessing.h"
17+
#include "Framework/AnalysisTask.h"
18+
#include "PWGHF/Core/HFSelectorCuts.h"
19+
#include "PWGHF/DataModel/HFSecondaryVertex.h"
20+
#include "PWGHF/DataModel/HFCandidateSelectionTables.h"
21+
#include "PWGHF/Core/HFSelectorCuts.h"
22+
23+
using namespace o2;
24+
using namespace o2::aod;
25+
using namespace o2::framework;
26+
using namespace o2::aod::hf_cand_bs;
27+
using namespace o2::analysis;
28+
using namespace o2::aod::hf_cand_prong2;
29+
using namespace o2::analysis::hf_cuts_bs_todspi;
30+
31+
struct HfBsToDsPiCandidateSelector {
32+
Produces<aod::HFSelBsToDsPiCandidate> hfSelBsToDsPiCandidate;
33+
34+
Configurable<double> pTCandMin{"pTCandMin", 0., "Lower bound of candidate pT"};
35+
Configurable<double> pTCandMax{"pTCandMax", 50., "Upper bound of candidate pT"};
36+
37+
//Track quality
38+
Configurable<double> TPCNClsFindablePIDCut{"TPCNClsFindablePIDCut", 70., "Lower bound of TPC findable clusters for good PID"};
39+
40+
//TPC PID
41+
Configurable<double> pidTPCMinpT{"pidTPCMinpT", 0.15, "Lower bound of track pT for TPC PID"};
42+
Configurable<double> pidTPCMaxpT{"pidTPCMaxpT", 10., "Upper bound of track pT for TPC PID"};
43+
Configurable<double> nSigmaTPC{"nSigmaTPC", 5., "Nsigma cut on TPC only"};
44+
Configurable<double> nSigmaTPCCombined{"nSigmaTPCCombined", 5., "Nsigma cut on TPC combined with TOF"};
45+
46+
//TOF PID
47+
Configurable<double> pidTOFMinpT{"pidTOFMinpT", 0.15, "Lower bound of track pT for TOF PID"};
48+
Configurable<double> pidTOFMaxpT{"pidTOFMaxpT", 10., "Upper bound of track pT for TOF PID"};
49+
Configurable<double> nSigmaTOF{"nSigmaTOF", 5., "Nsigma cut on TOF only"};
50+
Configurable<double> nSigmaTOFCombined{"nSigmaTOFCombined", 5., "Nsigma cut on TOF combined with TPC"};
51+
52+
Configurable<std::vector<double>> pTBins{"pTBins", std::vector<double>{hf_cuts_bs_todspi::pTBins_v}, "pT bin limits"};
53+
Configurable<LabeledArray<double>> cuts{"Bs_to_dspi_cuts", {hf_cuts_bs_todspi::cuts[0], npTBins, nCutVars, pTBinLabels, cutVarLabels}, "Bs0 candidate selection per pT bin"};
54+
Configurable<int> selectionFlagDs{"selectionFlagDs", 1, "Selection Flag for Ds+"};
55+
56+
// Apply topological cuts as defined in HFSelectorCuts.h; return true if candidate passes all cuts
57+
template <typename T1, typename T2, typename T3>
58+
bool selectionTopol(const T1& hfCandBs, const T2& hfCandDs, const T3& trackPi)
59+
{
60+
auto candpT = hfCandBs.pt();
61+
int pTBin = findBin(pTBins, candpT);
62+
if (pTBin == -1) {
63+
// Printf("Bs topol selection failed at getpTBin");
64+
return false;
65+
}
66+
67+
// check that the candidate pT is within the analysis range
68+
if (candpT < pTCandMin || candpT >= pTCandMax) {
69+
return false;
70+
}
71+
72+
//Λb0 mass cut
73+
if (std::abs(InvMassBsToDsPi(hfCandBs) - RecoDecay::getMassPDG(pdg::Code::kLambdaB0)) > cuts->get(pTBin, "m")) {
74+
//Printf("Bs topol selection failed at mass diff check");
75+
return false;
76+
}
77+
78+
//pion pt
79+
if (trackPi.pt() < cuts->get(pTBin, "pT Pi")) {
80+
return false;
81+
}
82+
83+
//Ds+ pt
84+
if (hfCandDs.pt() < cuts->get(pTBin, "pT Ds+")) {
85+
return false;
86+
}
87+
88+
//Ds mass
89+
//if (trackPi.sign() < 0) {
90+
//if (std::abs(InvMassDspKpi(hfCandDs) - RecoDecay::getMassPDG(pdg::Code::kLambdaCPlus)) > cuts->get(pTBin, "DeltaMDs")) {
91+
//return false;
92+
//}
93+
//}
94+
95+
//Bs Decay length
96+
if (hfCandBs.decayLength() < cuts->get(pTBin, "Bs decLen")) {
97+
return false;
98+
}
99+
100+
//Bs Decay length XY
101+
if (hfCandBs.decayLengthXY() < cuts->get(pTBin, "Bs decLenXY")) {
102+
return false;
103+
}
104+
105+
//Bs chi2PCA cut
106+
if (hfCandBs.chi2PCA() > cuts->get(pTBin, "Chi2PCA")) {
107+
//Printf("Bs selection failed at chi2PCA");
108+
return false;
109+
}
110+
111+
//Bs CPA cut
112+
if (hfCandBs.cpa() < cuts->get(pTBin, "CPA")) {
113+
return false;
114+
}
115+
116+
//d0 of pi
117+
if (std::abs(hfCandBs.impactParameter1()) < cuts->get(pTBin, "d0 Pi")) {
118+
return false;
119+
}
120+
121+
//d0 of Ds+
122+
if (std::abs(hfCandBs.impactParameter0()) < cuts->get(pTBin, "d0 Ds+")) {
123+
return false;
124+
}
125+
126+
return true;
127+
}
128+
129+
void process(aod::HfCandBs const& hfCandBss, soa::Join<aod::HfCandProng3, aod::HFSelDsCandidate>, aod::BigTracksPID const&)
130+
{
131+
for (auto& hfCandBs : hfCandBss) { //looping over Bs candidates
132+
133+
int statusBs = 0;
134+
135+
// check if flagged as Λb --> Λc+ π-
136+
if (!(hfCandBs.hfflag() & 1 << hf_cand_bs::DecayType::BsToDsPi)) {
137+
hfSelBsToDsPiCandidate(statusBs);
138+
//Printf("Bs candidate selection failed at hfflag check");
139+
continue;
140+
}
141+
142+
// Ds is always index0 and pi is index1 by default
143+
//auto candDs = hfCandBs.index0();
144+
auto candDs = hfCandBs.index0_as<soa::Join<aod::HfCandProng3, aod::HFSelDsCandidate>>();
145+
auto trackPi = hfCandBs.index1_as<aod::BigTracksPID>();
146+
147+
//topological cuts
148+
if (!selectionTopol(hfCandBs, candDs, trackPi)) {
149+
hfSelBsToDsPiCandidate(statusBs);
150+
// Printf("Bs candidate selection failed at selection topology");
151+
continue;
152+
}
153+
154+
hfSelBsToDsPiCandidate(1);
155+
//Printf("Bs candidate selection successful, candidate should be selected");
156+
}
157+
}
158+
};
159+
160+
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
161+
{
162+
WorkflowSpec workflow{};
163+
workflow.push_back(adaptAnalysisTask<HfBsToDsPiCandidateSelector>(cfgc));
164+
return workflow;
165+
}

0 commit comments

Comments
 (0)