Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
115 changes: 57 additions & 58 deletions PWGJE/Tasks/phiInJets.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -196,12 +196,11 @@ struct phiInJets {
JEhistos.add("h_matched_GEN_jet_phi", "matched_GEN level jet #phi;#phi_{jet part};Delta", {HistType::kTH2F, {{80, -1.0, 7.}, {400, -20., 20.}}});
JEhistos.add("2DGenToRec", "2DGenToRec", kTH2F, {PtAxis, axisPt});
JEhistos.add("2DGenToRec_constrained", "2DGenToRec_constrained", kTH2F, {PtAxis, axisPt});

JEhistos.add("RespGen_Matrix_MATCHED", "RespGen_Matrix_MATCHED", HistType::kTHnSparseD, {PtAxis, axisPt, PtAxis, axisPt}); // REC(Phi,Jet), GEN(Phi,Jet)
JEhistos.add("RespGen_Matrix_MATCHED_rand0", "RespGen_Matrix_MATCHED_rand0", HistType::kTHnSparseD, {PtAxis, axisPt, PtAxis, axisPt}); // REC(Phi,Jet), GEN(Phi,Jet)
JEhistos.add("RespGen_Matrix_MATCHED_rand1", "RespGen_Matrix_MATCHED_rand1", HistType::kTHnSparseD, {PtAxis, axisPt, PtAxis, axisPt}); // REC(Phi,Jet), GEN(Phi,Jet)


JEhistos.add("hMCTrue_hUSS_INSIDE", "hMCTrue_hUSS_INSIDE", kTH3F, {dRAxis, PtAxis, MinvAxis});
JEhistos.add("hMCTrue_hUSS_INSIDE_1D", "hMCTrue_hUSS_INSIDE_1D", kTH1F, {MinvAxis});
JEhistos.add("hMCTrue_hUSS_INSIDE_1D_2_3", "hMCTrue_hUSS_INSIDE_1D_2_3", kTH1F, {MinvAxis});
Expand Down Expand Up @@ -841,7 +840,7 @@ struct phiInJets {
JEhistos.fill(HIST("hMCRec_nonmatch_hUSS_INSIDE_1D_2_3"), lResonance.M());
JEhistos.fill(HIST("hMCRec_nonmatch_hUSS_INSIDE"), jetpt, lResonance.Pt(), lResonance.M());
}
// else if (!jetFlag && mcd_pt.size() > 0) {
// else if (!jetFlag && mcd_pt.size() > 0) {
// JEhistos.fill(HIST("hMCRec_nonmatch_hUSS_OUTSIDE_TRIG_1D"), lResonance.M());

// if (lResonance.Pt() > 2.0 && lResonance.Pt() < 3)
Expand Down Expand Up @@ -1010,23 +1009,23 @@ struct phiInJets {
JEhistos.fill(HIST("hMCTrue_nonmatch_hUSS_INSIDE_1D_2_3"), 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());
// else if (!jetFlag && mcp_pt.size() > 0) {
// JEhistos.fill(HIST("hMCTrue_nonmatch_hUSS_OUTSIDE_TRIG_1D"), lResonance.M());

// if (lResonance.Pt() > 2.0 && lResonance.Pt() < 3)
// JEhistos.fill(HIST("hMCTrue_nonmatch_hUSS_OUTSIDE_TRIG_1D_2_3"), lResonance.M());
// 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"), jetpt, 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());
// } else if (!jetFlag) {
// JEhistos.fill(HIST("hMCTrue_nonmatch_hUSS_OUTSIDE_1D"), lResonance.M());

// if (lResonance.Pt() > 2.0 && lResonance.Pt() < 3)
// JEhistos.fill(HIST("hMCTrue_nonmatch_hUSS_OUTSIDE_1D_2_3"), lResonance.M());
// 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"), jetpt, lResonance.Pt(), lResonance.M());
// JEhistos.fill(HIST("hMCTrue_nonmatch_hUSS_OUTSIDE"), jetpt, lResonance.Pt(), lResonance.M());

// } //! jetflag
// } //! jetflag

////////////////////////////Phi found
if (hasJets) {
Expand Down Expand Up @@ -1056,7 +1055,7 @@ struct phiInJets {
myCompleteJetTracks const& tracks,
myCompleteTracks const&,
aod::JMcParticles const& mcParticles,
aod::McParticles const&)
aod::McParticles const&)

{
if (cDebugLevel > 0) {
Expand Down Expand Up @@ -1142,7 +1141,7 @@ struct phiInJets {
double phi_dgth_px[2] = {0};
double phi_dgth_py[2] = {0};
double phi_dgth_pz[2] = {0};
double TEMP_phi_dgth_px[2] = {0};
double TEMP_phi_dgth_px[2] = {0};
double TEMP_phi_dgth_py[2] = {0};
double TEMP_phi_dgth_pz[2] = {0};

Expand All @@ -1161,35 +1160,35 @@ struct phiInJets {
auto trk = track.track_as<myCompleteTracks>();
if (!trackSelection(trk))
continue;
if (fabs(trk.eta()) > cfgtrkMaxEta)
continue;
if (fabs(trk.eta()) > cfgtrkMaxEta)
continue;
if (cfgSimPID) {
if (!trackPID(trk, true))
continue;
}
if(!trk.has_mcParticle())
continue;
auto part = trk.mcParticle();
if (!trk.has_mcParticle())
continue;
auto part = trk.mcParticle();
if (part.globalIndex() == dgth.globalIndex()) {
TEMP_phi_dgth_px[dgth_index] = track.px();
TEMP_phi_dgth_py[dgth_index] = track.py();
TEMP_phi_dgth_pz[dgth_index] = track.pz();
good_daughter[dgth_index] = true;
dgth_index++;
if(dgth_index==2){
phi_dgth_px[0] = TEMP_phi_dgth_px[0];
phi_dgth_py[0] = TEMP_phi_dgth_py[0];
phi_dgth_pz[0] = TEMP_phi_dgth_pz[0];
phi_dgth_px[1] = TEMP_phi_dgth_px[1];
phi_dgth_py[1] = TEMP_phi_dgth_py[1];
phi_dgth_pz[1] = TEMP_phi_dgth_pz[1];
break;
}
}//index check
}//track loop
}//mc daughter loop
}//check if particle has daughters
} else {//check for kstar
if (dgth_index == 2) {
phi_dgth_px[0] = TEMP_phi_dgth_px[0];
phi_dgth_py[0] = TEMP_phi_dgth_py[0];
phi_dgth_pz[0] = TEMP_phi_dgth_pz[0];
phi_dgth_px[1] = TEMP_phi_dgth_px[1];
phi_dgth_py[1] = TEMP_phi_dgth_py[1];
phi_dgth_pz[1] = TEMP_phi_dgth_pz[1];
break;
}
} // index check
} // track loop
} // mc daughter loop
} // check if particle has daughters
} else { // check for kstar
if (mcParticle.has_daughters())
for (auto& dgth : mcParticle.daughters_as<aod::JMcParticles>())
if (fabs(dgth.pdgCode()) != 321 || fabs(dgth.pdgCode()) != 211)
Expand Down Expand Up @@ -1234,25 +1233,25 @@ struct phiInJets {
}

if (jetFlag) {
if (cDebugLevel > 0) {
std::cout << "******************************************" << std::endl;
std::cout << "GEN TO REC LEVEL: " << std::endl;
std::cout << "Rec. Phi Pt: " << lResonance_REC.Pt() << std::endl;
std::cout << "Rec. Phi Eta: " << lResonance_REC.Eta() << std::endl;
std::cout << "Rec. Jet Pt: " << jetpt_mcd << std::endl;
std::cout << "Gen. Phi Pt: " << lResonance.Pt() << std::endl;
std::cout << "Gen. Phi Eta: " << lResonance.Eta() << std::endl;
std::cout << "Gen. Jet Pt: " << jetpt_mcp << std::endl;
std::cout << "******************************************" << std::endl;
}

JEhistos.fill(HIST("RespGen_Matrix_MATCHED"), lResonance_REC.Pt(), jetpt_mcd, lResonance.Pt(), jetpt_mcp);
unsigned int seed = static_cast<unsigned int>(std::chrono::system_clock::now().time_since_epoch().count());
int dice = rand_r(&seed) % 2;
if (dice > 0)
JEhistos.fill(HIST("RespGen_Matrix_MATCHED_rand0"), lResonance_REC.Pt(), jetpt_mcd, lResonance.Pt(), jetpt_mcp);
else
JEhistos.fill(HIST("RespGen_Matrix_MATCHED_rand1"), lResonance_REC.Pt(), jetpt_mcd, lResonance.Pt(), jetpt_mcp);
if (cDebugLevel > 0) {
std::cout << "******************************************" << std::endl;
std::cout << "GEN TO REC LEVEL: " << std::endl;
std::cout << "Rec. Phi Pt: " << lResonance_REC.Pt() << std::endl;
std::cout << "Rec. Phi Eta: " << lResonance_REC.Eta() << std::endl;
std::cout << "Rec. Jet Pt: " << jetpt_mcd << std::endl;
std::cout << "Gen. Phi Pt: " << lResonance.Pt() << std::endl;
std::cout << "Gen. Phi Eta: " << lResonance.Eta() << std::endl;
std::cout << "Gen. Jet Pt: " << jetpt_mcp << std::endl;
std::cout << "******************************************" << std::endl;
}

JEhistos.fill(HIST("RespGen_Matrix_MATCHED"), lResonance_REC.Pt(), jetpt_mcd, lResonance.Pt(), jetpt_mcp);
unsigned int seed = static_cast<unsigned int>(std::chrono::system_clock::now().time_since_epoch().count());
int dice = rand_r(&seed) % 2;
if (dice > 0)
JEhistos.fill(HIST("RespGen_Matrix_MATCHED_rand0"), lResonance_REC.Pt(), jetpt_mcd, lResonance.Pt(), jetpt_mcp);
else
JEhistos.fill(HIST("RespGen_Matrix_MATCHED_rand1"), lResonance_REC.Pt(), jetpt_mcd, lResonance.Pt(), jetpt_mcp);

JEhistos.fill(HIST("2DGenToRec"), lResonance.Pt(), jetpt_mcp);
// //check constrained eff
Expand All @@ -1264,7 +1263,7 @@ struct phiInJets {
JEhistos.fill(HIST("hMCTrue_hUSS_INSIDE_1D_2_3"), lResonance.M());
JEhistos.fill(HIST("hMCTrue_hUSS_INSIDE"), jetpt_mcp, lResonance.Pt(), lResonance.M());
}
// else if (!jetFlag && mcp_pt.size() > 0) {
// else if (!jetFlag && mcp_pt.size() > 0) {
// JEhistos.fill(HIST("hMCTrue_hUSS_OUTSIDE_TRIG_1D"), lResonance.M());

// if (lResonance.Pt() > 2.0 && lResonance.Pt() < 3)
Expand Down Expand Up @@ -1462,7 +1461,7 @@ struct phiInJets {
if (jetFlag) { // Fill Resp. Matrix
if (cDebugLevel > 0) {
std::cout << "******************************************" << std::endl;
std::cout << "REC TO GEN LEVEL: " << std::endl;
std::cout << "REC TO GEN LEVEL: " << 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;
Expand Down Expand Up @@ -1490,7 +1489,7 @@ struct phiInJets {
JEhistos.fill(HIST("hMCRec_hUSS_INSIDE_1D_2_3"), lResonance.M());
JEhistos.fill(HIST("hMCRec_hUSS_INSIDE"), jetpt_mcd, lResonance.Pt(), lResonance.M());
}
// else if (!jetFlag && mcd_pt.size() > 0) {
// else if (!jetFlag && mcd_pt.size() > 0) {
// JEhistos.fill(HIST("hMCRec_hUSS_OUTSIDE_TRIG_1D"), lResonance.M());

// if (lResonance.Pt() > 2.0 && lResonance.Pt() < 3)
Expand All @@ -1506,7 +1505,7 @@ struct phiInJets {

// JEhistos.fill(HIST("hMCRec_hUSS_OUTSIDE"), jetpt_mcd, lResonance.Pt(), lResonance.M());

// } //! jetflag
// } //! jetflag

} // pass track cut
} // has mc particle
Expand Down