does @couet or someone else know how to fix it please?
I was away for a bit. Looking at your new code now.
I do not get the same error. It seems your code has some invalid pointer:
Error in <HandleInterpreterException>: Trying to dereference null pointer or trying to call routine taking non-null arguments.
Execution of your code was aborted.
In file included from input_line_9:1:
/Users/couet/Downloads/calo.C:6886:14: warning: null passed to a callee that requires a non-null argument [-Wnonnull]
p09sub = htemp9sub->GetFunction("gaus")->GetParameter(0);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Hi @couet, I don’t know. I get the error just when I add
TH1 *hh2 = henecdsubstringcutrelTHFsumdiff->DrawCopy("colz"); // creates all axes
gPad->Modified();
gPad->Update(); // make sure it's really (re)drawn
TPaletteAxis * palette2 = (TPaletteAxis *) hh2->GetListOfFunctions()->FindObject("palette");
palette2->SetX1NDC(0.86);
palette2->SetX2NDC(0.90);
palette2->SetY1NDC(0.20);
palette2->SetY2NDC(0.80);
c45->Modified();
c45->Update();
otherwise, it works (but I can’t move the palette). Moreover, I would like to increase the marker size…so I wrote:
henecdsubstringcutrelTHFsumdiff->SetMarkerSize(20);
the marker size doesn’t increase.
The error I get is not due to the palette2 code. I commented it and I get the same error.
You are right…I commented it and I get error…but I downloaded again your file and I get error using it too o_O
When you uploaded it, it worked… I get the same error that in my printscreen…
line 3258 TH1 *hh = henecdsubstringcutrelTHF->DrawCopy("colz"); // creates all axes
I can’t understand what is happening…
Sometimes your histograms are empty and the fit does not produce any function. But you call GetParameter on this non existing function. This is why it crashes. I have put a few protections here and there to make your macro work. I would anyway recommend that you revisit it completely. It really looks very “draft” (no indentation, a lot of useless code, etc …).
calo.C (1.0 MB)
Hi @couet, thank you for your help.
- The macro currently works, but when I add
TH1 *hh2 = henecdsubstringcutrelTHFsumdiff->DrawCopy("colz"); // creates all axes
TPaletteAxis * palette2 = (TPaletteAxis *) hh2->GetListOfFunctions()->FindObject("palette");
palette2->SetX2NDC(0.93);
gPad->Modified();
gPad->Update(); // make sure it's really (re)drawn
c25->Modified();
c25->Update();
henecdsubstringcutrelTHFsumdiff->SetName(heneabname);
gPad->Modified();
gPad->Update(); // make sure it's really (re)drawn
to move also the second palette, it crashes again;
2. can you say me the useless code?
3. I would like to set the mark size. I wrote
henecdsubstringcutrelTHFsumdiff->SetMarkerSize(20);
but it doesn’t look to change…
- Please, can you check also this post please? Set energy 0 in a sum
Can you post the macro as you modified it ?
I ran you macro. I do not get any crash
I can’t try, I don’t have the si-500636660.root file: Error in <TFile::TFile>: file C:/si-calo-sep18/si-500636660.root does not exist
OK, I can reproduce the problem on Windows
OK, so you can’t create TH2F with 10000*10000 bins with 32 bit floating points on a 32 bit machine: 10000*10000*32 = 3.2GB! (max: 2GB)
Well, I’m not sure setting a marker size on a TH2F drawn with COLZ makes any sense. What you see is the bin size… Maybe @couet can comment on this one
You are right, it does not makes sense.