Hi Barbara,
sorry for the delay,
I know there is an option at the <plot
construction named norm
.
See for example the implementation inside TRestAnalysisPlot.cxx
,
plot.normalize = StringToDouble(GetParameter("norm", plotele, ""));
If you give the option norm="1"
it will adjusts the contents of the histogram bins so that the integral is equal to 1.
I have seen this working with TH1D histograms, but never tested with TH2D. Probably there is no big difference, and it just should work. Please, let me know in any case.
There is not such option directly at TRestAnalysisPlot
right now. Although it might not be hard to integrate. I will add it as an issue to github so that it is at least on the list of things todo.
But … an option is always to save your plot as .C
or .root
so that you can recover the histogram later on.
If, instead of save="plot.pdf"
you write save="plot.C"
you will save the generated plot as a macro that will generate the histogram. You can then modify the macro.
To change the palette it is something like
gStyle->SetPalette(kRainBow);
See TColor
reference.
https://root.cern.ch/doc/master/classTColor.html
So, probably, something like
root
[0] gStyle->SetPalette(kRainBow);
[1] .L plot.C
should work, but if it does not, perhaps it is because gStyle->SetPalette(xxx)
is being called from the plot.C
macro itself.
Please, let us know how the problem solves finally.
No, when you create a TH2D Histogram with 2 variables, it will fill a histogram by units
I.e.
histo2D->Fill(hitsAna_xMean, hitsAna_yMean);
will increase the corresponding bin by 1.
There is another call where you are allowed to add a weight (that could be the corresponding energy in keV). But it is not the case for us. We do not have a weight option here :(.
Instead, you could create a <cut
on hitsAna_energy
in order to create a hitmap on a specific energy range.