Skip to content

Commit

Permalink
fix and plot z vertex selection
Browse files Browse the repository at this point in the history
  • Loading branch information
jaimenorman committed Sep 7, 2024
1 parent 436b771 commit 0fc41c1
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions PWGJE/Tasks/jetHadronRecoil.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ struct hJetAnalysis {

HistogramRegistry registry{"registry",
{{"hNtrig", "number of triggers;trigger type;entries", {HistType::kTH1F, {{2, 0, 2}}}},
{"hZvtxSelected", "Z vertex position;Z_{vtx};entries", {HistType::kTH1F, {{80, -20, 20}}}},
{"hPtTrack", "Track p_{T};p_{T};entries", {HistType::kTH1F, {{200, 0, 200}}}},
{"hEtaTrack", "Track #eta;#eta;entries", {HistType::kTH1F, {{100, -1.0, 1.0}}}},
{"hPhiTrack", "Track #phi;#phi;entries", {HistType::kTH1F, {{160, -1.0, 7.0}}}},
Expand Down Expand Up @@ -429,6 +430,7 @@ struct hJetAnalysis {
if (!jetderiveddatautilities::selectCollision(collision, eventSelection)) {
return;
}
registry.fill(HIST("hZvtxSelected"), collision.posZ());
fillHistograms(jets, jetsWTA, tracks);
}
PROCESS_SWITCH(hJetAnalysis, processData, "process data", true);
Expand All @@ -441,6 +443,7 @@ struct hJetAnalysis {
if (!jetderiveddatautilities::selectCollision(collision, eventSelection)) {
return;
}
registry.fill(HIST("hZvtxSelected"), collision.posZ());
fillHistograms(jets, jetsWTA, tracks);
}
PROCESS_SWITCH(hJetAnalysis, processMCD, "process MC detector level", false);
Expand All @@ -453,6 +456,7 @@ struct hJetAnalysis {
if (!jetderiveddatautilities::selectCollision(collision, eventSelection)) {
return;
}
registry.fill(HIST("hZvtxSelected"), collision.posZ(), collision.mcCollision().weight());
fillHistograms(jets, jetsWTA, tracks, collision.mcCollision().weight());
}
PROCESS_SWITCH(hJetAnalysis, processMCDWeighted, "process MC detector level with event weights", false);
Expand All @@ -462,9 +466,10 @@ struct hJetAnalysis {
soa::Filtered<soa::Join<aod::Charged1MCParticleLevelJets, aod::Charged1MCParticleLevelJetConstituents, aod::Charged1MCParticleLevelJetsMatchedToChargedMCParticleLevelJets>> const& jetsWTA,
JetParticles const& particles)
{
if (collision.posZ() < vertexZCut) { // For some reason declaring a filter doesnt work
if (nabs(collision.posZ()) > vertexZCut) {
return;
}
registry.fill(HIST("hZvtxSelected"), collision.posZ());
fillMCPHistograms(jets, jetsWTA, particles);
}
PROCESS_SWITCH(hJetAnalysis, processMCP, "process MC particle level", false);
Expand All @@ -474,9 +479,10 @@ struct hJetAnalysis {
soa::Filtered<soa::Join<aod::Charged1MCParticleLevelJets, aod::Charged1MCParticleLevelJetConstituents, aod::Charged1MCParticleLevelJetsMatchedToChargedMCParticleLevelJets>> const& jetsWTA,
JetParticles const& particles)
{
if (collision.posZ() < vertexZCut) {
if (nabs(collision.posZ()) > vertexZCut) {

Check failure on line 482 in PWGJE/Tasks/jetHadronRecoil.cxx

View workflow job for this annotation

GitHub Actions / PR formatting / whitespace

Trailing spaces

Remove the trailing spaces at the end of the line.
return;
}
registry.fill(HIST("hZvtxSelected"), collision.posZ(), collision.weight());
fillMCPHistograms(jets, jetsWTA, particles, collision.weight());
}
PROCESS_SWITCH(hJetAnalysis, processMCPWeighted, "process MC particle level with event weights", false);
Expand All @@ -493,6 +499,7 @@ struct hJetAnalysis {
if (!jetderiveddatautilities::selectCollision(collision, eventSelection)) {
return;
}
registry.fill(HIST("hZvtxSelected"), collision.posZ());
const auto& mcpjetsWTACut = mcpjetsWTA.sliceBy(PartJetsPerCollision, collision.mcCollisionId());
for (const auto& mcdjet : mcdjets) {
fillMatchedHistograms(mcdjet, mcdjetsWTA, mcpjetsWTACut, mcpjets);
Expand All @@ -512,6 +519,7 @@ struct hJetAnalysis {
if (!jetderiveddatautilities::selectCollision(collision, eventSelection)) {
return;
}
registry.fill(HIST("hZvtxSelected"), collision.posZ());
const auto& mcpjetsWTACut = mcpjetsWTA.sliceBy(PartJetsPerCollision, collision.mcCollisionId());
for (const auto& mcdjet : mcdjets) {
fillMatchedHistograms(mcdjet, mcdjetsWTA, mcpjetsWTACut, mcpjets, mcdjet.eventWeight());
Expand All @@ -531,6 +539,7 @@ struct hJetAnalysis {
if (!jetderiveddatautilities::selectCollision(collision, eventSelection)) {
return;
}
registry.fill(HIST("hZvtxSelected"), collision.posZ());
const auto& mcpjetsWTACut = mcpjetsWTA.sliceBy(PartJetsPerCollision, collision.mcCollisionId());
bool ishJetEvent = false;
for (auto& track : tracks) {
Expand Down Expand Up @@ -559,6 +568,7 @@ struct hJetAnalysis {
if (!jetderiveddatautilities::selectCollision(collision, eventSelection)) {
return;
}
registry.fill(HIST("hZvtxSelected"), collision.posZ());
const auto& mcpjetsWTACut = mcpjetsWTA.sliceBy(PartJetsPerCollision, collision.mcCollisionId());
bool ishJetEvent = false;
for (auto& track : tracks) {
Expand Down

0 comments on commit 0fc41c1

Please sign in to comment.