Trying to sum the histograms in the two files I obtain something weird:
For GenEle/pt the final hist seems to be correct
For HGCalCluTkGenMatchSelected/HGCalCluGenMatch/GenEle/pt the output file contains the sum of HGCalCluTkGenMatchSelected/HGCalCluGenMatch/GenEle/pt of the first file and GenEle/pt of the second file
------------------------------------------------------------------
| Welcome to ROOT 6.32.04 https://root.cern |
| (c) 1995-2024, The ROOT Team; conception: R. Brun, F. Rademakers |
| Built for linuxx8664gcc on Aug 30 2024, 19:16:07 |
| From heads/master@tags/v6-32-04 |
| With c++ (GCC) 14.2.1 20240805 |
| Try '.help'/'.?', '.demo', '.license', '.credits', '.quit'/'.q' |
------------------------------------------------------------------
Check duplicate issues.
Description
Hi everyone, I am having a problem with hadd trying to merge some TH1. I have attached the root file that I am using.
Command
hadd hadd.root ./EEstudy_DoubleElectronsPU0_131Xv3Tc_0.root ./EEstudy_DoubleElectronsPU0_131Xv3Tc_1.root
EEstudy_DoubleElectronsPU0_131Xv3Tc_0.root EEstudy_DoubleElectronsPU0_131Xv3Tc_1.root hadd.root
The files contain 2 TH1:
Trying to sum the histograms in the two files I obtain something weird:
I already had a first discussion on the ROOT forum: https://root-forum.cern.ch/t/hadd-does-not-add-correctly-histograms-in-nested-folders/61695
Reproducer
EEstudy_DoubleElectronsPU0_131Xv3Tc_0.root EEstudy_DoubleElectronsPU0_131Xv3Tc_1.root hadd.root
root check.cpp
For each bin:
HGCalCluTkGenMatchSelected/HGCalCluGenMatch/GenEle/pt
TH1 andGenEle/pt
TH1FileOut is always equal to Wrong Sum instead of Expected
Output:
ROOT version
Installation method
pre-built binary
Operating system
Linux
Additional context
No response