@@ -84,6 +84,9 @@ struct HfDerivedDataCreatorCorrelationsReduced {
8484 Configurable<float > ptTrkMax{" ptTrkMax" , 3 ., " max. track pT" };
8585 Configurable<float > dcaXYTrkMax{" dcaXYTrkMax" , 1 ., " max. track DCA XY" };
8686 Configurable<float > dcaZTrkMax{" dcaZTrkMax" , 1 ., " max. track DCA Z" };
87+ Configurable<bool > usePtDiffDcaXYCut{" usePtDiffDcaXYCut" , false , " Use pt-differential DCAxy cut for associated tracks" };
88+ Configurable<float > dcaXYTrkNSigmaMax{" dcaXYTrkNSigmaMax" , 7 , " Cut on number of sigma deviations from expected DCA in the transverse direction" };
89+ Configurable<std::string> dcaXYPtPrimTrkFunc{" dcaXYPtPrimTrkFunc" , " (0.0026+0.005/(x^1.01))" , " Functional form of pt-dependent DCAxy cut" };
8790 Configurable<float > deltaEtaAbsMin{" deltaEtaAbsMin" , 0.5 , " min. pair delta eta" };
8891 Configurable<float > deltaEtaAbsMax{" deltaEtaAbsMax" , 2 ., " max. pair delta eta" };
8992 Configurable<float > downSampleTrksFactor{" downSampleTrksFactor" , 1 ., " Fraction of associated tracks to keep" };
@@ -98,6 +101,7 @@ struct HfDerivedDataCreatorCorrelationsReduced {
98101 SliceCache cache;
99102
100103 double massCharm{0 .};
104+ TF1* funcDcaXYPtCutPrimTrk = nullptr ;
101105
102106 using CollsWithCentMult = soa::Join<aod::Collisions, aod::EvSels, aod::FT0Mults, aod::FV0Mults, aod::CentFT0Ms, aod::CentFT0As, aod::CentFT0Cs, aod::CentFV0As>;
103107 using CandDsData = soa::Filtered<soa::Join<aod::HfCand3Prong, aod::HfSelDsToKKPi, aod::HfMlDsToKKPi>>;
@@ -130,6 +134,7 @@ struct HfDerivedDataCreatorCorrelationsReduced {
130134 ConfigurableAxis binsDeltaPhi{" binsDeltaPhi" , {64 , -3 ., 3 .}, " Delta Phi bins" };
131135 ConfigurableAxis binsMlOne{" binsMlOne" , {100 , 0 ., 1 .}, " " };
132136 ConfigurableAxis binsMlTwo{" binsMlTwo" , {100 , 0 ., 1 .}, " " };
137+ ConfigurableAxis binsDca{" binsDca" , {200 , -1 ., 1 .}, " " };
133138
134139 HistogramRegistry registry{" registry" , {}};
135140
@@ -159,6 +164,8 @@ struct HfDerivedDataCreatorCorrelationsReduced {
159164 const AxisSpec axisPhi = {binsPhi, " #it{#varphi}" };
160165 const AxisSpec axisPtTrig = {(std::vector<double >)binsPtTrig, " #it{p}_{T} Trig (GeV/#it{c})" };
161166 const AxisSpec axisPtAssoc = {(std::vector<double >)binsPtAssoc, " #it{p}_{T} Assoc (GeV/#it{c})" };
167+ const AxisSpec axisDcaXY = {binsDca, " DCA XY (cm)" };
168+ const AxisSpec axisDcaZ = {binsDca, " DCA Z (cm)" };
162169
163170 // Histograms for data analysis
164171 registry.add (" hPhiVsPtTrig" , " Trigger candidates phiVsPt" , {HistType::kTH2F , {{axisPhi}, {axisPtTrig}}});
@@ -167,6 +174,15 @@ struct HfDerivedDataCreatorCorrelationsReduced {
167174 registry.add (" hEtaVsPtTrigAssoc" , " Associated particles etaVsPt" , {HistType::kTH3F , {{axisEta}, {axisPtTrig}, {axisPtAssoc}}});
168175 registry.add (" hPhiVsPtAssoc" , " Associated particles phiVsPt" , {HistType::kTH2F , {{axisPhi}, {axisPtAssoc}}});
169176 registry.add (" hEtaVsPtAssoc" , " Associated particles etaVsPt" , {HistType::kTH2F , {{axisEta}, {axisPtAssoc}}});
177+ registry.add (" hDcaXYVsPtAssoc" , " Associated particles DCAxyVsPt" , {HistType::kTH2F , {{axisDcaXY}, {axisPtAssoc}}});
178+ registry.add (" hDcaZVsPtAssoc" , " Associated particles DCAzVsPt" , {HistType::kTH2F , {{axisDcaZ}, {axisPtAssoc}}});
179+
180+ // Setup pt-dependent DCAxy cut function
181+ if (usePtDiffDcaXYCut) {
182+ funcDcaXYPtCutPrimTrk = new TF1 (" funcDcaXYPtCutPrimTrk" , Form (" [0]*%s" , dcaXYPtPrimTrkFunc.value .data ()), 0.001 , 100 );
183+ funcDcaXYPtCutPrimTrk->SetParameter (0 , dcaXYTrkNSigmaMax);
184+ LOGF (info, " DCAxy pt-dependence function: %s" , Form (" [0]*%s" , dcaXYPtPrimTrkFunc.value .data ()));
185+ }
170186 }; // end init
171187
172188 // / Get charm hadron candidate mass
@@ -259,9 +275,8 @@ struct HfDerivedDataCreatorCorrelationsReduced {
259275 // / \param assTrk is the associated track
260276 // / \param cand is the trigger candidate
261277 template <CandType candType, typename TCand, typename TAssocTrk>
262- bool acceptSameEvtPair (TAssocTrk const & assTrk, TCand const & cand)
278+ bool acceptSameEvtPair (TAssocTrk const & assTrk, TCand const & cand, double deltaEta )
263279 {
264- double deltaEta = assTrk.eta () - cand.eta ();
265280 if (std::abs (deltaEta) <= deltaEtaAbsMin || std::abs (deltaEta) > deltaEtaAbsMax) {
266281 return false ;
267282 }
@@ -306,22 +321,31 @@ struct HfDerivedDataCreatorCorrelationsReduced {
306321 registry.fill (HIST (" hPhiVsPtTrig" ), RecoDecay::constrainAngle (trigCand.phi (), -o2::constants::math::PIHalf), trigCandPt);
307322 registry.fill (HIST (" hEtaVsPtTrig" ), trigCand.eta (), trigCandPt);
308323 for (const auto & assTrk : assTrks) {
309- if (!acceptSameEvtPair<candType>(assTrk, trigCand)) {
324+ double assTrkPt = assTrk.pt ();
325+ if (usePtDiffDcaXYCut) {
326+ float dcaXYTrkCut = funcDcaXYPtCutPrimTrk->Eval (assTrkPt);
327+ if (std::fabs (assTrk.dcaXY ()) > dcaXYTrkCut) {
328+ continue ;
329+ }
330+ }
331+
332+ double deltaEta = assTrk.eta () - trigCand.eta ();
333+ if (!acceptSameEvtPair<candType>(assTrk, trigCand, deltaEta)) {
310334 continue ;
311335 }
312- double assTrkPt = assTrk.pt ();
313336 if (downSampleTrksFactor < 1 .) {
314337 float pseudoRndm = assTrkPt * 1000 . - static_cast <int64_t >(assTrkPt * 1000 );
315338 if (assTrkPt < ptMaxForDownSample && collCentrality < centMaxForDownSample && pseudoRndm >= downSampleTrksFactor) {
316339 continue ;
317340 }
318341 }
319342 registry.fill (HIST (" hPhiVsPtTrigAssoc" ), RecoDecay::constrainAngle (assTrk.phi (), -o2::constants::math::PIHalf), trigCandPt, assTrkPt);
320- registry.fill (HIST (" hEtaVsPtAssoc " ), assTrk.eta (), trigCandPt, assTrkPt);
343+ registry.fill (HIST (" hEtaVsPtTrigAssoc " ), assTrk.eta (), trigCandPt, assTrkPt);
321344 registry.fill (HIST (" hPhiVsPtAssoc" ), RecoDecay::constrainAngle (assTrk.phi (), -o2::constants::math::PIHalf), assTrkPt);
322345 registry.fill (HIST (" hEtaVsPtAssoc" ), assTrk.eta (), assTrkPt);
346+ registry.fill (HIST (" hDcaXYVsPtAssoc" ), assTrk.dcaXY (), assTrkPt);
347+ registry.fill (HIST (" hDcaZVsPtAssoc" ), assTrk.dcaZ (), assTrkPt);
323348
324- double deltaEta = assTrk.eta () - trigCand.eta ();
325349 double deltaPhi = RecoDecay::constrainAngle (assTrk.phi () - trigCand.phi (), -o2::constants::math::PIHalf);
326350 rowSEPairs (rowCollisions.lastIndex (), trigCandPt, assTrkPt, deltaEta, deltaPhi);
327351 rowAssocTrkSels (assTrk.tpcNClsCrossedRows (), assTrk.itsClusterMap (), assTrk.itsNCls (), assTrk.dcaXY (), assTrk.dcaZ ());
@@ -363,6 +387,12 @@ struct HfDerivedDataCreatorCorrelationsReduced {
363387 continue ;
364388 }
365389 double assTrkPt = assTrk.pt ();
390+ if (usePtDiffDcaXYCut) {
391+ float dcaXYTrkCut = funcDcaXYPtCutPrimTrk->Eval (assTrkPt);
392+ if (std::fabs (assTrk.dcaXY ()) > dcaXYTrkCut) {
393+ continue ;
394+ }
395+ }
366396 if (!first && downSampleTrksFactor < 1 .) { // skip downsampling for the first track to avoid empty tables
367397 float pseudoRndm = assTrkPt * 1000 . - static_cast <int64_t >(assTrkPt * 1000 );
368398 if (assTrkPt < ptMaxForDownSample && collCentrality < centMaxForDownSample && pseudoRndm >= downSampleTrksFactor) {
@@ -372,6 +402,8 @@ struct HfDerivedDataCreatorCorrelationsReduced {
372402 first = false ;
373403 registry.fill (HIST (" hPhiVsPtAssoc" ), RecoDecay::constrainAngle (assTrk.phi (), -o2::constants::math::PIHalf), assTrkPt);
374404 registry.fill (HIST (" hEtaVsPtAssoc" ), assTrk.eta (), assTrkPt);
405+ registry.fill (HIST (" hDcaXYVsPtAssoc" ), assTrk.dcaXY (), assTrkPt);
406+ registry.fill (HIST (" hDcaZVsPtAssoc" ), assTrk.dcaZ (), assTrkPt);
375407 rowAssocBases (rowCollisions.lastIndex (), assTrk.phi (), assTrk.eta (), assTrkPt);
376408 rowAssocTrkSels (assTrk.tpcNClsCrossedRows (), assTrk.itsClusterMap (), assTrk.itsNCls (), assTrk.dcaXY (), assTrk.dcaZ ());
377409 }
0 commit comments