-
Notifications
You must be signed in to change notification settings - Fork 17
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
Variable CSA response curve #18
Conversation
c4685d8
to
4733eef
Compare
b35bf9b
to
66aab1a
Compare
@simonspa this is now how I would implement it. I tested the I would add a CI test and update the documentation once you're happy with the implementation. |
Btw the github CI needs to be updated for the latest commits:
|
Alright I tested if the function is invalid and if the amount of parameters given isn't the same as the function takes, both throw as expected. In the first case, I found no way to disable the output of the root error message, but that isn't necessarily bad as it helps to understand what's wrong in the formula. It isn't pretty though. One open question is the default value. Right now I just use some formula with random values that roughly imitate what the MuPix10 does. However, I think it's rather ugly. How does simply returning 0 sound to you? |
That's an interesting behaviour... I will have a look at this, thanks! |
Hej @stephanlachnit thanks for the ping - this approach to me looks very elegant and clean, you're using the same code for all models. I have two (very nit-picking) ideas:
Apart from that: 🚀
Thanks a lot, nice piece of code! :) Simon |
Oh yeah good idea.
Agreed.
I don't like it either, but I don't a fitting name for it.
Alright then I will start working on that.
Good idea. |
|
49dfc27
to
e8bdbd7
Compare
Ok I think I'm almost done. Two things left:
|
Minor detail: Feel free to pile up several commits, that makes them more atomic and in the end eases finding a problem later on e.g. using |
Concerning the test cases: these current are rather system tests than unit tests, meaning we have no introspection into the code but simply parse the output of a single-event run with the relevant modules active. This approach is described here in the manual: The |
e8bdbd7
to
1476dc2
Compare
Ok thanks for the explanation for the unit tests. I now use #PASS [R:CSADigitizer:mydetector] Pixel (2,0): time 7clk, signal 515clk
#PASSOSX [R:CSADigitizer:mydetector] Pixel (2,0): time 7clk, signal 515clk since this will check if the function is actually applied. I could also use #PASS [C:CSADigitizer:mydetector] Response function successfully initialized with 3 parameters
#PASSOSX [C:CSADigitizer:mydetector] Response function successfully initialized with 3 parameters which describes a bit more what is actually tested, but is a bit weaker. |
Also regarding the documentation, in https://github.com/allpix-squared/allpix-squared/blob/master/doc/usermanual/chapters/testing.tex a lot of tests are missing so I didn't add the new one, should I add it? |
You could also just add two tests :) |
I still hope to get that autogenerated from CMake at some point: https://gitlab.cern.ch/allpix-squared/allpix-squared/-/issues/207 - so from my point of view: don't bother. :) |
1476dc2
to
a98e513
Compare
Signed-off-by: Stephan Lachnit <stephanlachnit@protonmail.com>
Signed-off-by: Stephan Lachnit <stephanlachnit@protonmail.com>
a98e513
to
b0d7c79
Compare
Yup, just did. Note though: maybe add a trailing zero in the second number of the tests like with the first number (e.g. I think I fixed everything you pointed out. I will probably come back to the examples and exchange some values for the MuPix10 when I have better ones. |
b0d7c79
to
1246bd4
Compare
Signed-off-by: Stephan Lachnit <stephanlachnit@protonmail.com>
Signed-off-by: Stephan Lachnit <stephanlachnit@protonmail.com>
Also add a "/" at the start of the cmake ignore. Signed-off-by: Stephan Lachnit <stephanlachnit@protonmail.com>
1246bd4
to
3759ecf
Compare
Ah found typos. Fixed now (hopefully). |
Awesome, thanks a lot, @stephanlachnit for all your work and this very neat feature! Final CI run on Gitlab here: https://gitlab.cern.ch/allpix-squared/allpix-squared/-/merge_requests/455 |
Tests are executed in parallel in the CI, so there is no natural order in running them. But I agree, it's not very nice for ordering. We are planning to make the tests more atomic and eventually move them to their respective modules - then the ordering problem would be largely gone anyway. |
👏 |
Closes #17
@simonspa so this would be the my initial idea for the implementation. It's not polished by any means, just a concept.
I thought figured offloading everything to a different files makes changes or additional implementations in the future easier. Especially with the impulse response being part of a class, any type of response can be implemented. In theory, one could even move the entire pulse amplification loop to the class, to implement features like saturation.