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}
0 commit comments