5 #ifndef Lhood_MM_tools_h
6 #define Lhood_MM_tools_h
48 virtual StatusCode getTotalYield(
float& yield,
float& statErrUp,
float& statErrDown)
override final;
49 virtual StatusCode register1DHistogram(TH1*
h1,
const float *
val)
override;
50 virtual StatusCode register2DHistogram(TH2* h2,
const float *
xval,
const float *
yval)
override;
51 virtual StatusCode register3DHistogram(TH3* h3,
const float *
xval,
const float *
yval,
const float *zval)
override;
53 double nfakes(Double_t *poserr, Double_t *negerr);
55 double nfakes_std(
double *
error);
56 double nfakes_std_perEventWeight(
double *
error);
88 std::vector<std::unique_ptr<FakeBkgTools::FinalState> >
m_fsvec;
90 std::vector<int> m_fsvec;
93 int m_minnlep{}, m_maxnlep{}, m_maxnlep_loose{};
94 int m_theta_tot_start_index{};
96 bool m_requireSS{}, m_requireOS{};
98 bool m_needToResize{};
100 bool m_doFakeFactor{};
102 bool m_fixNormalization{};
106 bool m_alreadyMerged{};
108 static constexpr
int s_nLepMax = 6;
109 static constexpr
int s_maxRank = 64;
112 std::vector < std::vector < std::vector < double > > >
m_coeffs;
118 double m_dilep_SSfrac_num{}, m_dilep_SSfrac_denom{};
121 double m_nfakes_std{}, m_nfakes_std_err{};
123 double m_nfakes_std_perEventWeight{}, m_nfakes_std_err_perEventWeight{};
125 bool m_do_std_perEventWeight{};
129 Int_t m_printLevel{};
135 unsigned m_lastSaveIndex{};
138 inline static const double s_piover2 = 1.57079632679489661923;
139 inline static const double s_piover4 = 0.785398163397448309616;
143 static double logPoisson(
double obs,
double pred);
145 StatusCode addEventCustom(
const std::vector<bool>& isTight_vals,
146 const std::vector<FakeBkgTools::Efficiency>& realEff_vals,
147 const std::vector<FakeBkgTools::Efficiency>& fakeEff_vals,
148 const std::vector<int>& charges,
155 static void fcn_nlep(Int_t &npar , Double_t *gin , Double_t &
f, Double_t *
par, Int_t iflag );
156 static void fcn_minnlep_maxnlep(Int_t &npar, Double_t *gin, Double_t &
f, Double_t *
par, Int_t iflag);
158 void get_init_pars(std::vector<double> &init_pars,
int nlep);
159 void get_analytic(std::vector<double>& nrf,
const int nlep);
161 double fixPosErr(
double n_fake_fit,
TMinuit_LHMM* lhoodFit);
162 double fixNegErr(
double n_fake_fit,
TMinuit_LHMM* lhoodFit);
166 StatusCode fillHisto_internal(
const std::vector< LhoodMMFitInfo >& fitInfo_vec, TH1*
h);