This code implements the reaction plane method proposed by C. Nattrass et al. in Phys. Rev. C 93, 044915.
This codes uses as input a ROOT file that has to contain histograms of Dphi distribution in Signal and Background regions. Check the example fInput.root for reference.
You need to install iminuit: http://iminuit.readthedocs.io/en/latest/