3131#include " Common/DataModel/TrackSelectionTables.h"
3232
3333#include " CCDB/BasicCCDBManager.h"
34- #include " Framework/ASoAHelpers.h"
3534#include " Framework/AnalysisTask.h"
3635#include " Framework/runDataProcessing.h"
36+ #include < Framework/Configurable.h>
3737
3838#include " TF1.h"
3939#include < TPDGCode.h>
@@ -49,8 +49,8 @@ using namespace o2::framework::expressions;
4949#define BIT_CHECK (var, nbit ) ((var) & (1 << (nbit)))
5050
5151struct HStrangeCorrelationFilter {
52- const float ctauxiPDG = 4.91 ; // from PDG
53- const float ctauomegaPDG = 2.461 ; // from PDG
52+ const float ctauxi = 4.91 ; // from PDG
53+ const float ctauomega = 2.461 ; // from PDG
5454
5555 Service<o2::ccdb::BasicCCDBManager> ccdb;
5656
@@ -59,6 +59,8 @@ struct HStrangeCorrelationFilter {
5959 // master analysis switches
6060 Configurable<bool > doPPAnalysis{" doPPAnalysis" , true , " if in pp, set to true" };
6161 Configurable<bool > useParameterization{" useParameterization" , true , " ture for parameterization method, false for hist method" };
62+ Configurable<float > minPtForParam{" minPtForParam" , 0 .2f , " min pt for parameterization method" };
63+ Configurable<float > maxPtForParam{" maxPtForParam" , 14 .5f , " max pt for parameterization method" };
6264 // Operational
6365 Configurable<bool > fillTableOnlyWithCompatible{" fillTableOnlyWithCompatible" , true , " pre-apply dE/dx, broad mass window in table filling" };
6466 Configurable<float > strangedEdxNSigmaLoose{" strangedEdxNSigmaLoose" , 5 , " Nsigmas for strange decay daughters" };
@@ -76,6 +78,8 @@ struct HStrangeCorrelationFilter {
7678 Configurable<float > zVertexCut{" zVertexCut" , 10 , " Cut on PV position" };
7779 Configurable<bool > selectINELgtZERO{" selectINELgtZERO" , true , " select INEL>0 events" };
7880 Configurable<bool > requireAllGoodITSLayers{" requireAllGoodITSLayers" , false , " require that in the event all ITS are good" };
81+ Configurable<float > minCentPercent{" minCentPercent" , 0 , " minimum centrality percentage" };
82+ Configurable<float > maxCentPercent{" maxCentPercent" , 100 , " maximum centrality percentage" };
7983 } eventSelections;
8084
8185 struct : ConfigurableGroup {
@@ -137,6 +141,10 @@ struct HStrangeCorrelationFilter {
137141 Configurable<float > dcaBachtopv{" dcaBachtopv" , 0.1 , " dcaBachtopv" };
138142 Configurable<float > cascV0masswindow{" cascV0masswindow" , 0.01 , " cascV0masswindow" };
139143 Configurable<float > cascMindcav0topv{" cascMindcav0topv" , 0.01 , " cascMindcav0topv" };
144+
145+ // pt Range for pt dep cuts
146+ Configurable<float > highPtForCascDaugPtDep{" highPtForCascDaugPtDep" , 4.0 , " high pt range for pt dep cuts" };
147+ Configurable<float > lowPtForCascDaugPtDep{" lowPtForCascDaugPtDep" , 1.0 , " low pt range for pt dep cuts" };
140148 } systCuts;
141149 struct : ConfigurableGroup {
142150 // cascade selections in PbPb
@@ -237,6 +245,17 @@ struct HStrangeCorrelationFilter {
237245 OutputObj<ZorroSummary> zorroSummary{" zorroSummary" };
238246 int mRunNumber ;
239247
248+ struct TriggCandidate {
249+ float pt;
250+ int collisionId;
251+ int trackId;
252+ bool isPhysicalPrimary;
253+ float origPt;
254+ };
255+ TriggCandidate thisTrigg;
256+
257+ std::vector<TriggCandidate> triggerCandidates;
258+
240259 void init (InitContext const &)
241260 {
242261 zorroSummary.setObject (zorro.getZorroSummary ());
@@ -326,7 +345,7 @@ struct HStrangeCorrelationFilter {
326345 if (std::abs (collision.posZ ()) > eventSelections.zVertexCut ) {
327346 return false ;
328347 }
329- if (collision.centFT0M () > 100 || collision.centFT0M () < 0 ) {
348+ if (collision.centFT0M () > eventSelections. maxCentPercent || collision.centFT0M () < eventSelections. minCentPercent ) {
330349 return false ;
331350 }
332351 if (!collision.isInelGt0 () && eventSelections.selectINELgtZERO ) {
@@ -443,13 +462,13 @@ struct HStrangeCorrelationFilter {
443462
444463 bool physicalPrimary = false ;
445464 float origPt = -1 ;
446- float pdgCode = -9999 ;
465+ float code = -9999 ;
447466 if constexpr (requires { assoc.mcParticle (); }) {
448467 if (assoc.has_mcParticle ()) {
449468 auto mcParticle = assoc.mcParticle ();
450469 physicalPrimary = mcParticle.isPhysicalPrimary ();
451470 origPt = mcParticle.pt ();
452- pdgCode = mcParticle.pdgCode ();
471+ code = mcParticle.pdgCode ();
453472 }
454473 }
455474
@@ -458,7 +477,7 @@ struct HStrangeCorrelationFilter {
458477 physicalPrimary,
459478 assoc.globalIndex (),
460479 origPt,
461- pdgCode );
480+ code );
462481 assocPID (
463482 nSigmaTPCTOF[0 ],
464483 nSigmaTPCTOF[1 ],
@@ -473,7 +492,7 @@ struct HStrangeCorrelationFilter {
473492
474493 // cascadeselection in PbPb
475494 template <typename TCascade>
476- bool CascadeSelectedPbPb (TCascade casc, float pvx, float pvy, float pvz)
495+ bool cascadeSelectedPbPb (TCascade casc, float pvx, float pvy, float pvz)
477496 {
478497 // bachBaryonCosPA
479498 if (casc.bachBaryonCosPA () < MorePbPbsystCuts.bachBaryonCosPA )
@@ -486,9 +505,9 @@ struct HStrangeCorrelationFilter {
486505 return false ;
487506 // dcacascdaughters
488507 float ptDepCut = MorePbPbsystCuts.dcaCacsDauPar0 ;
489- if (casc.pt () > 1 && casc.pt () < 4 )
508+ if (casc.pt () > systCuts. lowPtForCascDaugPtDep && casc.pt () < systCuts. highPtForCascDaugPtDep )
490509 ptDepCut = MorePbPbsystCuts.dcaCacsDauPar1 ;
491- else if (casc.pt () > 4 )
510+ else if (casc.pt () > systCuts. highPtForCascDaugPtDep )
492511 ptDepCut = MorePbPbsystCuts.dcaCacsDauPar2 ;
493512 if (casc.dcacascdaughters () > ptDepCut)
494513 return false ;
@@ -516,48 +535,79 @@ struct HStrangeCorrelationFilter {
516535 // for real data processing
517536 void processTriggers (soa::Join<aod::Collisions, aod::EvSels, aod::CentFT0Ms, aod::CentFT0Cs, aod::PVMults>::iterator const & collision, soa::Filtered<FullTracks> const & tracks, aod::BCsWithTimestamps const &)
518537 {
538+ triggerCandidates.clear ();
519539 if (((doPPAnalysis && !isCollisionSelected (collision))) || (!doPPAnalysis && !isCollisionSelectedPbPb (collision))) {
520540 return ;
521541 }
522542
523543 // / _________________________________________________
524544 // / Step 1: Populate table with trigger tracks
545+ double leadingPt = -1 .;
546+ int leadingId = -1 ;
525547 for (auto const & track : tracks) {
526548 if (!isValidTrigger (track))
527549 continue ;
550+ thisTrigg.pt = track.pt ();
551+ thisTrigg.trackId = track.globalIndex ();
552+ thisTrigg.collisionId = track.collisionId ();
553+ thisTrigg.isPhysicalPrimary = false ; // if you decide to check real data for primaries, you'll have a hard time
554+ thisTrigg.origPt = 0 ;
555+ triggerCandidates.push_back (thisTrigg);
556+ if (track.pt () > leadingPt) {
557+ leadingPt = track.pt ();
558+ leadingId = track.globalIndex ();
559+ }
560+ }
561+ for (auto const & TriggCandidate : triggerCandidates) {
562+ bool isLeading = (leadingId == TriggCandidate.trackId );
528563 triggerTrack (
529- track.collisionId (),
530- false , // if you decide to check real data for primaries, you'll have a hard time
531- track.globalIndex (),
532- 0 );
564+ TriggCandidate.collisionId ,
565+ TriggCandidate.isPhysicalPrimary ,
566+ TriggCandidate.trackId ,
567+ TriggCandidate.origPt ,
568+ isLeading);
533569 triggerTrackExtra (1 );
534570 }
535571 }
536572
537573 // for MC processing
538574 void processTriggersMC (soa::Join<aod::Collisions, aod::EvSels, aod::CentFT0Ms, aod::CentFT0Cs, aod::PVMults>::iterator const & collision, soa::Filtered<FullTracksMC> const & tracks, aod::McParticles const &, aod::BCsWithTimestamps const &)
539575 {
576+ triggerCandidates.clear ();
540577 if (((doPPAnalysis && !isCollisionSelected (collision))) || (!doPPAnalysis && !isCollisionSelectedPbPb (collision))) {
541578 return ;
542579 }
543580
544581 // / _________________________________________________
545582 // / Step 1: Populate table with trigger tracks
583+ double leadingPt = -1 .;
584+ int leadingId = -1 ;
546585 for (auto const & track : tracks) {
547586 if (!isValidTrigger (track))
548587 continue ;
549- bool physicalPrimary = false ;
550- float origPt = -1 ;
588+ thisTrigg.pt = track.pt ();
589+ thisTrigg.trackId = track.globalIndex ();
590+ thisTrigg.collisionId = track.collisionId ();
551591 if (track.has_mcParticle ()) {
552592 auto mcParticle = track.mcParticle ();
553- physicalPrimary = mcParticle.isPhysicalPrimary ();
554- origPt = mcParticle.pt ();
593+ thisTrigg. isPhysicalPrimary = mcParticle.isPhysicalPrimary ();
594+ thisTrigg. origPt = mcParticle.pt ();
555595 }
596+ triggerCandidates.push_back (thisTrigg);
597+ if (track.pt () > leadingPt) {
598+ leadingPt = track.pt ();
599+ leadingId = track.globalIndex ();
600+ }
601+ }
602+
603+ for (auto const & TriggCandidate : triggerCandidates) {
604+ bool isLeading = (leadingId == TriggCandidate.trackId );
556605 triggerTrack (
557- track.collisionId (),
558- physicalPrimary,
559- track.globalIndex (),
560- origPt);
606+ TriggCandidate.collisionId ,
607+ TriggCandidate.isPhysicalPrimary ,
608+ TriggCandidate.trackId ,
609+ TriggCandidate.origPt ,
610+ isLeading);
561611 triggerTrackExtra (1 );
562612 }
563613 }
@@ -571,7 +621,7 @@ struct HStrangeCorrelationFilter {
571621 return ;
572622 }
573623 // No need to correlate stuff that's in far collisions
574- if (std::abs (collision.posZ ()) > 10.0 ) {
624+ if (std::abs (collision.posZ ()) > eventSelections. zVertexCut ) {
575625 return ;
576626 }
577627 if (zorroMask.value != " " ) {
@@ -599,7 +649,7 @@ struct HStrangeCorrelationFilter {
599649 return ;
600650 }
601651 // No need to correlate stuff that's in far collisions
602- if (std::abs (collision.posZ ()) > 10.0 ) {
652+ if (std::abs (collision.posZ ()) > eventSelections. zVertexCut ) {
603653 return ;
604654 }
605655 if (zorroMask.value != " " ) {
@@ -627,7 +677,7 @@ struct HStrangeCorrelationFilter {
627677 return ;
628678 }
629679 // No need to correlate stuff that's in far collisions
630- if (std::abs (collision.posZ ()) > 10.0 ) {
680+ if (std::abs (collision.posZ ()) > eventSelections. zVertexCut ) {
631681 return ;
632682 }
633683 if (zorroMask.value != " " ) {
@@ -654,7 +704,7 @@ struct HStrangeCorrelationFilter {
654704 return ;
655705 }
656706 // No need to correlate stuff that's in far collisions
657- if (std::abs (collision.posZ ()) > 10.0 ) {
707+ if (std::abs (collision.posZ ()) > eventSelections. zVertexCut ) {
658708 return ;
659709 }
660710 if (zorroMask.value != " " ) {
@@ -782,7 +832,7 @@ struct HStrangeCorrelationFilter {
782832 // Load parameters for sideband subtraction
783833 initParametersFromCCDB (bc);
784834 // simplified handling: calculate NSigma in mass here
785- if (v0.pt () < 0 . 2f || v0.pt () > 14 . 5f ) {
835+ if (v0.pt () < minPtForParam || v0.pt () > maxPtForParam ) {
786836 massNSigmaK0Short = (v0.mK0Short () - hK0ShortMean->GetBinContent (hK0ShortMean->FindBin (v0.pt ()))) / (hK0ShortWidth->GetBinContent (hK0ShortWidth->FindBin (v0.pt ())) + 1e-6 );
787837 massNSigmaLambda = (v0.mLambda () - hLambdaMean->GetBinContent (hLambdaMean->FindBin (v0.pt ()))) / (hLambdaWidth->GetBinContent (hLambdaMean->FindBin (v0.pt ())) + 1e-6 );
788838 massNSigmaAntiLambda = (v0.mAntiLambda () - hLambdaMean->GetBinContent (hLambdaMean->FindBin (v0.pt ()))) / (hLambdaWidth->GetBinContent (hLambdaMean->FindBin (v0.pt ())) + 1e-6 );
@@ -924,7 +974,7 @@ struct HStrangeCorrelationFilter {
924974 // Load parameters for sideband subtraction
925975 initParametersFromCCDB (bc);
926976 // simplified handling: calculate NSigma in mass here
927- if (v0.pt () < 0 . 2f || v0.pt () > 14 . 5f ) {
977+ if (v0.pt () < minPtForParam || v0.pt () > maxPtForParam ) {
928978 massNSigmaK0Short = (v0.mK0Short () - hK0ShortMean->GetBinContent (hK0ShortMean->FindBin (v0.pt ()))) / (hK0ShortWidth->GetBinContent (hK0ShortWidth->FindBin (v0.pt ())) + 1e-6 );
929979 massNSigmaLambda = (v0.mLambda () - hLambdaMean->GetBinContent (hLambdaMean->FindBin (v0.pt ()))) / (hLambdaWidth->GetBinContent (hLambdaMean->FindBin (v0.pt ())) + 1e-6 );
930980 massNSigmaAntiLambda = (v0.mAntiLambda () - hLambdaMean->GetBinContent (hLambdaMean->FindBin (v0.pt ()))) / (hLambdaWidth->GetBinContent (hLambdaMean->FindBin (v0.pt ())) + 1e-6 );
@@ -939,11 +989,11 @@ struct HStrangeCorrelationFilter {
939989 bool trueLambda = false ;
940990 bool trueAntiLambda = false ;
941991 v0PhysicalPrimary = v0.isPhysicalPrimary ();
942- if (v0.pdgCode () == 310 )
992+ if (v0.pdgCode () == PDG_t:: kK0Short )
943993 trueK0Short = true ;
944- if (v0.pdgCode () == 3122 )
994+ if (v0.pdgCode () == PDG_t:: kLambda0 )
945995 trueLambda = true ;
946- if (v0.pdgCode () == - 3122 )
996+ if (v0.pdgCode () == PDG_t:: kLambda0Bar )
947997 trueAntiLambda = true ;
948998 if (compatibleK0Short && (!doTrueSelectionInMass || (trueK0Short && v0PhysicalPrimary)))
949999 histos.fill (HIST (" h3dMassK0Short" ), v0.pt (), v0.mK0Short (), cent);
@@ -999,7 +1049,7 @@ struct HStrangeCorrelationFilter {
9991049 continue ;
10001050 if (negTrackCast.tpcNClsCrossedRows () < systCuts.minTPCNCrossedRows )
10011051 continue ;
1002- if (!doPPAnalysis && !CascadeSelectedPbPb (casc, collision.posX (), collision.posY (), collision.posZ ()))
1052+ if (!doPPAnalysis && !cascadeSelectedPbPb (casc, collision.posX (), collision.posY (), collision.posZ ()))
10031053 continue ;
10041054 // check dE/dx compatibility
10051055 int compatibleXiMinus = 0 ;
@@ -1008,8 +1058,8 @@ struct HStrangeCorrelationFilter {
10081058 int compatibleOmegaPlus = 0 ;
10091059 float cascpos = std::hypot (casc.x () - collision.posX (), casc.y () - collision.posY (), casc.z () - collision.posZ ());
10101060 float cascptotmom = std::hypot (casc.px (), casc.py (), casc.pz ());
1011- float ctauXi = o2::constants::physics::MassXiMinus * cascpos / ((cascptotmom + 1e-13 ) * ctauxiPDG );
1012- float ctauOmega = o2::constants::physics::MassOmegaMinus * cascpos / ((cascptotmom + 1e-13 ) * ctauomegaPDG );
1061+ float ctauXi = o2::constants::physics::MassXiMinus * cascpos / ((cascptotmom + 1e-13 ) * ctauxi );
1062+ float ctauOmega = o2::constants::physics::MassOmegaMinus * cascpos / ((cascptotmom + 1e-13 ) * ctauomega );
10131063
10141064 if (std::abs (posTrackCast.tpcNSigmaPr ()) < strangedEdxNSigmaLoose && std::abs (negTrackCast.tpcNSigmaPi ()) < strangedEdxNSigmaLoose && std::abs (bachTrackCast.tpcNSigmaPi ()) < strangedEdxNSigmaLoose && casc.sign () < 0 ) {
10151065 if (doPPAnalysis || (std::abs (casc.dcabachtopv ()) > MorePbPbsystCuts.dcaBachToPV && std::abs (casc.dcapostopv ()) > MorePbPbsystCuts.dcaBaryonToPV &&
@@ -1106,7 +1156,7 @@ struct HStrangeCorrelationFilter {
11061156 } else {
11071157 // Load parameters for sideband subtraction
11081158 initParametersFromCCDB (bc);
1109- if (casc.pt () < 0 . 2f || casc.pt () > 14 . 5f ) {
1159+ if (casc.pt () < minPtForParam || casc.pt () > maxPtForParam ) {
11101160 massNSigmaXi = (casc.mXi () - hXiMean->GetBinContent (hXiMean->FindBin (casc.pt ()))) / (hXiWidth->GetBinContent (hXiWidth->FindBin (casc.pt ())) + 1e-6 );
11111161 massNSigmaOmega = (casc.mOmega () - hOmegaMean->GetBinContent (hOmegaMean->FindBin (casc.pt ()))) / (hOmegaWidth->GetBinContent (hOmegaWidth->FindBin (casc.pt ())) + 1e-6 );
11121162 } else {
@@ -1171,7 +1221,7 @@ struct HStrangeCorrelationFilter {
11711221 continue ;
11721222 if (negTrackCast.tpcNClsCrossedRows () < systCuts.minTPCNCrossedRows )
11731223 continue ;
1174- if (!doPPAnalysis && !CascadeSelectedPbPb (casc, collision.posX (), collision.posY (), collision.posZ ()))
1224+ if (!doPPAnalysis && !cascadeSelectedPbPb (casc, collision.posX (), collision.posY (), collision.posZ ()))
11751225 continue ;
11761226
11771227 // check dE/dx compatibility
@@ -1181,8 +1231,8 @@ struct HStrangeCorrelationFilter {
11811231 int compatibleOmegaPlus = 0 ;
11821232 float cascpos = std::hypot (casc.x () - collision.posX (), casc.y () - collision.posY (), casc.z () - collision.posZ ());
11831233 float cascptotmom = std::hypot (casc.px (), casc.py (), casc.pz ());
1184- float ctauXi = o2::constants::physics::MassXiMinus * cascpos / ((cascptotmom + 1e-13 ) * ctauxiPDG );
1185- float ctauOmega = o2::constants::physics::MassOmegaMinus * cascpos / ((cascptotmom + 1e-13 ) * ctauomegaPDG );
1234+ float ctauXi = o2::constants::physics::MassXiMinus * cascpos / ((cascptotmom + 1e-13 ) * ctauxi );
1235+ float ctauOmega = o2::constants::physics::MassOmegaMinus * cascpos / ((cascptotmom + 1e-13 ) * ctauomega );
11861236
11871237 if (std::abs (posTrackCast.tpcNSigmaPr ()) < strangedEdxNSigmaLoose && std::abs (negTrackCast.tpcNSigmaPi ()) < strangedEdxNSigmaLoose && std::abs (bachTrackCast.tpcNSigmaPi ()) < strangedEdxNSigmaLoose && casc.sign () < 0 ) {
11881238 if (doPPAnalysis || (std::abs (casc.dcabachtopv ()) > MorePbPbsystCuts.dcaBachToPV && std::abs (casc.dcapostopv ()) > MorePbPbsystCuts.dcaBaryonToPV &&
@@ -1279,7 +1329,7 @@ struct HStrangeCorrelationFilter {
12791329 } else {
12801330 // Load parameters for sideband subtraction
12811331 initParametersFromCCDB (bc);
1282- if (casc.pt () < 0 . 2f || casc.pt () > 14 . 5f ) {
1332+ if (casc.pt () < minPtForParam || casc.pt () > maxPtForParam ) {
12831333 massNSigmaXi = (casc.mXi () - hXiMean->GetBinContent (hXiMean->FindBin (casc.pt ()))) / (hXiWidth->GetBinContent (hXiWidth->FindBin (casc.pt ())) + 1e-6 );
12841334 massNSigmaOmega = (casc.mOmega () - hOmegaMean->GetBinContent (hOmegaMean->FindBin (casc.pt ()))) / (hOmegaWidth->GetBinContent (hOmegaWidth->FindBin (casc.pt ())) + 1e-6 );
12851335 } else {
@@ -1294,13 +1344,13 @@ struct HStrangeCorrelationFilter {
12941344 bool trueOmegaMinus = false ;
12951345 bool trueOmegaPlus = false ;
12961346 cascPhysicalPrimary = casc.isPhysicalPrimary ();
1297- if (casc.pdgCode () == 3312 )
1347+ if (casc.pdgCode () == PDG_t:: kXiMinus )
12981348 trueXiMinus = true ;
1299- if (casc.pdgCode () == - 3312 )
1349+ if (casc.pdgCode () == PDG_t:: kXiPlusBar )
13001350 trueXiPlus = true ;
1301- if (casc.pdgCode () == 3334 )
1351+ if (casc.pdgCode () == PDG_t:: kOmegaMinus )
13021352 trueOmegaMinus = true ;
1303- if (casc.pdgCode () == - 3334 )
1353+ if (casc.pdgCode () == PDG_t:: kOmegaPlusBar )
13041354 trueOmegaPlus = true ;
13051355 if (compatibleXiMinus && (!doTrueSelectionInMass || (trueXiMinus && cascPhysicalPrimary)))
13061356 histos.fill (HIST (" h3dMassXiMinus" ), casc.pt (), casc.mXi (), cent);
0 commit comments