-
Notifications
You must be signed in to change notification settings - Fork 39
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
Support for TMultiGraph and THStack #92
Comments
Hi @zucchett, good point. We should also add the same functionality for |
Hi All, |
Hi @lucasflores, thanks for your feedback, glad the library is helping you! So far, I'm not aware of any developments regarding THStack inputs. If you'd be interested to write a function to facilitate this, your contribution would be very welcome and we'd be happy to provide some pointers! |
Hi @AndreasAlbert , Cool yeah I just wanted to make sure I wasn't redoing work already done :) So I took a crack at it, pointers would definitely be appreciated. You can take a look at my dev branch in my fork here https://github.com/lucasflores/hepdata_lib/tree/thstack_dev and relevant commit here lucasflores@7f1ec16. The additions ended up being minimal. It is essentially just a copy paste of read_hist_1d with a few extra lines (it ultimately might be better to just add the few lines to read_hist_1d/2d). Initial tests have this working as expected (and Adding the 2d version in this way is straight forward but I have yet to test it so it has not been added). So any thoughts as well as maybe some pointers on writing some official tests to add would be appreciated. Since the function is essentially read_hist_1d I would think the testing would really only be extend to making sure we have a THStack and that TH1s are contained inside. |
Hi @lucasflores, thanks for writing this. Before commenting on tests etc, let me clarify what I think you are doing. IIUC, you are reading the THstack as if it were a single histogram, and the user ends up with one set of y values that represent the sum of all histograms in the stack. Is that correct? In that case, I agree it might most straightforward to simply merge this into read_hist_1d. I can imagine though that it might also be useful to instead retrieve not just the total, but the individual stacked components separately, which I think would be an easy addition to what you have already written by adding a switch to |
Hi @AndreasAlbert , yeah no problem. And Ah no so this does take in a known specified individual hist name that exists in the stack say "h_Triboson3l" as a single background in your stack of backgrounds. You can also just pass in a bogus hist name and the error message will print out all the names of all the hists that exist in the stack in a list. With regards to the sum of the stack It was my understanding from this https://root-forum.cern.ch/t/thstack-and-getbincontent/18967/2 that by default the last histo in a stack should be the sum, so you should be able to get the sum in the same way as is already implemented. That being said an attempt with a stack from my own analysis I couldn't reproduce this with GetStack (no sum TH1 existed) but we might be doing something weird when we first create the stack. So yeah it is probably a good idea to have some functionality to return the sum as well. |
Hello! Is TMultiGraph now supported? Thanks! |
No, this discussion has not yet resulted in a pull request. We're always open for contributions! |
Support for TMultiGraph could be probably added to the wishlist. Support for TMultiGraph could make importing complex graphs much easier, and avoid painful conversions from TMultiGraph to TGraph in some cases.
The text was updated successfully, but these errors were encountered: