- [x] Replace [namesOfBkgPdf](https://github.com/AliceO2Group/O2Physics/blob/efb1a4945c2a0260027d9eb58d84bec6a91f9431/PWGHF/D2H/Macros/HFInvMassFitter.h#L52) etc with `std::array` - [x] Reduce code repetition in fit results table [printing](https://github.com/AliceO2Group/O2Physics/blob/efb1a4945c2a0260027d9eb58d84bec6a91f9431/PWGHF/D2H/Macros/HFInvMassFitter.cxx#L571) - [ ] Reduce code repetition due to alias for Range() [here](https://github.com/AliceO2Group/O2Physics/blob/efb1a4945c2a0260027d9eb58d84bec6a91f9431/PWGHF/D2H/Macros/HFInvMassFitter.cxx#L271) - [x] Use **enum**s for **switch**-**case** [here](https://github.com/AliceO2Group/O2Physics/blob/efb1a4945c2a0260027d9eb58d84bec6a91f9431/PWGHF/D2H/Macros/HFInvMassFitter.cxx#L763) etc. - [x] Use **enum**s for [hFitConfig](https://github.com/AliceO2Group/O2Physics/blob/efb1a4945c2a0260027d9eb58d84bec6a91f9431/PWGHF/D2H/Macros/runMassFitter.C#L537) bins - [x] Refactor [`setFixedValue`](https://github.com/AliceO2Group/O2Physics/blob/efb1a4945c2a0260027d9eb58d84bec6a91f9431/PWGHF/D2H/Macros/runMassFitter.C#L444) lambda-function - [x] Read optional json fields also optionally (e.g. do not require `meanFile` if `fixMean` == **false**) - [x] Check that config vector size is equal to `nSliceVars` (or empty) - [ ] ~~Get rid of warnings with `-Wall` `-Wextra`~~ - done by Vit - [ ] Get rid of RooFit warnings - [x] **throw** `std::runtime_error()` instead of **return** -1, e.g. [here](https://github.com/AliceO2Group/O2Physics/blob/efb1a4945c2a0260027d9eb58d84bec6a91f9431/PWGHF/D2H/Macros/runMassFitter.C#L220) - [x] Close opened files - [x] Factor out open file and get object with check for **nullptr** into functions - [x] Leave only one constructor - [x] Get rid of unnecessary (?) cloning, e.g. [here](https://github.com/AliceO2Group/O2Physics/blob/efb1a4945c2a0260027d9eb58d84bec6a91f9431/PWGHF/D2H/Macros/HFInvMassFitter.h#L197) - [x] ~~Pass [here](https://github.com/AliceO2Group/O2Physics/blob/efb1a4945c2a0260027d9eb58d84bec6a91f9431/PWGHF/D2H/Macros/runMassFitter.C#L468) hMassForRefl (?)~~ Do not create `hMassFor...` histograms for rebinning, rebin the existing histogram; - [x] Fix `Warning in <TH2F::LabelsOption>: Axis xaxis has no labels!` - [ ] Fix bug (logical error) with fitting selected ranges (e.g. "SBL, SBR") in Chi2 mode - [x] Exclude `mBkgPdfPrefit` from **class** members, move it under the **if**-statement [block](https://github.com/AliceO2Group/O2Physics/blob/efb1a4945c2a0260027d9eb58d84bec6a91f9431/PWGHF/D2H/Macros/HFInvMassFitter.cxx#L290) - [x] Factor out repeating code [here](https://github.com/AliceO2Group/O2Physics/blob/efb1a4945c2a0260027d9eb58d84bec6a91f9431/PWGHF/D2H/Macros/runMassFitter.C#L407) and [here](https://github.com/AliceO2Group/O2Physics/blob/efb1a4945c2a0260027d9eb58d84bec6a91f9431/PWGHF/D2H/Macros/runMassFitter.C#L473) - [x] HFInvMassFitter: [ClassDef](https://github.com/AliceO2Group/O2Physics/blob/efb1a4945c2a0260027d9eb58d84bec6a91f9431/PWGHF/D2H/Macros/HFInvMassFitter.h#L305)->ClassDefOverride - [x] Move > 1 line function definitions from `.h` to `.cxx` - [x] Solve signedness problem of `iSliceVar`