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

PWGCF: flow-task: fix mistakes and add option to consume less memory #7971

Merged
merged 4 commits into from
Oct 13, 2024

Conversation

Luzhiyongg
Copy link
Contributor

No description provided.

Copy link
Collaborator

@victor-gonzalez victor-gonzalez left a 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

Comment on lines 568 to 582
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;
Copy link
Collaborator

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

@Luzhiyongg
Copy link
Contributor Author

Hi @victor-gonzalez , thank you for your remind for the abs! I have fixed this.
Besides those using abs(), In Filter

Filter collisionFilter = nabs(aod::collision::posZ) < cfgCutVertex;
Filter trackFilter = (nabs(aod::track::eta) < cfgCutEta) && (aod::track::pt > cfgCutPtMin) && (aod::track::pt < cfgCutPtMax) && (aod::track::tpcChi2NCl < cfgCutChi2prTPCcls) && (aod::track::itsChi2NCl < cfgCutChi2prITScls);

I am using o2 inline node function nabs(). Is it corrected?

Copy link
Collaborator

@victor-gonzalez victor-gonzalez left a 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

@victor-gonzalez victor-gonzalez merged commit f5c6fc0 into AliceO2Group:master Oct 13, 2024
10 checks passed
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