-
Notifications
You must be signed in to change notification settings - Fork 497
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
PWGCF: flow-task: fix mistakes and add option to consume less memory #7971
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, use std::fabs
instead of abs
. The last one will not work as you would expect
PWGCF/Flow/Tasks/FlowTask.cxx
Outdated
switch (cfgFilterFlag) { | ||
case 0: | ||
return track.isGlobalTrack(); | ||
case 1: | ||
return (track.isGlobalTrackSDD() == (uint8_t) true); | ||
case 2: | ||
return (track.isGlobalTrackWoTPCCluster() && track.tpcNClsFound() >= cfgCutTPCclu); | ||
case 3: | ||
return (track.isGlobalTrackWoPtEta() && (abs(track.eta()) < cfgCutEta) && (track.pt() > cfgCutPtMin) && (track.pt() < cfgCutPtMax)); | ||
case 4: | ||
return (track.isGlobalTrackWoDCA() && abs(track.dcaZ()) <= cfgCutDCAz && abs(track.dcaXY()) <= cfgCutDCAxy * pow(track.pt(), -1.1)); | ||
case 5: | ||
return (track.isGlobalTrackWoDCATPCCluster() && abs(track.dcaZ()) <= cfgCutDCAz && abs(track.dcaXY()) <= cfgCutDCAxy * pow(track.pt(), -1.1) && track.tpcNClsFound() >= cfgCutTPCclu); | ||
default: | ||
return false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, don't use abs
. It turned out that now it is behaving as it should have, i.e. return an int
Use instead std::fabs
Hi @victor-gonzalez , thank you for your remind for the abs! I have fixed this.
I am using o2 inline node function nabs(). Is it corrected? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The use of nabs
in filters is correct
No description provided.