From 64b4ba9e6fb309d6135c178d38d8a8a3fdca65f2 Mon Sep 17 00:00:00 2001 From: Adrian Nassirpour Date: Tue, 23 Jul 2024 13:30:33 +0900 Subject: [PATCH 01/12] Added K*(892) functionality, as well as a host of optimizations and features --- PWGJE/Tasks/phiInJets.cxx | 501 +++++++++++++++++++++++++++++--------- 1 file changed, 391 insertions(+), 110 deletions(-) diff --git a/PWGJE/Tasks/phiInJets.cxx b/PWGJE/Tasks/phiInJets.cxx index 7b3f5374d01..3a18b121159 100644 --- a/PWGJE/Tasks/phiInJets.cxx +++ b/PWGJE/Tasks/phiInJets.cxx @@ -86,6 +86,9 @@ struct phiInJets { Configurable cDebugLevel{"cDebugLevel", 0, "Resolution of Debug"}; Configurable cfgBR{"cfgBR", false, "Forces Gen. Charged BR Only"}; Configurable cfgSimPID{"cfgSimPID", false, "Enforces PID on the Gen. Rec level"}; + Configurable cfgSingleJet{"cfgSingleJet", false, "Enforces strict phi-jet correspondance"}; + Configurable cfgIsKstar{"cfgIsKstar", false, "Swaps Phi for Kstar analysis"}; + // CONFIG DONE ///////////////////////////////////////// //INIT @@ -97,10 +100,10 @@ struct phiInJets { const AxisSpec axisEta{30, -1.5, +1.5, "#eta"}; const AxisSpec axisPhi{200, -1, +7, "#phi"}; const AxisSpec axisPt{200, 0, +200, "#pt"}; - const AxisSpec MinvAxis = {400, 0.95, 1.35}; + const AxisSpec MinvAxis = {500, 0.75, 1.25}; const AxisSpec PtAxis = {200, 0, 20.0}; const AxisSpec MultAxis = {100, 0, 100}; - const AxisSpec dRAxis = {100, 0, 3.6}; + const AxisSpec dRAxis = {100, 0, 100}; JEhistos.add("ptJEHistogramPion", "ptJEHistogramPion", kTH1F, {PtAxis}); JEhistos.add("ptJEHistogramKaon", "ptJEHistogramKaon", kTH1F, {PtAxis}); @@ -111,6 +114,8 @@ struct phiInJets { JEhistos.add("Resp_Matrix", "Resp_Matrix", HistType::kTHnSparseD, {PtAxis, axisPt, PtAxis, axisPt}); // REC(Phi,Jet), GEN(Phi,Jet) JEhistos.add("Resp_Matrix_MATCHED", "Resp_Matrix_MATCHED", HistType::kTHnSparseD, {PtAxis, axisPt, PtAxis, axisPt}); // REC(Phi,Jet), GEN(Phi,Jet) + JEhistos.add("Resp_Matrix_MATCHED_rand0", "Resp_Matrix_MATCHED_rand0", HistType::kTHnSparseD, {PtAxis, axisPt, PtAxis, axisPt}); // REC(Phi,Jet), GEN(Phi,Jet) + JEhistos.add("Resp_Matrix_MATCHED_rand1", "Resp_Matrix_MATCHED_rand1", HistType::kTHnSparseD, {PtAxis, axisPt, PtAxis, axisPt}); // REC(Phi,Jet), GEN(Phi,Jet) JEhistos.add("ptGeneratedPion", "ptGeneratedPion", kTH1F, {PtAxis}); JEhistos.add("ptGeneratedKaon", "ptGeneratedKaon", kTH1F, {PtAxis}); @@ -119,8 +124,10 @@ struct phiInJets { JEhistos.add("ptGeneratedPhi_ALLBR", "ptGeneratedPhi_ALLBR", kTH1F, {PtAxis}); JEhistos.add("ptGeneratedPhi_JetTrigger", "ptGeneratedPhi_JetTrigger", kTH1F, {PtAxis}); - JEhistos.add("mGeneratedPhi", "mGeneratedPhi", kTH1F, {MinvAxis}); + JEhistos.add("hNResoPerEvent", "hNResoPerEvent", kTH1F, {{10, 0, 10}}); + JEhistos.add("hNResoPerEventWJet", "hNResoPerEventWJet", kTH1F, {{10, 0, 10}}); + JEhistos.add("hNResoPerEventInJet", "hNResoPerEventInJet", kTH1F, {{10, 0, 10}}); JEhistos.add("etaHistogram", "etaHistogram", kTH1F, {axisEta}); JEhistos.add("phiHistogram", "phiHistogram", kTH1F, {axisPhi}); @@ -141,6 +148,8 @@ struct phiInJets { JEhistos.add("nEvents_MCRec_MATCHED", "nEvents_MCRec_MATCHED", kTH1F, {{4, 0.0, 4.0}}); JEhistos.add("nEvents_MCGen_MATCHED", "nEvents_MCGen_MATCHED", kTH1F, {{4, 0.0, 4.0}}); + + JEhistos.add("hMCRec_nonmatch_hUSS_KtoKangle_v_pt", "hMCRec_nonmatch_hUSS_KtoKangle_v_pt", kTH2F, {axisEta, PtAxis}); JEhistos.add("hMCTrue_nonmatch_hUSS_Kangle_v_pt", "hMCTrue_nonmatch_hUSS_Kangle_v_pt", kTH2F, {axisEta, PtAxis}); JEhistos.add("hMCRec_nonmatch_hUSS_Kangle_v_pt", "hMCRec_nonmatch_hUSS_Kangle_v_pt", kTH2F, {axisEta, PtAxis}); JEhistos.add("hMCRec_nonmatch_hUSS_INSIDE_pt_v_eta", "hMCRec_nonmatch_hUSS_INSIDE_pt_v_eta", kTH2F, {PtAxis, axisEta}); @@ -233,10 +242,11 @@ struct phiInJets { } // end of init double massKa = o2::constants::physics::MassKPlus; + double massPi = o2::constants::physics::MassPiMinus; using EventCandidates = soa::Join; // , aod::CentFT0Ms, aod::CentFT0As, aod::CentFT0Cs using TrackCandidates = soa::Join; + aod::pidTPCKa, aod::pidTOFKa,aod::pidTPCPi, aod::pidTOFPi>; Filter jetCuts = aod::jet::pt > cfgjetPtMin&& aod::jet::r == nround(cfgjetR.node() * 100.0f); // Function for track quality cuts @@ -285,7 +295,24 @@ struct phiInJets { ///////////////////////////////////////////////////////////////////////////// template - bool trackPID(const T& candidate) + bool trackPID(const T& candidate, bool FT) + { + bool pid = false; + + if(!cfgIsKstar) + pid=trackPIDKaon(candidate); + + else{ + if(!FT) + pid=trackPIDPion(candidate); + else + pid=trackPIDKaon(candidate); + } + return pid; + } + + template + bool trackPIDKaon(const T& candidate) { bool tpcPIDPassed{false}, tofPIDPassed{false}; if (std::abs(candidate.tpcNSigmaKa()) < cfgnTPCPID) @@ -303,30 +330,111 @@ struct phiInJets { } return false; } + + template + bool trackPIDPion(const T& candidate) + { + bool tpcPIDPassed{false}, tofPIDPassed{false}; + if (std::abs(candidate.tpcNSigmaPi()) < cfgnTPCPID) + tpcPIDPassed = true; + + if (candidate.hasTOF()) { + if (std::abs(candidate.tofNSigmaPi()) < cfgnTOFPID) { + tofPIDPassed = true; + } + } else { + tofPIDPassed = true; + } + if (tpcPIDPassed && tofPIDPassed) { + return true; + } + return false; + } + ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// + + template + double DistinguishJets(const JetType& jets, const TLorentzVector lResonance) + { + if (cDebugLevel > 0) + std::cout<<"oof, multiple jets fit to the same phi. Time to find the best phi-jet link"< + double DistinguishJetsMC(const Jet_pt& jet_pt, const Jet_phi& jet_phi, const Jet_eta& jet_eta,const TLorentzVector lResonance) + { + if (cDebugLevel > 0) + std::cout<<"oof, multiple jets fit to the same phi. Time to find the best phi-jet link"< - void minvReconstruction(double mult, const TracksType& trk1, const TracksType& trk2, const JetType& jets) + int minvReconstruction(double mult, const TracksType& trk1, const TracksType& trk2, const JetType& jets) { TLorentzVector lDecayDaughter1, lDecayDaughter2, lResonance; if (!trackSelection(trk1) || !trackSelection(trk2)) - return; + return -1; - if (!trackPID(trk1) || !trackPID(trk2)) - return; + if (!trackPID(trk1,true) || !trackPID(trk2,false)) + return -1; - if (trk1.index() >= trk2.index()) - return; // We need to run (0,1), (1,0) pairs as well. but same id pairs are not needed. + if(!cfgIsKstar){ + if (trk1.globalIndex() >= trk2.globalIndex()) + return -1; // For Phi, we only need to iterate each pair once + } + else{ + if (trk1.globalIndex() == trk2.globalIndex()) + return -1; // For Kstar, we need to run (0,1), (1,0) pairs as well. but same id pairs are not needed. + } lDecayDaughter1.SetXYZM(trk1.px(), trk1.py(), trk1.pz(), massKa); - lDecayDaughter2.SetXYZM(trk2.px(), trk2.py(), trk2.pz(), massKa); + if(!cfgIsKstar) + lDecayDaughter2.SetXYZM(trk2.px(), trk2.py(), trk2.pz(), massKa); + else + lDecayDaughter2.SetXYZM(trk2.px(), trk2.py(), trk2.pz(), massPi); + lResonance = lDecayDaughter1 + lDecayDaughter2; if (std::abs(lResonance.Eta()) > cfgtrkMaxEta) - return; - + return -1; + ///////////////////////////////////////////////////////////////////////////// // Fill Global Event Minv if (trk1.sign() * trk2.sign() < 0) { @@ -354,16 +462,24 @@ struct phiInJets { ///////////////////////////////////////////////////////////////////////////// bool jetFlag = false; + int goodjets = 0; + double jetpt = 0; for (auto const& jet : jets) { - double phidiff = TVector2::Phi_mpi_pi(jet.phi() - lResonance.Phi()); double etadiff = jet.eta() - lResonance.Eta(); double R = TMath::Sqrt((etadiff * etadiff) + (phidiff * phidiff)); - if (R < cfgjetR) + if (R < cfgjetR){ jetFlag = true; + jetpt = jet.pt(); + goodjets++; + } } - - ///////////////////////////////////////////////////////////////////////////// + + if(cfgSingleJet) + if(goodjets>1) + jetpt=DistinguishJets(jets, lResonance); + + ///////////////////////////////////////////////////////////////////////////// // Fill inside Jet if (jetFlag) { if (trk1.sign() * trk2.sign() < 0) { @@ -371,14 +487,14 @@ struct phiInJets { JEhistos.fill(HIST("hUSS_INSIDE_1D"), lResonance.M()); if (lResonance.Pt() > 2.0 && lResonance.Pt() < 3) JEhistos.fill(HIST("hUSS_INSIDE_1D_2_3"), lResonance.M()); - JEhistos.fill(HIST("hUSS_INSIDE"), mult, lResonance.Pt(), lResonance.M()); + JEhistos.fill(HIST("hUSS_INSIDE"), jetpt, lResonance.Pt(), lResonance.M()); } if (IsMC) { JEhistos.fill(HIST("hMCRec_hUSS_INSIDE_1D"), lResonance.M()); if (lResonance.Pt() > 2.0 && lResonance.Pt() < 3) JEhistos.fill(HIST("hMCRec_hUSS_INSIDE_1D_2_3"), lResonance.M()); - JEhistos.fill(HIST("hMCRec_hUSS_INSIDE"), mult, lResonance.Pt(), lResonance.M()); + JEhistos.fill(HIST("hMCRec_hUSS_INSIDE"), jetpt, lResonance.Pt(), lResonance.M()); } } else if (trk1.sign() * trk2.sign() > 0) { @@ -386,7 +502,7 @@ struct phiInJets { JEhistos.fill(HIST("hLSS_INSIDE_1D"), lResonance.M()); if (lResonance.Pt() > 2.0 && lResonance.Pt() < 3) JEhistos.fill(HIST("hLSS_INSIDE_1D_2_3"), lResonance.M()); - JEhistos.fill(HIST("hLSS_INSIDE"), mult, lResonance.Pt(), lResonance.M()); + JEhistos.fill(HIST("hLSS_INSIDE"), jetpt, lResonance.Pt(), lResonance.M()); } } // jetflag ///////////////////////////////////////////////////////////////////////////// @@ -399,14 +515,14 @@ struct phiInJets { JEhistos.fill(HIST("hUSS_OUTSIDE_1D"), lResonance.M()); if (lResonance.Pt() > 2.0 && lResonance.Pt() < 3) JEhistos.fill(HIST("hUSS_OUTSIDE_1D_2_3"), lResonance.M()); - JEhistos.fill(HIST("hUSS_OUTSIDE"), mult, lResonance.Pt(), lResonance.M()); + JEhistos.fill(HIST("hUSS_OUTSIDE"), jetpt, lResonance.Pt(), lResonance.M()); } if (IsMC) { JEhistos.fill(HIST("hMCRec_hUSS_OUTSIDE_1D"), lResonance.M()); if (lResonance.Pt() > 2.0 && lResonance.Pt() < 3) JEhistos.fill(HIST("hMCRec_hUSS_OUTSIDE_1D_2_3"), lResonance.M()); - JEhistos.fill(HIST("hMCRec_hUSS_OUTSIDE"), mult, lResonance.Pt(), lResonance.M()); + JEhistos.fill(HIST("hMCRec_hUSS_OUTSIDE"), jetpt, lResonance.Pt(), lResonance.M()); } } else if (trk1.sign() * trk2.sign() > 0) { @@ -414,10 +530,32 @@ struct phiInJets { JEhistos.fill(HIST("hLSS_OUTSIDE_1D"), lResonance.M()); if (lResonance.Pt() > 2.0 && lResonance.Pt() < 3) JEhistos.fill(HIST("hLSS_OUTSIDE_1D_2_3"), lResonance.M()); - JEhistos.fill(HIST("hLSS_OUTSIDE"), mult, lResonance.Pt(), lResonance.M()); + JEhistos.fill(HIST("hLSS_OUTSIDE"), jetpt, lResonance.Pt(), lResonance.M()); } } //! jetflag ///////////////////////////////////////////////////////////////////////////// + if(!cfgIsKstar){ + if(lResonance.M()>1.005 && lResonance.M()<1.035){ + if(jetFlag) + return 3; + if(goodjets>0) + return 2; + return 1; + } + else + return -1; + } + else{ + if(lResonance.M()>0.85 && lResonance.M()<0.95){ + if(jetFlag) + return 3; + if(goodjets>0) + return 2; + return 1; + } + else + return -1; + } } // MinvReconstruction ///////////////////////////////////////////////////////////////////////////// @@ -437,17 +575,30 @@ struct phiInJets { if (!jetderiveddatautilities::selectCollision(collision, jetderiveddatautilities::JCollisionSel::sel8)) return; + int nReso = 0; + int nResoWTrig = 0; + int nResoInTrig = 0; for (auto& [track1, track2] : combinations(o2::soa::CombinationsFullIndexPolicy(tracks, tracks))) { - auto trk1 = track1.track_as>(); - auto trk2 = track2.track_as>(); - minvReconstruction(1.0, trk1, trk2, chargedjets); + auto trk1 = track1.track_as>(); + auto trk2 = track2.track_as>(); + int Reso = minvReconstruction(1.0, trk1, trk2, chargedjets); + if(Reso>0) + nReso++; + if(Reso>1) + nResoWTrig++; + if(Reso>2) + nResoInTrig++; } + //Here we have to fill the number of reso candidates per event + JEhistos.fill(HIST("hNResoPerEvent"), nReso); + JEhistos.fill(HIST("hNResoPerEventWJet"), nResoWTrig); + JEhistos.fill(HIST("hNResoPerEventInJet"), nResoInTrig); + int nJets = 0; for (auto chargedjet : chargedjets) { JEhistos.fill(HIST("FJetaHistogram"), chargedjet.eta()); JEhistos.fill(HIST("FJphiHistogram"), chargedjet.phi()); JEhistos.fill(HIST("FJptHistogram"), chargedjet.pt()); - // JEhistos.fill(HIST("FJnchHistogram"), chargedjet.tracks().size()); nJets++; } @@ -457,7 +608,7 @@ struct phiInJets { // return; for (auto& trackC : tracks) { - auto originalTrack = trackC.track_as>(); + auto originalTrack = trackC.track_as>(); JEhistos.fill(HIST("hDCArToPv"), originalTrack.dcaXY()); JEhistos.fill(HIST("hDCAzToPv"), originalTrack.dcaZ()); JEhistos.fill(HIST("rawpT"), originalTrack.pt()); @@ -487,9 +638,9 @@ struct phiInJets { //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - using myCompleteTracks = soa::Join; - using myCompleteJetTracks = soa::Join; - int nJEEvents = 0; + using myCompleteTracks = soa::Join; + using myCompleteJetTracks = soa::Join; + int nJEEvents = 0; int nprocessRecEvents = 0; void processRec(o2::aod::JCollision const& collision, myCompleteJetTracks const& tracks, soa::Filtered const& mcdjets, aod::McParticles const&, myCompleteTracks const& /*originalTracks*/) { @@ -540,7 +691,7 @@ struct phiInJets { if (!trackSelection(originalTrack)) continue; if (cfgSimPID) - if (!trackPID(originalTrack)) + if (!trackPID(originalTrack, true)) continue; if (track.has_mcParticle()) { @@ -560,12 +711,16 @@ struct phiInJets { if (!trackSelection(originalTrack2)) continue; if (cfgSimPID) - if (!trackPID(originalTrack2)) - continue; - - if (originalTrack.index() >= originalTrack2.index()) - continue; - + if (!trackPID(originalTrack2,false)) + continue; + if(!cfgIsKstar){ + if (originalTrack.globalIndex() >= originalTrack2.globalIndex()) + continue; + } + else{ + if (originalTrack.globalIndex() == originalTrack2.globalIndex()) + continue; + } if (fabs(originalTrack.eta()) > cfgtrkMaxEta || fabs(originalTrack2.eta()) > cfgtrkMaxEta) continue; @@ -576,8 +731,15 @@ struct phiInJets { auto part2 = track2.mcParticle(); if (fabs(part1.pdgCode()) != 321) continue; // Not Kaon - if (fabs(part2.pdgCode()) != 321) - continue; // Not Kaon + if(!cfgIsKstar){ + if (fabs(part2.pdgCode()) != 321) + continue; // Not Kaon + } + else{ + if (fabs(part2.pdgCode()) != 211) + continue; // Not Kaon + } + if (!part1.has_mothers()) continue; // Not decaying Kaon if (!part2.has_mothers()) @@ -597,23 +759,43 @@ struct phiInJets { mothers2PDG.push_back(part2_mom.pdgCode()); } - if (mothers1PDG[0] != 333) - continue; // mother not phi - if (mothers2PDG[0] != 333) - continue; // mother not phi + if(!cfgIsKstar){ + if (mothers1PDG[0] != 333) + continue; // mother not phi + if (mothers2PDG[0] != 333) + continue; // mother not phi + } + else{ + if (mothers1PDG[0] != 313) + continue; // mother not phi + if (mothers2PDG[0] != 313) + continue; // mother not phi + } if (mothers1[0] != mothers2[0]) continue; // Kaons not from the same phi TLorentzVector lDecayDaughter1, lDecayDaughter2, lResonance; lDecayDaughter1.SetXYZM(originalTrack.px(), originalTrack.py(), originalTrack.pz(), massKa); - lDecayDaughter2.SetXYZM(originalTrack2.px(), originalTrack2.py(), originalTrack2.pz(), massKa); + if(!cfgIsKstar) + lDecayDaughter2.SetXYZM(originalTrack2.px(), originalTrack2.py(), originalTrack2.pz(), massKa); + else + lDecayDaughter2.SetXYZM(originalTrack2.px(), originalTrack2.py(), originalTrack2.pz(), massPi); lResonance = lDecayDaughter1 + lDecayDaughter2; + + double phidiff_Kaons = TVector2::Phi_mpi_pi(lDecayDaughter2.Phi() - lDecayDaughter1.Phi()); + double etadiff_Kaons = lDecayDaughter2.Eta() - lDecayDaughter1.Eta(); + double R_Kaons = TMath::Sqrt((etadiff_Kaons * etadiff_Kaons) + (phidiff_Kaons * phidiff_Kaons)); if (fabs(lResonance.Eta()) > cfgtrkMaxEta) continue; + JEhistos.fill(HIST("hMCRec_nonmatch_hUSS_KtoKangle_v_pt"),R_Kaons, lResonance.Pt()); JEhistos.fill(HIST("ptJEHistogramPhi"), lResonance.Pt()); - + + + //Now we do jets bool jetFlag = false; - for (std::vector::size_type i = 0; i < mcd_pt.size(); i++) { + int goodjets = 0; + double jetpt = 0; + for (int i = 0; i < mcd_pt.size(); i++) { double phidiff = TVector2::Phi_mpi_pi(mcd_phi[i] - lResonance.Phi()); double etadiff = mcd_eta[i] - lResonance.Eta(); double R = TMath::Sqrt((etadiff * etadiff) + (phidiff * phidiff)); @@ -628,16 +810,23 @@ struct phiInJets { JEhistos.fill(HIST("hMCRec_nonmatch_hUSS_Kangle_v_pt"), R_K1, lResonance.Pt()); JEhistos.fill(HIST("hMCRec_nonmatch_hUSS_Kangle_v_pt"), R_K2, lResonance.Pt()); } - if (R < cfgjetR) + if (R < cfgjetR){ jetFlag = true; + jetpt = mcd_pt[i]; + goodjets++; + } } + + if(cfgSingleJet) + if(goodjets>1) + jetpt=DistinguishJetsMC(mcd_pt, mcd_phi, mcd_eta, lResonance); if (jetFlag) { JEhistos.fill(HIST("hMCRec_nonmatch_hUSS_INSIDE_pt_v_eta"), lResonance.Pt(), lResonance.Eta()); JEhistos.fill(HIST("hMCRec_nonmatch_hUSS_INSIDE_1D"), lResonance.M()); if (lResonance.Pt() > 2.0 && lResonance.Pt() < 3) JEhistos.fill(HIST("hMCRec_nonmatch_hUSS_INSIDE_1D_2_3"), lResonance.M()); - JEhistos.fill(HIST("hMCRec_nonmatch_hUSS_INSIDE"), 1.0, lResonance.Pt(), lResonance.M()); + JEhistos.fill(HIST("hMCRec_nonmatch_hUSS_INSIDE"), jetpt, lResonance.Pt(), lResonance.M()); } else if (!jetFlag && mcd_pt.size() > 0) { JEhistos.fill(HIST("hMCRec_nonmatch_hUSS_OUTSIDE_TRIG_1D"), lResonance.M()); @@ -645,7 +834,7 @@ struct phiInJets { if (lResonance.Pt() > 2.0 && lResonance.Pt() < 3) JEhistos.fill(HIST("hMCRec_nonmatch_hUSS_OUTSIDE_TRIG_1D_2_3"), lResonance.M()); - JEhistos.fill(HIST("hMCRec_nonmatch_hUSS_OUTSIDE_TRIG"), 1.0, lResonance.Pt(), lResonance.M()); + JEhistos.fill(HIST("hMCRec_nonmatch_hUSS_OUTSIDE_TRIG"), jetpt, lResonance.Pt(), lResonance.M()); } else if (!jetFlag) { JEhistos.fill(HIST("hMCRec_nonmatch_hUSS_OUTSIDE_1D"), lResonance.M()); @@ -653,7 +842,7 @@ struct phiInJets { if (lResonance.Pt() > 2.0 && lResonance.Pt() < 3) JEhistos.fill(HIST("hMCRec_nonmatch_hUSS_OUTSIDE_1D_2_3"), lResonance.M()); - JEhistos.fill(HIST("hMCRec_nonmatch_hUSS_OUTSIDE"), 1.0, lResonance.Pt(), lResonance.M()); + JEhistos.fill(HIST("hMCRec_nonmatch_hUSS_OUTSIDE"), jetpt, lResonance.Pt(), lResonance.M()); } //! jetflag if (hasJets) { @@ -737,15 +926,32 @@ struct phiInJets { if (fabs(mcParticle.eta()) <= cfgtrkMaxEta) { // watch out for context!!! TLorentzVector lResonance; lResonance.SetPxPyPzE(mcParticle.px(), mcParticle.py(), mcParticle.pz(), mcParticle.e()); - if (abs(mcParticle.pdgCode()) == 333) { + + int GenPID=0; + if(!cfgIsKstar) + GenPID = 333; + else + GenPID = 313; + + if (abs(mcParticle.pdgCode()) == GenPID) { JEhistos.fill(HIST("ptGeneratedPhi_ALLBR"), mcParticle.pt()); bool skip = false; + // First we check for Forced BR - if (mcParticle.has_daughters()) - for (auto& dgth : mcParticle.daughters_as()) - if (fabs(dgth.pdgCode()) != 321) - skip = true; + // if we check for Phi + if(!cfgIsKstar){ + if (mcParticle.has_daughters()) + for (auto& dgth : mcParticle.daughters_as()) + if (fabs(dgth.pdgCode()) != 321) + skip = true; + } + else{ + if (mcParticle.has_daughters()) + for (auto& dgth : mcParticle.daughters_as()) + if (fabs(dgth.pdgCode()) != 321 || fabs(dgth.pdgCode()) != 211 ) + skip = true; + } if (skip && cfgBR) continue; @@ -753,11 +959,13 @@ struct phiInJets { JEhistos.fill(HIST("mGeneratedPhi"), lResonance.M()); ////////////////////////////Implementation of phi finding - + + int goodjets = 0; + double jetpt = 0; TLorentzVector lResonance; lResonance.SetPxPyPzE(mcParticle.px(), mcParticle.py(), mcParticle.pz(), mcParticle.e()); bool jetFlag = false; - for (std::vector::size_type i = 0; i < mcp_pt.size(); i++) { + for (int i = 0; i < mcp_pt.size(); i++) { double phidiff = TVector2::Phi_mpi_pi(mcp_phi[i] - lResonance.Phi()); double etadiff = mcp_eta[i] - lResonance.Eta(); double R = TMath::Sqrt((etadiff * etadiff) + (phidiff * phidiff)); @@ -770,16 +978,23 @@ struct phiInJets { JEhistos.fill(HIST("hMCTrue_nonmatch_hUSS_Kangle_v_pt"), R_K, lResonance.Pt()); } } - if (R < cfgjetR) + if (R < cfgjetR){ jetFlag = true; + jetpt = mcp_pt[i]; + goodjets++; + } } + if(cfgSingleJet) + if(goodjets>1) + jetpt=DistinguishJetsMC(mcp_pt, mcp_phi, mcp_eta, lResonance); + if (jetFlag) { JEhistos.fill(HIST("hMCTrue_nonmatch_hUSS_INSIDE_pt_v_eta"), lResonance.Pt(), lResonance.Eta()); JEhistos.fill(HIST("hMCTrue_nonmatch_hUSS_INSIDE_1D"), lResonance.M()); if (lResonance.Pt() > 2.0 && lResonance.Pt() < 3) JEhistos.fill(HIST("hMCTrue_nonmatch_hUSS_INSIDE_1D_2_3"), lResonance.M()); - JEhistos.fill(HIST("hMCTrue_nonmatch_hUSS_INSIDE"), 1.0, lResonance.Pt(), lResonance.M()); + JEhistos.fill(HIST("hMCTrue_nonmatch_hUSS_INSIDE"), jetpt, lResonance.Pt(), lResonance.M()); } else if (!jetFlag && mcp_pt.size() > 0) { JEhistos.fill(HIST("hMCTrue_nonmatch_hUSS_OUTSIDE_TRIG_1D"), lResonance.M()); @@ -787,7 +1002,7 @@ struct phiInJets { if (lResonance.Pt() > 2.0 && lResonance.Pt() < 3) JEhistos.fill(HIST("hMCTrue_nonmatch_hUSS_OUTSIDE_TRIG_1D_2_3"), lResonance.M()); - JEhistos.fill(HIST("hMCTrue_nonmatch_hUSS_OUTSIDE_TRIG"), 1.0, lResonance.Pt(), lResonance.M()); + JEhistos.fill(HIST("hMCTrue_nonmatch_hUSS_OUTSIDE_TRIG"), jetpt, lResonance.Pt(), lResonance.M()); } else if (!jetFlag) { JEhistos.fill(HIST("hMCTrue_nonmatch_hUSS_OUTSIDE_1D"), lResonance.M()); @@ -795,7 +1010,7 @@ struct phiInJets { if (lResonance.Pt() > 2.0 && lResonance.Pt() < 3) JEhistos.fill(HIST("hMCTrue_nonmatch_hUSS_OUTSIDE_1D_2_3"), lResonance.M()); - JEhistos.fill(HIST("hMCTrue_nonmatch_hUSS_OUTSIDE"), 1.0, lResonance.Pt(), lResonance.M()); + JEhistos.fill(HIST("hMCTrue_nonmatch_hUSS_OUTSIDE"), jetpt, lResonance.Pt(), lResonance.M()); } //! jetflag @@ -819,7 +1034,6 @@ struct phiInJets { using JetMCPTable = soa::Filtered>; using JetMCDTable = soa::Filtered>; - // void processMatchedGen(o2::aod::JMcCollision const& collision, aod::JMcParticles const& mcParticles, soa::Filtered const& mcpjets) int nprocessSimJEEvents = 0; void processMatchedGen(aod::JMcCollision const& collision, soa::SmallGroups> const& recocolls, @@ -896,32 +1110,58 @@ struct phiInJets { if (fabs(mcParticle.eta()) > cfgtrkMaxEta) continue; - if (fabs(mcParticle.pdgCode()) == 333) { + int GenPID = 0; + + if(!cfgIsKstar) + GenPID = 333; + else + GenPID = 313; + + if (fabs(mcParticle.pdgCode()) == GenPID) { + bool skip = false; // First we check for Forced BR - if (mcParticle.has_daughters()) - for (auto& dgth : mcParticle.daughters_as()) - if (fabs(dgth.pdgCode()) != 321) - skip = true; - - if (skip && cfgBR) - continue; + // if we check for Phi + if(!cfgIsKstar){ + if (mcParticle.has_daughters()) + for (auto& dgth : mcParticle.daughters_as()) + if (fabs(dgth.pdgCode()) != 321) + skip = true; + } + else{ + if (mcParticle.has_daughters()) + for (auto& dgth : mcParticle.daughters_as()) + if (fabs(dgth.pdgCode()) != 321 || fabs(dgth.pdgCode()) != 211 ) + skip = true; + } + + if (skip && cfgBR) + continue; + int goodjets = 0; + double jetpt = 0; TLorentzVector lResonance; lResonance.SetPxPyPzE(mcParticle.px(), mcParticle.py(), mcParticle.pz(), mcParticle.e()); bool jetFlag = false; - for (std::vector::size_type i = 0; i < mcp_pt.size(); i++) { + for (int i = 0; i < mcp_pt.size(); i++) { double phidiff = TVector2::Phi_mpi_pi(mcp_phi[i] - lResonance.Phi()); double etadiff = mcp_eta[i] - lResonance.Eta(); double R = TMath::Sqrt((etadiff * etadiff) + (phidiff * phidiff)); - if (R < cfgjetR) - jetFlag = true; - } + if (R < cfgjetR){ + jetFlag = true; + jetpt = mcp_pt[i]; + goodjets++; + } + } + if(cfgSingleJet) + if(goodjets>1) + jetpt=DistinguishJetsMC(mcp_pt, mcp_phi, mcp_eta, lResonance); + if (jetFlag) { JEhistos.fill(HIST("hMCTrue_hUSS_INSIDE_1D"), lResonance.M()); if (lResonance.Pt() > 2.0 && lResonance.Pt() < 3) JEhistos.fill(HIST("hMCTrue_hUSS_INSIDE_1D_2_3"), lResonance.M()); - JEhistos.fill(HIST("hMCTrue_hUSS_INSIDE"), 1.0, lResonance.Pt(), lResonance.M()); + JEhistos.fill(HIST("hMCTrue_hUSS_INSIDE"), jetpt, lResonance.Pt(), lResonance.M()); } else if (!jetFlag && mcp_pt.size() > 0) { JEhistos.fill(HIST("hMCTrue_hUSS_OUTSIDE_TRIG_1D"), lResonance.M()); @@ -929,7 +1169,7 @@ struct phiInJets { if (lResonance.Pt() > 2.0 && lResonance.Pt() < 3) JEhistos.fill(HIST("hMCTrue_hUSS_OUTSIDE_TRIG_1D_2_3"), lResonance.M()); - JEhistos.fill(HIST("hMCTrue_hUSS_OUTSIDE_TRIG"), 1.0, lResonance.Pt(), lResonance.M()); + JEhistos.fill(HIST("hMCTrue_hUSS_OUTSIDE_TRIG"), jetpt, lResonance.Pt(), lResonance.M()); } else if (!jetFlag) { JEhistos.fill(HIST("hMCTrue_hUSS_OUTSIDE_1D"), lResonance.M()); @@ -937,7 +1177,7 @@ struct phiInJets { if (lResonance.Pt() > 2.0 && lResonance.Pt() < 3) JEhistos.fill(HIST("hMCTrue_hUSS_OUTSIDE_1D_2_3"), lResonance.M()); - JEhistos.fill(HIST("hMCTrue_hUSS_OUTSIDE"), 1.0, lResonance.Pt(), lResonance.M()); + JEhistos.fill(HIST("hMCTrue_hUSS_OUTSIDE"), jetpt, lResonance.Pt(), lResonance.M()); } //! jetflag } // chech for phi @@ -1016,17 +1256,23 @@ struct phiInJets { auto trk1 = track1.track_as(); for (const auto& track2 : tracks) { auto trk2 = track2.track_as(); - if (trk1.index() >= trk2.index()) - continue; + if(!cfgIsKstar){ + if (trk1.globalIndex() >= trk2.globalIndex()) + continue; + } + else{ + if (trk1.globalIndex() == trk2.globalIndex()) + continue; + } if (fabs(trk1.eta()) > cfgtrkMaxEta || fabs(trk2.eta()) > cfgtrkMaxEta) continue; if ((trk1.sign() * trk2.sign()) > 0) continue; // Not K+K- if (trackSelection(trk1) && trackSelection(trk2)) { if (cfgSimPID) { - if (!trackPID(trk1)) + if (!trackPID(trk1,true)) continue; - if (!trackPID(trk2)) + if (!trackPID(trk2,false)) continue; } if (track1.has_mcParticle() && track2.has_mcParticle()) { @@ -1034,8 +1280,14 @@ struct phiInJets { auto part2 = track2.mcParticle(); if (fabs(part1.pdgCode()) != 321) continue; // Not Kaon - if (fabs(part2.pdgCode()) != 321) - continue; // Not Kaon + if(!cfgIsKstar){ + if (fabs(part2.pdgCode()) != 321) + continue; // Not Kaon + } + else{ + if (fabs(part2.pdgCode()) != 211) + continue; // Not Kaon + } if (!part1.has_mothers()) continue; // Not decaying Kaon if (!part2.has_mothers()) @@ -1058,47 +1310,76 @@ struct phiInJets { mothers2PDG.push_back(part2_mom.pdgCode()); mothers2Pt.push_back(part2_mom.pt()); } - if (mothers1PDG[0] != 333) - continue; // mother not phi - if (mothers2PDG[0] != 333) - continue; // mother not phi + if(!cfgIsKstar){ + if (mothers1PDG[0] != 333) + continue; // mother not phi + if (mothers2PDG[0] != 333) + continue; // mother not phi + } + else{ + if (mothers1PDG[0] != 313) + continue; // mother not phi + if (mothers2PDG[0] != 313) + continue; // mother not phi + } if (mothers1[0] != mothers2[0]) continue; // Kaons not from the same phi TLorentzVector lDecayDaughter1, lDecayDaughter2, lResonance; lDecayDaughter1.SetXYZM(trk1.px(), trk1.py(), trk1.pz(), massKa); - lDecayDaughter2.SetXYZM(trk2.px(), trk2.py(), trk2.pz(), massKa); + if(!cfgIsKstar) + lDecayDaughter2.SetXYZM(trk2.px(), trk2.py(), trk2.pz(), massKa); + else + lDecayDaughter2.SetXYZM(trk2.px(), trk2.py(), trk2.pz(), massPi); + lResonance = lDecayDaughter1 + lDecayDaughter2; - if (fabs(lResonance.Eta()) > cfgtrkMaxEta) continue; bool jetFlag = false; - for (std::vector::size_type i = 0; i < mcd_pt.size(); i++) { + int goodjets = 0; + double jetpt_mcp = 0; + double jetpt_mcd = 0; + for (int i = 0; i < mcd_pt.size(); i++) { double phidiff = TVector2::Phi_mpi_pi(mcd_phi[i] - lResonance.Phi()); double etadiff = mcd_eta[i] - lResonance.Eta(); double R = TMath::Sqrt((etadiff * etadiff) + (phidiff * phidiff)); - if (R < cfgjetR) + if (R < cfgjetR){ + jetpt_mcd = mcd_pt[i]; + jetpt_mcp = mcp_pt[i]; + goodjets++; jetFlag = true; - - if (jetFlag) { // Fill Resp. Matrix - if (cDebugLevel > 0) { - std::cout << "******************************************" << std::endl; - std::cout << "Rec. Phi Pt: " << lResonance.Pt() << std::endl; - std::cout << "Rec. Jet Pt: " << mcd_pt[i] << std::endl; - std::cout << "Gen. Phi Pt: " << mothers1Pt[0] << std::endl; - std::cout << "Gen. Jet Pt: " << mcp_pt[i] << std::endl; - std::cout << "******************************************" << std::endl; - } - JEhistos.fill(HIST("Resp_Matrix_MATCHED"), lResonance.Pt(), mcd_pt[i], mothers1Pt[0], mcp_pt[i]); - } - } - + } + } + + if(cfgSingleJet) + if(goodjets>1){ + jetpt_mcd=DistinguishJetsMC(mcd_pt, mcd_phi, mcd_eta, lResonance); + jetpt_mcp=DistinguishJetsMC(mcp_pt, mcp_phi, mcp_eta, lResonance); + } + + if (jetFlag) { // Fill Resp. Matrix + if (cDebugLevel > 0) { + std::cout << "******************************************" << std::endl; + std::cout << "Rec. Phi Pt: " << lResonance.Pt() << std::endl; + std::cout << "Rec. Jet Pt: " << jetpt_mcd << std::endl; + std::cout << "Gen. Phi Pt: " << mothers1Pt[0] << std::endl; + std::cout << "Gen. Jet Pt: " << jetpt_mcp << std::endl; + std::cout << "******************************************" << std::endl; + } + JEhistos.fill(HIST("Resp_Matrix_MATCHED"), lResonance.Pt(), jetpt_mcd, mothers1Pt[0], jetpt_mcp); + int dice = rand() % 2; + if(dice>0) + JEhistos.fill(HIST("Resp_Matrix_MATCHED_rand0"), lResonance.Pt(), jetpt_mcd, mothers1Pt[0], jetpt_mcp); + else + JEhistos.fill(HIST("Resp_Matrix_MATCHED_rand1"), lResonance.Pt(), jetpt_mcd, mothers1Pt[0], jetpt_mcp); + + } if (jetFlag) { JEhistos.fill(HIST("hMCRec_hUSS_INSIDE_1D"), lResonance.M()); if (lResonance.Pt() > 2.0 && lResonance.Pt() < 3) JEhistos.fill(HIST("hMCRec_hUSS_INSIDE_1D_2_3"), lResonance.M()); - JEhistos.fill(HIST("hMCRec_hUSS_INSIDE"), 1.0, lResonance.Pt(), lResonance.M()); + JEhistos.fill(HIST("hMCRec_hUSS_INSIDE"), jetpt_mcd, lResonance.Pt(), lResonance.M()); } else if (!jetFlag && mcd_pt.size() > 0) { JEhistos.fill(HIST("hMCRec_hUSS_OUTSIDE_TRIG_1D"), lResonance.M()); @@ -1106,7 +1387,7 @@ struct phiInJets { if (lResonance.Pt() > 2.0 && lResonance.Pt() < 3) JEhistos.fill(HIST("hMCRec_hUSS_OUTSIDE_TRIG_1D_2_3"), lResonance.M()); - JEhistos.fill(HIST("hMCRec_hUSS_OUTSIDE_TRIG"), 1.0, lResonance.Pt(), lResonance.M()); + JEhistos.fill(HIST("hMCRec_hUSS_OUTSIDE_TRIG"), jetpt_mcd, lResonance.Pt(), lResonance.M()); } else if (!jetFlag) { JEhistos.fill(HIST("hMCRec_hUSS_OUTSIDE_1D"), lResonance.M()); @@ -1114,7 +1395,7 @@ struct phiInJets { if (lResonance.Pt() > 2.0 && lResonance.Pt() < 3) JEhistos.fill(HIST("hMCRec_hUSS_OUTSIDE_1D_2_3"), lResonance.M()); - JEhistos.fill(HIST("hMCRec_hUSS_OUTSIDE"), 1.0, lResonance.Pt(), lResonance.M()); + JEhistos.fill(HIST("hMCRec_hUSS_OUTSIDE"), jetpt_mcd, lResonance.Pt(), lResonance.M()); } //! jetflag From 9d8a771bbe74519fb79b80d3ea2b87eadaa3f71c Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Tue, 23 Jul 2024 04:38:51 +0000 Subject: [PATCH 02/12] Please consider the following formatting changes --- PWGJE/Tasks/phiInJets.cxx | 561 ++++++++++++++++++-------------------- 1 file changed, 271 insertions(+), 290 deletions(-) diff --git a/PWGJE/Tasks/phiInJets.cxx b/PWGJE/Tasks/phiInJets.cxx index 3a18b121159..90a09d60b70 100644 --- a/PWGJE/Tasks/phiInJets.cxx +++ b/PWGJE/Tasks/phiInJets.cxx @@ -148,7 +148,6 @@ struct phiInJets { JEhistos.add("nEvents_MCRec_MATCHED", "nEvents_MCRec_MATCHED", kTH1F, {{4, 0.0, 4.0}}); JEhistos.add("nEvents_MCGen_MATCHED", "nEvents_MCGen_MATCHED", kTH1F, {{4, 0.0, 4.0}}); - JEhistos.add("hMCRec_nonmatch_hUSS_KtoKangle_v_pt", "hMCRec_nonmatch_hUSS_KtoKangle_v_pt", kTH2F, {axisEta, PtAxis}); JEhistos.add("hMCTrue_nonmatch_hUSS_Kangle_v_pt", "hMCTrue_nonmatch_hUSS_Kangle_v_pt", kTH2F, {axisEta, PtAxis}); JEhistos.add("hMCRec_nonmatch_hUSS_Kangle_v_pt", "hMCRec_nonmatch_hUSS_Kangle_v_pt", kTH2F, {axisEta, PtAxis}); @@ -246,7 +245,7 @@ struct phiInJets { using EventCandidates = soa::Join; // , aod::CentFT0Ms, aod::CentFT0As, aod::CentFT0Cs using TrackCandidates = soa::Join; + aod::pidTPCKa, aod::pidTOFKa, aod::pidTPCPi, aod::pidTOFPi>; Filter jetCuts = aod::jet::pt > cfgjetPtMin&& aod::jet::r == nround(cfgjetR.node() * 100.0f); // Function for track quality cuts @@ -299,15 +298,15 @@ struct phiInJets { { bool pid = false; - if(!cfgIsKstar) - pid=trackPIDKaon(candidate); + if (!cfgIsKstar) + pid = trackPIDKaon(candidate); - else{ - if(!FT) - pid=trackPIDPion(candidate); + else { + if (!FT) + pid = trackPIDPion(candidate); else - pid=trackPIDKaon(candidate); - } + pid = trackPIDKaon(candidate); + } return pid; } @@ -331,74 +330,72 @@ struct phiInJets { return false; } - template - bool trackPIDPion(const T& candidate) - { - bool tpcPIDPassed{false}, tofPIDPassed{false}; - if (std::abs(candidate.tpcNSigmaPi()) < cfgnTPCPID) - tpcPIDPassed = true; - - if (candidate.hasTOF()) { - if (std::abs(candidate.tofNSigmaPi()) < cfgnTOFPID) { - tofPIDPassed = true; - } - } else { - tofPIDPassed = true; - } - if (tpcPIDPassed && tofPIDPassed) { - return true; - } - return false; + template + bool trackPIDPion(const T& candidate) + { + bool tpcPIDPassed{false}, tofPIDPassed{false}; + if (std::abs(candidate.tpcNSigmaPi()) < cfgnTPCPID) + tpcPIDPassed = true; + + if (candidate.hasTOF()) { + if (std::abs(candidate.tofNSigmaPi()) < cfgnTOFPID) { + tofPIDPassed = true; + } + } else { + tofPIDPassed = true; + } + if (tpcPIDPassed && tofPIDPassed) { + return true; + } + return false; } ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// - + template double DistinguishJets(const JetType& jets, const TLorentzVector lResonance) { if (cDebugLevel > 0) - std::cout<<"oof, multiple jets fit to the same phi. Time to find the best phi-jet link"< - double DistinguishJetsMC(const Jet_pt& jet_pt, const Jet_phi& jet_phi, const Jet_eta& jet_eta,const TLorentzVector lResonance) + double DistinguishJetsMC(const Jet_pt& jet_pt, const Jet_phi& jet_phi, const Jet_eta& jet_eta, const TLorentzVector lResonance) { if (cDebugLevel > 0) - std::cout<<"oof, multiple jets fit to the same phi. Time to find the best phi-jet link"<= trk2.globalIndex()) - return -1; // For Phi, we only need to iterate each pair once - } - else{ + return -1; // For Phi, we only need to iterate each pair once + } else { if (trk1.globalIndex() == trk2.globalIndex()) - return -1; // For Kstar, we need to run (0,1), (1,0) pairs as well. but same id pairs are not needed. + return -1; // For Kstar, we need to run (0,1), (1,0) pairs as well. but same id pairs are not needed. } lDecayDaughter1.SetXYZM(trk1.px(), trk1.py(), trk1.pz(), massKa); - if(!cfgIsKstar) + if (!cfgIsKstar) lDecayDaughter2.SetXYZM(trk2.px(), trk2.py(), trk2.pz(), massKa); else lDecayDaughter2.SetXYZM(trk2.px(), trk2.py(), trk2.pz(), massPi); - + lResonance = lDecayDaughter1 + lDecayDaughter2; if (std::abs(lResonance.Eta()) > cfgtrkMaxEta) - return -1; - + return -1; + ///////////////////////////////////////////////////////////////////////////// // Fill Global Event Minv if (trk1.sign() * trk2.sign() < 0) { @@ -468,18 +464,18 @@ struct phiInJets { double phidiff = TVector2::Phi_mpi_pi(jet.phi() - lResonance.Phi()); double etadiff = jet.eta() - lResonance.Eta(); double R = TMath::Sqrt((etadiff * etadiff) + (phidiff * phidiff)); - if (R < cfgjetR){ + if (R < cfgjetR) { jetFlag = true; - jetpt = jet.pt(); - goodjets++; - } + jetpt = jet.pt(); + goodjets++; + } } - - if(cfgSingleJet) - if(goodjets>1) - jetpt=DistinguishJets(jets, lResonance); - - ///////////////////////////////////////////////////////////////////////////// + + if (cfgSingleJet) + if (goodjets > 1) + jetpt = DistinguishJets(jets, lResonance); + + ///////////////////////////////////////////////////////////////////////////// // Fill inside Jet if (jetFlag) { if (trk1.sign() * trk2.sign() < 0) { @@ -534,28 +530,25 @@ struct phiInJets { } } //! jetflag ///////////////////////////////////////////////////////////////////////////// - if(!cfgIsKstar){ - if(lResonance.M()>1.005 && lResonance.M()<1.035){ - if(jetFlag) - return 3; - if(goodjets>0) - return 2; - return 1; - } - else - return -1; + if (!cfgIsKstar) { + if (lResonance.M() > 1.005 && lResonance.M() < 1.035) { + if (jetFlag) + return 3; + if (goodjets > 0) + return 2; + return 1; + } else + return -1; + } else { + if (lResonance.M() > 0.85 && lResonance.M() < 0.95) { + if (jetFlag) + return 3; + if (goodjets > 0) + return 2; + return 1; + } else + return -1; } - else{ - if(lResonance.M()>0.85 && lResonance.M()<0.95){ - if(jetFlag) - return 3; - if(goodjets>0) - return 2; - return 1; - } - else - return -1; - } } // MinvReconstruction ///////////////////////////////////////////////////////////////////////////// @@ -582,18 +575,18 @@ struct phiInJets { auto trk1 = track1.track_as>(); auto trk2 = track2.track_as>(); int Reso = minvReconstruction(1.0, trk1, trk2, chargedjets); - if(Reso>0) - nReso++; - if(Reso>1) - nResoWTrig++; - if(Reso>2) - nResoInTrig++; + if (Reso > 0) + nReso++; + if (Reso > 1) + nResoWTrig++; + if (Reso > 2) + nResoInTrig++; } - //Here we have to fill the number of reso candidates per event + // Here we have to fill the number of reso candidates per event JEhistos.fill(HIST("hNResoPerEvent"), nReso); JEhistos.fill(HIST("hNResoPerEventWJet"), nResoWTrig); JEhistos.fill(HIST("hNResoPerEventInJet"), nResoInTrig); - + int nJets = 0; for (auto chargedjet : chargedjets) { JEhistos.fill(HIST("FJetaHistogram"), chargedjet.eta()); @@ -638,9 +631,9 @@ struct phiInJets { //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - using myCompleteTracks = soa::Join; - using myCompleteJetTracks = soa::Join; - int nJEEvents = 0; + using myCompleteTracks = soa::Join; + using myCompleteJetTracks = soa::Join; + int nJEEvents = 0; int nprocessRecEvents = 0; void processRec(o2::aod::JCollision const& collision, myCompleteJetTracks const& tracks, soa::Filtered const& mcdjets, aod::McParticles const&, myCompleteTracks const& /*originalTracks*/) { @@ -711,16 +704,15 @@ struct phiInJets { if (!trackSelection(originalTrack2)) continue; if (cfgSimPID) - if (!trackPID(originalTrack2,false)) - continue; - if(!cfgIsKstar){ - if (originalTrack.globalIndex() >= originalTrack2.globalIndex()) - continue; - } - else{ - if (originalTrack.globalIndex() == originalTrack2.globalIndex()) - continue; - } + if (!trackPID(originalTrack2, false)) + continue; + if (!cfgIsKstar) { + if (originalTrack.globalIndex() >= originalTrack2.globalIndex()) + continue; + } else { + if (originalTrack.globalIndex() == originalTrack2.globalIndex()) + continue; + } if (fabs(originalTrack.eta()) > cfgtrkMaxEta || fabs(originalTrack2.eta()) > cfgtrkMaxEta) continue; @@ -731,15 +723,14 @@ struct phiInJets { auto part2 = track2.mcParticle(); if (fabs(part1.pdgCode()) != 321) continue; // Not Kaon - if(!cfgIsKstar){ - if (fabs(part2.pdgCode()) != 321) - continue; // Not Kaon - } - else{ - if (fabs(part2.pdgCode()) != 211) - continue; // Not Kaon - } - + if (!cfgIsKstar) { + if (fabs(part2.pdgCode()) != 321) + continue; // Not Kaon + } else { + if (fabs(part2.pdgCode()) != 211) + continue; // Not Kaon + } + if (!part1.has_mothers()) continue; // Not decaying Kaon if (!part2.has_mothers()) @@ -759,42 +750,40 @@ struct phiInJets { mothers2PDG.push_back(part2_mom.pdgCode()); } - if(!cfgIsKstar){ - if (mothers1PDG[0] != 333) - continue; // mother not phi - if (mothers2PDG[0] != 333) - continue; // mother not phi - } - else{ - if (mothers1PDG[0] != 313) - continue; // mother not phi - if (mothers2PDG[0] != 313) - continue; // mother not phi - } + if (!cfgIsKstar) { + if (mothers1PDG[0] != 333) + continue; // mother not phi + if (mothers2PDG[0] != 333) + continue; // mother not phi + } else { + if (mothers1PDG[0] != 313) + continue; // mother not phi + if (mothers2PDG[0] != 313) + continue; // mother not phi + } if (mothers1[0] != mothers2[0]) continue; // Kaons not from the same phi TLorentzVector lDecayDaughter1, lDecayDaughter2, lResonance; lDecayDaughter1.SetXYZM(originalTrack.px(), originalTrack.py(), originalTrack.pz(), massKa); - if(!cfgIsKstar) - lDecayDaughter2.SetXYZM(originalTrack2.px(), originalTrack2.py(), originalTrack2.pz(), massKa); - else - lDecayDaughter2.SetXYZM(originalTrack2.px(), originalTrack2.py(), originalTrack2.pz(), massPi); + if (!cfgIsKstar) + lDecayDaughter2.SetXYZM(originalTrack2.px(), originalTrack2.py(), originalTrack2.pz(), massKa); + else + lDecayDaughter2.SetXYZM(originalTrack2.px(), originalTrack2.py(), originalTrack2.pz(), massPi); lResonance = lDecayDaughter1 + lDecayDaughter2; - - double phidiff_Kaons = TVector2::Phi_mpi_pi(lDecayDaughter2.Phi() - lDecayDaughter1.Phi()); - double etadiff_Kaons = lDecayDaughter2.Eta() - lDecayDaughter1.Eta(); - double R_Kaons = TMath::Sqrt((etadiff_Kaons * etadiff_Kaons) + (phidiff_Kaons * phidiff_Kaons)); + + double phidiff_Kaons = TVector2::Phi_mpi_pi(lDecayDaughter2.Phi() - lDecayDaughter1.Phi()); + double etadiff_Kaons = lDecayDaughter2.Eta() - lDecayDaughter1.Eta(); + double R_Kaons = TMath::Sqrt((etadiff_Kaons * etadiff_Kaons) + (phidiff_Kaons * phidiff_Kaons)); if (fabs(lResonance.Eta()) > cfgtrkMaxEta) continue; - JEhistos.fill(HIST("hMCRec_nonmatch_hUSS_KtoKangle_v_pt"),R_Kaons, lResonance.Pt()); + JEhistos.fill(HIST("hMCRec_nonmatch_hUSS_KtoKangle_v_pt"), R_Kaons, lResonance.Pt()); JEhistos.fill(HIST("ptJEHistogramPhi"), lResonance.Pt()); - - - //Now we do jets + + // Now we do jets bool jetFlag = false; - int goodjets = 0; - double jetpt = 0; + int goodjets = 0; + double jetpt = 0; for (int i = 0; i < mcd_pt.size(); i++) { double phidiff = TVector2::Phi_mpi_pi(mcd_phi[i] - lResonance.Phi()); double etadiff = mcd_eta[i] - lResonance.Eta(); @@ -810,16 +799,16 @@ struct phiInJets { JEhistos.fill(HIST("hMCRec_nonmatch_hUSS_Kangle_v_pt"), R_K1, lResonance.Pt()); JEhistos.fill(HIST("hMCRec_nonmatch_hUSS_Kangle_v_pt"), R_K2, lResonance.Pt()); } - if (R < cfgjetR){ + if (R < cfgjetR) { jetFlag = true; - jetpt = mcd_pt[i]; - goodjets++; - } + jetpt = mcd_pt[i]; + goodjets++; + } } - - if(cfgSingleJet) - if(goodjets>1) - jetpt=DistinguishJetsMC(mcd_pt, mcd_phi, mcd_eta, lResonance); + + if (cfgSingleJet) + if (goodjets > 1) + jetpt = DistinguishJetsMC(mcd_pt, mcd_phi, mcd_eta, lResonance); if (jetFlag) { JEhistos.fill(HIST("hMCRec_nonmatch_hUSS_INSIDE_pt_v_eta"), lResonance.Pt(), lResonance.Eta()); @@ -927,31 +916,30 @@ struct phiInJets { TLorentzVector lResonance; lResonance.SetPxPyPzE(mcParticle.px(), mcParticle.py(), mcParticle.pz(), mcParticle.e()); - int GenPID=0; - if(!cfgIsKstar) - GenPID = 333; - else - GenPID = 313; - + int GenPID = 0; + if (!cfgIsKstar) + GenPID = 333; + else + GenPID = 313; + if (abs(mcParticle.pdgCode()) == GenPID) { JEhistos.fill(HIST("ptGeneratedPhi_ALLBR"), mcParticle.pt()); bool skip = false; - + // First we check for Forced BR - // if we check for Phi - if(!cfgIsKstar){ - if (mcParticle.has_daughters()) - for (auto& dgth : mcParticle.daughters_as()) - if (fabs(dgth.pdgCode()) != 321) - skip = true; - } - else{ - if (mcParticle.has_daughters()) - for (auto& dgth : mcParticle.daughters_as()) - if (fabs(dgth.pdgCode()) != 321 || fabs(dgth.pdgCode()) != 211 ) - skip = true; - } + // if we check for Phi + if (!cfgIsKstar) { + if (mcParticle.has_daughters()) + for (auto& dgth : mcParticle.daughters_as()) + if (fabs(dgth.pdgCode()) != 321) + skip = true; + } else { + if (mcParticle.has_daughters()) + for (auto& dgth : mcParticle.daughters_as()) + if (fabs(dgth.pdgCode()) != 321 || fabs(dgth.pdgCode()) != 211) + skip = true; + } if (skip && cfgBR) continue; @@ -959,9 +947,9 @@ struct phiInJets { JEhistos.fill(HIST("mGeneratedPhi"), lResonance.M()); ////////////////////////////Implementation of phi finding - - int goodjets = 0; - double jetpt = 0; + + int goodjets = 0; + double jetpt = 0; TLorentzVector lResonance; lResonance.SetPxPyPzE(mcParticle.px(), mcParticle.py(), mcParticle.pz(), mcParticle.e()); bool jetFlag = false; @@ -978,16 +966,15 @@ struct phiInJets { JEhistos.fill(HIST("hMCTrue_nonmatch_hUSS_Kangle_v_pt"), R_K, lResonance.Pt()); } } - if (R < cfgjetR){ + if (R < cfgjetR) { jetFlag = true; - jetpt = mcp_pt[i]; - goodjets++; - } + jetpt = mcp_pt[i]; + goodjets++; + } } - if(cfgSingleJet) - if(goodjets>1) - jetpt=DistinguishJetsMC(mcp_pt, mcp_phi, mcp_eta, lResonance); - + if (cfgSingleJet) + if (goodjets > 1) + jetpt = DistinguishJetsMC(mcp_pt, mcp_phi, mcp_eta, lResonance); if (jetFlag) { JEhistos.fill(HIST("hMCTrue_nonmatch_hUSS_INSIDE_pt_v_eta"), lResonance.Pt(), lResonance.Eta()); @@ -1111,34 +1098,33 @@ struct phiInJets { continue; int GenPID = 0; - - if(!cfgIsKstar) - GenPID = 333; + + if (!cfgIsKstar) + GenPID = 333; else - GenPID = 313; + GenPID = 313; if (fabs(mcParticle.pdgCode()) == GenPID) { bool skip = false; // First we check for Forced BR - // if we check for Phi - if(!cfgIsKstar){ - if (mcParticle.has_daughters()) - for (auto& dgth : mcParticle.daughters_as()) - if (fabs(dgth.pdgCode()) != 321) - skip = true; - } - else{ - if (mcParticle.has_daughters()) - for (auto& dgth : mcParticle.daughters_as()) - if (fabs(dgth.pdgCode()) != 321 || fabs(dgth.pdgCode()) != 211 ) - skip = true; - } - - if (skip && cfgBR) - continue; - int goodjets = 0; - double jetpt = 0; + // if we check for Phi + if (!cfgIsKstar) { + if (mcParticle.has_daughters()) + for (auto& dgth : mcParticle.daughters_as()) + if (fabs(dgth.pdgCode()) != 321) + skip = true; + } else { + if (mcParticle.has_daughters()) + for (auto& dgth : mcParticle.daughters_as()) + if (fabs(dgth.pdgCode()) != 321 || fabs(dgth.pdgCode()) != 211) + skip = true; + } + + if (skip && cfgBR) + continue; + int goodjets = 0; + double jetpt = 0; TLorentzVector lResonance; lResonance.SetPxPyPzE(mcParticle.px(), mcParticle.py(), mcParticle.pz(), mcParticle.e()); bool jetFlag = false; @@ -1146,16 +1132,15 @@ struct phiInJets { double phidiff = TVector2::Phi_mpi_pi(mcp_phi[i] - lResonance.Phi()); double etadiff = mcp_eta[i] - lResonance.Eta(); double R = TMath::Sqrt((etadiff * etadiff) + (phidiff * phidiff)); - if (R < cfgjetR){ - jetFlag = true; - jetpt = mcp_pt[i]; - goodjets++; - } - } - if(cfgSingleJet) - if(goodjets>1) - jetpt=DistinguishJetsMC(mcp_pt, mcp_phi, mcp_eta, lResonance); - + if (R < cfgjetR) { + jetFlag = true; + jetpt = mcp_pt[i]; + goodjets++; + } + } + if (cfgSingleJet) + if (goodjets > 1) + jetpt = DistinguishJetsMC(mcp_pt, mcp_phi, mcp_eta, lResonance); if (jetFlag) { JEhistos.fill(HIST("hMCTrue_hUSS_INSIDE_1D"), lResonance.M()); @@ -1256,23 +1241,22 @@ struct phiInJets { auto trk1 = track1.track_as(); for (const auto& track2 : tracks) { auto trk2 = track2.track_as(); - if(!cfgIsKstar){ - if (trk1.globalIndex() >= trk2.globalIndex()) - continue; - } - else{ - if (trk1.globalIndex() == trk2.globalIndex()) - continue; - } + if (!cfgIsKstar) { + if (trk1.globalIndex() >= trk2.globalIndex()) + continue; + } else { + if (trk1.globalIndex() == trk2.globalIndex()) + continue; + } if (fabs(trk1.eta()) > cfgtrkMaxEta || fabs(trk2.eta()) > cfgtrkMaxEta) continue; if ((trk1.sign() * trk2.sign()) > 0) continue; // Not K+K- if (trackSelection(trk1) && trackSelection(trk2)) { if (cfgSimPID) { - if (!trackPID(trk1,true)) + if (!trackPID(trk1, true)) continue; - if (!trackPID(trk2,false)) + if (!trackPID(trk2, false)) continue; } if (track1.has_mcParticle() && track2.has_mcParticle()) { @@ -1280,14 +1264,13 @@ struct phiInJets { auto part2 = track2.mcParticle(); if (fabs(part1.pdgCode()) != 321) continue; // Not Kaon - if(!cfgIsKstar){ - if (fabs(part2.pdgCode()) != 321) - continue; // Not Kaon - } - else{ - if (fabs(part2.pdgCode()) != 211) - continue; // Not Kaon - } + if (!cfgIsKstar) { + if (fabs(part2.pdgCode()) != 321) + continue; // Not Kaon + } else { + if (fabs(part2.pdgCode()) != 211) + continue; // Not Kaon + } if (!part1.has_mothers()) continue; // Not decaying Kaon if (!part2.has_mothers()) @@ -1310,71 +1293,69 @@ struct phiInJets { mothers2PDG.push_back(part2_mom.pdgCode()); mothers2Pt.push_back(part2_mom.pt()); } - if(!cfgIsKstar){ - if (mothers1PDG[0] != 333) - continue; // mother not phi - if (mothers2PDG[0] != 333) - continue; // mother not phi - } - else{ - if (mothers1PDG[0] != 313) - continue; // mother not phi - if (mothers2PDG[0] != 313) - continue; // mother not phi - } + if (!cfgIsKstar) { + if (mothers1PDG[0] != 333) + continue; // mother not phi + if (mothers2PDG[0] != 333) + continue; // mother not phi + } else { + if (mothers1PDG[0] != 313) + continue; // mother not phi + if (mothers2PDG[0] != 313) + continue; // mother not phi + } if (mothers1[0] != mothers2[0]) continue; // Kaons not from the same phi TLorentzVector lDecayDaughter1, lDecayDaughter2, lResonance; lDecayDaughter1.SetXYZM(trk1.px(), trk1.py(), trk1.pz(), massKa); - if(!cfgIsKstar) - lDecayDaughter2.SetXYZM(trk2.px(), trk2.py(), trk2.pz(), massKa); - else - lDecayDaughter2.SetXYZM(trk2.px(), trk2.py(), trk2.pz(), massPi); - + if (!cfgIsKstar) + lDecayDaughter2.SetXYZM(trk2.px(), trk2.py(), trk2.pz(), massKa); + else + lDecayDaughter2.SetXYZM(trk2.px(), trk2.py(), trk2.pz(), massPi); + lResonance = lDecayDaughter1 + lDecayDaughter2; if (fabs(lResonance.Eta()) > cfgtrkMaxEta) continue; bool jetFlag = false; - int goodjets = 0; - double jetpt_mcp = 0; - double jetpt_mcd = 0; + int goodjets = 0; + double jetpt_mcp = 0; + double jetpt_mcd = 0; for (int i = 0; i < mcd_pt.size(); i++) { double phidiff = TVector2::Phi_mpi_pi(mcd_phi[i] - lResonance.Phi()); double etadiff = mcd_eta[i] - lResonance.Eta(); double R = TMath::Sqrt((etadiff * etadiff) + (phidiff * phidiff)); - if (R < cfgjetR){ - jetpt_mcd = mcd_pt[i]; - jetpt_mcp = mcp_pt[i]; - goodjets++; + if (R < cfgjetR) { + jetpt_mcd = mcd_pt[i]; + jetpt_mcp = mcp_pt[i]; + goodjets++; jetFlag = true; - } - } - - if(cfgSingleJet) - if(goodjets>1){ - jetpt_mcd=DistinguishJetsMC(mcd_pt, mcd_phi, mcd_eta, lResonance); - jetpt_mcp=DistinguishJetsMC(mcp_pt, mcp_phi, mcp_eta, lResonance); - } - - if (jetFlag) { // Fill Resp. Matrix - if (cDebugLevel > 0) { - std::cout << "******************************************" << std::endl; - std::cout << "Rec. Phi Pt: " << lResonance.Pt() << std::endl; - std::cout << "Rec. Jet Pt: " << jetpt_mcd << std::endl; - std::cout << "Gen. Phi Pt: " << mothers1Pt[0] << std::endl; - std::cout << "Gen. Jet Pt: " << jetpt_mcp << std::endl; - std::cout << "******************************************" << std::endl; - } - JEhistos.fill(HIST("Resp_Matrix_MATCHED"), lResonance.Pt(), jetpt_mcd, mothers1Pt[0], jetpt_mcp); - int dice = rand() % 2; - if(dice>0) - JEhistos.fill(HIST("Resp_Matrix_MATCHED_rand0"), lResonance.Pt(), jetpt_mcd, mothers1Pt[0], jetpt_mcp); - else - JEhistos.fill(HIST("Resp_Matrix_MATCHED_rand1"), lResonance.Pt(), jetpt_mcd, mothers1Pt[0], jetpt_mcp); - - } + } + } + + if (cfgSingleJet) + if (goodjets > 1) { + jetpt_mcd = DistinguishJetsMC(mcd_pt, mcd_phi, mcd_eta, lResonance); + jetpt_mcp = DistinguishJetsMC(mcp_pt, mcp_phi, mcp_eta, lResonance); + } + + if (jetFlag) { // Fill Resp. Matrix + if (cDebugLevel > 0) { + std::cout << "******************************************" << std::endl; + std::cout << "Rec. Phi Pt: " << lResonance.Pt() << std::endl; + std::cout << "Rec. Jet Pt: " << jetpt_mcd << std::endl; + std::cout << "Gen. Phi Pt: " << mothers1Pt[0] << std::endl; + std::cout << "Gen. Jet Pt: " << jetpt_mcp << std::endl; + std::cout << "******************************************" << std::endl; + } + JEhistos.fill(HIST("Resp_Matrix_MATCHED"), lResonance.Pt(), jetpt_mcd, mothers1Pt[0], jetpt_mcp); + int dice = rand() % 2; + if (dice > 0) + JEhistos.fill(HIST("Resp_Matrix_MATCHED_rand0"), lResonance.Pt(), jetpt_mcd, mothers1Pt[0], jetpt_mcp); + else + JEhistos.fill(HIST("Resp_Matrix_MATCHED_rand1"), lResonance.Pt(), jetpt_mcd, mothers1Pt[0], jetpt_mcp); + } if (jetFlag) { JEhistos.fill(HIST("hMCRec_hUSS_INSIDE_1D"), lResonance.M()); if (lResonance.Pt() > 2.0 && lResonance.Pt() < 3) From 178f60fd3ef14c6b4fcc2f4c19024d60de5575d2 Mon Sep 17 00:00:00 2001 From: Adrian Nassirpour Date: Tue, 23 Jul 2024 13:54:33 +0900 Subject: [PATCH 03/12] Megalinter fixes for pull 6940 --- PWGJE/Tasks/phiInJets.cxx | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/PWGJE/Tasks/phiInJets.cxx b/PWGJE/Tasks/phiInJets.cxx index 90a09d60b70..bca5ebeddf5 100644 --- a/PWGJE/Tasks/phiInJets.cxx +++ b/PWGJE/Tasks/phiInJets.cxx @@ -298,10 +298,10 @@ struct phiInJets { { bool pid = false; - if (!cfgIsKstar) + if (!cfgIsKstar) { pid = trackPIDKaon(candidate); - else { + } else { if (!FT) pid = trackPIDPion(candidate); else @@ -537,8 +537,9 @@ struct phiInJets { if (goodjets > 0) return 2; return 1; - } else + } else { return -1; + } } else { if (lResonance.M() > 0.85 && lResonance.M() < 0.95) { if (jetFlag) @@ -546,8 +547,9 @@ struct phiInJets { if (goodjets > 0) return 2; return 1; - } else + } else { return -1; + } } } // MinvReconstruction @@ -1334,12 +1336,12 @@ struct phiInJets { } } - if (cfgSingleJet) + if (cfgSingleJet) { if (goodjets > 1) { jetpt_mcd = DistinguishJetsMC(mcd_pt, mcd_phi, mcd_eta, lResonance); jetpt_mcp = DistinguishJetsMC(mcp_pt, mcp_phi, mcp_eta, lResonance); } - + } if (jetFlag) { // Fill Resp. Matrix if (cDebugLevel > 0) { std::cout << "******************************************" << std::endl; @@ -1350,7 +1352,7 @@ struct phiInJets { std::cout << "******************************************" << std::endl; } JEhistos.fill(HIST("Resp_Matrix_MATCHED"), lResonance.Pt(), jetpt_mcd, mothers1Pt[0], jetpt_mcp); - int dice = rand() % 2; + int dice = rand_r() % 2; if (dice > 0) JEhistos.fill(HIST("Resp_Matrix_MATCHED_rand0"), lResonance.Pt(), jetpt_mcd, mothers1Pt[0], jetpt_mcp); else From 54ddc1ec3c48453d2075cbc3b816a6f07107a83e Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Tue, 23 Jul 2024 04:55:53 +0000 Subject: [PATCH 04/12] Please consider the following formatting changes --- PWGJE/Tasks/phiInJets.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGJE/Tasks/phiInJets.cxx b/PWGJE/Tasks/phiInJets.cxx index bca5ebeddf5..adfd9461f02 100644 --- a/PWGJE/Tasks/phiInJets.cxx +++ b/PWGJE/Tasks/phiInJets.cxx @@ -1341,7 +1341,7 @@ struct phiInJets { jetpt_mcd = DistinguishJetsMC(mcd_pt, mcd_phi, mcd_eta, lResonance); jetpt_mcp = DistinguishJetsMC(mcp_pt, mcp_phi, mcp_eta, lResonance); } - } + } if (jetFlag) { // Fill Resp. Matrix if (cDebugLevel > 0) { std::cout << "******************************************" << std::endl; From 7718a44ad03d04c1ae031a85ae2340d9d7cb95f8 Mon Sep 17 00:00:00 2001 From: Adrian Nassirpour Date: Tue, 23 Jul 2024 14:46:38 +0900 Subject: [PATCH 05/12] Fixed rand_r() bug --- PWGJE/Tasks/phiInJets.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PWGJE/Tasks/phiInJets.cxx b/PWGJE/Tasks/phiInJets.cxx index adfd9461f02..b0b2335e7f4 100644 --- a/PWGJE/Tasks/phiInJets.cxx +++ b/PWGJE/Tasks/phiInJets.cxx @@ -1352,7 +1352,8 @@ struct phiInJets { std::cout << "******************************************" << std::endl; } JEhistos.fill(HIST("Resp_Matrix_MATCHED"), lResonance.Pt(), jetpt_mcd, mothers1Pt[0], jetpt_mcp); - int dice = rand_r() % 2; + unsigned int seed = 1992; + int dice = rand_r(&seed) % 2; if (dice > 0) JEhistos.fill(HIST("Resp_Matrix_MATCHED_rand0"), lResonance.Pt(), jetpt_mcd, mothers1Pt[0], jetpt_mcp); else From 99d37c09c3520ce4e63df9c35e035a13be9ecbd2 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Tue, 23 Jul 2024 05:47:29 +0000 Subject: [PATCH 06/12] Please consider the following formatting changes --- PWGJE/Tasks/phiInJets.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGJE/Tasks/phiInJets.cxx b/PWGJE/Tasks/phiInJets.cxx index b0b2335e7f4..8cf2c05885b 100644 --- a/PWGJE/Tasks/phiInJets.cxx +++ b/PWGJE/Tasks/phiInJets.cxx @@ -1352,7 +1352,7 @@ struct phiInJets { std::cout << "******************************************" << std::endl; } JEhistos.fill(HIST("Resp_Matrix_MATCHED"), lResonance.Pt(), jetpt_mcd, mothers1Pt[0], jetpt_mcp); - unsigned int seed = 1992; + unsigned int seed = 1992; int dice = rand_r(&seed) % 2; if (dice > 0) JEhistos.fill(HIST("Resp_Matrix_MATCHED_rand0"), lResonance.Pt(), jetpt_mcd, mothers1Pt[0], jetpt_mcp); From c62af2255acd2fb5dfc307cf61dfa91546e00b48 Mon Sep 17 00:00:00 2001 From: Adrian Nassirpour Date: Mon, 29 Jul 2024 15:09:53 +0900 Subject: [PATCH 07/12] Bugfix to random evaluator --- PWGJE/Tasks/phiInJets.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGJE/Tasks/phiInJets.cxx b/PWGJE/Tasks/phiInJets.cxx index 8cf2c05885b..0e0736b68a8 100644 --- a/PWGJE/Tasks/phiInJets.cxx +++ b/PWGJE/Tasks/phiInJets.cxx @@ -1352,7 +1352,7 @@ struct phiInJets { std::cout << "******************************************" << std::endl; } JEhistos.fill(HIST("Resp_Matrix_MATCHED"), lResonance.Pt(), jetpt_mcd, mothers1Pt[0], jetpt_mcp); - unsigned int seed = 1992; + unsigned int seed = static_cast(std::chrono::system_clock::now().time_since_epoch().count()); int dice = rand_r(&seed) % 2; if (dice > 0) JEhistos.fill(HIST("Resp_Matrix_MATCHED_rand0"), lResonance.Pt(), jetpt_mcd, mothers1Pt[0], jetpt_mcp); From 50b4ad477a43d5179c8e8f8381ca635cafb3a761 Mon Sep 17 00:00:00 2001 From: Adrian Nassirpour Date: Wed, 31 Jul 2024 21:02:01 +0900 Subject: [PATCH 08/12] New update, properly creates the response matrix efficiency on the generator level --- PWGJE/Tasks/phiInJets.cxx | 79 +++++++++++++++++++++++++++++++++------ 1 file changed, 67 insertions(+), 12 deletions(-) diff --git a/PWGJE/Tasks/phiInJets.cxx b/PWGJE/Tasks/phiInJets.cxx index 0e0736b68a8..a7e4e5b6867 100644 --- a/PWGJE/Tasks/phiInJets.cxx +++ b/PWGJE/Tasks/phiInJets.cxx @@ -116,6 +116,10 @@ struct phiInJets { JEhistos.add("Resp_Matrix_MATCHED", "Resp_Matrix_MATCHED", HistType::kTHnSparseD, {PtAxis, axisPt, PtAxis, axisPt}); // REC(Phi,Jet), GEN(Phi,Jet) JEhistos.add("Resp_Matrix_MATCHED_rand0", "Resp_Matrix_MATCHED_rand0", HistType::kTHnSparseD, {PtAxis, axisPt, PtAxis, axisPt}); // REC(Phi,Jet), GEN(Phi,Jet) JEhistos.add("Resp_Matrix_MATCHED_rand1", "Resp_Matrix_MATCHED_rand1", HistType::kTHnSparseD, {PtAxis, axisPt, PtAxis, axisPt}); // REC(Phi,Jet), GEN(Phi,Jet) + JEhistos.add("2DRecToGen", "2DRecToGen", kTH2F, {PtAxis, axisPt}); + JEhistos.add("2DRecToGen_constrained", "2DRecToGen_constrained", kTH2F, {PtAxis, axisPt}); + JEhistos.add("2DGenToRec", "2DGenToRec", kTH2F, {PtAxis, axisPt}); + JEhistos.add("2DGenToRec_constrained", "2DGenToRec_constrained", kTH2F, {PtAxis, axisPt}); JEhistos.add("ptGeneratedPion", "ptGeneratedPion", kTH1F, {PtAxis}); JEhistos.add("ptGeneratedKaon", "ptGeneratedKaon", kTH1F, {PtAxis}); @@ -1028,6 +1032,8 @@ struct phiInJets { soa::SmallGroups> const& recocolls, JetMCDTable const& /*mcdjets*/, JetMCPTable const& mcpjets, + myCompleteJetTracks const& tracks, + myCompleteTracks const&, aod::JMcParticles const& mcParticles) { @@ -1107,28 +1113,61 @@ struct phiInJets { GenPID = 313; if (fabs(mcParticle.pdgCode()) == GenPID) { - bool skip = false; + double phi_dgth_px[2]={0}; + double phi_dgth_py[2]={0}; + double phi_dgth_pz[2]={0}; + bool good_daughter[2]={false}; + int dgth_index=0; // First we check for Forced BR // if we check for Phi if (!cfgIsKstar) { if (mcParticle.has_daughters()) - for (auto& dgth : mcParticle.daughters_as()) - if (fabs(dgth.pdgCode()) != 321) + for (auto& dgth : mcParticle.daughters_as()){ + if (fabs(dgth.pdgCode()) != 321){ skip = true; + break; + } + for (const auto& track : tracks){ + auto trk = track.track_as(); + if (!trackSelection(trk)) + continue; + if (cfgSimPID) { + if (!trackPID(trk, true)) + continue; + } + if(track.globalIndex()==dgth.globalIndex()){ + phi_dgth_px[dgth_index]=track.px(); + phi_dgth_py[dgth_index]=track.py(); + phi_dgth_pz[dgth_index]=track.pz(); + good_daughter[dgth_index]=true; + dgth_index++; + } + } + } } else { if (mcParticle.has_daughters()) for (auto& dgth : mcParticle.daughters_as()) if (fabs(dgth.pdgCode()) != 321 || fabs(dgth.pdgCode()) != 211) skip = true; } - + if (skip && cfgBR) continue; + int goodjets = 0; - double jetpt = 0; + double jetpt_mcd = 0; + double jetpt_mcp = 0; TLorentzVector lResonance; + TLorentzVector lResonance_REC; + TLorentzVector lDecayDaughter1_REC; + TLorentzVector lDecayDaughter2_REC; lResonance.SetPxPyPzE(mcParticle.px(), mcParticle.py(), mcParticle.pz(), mcParticle.e()); + lDecayDaughter1_REC.SetXYZM(phi_dgth_px[0],phi_dgth_py[0],phi_dgth_pz[0], massKa); + lDecayDaughter2_REC.SetXYZM(phi_dgth_px[1],phi_dgth_py[1],phi_dgth_pz[1], massKa); + lResonance_REC = lDecayDaughter1_REC + lDecayDaughter2_REC; + + bool jetFlag = false; for (int i = 0; i < mcp_pt.size(); i++) { double phidiff = TVector2::Phi_mpi_pi(mcp_phi[i] - lResonance.Phi()); @@ -1136,19 +1175,28 @@ struct phiInJets { double R = TMath::Sqrt((etadiff * etadiff) + (phidiff * phidiff)); if (R < cfgjetR) { jetFlag = true; - jetpt = mcp_pt[i]; + jetpt_mcp = mcp_pt[i]; + jetpt_mcd = mcd_pt[i]; goodjets++; } } - if (cfgSingleJet) - if (goodjets > 1) - jetpt = DistinguishJetsMC(mcp_pt, mcp_phi, mcp_eta, lResonance); + if (cfgSingleJet){ + if (goodjets > 1){ + jetpt_mcp = DistinguishJetsMC(mcp_pt, mcp_phi, mcp_eta, lResonance); + jetpt_mcd = DistinguishJetsMC(mcd_pt, mcd_phi, mcd_eta, lResonance); + } + } + + JEhistos.fill(HIST("2DGenToRec"), lResonance.Pt(), jetpt_mcp); + // //check constrained eff + if(good_daughter[0] && good_daughter[1] && lResonance_REC.Pt()>0 && lResonance_REC.Pt()<20.0 && jetpt_mcd>8 && jetpt_mcd<200) + JEhistos.fill(HIST("2DGenToRec_constrained"), lResonance.Pt(), jetpt_mcp); if (jetFlag) { JEhistos.fill(HIST("hMCTrue_hUSS_INSIDE_1D"), lResonance.M()); if (lResonance.Pt() > 2.0 && lResonance.Pt() < 3) JEhistos.fill(HIST("hMCTrue_hUSS_INSIDE_1D_2_3"), lResonance.M()); - JEhistos.fill(HIST("hMCTrue_hUSS_INSIDE"), jetpt, lResonance.Pt(), lResonance.M()); + JEhistos.fill(HIST("hMCTrue_hUSS_INSIDE"), jetpt_mcp, lResonance.Pt(), lResonance.M()); } else if (!jetFlag && mcp_pt.size() > 0) { JEhistos.fill(HIST("hMCTrue_hUSS_OUTSIDE_TRIG_1D"), lResonance.M()); @@ -1156,7 +1204,7 @@ struct phiInJets { if (lResonance.Pt() > 2.0 && lResonance.Pt() < 3) JEhistos.fill(HIST("hMCTrue_hUSS_OUTSIDE_TRIG_1D_2_3"), lResonance.M()); - JEhistos.fill(HIST("hMCTrue_hUSS_OUTSIDE_TRIG"), jetpt, lResonance.Pt(), lResonance.M()); + JEhistos.fill(HIST("hMCTrue_hUSS_OUTSIDE_TRIG"), jetpt_mcp, lResonance.Pt(), lResonance.M()); } else if (!jetFlag) { JEhistos.fill(HIST("hMCTrue_hUSS_OUTSIDE_1D"), lResonance.M()); @@ -1164,7 +1212,7 @@ struct phiInJets { if (lResonance.Pt() > 2.0 && lResonance.Pt() < 3) JEhistos.fill(HIST("hMCTrue_hUSS_OUTSIDE_1D_2_3"), lResonance.M()); - JEhistos.fill(HIST("hMCTrue_hUSS_OUTSIDE"), jetpt, lResonance.Pt(), lResonance.M()); + JEhistos.fill(HIST("hMCTrue_hUSS_OUTSIDE"), jetpt_mcp, lResonance.Pt(), lResonance.M()); } //! jetflag } // chech for phi @@ -1359,6 +1407,13 @@ struct phiInJets { else JEhistos.fill(HIST("Resp_Matrix_MATCHED_rand1"), lResonance.Pt(), jetpt_mcd, mothers1Pt[0], jetpt_mcp); } + + JEhistos.fill(HIST("2DRecToGen"), lResonance.Pt(), jetpt_mcd); + //check constrained eff + if(mothers1Pt[0]>0 && mothers1Pt[0]<20.0 && jetpt_mcp>8 && jetpt_mcp<200) + JEhistos.fill(HIST("2DRecToGen_constrained"), lResonance.Pt(), jetpt_mcd); + + //Fill 3D Invariant mass distributions if (jetFlag) { JEhistos.fill(HIST("hMCRec_hUSS_INSIDE_1D"), lResonance.M()); if (lResonance.Pt() > 2.0 && lResonance.Pt() < 3) From 9e97e383d60ce7a204af33b4f94dbc8289af0abe Mon Sep 17 00:00:00 2001 From: Adrian Nassirpour Date: Wed, 31 Jul 2024 22:21:37 +0900 Subject: [PATCH 09/12] Bugfix on the MC-REC matching --- PWGJE/Tasks/phiInJets.cxx | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/PWGJE/Tasks/phiInJets.cxx b/PWGJE/Tasks/phiInJets.cxx index a7e4e5b6867..2b3e6b0f995 100644 --- a/PWGJE/Tasks/phiInJets.cxx +++ b/PWGJE/Tasks/phiInJets.cxx @@ -1166,7 +1166,9 @@ struct phiInJets { lDecayDaughter1_REC.SetXYZM(phi_dgth_px[0],phi_dgth_py[0],phi_dgth_pz[0], massKa); lDecayDaughter2_REC.SetXYZM(phi_dgth_px[1],phi_dgth_py[1],phi_dgth_pz[1], massKa); lResonance_REC = lDecayDaughter1_REC + lDecayDaughter2_REC; - + if (cDebugLevel > 0) + if(good_daughter[0] && good_daughter[1]) + std::cout<<"Reconstructed level phi pT: "< 1){ jetpt_mcp = DistinguishJetsMC(mcp_pt, mcp_phi, mcp_eta, lResonance); - jetpt_mcd = DistinguishJetsMC(mcd_pt, mcd_phi, mcd_eta, lResonance); + jetpt_mcd = DistinguishJetsMC(mcd_pt, mcd_phi, mcd_eta, lResonance_REC); } } - JEhistos.fill(HIST("2DGenToRec"), lResonance.Pt(), jetpt_mcp); - // //check constrained eff - if(good_daughter[0] && good_daughter[1] && lResonance_REC.Pt()>0 && lResonance_REC.Pt()<20.0 && jetpt_mcd>8 && jetpt_mcd<200) - JEhistos.fill(HIST("2DGenToRec_constrained"), lResonance.Pt(), jetpt_mcp); - if (jetFlag) { + + JEhistos.fill(HIST("2DGenToRec"), lResonance.Pt(), jetpt_mcp); + // //check constrained eff + if(good_daughter[0] && good_daughter[1] && lResonance_REC.Pt()>0 && lResonance_REC.Pt()<20.0 && jetpt_mcd>8 && jetpt_mcd<200) + JEhistos.fill(HIST("2DGenToRec_constrained"), lResonance.Pt(), jetpt_mcp); + JEhistos.fill(HIST("hMCTrue_hUSS_INSIDE_1D"), lResonance.M()); if (lResonance.Pt() > 2.0 && lResonance.Pt() < 3) JEhistos.fill(HIST("hMCTrue_hUSS_INSIDE_1D_2_3"), lResonance.M()); @@ -1406,12 +1409,13 @@ struct phiInJets { JEhistos.fill(HIST("Resp_Matrix_MATCHED_rand0"), lResonance.Pt(), jetpt_mcd, mothers1Pt[0], jetpt_mcp); else JEhistos.fill(HIST("Resp_Matrix_MATCHED_rand1"), lResonance.Pt(), jetpt_mcd, mothers1Pt[0], jetpt_mcp); - } + + JEhistos.fill(HIST("2DRecToGen"), lResonance.Pt(), jetpt_mcd); + //check constrained eff + if(mothers1Pt[0]>0 && mothers1Pt[0]<20.0 && jetpt_mcp>8 && jetpt_mcp<200) + JEhistos.fill(HIST("2DRecToGen_constrained"), lResonance.Pt(), jetpt_mcd); - JEhistos.fill(HIST("2DRecToGen"), lResonance.Pt(), jetpt_mcd); - //check constrained eff - if(mothers1Pt[0]>0 && mothers1Pt[0]<20.0 && jetpt_mcp>8 && jetpt_mcp<200) - JEhistos.fill(HIST("2DRecToGen_constrained"), lResonance.Pt(), jetpt_mcd); + } //Fill 3D Invariant mass distributions if (jetFlag) { From b067da45a55caa96ddf2012aad7559376d26604a Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Wed, 31 Jul 2024 13:29:51 +0000 Subject: [PATCH 10/12] Please consider the following formatting changes --- PWGJE/Tasks/phiInJets.cxx | 121 +++++++++++++++++++------------------- 1 file changed, 60 insertions(+), 61 deletions(-) diff --git a/PWGJE/Tasks/phiInJets.cxx b/PWGJE/Tasks/phiInJets.cxx index 2b3e6b0f995..924dfc362d8 100644 --- a/PWGJE/Tasks/phiInJets.cxx +++ b/PWGJE/Tasks/phiInJets.cxx @@ -117,9 +117,9 @@ struct phiInJets { JEhistos.add("Resp_Matrix_MATCHED_rand0", "Resp_Matrix_MATCHED_rand0", HistType::kTHnSparseD, {PtAxis, axisPt, PtAxis, axisPt}); // REC(Phi,Jet), GEN(Phi,Jet) JEhistos.add("Resp_Matrix_MATCHED_rand1", "Resp_Matrix_MATCHED_rand1", HistType::kTHnSparseD, {PtAxis, axisPt, PtAxis, axisPt}); // REC(Phi,Jet), GEN(Phi,Jet) JEhistos.add("2DRecToGen", "2DRecToGen", kTH2F, {PtAxis, axisPt}); - JEhistos.add("2DRecToGen_constrained", "2DRecToGen_constrained", kTH2F, {PtAxis, axisPt}); + JEhistos.add("2DRecToGen_constrained", "2DRecToGen_constrained", kTH2F, {PtAxis, axisPt}); JEhistos.add("2DGenToRec", "2DGenToRec", kTH2F, {PtAxis, axisPt}); - JEhistos.add("2DGenToRec_constrained", "2DGenToRec_constrained", kTH2F, {PtAxis, axisPt}); + JEhistos.add("2DGenToRec_constrained", "2DGenToRec_constrained", kTH2F, {PtAxis, axisPt}); JEhistos.add("ptGeneratedPion", "ptGeneratedPion", kTH1F, {PtAxis}); JEhistos.add("ptGeneratedKaon", "ptGeneratedKaon", kTH1F, {PtAxis}); @@ -1032,7 +1032,7 @@ struct phiInJets { soa::SmallGroups> const& recocolls, JetMCDTable const& /*mcdjets*/, JetMCPTable const& mcpjets, - myCompleteJetTracks const& tracks, + myCompleteJetTracks const& tracks, myCompleteTracks const&, aod::JMcParticles const& mcParticles) @@ -1114,62 +1114,62 @@ struct phiInJets { if (fabs(mcParticle.pdgCode()) == GenPID) { bool skip = false; - double phi_dgth_px[2]={0}; - double phi_dgth_py[2]={0}; - double phi_dgth_pz[2]={0}; - bool good_daughter[2]={false}; - int dgth_index=0; + double phi_dgth_px[2] = {0}; + double phi_dgth_py[2] = {0}; + double phi_dgth_pz[2] = {0}; + bool good_daughter[2] = {false}; + int dgth_index = 0; // First we check for Forced BR // if we check for Phi if (!cfgIsKstar) { if (mcParticle.has_daughters()) - for (auto& dgth : mcParticle.daughters_as()){ - if (fabs(dgth.pdgCode()) != 321){ + for (auto& dgth : mcParticle.daughters_as()) { + if (fabs(dgth.pdgCode()) != 321) { skip = true; - break; - } - for (const auto& track : tracks){ - auto trk = track.track_as(); - if (!trackSelection(trk)) - continue; - if (cfgSimPID) { - if (!trackPID(trk, true)) - continue; - } - if(track.globalIndex()==dgth.globalIndex()){ - phi_dgth_px[dgth_index]=track.px(); - phi_dgth_py[dgth_index]=track.py(); - phi_dgth_pz[dgth_index]=track.pz(); - good_daughter[dgth_index]=true; - dgth_index++; - } - } - } + break; + } + for (const auto& track : tracks) { + auto trk = track.track_as(); + if (!trackSelection(trk)) + continue; + if (cfgSimPID) { + if (!trackPID(trk, true)) + continue; + } + if (track.globalIndex() == dgth.globalIndex()) { + phi_dgth_px[dgth_index] = track.px(); + phi_dgth_py[dgth_index] = track.py(); + phi_dgth_pz[dgth_index] = track.pz(); + good_daughter[dgth_index] = true; + dgth_index++; + } + } + } } else { if (mcParticle.has_daughters()) for (auto& dgth : mcParticle.daughters_as()) if (fabs(dgth.pdgCode()) != 321 || fabs(dgth.pdgCode()) != 211) skip = true; } - + if (skip && cfgBR) continue; - + int goodjets = 0; double jetpt_mcd = 0; - double jetpt_mcp = 0; + double jetpt_mcp = 0; TLorentzVector lResonance; - TLorentzVector lResonance_REC; - TLorentzVector lDecayDaughter1_REC; - TLorentzVector lDecayDaughter2_REC; + TLorentzVector lResonance_REC; + TLorentzVector lDecayDaughter1_REC; + TLorentzVector lDecayDaughter2_REC; lResonance.SetPxPyPzE(mcParticle.px(), mcParticle.py(), mcParticle.pz(), mcParticle.e()); - lDecayDaughter1_REC.SetXYZM(phi_dgth_px[0],phi_dgth_py[0],phi_dgth_pz[0], massKa); - lDecayDaughter2_REC.SetXYZM(phi_dgth_px[1],phi_dgth_py[1],phi_dgth_pz[1], massKa); - lResonance_REC = lDecayDaughter1_REC + lDecayDaughter2_REC; - if (cDebugLevel > 0) - if(good_daughter[0] && good_daughter[1]) - std::cout<<"Reconstructed level phi pT: "< 0) + if (good_daughter[0] && good_daughter[1]) + std::cout << "Reconstructed level phi pT: " << lResonance_REC.Pt() << std::endl; + bool jetFlag = false; for (int i = 0; i < mcp_pt.size(); i++) { double phidiff = TVector2::Phi_mpi_pi(mcp_phi[i] - lResonance.Phi()); @@ -1178,23 +1178,23 @@ struct phiInJets { if (R < cfgjetR) { jetFlag = true; jetpt_mcp = mcp_pt[i]; - jetpt_mcd = mcd_pt[i]; + jetpt_mcd = mcd_pt[i]; goodjets++; } } - if (cfgSingleJet){ - if (goodjets > 1){ + if (cfgSingleJet) { + if (goodjets > 1) { jetpt_mcp = DistinguishJetsMC(mcp_pt, mcp_phi, mcp_eta, lResonance); - jetpt_mcd = DistinguishJetsMC(mcd_pt, mcd_phi, mcd_eta, lResonance_REC); - } - } - + jetpt_mcd = DistinguishJetsMC(mcd_pt, mcd_phi, mcd_eta, lResonance_REC); + } + } + if (jetFlag) { - JEhistos.fill(HIST("2DGenToRec"), lResonance.Pt(), jetpt_mcp); - // //check constrained eff - if(good_daughter[0] && good_daughter[1] && lResonance_REC.Pt()>0 && lResonance_REC.Pt()<20.0 && jetpt_mcd>8 && jetpt_mcd<200) - JEhistos.fill(HIST("2DGenToRec_constrained"), lResonance.Pt(), jetpt_mcp); + JEhistos.fill(HIST("2DGenToRec"), lResonance.Pt(), jetpt_mcp); + // //check constrained eff + if (good_daughter[0] && good_daughter[1] && lResonance_REC.Pt() > 0 && lResonance_REC.Pt() < 20.0 && jetpt_mcd > 8 && jetpt_mcd < 200) + JEhistos.fill(HIST("2DGenToRec_constrained"), lResonance.Pt(), jetpt_mcp); JEhistos.fill(HIST("hMCTrue_hUSS_INSIDE_1D"), lResonance.M()); if (lResonance.Pt() > 2.0 && lResonance.Pt() < 3) @@ -1403,21 +1403,20 @@ struct phiInJets { std::cout << "******************************************" << std::endl; } JEhistos.fill(HIST("Resp_Matrix_MATCHED"), lResonance.Pt(), jetpt_mcd, mothers1Pt[0], jetpt_mcp); - unsigned int seed = static_cast(std::chrono::system_clock::now().time_since_epoch().count()); + unsigned int seed = static_cast(std::chrono::system_clock::now().time_since_epoch().count()); int dice = rand_r(&seed) % 2; if (dice > 0) JEhistos.fill(HIST("Resp_Matrix_MATCHED_rand0"), lResonance.Pt(), jetpt_mcd, mothers1Pt[0], jetpt_mcp); else JEhistos.fill(HIST("Resp_Matrix_MATCHED_rand1"), lResonance.Pt(), jetpt_mcd, mothers1Pt[0], jetpt_mcp); - - JEhistos.fill(HIST("2DRecToGen"), lResonance.Pt(), jetpt_mcd); - //check constrained eff - if(mothers1Pt[0]>0 && mothers1Pt[0]<20.0 && jetpt_mcp>8 && jetpt_mcp<200) - JEhistos.fill(HIST("2DRecToGen_constrained"), lResonance.Pt(), jetpt_mcd); + JEhistos.fill(HIST("2DRecToGen"), lResonance.Pt(), jetpt_mcd); + // check constrained eff + if (mothers1Pt[0] > 0 && mothers1Pt[0] < 20.0 && jetpt_mcp > 8 && jetpt_mcp < 200) + JEhistos.fill(HIST("2DRecToGen_constrained"), lResonance.Pt(), jetpt_mcd); } - - //Fill 3D Invariant mass distributions + + // Fill 3D Invariant mass distributions if (jetFlag) { JEhistos.fill(HIST("hMCRec_hUSS_INSIDE_1D"), lResonance.M()); if (lResonance.Pt() > 2.0 && lResonance.Pt() < 3) From 9bc0c54637386e6b84e5b6ba94ed2ec2cd274c86 Mon Sep 17 00:00:00 2001 From: Adrian Nassirpour Date: Wed, 31 Jul 2024 22:40:41 +0900 Subject: [PATCH 11/12] Megalinter requests for if/else braces --- PWGJE/Tasks/phiInJets.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PWGJE/Tasks/phiInJets.cxx b/PWGJE/Tasks/phiInJets.cxx index 924dfc362d8..69fc996b7b6 100644 --- a/PWGJE/Tasks/phiInJets.cxx +++ b/PWGJE/Tasks/phiInJets.cxx @@ -1122,7 +1122,7 @@ struct phiInJets { // First we check for Forced BR // if we check for Phi if (!cfgIsKstar) { - if (mcParticle.has_daughters()) + if (mcParticle.has_daughters()){ for (auto& dgth : mcParticle.daughters_as()) { if (fabs(dgth.pdgCode()) != 321) { skip = true; @@ -1145,6 +1145,7 @@ struct phiInJets { } } } + } } else { if (mcParticle.has_daughters()) for (auto& dgth : mcParticle.daughters_as()) From a00309ec3dd3b2fb232ef6460005b25617ef23d7 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Wed, 31 Jul 2024 13:41:51 +0000 Subject: [PATCH 12/12] Please consider the following formatting changes --- PWGJE/Tasks/phiInJets.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGJE/Tasks/phiInJets.cxx b/PWGJE/Tasks/phiInJets.cxx index 69fc996b7b6..c4cd941fd9e 100644 --- a/PWGJE/Tasks/phiInJets.cxx +++ b/PWGJE/Tasks/phiInJets.cxx @@ -1122,7 +1122,7 @@ struct phiInJets { // First we check for Forced BR // if we check for Phi if (!cfgIsKstar) { - if (mcParticle.has_daughters()){ + if (mcParticle.has_daughters()) { for (auto& dgth : mcParticle.daughters_as()) { if (fabs(dgth.pdgCode()) != 321) { skip = true; @@ -1145,7 +1145,7 @@ struct phiInJets { } } } - } + } } else { if (mcParticle.has_daughters()) for (auto& dgth : mcParticle.daughters_as())