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
41 changes: 39 additions & 2 deletions PWGJE/Tasks/jetHadronRecoil.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
std::vector<double> dRBinning = {0.0, 1.0e-9, 0.003, 0.006, 0.009, 0.012, 0.015, 0.018, 0.021, 0.024,
0.027, 0.03, 0.033, 0.036, 0.039, 0.042, 0.045, 0.048, 0.051, 0.054,
0.057, 0.06, 0.063, 0.066, 0.069, 0.072, 0.075, 0.078, 0.081, 0.084,
0.087, 0.09, 0.093, 0.096, 0.099, 0.102, 0.105, 0.108, 0.111, 0.114,

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

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-mass]

Avoid hard-coded particle masses. Use o2::constants::physics::Mass... instead.
0.117, 0.12, 0.123, 0.126, 0.129, 0.132, 0.135, 0.138, 0.141, 0.144,
0.147, 0.15, 0.153, 0.156, 0.159, 0.162, 0.165, 0.168, 0.171, 0.174,
0.177, 0.18, 0.183, 0.186, 0.189, 0.192, 0.195, 0.198, 0.201, 0.204,
Expand All @@ -129,6 +129,8 @@
{"hEtaTrack", "Track #eta;#eta;entries", {HistType::kTH1F, {{100, -1.0, 1.0}}}},
{"hPhiTrack", "Track #phi;#phi;entries", {HistType::kTH1F, {{100, 0.0, o2::constants::math::TwoPI}}}},
{"hTrack3D", "3D tracks histogram;p_{T};#eta;#phi", {HistType::kTH3F, {{200, 0, 200}, {100, -1.0, 1.0}, {100, 0.0, o2::constants::math::TwoPI}}}},
{"hTrackPtHard", "Tracks vs pThard;#frac{p_{T}}{#hat{p}};p_{T}", {HistType::kTH2F, {{20, 0, 5}, {200, 0, 200}}}},
{"hPartPtHard", "Part vs pThard;#frac{p_{T}}{#hat{p}};p_{T}", {HistType::kTH2F, {{20, 0, 5}, {200, 0, 200}}}},
{"hPtTrackPtHard", "Track p_{T} vs #hat{p};p_{T};#frac{p_{T}}{#hat{p}}", {HistType::kTH2F, {{200, 0, 200}, {20, 0, 5}}}},
{"hConstituents3D", "3D constituents histogram;p_{T};#eta;#phi", {HistType::kTH3F, {{200, 0, 200}, {100, -1.0, 1.0}, {100, 0.0, o2::constants::math::TwoPI}}}},
{"hReferencePtDPhi", "jet p_{T} vs DPhi;#Delta#phi;p_{T,jet}", {HistType::kTH2F, {{100, 0, o2::constants::math::TwoPI}, {500, -100, 400}}}},
Expand All @@ -146,6 +148,8 @@
{"hJetEta", "jet #eta;#eta_{jet};entries", {HistType::kTH1F, {{100, -1.0, 1.0}}}},
{"hJetPhi", "jet #phi;#phi_{jet};entries", {HistType::kTH1F, {{100, 0.0, o2::constants::math::TwoPI}}}},
{"hJet3D", "3D jet distribution;p_{T};#eta;#phi", {HistType::kTH3F, {{500, -100, 400}, {100, -1.0, 1.0}, {100, 0.0, o2::constants::math::TwoPI}}}},
{"hTracksvsJets", "comparing leading tracks and jets;p_{T,track};p_{T,jet};#hat{p}", {HistType::kTH3F, {{200, 0, 200}, {500, -100, 400}, {195, 5, 200}}}},
{"hPartvsJets", "comparing leading particles and jets;p_{T,part};p_{T,jet};#hat{p}", {HistType::kTH3F, {{200, 0, 200}, {500, -100, 400}, {195, 5, 200}}}},
{"hPtPart", "Particle p_{T};p_{T};entries", {HistType::kTH1F, {{200, 0, 200}}}},
{"hEtaPart", "Particle #eta;#eta;entries", {HistType::kTH1F, {{100, -1.0, 1.0}}}},
{"hPhiPart", "Particle #phi;#phi;entries", {HistType::kTH1F, {{100, 0.0, o2::constants::math::TwoPI}}}},
Expand Down Expand Up @@ -177,7 +181,7 @@
{"hPtMatched1d", "p_{T} matching 1d;p_{T,part}", {HistType::kTH1F, {{400, 0, 400}}}},
{"hDeltaRMatched1d", "#DeltaR matching 1d;#DeltaR_{part}", {HistType::kTH1F, {dRAxisPart}}},
{"hPtResolution", "p_{T} resolution;p_{T,part};Relative Resolution", {HistType::kTH2F, {{400, 0, 400}, {1000, -5.0, 5.0}}}},
{"hPhiResolution", "#phi resolution;#p{T,part};Resolution", {HistType::kTH2F, {{400, 0, 400}, {1000, -7.0, 7.0}}}},
{"hPhiResolution", "#phi resolution;#p_{T,part};Resolution", {HistType::kTH2F, {{400, 0, 400}, {1000, -7.0, 7.0}}}},
{"hDeltaRResolution", "#DeltaR Resolution;p_{T,part};Resolution", {HistType::kTH2F, {{400, 0, 400}, {1000, -0.15, 0.15}}}},
{"hFullMatching", "Full 6D matching;p_{T,det};p_{T,part};#phi_{det};#phi_{part};#DeltaR_{det};#DeltaR_{part}", {HistType::kTHnSparseD, {ptAxisDet, ptAxisPart, phiAxisDet, phiAxisPart, dRAxisDet, dRAxisPart}}}}};

Expand Down Expand Up @@ -210,11 +214,16 @@
bool isSigCol;
std::vector<double> phiTTAr;
std::vector<double> ptTTAr;
std::vector<double> tracksAr;
double phiTT = 0;
double ptTT = 0;
double ptRandTrack = 0;
int trigNumber = 0;
int trackNumber = 0;
int nTT = 0;
double leadingPT = 0;
double leadingTrackPt = 0;
double leadingJetPt = 0;
float rhoReference = rho + rhoReferenceShift;

float dice = rand->Rndm();
Expand All @@ -227,6 +236,10 @@
if (!jetderiveddatautilities::selectTrack(track, trackSelection)) {
continue;
}
tracksAr.push_back(track.pt());
if (track.pt() > leadingTrackPt) {
leadingTrackPt = track.pt();
}
if (track.pt() > pTHatTrackMaxMCD * pTHat) {
if (outlierRejectEvent) {
return;
Expand All @@ -253,6 +266,10 @@
registry.fill(HIST("hPtTrackPtHard"), track.pt(), track.pt() / pTHat, weight);
}

trackNumber = rand->Integer(tracksAr.size());
ptRandTrack = tracksAr[trackNumber];
registry.fill(HIST("hTrackPtHard"), ptRandTrack / pTHat, ptRandTrack, weight);

if (nTT > 0) {
trigNumber = rand->Integer(nTT);
phiTT = phiTTAr[trigNumber];
Expand All @@ -267,13 +284,16 @@
registry.fill(HIST("hNtrig"), 0.5, weight);
registry.fill(HIST("hRefEventTriggers"), nTT, weight);
registry.fill(HIST("hRhoReference"), rhoReference, weight);
for (double shift = 0.0; shift <= 2.0; shift += 0.1) {

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

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
registry.fill(HIST("hRhoReferenceShift"), rho + shift, shift, weight);
}
registry.fill(HIST("hReferenceTriggersPtHard"), ptTT / pTHat, weight);
}
}
for (const auto& jet : jets) {
if (jet.pt() > leadingJetPt) {
leadingJetPt = jet.pt();
}
if (jet.pt() > pTHatMaxMCD * pTHat) {
if (outlierRejectEvent) {
return;
Expand Down Expand Up @@ -304,37 +324,38 @@
if (nTT > 0) {
float dphi = RecoDecay::constrainAngle(jet.phi() - phiTT);
if (isSigCol) {
if (std::abs(dphi - o2::constants::math::PI) < 0.6) {

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

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
registry.fill(HIST("hDeltaRpTSignal"), jet.pt() - (rho * jet.area()), dR, weight);
registry.fill(HIST("hDeltaRSignal"), dR, weight);
}
registry.fill(HIST("hDeltaRpTDPhiSignal"), jet.pt() - (rho * jet.area()), dphi, dR, weight);
registry.fill(HIST("hSignalPtDPhi"), dphi, jet.pt() - (rho * jet.area()), weight);
if (std::abs(dphi - o2::constants::math::PI) < 0.6) {

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

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
registry.fill(HIST("hSignalPt"), jet.pt() - (rho * jet.area()), weight);
registry.fill(HIST("hSignalPtHard"), jet.pt() - (rho * jet.area()), ptTT / pTHat, weight);
}
}
if (!isSigCol) {
if (std::abs(dphi - o2::constants::math::PI) < 0.6) {

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

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
registry.fill(HIST("hDeltaRpTReference"), jet.pt() - (rhoReference * jet.area()), dR, weight);
registry.fill(HIST("hDeltaRReference"), dR, weight);
}
registry.fill(HIST("hDeltaRpTDPhiReference"), jet.pt() - (rhoReference * jet.area()), dphi, dR, weight);
for (double shift = 0.0; shift <= 2.0; shift += 0.1) {

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

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
registry.fill(HIST("hDeltaRpTDPhiReferenceShifts"), jet.pt() - ((rho + shift) * jet.area()), dphi, dR, shift, weight);
}
registry.fill(HIST("hReferencePtDPhi"), dphi, jet.pt() - (rhoReference * jet.area()), weight);
for (double shift = 0.0; shift <= 2.0; shift += 0.1) {

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

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
registry.fill(HIST("hReferencePtDPhiShifts"), dphi, jet.pt() - ((rho + shift) * jet.area()), shift, weight);
}
if (std::abs(dphi - o2::constants::math::PI) < 0.6) {

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

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
registry.fill(HIST("hReferencePt"), jet.pt() - (rhoReference * jet.area()), weight);
registry.fill(HIST("hReferencePtHard"), jet.pt() - (rhoReference * jet.area()), ptTT / pTHat, weight);
}
}
}
}
registry.fill(HIST("hTracksvsJets"), leadingTrackPt, leadingJetPt, pTHat, weight);
}

template <typename T, typename W, typename U>
Expand All @@ -343,18 +364,26 @@
bool isSigCol;
std::vector<double> phiTTAr;
std::vector<double> ptTTAr;
std::vector<double> partAr;
double phiTT = 0;
double ptTT = 0;
double ptRandPart = 0;
int trigNumber = 0;
int partNumber = 0;
int nTT = 0;

double leadingPartPt = 0;
double leadingJetPt = 0;
float dice = rand->Rndm();
if (dice < fracSig)
isSigCol = true;
else
isSigCol = false;

for (const auto& particle : particles) {
partAr.push_back(particle.pt());
if (particle.pt() > leadingPartPt) {
leadingPartPt = particle.pt();
}
if (particle.pt() > pTHatTrackMaxMCD * pTHat) {
if (outlierRejectEvent) {
return;
Expand Down Expand Up @@ -386,6 +415,10 @@
registry.fill(HIST("hPtPartPtHard"), particle.pt(), particle.pt() / pTHat, weight);
}

partNumber = rand->Integer(partAr.size());
ptRandPart = partAr[partNumber];
registry.fill(HIST("hPartPtHard"), ptRandPart / pTHat, ptRandPart, weight);

if (nTT > 0) {
trigNumber = rand->Integer(nTT);
phiTT = phiTTAr[trigNumber];
Expand All @@ -403,6 +436,9 @@
}

for (const auto& jet : jets) {
if (jet.pt() > leadingJetPt) {
leadingJetPt = jet.pt();
}
if (jet.pt() > pTHatMaxMCP * pTHat) {
if (outlierRejectEvent) {
return;
Expand All @@ -425,7 +461,7 @@
if (nTT > 0) {
float dphi = RecoDecay::constrainAngle(jet.phi() - phiTT);
if (isSigCol) {
if (std::abs(dphi - o2::constants::math::PI) < 0.6) {

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

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
registry.fill(HIST("hDeltaRpTSignalPart"), jet.pt(), dR, weight);
registry.fill(HIST("hDeltaRSignalPart"), dR, weight);
}
Expand All @@ -450,6 +486,7 @@
}
}
}
registry.fill(HIST("hPartvsJets"), leadingPartPt, leadingJetPt, pTHat, weight);
}

template <typename T, typename V, typename W, typename U, typename X, typename Y>
Expand Down Expand Up @@ -913,7 +950,7 @@
} else if (wtaMethod == 1) {
// recluster jet
jetConstituents.clear();
for (auto& jetConstituent : jet.template tracks_as<X>()) {

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

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
fastjetutilities::fillTracks(jetConstituent, jetConstituents, jetConstituent.globalIndex());
}
jetReclustered.clear();
Expand Down
Loading