I have a tree with these two branches:
*............................................................................*
*Br 2 :HGamTruthHiggsBosonsAuxDyn.pt : vector<float> *
*Entries : 20000 : Total Size= 387205 bytes File Size = 168111 *
*Baskets : 200 : Basket Size= 3584 bytes Compression= 2.28 *
*............................................................................*
and
******************************************************************************
*Br 0 :HGamEventInfoAuxDyn.weightInitial : *
* | HGamEventInfoAuxDyn.weightInitial/F *
*Entries : 20000 : Total Size= 106417 bytes File Size = 102000 *
*Baskets : 200 : Basket Size= 1536 bytes Compression= 1.00 *
*............................................................................*
Unforunately the first is a vector, but it has always exactly one element.
If I make an histogram of the quantity, without considering weights
df.Histo1D({"", "", 100, -10E3, 800E3}, "HGamTruthHiggsBosonsAuxDyn.pt").GetValue()
it works smootly. I guess that the logic is the same as the TTree::Draw
: for each event it loops on all the element of the vector (in my case I have only and always one element).
Now, with weights:
df.Histo1D({"", "", 100, -10E3, 800E3}, "HGamTruthHiggsBosonsAuxDyn.pt", "HGamEventInfoAuxDyn.weightInitial").GetValue()
it triggers a bunch or error that saying that it cannot resolve the function (attached)
error2.txt (11.7 KB)
So: why? Why it cannot handle a std::vector<float>
when using weights? I would expect the same capabilities with/without weights.
I tried to solve this problem in the following way:
df.Define("ptH", "HGamTruthHiggsBosonsAuxDyn.pt[0]").Histo1D({"", "", 100, -10E3, 800E3}, "ptH", "HGamEventInfoAuxDyn.weightInitial").GetValue()
seems to work, but quite ugly that with/without weights I have different behaviour.
_ROOT Version:6.16/00
Platform: Not Provided
Compiler: Not Provided