Skip to content

Commit 10f0702

Browse files
authored
Add J/ψ → μ+ μ− selection in selector (#6350)
* Fix micro to mu * Add ALICE 2/3 switch * Reshuffle ALICE 2/3 detectors * Add μ+ μ− selection column in selector * Define things when needed * Remove ee from selector names
1 parent fc730bf commit 10f0702

7 files changed

Lines changed: 74 additions & 53 deletions

File tree

Analysis/DataModel/include/AnalysisDataModel/HFCandidateSelectionTables.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,11 @@ DECLARE_SOA_TABLE(HFSelLcCandidate, "AOD", "HFSELLCCAND", //!
3939
namespace hf_selcandidate_jpsi
4040
{
4141
DECLARE_SOA_COLUMN(IsSelJpsiToEE, isSelJpsiToEE, int); //!
42+
DECLARE_SOA_COLUMN(IsSelJpsiToMuMu, isSelJpsiToMuMu, int); //!
4243
} // namespace hf_selcandidate_jpsi
43-
DECLARE_SOA_TABLE(HFSelJpsiToEECandidate, "AOD", "HFSELJPSICAND", //!
44-
hf_selcandidate_jpsi::IsSelJpsiToEE);
44+
DECLARE_SOA_TABLE(HFSelJpsiCandidate, "AOD", "HFSELJPSICAND", //!
45+
hf_selcandidate_jpsi::IsSelJpsiToEE,
46+
hf_selcandidate_jpsi::IsSelJpsiToMuMu);
4547

4648
namespace hf_selcandidate_lc_k0sp
4749
{

Analysis/DataModel/include/AnalysisDataModel/HFSecondaryVertex.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ auto InvMassJpsiToEE(const T& candidate)
297297
return candidate.m(array{RecoDecay::getMassPDG(kElectron), RecoDecay::getMassPDG(kElectron)});
298298
}
299299

300-
// J/ψ → µ+ µ
300+
// J/ψ → μ+ μ
301301

302302
template <typename T>
303303
auto InvMassJpsiToMuMu(const T& candidate)

Analysis/Tasks/PWGHF/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ o2_add_dpl_workflow(hf-lc-candidate-selector
6868
PUBLIC_LINK_LIBRARIES O2::Framework O2::AnalysisDataModel O2::AnalysisCore O2::DetectorsVertexing
6969
COMPONENT_NAME Analysis)
7070

71-
o2_add_dpl_workflow(hf-jpsi-toee-candidate-selector
72-
SOURCES HFJpsiToEECandidateSelector.cxx
71+
o2_add_dpl_workflow(hf-jpsi-candidate-selector
72+
SOURCES HFJpsiCandidateSelector.cxx
7373
PUBLIC_LINK_LIBRARIES O2::Framework O2::AnalysisDataModel O2::AnalysisCore O2::DetectorsVertexing O2::ALICE3Analysis
7474
COMPONENT_NAME Analysis)
7575

Analysis/Tasks/PWGHF/HFCandidateCreatorX.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ struct HFCandidateCreatorX {
6868
void process(aod::Collision const& collision,
6969
soa::Filtered<soa::Join<
7070
aod::HfCandProng2,
71-
aod::HFSelJpsiToEECandidate>> const& jpsiCands,
71+
aod::HFSelJpsiCandidate>> const& jpsiCands,
7272
aod::BigTracks const& tracks)
7373
{
7474
// 2-prong vertex fitter (to rebuild Jpsi vertex)

Analysis/Tasks/PWGHF/HFJpsiToEECandidateSelector.cxx renamed to Analysis/Tasks/PWGHF/HFJpsiCandidateSelector.cxx

Lines changed: 63 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// granted to it by virtue of its status as an Intergovernmental Organization
99
// or submit itself to any jurisdiction.
1010

11-
/// \file HFJpsiToEECandidateSelector.cxx
11+
/// \file HFJpsiCandidateSelector.cxx
1212
/// \brief J/ψ → e+ e− selection task
1313
///
1414
/// \author Biao Zhang <biao.zhang@cern.ch>, CCNU
@@ -88,16 +88,16 @@ struct Alice3PidIndexBuilder {
8888
};
8989

9090
/// Struct for applying J/ψ → e+ e− selection cuts
91-
struct HFJpsiToEECandidateSelector {
92-
Produces<aod::HFSelJpsiToEECandidate> hfSelJpsiToEECandidate;
91+
struct HFJpsiCandidateSelector {
92+
Produces<aod::HFSelJpsiCandidate> hfSelJpsiCandidate;
9393

94+
Configurable<bool> isALICE3{"isALICE3", false, "Switch between ALICE 2 and ALICE 3 detector setup"};
9495
Configurable<double> d_pTCandMin{"d_pTCandMin", 0., "Lower bound of candidate pT"};
9596
Configurable<double> d_pTCandMax{"d_pTCandMax", 50., "Upper bound of candidate pT"};
9697
// TPC
9798
Configurable<double> d_pidTPCMinpT{"d_pidTPCMinpT", 0.15, "Lower bound of track pT for TPC PID"};
9899
Configurable<double> d_pidTPCMaxpT{"d_pidTPCMaxpT", 10., "Upper bound of track pT for TPC PID"};
99100
Configurable<double> d_nSigmaTPC{"d_nSigmaTPC", 3., "Nsigma cut on TPC only"};
100-
//Configurable<double> d_TPCNClsFindablePIDCut{"d_TPCNClsFindablePIDCut", 70., "Lower bound of TPC findable clusters for good PID"};
101101
// TOF
102102
Configurable<double> d_pidTOFMinpT{"d_pidTOFMinpT", 0.15, "Lower bound of track pT for TOF PID"};
103103
Configurable<double> d_pidTOFMaxpT{"d_pidTOFMaxpT", 5., "Upper bound of track pT for TOF PID"};
@@ -107,18 +107,17 @@ struct HFJpsiToEECandidateSelector {
107107
Configurable<double> d_pidRICHMinpT{"d_pidRICHMinpT", 0.15, "Lower bound of track pT for RICH PID"};
108108
Configurable<double> d_pidRICHMaxpT{"d_pidRICHMaxpT", 10., "Upper bound of track pT for RICH PID"};
109109
Configurable<double> d_nSigmaRICH{"d_nSigmaRICH", 3., "Nsigma cut on RICH only"};
110-
111110
// topological cuts
112111
Configurable<std::vector<double>> pTBins{"pTBins", std::vector<double>{hf_cuts_jpsi_toee::pTBins_v}, "pT bin limits"};
113112
Configurable<LabeledArray<double>> cuts{"Jpsi_to_ee_cuts", {hf_cuts_jpsi_toee::cuts[0], npTBins, nCutVars, pTBinLabels, cutVarLabels}, "Jpsi candidate selection per pT bin"};
114113

115114
/// Conjugate-independent topological cuts
116115
/// \param candidate is candidate
117-
/// \param trackPositron is the track with the positron hypothesis
118-
/// \param trackElectron is the track with the electron hypothesis
116+
/// \param trackPos is the positive track
117+
/// \param trackNeg is the negative track
119118
/// \return true if candidate passes all cuts
120119
template <typename T1, typename T2>
121-
bool selectionTopol(const T1& candidate, const T2& trackPositron, const T2& trackElectron)
120+
bool selectionTopol(const T1& candidate, const T2& trackPos, const T2& trackNeg, int& selEE, int& selMuMu)
122121
{
123122
auto candpT = candidate.pt();
124123
auto pTBin = findBin(pTBins, candpT);
@@ -131,23 +130,32 @@ struct HFJpsiToEECandidateSelector {
131130
return false;
132131
}
133132

134-
// cut on invariant mass
133+
// cut on e+ e− invariant mass
135134
if (std::abs(InvMassJpsiToEE(candidate) - RecoDecay::getMassPDG(pdg::Code::kJpsi)) > cuts->get(pTBin, "m")) {
135+
selEE = 0;
136+
}
137+
138+
// cut on μ+ μ− invariant mass
139+
if (std::abs(InvMassJpsiToMuMu(candidate) - RecoDecay::getMassPDG(pdg::Code::kJpsi)) > cuts->get(pTBin, "m")) {
140+
selMuMu = 0;
141+
}
142+
143+
if (selEE == 0 && selMuMu == 0) {
136144
return false;
137145
}
138146

139-
// cut on daughter pT
140-
if (trackElectron.pt() < cuts->get(pTBin, "pT El") || trackPositron.pt() < cuts->get(pTBin, "pT El")) {
147+
// cut on daughter pT (same cut used for both channels)
148+
if (trackNeg.pt() < cuts->get(pTBin, "pT El") || trackPos.pt() < cuts->get(pTBin, "pT El")) {
141149
return false;
142150
}
143151

144152
// cut on daughter DCA - need to add secondary vertex constraint here
145-
if (std::abs(trackElectron.dcaPrim0()) > cuts->get(pTBin, "DCA_xy") || std::abs(trackPositron.dcaPrim0()) > cuts->get(pTBin, "DCA_xy")) {
153+
if (std::abs(trackNeg.dcaPrim0()) > cuts->get(pTBin, "DCA_xy") || std::abs(trackPos.dcaPrim0()) > cuts->get(pTBin, "DCA_xy")) {
146154
return false;
147155
}
148156

149157
// cut on daughter DCA - need to add secondary vertex constraint here
150-
if (std::abs(trackElectron.dcaPrim1()) > cuts->get(pTBin, "DCA_z") || std::abs(trackPositron.dcaPrim1()) > cuts->get(pTBin, "DCA_z")) {
158+
if (std::abs(trackNeg.dcaPrim1()) > cuts->get(pTBin, "DCA_z") || std::abs(trackPos.dcaPrim1()) > cuts->get(pTBin, "DCA_z")) {
151159
return false;
152160
}
153161

@@ -176,54 +184,65 @@ struct HFJpsiToEECandidateSelector {
176184
// looping over 2-prong candidates
177185
for (auto& candidate : candidates) {
178186

187+
if (!(candidate.hfflag() & 1 << DecayType::JpsiToEE) && !(candidate.hfflag() & 1 << DecayType::JpsiToMuMu)) {
188+
hfSelJpsiCandidate(0, 0);
189+
continue;
190+
}
191+
179192
auto trackPos = candidate.index0_as<TracksPID>(); // positive daughter
180193
auto trackNeg = candidate.index1_as<TracksPID>(); // negative daughter
181194

182-
if (!(candidate.hfflag() & 1 << DecayType::JpsiToEE)) {
183-
hfSelJpsiToEECandidate(0);
184-
continue;
185-
}
195+
int selectedEE = 1;
196+
int selectedMuMu = 1;
186197

187198
// track selection level need to add special cuts (additional cuts on decay length and d0 norm)
188199

189-
if (!selectionTopol(candidate, trackPos, trackNeg)) {
190-
hfSelJpsiToEECandidate(0);
200+
if (!selectionTopol(candidate, trackPos, trackNeg, selectedEE, selectedMuMu)) {
201+
hfSelJpsiCandidate(0, 0);
191202
continue;
192203
}
193204

194-
// track-level PID TPC selection
195-
// FIXME: temporarily disabled for ALICE 3 development
196-
//if (selectorElectron.getStatusTrackPIDTPC(trackPos) == TrackSelectorPID::Status::PIDRejected ||
197-
// selectorElectron.getStatusTrackPIDTPC(trackNeg) == TrackSelectorPID::Status::PIDRejected) {
198-
// hfSelJpsiToEECandidate(0);
199-
// continue;
200-
//}
201-
202-
// track-level PID TOF selection
205+
// track-level electron PID TOF selection
203206
if (selectorElectron.getStatusTrackPIDTOF(trackPos) == TrackSelectorPID::Status::PIDRejected ||
204207
selectorElectron.getStatusTrackPIDTOF(trackNeg) == TrackSelectorPID::Status::PIDRejected) {
205-
hfSelJpsiToEECandidate(0);
206-
continue;
208+
selectedEE = 0;
207209
}
208210

209-
// track-level PID RICH selection
210-
if (selectorElectron.getStatusTrackPIDRICH(trackPos) == TrackSelectorPID::Status::PIDRejected ||
211-
selectorElectron.getStatusTrackPIDRICH(trackNeg) == TrackSelectorPID::Status::PIDRejected) {
212-
hfSelJpsiToEECandidate(0);
211+
if (selectedEE == 0 && selectedMuMu == 0) {
212+
hfSelJpsiCandidate(0, 0);
213213
continue;
214214
}
215215

216-
// track-level muon PID MID selection
217-
//LOGF(info, "Muon selection: Start");
218-
if (selectorMuon.getStatusTrackPIDMID(trackPos) == TrackSelectorPID::Status::PIDRejected ||
219-
selectorMuon.getStatusTrackPIDMID(trackNeg) == TrackSelectorPID::Status::PIDRejected) {
220-
//LOGF(info, "Muon selection: Rejected");
221-
hfSelJpsiToEECandidate(0);
222-
continue;
216+
if (isALICE3) { // ALICE 3 detectors
217+
// track-level electron PID RICH selection
218+
if (selectorElectron.getStatusTrackPIDRICH(trackPos) == TrackSelectorPID::Status::PIDRejected ||
219+
selectorElectron.getStatusTrackPIDRICH(trackNeg) == TrackSelectorPID::Status::PIDRejected) {
220+
selectedEE = 0;
221+
}
222+
223+
if (selectedEE == 0 && selectedMuMu == 0) {
224+
hfSelJpsiCandidate(0, 0);
225+
continue;
226+
}
227+
228+
// track-level muon PID MID selection
229+
//LOGF(info, "Muon selection: Start");
230+
if (selectorMuon.getStatusTrackPIDMID(trackPos) == TrackSelectorPID::Status::PIDRejected ||
231+
selectorMuon.getStatusTrackPIDMID(trackNeg) == TrackSelectorPID::Status::PIDRejected) {
232+
//LOGF(info, "Muon selection: Rejected");
233+
selectedMuMu = 0;
234+
}
235+
//LOGF(info, "Muon selection: Selected");
236+
237+
} else { // ALICE 2 detectors
238+
// track-level electron PID TPC selection
239+
if (selectorElectron.getStatusTrackPIDTPC(trackPos) == TrackSelectorPID::Status::PIDRejected ||
240+
selectorElectron.getStatusTrackPIDTPC(trackNeg) == TrackSelectorPID::Status::PIDRejected) {
241+
selectedEE = 0;
242+
}
223243
}
224-
//LOGF(info, "Muon selection: Selected");
225244

226-
hfSelJpsiToEECandidate(1);
245+
hfSelJpsiCandidate(selectedEE, selectedMuMu);
227246
}
228247
}
229248
};
@@ -234,5 +253,5 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
234253
//adaptAnalysisTask<RICHindexbuilder>(cfgc),
235254
//adaptAnalysisTask<MidIndexBuilder>(cfgc),
236255
adaptAnalysisTask<Alice3PidIndexBuilder>(cfgc),
237-
adaptAnalysisTask<HFJpsiToEECandidateSelector>(cfgc, TaskName{"hf-jpsi-toee-candidate-selector"})};
256+
adaptAnalysisTask<HFJpsiCandidateSelector>(cfgc, TaskName{"hf-jpsi-candidate-selector"})};
238257
}

Analysis/Tasks/PWGHF/HFXToJpsiPiPiCandidateSelector.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
/// \file HFXToJpsiPiPiCandidateSelector.cxx
1212
/// \brief X(3872) selection task.
13-
/// \note Adapted from HFJpsiToEECandidateSelector.cxx
13+
/// \note Adapted from HFJpsiCandidateSelector.cxx
1414
/// \author Rik Spijkers <r.spijkers@students.uu.nl>, Utrecht University
1515

1616
#include "Framework/runDataProcessing.h"

Analysis/Tasks/PWGHF/taskJpsi.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ struct TaskJpsi {
6363

6464
Filter filterSelectCandidates = (aod::hf_selcandidate_jpsi::isSelJpsiToEE >= d_selectionFlagJpsi);
6565

66-
void process(soa::Filtered<soa::Join<aod::HfCandProng2, aod::HFSelJpsiToEECandidate>> const& candidates)
66+
void process(soa::Filtered<soa::Join<aod::HfCandProng2, aod::HFSelJpsiCandidate>> const& candidates)
6767
{
6868
for (auto& candidate : candidates) {
6969
if (!(candidate.hfflag() & 1 << DecayType::JpsiToEE)) {
@@ -134,7 +134,7 @@ struct TaskJpsiMC {
134134

135135
Filter filterSelectCandidates = (aod::hf_selcandidate_jpsi::isSelJpsiToEE >= d_selectionFlagJpsi);
136136

137-
void process(soa::Filtered<soa::Join<aod::HfCandProng2, aod::HFSelJpsiToEECandidate, aod::HfCandProng2MCRec>> const& candidates,
137+
void process(soa::Filtered<soa::Join<aod::HfCandProng2, aod::HFSelJpsiCandidate, aod::HfCandProng2MCRec>> const& candidates,
138138
soa::Join<aod::McParticles, aod::HfCandProng2MCGen> const& particlesMC, aod::BigTracksMC const& tracks)
139139
{
140140
// MC rec.

0 commit comments

Comments
 (0)