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: give a maximum-pT cut on jet constituents #7583

Closed
wants to merge 2 commits into from

Conversation

joonsukbae
Copy link
Contributor

Hi Nima,
Existing track pT max cut can't allow jet rejection after jets finding w/o track pT cut both in jetfinderQA nor jetfinder tasks, thus I added this selection in jet acceptance task.

@nzardosh
Copy link
Collaborator

nzardosh commented Sep 5, 2024

Hi Joonsuk, i think the function is cleaner like this:

template <typename T, typename U>
bool isAcceptedJet(U const& jet)
{

if (jetAreaFractionMin > -98.0) {
  if (jet.area() < jetAreaFractionMin * M_PI * (jet.r() / 100.0) * (jet.r() / 100.0)) {
    return false;
  }
}
bool checkConstituentPt = true;
bool checkConstituentMinPt = (leadingConstituentPtMin > -98.0);
bool checkConstituentMaxPt = (leadingConstituentPtMax < 9998.0);
if (!checkConstituentMinPt && !checkConstituentMaxPt) {
  checkConstituentPt = false;
}

if (checkConstituentPt){
  bool isMinLeadingConstituent = !checkConstituentMinPt;
  bool isMaxLeadingConstituent = true;

for (const auto& constituent : jet.template tracks_as<T>()) {
  double pt = constituent.pt();

  if (checkConstituentMinPt && pt >= leadingConstituentPtMin) {
    isMinLeadingConstituent = true;
  }
  if (checkConstituentMaxPt && pt > leadingConstituentPtMax) {
    isMaxLeadingConstituent = false;
  }
}
return isMinLeadingConstituent && isMaxLeadingConstituent;
}

return true;

}

can you please check it works and change accoridngly?

@joonsukbae
Copy link
Contributor Author

joonsukbae commented Sep 5, 2024

Sure, thanks for the repair. I'll check it then fix it:)
Btw, would the lack of an early exit condition significantly impact performance? In the case of the MB MC dataset I’m using, the jets have an average of around 3 constituents each.

@nzardosh
Copy link
Collaborator

nzardosh commented Sep 5, 2024

I think the problem with the early condition was that if we want to add a condition not related to the pT later then it would be skipped

@joonsukbae
Copy link
Contributor Author

Please ignore this fetch at 21:23. Because my O2 installation failed in local, I pulled upstream.

@joonsukbae joonsukbae closed this Sep 6, 2024
@joonsukbae
Copy link
Contributor Author

I checked your solution and it works very well in local

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants