I have a compiled analyzer that accesses a pair of TH1F histograms that may or may not have Sumw2 set. The code calls:
hReco->Sumw2();
hSim->Sumw2();
And crashes if Sumw2 has already been called, throwing this message:
Fatal Root Error: @SUB=TH1F::Sumw2
Sum of squares of weights structure already created
When interpreted, the same code only gives a warning. Is the error a bug, or expected behavior. If it is indeed expected behavior, can you suggest a way to check if the structure already exists before calling Sumw2?
Thanks,
Jeff