Giter Club home page Giter Club logo

Comments (5)

trholmes avatar trholmes commented on August 22, 2024 1

Glad you're thinking about these details! In fact what we do is significantly simpler than what you're describing. The bin itself is built on the values in the full range (not just the leading edge) so in principle this is taken care of by construction. You can just use the value returned by the FindBin() function.

Of course there are small issues this can create if your distribution within a bin is dramatically different between the sample this was measured on vs. the sample you're applying it to, but we try to make the bins small enough that this is not an issue.

from llp_sleptons_rpv_susy.

trholmes avatar trholmes commented on August 22, 2024 1

from llp_sleptons_rpv_susy.

A-A-Abdelhamid avatar A-A-Abdelhamid commented on August 22, 2024

@trholmes Thanks!

This makes sense, but there is an issue with that function. The graph/plot in the ROOT file is not a histogram object, it is a "TGraph2DErrors" object

It does not have a FindBin() method and gives this error when I try to use it:

AttributeError: 'TGraph2DErrors' object has no attribute 'FindBin'

Here is the ROOT files contents:

command _file0->ls()
output:

TFile**		HEPData-ins1831504-v2-pt-d0_muon_efficiency.root	
 TFile*		HEPData-ins1831504-v2-pt-d0_muon_efficiency.root	
  KEY: TDirectoryFile	pt-d0 muon efficiency;1	pt-d0 muon efficiency

command:

_file0->cd("pt-d0 muon efficiency");
_file0->ls();

output:

TFile**		HEPData-ins1831504-v2-pt-d0_muon_efficiency.root	
 TFile*		HEPData-ins1831504-v2-pt-d0_muon_efficiency.root	
  TDirectoryFile*		pt-d0 muon efficiency	pt-d0 muon efficiency
   KEY: TGraph2DErrors	Graph2D_y1;1	doi:10.17182/hepdata.98796.v2/t15
  KEY: TDirectoryFile	pt-d0 muon efficiency;1	pt-d0 muon efficiency

One way to get around this is to extract the x,y,z values and plotting it as a histogram (TH2), (or maybe in this case it might be easier to use one of the suggestions I mentioned earlier.)

What do you think?

from llp_sleptons_rpv_susy.

trholmes avatar trholmes commented on August 22, 2024

from llp_sleptons_rpv_susy.

A-A-Abdelhamid avatar A-A-Abdelhamid commented on August 22, 2024

I used the GetHistogram() function:
I simply typed hist=_ graph.GetHistogram()
, and it works as expected. According to the function's documentation:

 "If fHistogram doesn't exist, books the 2D histogram fHistogram with a margin around the hull. Calls TGraphDelaunay::Interpolate at each bin centre to build up an interpolated 2D histogram."

I plotted it to see how it looks and compared it to the original plot.
hist

The binning here is different compared to the histogram in the paper.
Here, instead of having one bin for 100GeV to 170 GeV as the original plot, it creates 5 bins centered at "107.875, 123.625, 139.375, 155.125, 170.875" GeV.

Same with the 25mm-75mm bin, which is now 7 bins centered at "28.125, 34.375, 40.625, 46.875, 53.125, 59.375, 65.625, 71.875" mm, the efficiencies for these new bins are interpolated. 

A muon with 100-170 GeV and 25-75mm d0 has an efficiency of 0.54118 then it jumps to 0.4164 at 75mm in the original plot. Now efficiency for bin centered at (107.875 GeV, 28.125 mm) is 0.540038875, for bin centered at 139.375, 46.875  mm ) is 0.519581875, for bin centered at (170.875 GeV, 71.875 mm) is 0.49807787500000006 and for bin centered at (170.875 GeV, 78.125 mm) is 0.468099125

I am not sure why it chose to change the binning, but I believe this is perfectly fine (probably even better now), but I wanted to let you know just in case.

Thanks!
@trholmes

from llp_sleptons_rpv_susy.

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.