1515// / \author Samrangy Sadhu <samrangy.sadhu@cern.ch>, INFN Bari
1616// / \author Swapnesh Santosh Khade <swapnesh.santosh.khade@cern.ch>, IIT Indore
1717
18+ #include " Framework/AnalysisTask.h"
19+ #include " Framework/HistogramRegistry.h"
20+ #include " Framework/runDataProcessing.h"
21+
1822#include " Common/Core/TrackSelection.h"
1923#include " Common/DataModel/TrackSelectionTables.h"
2024#include " Common/DataModel/Centrality.h"
2125#include " Common/DataModel/Multiplicity.h"
22- #include " Framework/AnalysisTask.h"
23- #include " Framework/HistogramRegistry.h"
24- #include " Framework/runDataProcessing.h"
26+
2527#include " PWGHF/DataModel/CandidateReconstructionTables.h"
2628#include " PWGHF/DataModel/CandidateSelectionTables.h"
2729
@@ -75,7 +77,7 @@ BinningType corrBinning{{zBins, multBins}, true};
7577struct HfD0Selection {
7678 SliceCache cache;
7779 Preslice<aod::HfCand2Prong> perCol = aod::hf_cand::collisionId;
78-
80+
7981 Produces<aod::DmesonSelection> d0Sel;
8082 Configurable<int > selectionFlagD0{" selectionFlagD0" , 1 , " Selection Flag for D0" };
8183 Configurable<int > selectionFlagD0bar{" selectionFlagD0bar" , 1 , " Selection Flag for D0bar" };
@@ -114,7 +116,7 @@ struct HfD0Selection {
114116 // check decay channel flag for candidate1
115117 if (!(candidate1.hfflag () & 1 << DecayType::D0ToPiK)) {
116118 continue ;
117- }
119+ }
118120 if (yCandMax >= 0 . && std::abs (yD0 (candidate1)) > yCandMax) {
119121 continue ;
120122 }
@@ -206,7 +208,7 @@ struct HfCorrelatorD0Hadrons {
206208 {" hZvtx" , " z vertex;z vertex;entries" , {HistType::kTH1F , {{200 , -20 ., 20 .}}}},
207209 {" hD0Bin" , " D0 selected in pool Bin;pool Bin;entries" , {HistType::kTH1F , {{9 , 0 ., 9 .}}}},
208210 {" hTracksBin" , " Tracks selected in pool Bin;pool Bin;entries" , {HistType::kTH1F , {{9 , 0 ., 9 .}}}}}};
209-
211+
210212 void init (o2::framework::InitContext&)
211213 {
212214 auto vbins = (std::vector<double >)bins;
@@ -496,23 +498,23 @@ struct HfCorrelatorD0Hadrons {
496498
497499 int signalStatus = 0 ;
498500 if ((flagD0 == true ) && (candidate1.isSelD0 () >= selectionFlagD0) && (isSoftpiD0 == false )) {
499- SETBIT (signalStatus,o2::aod::hf_correlation_d0_hadron ::kD0Sig );
501+ SETBIT (signalStatus, ParticleType ::kD0Sig );
500502 } // signal case D0
501503 if ((flagD0bar == true ) && (candidate1.isSelD0 () >= selectionFlagD0) && (isSoftpiD0 == false )) {
502- SETBIT (signalStatus,o2::aod::hf_correlation_d0_hadron:: kD0Ref );
504+ SETBIT (signalStatus, ParticleType:: kD0Ref );
503505 } // reflection case D0
504506 if ((flagD0 == false ) && (flagD0bar == false ) && (candidate1.isSelD0 () >= selectionFlagD0) && (isSoftpiD0 == false )) {
505- SETBIT (signalStatus,o2::aod::hf_correlation_d0_hadron:: kD0Bg );
507+ SETBIT (signalStatus, ParticleType:: kD0Bg );
506508 } // background case D0
507509
508510 if ((flagD0bar == true ) && (candidate1.isSelD0bar () >= selectionFlagD0bar) && (isSoftpiD0bar == false )) {
509- SETBIT (signalStatus,o2::aod::hf_correlation_d0_hadron ::kD0barSig );
511+ SETBIT (signalStatus, ParticleType ::kD0barSig );
510512 } // signal case D0bar
511513 if ((flagD0 == true ) && (candidate1.isSelD0bar () >= selectionFlagD0bar) && (isSoftpiD0bar == false )) {
512- SETBIT (signalStatus,o2::aod::hf_correlation_d0_hadron ::kD0barRef );
514+ SETBIT (signalStatus, ParticleType ::kD0barRef );
513515 } // reflection case D0bar
514516 if ((flagD0 == false ) && (flagD0bar == false ) && (candidate1.isSelD0bar () >= selectionFlagD0bar) && (isSoftpiD0bar == false )) {
515- SETBIT (signalStatus,o2::aod::hf_correlation_d0_hadron ::kD0barBg );
517+ SETBIT (signalStatus, ParticleType ::kD0barBg );
516518 } // background case D0bar
517519
518520 entryD0HadronPair (getDeltaPhi (track.phi (), candidate1.phi ()),
@@ -522,7 +524,7 @@ struct HfCorrelatorD0Hadrons {
522524 poolBin);
523525 entryD0HadronRecoInfo (invMassD0ToPiK (candidate1), invMassD0barToKPi (candidate1), signalStatus);
524526 } // end inner loop (Tracks)
525- } // end of outer loop (D0)
527+ } // end of outer loop (D0)
526528 registry.fill (HIST (" hZvtx" ), collision.posZ ());
527529 registry.fill (HIST (" hMultV0M" ), collision.multFV0M ());
528530 }
@@ -584,32 +586,32 @@ struct HfCorrelatorD0Hadrons {
584586 continue ;
585587
586588 registry.fill (HIST (" hTrackCounterGen" ), 3 ); // fill after soft pion removal
587-
589+
588590 auto getTracksSize = [&particlesMc](aod::McCollision const & collision) {
589- int nTracks = 0 ;
590- for (auto & track : particlesMc) {
591- if (track.isPhysicalPrimary () && std::abs (track.eta ()) < 1.0 ) {
592- nTracks++;
591+ int nTracks = 0 ;
592+ for (auto & track : particlesMc) {
593+ if (track.isPhysicalPrimary () && std::abs (track.eta ()) < 1.0 ) {
594+ nTracks++;
595+ }
593596 }
594- }
595- return nTracks;
596- };
597- using BinningTypeMCGen = FlexibleBinningPolicy<std::tuple<decltype (getTracksSize)>, aod::mccollision::PosZ, decltype (getTracksSize)>;
598- BinningTypeMCGen corrBinningMCGen{{getTracksSize}, {zBins, multBinsMcGen}, true };
597+ return nTracks;
598+ };
599+ using BinningTypeMCGen = FlexibleBinningPolicy<std::tuple<decltype (getTracksSize)>, aod::mccollision::PosZ, decltype (getTracksSize)>;
600+ BinningTypeMCGen corrBinningMCGen{{getTracksSize}, {zBins, multBinsMcGen}, true };
599601 int poolBin = corrBinningMCGen.getBin (std::make_tuple (mccollision.posZ (), getTracksSize (mccollision)));
600-
602+
601603 entryD0HadronPair (getDeltaPhi (particle2.phi (), particle1.phi ()),
602604 particle2.eta () - particle1.eta (),
603605 particle1.pt (),
604606 particle2.pt (),
605607 poolBin);
606608 entryD0HadronRecoInfo (massD0, massD0, 0 ); // dummy info
607- } // end inner loop (Tracks)
608- } // end outer loop (D0)
609+ } // end inner loop (Tracks)
610+ } // end outer loop (D0)
609611 }
610612
611613 PROCESS_SWITCH (HfCorrelatorD0Hadrons, processMcGen, " Process MC Gen mode" , false );
612-
614+
613615 // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
614616 // ========================================================== Implement Event mixing for Data, McRec, McGen ========================================================================================
615617 // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -618,14 +620,14 @@ struct HfCorrelatorD0Hadrons {
618620 using fullTracks = soa::Join<aod::Tracks, aod::TracksDCA>;
619621 using mySelCollisions = soa::Filtered<myCollisions>;
620622 using myTracks = soa::Filtered<fullTracks>;
621- using myCandidatesData = soa::Filtered<soa::Join<aod::HfCand2Prong, aod::HfSelD0>>;
622-
623+ using myCandidatesData = soa::Filtered<soa::Join<aod::HfCand2Prong, aod::HfSelD0>>;
624+
623625 Filter collisionFilter = aod::hf_selection_dmeson_collision::dmesonSel == true ;
624626 Filter trackFilter = (aod::track::eta > static_cast <float >(-etaTrackMax)) && (aod::track::eta < static_cast <float >(etaTrackMax)) && (aod::track::pt > static_cast <float >(ptTrackMin)) && (aod::track::dcaXY > static_cast <float >(-dcaXYTrackMax)) && (aod::track::dcaXY < static_cast <float >(dcaXYTrackMax)) &&
625627 (aod::track::dcaZ > static_cast <float >(-dcaZTrackMax)) && (aod::track::dcaZ < static_cast <float >(dcaZTrackMax));
626628 Filter d0filter = (aod::hf_sel_candidate_d0::isSelD0 >= 1 ) || (aod::hf_sel_candidate_d0::isSelD0bar >= 1 );
627629
628- // ========================================================== Implement Event mixing on Data ========================================================================================
630+ // ========================================================== Implement Event mixing on Data ========================================================================================
629631 void processDataMixedEvent (mySelCollisions& collisions, myCandidatesData& candidates, myTracks& tracks)
630632 {
631633 auto tracksTuple = std::make_tuple (candidates, tracks);
@@ -639,8 +641,8 @@ struct HfCorrelatorD0Hadrons {
639641 if (yCandMax >= 0 . && std::abs (yD0 (t1)) > yCandMax) {
640642 continue ;
641643 }
642-
643- // soft pion removal, signal status 1,3 for D0 and 2,3 for D0bar (softpi removed), signal status 11,13 for D0 and 12.13 for D0bar (only softpi)
644+
645+ // soft pion removal, signal status 1,3 for D0 and 2,3 for D0bar (softpi removed), signal status 11,13 for D0 and 12.13 for D0bar (only softpi)
644646 auto ePiK = RecoDecay::e (t1.pVectorProng0 (), massPi) + RecoDecay::e (t1.pVectorProng1 (), massK);
645647 auto eKPi = RecoDecay::e (t1.pVectorProng0 (), massK) + RecoDecay::e (t1.pVectorProng1 (), massPi);
646648 double invMassDstar1 = 0 ., invMassDstar2 = 0 .;
@@ -661,31 +663,31 @@ struct HfCorrelatorD0Hadrons {
661663 isSoftpiD0bar = true ;
662664 }
663665 }
664-
666+
665667 int signalStatus = 0 ;
666668 if (t1.isSelD0 () >= selectionFlagD0) {
667669 if (isSoftpiD0 == false ) {
668- signalStatus += 1 ;
669- } else {
670- signalStatus += 11 ;
671- }
670+ signalStatus += 1 ;
671+ } else {
672+ signalStatus += 11 ;
673+ }
672674 }
673675 if (t1.isSelD0bar () >= selectionFlagD0bar) {
674- if (isSoftpiD0bar == false ) {
675- signalStatus += 2 ;
676- } else {
677- signalStatus += 12 ;
678- }
676+ if (isSoftpiD0bar == false ) {
677+ signalStatus += 2 ;
678+ } else {
679+ signalStatus += 12 ;
680+ }
679681 }
680-
682+
681683 entryD0HadronPair (getDeltaPhi (t1.phi (), t2.phi ()), t1.eta () - t2.eta (), t1.pt (), t2.pt (), poolBin);
682684 entryD0HadronRecoInfo (invMassD0ToPiK (t1), invMassD0barToKPi (t1), signalStatus);
683- }
685+ }
684686 }
685- }
686- PROCESS_SWITCH (HfCorrelatorD0Hadrons, processDataMixedEvent, " Process data mixed event" , false );
687+ }
688+ PROCESS_SWITCH (HfCorrelatorD0Hadrons, processDataMixedEvent, " Process data mixed event" , false );
687689
688- // ========================================================== Implement Event mixing on McRec ========================================================================================
690+ // ========================================================== Implement Event mixing on McRec ========================================================================================
689691 using myCandidatesMcRec = soa::Filtered<soa::Join<aod::HfCand2Prong, aod::HfSelD0, aod::HfCand2ProngMcRec>>;
690692
691693 void processMcRecMixedEvent (mySelCollisions& collisions, myCandidatesMcRec& candidates, myTracks& tracks)
@@ -696,15 +698,14 @@ struct HfCorrelatorD0Hadrons {
696698 bool flagD0bar = false ;
697699 for (auto & [c1, tracks1, c2, tracks2] : pairMcRec) {
698700 int poolBin = corrBinning.getBin (std::make_tuple (c2.posZ (), c2.multFV0M ()));
699-
700701
701702 for (auto & [t1, t2] : o2::soa::combinations (o2::soa::CombinationsFullIndexPolicy (tracks1, tracks2))) {
702703
703704 if (yCandMax >= 0 . && std::abs (yD0 (t1)) > yCandMax) {
704705 continue ;
705706 }
706-
707- // soft pion removal
707+
708+ // soft pion removal
708709 auto ePiK = RecoDecay::e (t1.pVectorProng0 (), massPi) + RecoDecay::e (t1.pVectorProng1 (), massK);
709710 auto eKPi = RecoDecay::e (t1.pVectorProng0 (), massK) + RecoDecay::e (t1.pVectorProng1 (), massPi);
710711 double invMassDstar1 = 0 ., invMassDstar2 = 0 .;
@@ -725,59 +726,59 @@ struct HfCorrelatorD0Hadrons {
725726 isSoftpiD0bar = true ;
726727 }
727728 }
728-
729+
729730 flagD0 = t1.flagMcMatchRec () == (1 << DecayType::D0ToPiK); // flagD0Signal 'true' if candidate1 matched to D0 (particle)
730731 flagD0bar = t1.flagMcMatchRec () == -(1 << DecayType::D0ToPiK); // flagD0Reflection 'true' if candidate1, selected as D0 (particle), is matched to D0bar (antiparticle)
731732 int signalStatus = 0 ;
732-
733+
733734 if ((flagD0 == true ) && (t1.isSelD0 () >= selectionFlagD0)) {
734735 if (isSoftpiD0 == false ) {
735- SETBIT (signalStatus,o2::aod::hf_correlation_d0_hadron ::kD0Sig ); // signalStatus += 1;
736- } else {
737- SETBIT (signalStatus,o2::aod::hf_correlation_d0_hadron:: kSoftPi ); // signalStatus += 64;
738- }
736+ SETBIT (signalStatus, ParticleType ::kD0Sig ); // signalStatus += 1;
737+ } else {
738+ SETBIT (signalStatus, ParticleType:: kSoftPi ); // signalStatus += 64;
739+ }
739740 } // signal case D0
740-
741+
741742 if ((flagD0bar == true ) && (t1.isSelD0 () >= selectionFlagD0)) {
742743 if (isSoftpiD0 == false ) {
743- SETBIT (signalStatus,o2::aod::hf_correlation_d0_hadron ::kD0Ref ); // signalStatus += 2;
744- } else {
745- SETBIT (signalStatus,o2::aod::hf_correlation_d0_hadron:: kSoftPi ); // signalStatus += 64;
746- }
744+ SETBIT (signalStatus, ParticleType ::kD0Ref ); // signalStatus += 2;
745+ } else {
746+ SETBIT (signalStatus, ParticleType:: kSoftPi ); // signalStatus += 64;
747+ }
747748 } // reflection case D0
748-
749+
749750 if ((flagD0 == false ) && (flagD0bar == false ) && (t1.isSelD0 () >= selectionFlagD0)) {
750751 if (isSoftpiD0 == false ) {
751- SETBIT (signalStatus,o2::aod::hf_correlation_d0_hadron ::kD0Bg ); // signalStatus += 4;
752- } else {
753- SETBIT (signalStatus,o2::aod::hf_correlation_d0_hadron ::kSoftPi );
754- }
752+ SETBIT (signalStatus, ParticleType ::kD0Bg ); // signalStatus += 4;
753+ } else {
754+ SETBIT (signalStatus, ParticleType ::kSoftPi );
755+ }
755756 } // background case D0
756757
757758 if ((flagD0bar == true ) && (t1.isSelD0bar () >= selectionFlagD0bar)) {
758759 if (isSoftpiD0bar == false ) {
759- SETBIT (signalStatus,o2::aod::hf_correlation_d0_hadron ::kD0barSig ); // signalStatus += 8;
760- } else {
761- SETBIT (signalStatus,o2::aod::hf_correlation_d0_hadron ::kSoftPi );
762- }
760+ SETBIT (signalStatus, ParticleType ::kD0barSig ); // signalStatus += 8;
761+ } else {
762+ SETBIT (signalStatus, ParticleType ::kSoftPi );
763+ }
763764 } // signal case D0bar
764-
765+
765766 if ((flagD0 == true ) && (t1.isSelD0bar () >= selectionFlagD0bar)) {
766767 if (isSoftpiD0bar == false ) {
767- SETBIT (signalStatus,o2::aod::hf_correlation_d0_hadron ::kD0barRef ); // signalStatus += 16;
768- } else {
769- SETBIT (signalStatus,o2::aod::hf_correlation_d0_hadron ::kSoftPi );
770- }
768+ SETBIT (signalStatus, ParticleType ::kD0barRef ); // signalStatus += 16;
769+ } else {
770+ SETBIT (signalStatus, ParticleType ::kSoftPi );
771+ }
771772 } // reflection case D0bar
772-
773+
773774 if ((flagD0 == false ) && (flagD0bar == false ) && (t1.isSelD0bar () >= selectionFlagD0bar)) {
774775 if (isSoftpiD0bar == false ) {
775- SETBIT (signalStatus,o2::aod::hf_correlation_d0_hadron ::kD0barBg ); // signalStatus += 32;
776- } else {
777- SETBIT (signalStatus,o2::aod::hf_correlation_d0_hadron ::kSoftPi );
778- }
776+ SETBIT (signalStatus, ParticleType ::kD0barBg ); // signalStatus += 32;
777+ } else {
778+ SETBIT (signalStatus, ParticleType ::kSoftPi );
779+ }
779780 } // background case D0bar
780-
781+
781782 registry.fill (HIST (" hSignalStatusMERec" ), signalStatus);
782783 entryD0HadronPair (getDeltaPhi (t1.phi (), t2.phi ()), t1.eta () - t2.eta (), t1.pt (), t2.pt (), poolBin);
783784 entryD0HadronRecoInfo (invMassD0ToPiK (t1), invMassD0barToKPi (t1), signalStatus);
@@ -786,8 +787,7 @@ struct HfCorrelatorD0Hadrons {
786787 }
787788 PROCESS_SWITCH (HfCorrelatorD0Hadrons, processMcRecMixedEvent, " Process Mixed Event MCRec" , false );
788789
789-
790- // Event Mixing for the MCGen Mode
790+ // Event Mixing for the MCGen Mode
791791 using myCollisionsMcGen = soa::Join<aod::McCollisions, aod::DmesonSelection>;
792792 using fullTracksMcGen = aod::McParticles;
793793 using mySelCollisionsMcGen = soa::Filtered<myCollisionsMcGen>;
@@ -838,7 +838,7 @@ struct HfCorrelatorD0Hadrons {
838838 if (t2.pt () < ptTrackMin) {
839839 continue ;
840840 }
841-
841+
842842 // ==============================soft pion removal================================
843843 // method used: indexMother = -1 by default if the mother doesn't match with given PID of the mother. We find mother of pion if it is D* and mother of D0 if it is D*. If they are both positive and they both match each other, then it is detected as a soft pion
844844
@@ -854,7 +854,6 @@ struct HfCorrelatorD0Hadrons {
854854 }
855855 }
856856 PROCESS_SWITCH (HfCorrelatorD0Hadrons, processMcGenMixedEvent, " Process Mixed Event MCGen" , false );
857-
858857};
859858
860859WorkflowSpec defineDataProcessing (ConfigContext const & cfgc)
0 commit comments