GRIFFINCollaboration / GRSISort

A lean, mean, sorting machine.
MIT License
21 stars 54 forks source link

Issues when loading TBGsubstraction #1453

Closed JRMurias closed 1 month ago

JRMurias commented 2 months ago

I'm trying to analyze data using the TBGsubstracitoon on both my laptop and a new desktop computer, but this error pops up on both. In my work-pc works fine and i do not understand why this is happening. Root version is 6.23 for the new desktop and 6.28 for the laptop. Grsisort versions are 4.0.0.5 and 4.0.0.4 respectively

TBGSubstraction

VinzenzBildstein commented 2 months ago

As you can see from the error message, the constructor of TBGSubtraction takes a TH2* as the first argument, and not a string ("ggE"). So simply omit the quotation marks and it should work (assuming ggE is a 2D histogram).

JRMurias commented 2 months ago

It did not work wihtout the quotations but playing around i fixed the issue by adding into the line, new TBGSusbtraction(ggE).

Another thing called my attention, nothing wrong happens when gatting with only one bakground, but the viewer crashes when i use 2. I realize this as when i click to select the 2nd background, the histogram is represented by dots and after a few i need to restart again

Screenshot from 2024-09-10 01-42-08

VinzenzBildstein commented 2 months ago

I just tried, and I cannot reproduce that on our servers (using Ubuntu 22.04, ROOT 6.30.06, most recent GRSISort - commit 4b970a909).

Typically ROOT changes histograms from normal "hist" plotting style to the "error" plotting style on its own when the weights get set. This can e.g. happen when scaling a histogram. You can see this when you plot a normal 1D histogram without any argument. It will show the "normal" plotting style with one continuous line made up from straight horizontal and vertical segments. If you take that histogram and scale it, even if you scale it by 1., once you refresh the canvas it will switch to the error bar plot.

bolaizol commented 2 months ago

I always find very hard to separate peaks in error plot, so I suggest changing it to "hist":

d01edaf73bd199d642a42b3593bcd89876909de1

I tested it locally and it even seems to be a bit more stable (TBGSubtractor still crashes a lot, like every time I close it).

VinzenzBildstein commented 2 months ago

I merged that PR. TBSubtractor crashing when you close it is an old issue, it seems to have something to do with the memory management. My guess would be that ROOT is trying to delete things that have already been deleted. But apart from that I never had an issue with it crashing?

VinzenzBildstein commented 2 months ago

Did that PR solve your problem, @JRMurias?

JRMurias commented 2 months ago

Pretty much, still have the feeling that somehting is not right when re-trying fits and such but will investigate and make a new post if i cannot figure it out. Thank you guys

VinzenzBildstein commented 1 month ago

One note about this, by now using "hist" as a drawing option, none of the associated functions of the histogram are drawn at the same time. We could overcome this (if it ever becomes a problem) by looping over the list of functions and drawing those with option "same".