Hello @couet ,
I have a file (Stack_Hist_signals.C) that stack some histgrams but others nothing.Also
appear me warnning message suchtat
" Error in <HandleInterpreterException>: Trying to access a pointer that points to an invalid memory address. Execution of your code was aborted. In file included from input_line_8:1: /home/ahmed/bb- _Signals/Stack_Hist_Signals.C:147:6: warning: invalid memory pointer passed to a callee:
hmc[0][i]->SetLineColor(kYellow); "
^~~~~~~~~
I will send you the used root file and Stack_Hist_Signal.C to manage help me
The error message is clear, at least one of the “hmc[0][i]” is not found in the file. Check that all exist indeed; open the root file in a TBrowser and check or, e.g. in the code,
//...
hmc[0][i] = (TH1F*)rootH0BBbar->Get(hname_mc[i]);
if (!hmc[0][i]) {
cout << hname_mc[i] <<" not found" << endl;
return;
}
//...
gives the following (I show only the lines relevant to the issue):
KEY: TH1D fatJet_PT;1 fatJet_PT distribution
KEY: TH1D fatJet_Eta;1 fatJet_Eta distribution
KEY: TH1D fatJet_Mass;1 fatJet_Mass distribution
KEY: TH1D fatJet_DeltaEta;1 fatJet_DeltaEta distribution
KEY: TH1D fatJet_DeltaPhi;1 fatJet_DeltaPhi distribution
Mind these leading spaces in the names of the first two histograms - this is no bueno, and these are the primary reason for the crash.