@@ -62,6 +62,13 @@ using std::array;
6262using dauTracks = soa::Join<aod::DauTrackExtras, aod::DauTrackTPCPIDs>;
6363using V0StandardDerivedDatas = soa::Join<aod::V0Cores, aod::V0CollRefs, aod::V0Extras, aod::V0LambdaMLScores, aod::V0AntiLambdaMLScores, aod::V0GammaMLScores>;
6464
65+ static const std::vector<std::string> photonSels = {" No Sel" , " Mass" , " Y" , " Neg Eta" , " Pos Eta" ,
66+ " DCAToPV" , " DCADau" , " Radius" , " Z" , " CosPA" ,
67+ " Phi" , " Qt" , " Alpha" , " TPCCR" , " TPC NSigma" };
68+ static const std::vector<std::string> kshortSels = {" No Sel" , " Mass" , " Y" , " Neg Eta" , " Pos Eta" ,
69+ " DCAToPV" , " Radius" , " Z" , " DCADau" , " Armenteros" ,
70+ " CosPA" , " TPCCR" , " ITSNCls" , " Lifetime" , " TPC NSigma" };
71+
6572struct k892hadronphotonBkg {
6673 Service<o2::ccdb::BasicCCDBManager> ccdb;
6774 ctpRateFetcher rateFetcher;
@@ -175,6 +182,7 @@ struct k892hadronphotonBkg {
175182 Configurable<bool > kshortRejectPosITSafterburner{" kshortRejectPosITSafterburner" , false , " reject positive track formed out of afterburner ITS tracks" };
176183 Configurable<bool > kshortRejectNegITSafterburner{" kshortRejectNegITSafterburner" , false , " reject negative track formed out of afterburner ITS tracks" };
177184 Configurable<float > kshortArmenterosCoefficient{" kshortArmenterosCoefficient" , 0.2 , " Armenteros-Podolanski coefficient to reject lambdas" };
185+ Configurable<float > kshortMaxTPCNSigmas{" kshortMaxTPCNSigmas" , 1e+9 , " Max |TPC NSigma| (pion hypothesis) for K0S daughters" };
178186 } kshortSelections;
179187
180188 struct : ConfigurableGroup {
@@ -184,6 +192,7 @@ struct k892hadronphotonBkg {
184192 ConfigurableAxis axisCentrality{" axisCentrality" , {VARIABLE_WIDTH , 0 .0f , 5 .0f , 10 .0f , 20 .0f , 30 .0f , 40 .0f , 50 .0f , 60 .0f , 70 .0f , 80 .0f , 90 .0f , 100 .0f , 110 .0f }, " Centrality" };
185193 ConfigurableAxis axisKStarMass{" axisKStarMass" , {500 , 0 .6f , 1 .6f }, " M_{K^{*}} (GeV/c^{2})" };
186194 ConfigurableAxis axisIRBinning{" axisIRBinning" , {151 , -10 , 1500 }, " Binning for the interaction rate (kHz)" };
195+ ConfigurableAxis axisCandSel{" axisCandSel" , {15 , 0 .5f , +15 .5f }, " Candidate Selection" };
187196 } axisConfig;
188197
189198 void init (InitContext const &)
@@ -230,6 +239,15 @@ struct k892hadronphotonBkg {
230239 }
231240 }
232241
242+ // Single-particle selection
243+ histos.add (" PhotonSel/hSelectionStatistics" , " hSelectionStatistics" , kTH1D , {axisConfig.axisCandSel });
244+ for (size_t i = 0 ; i < photonSels.size (); ++i)
245+ histos.get <TH1 >(HIST (" PhotonSel/hSelectionStatistics" ))->GetXaxis ()->SetBinLabel (i + 1 , photonSels[i].c_str ());
246+
247+ histos.add (" KShortSel/hSelectionStatistics" , " hSelectionStatistics" , kTH1D , {axisConfig.axisCandSel });
248+ for (size_t i = 0 ; i < kshortSels.size (); ++i)
249+ histos.get <TH1 >(HIST (" KShortSel/hSelectionStatistics" ))->GetXaxis ()->SetBinLabel (i + 1 , kshortSels[i].c_str ());
250+
233251 if (kstarBkgConfig.doSameEvtRotation || kstarBkgConfig.doEvtMixing ) {
234252 histos.add (" KStarBkg/hDeltaCollision" , " hDeltaCollision" , kTH1D , {{2000 , -1000 .f , 1000 .f }});
235253 histos.add (" KStarBkg/h2dCentralityCollPair" , " h2dCentralityCollPair" , kTH2D , {axisConfig.axisCentrality , axisConfig.axisCentrality });
@@ -385,7 +403,7 @@ struct k892hadronphotonBkg {
385403 }
386404
387405 // _______________________________________________
388- // Process v0 photon candidate (data only, no QA fills)
406+ // Process v0 photon candidate
389407 template <typename TV0Object>
390408 bool processPhotonCandidate (TV0Object const & gamma)
391409 {
@@ -402,61 +420,77 @@ struct k892hadronphotonBkg {
402420 } else {
403421 // Standard selection
404422 // Gamma basic selection criteria:
423+ histos.fill (HIST (" PhotonSel/hSelectionStatistics" ), 1 .);
405424 if ((gamma.mGamma () < 0 ) || (gamma.mGamma () > photonSelections.photonMaxMass ))
406425 return false ;
407426
427+ histos.fill (HIST (" PhotonSel/hSelectionStatistics" ), 2 .);
408428 if ((photonY < photonSelections.photonMinRapidity ) || (photonY > photonSelections.photonMaxRapidity ))
409429 return false ;
410430
431+ histos.fill (HIST (" PhotonSel/hSelectionStatistics" ), 3 .);
411432 if (gamma.negativeeta () < photonSelections.photonDauEtaMin || gamma.negativeeta () > photonSelections.photonDauEtaMax )
412433 return false ;
413434
435+ histos.fill (HIST (" PhotonSel/hSelectionStatistics" ), 4 .);
414436 if (gamma.positiveeta () < photonSelections.photonDauEtaMin || gamma.positiveeta () > photonSelections.photonDauEtaMax )
415437 return false ;
416438
439+ histos.fill (HIST (" PhotonSel/hSelectionStatistics" ), 5 .);
417440 if ((TMath::Abs (gamma.dcapostopv ()) < photonSelections.photonMinDCADauToPv ) || (TMath::Abs (gamma.dcanegtopv ()) < photonSelections.photonMinDCADauToPv ))
418441 return false ;
419442
443+ histos.fill (HIST (" PhotonSel/hSelectionStatistics" ), 6 .);
420444 if (TMath::Abs (gamma.dcaV0daughters ()) > photonSelections.photonMaxDCAV0Dau )
421445 return false ;
422446
447+ histos.fill (HIST (" PhotonSel/hSelectionStatistics" ), 7 .);
423448 if ((gamma.v0radius () < photonSelections.photonMinRadius ) || (gamma.v0radius () > photonSelections.photonMaxRadius ))
424449 return false ;
425450
451+ histos.fill (HIST (" PhotonSel/hSelectionStatistics" ), 8 .);
426452 if ((gamma.z () < photonSelections.photonMinZ ) || (gamma.z () > photonSelections.photonMaxZ ))
427453 return false ;
428454
455+ histos.fill (HIST (" PhotonSel/hSelectionStatistics" ), 9 .);
429456 if (gamma.v0cosPA () < photonSelections.photonMinV0cospa )
430457 return false ;
431458
459+ histos.fill (HIST (" PhotonSel/hSelectionStatistics" ), 10 .);
432460 float photonPhi = RecoDecay::phi (gamma.px (), gamma.py ());
433461 if ((((photonPhi > photonSelections.photonPhiMin1 ) && (photonPhi < photonSelections.photonPhiMax1 )) || ((photonPhi > photonSelections.photonPhiMin2 ) && (photonPhi < photonSelections.photonPhiMax2 ))) && ((photonSelections.photonPhiMin1 != -1 ) && (photonSelections.photonPhiMax1 != -1 ) && (photonSelections.photonPhiMin2 != -1 ) && (photonSelections.photonPhiMax2 != -1 )))
434462 return false ;
435463
464+ histos.fill (HIST (" PhotonSel/hSelectionStatistics" ), 11 .);
436465 if (gamma.qtarm () > photonSelections.photonMaxQt )
437466 return false ;
438467
468+ histos.fill (HIST (" PhotonSel/hSelectionStatistics" ), 12 .);
439469 if (TMath::Abs (gamma.alpha ()) > photonSelections.photonMaxAlpha )
440470 return false ;
441471
442472 auto posTrackGamma = gamma.template posTrackExtra_as <dauTracks>();
443473 auto negTrackGamma = gamma.template negTrackExtra_as <dauTracks>();
444474
475+ histos.fill (HIST (" PhotonSel/hSelectionStatistics" ), 13 .);
445476 if ((posTrackGamma.tpcCrossedRows () < photonSelections.photonMinTPCCrossedRows ) || (negTrackGamma.tpcCrossedRows () < photonSelections.photonMinTPCCrossedRows ))
446477 return false ;
447478
479+ histos.fill (HIST (" PhotonSel/hSelectionStatistics" ), 14 .);
448480 if (((posTrackGamma.tpcNSigmaEl () < photonSelections.photonMinTPCNSigmas ) || (posTrackGamma.tpcNSigmaEl () > photonSelections.photonMaxTPCNSigmas )))
449481 return false ;
450482
451483 if (((negTrackGamma.tpcNSigmaEl () < photonSelections.photonMinTPCNSigmas ) || (negTrackGamma.tpcNSigmaEl () > photonSelections.photonMaxTPCNSigmas )))
452484 return false ;
485+
486+ histos.fill (HIST (" PhotonSel/hSelectionStatistics" ), 15 .);
453487 }
454488
455489 return true ;
456490 }
457491
458492 // _______________________________________________
459- // Process K0Short candidate (data only, no QA fills)
493+ // Process K0Short candidate
460494 template <typename TV0Object, typename TCollision>
461495 bool processKShortCandidate (TV0Object const & kshort, TCollision const & collision)
462496 {
@@ -470,54 +504,75 @@ struct k892hadronphotonBkg {
470504
471505 } else {
472506 // KShort basic selection criteria:
507+ histos.fill (HIST (" KShortSel/hSelectionStatistics" ), 1 .);
473508 if ((TMath::Abs (kshort.mK0Short () - o2::constants::physics::MassK0Short) > kshortSelections.kshortWindow ) && kshortSelections.kshortWindow > 0 )
474509 return false ;
475510
511+ histos.fill (HIST (" KShortSel/hSelectionStatistics" ), 2 .);
476512 if ((kshort.yK0Short () < kshortSelections.kshortMinRapidity ) || (kshort.yK0Short () > kshortSelections.kshortMaxRapidity ))
477513 return false ;
478514
515+ histos.fill (HIST (" KShortSel/hSelectionStatistics" ), 3 .);
479516 if ((kshort.negativeeta () < kshortSelections.kshortDauEtaMin ) || (kshort.negativeeta () > kshortSelections.kshortDauEtaMax ))
480517 return false ;
481518
519+ histos.fill (HIST (" KShortSel/hSelectionStatistics" ), 4 .);
482520 if ((kshort.positiveeta () < kshortSelections.kshortDauEtaMin ) || (kshort.positiveeta () > kshortSelections.kshortDauEtaMax ))
483521 return false ;
484522
523+ histos.fill (HIST (" KShortSel/hSelectionStatistics" ), 5 .);
485524 if ((TMath::Abs (kshort.dcapostopv ()) < kshortSelections.kshortMinDCAPosToPv ) || (TMath::Abs (kshort.dcanegtopv ()) < kshortSelections.kshortMinDCANegToPv ))
486525 return false ;
487526
527+ histos.fill (HIST (" KShortSel/hSelectionStatistics" ), 6 .);
488528 if ((kshort.v0radius () < kshortSelections.kshortMinv0radius ) || (kshort.v0radius () > kshortSelections.kshortMaxv0radius ))
489529 return false ;
490530
531+ histos.fill (HIST (" KShortSel/hSelectionStatistics" ), 7 .);
491532 if ((kshort.z () < kshortSelections.kshortMinZ ) || (kshort.z () > kshortSelections.kshortMaxZ ))
492533 return false ;
493534
535+ histos.fill (HIST (" KShortSel/hSelectionStatistics" ), 8 .);
494536 if (TMath::Abs (kshort.dcaV0daughters ()) > kshortSelections.kshortMaxDCAV0Dau )
495537 return false ;
496538
539+ histos.fill (HIST (" KShortSel/hSelectionStatistics" ), 9 .);
497540 if (kshort.qtarm () < kshortSelections.kshortArmenterosCoefficient * TMath::Abs (kshort.alpha ()))
498541 return false ;
499542
543+ histos.fill (HIST (" KShortSel/hSelectionStatistics" ), 10 .);
500544 if (kshort.v0cosPA () < kshortSelections.kshortMinv0cospa )
501545 return false ;
502546
503547 auto posTrackKShort = kshort.template posTrackExtra_as <dauTracks>();
504548 auto negTrackKShort = kshort.template negTrackExtra_as <dauTracks>();
505549
550+ histos.fill (HIST (" KShortSel/hSelectionStatistics" ), 11 .);
506551 if ((posTrackKShort.tpcCrossedRows () < kshortSelections.kshortMinTPCCrossedRows ) || (negTrackKShort.tpcCrossedRows () < kshortSelections.kshortMinTPCCrossedRows ))
507552 return false ;
508553
509554 // MinITSCls
510555 bool posIsFromAfterburner = posTrackKShort.itsChi2PerNcl () < 0 ;
511556 bool negIsFromAfterburner = negTrackKShort.itsChi2PerNcl () < 0 ;
512557
558+ histos.fill (HIST (" KShortSel/hSelectionStatistics" ), 12 .);
513559 if (posTrackKShort.itsNCls () < kshortSelections.kshortMinITSclusters && (!kshortSelections.kshortRejectPosITSafterburner || posIsFromAfterburner))
514560 return false ;
515561 if (negTrackKShort.itsNCls () < kshortSelections.kshortMinITSclusters && (!kshortSelections.kshortRejectNegITSafterburner || negIsFromAfterburner))
516562 return false ;
517563
564+ histos.fill (HIST (" KShortSel/hSelectionStatistics" ), 13 .);
518565 float fKShortLifeTime = kshort.distovertotmom (collision.posX (), collision.posY (), collision.posZ ()) * o2::constants::physics::MassK0Short;
519566 if (fKShortLifeTime > kshortSelections.kshortMaxLifeTime )
520567 return false ;
568+
569+ histos.fill (HIST (" KShortSel/hSelectionStatistics" ), 14 .);
570+ // TPC PID selection on the K0S pion daughters (same convention as posTrackKShort.tpcNSigmaPi())
571+ if (((TMath::Abs (posTrackKShort.tpcNSigmaPi ()) > kshortSelections.kshortMaxTPCNSigmas ) ||
572+ (TMath::Abs (negTrackKShort.tpcNSigmaPi ()) > kshortSelections.kshortMaxTPCNSigmas )))
573+ return false ;
574+
575+ histos.fill (HIST (" KShortSel/hSelectionStatistics" ), 15 .);
521576 }
522577 return true ;
523578 }
0 commit comments