-
Notifications
You must be signed in to change notification settings - Fork 4
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
Added exponential shaping function to TRestRawSignalShapingProcess #58
Conversation
src/TRestRawSignalShapingProcess.cxx
Outdated
} else if (fShapingType == "exponential") { | ||
Nr = (Int_t)(5 * fShapingTime); | ||
|
||
rsp = new double[Nr]; |
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.
We should in general avoid to use new
, particularly in standard data types such as double
. I think we can easily replace by std::vector<double>
in this case.
I know this issue was not introduced in this PR, but we should try to fix it, let me know in case of doubts, I can provide code changes.
@juanangp Not sure what's is the issue with |
We should only use pointers whenever it is requiered (which is not that common), and in this cases we should attempt to use smart pointers (https://en.cppreference.com/book/intro/smart_pointers), root may give issues with this so it may not be always possible. In this case I don't think using pointers serves any purpose, but I have not reviewed the code in detail. Also we should not use C style arrays either (stuff like Also in my opinion we should always try to replace old variable names with more explicit variable names, i.e. It is also not necessary (and not recommended IMO) to use |
While using The solution that you provide using c style arrays is fine to me since you are not recursivelly calling Perhaps you should remove the |
As a general comment, the pipeline was failing, it seems that your local branch was quite behind master, please make sure that your branch is up-to-date before creating the PR. To merge master with your local branch you just have to do I have changed a little the code, using |
New response fuction added to TRestRawSignalShapingProcess, the exponential function: exp(-x/t)