Hello Everyone,
I have a small problem after making the projections. I will attach the relevant script here.
I have two files, one is the background data while the other is the data file.
The first thing I want to do is open the background file and make a projection of 25 background Runs, from which I get the projection. Then I integrate a specific region as shown from 401, 500. This one will be used for scaling.
The next thing I want to do is to make the projection of the data runs and subtract from each data run the 25 background Runs.
Then I performed the subtraction from the data run-background run, Also, I draw them and I see that the subtraction has been performed.
Here I have the problem, I want to take an integral for the data run-background run for the specific region, However the integral that I take only gives me the data run counts and not counts from the subtracted one. More specifically from the code, I want to see the counts_integral1 taken from h2(after background subtraction) and not from the px.
Any help will be appreciated.
Sorry for the long post.
However the integral that I take only gives me the data run counts and not counts from the subtracted one.
Can you share the plots of h->ProjectionY (Form ("slices_%zu", ibin), ibin, ibin, ""); and h2 for one single ibin? And the corresponding counts_integral1 for that bin?
How does (h2->FindBin (6.), h2->FindBin (19.)) relate to (401,500)?
It is because I want to know the number of counts in the peak in the data runs. so the FindBin(6.,19.) and (401,500) are not related to each other.
Below I will show some of the projections in the canvas c3 below for
The corresponding counts_integral1 are the same before and after the background subtraction.
0
6
10
0
4
7
2
The issue is that counts_integral1 should give me the counts after subtraction but it gives me the counts before the subtraction. Or maybe somehow the subtraction is not working correctly, I recently noticed that the before and after the background spectra looks the same but after the subtractions the entries are less.
Thanks.
Let me know if you need some more information.
Hi,
I want to scale the background and then subtract it from all the slices (px). So I have to scale the same background with all the slices.
what do you mean by scaling the h once, Its a TH2 and the background is TH1?
So I am not sure if it will work.
For scaling, I only know this way to scale, before it worked for me but it does not work for the slices(px)