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
39 changes: 19 additions & 20 deletions PWGJE/Tasks/fullJetSpectraPP.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
//
/// \author Archita Rani Dash <archita.rani.dash@cern.ch>
#include <vector>
#include <iostream>

Check warning on line 17 in PWGJE/Tasks/fullJetSpectraPP.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

Including iostream is discouraged. Use O2 logging instead.
#include <utility>

#include "CommonConstants/PhysicsConstants.h"
Expand Down Expand Up @@ -157,7 +157,7 @@
}
auto jetRadiiBins = (std::vector<double>)jetRadii;
if (jetRadiiBins.size() > 1) {
jetRadiiBins.push_back(jetRadiiBins[jetRadiiBins.size() - 1] + (TMath::Abs(jetRadiiBins[jetRadiiBins.size() - 1] - jetRadiiBins[jetRadiiBins.size() - 2])));

Check warning on line 160 in PWGJE/Tasks/fullJetSpectraPP.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

Consider replacing ROOT entities with equivalents from standard C++ or from O2.
} else {
jetRadiiBins.push_back(jetRadiiBins[jetRadiiBins.size() - 1] + 0.1);
}
Expand Down Expand Up @@ -255,22 +255,21 @@

registry.add("h2_matchedjet_etaphiDet", "Det jet #eta vs jet #varphi; #eta_{jet};#varphi_{jet}", {HistType::kTH2F, {{100, -1., 1.}, {160, -1., 7.}}});
registry.add("h2_matchedjet_etaphiPart", "Part jet #eta vs jet #varphi; #eta_{jet};#varphi_{jet}", {HistType::kTH2F, {{100, -1., 1.}, {160, -1., 7.}}});
registry.add("h2_matchedjet_deltaEtaCorr", "Correlation between Det Eta and Part Eta; #eta_{jet,det}; #eta_{jet,part}", {HistType::kTH2F, {{100, -1., 1.},{100, -1., 1.}}});
registry.add("h2_matchedjet_deltaPhiCorr", "Correlation between Det Phi and Part Phi; #varphi_{jet,det}; #varphi_{jet,part}", {HistType::kTH2F, {{160, 0., 7.},{160, 0., 7.}}});
registry.add("h2_matchedjet_deltaEtaCorr", "Correlation between Det Eta and Part Eta; #eta_{jet,det}; #eta_{jet,part}", {HistType::kTH2F, {{100, -1., 1.}, {100, -1., 1.}}});
registry.add("h2_matchedjet_deltaPhiCorr", "Correlation between Det Phi and Part Phi; #varphi_{jet,det}; #varphi_{jet,part}", {HistType::kTH2F, {{160, 0., 7.}, {160, 0., 7.}}});

registry.add("h2_full_jet_energyscalePart", "Jet Energy Scale (part); p_{T,part} (GeV/c); (p_{T,det} - p_{T,part})/p_{T,part}", {HistType::kTH2F, {{400, 0., 400.}, {200, -1., 1.}}});
registry.add("h3_full_jet_energyscalePart", "R dependence of Jet Energy Scale (Part); #it{R}_{jet};p_{T,det} (GeV/c); (p_{T,det} - p_{T,part})/p_{T,part}", {HistType::kTH3F, {{jetRadiiBins, ""}, {400, 0., 400.}, {200, -1., 1.}}});
registry.add("h2_full_jet_etaresolutionPart", ";p_{T,part} (GeV/c); (#eta_{jet,det} - #eta_{jet,part})/#eta_{jet,part}", {HistType::kTH2F, {{400, 0., 400.}, {100, -1., 1.}}});
registry.add("h2_full_jet_phiresolutionPart", ";p_{T,part} (GeV/c); (#varphi_{jet,det} - #varphi_{jet,part})/#varphi_{jet,part}", {HistType::kTH2F, {{400, 0., 400.}, {160, -1., 7.}}});
registry.add("h2_full_jet_energyscaleChargedPart", "Jet Energy Scale (charged part); p_{T,part} (GeV/c); (p_{T,det} - p_{T,part})/p_{T,part}", {HistType::kTH2F,{{400, 0., 400.}, {200, -1.,1.}}});
registry.add("h2_full_jet_energyscaleNeutralPart", "Jet Energy Scale (neutral part); p_{T,part} (GeV/c); (p_{T,det} - p_{T,part})/p_{T,part}", {HistType::kTH2F,{{400, 0., 400.}, {200, -1.,1.}}});
registry.add("h2_full_jet_energyscaleChargedVsFullPart", "Jet Energy Scale (charged part, vs. full jet pt); p_{T,part} (GeV/c); (p_{T,det} - p_{T,part})/p_{T,part}", {HistType::kTH2F,{{400, 0., 400.}, {200, -1.,1.}}});
registry.add("h2_full_jet_energyscaleNeutralVsFullPart", "Jet Energy Scale (neutral part, vs. full jet pt); p_{T,part} (GeV/c); (p_{T,det} - p_{T,part})/p_{T,part}", {HistType::kTH2F,{{400, 0., 400.}, {200, -1.,1.}}});
registry.add("h2_full_jet_energyscaleChargedPart", "Jet Energy Scale (charged part); p_{T,part} (GeV/c); (p_{T,det} - p_{T,part})/p_{T,part}", {HistType::kTH2F, {{400, 0., 400.}, {200, -1., 1.}}});
registry.add("h2_full_jet_energyscaleNeutralPart", "Jet Energy Scale (neutral part); p_{T,part} (GeV/c); (p_{T,det} - p_{T,part})/p_{T,part}", {HistType::kTH2F, {{400, 0., 400.}, {200, -1., 1.}}});
registry.add("h2_full_jet_energyscaleChargedVsFullPart", "Jet Energy Scale (charged part, vs. full jet pt); p_{T,part} (GeV/c); (p_{T,det} - p_{T,part})/p_{T,part}", {HistType::kTH2F, {{400, 0., 400.}, {200, -1., 1.}}});
registry.add("h2_full_jet_energyscaleNeutralVsFullPart", "Jet Energy Scale (neutral part, vs. full jet pt); p_{T,part} (GeV/c); (p_{T,det} - p_{T,part})/p_{T,part}", {HistType::kTH2F, {{400, 0., 400.}, {200, -1., 1.}}});
registry.add("h2_full_fakemcdjets", "Fake MCD Jets; p_{T,det} (GeV/c); NCounts", {HistType::kTH2F, {{350, 0., 350.}, {100, 0., 100.}}});
registry.add("h2_full_fakemcpjets", "Fake MCP Jets; p_{T,part} (GeV/c); NCounts", {HistType::kTH2F, {{350, 0., 350.}, {100, 0., 100.}}});
// Response Matrix
registry.add("h_full_jet_ResponseMatrix", "Full Jets Response Matrix; p_{T,det} (GeV/c); p_{T,part} (GeV/c)", {HistType::kTH2F, {{200, 0., 200.}, {200, 0., 200.}}});

}

// Label the histograms
Expand Down Expand Up @@ -304,13 +303,13 @@
{

if (jetAreaFractionMin > -98.0) {
if (jet.area() < jetAreaFractionMin * M_PI * (jet.r() / 100.0) * (jet.r() / 100.0)) {

Check warning on line 306 in PWGJE/Tasks/fullJetSpectraPP.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

Consider using the PI constant (and its multiples and fractions) defined in o2::constants::math.
return false;
}
}
if (leadingConstituentPtMin > -98.0) {
bool isMinleadingConstituent = false;
for (auto& constituent : jet.template tracks_as<T>()) {

Check warning on line 312 in PWGJE/Tasks/fullJetSpectraPP.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

Use constant references for non-modified iterators in range-based for loops.
if (constituent.pt() >= leadingConstituentPtMin) {
isMinleadingConstituent = true;
break;
Expand All @@ -327,7 +326,7 @@
void fillJetHistograms(T const& jet, float weight = 1.0)
{
float pTHat = 10. / (std::pow(weight, 1.0 / pTHatExponent));
if (jet.pt() > pTHatMaxMCD * pTHat || pTHat < pTHatAbsoluteMin) { // for MCD jets only to remove outliers; setting pTHatMaxMCD = 1 improves purity
if (jet.pt() > pTHatMaxMCD * pTHat || pTHat < pTHatAbsoluteMin) { // for MCD jets only to remove outliers; setting pTHatMaxMCD = 1 improves purity
return;
}

Expand All @@ -339,7 +338,7 @@
registry.fill(HIST("h_full_jet_phi"), jet.phi(), weight);
registry.fill(HIST("h2_jet_etaphi"), jet.eta(), jet.phi(), weight);

for (auto& cluster : jet.template clusters_as<aod::JetClusters>()) {

Check warning on line 341 in PWGJE/Tasks/fullJetSpectraPP.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

Use constant references for non-modified iterators in range-based for loops.
registry.fill(HIST("h2_full_jet_neutralconstituents"), jet.pt(), jet.clustersIds().size(), weight);

neutralEnergy += cluster.energy();
Expand All @@ -354,7 +353,7 @@
auto NEF = neutralEnergy / jet.energy();
registry.fill(HIST("h2_full_jet_NEF"), jet.pt(), NEF, weight);

for (auto& jettrack : jet.template tracks_as<aod::JetTracks>()) {

Check warning on line 356 in PWGJE/Tasks/fullJetSpectraPP.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

Use constant references for non-modified iterators in range-based for loops.
sumtrackE += jettrack.energy();

registry.fill(HIST("h_Detjet_ntracks"), jettrack.pt(), weight);
Expand Down Expand Up @@ -391,7 +390,7 @@
void fillMCPHistograms(T const& jet, float weight = 1.0)
{
float pTHat = 10. / (std::pow(weight, 1.0 / pTHatExponent));
if (jet.pt() > pTHatMaxMCP * pTHat || pTHat < pTHatAbsoluteMin) { // MCP outlier rejection
if (jet.pt() > pTHatMaxMCP * pTHat || pTHat < pTHatAbsoluteMin) { // MCP outlier rejection
return;
}
float neutralEnergy = 0.0;
Expand Down Expand Up @@ -437,7 +436,7 @@
{
double sumtrackE = 0.0;
float pTHat = 10. / (std::pow(weight, 1.0 / pTHatExponent));
if (pTHat < pTHatAbsoluteMin) { // Track outlier rejection
if (pTHat < pTHatAbsoluteMin) { // Track outlier rejection
return;
}
for (auto const& track : tracks) {
Expand Down Expand Up @@ -467,18 +466,18 @@
template <typename T, typename U>
void fillMatchedHistograms(T const& jetBase, float weight = 1.0)
{
float pTHat = 10. / (std::pow(weight, 1.0 / pTHatExponent));
if (jetBase.pt() > pTHatMaxMCD * pTHat || pTHat < pTHatAbsoluteMin) {
return;
}
float pTHat = 10. / (std::pow(weight, 1.0 / pTHatExponent));
if (jetBase.pt() > pTHatMaxMCD * pTHat || pTHat < pTHatAbsoluteMin) {
return;
}

if (jetBase.has_matchedJetGeo()) { // geometrical jet matching only needed for pp - here,matching Base(Det.level) with Tag (Part. level) jets
registry.fill(HIST("h_full_matchedmcdjet_tablesize"), jetBase.size(), weight);
registry.fill(HIST("h_full_matchedmcdjet_ntracks"), jetBase.tracksIds().size(), weight);
registry.fill(HIST("h2_matchedjet_etaphiDet"), jetBase.eta(), jetBase.phi(), weight);

for (auto& jetTag : jetBase.template matchedJetGeo_as<std::decay_t<U>>()) {
if (jetTag.pt() > pTHatMaxMCP * pTHat || pTHat < pTHatAbsoluteMin) { // MCP outlier rejection
if (jetTag.pt() > pTHatMaxMCP * pTHat || pTHat < pTHatAbsoluteMin) { // MCP outlier rejection
continue;
}
auto deltaEta = jetBase.eta() - jetTag.eta();
Expand Down Expand Up @@ -695,7 +694,7 @@
{
registry.fill(HIST("h_collisions_unweighted"), 1.0); // total events
bool eventAccepted = false;
if (fabs(collision.posZ()) > VertexZCut) {

Check warning on line 697 in PWGJE/Tasks/fullJetSpectraPP.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

Use std:: prefix for names from the std namespace.
return;
}
// if (!jetderiveddatautilities::selectCollision(collision, eventSelectionBits)) {
Expand Down Expand Up @@ -740,7 +739,7 @@
int fakemcdjet = 0;
int fakemcpjet = 0;
// float pTHat = 10. / (std::pow(eventWeight, 1.0 / pTHatExponent));
if (fabs(collision.posZ()) > VertexZCut) { // making double sure this condition is satisfied

Check warning on line 742 in PWGJE/Tasks/fullJetSpectraPP.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

Use std:: prefix for names from the std namespace.
return;
}
// if (!jetderiveddatautilities::selectCollision(collision, eventSelectionBits)) {
Expand Down Expand Up @@ -796,12 +795,12 @@
registry.fill(HIST("h2_full_fakemcpjets"), mcpjet.pt(), fakemcpjet, 1.0);
continue;
}
}// mcpjet loop
} // mcpjet loop

// // Fill MCD jet histograms if a valid MCP jet match was found within the EMCAL region
// registry.fill(HIST("h_full_matchedmcpjet_eta"), mcpjet.eta(), 1.0);
// registry.fill(HIST("h_full_matchedmcpjet_phi"), mcpjet.phi(), 1.0);
fillMatchedHistograms<typename JetTableMCDMatchedJoined::iterator, JetTableMCPMatchedJoined>(mcdjet);
// // Fill MCD jet histograms if a valid MCP jet match was found within the EMCAL region
// registry.fill(HIST("h_full_matchedmcpjet_eta"), mcpjet.eta(), 1.0);
// registry.fill(HIST("h_full_matchedmcpjet_phi"), mcpjet.phi(), 1.0);
fillMatchedHistograms<typename JetTableMCDMatchedJoined::iterator, JetTableMCPMatchedJoined>(mcdjet);
} // mcdjet loop
}
PROCESS_SWITCH(FullJetSpectrapp, processJetsMCPMCDMatched, "Full Jet finder MCP matched to MCD", false);
Expand All @@ -810,7 +809,7 @@
{
float eventWeight = collision.mcCollision().weight();

if (fabs(collision.posZ()) > VertexZCut) { // making double sure this condition is satisfied

Check warning on line 812 in PWGJE/Tasks/fullJetSpectraPP.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

Use std:: prefix for names from the std namespace.
return;
}
if (doMBGapTrigger && eventWeight == 1) {
Expand Down Expand Up @@ -894,7 +893,7 @@
{
bool eventAccepted = false;
float eventWeight = collision.mcCollision().weight();
if (fabs(collision.posZ()) > VertexZCut) {

Check warning on line 896 in PWGJE/Tasks/fullJetSpectraPP.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

Use std:: prefix for names from the std namespace.
return;
}
if (eventWeight == 1) {
Expand Down
Loading