Closed BrieucF closed 9 years ago
@blinkseb : to address the second point, is there a way around with the structs stored from PR #22 ? Or do we need to store these manually ?
we can request hh_leptons.isID_L
, or check @hh_leptons.size()
, but I could not find a way to get @hh_leptons.isID_L.size()
A shot in the dark here. Does hh_leptons.@isID_L.size()
work ?
Le 8 oct. 2015 19:03, "Olivier" notifications@github.com a écrit :
@blinkseb https://github.com/blinkseb : to address the second point, is there a way around with the structs stored from PR #22 https://github.com/cp3-llbb/HHAnalysis/pull/22 ? Or do we need to store these manually ?
we can request hh_leptons.isID_L, or check @hh_leptons.size(), but I could not find a way to get @hh_leptons.isID_L.size()
— Reply to this email directly or view it on GitHub https://github.com/cp3-llbb/HHAnalysis/issues/18#issuecomment-146624749.
It does :smile: !
\o/
2015-10-09 9:27 GMT+02:00 Olivier notifications@github.com:
It does [image: :smile:] !
— Reply to this email directly or view it on GitHub https://github.com/cp3-llbb/HHAnalysis/issues/18#issuecomment-146778588.
Sébastien Brochet
So, you have a vector of structures, and this gives you the length of the vector which have isID_L to true?
yep, aka nLeptonLoose in this case
I don't think it's true. hh_leptons.@isID_L.size()
should returns the size of the isID_L
vector, what ever it's inside.
correct, did not look correctly at the content, yes, hh_leptons.@isID_L.size()
works, but return the same as hh_leptons.isID_L
:
so we need to store these multiplicities independently. Is my understanding correct ?
Ok that's weird here, I'll do some test, but my understanding so far was:
hh_leptons.@isID_L.size()
returns the number of entries inside the isID_L
arrayhh_leptons.isID_L
returns the content of the array, so since it's bool, only true or false for each entry.If you need to access the number of entries with hh_leptons.isID_L == true
I don't think there's an easy way to do that in ROOT at Draw time, but maybe there's. Time to restudy the doc :fearful:
after discussing with @swertz : maybe the easiest and cleanest way would be, in addition to storing hh_leptons.isID_L
, to store another vector hh_leptons_L
, containing the indices of the loose leptons.
This way we would both have an easy access to multiplicities, and an easy looping access over loose leptons only (not the most optimal for the size, but not the worst either)