@@ -265,7 +265,7 @@ struct Phik0shortanalysis {
265265 AxisSpec vertexZAxis = {100 , -15 .f , 15 .f , " vrtx_{Z} [cm]" };
266266 AxisSpec etaAxis = {16 , -trackConfigs.etaMax , trackConfigs.etaMax , " #eta" };
267267 AxisSpec yAxis = {nBinsY, -cfgYAcceptanceSmear, cfgYAcceptanceSmear, " #it{y}" };
268- AxisSpec deltayAxis = {nBinsDeltaY, -1 .2f , 1 .2f , " #Delta#it{y}" };
268+ AxisSpec deltayAxis = {nBinsDeltaY, -1 .0f , 1 .0f , " #Delta#it{y}" };
269269 AxisSpec multAxis = {120 , 0 .0f , 120 .0f , " centFT0M" };
270270 AxisSpec binnedmultAxis{(std::vector<double >)binsMult, " centFT0M" };
271271 AxisSpec binnedpTPhiAxis{(std::vector<double >)binspTPhi, " #it{p}_{T} (GeV/#it{c})" };
@@ -553,6 +553,15 @@ struct Phik0shortanalysis {
553553
554554 mcPionHist.add (" h3PiRapidityGenMC" , " Rapidity for Pion for GenMC" , kTH3F , {binnedmultAxis, binnedptPiAxis, yAxis});
555555
556+ // Histograms for new analysis procedure (to be finalized and renamed deleting other histograms)
557+ dataPhiHist.add (" h3PhiDataNewProc" , " Invariant mass of Phi n Data" , kTH3F , {binnedmultAxis, binnedpTPhiAxis, massPhiAxis});
558+ dataPhiK0SHist.add (" h5PhiK0SDataNewProc" , " 2D Invariant mass of Phi and K0Short for Data" , kTHnSparseF , {deltayAxis, binnedmultAxis, binnedptK0SAxis, massK0SAxis, massPhiAxis});
559+ dataPhiPionHist.add (" h6PhiPiDataNewProc" , " Phi Invariant mass vs Pion nSigma TPC/TOF for Data" , kTHnSparseF , {deltayAxis, binnedmultAxis, binnedptPiAxis, {100 , -10 .0f , 10 .0f }, {100 , -10 .0f , 10 .0f }, massPhiAxis});
560+
561+ closureMCPhiHist.add (" h3PhiMCClosureNewProc" , " Invariant mass of Phi" , kTH3F , {binnedmultAxis, binnedpTPhiAxis, massPhiAxis});
562+ closureMCPhiK0SHist.add (" h5PhiK0SMCClosureNewProc" , " 2D Invariant mass of Phi and K0Short for MC Closure Test" , kTHnSparseF , {deltayAxis, binnedmultAxis, binnedptK0SAxis, massK0SAxis, massPhiAxis});
563+ closureMCPhiPionHist.add (" h6PhiPiMCClosureNewProc" , " Phi Invariant mass vs Pion nSigma TPC/TOF for MC Closure Test" , kTHnSparseF , {deltayAxis, binnedmultAxis, binnedptPiAxis, {100 , -10 .0f , 10 .0f }, {100 , -10 .0f , 10 .0f }, massPhiAxis});
564+
556565 // Initialize CCDB only if purity is requested in the task
557566 if (useCCDB) {
558567 ccdb->setURL (ccdbUrl);
@@ -2422,7 +2431,7 @@ struct Phik0shortanalysis {
24222431
24232432 PROCESS_SWITCH (Phik0shortanalysis, processdNdetaWPhiMCGen, " Process function for dN/deta values in MCGen" , false );
24242433
2425- // 2D procedure
2434+ // New 2D analysis procedure
24262435 void processPhiK0SPionData2D (SelCollisions::iterator const & collision, FullTracks const & fullTracks, FullV0s const & V0s, V0DauTracks const &)
24272436 {
24282437 // Check if the event selection is passed
@@ -2439,8 +2448,6 @@ struct Phik0shortanalysis {
24392448 bool isCountedPhi = false ;
24402449 bool isFilledhV0 = false ;
24412450
2442- double weight{1.0 };
2443-
24442451 // Loop over all positive tracks
24452452 for (const auto & track1 : posThisColl) {
24462453 if (!selectionTrackResonance<false >(track1, true ) || !selectionPIDKaonpTdependent (track1))
@@ -2473,10 +2480,7 @@ struct Phik0shortanalysis {
24732480 isCountedPhi = true ;
24742481 }
24752482
2476- if (fillMethodSingleWeight)
2477- weight *= (1 - getPhiPurity (multiplicity, recPhi));
2478-
2479- dataPhiHist.fill (HIST (" h3PhipurData" ), multiplicity, recPhi.Pt (), recPhi.M ());
2483+ dataPhiHist.fill (HIST (" h3PhiDataNewProc" ), multiplicity, recPhi.Pt (), recPhi.M ());
24802484
24812485 // V0 already reconstructed by the builder
24822486 for (const auto & v0 : V0s) {
@@ -2503,12 +2507,7 @@ struct Phik0shortanalysis {
25032507 if (std::abs (v0.yK0Short ()) > cfgYAcceptance)
25042508 continue ;
25052509
2506- dataPhiK0SHist.fill (HIST (" h5PhiK0SData" ), 0 , multiplicity, v0.pt (), v0.mK0Short (), recPhi.M ());
2507- for (size_t i = 0 ; i < cfgDeltaYAcceptanceBins->size (); i++) {
2508- if (std::abs (v0.yK0Short () - recPhi.Rapidity ()) > cfgDeltaYAcceptanceBins->at (i))
2509- continue ;
2510- dataPhiK0SHist.fill (HIST (" h5PhiK0SData" ), i + 1 , multiplicity, v0.pt (), v0.mK0Short (), recPhi.M ());
2511- }
2510+ dataPhiK0SHist.fill (HIST (" h5PhiK0SDataNewProc" ), v0.yK0Short () - recPhi.Rapidity (), multiplicity, v0.pt (), v0.mK0Short (), recPhi.M ());
25122511 }
25132512
25142513 isFilledhV0 = true ;
@@ -2523,18 +2522,10 @@ struct Phik0shortanalysis {
25232522
25242523 float nSigmaTOFPi = (track.hasTOF () ? track.tofNSigmaPi () : -999 );
25252524
2526- dataPhiPionHist.fill (HIST (" h6PhiPiData" ), 0 , multiplicity, track.pt (), track.tpcNSigmaPi (), nSigmaTOFPi, recPhi.M ());
2527- for (size_t i = 0 ; i < cfgDeltaYAcceptanceBins->size (); i++) {
2528- if (std::abs (track.rapidity (massPi) - recPhi.Rapidity ()) > cfgDeltaYAcceptanceBins->at (i))
2529- continue ;
2530- dataPhiPionHist.fill (HIST (" h6PhiPiData" ), i + 1 , multiplicity, track.pt (), track.tpcNSigmaPi (), nSigmaTOFPi, recPhi.M ());
2531- }
2525+ dataPhiPionHist.fill (HIST (" h6PhiPiDataNewProc" ), track.rapidity (massPi) - recPhi.Rapidity (), multiplicity, track.pt (), track.tpcNSigmaPi (), nSigmaTOFPi, recPhi.M ());
25322526 }
25332527 }
25342528 }
2535-
2536- weight = 1 - weight;
2537- dataEventHist.fill (HIST (" hEventSelection" ), 5 , weight); // at least a Phi in the event
25382529 }
25392530
25402531 PROCESS_SWITCH (Phik0shortanalysis, processPhiK0SPionData2D, " Process function for Phi-K0S and Phi-Pion Correlations in Data2D" , false );
@@ -2558,8 +2549,6 @@ struct Phik0shortanalysis {
25582549
25592550 bool isCountedPhi = false ;
25602551
2561- double weight{1.0 };
2562-
25632552 // Loop over all positive tracks
25642553 for (const auto & track1 : posThisColl) {
25652554 if (!selectionTrackResonance<true >(track1, true ) || !selectionPIDKaonpTdependent (track1))
@@ -2588,10 +2577,7 @@ struct Phik0shortanalysis {
25882577 isCountedPhi = true ;
25892578 }
25902579
2591- if (fillMethodSingleWeight)
2592- weight *= (1 - getPhiPurity (genmultiplicity, recPhi));
2593-
2594- closureMCPhiHist.fill (HIST (" h3PhipurMCClosure" ), genmultiplicity, recPhi.Pt (), recPhi.M ());
2580+ closureMCPhiHist.fill (HIST (" h3PhiMCClosureNewProc" ), genmultiplicity, recPhi.Pt (), recPhi.M ());
25952581
25962582 // V0 already reconstructed by the builder
25972583 for (const auto & v0 : V0s) {
@@ -2614,12 +2600,7 @@ struct Phik0shortanalysis {
26142600 if (std::abs (v0.yK0Short ()) > cfgYAcceptance)
26152601 continue ;
26162602
2617- closureMCPhiK0SHist.fill (HIST (" h5PhiK0SMCClosure" ), 0 , genmultiplicity, v0.pt (), v0.mK0Short (), recPhi.M ());
2618- for (size_t i = 0 ; i < cfgDeltaYAcceptanceBins->size (); i++) {
2619- if (std::abs (v0.yK0Short () - recPhi.Rapidity ()) > cfgDeltaYAcceptanceBins->at (i))
2620- continue ;
2621- closureMCPhiK0SHist.fill (HIST (" h5PhiK0SMCClosure" ), i + 1 , genmultiplicity, v0.pt (), v0.mK0Short (), recPhi.M ());
2622- }
2603+ closureMCPhiK0SHist.fill (HIST (" h5PhiK0SMCClosureNewProc" ), v0.yK0Short () - recPhi.Rapidity (), genmultiplicity, v0.pt (), v0.mK0Short (), recPhi.M ());
26232604 }
26242605
26252606 // Loop over all primary pion candidates
@@ -2640,160 +2621,14 @@ struct Phik0shortanalysis {
26402621
26412622 float nSigmaTOFPi = (track.hasTOF () ? track.tofNSigmaPi () : -999 );
26422623
2643- closureMCPhiPionHist.fill (HIST (" h6PhiPiMCClosure" ), 0 , genmultiplicity, track.pt (), track.tpcNSigmaPi (), nSigmaTOFPi, recPhi.M ());
2644- for (size_t i = 0 ; i < cfgDeltaYAcceptanceBins->size (); i++) {
2645- if (std::abs (track.rapidity (massPi) - recPhi.Rapidity ()) > cfgDeltaYAcceptanceBins->at (i))
2646- continue ;
2647- closureMCPhiPionHist.fill (HIST (" h6PhiPiMCClosure" ), i + 1 , genmultiplicity, track.pt (), track.tpcNSigmaPi (), nSigmaTOFPi, recPhi.M ());
2648- }
2624+ closureMCPhiPionHist.fill (HIST (" h6PhiPiMCClosureNewProc" ), track.rapidity (massPi) - recPhi.Rapidity (), genmultiplicity, track.pt (), track.tpcNSigmaPi (), nSigmaTOFPi, recPhi.M ());
26492625 }
26502626 }
26512627 }
2652-
2653- weight = 1 - weight;
2654- mcEventHist.fill (HIST (" hRecMCEventSelection" ), 8 , weight); // at least a Phi in the event
26552628 }
26562629
26572630 PROCESS_SWITCH (Phik0shortanalysis, processPhiK0SPionMCClosure2D, " Process function for Phi-K0S and Phi-Pion Correlations in MCClosure2D" , false );
26582631
2659- void processPhiK0SPionMCReco2D (SimCollisions::iterator const & collision, FullMCTracks const & fullMCTracks, FullMCV0s const & V0s, V0DauMCTracks const &, MCCollisions const &, aod::McParticles const &)
2660- {
2661- if (!acceptEventQA<true >(collision, true ))
2662- return ;
2663-
2664- float multiplicity = collision.centFT0M ();
2665- mcEventHist.fill (HIST (" hRecMCMultiplicityPercent" ), multiplicity);
2666-
2667- if (!collision.has_mcCollision ())
2668- return ;
2669- mcEventHist.fill (HIST (" hRecMCEventSelection" ), 6 ); // with at least a gen collision
2670-
2671- const auto & mcCollision = collision.mcCollision_as <MCCollisions>();
2672- float genmultiplicity = mcCollision.centFT0M ();
2673- mcEventHist.fill (HIST (" hRecMCGenMultiplicityPercent" ), genmultiplicity);
2674-
2675- // Defining positive and negative tracks for phi reconstruction
2676- auto posThisColl = posMCTracks->sliceByCached (aod::track::collisionId, collision.globalIndex (), cache);
2677- auto negThisColl = negMCTracks->sliceByCached (aod::track::collisionId, collision.globalIndex (), cache);
2678-
2679- bool isCountedPhi = false ;
2680-
2681- // Loop over all positive tracks
2682- for (const auto & track1 : posThisColl) {
2683- if (!selectionTrackResonance<true >(track1, false ) || !selectionPIDKaonpTdependent (track1))
2684- continue ; // topological and PID selection
2685-
2686- auto track1ID = track1.globalIndex ();
2687-
2688- if (!track1.has_mcParticle ())
2689- continue ;
2690- auto mcTrack1 = track1.mcParticle_as <aod::McParticles>();
2691- if (mcTrack1.pdgCode () != PDG_t::kKPlus || !mcTrack1.isPhysicalPrimary ())
2692- continue ;
2693-
2694- // Loop over all negative tracks
2695- for (const auto & track2 : negThisColl) {
2696- if (!selectionTrackResonance<true >(track2, false ) || !selectionPIDKaonpTdependent (track2))
2697- continue ; // topological and PID selection
2698-
2699- auto track2ID = track2.globalIndex ();
2700- if (track2ID == track1ID)
2701- continue ; // condition to avoid double counting of pair
2702-
2703- if (!track2.has_mcParticle ())
2704- continue ;
2705- auto mcTrack2 = track2.mcParticle_as <aod::McParticles>();
2706- if (mcTrack2.pdgCode () != PDG_t::kKMinus || !mcTrack2.isPhysicalPrimary ())
2707- continue ;
2708-
2709- bool isMCMotherPhi = false ;
2710- for (const auto & motherOfMcTrack1 : mcTrack1.mothers_as <aod::McParticles>()) {
2711- for (const auto & motherOfMcTrack2 : mcTrack2.mothers_as <aod::McParticles>()) {
2712- if (motherOfMcTrack1.pdgCode () != motherOfMcTrack2.pdgCode ())
2713- continue ;
2714- if (motherOfMcTrack1.globalIndex () != motherOfMcTrack2.globalIndex ())
2715- continue ;
2716- if (motherOfMcTrack1.pdgCode () != o2::constants::physics::Pdg::kPhi )
2717- continue ;
2718- isMCMotherPhi = true ;
2719- }
2720- }
2721- if (!isMCMotherPhi)
2722- continue ;
2723-
2724- ROOT::Math::PxPyPzMVector recPhi = recMother (track1, track2, massKa, massKa);
2725- if (recPhi.Pt () < minPhiPt || recPhi.Pt () > maxPhiPt)
2726- continue ;
2727-
2728- if (std::abs (recPhi.Rapidity ()) > cfgYAcceptance)
2729- continue ;
2730-
2731- if (!isCountedPhi) {
2732- mcEventHist.fill (HIST (" hRecMCEventSelection" ), 7 ); // at least a Phi in the event
2733- isCountedPhi = true ;
2734- }
2735-
2736- // V0 already reconstructed by the builder
2737- for (const auto & v0 : V0s) {
2738- if (!v0.has_mcParticle ()) {
2739- continue ;
2740- }
2741-
2742- auto v0mcparticle = v0.mcParticle ();
2743- if (v0mcparticle.pdgCode () != PDG_t::kK0Short || !v0mcparticle.isPhysicalPrimary ())
2744- continue ;
2745-
2746- const auto & posDaughterTrack = v0.posTrack_as <V0DauMCTracks>();
2747- const auto & negDaughterTrack = v0.negTrack_as <V0DauMCTracks>();
2748-
2749- // Cut on V0 dynamic columns
2750- if (!selectionV0 (v0, posDaughterTrack, negDaughterTrack))
2751- continue ;
2752- if (v0Configs.cfgFurtherV0Selection && !furtherSelectionV0 (v0, collision))
2753- continue ;
2754-
2755- if (std::abs (v0.yK0Short ()) > cfgYAcceptance)
2756- continue ;
2757-
2758- mcPhiK0SHist.fill (HIST (" h5PhiK0SMCClosure" ), 0 , genmultiplicity, v0.pt (), v0.mK0Short (), recPhi.M ());
2759- for (size_t i = 0 ; i < cfgDeltaYAcceptanceBins->size (); i++) {
2760- if (std::abs (v0.yK0Short () - recPhi.Rapidity ()) > cfgDeltaYAcceptanceBins->at (i))
2761- continue ;
2762- mcPhiK0SHist.fill (HIST (" h5PhiK0SMCClosure" ), i + 1 , genmultiplicity, v0.pt (), v0.mK0Short (), recPhi.M ());
2763- }
2764- }
2765-
2766- // Loop over all primary pion candidates
2767- for (const auto & track : fullMCTracks) {
2768- if (!track.has_mcParticle ())
2769- continue ;
2770-
2771- auto mcTrack = track.mcParticle_as <aod::McParticles>();
2772- if (std::abs (mcTrack.pdgCode ()) != PDG_t::kPiPlus || !mcTrack.isPhysicalPrimary ())
2773- continue ;
2774-
2775- if (!selectionPion<true , true >(track, false ))
2776- continue ;
2777-
2778- if (std::abs (track.rapidity (massPi)) > cfgYAcceptance)
2779- continue ;
2780-
2781- float nSigmaTOFPi = (track.hasTOF () ? track.tofNSigmaPi () : -999 );
2782-
2783- mcPhiPionHist.fill (HIST (" h6PhiPiMCClosure" ), 0 , genmultiplicity, track.pt (), track.tpcNSigmaPi (), nSigmaTOFPi, recPhi.M ());
2784- for (size_t i = 0 ; i < cfgDeltaYAcceptanceBins->size (); i++) {
2785- if (std::abs (track.rapidity (massPi) - recPhi.Rapidity ()) > cfgDeltaYAcceptanceBins->at (i))
2786- continue ;
2787- mcPhiPionHist.fill (HIST (" h6PhiPiMCClosure" ), i + 1 , genmultiplicity, track.pt (), track.tpcNSigmaPi (), nSigmaTOFPi, recPhi.M ());
2788- }
2789- }
2790- }
2791- }
2792- }
2793-
2794- PROCESS_SWITCH (Phik0shortanalysis, processPhiK0SPionMCReco2D, " Process function for Phi-K0S and Phi-Pion Correlations Efficiency correction in MCReco2D" , false );
2795-
2796- // New analysis procedure
27972632 void processAllPartMCReco (SimCollisions::iterator const & collision, FullMCTracks const & fullMCTracks, FullMCV0s const & V0s, V0DauMCTracks const &, MCCollisions const &, aod::McParticles const & mcParticles)
27982633 {
27992634 for (const auto & collision : collisions) {
0 commit comments