Fix a couple of bugs in lalinference modeList input
The code was using strtok_r
passing ppt=LALInferenceGetProcParamVal(commandLine,"--modeList")
as first argument. However strtok_r modifies the first argument in place...
Since MCMC is multithreaded, initCBC is being called multiple times, but the first caller would modify the argument of --modeList
in place, terminating it after the first set of l,m, which means the other callers would only get only one l,m added to their LALSim structure.
MCMC results produce with this code are thus to be discarded. Only one chain will have the correct (l,m)'s (maybe) while the others will for sure be wrong and only have whatever mode happened to be first in --ModeList [...]
I also added a few comments and improved the variable naming style.