2020// oussama.benchikhi@cern.ch
2121//
2222
23- #include " PWGLF/DataModel/LFSigmaTables.h"
2423#include " PWGLF/DataModel/LFStrangenessMLTables.h"
2524#include " PWGLF/DataModel/LFStrangenessPIDTables.h"
2625#include " PWGLF/DataModel/LFStrangenessTables.h"
2726
2827#include " Common/CCDB/EventSelectionParams.h"
2928#include " Common/CCDB/ctpRateFetcher.h"
3029#include " Common/Core/RecoDecay.h"
30+ #include " Common/DataModel/Centrality.h"
3131
3232#include < CCDB/BasicCCDBManager.h>
3333#include < CommonConstants/MathConstants.h>
4242#include < Framework/InitContext.h>
4343#include < Framework/OutputObjHeader.h>
4444#include < Framework/runDataProcessing.h>
45+ #include " Framework/BinningPolicy.h"
4546
46- #include < Math/Vector3D.h>
4747#include < Math/Vector4D.h>
4848#include < TH1.h>
49- #include < TMath.h>
5049#include < TRandom3.h>
5150
5251#include < array>
5352#include < cmath>
5453#include < cstdint>
5554#include < string>
5655#include < vector>
56+ #include < cstddef>
5757
5858using namespace o2 ;
5959using namespace o2 ::framework;
@@ -127,7 +127,7 @@ struct k892hadronphotonBkg {
127127 // // Photon criteria:
128128 struct : ConfigurableGroup {
129129 std::string prefix = " photonSelections" ; // JSON group name
130- Configurable<float > gamma_MLThreshold{ " gamma_MLThreshold " , 0.1 , " Decision Threshold value to select gammas" };
130+ Configurable<float > gammaMLThreshold{ " gammaMLThreshold " , 0.1 , " Decision Threshold value to select gammas" };
131131 Configurable<int > photonv0TypeSel{" photonv0TypeSel" , 7 , " select on a certain V0 type (leave negative if no selection desired)" };
132132 Configurable<float > photonMinDCADauToPv{" photonMinDCADauToPv" , 0.0 , " Min DCA daughter To PV (cm)" };
133133 Configurable<float > photonMaxDCAV0Dau{" photonMaxDCAV0Dau" , 3.5 , " Max DCA V0 Daughters (cm)" };
@@ -155,7 +155,7 @@ struct k892hadronphotonBkg {
155155 // KShort criteria:
156156 struct : ConfigurableGroup {
157157 std::string prefix = " kshortSelections" ; // JSON group name
158- Configurable<float > kshort_MLThreshold{ " kshort_MLThreshold " , 0.1 , " Decision Threshold value to select kshorts" };
158+ Configurable<float > kshortMLThreshold{ " kshortMLThreshold " , 0.1 , " Decision Threshold value to select kshorts" };
159159 Configurable<float > kshortMinDCANegToPv{" kshortMinDCANegToPv" , .05 , " min DCA Neg To PV (cm)" };
160160 Configurable<float > kshortMinDCAPosToPv{" kshortMinDCAPosToPv" , .05 , " min DCA Pos To PV (cm)" };
161161 Configurable<float > kshortMaxDCAV0Dau{" kshortMaxDCAV0Dau" , 2.5 , " Max DCA V0 Daughters (cm)" };
@@ -249,7 +249,7 @@ struct k892hadronphotonBkg {
249249 // _______________________________________________
250250 // Event selection (identical to the builder)
251251 template <typename TCollision>
252- bool IsEventAccepted (TCollision const & collision, bool fillHists)
252+ bool isEventAccepted (TCollision const & collision, bool fillHists)
253253 {
254254 if (fillHists)
255255 histos.fill (HIST (" hEventSelection" ), 0 . /* all collisions */ );
@@ -393,10 +393,10 @@ struct k892hadronphotonBkg {
393393 if (gamma.v0Type () != photonSelections.photonv0TypeSel && photonSelections.photonv0TypeSel > -1 )
394394 return false ;
395395
396- float PhotonY = RecoDecay::y (std::array{gamma.px (), gamma.py (), gamma.pz ()}, o2::constants::physics::MassGamma);
396+ float photonY = RecoDecay::y (std::array{gamma.px (), gamma.py (), gamma.pz ()}, o2::constants::physics::MassGamma);
397397
398398 if (useMLScores) {
399- if (gamma.gammaBDTScore () <= photonSelections.gamma_MLThreshold )
399+ if (gamma.gammaBDTScore () <= photonSelections.gammaMLThreshold )
400400 return false ;
401401
402402 } else {
@@ -405,7 +405,7 @@ struct k892hadronphotonBkg {
405405 if ((gamma.mGamma () < 0 ) || (gamma.mGamma () > photonSelections.photonMaxMass ))
406406 return false ;
407407
408- if ((PhotonY < photonSelections.photonMinRapidity ) || (PhotonY > photonSelections.photonMaxRapidity ))
408+ if ((photonY < photonSelections.photonMinRapidity ) || (photonY > photonSelections.photonMaxRapidity ))
409409 return false ;
410410
411411 if (gamma.negativeeta () < photonSelections.photonDauEtaMin || gamma.negativeeta () > photonSelections.photonDauEtaMax )
@@ -429,8 +429,8 @@ struct k892hadronphotonBkg {
429429 if (gamma.v0cosPA () < photonSelections.photonMinV0cospa )
430430 return false ;
431431
432- float PhotonPhi = RecoDecay::phi (gamma.px (), gamma.py ());
433- 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 )))
432+ float photonPhi = RecoDecay::phi (gamma.px (), gamma.py ());
433+ 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 )))
434434 return false ;
435435
436436 if (gamma.qtarm () > photonSelections.photonMaxQt )
@@ -465,7 +465,7 @@ struct k892hadronphotonBkg {
465465 return false ;
466466
467467 if (useMLScores) {
468- // if (kshort.k0ShortBDTScore() <= kshortSelections.KShort_MLThreshold )
468+ // if (kshort.k0ShortBDTScore() <= kshortSelections.kshortMLThreshold )
469469 return false ;
470470
471471 } else {
@@ -600,7 +600,7 @@ struct k892hadronphotonBkg {
600600 // ── Pass 1: populate pools using single-particle selections ──
601601 for (const auto & coll : collisions) {
602602
603- if (eventSelections.fUseEventSelection && !IsEventAccepted (coll, true ))
603+ if (eventSelections.fUseEventSelection && !isEventAccepted (coll, true ))
604604 continue ;
605605
606606 for (size_t i = 0 ; i < v0grouped[coll.globalIndex ()].size (); i++) {
@@ -654,7 +654,7 @@ struct k892hadronphotonBkg {
654654 for (int kIdx : kshorts1) {
655655 auto kshort = fullV0s.rawIteratorAt (kIdx );
656656 float kP = std::hypot (kshort.px (), kshort.py (), kshort.pz ());
657- ROOT ::Math::PxPyPzEVector FourMomKShort (
657+ ROOT ::Math::PxPyPzEVector fourMomKShort (
658658 kshort.px (), kshort.py (), kshort.pz (),
659659 std::sqrt (kP * kP +
660660 o2::constants::physics::MassK0Short *
@@ -663,23 +663,23 @@ struct k892hadronphotonBkg {
663663 for (int pIdx : photons2) {
664664 auto photon = fullV0s.rawIteratorAt (pIdx);
665665 float pP = std::hypot (photon.px (), photon.py (), photon.pz ());
666- ROOT ::Math::PxPyPzEVector FourMomPhoton (
666+ ROOT ::Math::PxPyPzEVector fourMomPhoton (
667667 photon.px (), photon.py (), photon.pz (), pP);
668668
669- auto FourMomKStar = FourMomPhoton + FourMomKShort ;
669+ auto fourMomKStar = fourMomPhoton + fourMomKShort ;
670670
671- double cosOA = FourMomPhoton .Vect ().Dot (FourMomKShort .Vect ()) /
672- (FourMomPhoton .P () * FourMomKShort .P ());
671+ double cosOA = fourMomPhoton .Vect ().Dot (fourMomKShort .Vect ()) /
672+ (fourMomPhoton .P () * fourMomKShort .P ());
673673 double openAngle = std::acos (cosOA);
674- float mass = FourMomKStar .M ();
675- float pt = FourMomKStar .Pt ();
674+ float mass = fourMomKStar .M ();
675+ float pt = fourMomKStar .Pt ();
676676 // Rapidity computed under the K*(892) mass hypothesis (NOT the actual pair
677677 // invariant mass) to match the same-event rotational background and the
678678 // buildKStar signal selection, so the rapidity acceptance is identical for
679679 // signal and all backgrounds.
680- float rapidity = RecoDecay::y (std::array{static_cast <float >(FourMomKStar .Px ()),
681- static_cast <float >(FourMomKStar .Py ()),
682- static_cast <float >(FourMomKStar .Pz ())},
680+ float rapidity = RecoDecay::y (std::array{static_cast <float >(fourMomKStar .Px ()),
681+ static_cast <float >(fourMomKStar .Py ()),
682+ static_cast <float >(fourMomKStar .Pz ())},
683683 o2::constants::physics::MassK0Star892);
684684
685685 if (openAngle > kstarBkgConfig.kstarMaxOPAngle )
@@ -701,32 +701,32 @@ struct k892hadronphotonBkg {
701701 for (int pIdx : photons1) {
702702 auto photon = fullV0s.rawIteratorAt (pIdx);
703703 float pP = std::hypot (photon.px (), photon.py (), photon.pz ());
704- ROOT ::Math::PxPyPzEVector FourMomPhoton (
704+ ROOT ::Math::PxPyPzEVector fourMomPhoton (
705705 photon.px (), photon.py (), photon.pz (), pP);
706706
707707 for (int kIdx : kshorts2) {
708708 auto kshort = fullV0s.rawIteratorAt (kIdx );
709709 float kP = std::hypot (kshort.px (), kshort.py (), kshort.pz ());
710- ROOT ::Math::PxPyPzEVector FourMomKShort (
710+ ROOT ::Math::PxPyPzEVector fourMomKShort (
711711 kshort.px (), kshort.py (), kshort.pz (),
712712 std::sqrt (kP * kP +
713713 o2::constants::physics::MassK0Short *
714714 o2::constants::physics::MassK0Short));
715715
716- auto FourMomKStar = FourMomPhoton + FourMomKShort ;
716+ auto fourMomKStar = fourMomPhoton + fourMomKShort ;
717717
718- double cosOA = FourMomPhoton .Vect ().Dot (FourMomKShort .Vect ()) /
719- (FourMomPhoton .P () * FourMomKShort .P ());
718+ double cosOA = fourMomPhoton .Vect ().Dot (fourMomKShort .Vect ()) /
719+ (fourMomPhoton .P () * fourMomKShort .P ());
720720 double openAngle = std::acos (cosOA);
721- float mass = FourMomKStar .M ();
722- float pt = FourMomKStar .Pt ();
721+ float mass = fourMomKStar .M ();
722+ float pt = fourMomKStar .Pt ();
723723 // Rapidity computed under the K*(892) mass hypothesis (NOT the actual pair
724724 // invariant mass) to match the same-event rotational background and the
725725 // buildKStar signal selection, so the rapidity acceptance is identical for
726726 // signal and all backgrounds.
727- float rapidity = RecoDecay::y (std::array{static_cast <float >(FourMomKStar .Px ()),
728- static_cast <float >(FourMomKStar .Py ()),
729- static_cast <float >(FourMomKStar .Pz ())},
727+ float rapidity = RecoDecay::y (std::array{static_cast <float >(fourMomKStar .Px ()),
728+ static_cast <float >(fourMomKStar .Py ()),
729+ static_cast <float >(fourMomKStar .Pz ())},
730730 o2::constants::physics::MassK0Star892);
731731
732732 if (openAngle > kstarBkgConfig.kstarMaxOPAngle )
0 commit comments