Git Product home page Git Product logo

Comments (4)

u-eff-gee avatar u-eff-gee commented on June 10, 2024

Hi Xavier,

Thanks for posting your question.

First of all, I'd like to say that it would be helpful if you could explain more precisely what matrices and scripts you are referring to. Maybe provide a minimum working example. For the moment, I will attempt to make an educated guess because I know roughly what you are working on.

In general, the message you quoted is not necessarily a problem, it is just a warning. Internally, when loading a histogram in the ROOT format, hdtv checks for so-called "primitive binning" (difference between the maximum and minimum x value corresponds to the number of bins, see here

def HasPrimitiveBinning(hist):

i.e. bin number N should cover the x-value range from N-1 to N. With histograms that are created by external scripts, this may not always be the case. A very common issue here is that bin number N covers a range that is symmetric around an integer x value, i.e. N-0.5 to N+0.5. In this case, the conversion to a hdtv-style primitive binning is trivial.
On the other hand, if the calibration of your input spectrum is highly nonlinear or the x values are not even monotonously increasing, the loaded spectrum may look very different from what you viewed in ROOT.

There are many reasons why hdtv would print this warning message for one spectrum, but not the other. Maybe one of them has a calibration, and the other doesn't?

If the spectrum you loaded into hdtv looks like the one you viewed in ROOT, everything is probably alright. To be absolutely sure, you could try to perform the same fit using ROOT's fit interface and hdtv and check whether they agree.

Best,
Udo

from hdtv.

g3beam avatar g3beam commented on June 10, 2024

Hi Udo,

The process I have been taking when analyzing the gated spectrum is first done via ROOT to gate at specified energies. From there, I set the matrix file ,name, and parameters for the gate and two background gate limits. The script is then loaded to be viewed on ROOT and hdtv to analyze the gated coincidences.

Below is a sample of the script and images of what I have been encountering when trying to analyzing labr_labr for 64Ni. The first image was when I was loading the coincidence script and just an error in ROOT that was fixed. Last image is a gated spectrum for the first 2+ state at 1345 keV which is currently recalibrated at 1327 keV (the 511 keV peak was shifted to 506 keV). Using the following gated formula via hdtv to find the coincidences: Gate - 1/2(background1 +background2).

I am currently looking at the binning between labr_labr and labr_hpge as you have advised.

Ni64_gate.txt
Screenshot from 2023-01-27 11-21-28
Screenshot from 2023-02-17 11-56-00

Regards,

Xavier

from hdtv.

u-eff-gee avatar u-eff-gee commented on June 10, 2024

Hi Xavier,

If the code in the screenshot (which is not identical to the code in the text file) was used to generate the spectra that are shown in the hdtv screenshot, then it seems to me that you are not "Using hdtv for coincidence analysis" as the title of your issue implies. Your description corroborates that. hdtv also has coincidence-matrix analysis capabilities of its own (https://github.com/janmayer/hdtv/blob/master/doc/guide/hdtv.rst#matrix-interface). At the beginning, I thought that that was what you were referring to. It looks like you are analyzing 1D spectra that are the output from a ROOT script.

I can see nothing that is obviously wrong with the spectra you sent. The plot of the labr_hpge matrix is showing a 1D spectrum in red which you did not mention. A labr_labr matrix is not shown. The three 1D spectra look okay to me. They appear to have the usual Gaussian/Poissonian fluctuations (although that is a little hard to judge with a logarithmic y axis) and a satisfactory lineshape.
You are mentioning many experiment-specific pieces of information in your description, but not all of them seem to be related to your original issue with the unconventional binning. For example, I am not sure what you mean by:

The first image was when I was loading the coincidence script and just an error in ROOT that was fixed.

From Ni64_gate*.cpp, it is not possible to address the binning issue, because the binnings of gate, background_gate_1, and background_gate_2 all depend on the 2D histogram matrix whose properties are unknown.

I am currently looking at the binning between labr_labr and labr_hpge as you have advised.

Yes, that will help us figure out why the warning about "unconventional binning" is printed.

Please let me know if I got anything wrong here. There are several assumptions in my answer.

Best,
Udo

from hdtv.

op3 avatar op3 commented on June 10, 2024

Dear Xavier,

your matrix has a non-trivial binning (which for hdtv means anything else than bins with a width of 1, with the first bin centered at 0). The message that you see only means that hdtv is converting the binning of your matrix to its internal representation. This can safely be ignored in your case. This would only be a problem if you had a binning that can not be represented by a polynomial of order 4 (which is not the case).

I have to close this issue now, because this is not a support forum.

Best,
Oliver

from hdtv.

Related Issues (10)

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.