@@ -72,9 +72,9 @@ struct HfFilter { // Main struct for HF triggers
7272
7373 // parameters for all triggers
7474 // nsigma PID (except for V0 and cascades)
75- Configurable<LabeledArray<float >> nSigmaPidCuts{" nSigmaPidCuts" , {cutsNsigma[0 ], 3 , 6 , labelsRowsNsigma, labelsColumnsNsigma}, " Nsigma cuts for TPC/TOF PID (except for V0 and cascades)" };
75+ Configurable<LabeledArray<float >> nSigmaPidCuts{" nSigmaPidCuts" , {cutsNsigma[0 ], 3 , 7 , labelsRowsNsigma, labelsColumnsNsigma}, " Nsigma cuts for TPC/TOF PID (except for V0 and cascades)" };
7676 // min and max pts for tracks and bachelors (except for V0 and cascades)
77- Configurable<LabeledArray<float >> ptCuts{" ptCuts" , {cutsPt[0 ], 2 , 6 , labelsRowsCutsPt, labelsColumnsCutsPt}, " minimum and maximum pT for bachelor tracks (except for V0 and cascades)" };
77+ Configurable<LabeledArray<float >> ptCuts{" ptCuts" , {cutsPt[0 ], 2 , 7 , labelsRowsCutsPt, labelsColumnsCutsPt}, " minimum and maximum pT for bachelor tracks (except for V0 and cascades)" };
7878
7979 // parameters for high-pT triggers
8080 Configurable<LabeledArray<float >> ptThresholds{" ptThresholds" , {cutsHighPtThresholds[0 ], 1 , 2 , labelsEmpty, labelsColumnsHighPtThresholds}, " pT treshold for high pT charm hadron candidates for kHighPt triggers in GeV/c" };
@@ -91,10 +91,11 @@ struct HfFilter { // Main struct for HF triggers
9191
9292 // parameters for femto triggers
9393 Configurable<float > femtoMaxRelativeMomentum{" femtoMaxRelativeMomentum" , 2 ., " Maximal allowed value for relative momentum between charm-proton pairs in GeV/c" };
94- Configurable<LabeledArray<int >> enableFemtoChannels{" enableFemtoChannels" , {activeFemtoChannels[0 ], 1 , 5 , labelsEmpty , labelsColumnsFemtoChannels}, " Flags to enable/disable femto channels" };
94+ Configurable<LabeledArray<int >> enableFemtoChannels{" enableFemtoChannels" , {activeFemtoChannels[0 ], 2 , 5 , labelsRowsFemtoChannels , labelsColumnsFemtoChannels}, " Flags to enable/disable femto channels" };
9595 Configurable<bool > requireCharmMassForFemto{" requireCharmMassForFemto" , false , " Flags to enable/disable cut on charm-hadron invariant-mass window for femto" };
96- Configurable<float > ptThresholdForFemtoPid{" ptThresholdForFemtoPid" , 8 ., " pT threshold for changing strategy of proton PID in femto triggers" };
97- Configurable<bool > forceTofPidForFemto{" forceTofPidForFemto" , true , " force TOF PID for proton in femto triggers" };
96+ Configurable<LabeledArray<float >> ptThresholdsForFemto{" ptThresholdsForFemto" , {cutsPtThresholdsForFemto[0 ], 1 , 2 , labelsEmpty, labelsColumnsPtThresholdsForFemto}, " pT treshold for proton or deuteron for kFemto triggers in GeV/c" };
97+ Configurable<bool > forceTofProtonForFemto{" forceTofProtonForFemto" , true , " flag to force TOF PID for protons" };
98+ Configurable<bool > forceTofDeuteronForFemto{" forceTofDeuteronForFemto" , false , " flag to force TOF PID for deuterons" };
9899
99100 // double charm
100101 Configurable<LabeledArray<int >> enableDoubleCharmChannels{" enableDoubleCharmChannels" , {activeDoubleCharmChannels[0 ], 1 , 3 , labelsEmpty, labelsColumnsDoubleCharmChannels}, " Flags to enable/disable double charm channels" };
@@ -157,9 +158,11 @@ struct HfFilter { // Main struct for HF triggers
157158 std::shared_ptr<TH1> hN2ProngCharmCand, hN3ProngCharmCand;
158159 std::array<std::shared_ptr<TH1>, kNCharmParticles > hCharmHighPt{};
159160 std::array<std::shared_ptr<TH1>, kNCharmParticles > hCharmProtonKstarDistr{};
161+ std::array<std::shared_ptr<TH1>, kNCharmParticles > hCharmDeuteronKstarDistr{};
160162 std::array<std::shared_ptr<TH2>, kNBeautyParticles > hMassVsPtB{};
161163 std::array<std::shared_ptr<TH2>, kNCharmParticles + 17 > hMassVsPtC{}; // +9 for resonances (D*+, D*0, Ds*+, Ds1+, Ds2*+, Xic+* right sign, Xic+* wrong sign, Xic0* right sign, Xic0* wrong sign) +2 for SigmaC (SigmaC++, SigmaC0) +2 for SigmaCK pairs (SigmaC++K-, SigmaC0K0s) +2 for charm baryons (Xi+Pi, Xi+Ka)
162164 std::shared_ptr<TH2> hProtonTPCPID, hProtonTOFPID;
165+ std::shared_ptr<TH2> hDeuteronTPCPID, hDeuteronTOFPID;
163166 std::array<std::shared_ptr<TH1>, kNCharmParticles > hBDTScoreBkg{};
164167 std::array<std::shared_ptr<TH1>, kNCharmParticles > hBDTScorePrompt{};
165168 std::array<std::shared_ptr<TH1>, kNCharmParticles > hBDTScoreNonPrompt{};
@@ -181,20 +184,23 @@ struct HfFilter { // Main struct for HF triggers
181184 void init (InitContext&)
182185 {
183186 helper.setHighPtTriggerThresholds (ptThresholds->get (0u , 0u ), ptThresholds->get (0u , 1u ));
187+ helper.setPtTriggerThresholdsForFemto (ptThresholdsForFemto->get (0u , 0u ), ptThresholdsForFemto->get (0u , 1u ));
184188 helper.setPtBinsSingleTracks (pTBinsTrack);
185189 helper.setPtBinsBeautyHadrons (pTBinsBHadron);
186190 helper.setPtLimitsBeautyBachelor (ptCuts->get (0u , 0u ), ptCuts->get (1u , 0u ));
187191 helper.setPtLimitsDstarSoftPion (ptCuts->get (0u , 1u ), ptCuts->get (1u , 1u ));
188192 helper.setPtLimitsProtonForFemto (ptCuts->get (0u , 2u ), ptCuts->get (1u , 2u ));
193+ helper.setPtLimitsDeuteronForFemto (ptCuts->get (0u , 6u ), ptCuts->get (1u , 6u ));
189194 helper.setPtLimitsCharmBaryonBachelor (ptCuts->get (0u , 3u ), ptCuts->get (1u , 3u ));
190195 helper.setCutsSingleTrackBeauty (cutsTrackBeauty3Prong, cutsTrackBeauty4Prong);
191196 helper.setCutsSingleTrackCharmBaryonBachelor (cutsTrackCharmBaryonBachelor);
192197 helper.setCutsBplus (cutsBplus);
193- helper.setPtThresholdPidStrategyForFemto (ptThresholdForFemtoPid);
194198 helper.setNsigmaProtonCutsForFemto (std::array{nSigmaPidCuts->get (0u , 3u ), nSigmaPidCuts->get (1u , 3u ), nSigmaPidCuts->get (2u , 3u )});
199+ helper.setNsigmaDeuteronCutsForFemto (std::array{nSigmaPidCuts->get (0u , 6u ), nSigmaPidCuts->get (1u , 6u ), nSigmaPidCuts->get (2u , 6u )});
195200 helper.setNsigmaProtonCutsForCharmBaryons (nSigmaPidCuts->get (0u , 0u ), nSigmaPidCuts->get (1u , 0u ));
196201 helper.setNsigmaPionKaonCutsForDzero (nSigmaPidCuts->get (0u , 1u ), nSigmaPidCuts->get (1u , 1u ));
197202 helper.setNsigmaKaonCutsFor3Prongs (nSigmaPidCuts->get (0u , 2u ), nSigmaPidCuts->get (1u , 2u ));
203+ helper.setForceTofForFemto (forceTofProtonForFemto, forceTofDeuteronForFemto);
198204 helper.setV0Selections (cutsGammaK0sLambda->get (0u , 0u ), cutsGammaK0sLambda->get (0u , 1u ), cutsGammaK0sLambda->get (0u , 2u ), cutsGammaK0sLambda->get (0u , 3u ), cutsGammaK0sLambda->get (0u , 4u ), cutsGammaK0sLambda->get (0u , 5u ));
199205 helper.setXiSelections (cutsXiCascades->get (0u , 0u ), cutsXiCascades->get (0u , 1u ), cutsXiCascades->get (0u , 2u ), cutsXiCascades->get (0u , 3u ), cutsXiCascades->get (0u , 4u ), cutsXiCascades->get (0u , 5u ), cutsXiCascades->get (0u , 6u ), cutsXiCascades->get (0u , 7u ));
200206 helper.setNsigmaPiCutsForCharmBaryonBachelor (nSigmaPidCuts->get (0u , 4u ), nSigmaPidCuts->get (1u , 4u ));
@@ -222,6 +228,7 @@ struct HfFilter { // Main struct for HF triggers
222228 for (int iCharmPart{0 }; iCharmPart < kNCharmParticles ; ++iCharmPart) {
223229 hCharmHighPt[iCharmPart] = registry.add <TH1>(Form (" f%sHighPt" , charmParticleNames[iCharmPart].data ()), Form (" #it{p}_{T} distribution of triggered high-#it{p}_{T} %s candidates;#it{p}_{T} (GeV/#it{c});counts" , charmParticleNames[iCharmPart].data ()), HistType::kTH1F , {ptAxis});
224230 hCharmProtonKstarDistr[iCharmPart] = registry.add <TH1>(Form (" f%sProtonKstarDistr" , charmParticleNames[iCharmPart].data ()), Form (" #it{k}* distribution of triggered p#minus%s pairs;#it{k}* (GeV/#it{c});counts" , charmParticleNames[iCharmPart].data ()), HistType::kTH1F , {kstarAxis});
231+ hCharmDeuteronKstarDistr[iCharmPart] = registry.add <TH1>(Form (" f%sDeuteronKstarDistr" , charmParticleNames[iCharmPart].data ()), Form (" #it{k}* distribution of triggered de%s pairs;#it{k}* (GeV/#it{c});counts" , charmParticleNames[iCharmPart].data ()), HistType::kTH1F , {kstarAxis});
225232 hMassVsPtC[iCharmPart] = registry.add <TH2>(Form (" fMassVsPt%s" , charmParticleNames[iCharmPart].data ()), Form (" #it{M} vs. #it{p}_{T} distribution of triggered %s candidates;#it{p}_{T} (GeV/#it{c});#it{M} (GeV/#it{c}^{2});counts" , charmParticleNames[iCharmPart].data ()), HistType::kTH2F , {ptAxis, massAxisC[iCharmPart]});
226233 if (activateQA > 1 ) {
227234 hBDTScoreBkg[iCharmPart] = registry.add <TH1>(Form (" f%sBDTScoreBkgDistr" , charmParticleNames[iCharmPart].data ()), Form (" BDT background score distribution for %s;BDT background score;counts" , charmParticleNames[iCharmPart].data ()), HistType::kTH1F , {bdtAxis});
@@ -276,6 +283,9 @@ struct HfFilter { // Main struct for HF triggers
276283 if (activateQA > 1 ) {
277284 hProtonTPCPID = registry.add <TH2>(" fProtonTPCPID" , " #it{N}_{#sigma}^{TPC} vs. #it{p} for selected protons;#it{p} (GeV/#it{c});#it{N}_{#sigma}^{TPC}" , HistType::kTH2F , {pAxis, nSigmaAxis});
278285 hProtonTOFPID = registry.add <TH2>(" fProtonTOFPID" , " #it{N}_{#sigma}^{TOF} vs. #it{p} for selected protons;#it{p} (GeV/#it{c});#it{N}_{#sigma}^{TOF}" , HistType::kTH2F , {pAxis, nSigmaAxis});
286+ hDeuteronTPCPID = registry.add <TH2>(" hDeuteronTPCPID" , " #it{N}_{#sigma}^{TPC} vs. #it{p} for selected deuterons;#it{p} (GeV/#it{c});#it{N}_{#sigma}^{TPC}" , HistType::kTH2F , {pAxis, nSigmaAxis});
287+ hDeuteronTOFPID = registry.add <TH2>(" hDeuteronTOFPID" , " #it{N}_{#sigma}^{TOF} vs. #it{p} for selected deuterons;#it{p} (GeV/#it{c});#it{N}_{#sigma}^{TOF}" , HistType::kTH2F , {pAxis, nSigmaAxis});
288+
279289 hV0Selected = registry.add <TH2>(" fV0Selected" , " Selections for V0s;;counts" , HistType::kTH2F , {{9 , -0.5 , 8.5 }, {kNV0 , -0.5 , +kNV0 - 0.5 }});
280290
281291 for (int iV0{kPhoton }; iV0 < kNV0 ; ++iV0) {
@@ -303,8 +313,8 @@ struct HfFilter { // Main struct for HF triggers
303313 thresholdBDTScores = {thresholdBDTScoreD0ToKPi, thresholdBDTScoreDPlusToPiKPi, thresholdBDTScoreDSToPiKK, thresholdBDTScoreLcToPiKP, thresholdBDTScoreXicToPiKP};
304314 }
305315
306- using BigTracksMCPID = soa::Join<aod::Tracks, aod::TracksExtra, aod::TracksDCA, aod::pidTPCFullPi, aod::pidTOFFullPi, aod::pidTPCFullKa, aod::pidTOFFullKa, aod::pidTPCFullPr, aod::pidTOFFullPr, aod::McTrackLabels>;
307- using BigTracksPID = soa::Join<aod::Tracks, aod::TracksWCovDcaExtra, aod::TracksDCA, aod::TrackSelection, aod::pidTPCFullPi, aod::pidTOFFullPi, aod::pidTPCFullKa, aod::pidTOFFullKa, aod::pidTPCFullPr, aod::pidTOFFullPr>;
316+ using BigTracksMCPID = soa::Join<aod::Tracks, aod::TracksExtra, aod::TracksDCA, aod::pidTPCFullPi, aod::pidTOFFullPi, aod::pidTPCFullKa, aod::pidTOFFullKa, aod::pidTPCFullPr, aod::pidTOFFullPr, aod::pidTPCFullDe, aod::pidTOFFullDe, aod:: McTrackLabels>;
317+ using BigTracksPID = soa::Join<aod::Tracks, aod::TracksWCovDcaExtra, aod::TracksDCA, aod::TrackSelection, aod::pidTPCFullPi, aod::pidTOFFullPi, aod::pidTPCFullKa, aod::pidTOFFullKa, aod::pidTPCFullPr, aod::pidTOFFullPr, aod::pidTPCFullDe, aod::pidTOFFullDe >;
308318 using CollsWithEvSel = soa::Join<aod::Collisions, aod::EvSels>;
309319
310320 using Hf2ProngsWithMl = soa::Join<aod::Hf2Prongs, aod::Hf2ProngMlProbs>;
@@ -355,7 +365,7 @@ struct HfFilter { // Main struct for HF triggers
355365 if (setTPCCalib == 1 ) {
356366 helper.setTpcRecalibMaps (ccdb, bc, ccdbPathTPC);
357367 } else if (setTPCCalib > 1 ) {
358- helper.setValuesBB (ccdbApi, bc, std::array{ccdbBBPion.value , ccdbBBAntiPion.value , ccdbBBKaon.value , ccdbBBAntiKaon.value , ccdbBBProton.value , ccdbBBAntiProton.value });
368+ helper.setValuesBB (ccdbApi, bc, std::array{ccdbBBPion.value , ccdbBBAntiPion.value , ccdbBBKaon.value , ccdbBBAntiKaon.value , ccdbBBProton.value , ccdbBBAntiProton.value , ccdbBBProton. value , ccdbBBAntiProton. value }); // dummy for deuteron
359369 }
360370
361371 currentRun = bc.runNumber ();
@@ -570,11 +580,11 @@ struct HfFilter { // Main struct for HF triggers
570580
571581 // 2-prong femto
572582 if (!keepEvent[kFemto2P ] && enableFemtoChannels->get (0u , 0u ) && isCharmTagged && track.collisionId () == thisCollId && (TESTBIT (selD0, 0 ) || TESTBIT (selD0, 1 ) || !requireCharmMassForFemto)) {
573- bool isProton = helper.isSelectedProton4Femto (track, trackParThird, activateQA, hProtonTPCPID, hProtonTOFPID, forceTofPidForFemto );
583+ bool isProton = helper.isSelectedTrack4Femto (track, trackParThird, activateQA, hProtonTPCPID, hProtonTOFPID, kProtonForFemto );
574584 if (isProton) {
575585 float relativeMomentum = helper.computeRelativeMomentum (pVecThird, pVec2Prong, massD0);
576586 if (applyOptimisation) {
577- optimisationTreeFemto (thisCollId, o2::constants::physics::Pdg::kD0 , pt2Prong, scores[0 ], scores[1 ], scores[2 ], relativeMomentum, track.tpcNSigmaPr (), track.tofNSigmaPr ());
587+ optimisationTreeFemto (thisCollId, o2::constants::physics::Pdg::kD0 , pt2Prong, scores[0 ], scores[1 ], scores[2 ], relativeMomentum, track.tpcNSigmaPr (), track.tofNSigmaPr (), track. tpcNSigmaDe (), track. tofNSigmaDe () );
578588 }
579589 if (relativeMomentum < femtoMaxRelativeMomentum) {
580590 keepEvent[kFemto2P ] = true ;
@@ -948,13 +958,15 @@ struct HfFilter { // Main struct for HF triggers
948958 } // end beauty selection
949959
950960 // 3-prong femto
951- bool isProton = helper.isSelectedProton4Femto (track, trackParFourth, activateQA, hProtonTPCPID, hProtonTOFPID, forceTofPidForFemto);
961+ bool isProton = helper.isSelectedTrack4Femto (track, trackParFourth, activateQA, hProtonTPCPID, hProtonTOFPID, kProtonForFemto );
962+ bool isDeuteron = helper.isSelectedTrack4Femto (track, trackParFourth, activateQA, hDeuteronTPCPID, hDeuteronTOFPID, kDeuteronForFemto );
963+
952964 if (isProton && track.collisionId () == thisCollId) {
953965 for (int iHypo{0 }; iHypo < kNCharmParticles - 1 && !keepEvent[kFemto3P ]; ++iHypo) {
954966 if (isCharmTagged[iHypo] && enableFemtoChannels->get (0u , iHypo + 1 ) && (TESTBIT (is3ProngInMass[iHypo], 0 ) || TESTBIT (is3ProngInMass[iHypo], 1 ) || !requireCharmMassForFemto)) {
955967 float relativeMomentum = helper.computeRelativeMomentum (pVecFourth, pVec3Prong, massCharmHypos[iHypo]);
956968 if (applyOptimisation) {
957- optimisationTreeFemto (thisCollId, charmParticleID[iHypo], pt3Prong, scores[iHypo][0 ], scores[iHypo][1 ], scores[iHypo][2 ], relativeMomentum, track.tpcNSigmaPr (), track.tofNSigmaPr ());
969+ optimisationTreeFemto (thisCollId, charmParticleID[iHypo], pt3Prong, scores[iHypo][0 ], scores[iHypo][1 ], scores[iHypo][2 ], relativeMomentum, track.tpcNSigmaPr (), track.tofNSigmaPr (), track. tpcNSigmaDe (), track. tofNSigmaDe () );
958970 }
959971 if (relativeMomentum < femtoMaxRelativeMomentum) {
960972 keepEvent[kFemto3P ] = true ;
@@ -964,6 +976,21 @@ struct HfFilter { // Main struct for HF triggers
964976 }
965977 }
966978 }
979+ } else if (isDeuteron && track.collisionId () == thisCollId) {
980+ for (int iHypo{0 }; iHypo < kNCharmParticles - 1 && !keepEvent[kFemto3P ]; ++iHypo) {
981+ if (isCharmTagged[iHypo] && enableFemtoChannels->get (1u , iHypo + 1 ) && (TESTBIT (is3ProngInMass[iHypo], 0 ) || TESTBIT (is3ProngInMass[iHypo], 1 ) || !requireCharmMassForFemto)) {
982+ float relativeMomentum = helper.computeRelativeMomentum (pVecFourth, pVec3Prong, massCharmHypos[iHypo]);
983+ if (applyOptimisation) {
984+ optimisationTreeFemto (thisCollId, charmParticleID[iHypo], pt3Prong, scores[iHypo][0 ], scores[iHypo][1 ], scores[iHypo][2 ], relativeMomentum, track.tpcNSigmaPr (), track.tofNSigmaPr (), track.tpcNSigmaDe (), track.tofNSigmaDe ());
985+ }
986+ if (relativeMomentum < femtoMaxRelativeMomentum) {
987+ keepEvent[kFemto3P ] = true ;
988+ if (activateQA) {
989+ hCharmDeuteronKstarDistr[iHypo + 1 ]->Fill (relativeMomentum);
990+ }
991+ }
992+ }
993+ }
967994 } // end femto selection
968995
969996 // SigmaC++ K- trigger
0 commit comments