@@ -62,13 +62,25 @@ using namespace o2::soa;
6262
6363namespace
6464{
65- // static constexpr int NPart = 2;
66- // static constexpr int NCuts = 5;
6765const std::vector<std::string> partNames{" PhiCandidate" , " Track" };
6866const std::vector<std::string> cutNames{" MaxPt" , " PIDthr" , " nSigmaTPC" , " nSigmaTPCTOF" , " MaxP" };
69- // static const float cutsTable[NPart][NCuts]{ //unused variable
70- // {4.05f, 1.f, 3.f, 3.f, 100.f},
71- // {4.05f, 1.f, 3.f, 3.f, 100.f}};
67+
68+ // Constants for pT / momentum
69+ constexpr float kMomCutLow = 0 .5f ;
70+ constexpr float kMomCutKaonLow = 0 .3f ;
71+ constexpr float kMomCutKaonMid = 0 .45f ;
72+ constexpr float kMomCutKaonHigh = 0 .55f ;
73+ constexpr float kMomCutKaonMax = 1 .5f ;
74+
75+ // Constants for nSigma cuts
76+ constexpr float kNSigmaStrict = 1 .0f ;
77+ constexpr float kNSigmaMedium = 2 .0f ;
78+ constexpr float kNSigmaStandard = 3 .0f ;
79+
80+ // Helper constants and indices
81+ constexpr int kInvalidMCPartId = -1 ;
82+ constexpr int kPhiDaughterOffsetPos = 2 ;
83+ constexpr int kPhiDaughterOffsetNeg = 1 ;
7284} // namespace
7385
7486struct FemtoUniversePairTaskTrackPhi {
@@ -185,9 +197,9 @@ struct FemtoUniversePairTaskTrackPhi {
185197 ConfigurableAxis confBins3DmT{" confBins3DmT" , {VARIABLE_WIDTH , 1 .02f , 1 .14f , 1 .20f , 1 .26f , 1 .38f , 1 .56f , 1 .86f , 4 .50f }, " mT Binning for the 3Dimensional plot: k* vs multiplicity vs mT (set <<confUse3D>> to true in order to use)" };
186198 ConfigurableAxis confBins3Dmult{" confBins3Dmult" , {VARIABLE_WIDTH , 0 .0f , 20 .0f , 30 .0f , 40 .0f , 99999 .0f }, " multiplicity Binning for the 3Dimensional plot: k* vs multiplicity vs mT (set <<confUse3D>> to true in order to use)" };
187199
188- ConfigurableAxis ConfBinskstar{ " ConfBinskstar " , {1500 , 0 ., 6 .}, " binning kstar" };
189- ConfigurableAxis ConfBinskT{ " ConfBinskT " , {150 , 0 ., 9 .}, " binning kT" };
190- ConfigurableAxis ConfBinsmT{ " ConfBinsmT " , {225 , 0 ., 7.5 }, " binning mT" };
200+ ConfigurableAxis confBinskstar{ " confBinskstar " , {1500 , 0 ., 6 .}, " binning kstar" };
201+ ConfigurableAxis confBinskT{ " confBinskT " , {150 , 0 ., 9 .}, " binning kT" };
202+ ConfigurableAxis confBinsmT{ " confBinsmT " , {225 , 0 ., 7.5 }, " binning mT" };
191203
192204 FemtoUniverseContainer<femto_universe_container::EventType::same, femto_universe_container::Observable::kstar> sameEventCont;
193205 FemtoUniverseContainer<femto_universe_container::EventType::mixed, femto_universe_container::Observable::kstar> mixedEventCont;
@@ -212,7 +224,7 @@ struct FemtoUniversePairTaskTrackPhi {
212224 EffCorConfigurableGroup effCorConfGroup;
213225 EfficiencyCorrection effCorrection{&effCorConfGroup};
214226
215- float weight = 1 ;
227+ float mWeight = 1 . 0f ;
216228
217229 // PID for protons
218230 bool isProtonNSigma (float mom, float nsigmaTPCPr, float nsigmaTOFPr) // previous version from: https://github.com/alisw/AliPhysics/blob/master/PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoMJTrackCut.cxx
@@ -226,7 +238,7 @@ struct FemtoUniversePairTaskTrackPhi {
226238
227239 bool isProtonRejected (float mom, float nsigmaTPCPi, float nsigmaTOFPi, float nsigmaTPCK, float nsigmaTOFK)
228240 {
229- if (mom < 0.5 ) {
241+ if (mom < kMomCutLow ) {
230242 return true ;
231243 } else {
232244 return std::hypot (nsigmaTOFPi, nsigmaTPCPi) < confPIDPionNsigmaReject || std::hypot (nsigmaTOFK, nsigmaTPCK) < confPIDKaonNsigmaReject;
@@ -236,10 +248,10 @@ struct FemtoUniversePairTaskTrackPhi {
236248 bool isKaonNSigma (float mom, bool hasTOF, float nsigmaTPCK, float nsigmaTOFK)
237249 {
238250 if (confTrackUseRun3PIDforKaons) {
239- if (mom < 0.5 ) {
251+ if (mom < kMomCutLow ) {
240252 return std::abs (nsigmaTPCK) < 3.0 ;
241253 }
242- if (mom >= 0.5 ) {
254+ if (mom >= kMomCutLow ) {
243255 if (hasTOF) { // if TOF is available, use combine nsigma
244256 return std::hypot (nsigmaTOFK, nsigmaTPCK) < 3.0 ;
245257 } else // if TOF is not available, use TPC nsigma only
@@ -248,19 +260,19 @@ struct FemtoUniversePairTaskTrackPhi {
248260 }
249261 }
250262 } else {
251- if (mom < 0.3 ) { // 0.0-0.3
263+ if (mom < kMomCutKaonLow ) { // 0.0-0.3
252264 return std::abs (nsigmaTPCK) < 3.0 ;
253265 }
254- if (mom < 0.45 ) { // 0.30 - 0.45
266+ if (mom < kMomCutKaonMid ) { // 0.30 - 0.45
255267 return std::abs (nsigmaTPCK) < 2.0 ;
256268 }
257- if (mom < 0.55 ) { // 0.45-0.55
269+ if (mom < kMomCutKaonHigh ) { // 0.45-0.55
258270 return std::abs (nsigmaTPCK) < 1.0 ;
259271 }
260- if (mom < 1.5 ) { // 0.55-1.5 (now we use TPC and TOF)
272+ if (mom < kMomCutKaonMax ) { // 0.55-1.5 (now we use TPC and TOF)
261273 return std::hypot (nsigmaTOFK, nsigmaTPCK) < 3.0 ;
262274 }
263- if (mom > 1.5 ) { // 1.5 -
275+ if (mom > kMomCutKaonMax ) { // 1.5 -
264276 return (std::abs (nsigmaTOFK) < 2.0 ) && (std::abs (nsigmaTPCK) < 3.0 );
265277 }
266278 return false ;
@@ -432,8 +444,8 @@ struct FemtoUniversePairTaskTrackPhi {
432444 mixQaRegistry.add (" MixingQA/hSECollisionBins" , " ;bin;Entries" , kTH1F , {{120 , -0.5 , 119.5 }});
433445 mixQaRegistry.add (" MixingQA/hMECollisionBins" , " ;bin;Entries" , kTH1F , {{120 , -0.5 , 119.5 }});
434446
435- sameEventCont.init (&resultRegistry, ConfBinskstar , confBinsMult, ConfBinskT, ConfBinsmT , confBins3Dmult, confBins3DmT, confBinsEta, confBinsPhi, confIsMC, confUse3D);
436- mixedEventCont.init (&resultRegistry, ConfBinskstar , confBinsMult, ConfBinskT, ConfBinsmT , confBins3Dmult, confBins3DmT, confBinsEta, confBinsPhi, confIsMC, confUse3D);
447+ sameEventCont.init (&resultRegistry, confBinskstar , confBinsMult, confBinskT, confBinsmT , confBins3Dmult, confBins3DmT, confBinsEta, confBinsPhi, confIsMC, confUse3D);
448+ mixedEventCont.init (&resultRegistry, confBinskstar , confBinsMult, confBinskT, confBinsmT , confBins3Dmult, confBins3DmT, confBinsEta, confBinsPhi, confIsMC, confUse3D);
437449
438450 sameEventCont.setPDGCodes (333 , confTrackPDGCode);
439451 mixedEventCont.setPDGCodes (333 , confTrackPDGCode);
@@ -449,7 +461,7 @@ struct FemtoUniversePairTaskTrackPhi {
449461 {
450462 for (auto const & phicandidate : groupPartsPhi) {
451463 // TODO: add phi meson minv cut here
452- const auto & posChild = parts.iteratorAt (phicandidate.index () - 2 );
464+ const auto & posChild = parts.iteratorAt (phicandidate.index () - kPhiDaughterOffsetPos );
453465 float tpcNSigmaKp = trackCuts.getNsigmaTPC (posChild, o2::track::PID ::Kaon);
454466 float tofNSigmaKp = trackCuts.getNsigmaTOF (posChild, o2::track::PID ::Kaon);
455467 qaRegistry.fill (HIST (" PhiDaugh_pos/nSigmaTPC" ), posChild.p (), tpcNSigmaKp);
@@ -459,7 +471,7 @@ struct FemtoUniversePairTaskTrackPhi {
459471 qaRegistry.fill (HIST (" PhiDaugh_pos/eta" ), posChild.eta ());
460472 qaRegistry.fill (HIST (" PhiDaugh_pos/phi" ), posChild.phi ());
461473
462- const auto & negChild = parts.iteratorAt (phicandidate.index () - 1 );
474+ const auto & negChild = parts.iteratorAt (phicandidate.index () - kPhiDaughterOffsetNeg );
463475 float tpcNSigmaKm = trackCuts.getNsigmaTPC (negChild, o2::track::PID ::Kaon);
464476 float tofNSigmaKm = trackCuts.getNsigmaTOF (negChild, o2::track::PID ::Kaon);
465477 qaRegistry.fill (HIST (" PhiDaugh_neg/nSigmaTPC" ), negChild.p (), tpcNSigmaKm);
@@ -541,8 +553,8 @@ struct FemtoUniversePairTaskTrackPhi {
541553 if (!pairCleaner.isCleanPair (track, phicandidate, parts)) {
542554 continue ;
543555 }
544- weight = effCorrection.getWeight <FilteredFDCollisions>(ParticleNo::ONE , phicandidate) * effCorrection.getWeight <FilteredFDCollisions>(ParticleNo::TWO , track);
545- sameEventCont.setPair <isMC>(track, phicandidate, multCol, confUse3D, weight );
556+ mWeight = effCorrection.getWeight <FilteredFDCollisions>(ParticleNo::ONE , phicandidate) * effCorrection.getWeight <FilteredFDCollisions>(ParticleNo::TWO , track);
557+ sameEventCont.setPair <isMC>(track, phicandidate, multCol, confUse3D, mWeight );
546558 }
547559
548560 // // Used for better fitting of invariant mass background.
@@ -592,8 +604,8 @@ struct FemtoUniversePairTaskTrackPhi {
592604 continue ;
593605 }
594606 }
595- weight = effCorrection.getWeight <FilteredFDCollisions>(ParticleNo::ONE , phicandidate) * effCorrection.getWeight <FilteredFDCollisions>(ParticleNo::TWO , track);
596- mixedEventCont.setPair <isMC>(track, phicandidate, multCol, confUse3D, weight );
607+ mWeight = effCorrection.getWeight <FilteredFDCollisions>(ParticleNo::ONE , phicandidate) * effCorrection.getWeight <FilteredFDCollisions>(ParticleNo::TWO , track);
608+ mixedEventCont.setPair <isMC>(track, phicandidate, multCol, confUse3D, mWeight );
597609 }
598610 }
599611
@@ -722,7 +734,7 @@ struct FemtoUniversePairTaskTrackPhi {
722734 {
723735 for (auto const & part : parts) {
724736 auto mcPartId = part.fdMCParticleId ();
725- if (mcPartId == - 1 )
737+ if (mcPartId == kInvalidMCPartId )
726738 continue ; // no MC particle
727739 const auto & mcpart = mcparts.iteratorAt (mcPartId);
728740
0 commit comments