Skip to content

Commit

Permalink
Fix decay map in event mergers
Browse files Browse the repository at this point in the history
  • Loading branch information
vlvovch committed Nov 7, 2020
1 parent 6359ee5 commit b19e19c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/library/HRGEventGenerator/SimpleEvent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,17 @@ namespace thermalfist {
ret.DecayMap.reserve(evt1.DecayMap.size() + evt2.DecayMap.size());
ret.DecayMap.insert(ret.DecayMap.end(), evt1.DecayMap.begin(), evt1.DecayMap.end());
ret.DecayMap.insert(ret.DecayMap.end(), evt2.DecayMap.begin(), evt2.DecayMap.end());
int offset = evt1.DecayMap.size();
for (int i = evt1.DecayMap.size(); i < ret.DecayMap.size(); i++)
if (ret.DecayMap[i] != -1)
ret.DecayMap[i] += offset;

ret.DecayMapFinal.reserve(evt1.DecayMapFinal.size() + evt2.DecayMapFinal.size());
ret.DecayMapFinal.insert(ret.DecayMapFinal.end(), evt1.DecayMapFinal.begin(), evt1.DecayMapFinal.end());
ret.DecayMapFinal.insert(ret.DecayMapFinal.end(), evt2.DecayMapFinal.begin(), evt2.DecayMapFinal.end());

for (int i = evt1.DecayMapFinal.size(); i < ret.DecayMapFinal.size(); i++)
ret.DecayMapFinal[i] += offset;

// TODO: check if proper to combine weights like that
ret.weight = evt1.weight * evt2.weight;
ret.logweight = evt1.logweight + evt2.logweight;
Expand Down

0 comments on commit b19e19c

Please sign in to comment.