From 13a41d11462be89fa068a267d6eee4130bf810cf Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Wed, 31 Jul 2024 13:23:02 +0000 Subject: [PATCH] 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)