jackfrost373 / LHCb_Xic_production

Honours programme analysis at MSP for MSP honours students, measuring the production ratio of Xi_c over L_c in the LHCb experiment.
2 stars 4 forks source link

order of arguments when running "fit.py" #75

Open Jan-03 opened 2 years ago

Jan-03 commented 2 years ago

not sure if this is intended or not, but when running fit.py the -s argument must be given before the -m argument otherwise the code won't run.

cpawley commented 2 years ago

If it is intentional it should be in the help and the README.md (and otherwise it should be amended such that we can have the shape defined anywhere)

jackfrost373 commented 2 years ago

Ah, it seems to be because of the handling of arguments: '-s' is checked first, and then for some reason it is removed from the argument list making the list shorter, hence messing up the iteration over arguments...

See https://github.com/jackfrost373/LHCb_Xic_production/blob/master/analysis/Scripts/MassFitting/fit.py#L129

cpawley commented 2 years ago

In my call with @FelixRitter3110 - we discussed this - I think he said it was intentional...but maybe I am wrong

FelixRitter3110 commented 2 years ago

I just copied on Jonas' previous work where he does the same and removes variables from the argument list.

See: https://github.com/jackfrost373/LHCb_Xic_production/blob/9ffcc8fb08b6edaeefa255da7bd36cf599ff8d1b/analysis/Scripts/MassFitting/fit.py#L154

It was neither intentional nor an accident. I was aware of that fact but as it was just a logic error I focussed on making my overall code work first.

I can change if wanted.

Is it better to have arguments in any order or should we just update the ReadMe?

jackfrost373 commented 2 years ago

Would it mess things up if you don't remove the argument?

FelixRitter3110 commented 2 years ago

I dont know. when not deleting the argument it might return errors due to the algorithm trying to access a specific element out of the arguments array which might have changed.

could give it a careful try though