Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PWGJE] PWGJE - fix jetBackgroundAnalysis RC without 2 leading jets #9628

Merged
merged 1 commit into from
Jan 30, 2025
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
21 changes: 11 additions & 10 deletions PWGJE/Tasks/jetBackgroundAnalysis.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -121,31 +121,31 @@
}
TRandom3 randomNumber(0);
float randomConeEta = randomNumber.Uniform(trackEtaMin + randomConeR, trackEtaMax - randomConeR);
float randomConePhi = randomNumber.Uniform(0.0, 2 * M_PI);

Check warning on line 124 in PWGJE/Tasks/jetBackgroundAnalysis.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[external-pi]

Consider using the PI constant (and its multiples and fractions) defined in o2::constants::math.
float randomConePt = 0;
for (auto const& track : tracks) {
if (jetderiveddatautilities::selectTrack(track, trackSelection)) {
float dPhi = RecoDecay::constrainAngle(track.phi() - randomConePhi, static_cast<float>(-M_PI));

Check warning on line 128 in PWGJE/Tasks/jetBackgroundAnalysis.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[external-pi]

Consider using the PI constant (and its multiples and fractions) defined in o2::constants::math.
float dEta = track.eta() - randomConeEta;
if (TMath::Sqrt(dEta * dEta + dPhi * dPhi) < randomConeR) {

Check warning on line 130 in PWGJE/Tasks/jetBackgroundAnalysis.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root-entity]

Consider replacing ROOT entities with equivalents from standard C++ or from O2.
randomConePt += track.pt();
}
}
}
registry.fill(HIST("h2_centrality_rhorandomcone"), collision.centrality(), randomConePt - M_PI * randomConeR * randomConeR * collision.rho());

Check warning on line 135 in PWGJE/Tasks/jetBackgroundAnalysis.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[external-pi]

Consider using the PI constant (and its multiples and fractions) defined in o2::constants::math.

// randomised eta,phi for tracks, to assess part of fluctuations coming from statistically independently emitted particles
randomConePt = 0;
for (auto const& track : tracks) {
if (jetderiveddatautilities::selectTrack(track, trackSelection)) {
float dPhi = RecoDecay::constrainAngle(randomNumber.Uniform(0.0, 2 * M_PI) - randomConePhi, static_cast<float>(-M_PI)); // ignores actual phi of track

Check warning on line 141 in PWGJE/Tasks/jetBackgroundAnalysis.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[external-pi]

Consider using the PI constant (and its multiples and fractions) defined in o2::constants::math.
float dEta = randomNumber.Uniform(trackEtaMin, trackEtaMax) - randomConeEta; // ignores actual eta of track
if (TMath::Sqrt(dEta * dEta + dPhi * dPhi) < randomConeR) {

Check warning on line 143 in PWGJE/Tasks/jetBackgroundAnalysis.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root-entity]

Consider replacing ROOT entities with equivalents from standard C++ or from O2.
randomConePt += track.pt();
}
}
}
registry.fill(HIST("h2_centrality_rhorandomconerandomtrackdirection"), collision.centrality(), randomConePt - M_PI * randomConeR * randomConeR * collision.rho());

Check warning on line 148 in PWGJE/Tasks/jetBackgroundAnalysis.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[external-pi]

Consider using the PI constant (and its multiples and fractions) defined in o2::constants::math.

// removing the leading jet from the random cone
if (jets.size() > 0) { // if there are no jets in the acceptance (from the jetfinder cuts) then there can be no leading jet
Expand All @@ -153,7 +153,7 @@
float dEtaLeadingJet = jets.iteratorAt(0).eta() - randomConeEta;

bool jetWasInCone = false;
while ((randomConeLeadJetDeltaR <= 0 && (TMath::Sqrt(dEtaLeadingJet * dEtaLeadingJet + dPhiLeadingJet * dPhiLeadingJet) < jets.iteratorAt(0).r() / 100.0 + randomConeR)) || (randomConeLeadJetDeltaR > 0 && (TMath::Sqrt(dEtaLeadingJet * dEtaLeadingJet + dPhiLeadingJet * dPhiLeadingJet) < randomConeLeadJetDeltaR))) {

Check warning on line 156 in PWGJE/Tasks/jetBackgroundAnalysis.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root-entity]

Consider replacing ROOT entities with equivalents from standard C++ or from O2.
jetWasInCone = true;
randomConeEta = randomNumber.Uniform(trackEtaMin + randomConeR, trackEtaMax - randomConeR);
randomConePhi = randomNumber.Uniform(0.0, 2 * M_PI);
Expand All @@ -166,28 +166,29 @@
if (jetderiveddatautilities::selectTrack(track, trackSelection)) { // if track selection is uniformTrack, dcaXY and dcaZ cuts need to be added as they aren't in the selection so that they can be studied here
float dPhi = RecoDecay::constrainAngle(track.phi() - randomConePhi, static_cast<float>(-M_PI));
float dEta = track.eta() - randomConeEta;
if (TMath::Sqrt(dEta * dEta + dPhi * dPhi) < randomConeR) {

Check warning on line 169 in PWGJE/Tasks/jetBackgroundAnalysis.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root-entity]

Consider replacing ROOT entities with equivalents from standard C++ or from O2.
randomConePt += track.pt();
}
}
}
}
}

registry.fill(HIST("h2_centrality_rhorandomconewithoutleadingjet"), collision.centrality(), randomConePt - M_PI * randomConeR * randomConeR * collision.rho());

// randomised eta,phi for tracks, to assess part of fluctuations coming from statistically independently emitted particles, removing tracks from 2 leading jets
double randomConePtWithoutOneLeadJet = 0;
double randomConePtWithoutTwoLeadJet = 0;
for (auto const& track : tracks) {
if (jetderiveddatautilities::selectTrack(track, trackSelection)) {
float dPhi = RecoDecay::constrainAngle(randomNumber.Uniform(0.0, 2 * M_PI) - randomConePhi, static_cast<float>(-M_PI)); // ignores actual phi of track
float dEta = randomNumber.Uniform(trackEtaMin, trackEtaMax) - randomConeEta; // ignores actual eta of track
if (TMath::Sqrt(dEta * dEta + dPhi * dPhi) < randomConeR) {
if (!trackIsInJet(track, jets.iteratorAt(0))) {
randomConePtWithoutOneLeadJet += track.pt();
if (!trackIsInJet(track, jets.iteratorAt(1))) {
randomConePtWithoutTwoLeadJet += track.pt();
if (jets.size() > 1) { // if there are no jets, or just one, in the acceptance (from the jetfinder cuts) then one cannot find 2 leading jets
for (auto const& track : tracks) {
if (jetderiveddatautilities::selectTrack(track, trackSelection)) {
float dPhi = RecoDecay::constrainAngle(randomNumber.Uniform(0.0, 2 * M_PI) - randomConePhi, static_cast<float>(-M_PI)); // ignores actual phi of track
float dEta = randomNumber.Uniform(trackEtaMin, trackEtaMax) - randomConeEta; // ignores actual eta of track
if (TMath::Sqrt(dEta * dEta + dPhi * dPhi) < randomConeR) {

Check warning on line 186 in PWGJE/Tasks/jetBackgroundAnalysis.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root-entity]

Consider replacing ROOT entities with equivalents from standard C++ or from O2.
if (!trackIsInJet(track, jets.iteratorAt(0))) {
randomConePtWithoutOneLeadJet += track.pt();
if (!trackIsInJet(track, jets.iteratorAt(1))) {
randomConePtWithoutTwoLeadJet += track.pt();
}
}
}
}
Expand Down
Loading