Hi,
I’ve tried to send this mail before, but I think it has not reached the forum. Sorry if you get it twice!
My problem is the following:
I have two files (pippo1.root pippo2.root) containing the same 2D histo.
When I try hadd pippo.root pippo1.root pippo2.root the result has not been
added. Is this normal?
First File:
root [1] gDirectory->ls()
TFile** pippo1.root
TFile* pippo1.root
KEY: TH2F eff_MuNoIsoJetsL3PreFiltered:_NumMu_1_Num_Jets_1;1
Efficiency (%) vs HLT Pt threshold (GeV),
label=MuNoIsoJetsL3PreFiltered:_NumMu_1_Num_Jets_1
root [2] TH2* histo = (TH2*)
gDirectory->Get("eff_MuNoIsoJetsL3PreFiltered:_NumMu_1_Num_Jets_1;1")
root [3] histo->GetBinContent(1,1)
(const Double_t)1.97900000000000000e+03
Second File:
root [2] gDirectory->ls()
TFile** pippo2.root
TFile* pippo2.root
KEY: TH2F eff_MuNoIsoJetsL3PreFiltered:_NumMu_1_Num_Jets_1;1
Efficiency (%) vs HLT Pt threshold (GeV),
label=MuNoIsoJetsL3PreFiltered:_NumMu_1_Num_Jets_1
root [3] TH2* histo = (TH2*)
gDirectory->Get("eff_MuNoIsoJetsL3PreFiltered:_NumMu_1_Num_Jets_1;1")
root [4] histo->GetBinContent(1,1)
(const Double_t)1.97900000000000000e+03
Then I do:
hadd pippo.root pippo1.root pippo2.root
If I look at the output file it contains only 1979 events in first bin,
not 1979*2 as it should.
root [1] gDirectory->ls()
TFile** pippo.root
TFile* pippo.root
KEY: TH2F eff_MuNoIsoJetsL3PreFiltered:_NumMu_1_Num_Jets_1;1
Efficiency (%) vs HLT Pt threshold (GeV),
label=MuNoIsoJetsL3PreFiltered:_NumMu_1_Num_Jets_1
root [2] TH2* histo = (TH2*)
gDirectory->Get("eff_MuNoIsoJetsL3PreFiltered:_NumMu_1_Num_Jets_1;1")
root [3] histo->GetBinContent(1,1)
(const Double_t)1.97900000000000000e+03
If I load both files and add the histos “by hand” (histo->Add(histo2)) the
result is OK
root [15] histo->GetBinContent(1,1)
(const Double_t)3.95800000000000000e+03
Does anybody know what the problem can be?
Thank you for any help,
Silvia