Skip to content

Commit

Permalink
Added functionality to enable/disable PID selections on reconstructed MC
Browse files Browse the repository at this point in the history
  • Loading branch information
smaff92 committed Jun 16, 2024
1 parent 83ab0d8 commit 7fd3c2a
Showing 1 changed file with 35 additions and 20 deletions.
55 changes: 35 additions & 20 deletions PWGJE/Tasks/phiInJets.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ struct phiInJets {
Configurable<float> cfgVtxCut{"cfgVtxCut", 10.0, "V_z cut selection"};
Configurable<int> cDebugLevel{"cDebugLevel", 0, "Resolution of Debug"};
Configurable<bool> cfgBR{"cfgBR", false, "Forces Gen. Charged BR Only"};
Configurable<bool> cfgSimPID{"cfgSimPID", false, "Enforces PID on the Gen. Rec level"};

// CONFIG DONE
///////////////////////////////////////// //INIT

Expand Down Expand Up @@ -538,6 +540,10 @@ struct phiInJets {
auto originalTrack = track.track_as<myCompleteTracks>();
if (!trackSelection(originalTrack))
continue;
if(cfgSimPID)
if (!trackPID(originalTrack))
continue;

if (track.has_mcParticle()) {
auto mcParticle = track.mcParticle();

Expand All @@ -554,6 +560,9 @@ struct phiInJets {
auto originalTrack2 = track2.track_as<myCompleteTracks>();
if (!trackSelection(originalTrack2))
continue;
if(cfgSimPID)
if (!trackPID(originalTrack2))
continue;

if (originalTrack.index() >= originalTrack2.index())
continue;
Expand Down Expand Up @@ -609,17 +618,17 @@ struct phiInJets {
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));
double phidiff_K1 = TVector2::Phi_mpi_pi(mcd_phi[i] - lDecayDaughter1.Phi());
double etadiff_K1 = mcd_eta[i] - lDecayDaughter1.Eta();
double R_K1 = TMath::Sqrt((etadiff_K1 * etadiff_K1) + (phidiff_K1 * phidiff_K1));
double phidiff_K2 = TVector2::Phi_mpi_pi(mcd_phi[i] - lDecayDaughter2.Phi());
double etadiff_K2 = mcd_eta[i] - lDecayDaughter2.Eta();
double R_K2 = TMath::Sqrt((etadiff_K2 * etadiff_K2) + (phidiff_K2 * phidiff_K2));
if(R < cfgjetR){
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());
}

double phidiff_K1 = TVector2::Phi_mpi_pi(mcd_phi[i] - lDecayDaughter1.Phi());
double etadiff_K1 = mcd_eta[i] - lDecayDaughter1.Eta();
double R_K1 = TMath::Sqrt((etadiff_K1 * etadiff_K1) + (phidiff_K1 * phidiff_K1));
double phidiff_K2 = TVector2::Phi_mpi_pi(mcd_phi[i] - lDecayDaughter2.Phi());
double etadiff_K2 = mcd_eta[i] - lDecayDaughter2.Eta();
double R_K2 = TMath::Sqrt((etadiff_K2 * etadiff_K2) + (phidiff_K2 * phidiff_K2));
if (R < cfgjetR) {
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)
jetFlag = true;
}
Expand Down Expand Up @@ -753,15 +762,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 (mcParticle.has_daughters()){
for (auto& dgth : mcParticle.daughters_as<aod::JMcParticles>()){
double phidiff_K = TVector2::Phi_mpi_pi(mcp_phi[i] - dgth.phi());
double etadiff_K = mcp_eta[i] - dgth.eta();
double R_K = TMath::Sqrt((etadiff_K * etadiff_K) + (phidiff_K * phidiff_K));
if(R < cfgjetR)
JEhistos.fill(HIST("hMCTrue_nonmatch_hUSS_Kangle_v_pt"), R_K, lResonance.Pt());
}
}
if (mcParticle.has_daughters()) {
for (auto& dgth : mcParticle.daughters_as<aod::JMcParticles>()) {
double phidiff_K = TVector2::Phi_mpi_pi(mcp_phi[i] - dgth.phi());
double etadiff_K = mcp_eta[i] - dgth.eta();
double R_K = TMath::Sqrt((etadiff_K * etadiff_K) + (phidiff_K * phidiff_K));
if (R < cfgjetR)
JEhistos.fill(HIST("hMCTrue_nonmatch_hUSS_Kangle_v_pt"), R_K, lResonance.Pt());
}
}
if (R < cfgjetR)
jetFlag = true;
}
Expand Down Expand Up @@ -1015,6 +1024,12 @@ struct phiInJets {
if ((trk1.sign() * trk2.sign()) > 0)
continue; // Not K+K-
if (trackSelection(trk1) && trackSelection(trk2)) {
if(cfgSimPID){
if (!trackPID(trk1))
continue;
if (!trackPID(trk2))
continue;
}
if (track1.has_mcParticle() && track2.has_mcParticle()) {
auto part1 = track1.mcParticle();
auto part2 = track2.mcParticle();
Expand Down

0 comments on commit 7fd3c2a

Please sign in to comment.