Add method SetWeights to Decays class
dbrundu opened this issue · 3 comments
The hydra::Decays
class does not contain a method to set the weights indipendently from the four-vectors. Altought this can be already done event-by-event, creating a new decay instance and copying only the four vectors using custom weights, a SetWeights
method would be useful, for example if we have a set of unweighted decays to reweight or to import the weights from a separate Sweights study.
Actually, this can be done event-by-event without any copying or new container creation . For example:
for (auto& x : decays.GetWeights( )) x = 1.5;
The method GetWeights() returns a r/w range pointing to the weights.
About a SetWeights() method: can be useful to set the events weights in block, using move semantics.
For event-by-event case, SetWeight(index, weight) or something similar would be more clear.
I will tag this issue as question & enhancement...
this issue lose applicability.