[PWGDQ] add tag and probe method for dalitz selection#15948
[PWGDQ] add tag and probe method for dalitz selection#15948glegras wants to merge 9 commits intoAliceO2Group:masterfrom
Conversation
|
O2 linter results: ❌ 23 errors, |
| TF1* fDCAxyresLow = new TF1("fDCAxyresLow", "[0] + [1] * pow(x, -[2])", 0.1, 1000.); | ||
| TF1* fDCAzresLow = new TF1("fDCAzresLow", "[0] + [1] * pow(x, -[2])", 0.1, 1000.); | ||
| TF1* fDCAxyresUp = new TF1("fDCAxyresUp", "[0] + [1] * pow(x, -[2])", 0.1, 1000.); | ||
| TF1* fDCAzresUp = new TF1("fDCAzresUp", "[0] + [1] * pow(x, -[2])", 0.1, 1000.); |
There was a problem hiding this comment.
How do these objects get deleted?
There was a problem hiding this comment.
Since they are used in the AnalysisCut, they cannot be deleted until the end. But now I modified so that these TF1 are defined only when necessary
There was a problem hiding this comment.
You didn't answer my question.
There was a problem hiding this comment.
I am not sure how they are deleted, maybe @iarsene you could check the PR and comment on that? Also I am using the standard coding of the PWGDQ framework, so if something is wrong about object deletions it should be modified in the entire framework.
There was a problem hiding this comment.
I'm asking because I don't see a single delete statement in the AnalysisCut class which would indicate that all the dynamically allocated objects with raw pointers leak, unless they are owned and handled by other classes.
There was a problem hiding this comment.
Hi Vit, in principle you are right. However, this function is allocated at init time, and then we need it until the end of the job. So this will not "leak" memory during the time the job is running. We can probably make the AnalysisCut to own this TF1 and then have an explicit delete when the cut gets destroyed at the end of the job.
There was a problem hiding this comment.
Hi Ionut, I don't know what you mean by "job" here, but I would expect the leak to live from the first call of ~AnalysisCut till the end of the program. Either the destructor should handle the deallocation or the raw pointers should be replaced with smart pointers.
There was a problem hiding this comment.
I changed from TF1* to shared_ptr now
No description provided.