Can somebody please explain to me why histogram h30 is empty after the execution of the macro? a “h30->Draw()” from the command line produces an empty plot.
Thanks.
–Christos
===========================================
int run(void)
{
TH1F * h10 = new TH1F(“h10”,“hist 10”, 100, -10, 10);
TH1F * h20 = new TH1F(“h20”,“hist 20”, 100, -10, 10);
TH1F * h30 = new TH1F(“h30”,“hist 30”, 100, -10, 10);
for(Int_t i = 0; i != 1000; ++i)
{
h10->Fill(gRandom->Gaus(0,2));
h20->Fill(gRandom->Gaus(0,3));
}
Could you be a bit more specific, i.e. what should I do instead? I want h30 to stay in memory, that’s why I use new. In the first script, that did not work (obviously). In the second script, I removed the first instantiation:
TH1F * h30 = new TH1F(“h30”,“hist 30”, 100, -10, 10);
since I use new when I call the GetAsymmetry method.