Giter Site home page Giter Site logo

Comments (8)

AndreasAlbert avatar AndreasAlbert commented on July 29, 2024

Hi @zucchett, good point. We should also add the same functionality for THStack and make sure that they work consistently (i.e. similar calling syntax, same output format). The main difference between the two would be that each graph in a TMultiGraph can have an independent set of x values, wheres all histograms in a THStack will use the same x axis binning.

from hepdata_lib.

lucasflores avatar lucasflores commented on July 29, 2024

Hi All,
ATLAS guy here. Has there been anymore development on implementing THStack functionality? Also just to say this library has been great so far, thanks for putting something like this together.
-Lucas

from hepdata_lib.

AndreasAlbert avatar AndreasAlbert commented on July 29, 2024

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!

from hepdata_lib.

lucasflores avatar lucasflores commented on July 29, 2024

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.

from hepdata_lib.

AndreasAlbert avatar AndreasAlbert commented on July 29, 2024

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 read_stack_1d. What do you think?

from hepdata_lib.

lucasflores avatar lucasflores commented on July 29, 2024

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.

from hepdata_lib.

rmanzoni avatar rmanzoni commented on July 29, 2024

Hello! Is TMultiGraph now supported? Thanks!

from hepdata_lib.

clelange avatar clelange commented on July 29, 2024

No, this discussion has not yet resulted in a pull request. We're always open for contributions!

from hepdata_lib.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.