@@ -74,6 +74,7 @@ struct HStrangeCorrelation {
7474 Configurable<bool > doGenEventSelection{" doGenEventSelection" , true , " use event selections when performing closure test for the gen events" };
7575 Configurable<bool > selectINELgtZERO{" selectINELgtZERO" , true , " select INEL>0 events" };
7676 Configurable<float > zVertexCut{" zVertexCut" , 10 , " Cut on PV position" };
77+ Configurable<bool > requireAllGoodITSLayers{" requireAllGoodITSLayers" , false , " require that in the event all ITS are good" };
7778 Configurable<bool > skipUnderOverflowInTHn{" skipUnderOverflowInTHn" , false , " skip under/overflow in THns" };
7879 Configurable<int > mixingParameter{" mixingParameter" , 10 , " how many events are mixed" };
7980 Configurable<bool > doMCassociation{" doMCassociation" , false , " fill everything only for MC associated" };
@@ -119,13 +120,19 @@ struct HStrangeCorrelation {
119120 Configurable<int > minTPCNCrossedRowsTrigger{" minTPCNCrossedRowsTrigger" , 70 , " Minimum TPC crossed rows (trigger)" };
120121 Configurable<int > minTPCNCrossedRowsAssociated{" minTPCNCrossedRowsAssociated" , 70 , " Minimum TPC crossed rows (associated)" };
121122 Configurable<bool > triggerRequireITS{" triggerRequireITS" , true , " require ITS signal in trigger tracks" };
123+ Configurable<bool > assocRequireITS{" assocRequireITS" , true , " require ITS signal in associated primary tracks" };
122124 Configurable<int > triggerMaxTPCSharedClusters{" triggerMaxTPCSharedClusters" , 200 , " maximum number of shared TPC clusters (inclusive)" };
125+ Configurable<int > assocMaxTPCSharedClusters{" assocMaxTPCSharedClusters" , 200 , " maximum number of shared TPC clusters (inclusive) for assoc primary tracks" };
123126 Configurable<bool > triggerRequireL0{" triggerRequireL0" , false , " require ITS L0 cluster for trigger" };
127+ Configurable<bool > assocRequireL0{" assocRequireL0" , true , " require ITS L0 cluster for assoc primary track" };
124128
125129 // --- Trigger: DCA variation from basic formula: |DCAxy| < 0.004f + (0.013f / pt)
126130 Configurable<float > dcaXYconstant{" dcaXYconstant" , 0.004 , " [0] in |DCAxy| < [0]+[1]/pT" };
127131 Configurable<float > dcaXYpTdep{" dcaXYpTdep" , 0.013 , " [1] in |DCAxy| < [0]+[1]/pT" };
128132
133+ Configurable<float > dcaXYconstantAssoc{" dcaXYconstantAssoc" , 0.004 , " [0] in |DCAxy| < [0]+[1]/pT" };
134+ Configurable<float > dcaXYpTdepAssoc{" dcaXYpTdepAssoc" , 0.013 , " [1] in |DCAxy| < [0]+[1]/pT" };
135+
129136 // --- Associated: topological variable variation (OK to vary all-at-once, at least for first study)
130137 Configurable<double > v0cospa{" v0cospa" , 0.97 , " V0 CosPA" }; // double -> N.B. dcos(x)/dx = 0 at x=0)
131138 Configurable<float > dcaV0dau{" dcaV0dau" , 1.0 , " DCA V0 Daughters" };
@@ -265,6 +272,30 @@ struct HStrangeCorrelation {
265272 }
266273 return true ;
267274 }
275+ template <class TTrack >
276+ bool isValidAssocHadron (TTrack track)
277+ {
278+ if (track.tpcNClsCrossedRows () < systCuts.minTPCNCrossedRowsAssociated ) {
279+ return false ; // crossed rows
280+ }
281+ if (!track.hasITS () && systCuts.assocRequireITS ) {
282+ return false ; // skip, doesn't have ITS signal (skips lots of TPC-only!)
283+ }
284+ if (track.tpcNClsShared () > systCuts.assocMaxTPCSharedClusters ) {
285+ return false ; // skip, has shared clusters
286+ }
287+ if (!(TESTBIT (track.itsClusterMap (), 0 )) && systCuts.assocRequireL0 ) {
288+ return false ; // skip, doesn't have cluster in ITS L0
289+ }
290+ // systematic variations: trigger DCAxy
291+ if (std::abs (track.dcaXY ()) > systCuts.dcaXYconstantAssoc + systCuts.dcaXYpTdepAssoc * std::abs (track.signed1Pt ())) {
292+ return false ;
293+ }
294+ if (track.pt () > axisRanges[2 ][1 ] || track.pt () < axisRanges[2 ][0 ]) {
295+ return false ;
296+ }
297+ return true ;
298+ }
268299 void fillCorrelationsV0 (aod::TriggerTracks const & triggers, aod::AssocV0s const & assocs, bool mixing, float pvz, float mult)
269300 {
270301 for (auto const & triggerTrack : triggers) {
@@ -278,6 +309,9 @@ struct HStrangeCorrelation {
278309 float efficiency = 1 .0f ;
279310 if (applyEfficiencyForTrigger) {
280311 efficiency = hEfficiencyTrigger->Interpolate (trigg.pt (), trigg.eta ());
312+ if (efficiency == 0 ) { // check for zero efficiency, do not apply if the case
313+ efficiency = 1 ;
314+ }
281315 }
282316 float weight = (applyEfficiencyForTrigger) ? 1 . / efficiency : 1 .0f ;
283317 histos.fill (HIST (" sameEvent/TriggerParticlesV0" ), trigg.pt (), mult, weight);
@@ -336,6 +370,9 @@ struct HStrangeCorrelation {
336370 if (applyEfficiencyForTrigger) {
337371 efficiency = efficiency * hEfficiencyTrigger->Interpolate (pttrigger, trigg.eta ());
338372 }
373+ if (efficiency == 0 ) { // check for zero efficiency, do not apply if the case
374+ efficiency = 1 ;
375+ }
339376
340377 float weight = (applyEfficiencyCorrection || applyEfficiencyForTrigger) ? 1 . / efficiency : 1 .0f ;
341378 if (TESTBIT (doCorrelation, Index) && (!applyEfficiencyCorrection || efficiency != 0 )) {
@@ -379,6 +416,9 @@ struct HStrangeCorrelation {
379416 float efficiency = 1 .0f ;
380417 if (applyEfficiencyForTrigger) {
381418 efficiency = hEfficiencyTrigger->Interpolate (trigg.pt (), trigg.eta ());
419+ if (efficiency == 0 ) { // check for zero efficiency, do not apply if the case
420+ efficiency = 1 ;
421+ }
382422 }
383423 float weight = (applyEfficiencyForTrigger) ? 1 . / efficiency : 1 .0f ;
384424 histos.fill (HIST (" sameEvent/TriggerParticlesCascade" ), trigg.pt (), mult, weight);
@@ -450,6 +490,9 @@ struct HStrangeCorrelation {
450490 if (applyEfficiencyForTrigger) {
451491 efficiency = efficiency * hEfficiencyTrigger->Interpolate (pttrigger, trigg.eta ());
452492 }
493+ if (efficiency == 0 ) { // check for zero efficiency, do not apply if the case
494+ efficiency = 1 ;
495+ }
453496 float weight = (applyEfficiencyCorrection || applyEfficiencyForTrigger) ? 1 . / efficiency : 1 .0f ;
454497 if (TESTBIT (doCorrelation, Index + 3 ) && (!applyEfficiencyCorrection || efficiency != 0 )) {
455498 if (assocCandidate.compatible (Index, systCuts.dEdxCompatibility ) && (!doMCassociation || assocCandidate.mcTrue (Index)) && (!doAssocPhysicalPrimary || assocCandidate.mcPhysicalPrimary ()) && !mixing && -massWindowConfigurations.maxBgNSigma < assocCandidate.invMassNSigma (Index) && assocCandidate.invMassNSigma (Index) < -massWindowConfigurations.minBgNSigma )
@@ -484,6 +527,9 @@ struct HStrangeCorrelation {
484527 float efficiency = 1 .0f ;
485528 if (applyEfficiencyForTrigger) {
486529 efficiency = hEfficiencyTrigger->Interpolate (trigg.pt (), trigg.eta ());
530+ if (efficiency == 0 ) { // check for zero efficiency, do not apply if the case
531+ efficiency = 1 ;
532+ }
487533 }
488534 float weight = (applyEfficiencyForTrigger) ? 1 . / efficiency : 1 .0f ;
489535 if constexpr (requires { triggerTrack.extra (); })
@@ -504,11 +550,12 @@ struct HStrangeCorrelation {
504550 continue ;
505551 }
506552 }
507-
508553 // ---] track quality check [---
509- if (assoc. tpcNClsCrossedRows () < systCuts. minTPCNCrossedRowsAssociated )
554+ if (! isValidAssocHadron (assoc) )
510555 continue ;
511-
556+ if (doAssocPhysicalPrimary && !assocTrack.mcPhysicalPrimary ()) {
557+ continue ;
558+ }
512559 float deltaphi = computeDeltaPhi (trigg.phi (), assoc.phi ());
513560 float deltaeta = trigg.eta () - assoc.eta ();
514561 float ptassoc = assoc.pt ();
@@ -533,6 +580,9 @@ struct HStrangeCorrelation {
533580 if (applyEfficiencyForTrigger) {
534581 efficiency = efficiency * hEfficiencyTrigger->Interpolate (pttrigger, trigg.eta ());
535582 }
583+ if (efficiency == 0 ) { // check for zero efficiency, do not apply if the case
584+ efficiency = 1 ;
585+ }
536586 float weight = (applyEfficiencyCorrection || applyEfficiencyForTrigger) ? 1 . / efficiency : 1 .0f ;
537587
538588 if (!mixing) {
@@ -770,6 +820,7 @@ struct HStrangeCorrelation {
770820 histos.add (" hTriggerPtResolution" , " ;p_{T}^{reconstructed} (GeV/c); p_{T}^{generated} (GeV/c)" , kTH2F , {axisPtQA, axisPtQA});
771821 histos.add (" hTriggerPrimaryEtaVsPt" , " hTriggerPrimaryEtaVsPt" , kTH3F , {axisPtQA, axisEta, axisMult});
772822 histos.add (" hTrackEtaVsPtVsPhi" , " hTrackEtaVsPtVsPhi" , kTH3F , {axisPtQA, axisEta, axisPhi});
823+ histos.add (" hAssocTrackEtaVsPtVsPhi" , " hAssocTrackEtaVsPtVsPhi" , kTH3F , {axisPtQA, axisEta, axisPhi});
773824 histos.add (" hTrackAttempt" , " Attempt" , kTH3F , {axisPtQA, axisEta, axisPhi});
774825
775826 bool hStrange = false ;
@@ -863,6 +914,9 @@ struct HStrangeCorrelation {
863914 if (!collision.isInelGt0 () && selectINELgtZERO) {
864915 return false ;
865916 }
917+ if (!collision.selection_bit (aod::evsel::kIsGoodITSLayersAll ) && requireAllGoodITSLayers) {
918+ return false ;
919+ }
866920 if (zorroMask.value != " " ) {
867921 auto bc = collision.template bc_as <aod::BCsWithTimestamps>();
868922 initZorro (bc);
@@ -946,12 +1000,39 @@ struct HStrangeCorrelation {
9461000 auto track = triggerTrack.track_as <TracksComplete>();
9471001 if (!isValidTrigger (track))
9481002 continue ;
1003+ float efficiency = 1 .0f ;
1004+ if (applyEfficiencyCorrection) {
1005+ efficiency = hEfficiencyTrigger->Interpolate (track.pt (), track.eta ());
1006+ }
1007+ if (efficiency == 0 ) { // check for zero efficiency, do not apply if the case
1008+ efficiency = 1 ;
1009+ }
1010+ float weight = applyEfficiencyCorrection ? 1 . / efficiency : 1 .0f ;
9491011 histos.fill (HIST (" hTriggerAllSelectedEtaVsPt" ), track.pt (), track.eta (), collision.centFT0M ());
9501012 histos.fill (HIST (" hTriggerPtResolution" ), track.pt (), triggerTrack.mcOriginalPt ());
9511013 if (doTriggPhysicalPrimary && !triggerTrack.mcPhysicalPrimary ())
9521014 continue ;
9531015 histos.fill (HIST (" hTriggerPrimaryEtaVsPt" ), track.pt (), track.eta (), collision.centFT0M ());
954- histos.fill (HIST (" hTrackEtaVsPtVsPhi" ), track.pt (), track.eta (), track.phi ());
1016+ histos.fill (HIST (" hTrackEtaVsPtVsPhi" ), track.pt (), track.eta (), track.phi (), weight);
1017+ }
1018+ for (auto const & assocTrack : assocHadrons) {
1019+ auto assoc = assocTrack.track_as <TracksComplete>();
1020+ if (!isValidAssocHadron (assoc))
1021+ continue ;
1022+ float efficiency = 1 .0f ;
1023+ if (applyEfficiencyCorrection) {
1024+ efficiency = hEfficiencyHadron->Interpolate (assoc.pt (), assoc.eta ());
1025+ }
1026+ if (efficiency == 0 ) { // check for zero efficiency, do not apply if the case
1027+ efficiency = 1 ;
1028+ }
1029+ float weight = applyEfficiencyCorrection ? 1 . / efficiency : 1 .0f ;
1030+ histos.fill (HIST (" hAssocHadronsAllSelectedEtaVsPt" ), assoc.pt (), assoc.eta (), collision.centFT0M ());
1031+ histos.fill (HIST (" hAssocPtResolution" ), assoc.pt (), assocTrack.mcOriginalPt ());
1032+ if (doAssocPhysicalPrimary && !assocTrack.mcPhysicalPrimary ())
1033+ continue ;
1034+ histos.fill (HIST (" hAssocPrimaryEtaVsPt" ), assoc.pt (), assoc.eta (), collision.centFT0M ());
1035+ histos.fill (HIST (" hAsssocTrackEtaVsPtVsPhi" ), assoc.pt (), assoc.eta (), assoc.phi (), weight);
9551036 }
9561037 }
9571038
@@ -1014,6 +1095,9 @@ struct HStrangeCorrelation {
10141095 if (applyEfficiencyCorrection) {
10151096 efficiency = hEfficiencyV0[Index]->Interpolate (v0Data.pt (), v0Data.eta ());
10161097 }
1098+ if (efficiency == 0 ) { // check for zero efficiency, do not apply if the case
1099+ efficiency = 1 ;
1100+ }
10171101 float weight = applyEfficiencyCorrection ? 1 . / efficiency : 1 .0f ;
10181102 if (v0.compatible (Index, systCuts.dEdxCompatibility ) && (!doMCassociation || v0.mcTrue (Index)) && (!doAssocPhysicalPrimary || v0.mcPhysicalPrimary ()) && (!applyEfficiencyCorrection || efficiency != 0 )) {
10191103 if (TESTBIT (doCorrelation, Index)) {
@@ -1109,6 +1193,9 @@ struct HStrangeCorrelation {
11091193 if (applyEfficiencyCorrection) {
11101194 efficiency = hEfficiencyCascade[Index]->Interpolate (cascData.pt (), cascData.eta ());
11111195 }
1196+ if (efficiency == 0 ) { // check for zero efficiency, do not apply if the case
1197+ efficiency = 1 ;
1198+ }
11121199 float weight = applyEfficiencyCorrection ? 1 . / efficiency : 1 .0f ;
11131200 if (casc.compatible (Index, systCuts.dEdxCompatibility ) && (!doMCassociation || casc.mcTrue (Index)) && (!doAssocPhysicalPrimary || casc.mcPhysicalPrimary ()) && (!applyEfficiencyCorrection || efficiency != 0 )) {
11141201 if (TESTBIT (doCorrelation, Index + 3 )) {
0 commit comments