16 constexpr
double GEV = 1000.0;
20 using ROOT::Math::PtEtaPhiMVector;
36 return prob->MetProbability(preparedInput, 1.,1.,1.,1.);
46 return prob->mEtAndTauProbability(preparedInput);
52 PtEtaPhiMVector totalTau1;
55 const double tau1_tmpp = totalTau1.P();
56 const double angle1 =
Angle(nuvec1,tauvec1);
57 Prob*=
prob->dTheta3d_probabilityFast(preparedInput, tau_type1, angle1, tau1_tmpp);
60 PtEtaPhiMVector totalTau2;
63 const double tau2_tmpp = totalTau2.P();
64 const double angle2 =
Angle(nuvec2,tauvec2);
65 Prob*=
prob->dTheta3d_probabilityFast(preparedInput, tau_type2, angle2, tau2_tmpp);
72 return prob->TauProbability(preparedInput, tau_type1, tauvec1, nuvec1, tau_type2, tauvec2, nuvec2, preparedInput.
m_MetVec.R());
74 return prob->TauProbability(preparedInput, tau_type1, tauvec1, nuvec1, tau_type2, tauvec2, nuvec2);
81 if(
prob->GetUseMnuProbability()==1){
83 else if(tau_type1==8 && (tau_type2>=0 && tau_type2<=5))
return prob->MnuProbability(preparedInput, nuvec1.M());
84 else if((tau_type1>=0 && tau_type1<=5) && tau_type2==8)
return prob->MnuProbability(preparedInput, nuvec2.M());
86 Warning(
"DiTauMassTools",
"something went really wrong in MNuProb...");
98 PtEtaPhiMVector totalTau1;
101 const double angle1 =
Angle(nuvec1,tauvec1);
102 double prob_tmp = 1
e-10;
103 if (angle1!=0.) prob_tmp=
prob->GetFormulaAngle1()->Eval(angle1);
104 if (prob_tmp<=0.) prob_tmp=1
e-10;
108 PtEtaPhiMVector totalTau2;
111 const double angle2 =
Angle(nuvec2,tauvec2);
112 double prob_tmp = 1
e-10;
113 if (angle2!=0.) prob_tmp=
prob->GetFormulaAngle2()->Eval(angle2);
114 if (prob_tmp<=0.) prob_tmp=1
e-10;
118 if (std::isnan(Prob)) Prob = 0.;
127 double R1 = nuvec1.P()/tauvec1.P();
128 double R2 = nuvec2.P()/tauvec2.P();
129 Prob*=
prob->GetFormulaRatio1()->Eval(R1);
130 Prob*=
prob->GetFormulaRatio2()->Eval(R2);
132 if (std::isnan(Prob)) Prob = 0.;
140 if(
prob->GetUseMnuProbability()==1){
142 else if(tau_type1==8 && (tau_type2>=0 && tau_type2<=5)) Prob*=
prob->GetFormulaNuMass()->Eval(nuvec1.M());
143 else if((tau_type1>=0 && tau_type1<=5) && tau_type2==8) Prob*=
prob->GetFormulaNuMass()->Eval(nuvec2.M());
145 Warning(
"DiTauMassTools",
"something went really wrong in MNuProb...");
149 if (std::isnan(Prob)) Prob = 0.;
162 double Pt_tau = tauvec.Pt();
164 if (tautype > 4 && tautype < 8)
type = 4;
167 for(
int i=0;
i<=3;
i++){
178 for(
int i=0;
i<=3;
i++){
192 if(tautype > 4 && tautype < 8)
type = 4;
227 if (!paramFilePath.empty()){
228 std::string total_path =
"DiTauMassTools/"+paramFilePath;
232 m_probListConstant.push_back( std::bind(&
mEtAndTauProbabilityWrapper,
this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4, std::placeholders::_5, std::placeholders::_6, std::placeholders::_7) );
233 m_probListOneTau.push_back( std::bind(&
dTheta3d_probabilityNewWrapper,
this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4, std::placeholders::_5, std::placeholders::_6, std::placeholders::_7) );
234 m_probListTwoTau.push_back( std::bind(&
TauProbabilityNewWrapper,
this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4, std::placeholders::_5, std::placeholders::_6, std::placeholders::_7) );
235 m_probListTwoTau.push_back( std::bind(&
MnuProbabilityNewWrapper,
this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4, std::placeholders::_5, std::placeholders::_6, std::placeholders::_7) );
241 m_probListConstant.push_back( std::bind(&
mEtAndTauProbabilityWrapper,
this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4, std::placeholders::_5, std::placeholders::_6, std::placeholders::_7) );
242 m_probListOneTau.push_back( std::bind(&
dTheta3d_probabilityFastWrapper,
this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4, std::placeholders::_5, std::placeholders::_6, std::placeholders::_7) );
243 m_probListTwoTau.push_back( std::bind(&
TauProbabilityWrapper,
this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4, std::placeholders::_5, std::placeholders::_6, std::placeholders::_7) );
244 m_probListTwoTau.push_back( std::bind(&
MnuProbabilityWrapper,
this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4, std::placeholders::_5, std::placeholders::_6, std::placeholders::_7) );
540 double MissingMassProb::apply(
MissingMassInput& preparedInput,
const int & tau_type1,
const int & tau_type2,
const PtEtaPhiMVector & tauvec1,
const PtEtaPhiMVector & tauvec2,
const PtEtaPhiMVector nuvec1,
const PtEtaPhiMVector & nuvec2,
bool constant,
bool oneTau,
bool twoTau) {
544 prob*=
f(preparedInput, tau_type1, tau_type2, tauvec1, tauvec2, nuvec1, nuvec2);
546 }
else if (oneTau ==
true) {
548 prob*=
f(preparedInput, tau_type1, tau_type2, tauvec1, tauvec2, nuvec1, nuvec2);
550 }
else if (twoTau ==
true) {
552 prob*=
f(preparedInput, tau_type1, tau_type2, tauvec1, tauvec2, nuvec1, nuvec2);
563 if(MetSigma1>1.0 && MetSigma2>1.0)
566 metprob=
exp(-0.5*(met1*met1/(MetSigma1*MetSigma1)+met2*met2/(MetSigma2*MetSigma2)))/(MetSigma1*MetSigma2*2*TMath::Pi());
570 if(preparedInput.
m_fUseVerbose==1) Warning(
"DiTauMassTools",
"MissingMassCalculator::MetProbability: either MetSigma1 or MetSigma2 are <1 GeV--- too low, returning prob=1");
626 const double R1=nu1.E()/vis1.E();
630 double E1=0.5*(mtau*mtau+
m1*
m1-
m2*
m2)/mtau;
632 if(E1<=m1 || E1>=mtau)
634 if(preparedInput.
m_fUseVerbose==1) Warning(
"DiTauMassTools",
"Warning in MissingMassCalculator::TauProbability: bad E1, returning 0 ");
637 if(E2<=m2 || E2>=mtau)
639 if(preparedInput.
m_fUseVerbose==1) Warning(
"DiTauMassTools",
"Warning in MissingMassCalculator::TauProbability: bad E2, returning 0 ");
642 preparedInput.
m_tlv_tmp.SetPxPyPzE(0.,0.,0.,0.);
647 double V=
p/sqrt(
p*
p+mtau*mtau);
649 if(type1==8)
p0=sqrt(E2*E2-
m2*
m2);
651 prob1=0.5*mtau/(
p0*V*
pow(R1+1.0,2));
658 const int & type2,
const PtEtaPhiMVector & vis2,
const PtEtaPhiMVector & nu2)
665 const double R1=nu1.E()/vis1.E();
666 const double R2=nu2.E()/vis2.E();
670 double E1=0.5*(mtau*mtau+
m1*
m1-
m2*
m2)/mtau;
672 if(E1<=m1 || E1>=mtau)
674 if(preparedInput.
m_fUseVerbose==1) Warning(
"DiTauMassTools",
"Warning in MissingMassCalculator::TauProbability: bad E1, returning 0 ");
677 if(E2<=m2 || E2>=mtau)
679 if(preparedInput.
m_fUseVerbose==1) Warning(
"DiTauMassTools",
"Warning in MissingMassCalculator::TauProbability: bad E2, returning 0 ");
682 preparedInput.
m_tlv_tmp.SetPxPyPzE(0.,0.,0.,0.);
687 double V=
p/sqrt(
p*
p+mtau*mtau);
689 if(type1==8)
p0=sqrt(E2*E2-
m2*
m2);
691 prob1=0.5*mtau/(
p0*V*
pow(R1+1.0,2));
699 E1=0.5*(mtau*mtau+
m1*
m1-
m2*
m2)/mtau;
701 if(E1<=m1 || E1>=mtau)
703 if(preparedInput.
m_fUseVerbose==1) Warning(
"DiTauMassTools",
"Warning in MissingMassCalculator::TauProbability: bad E1, returning 0 ");
706 if(E2<=m2 || E2>=mtau)
708 if(preparedInput.
m_fUseVerbose==1) Warning(
"DiTauMassTools",
"Warning in MissingMassCalculator::TauProbability: bad E2, returning 0 ");
711 preparedInput.
m_tlv_tmp.SetPxPyPzE(0.,0.,0.,0.);
718 V=
p/sqrt(
p*
p+mtau*mtau);
719 if(type2==8)
p0=sqrt(E2*E2-
m2*
m2);
721 prob2=0.5*mtau/(
p0*V*
pow(R2+1.0,2));
731 const int & type2,
const PtEtaPhiMVector & vis2,
const PtEtaPhiMVector & nu2,
const double & detmet) {
740 const double R1=nu1.P()/vis1.P();
741 const double R2=nu2.P()/vis2.P();
742 const double lep_p1[4]={0.417,0.64,0.52,0.678};
743 const double lep_p2[4]={0.23,0.17,0.315,0.319};
744 const double lep_p3[4]={0.18,0.33,0.41,0.299};
745 const double lep_p4[4]={0.033,0.109,0.129,0.096};
746 const double lep_p5[4]={0.145,0.107,0.259,0.304};
749 const double n_1pr[4]={-0.15,-0.13,-0.25,-0.114};
750 const double s_1pr[4]={0.40,0.54,0.62,0.57};
751 const double n_3pr[4]={-1.08,-1.57,-0.46,-0.39};
752 const double s_3pr[4]={0.53,0.85,0.61,0.53};
755 if(type1>=0 && type1<=5)
760 if(type2>=0 && type2<=5)
765 if(Plep<50.0 && Plep>=45.0) ind=2;
766 if(Plep<45.0 && Plep>=40.0) ind=1;
768 if(Ptau<50.0 && Ptau>=45.0) indT=2;
769 if(Ptau<45.0 && Ptau>=40.0) indT=1;
770 if(Ptau<40.0) indT=0;
771 if(type1==8)
prob=
prob*(lep_p5[ind]*TMath::Gaus(R1,lep_p1[ind],lep_p2[ind])+TMath::Landau(R1,lep_p3[ind],lep_p4[ind]))/(1+lep_p5[ind]);
772 if(type2==8)
prob=
prob*(lep_p5[ind]*TMath::Gaus(R2,lep_p1[ind],lep_p2[ind])+TMath::Landau(R2,lep_p3[ind],lep_p4[ind]))/(1+lep_p5[ind]);
774 if(type1>=0 && type1<=2)
prob=
prob*TMath::Gaus(R1,n_1pr[indT],s_1pr[indT]);
775 if(type2>=0 && type2<=2)
prob=
prob*TMath::Gaus(R2,n_1pr[indT],s_1pr[indT]);
776 if(type1>=3 && type1<=5)
prob=
prob*TMath::Gaus(R1,n_3pr[indT],s_3pr[indT]);
777 if(type2>=3 && type2<=5)
prob=
prob*TMath::Gaus(R2,n_3pr[indT],s_3pr[indT]);
782 const double R1=nu1.P()/vis1.P();
783 const double R2=nu2.P()/vis2.P();
784 const double lep_p1[4]={0.441,0.64,0.79,0.8692};
785 const double lep_p2[4]={0.218,0.28,0.29,0.3304};
786 const double lep_p3[4]={0.256,0.33,0.395,0.4105};
787 const double lep_p4[4]={0.048,0.072,0.148,0.1335};
788 const double lep_p5[4]={0.25,0.68,0.10,0.2872};
790 const double p_1prong=-3.706;
791 const double p_3prong=-5.845;
794 if(type1>=0 && type1<=5)
799 if(type2>=0 && type2<=5)
804 if(Plep<50.0 && Plep>=45.0) ind=2;
805 if(Plep<45.0 && Plep>=40.0) ind=1;
807 const double scale1prong=Ptau>45.0 ? 1.0 : -1.019/((Ptau*0.0074-0.059)*p_1prong);
808 const double scale3prong=Ptau>40.0 ? 1.0 : -1.24/((Ptau*0.0062-0.033)*p_3prong);
809 if(type1==8)
prob=
prob*(lep_p5[ind]*TMath::Gaus(R1,lep_p1[ind],lep_p2[ind])+TMath::Landau(R1,lep_p3[ind],lep_p4[ind]))/(1+lep_p5[ind]);
810 if(type2==8)
prob=
prob*(lep_p5[ind]*TMath::Gaus(R2,lep_p1[ind],lep_p2[ind])+TMath::Landau(R2,lep_p3[ind],lep_p4[ind]))/(1+lep_p5[ind]);
812 if(type1>=0 && type1<=2)
prob=
prob*
exp(p_1prong*R1*scale1prong)*std::abs(p_1prong*scale1prong)*0.02;
813 if(type2>=0 && type2<=2)
prob=
prob*
exp(p_1prong*R2*scale1prong)*std::abs(p_1prong*scale1prong)*0.02;
814 if(type1>=3 && type1<=5)
prob=
prob*
exp(p_3prong*R1*scale3prong)*std::abs(p_3prong*scale3prong)*0.02;
815 if(type2>=3 && type2<=5)
prob=
prob*
exp(p_3prong*R2*scale3prong)*std::abs(p_3prong*scale3prong)*0.02;
825 const double R[2]={nu1.P()/vis1.P(),nu2.P()/vis2.P()};
826 const double E[2]={(nu1+vis1).
E(),(nu2+vis2).
E()};
827 const int tau_type[2]={type1,type2};
828 int order1= vis1.Pt()>vis2.Pt() ? 0 : 1;
829 int order2= vis1.Pt()>vis2.Pt() ? 1 : 0;
834 par_1p[0][0]=0.1273; par_1p[0][1]=-0.2479; par_1p[0][2]=1.0; par_1p[0][3]=-43.16; par_1p[0][4]=0.0; par_1p[0][5]=0.0;
835 par_1p[1][0]=0.3736; par_1p[1][1]=-1.441; par_1p[1][2]=1.0; par_1p[1][3]=-29.82; par_1p[1][4]=0.0; par_1p[1][5]=0.0;
836 par_3p[0][0]=0.1167; par_3p[0][1]=-0.1388; par_3p[0][2]=1.0; par_3p[0][3]=-44.77; par_3p[0][4]=0.0; par_3p[0][5]=0.0;
837 par_3p[1][0]=0.3056; par_3p[1][1]=-2.18; par_3p[1][2]=1.0; par_3p[1][3]=-19.09; par_3p[1][4]=0.0; par_3p[1][5]=0.0;
839 const double C1p=0.062;
840 const double C3p=0.052;
841 const double G1p=1.055;
842 const double G3p=1.093;
845 if( tau_type[order1]>=0 && tau_type[order1]<=2 )
851 const double slope=par_1p[0][0]+par_1p[0][1]/(par_1p[0][2]*
x+par_1p[0][3])+par_1p[0][4]*
x > 0.01 ?
852 par_1p[0][0]+par_1p[0][1]/(par_1p[0][2]*
x+par_1p[0][3])+par_1p[0][4]*
x : 0.01;
853 prob=
prob*
exp(-R[order1]/slope)*0.04/std::abs(slope);
855 if( tau_type[order1]>=3 && tau_type[order1]<=5 )
860 const double slope=par_3p[0][0]+par_3p[0][1]/(par_3p[0][2]*
x+par_3p[0][3])+par_3p[0][4]*
x > 0.01 ?
861 par_3p[0][0]+par_3p[0][1]/(par_3p[0][2]*
x+par_3p[0][3])+par_3p[0][4]*
x : 0.01;
862 prob=
prob*
exp(-R[order1]/slope)*0.04/std::abs(slope);
865 if( tau_type[order2]>=0 && tau_type[order2]<=2 )
867 const double par[4]={0.1147,-0.09675,-35.0,3.711E-11};
870 const double sigma=G1p*(par_1p[1][0]+par_1p[1][1]/(par_1p[1][2]*
x+par_1p[1][3])+par_1p[1][4]*
x+par_1p[1][5]*
x*
x) > 0.01 ?
871 G1p*(par_1p[1][0]+par_1p[1][1]/(par_1p[1][2]*
x+par_1p[1][3])+par_1p[1][4]*
x+par_1p[1][5]*
x*
x) : 0.01;
876 if( tau_type[order2]>=3 && tau_type[order2]<=5 )
880 const double sigma=G3p*(par_3p[1][0]+par_3p[1][1]/(par_3p[1][2]*
x+par_3p[1][3])+par_3p[1][4]*
x+par_3p[1][5]*
x*
x) > 0.01 ?
881 G3p*(par_3p[1][0]+par_3p[1][1]/(par_3p[1][2]*
x+par_3p[1][3])+par_3p[1][4]*
x+par_3p[1][5]*
x*
x) : 0.01;
882 const double par[4]={0.2302,-2.012,-36.08,-0.000373};
890 const double R1=nu1.P()/vis1.P();
891 const double R2=nu2.P()/vis2.P();
892 const double E1=(nu1+vis1).
E();
893 const double E2=(nu2+vis2).
E();
894 int order1= vis1.Pt()>vis2.Pt() ? 0 : 1;
895 int order2= vis1.Pt()>vis2.Pt() ? 1 : 0;
896 const double slope_1p[2]={-3.185,-2.052};
897 const double slope_3p[2]={-3.876,-2.853};
900 par_1p[0][0]=-0.3745; par_1p[0][1]=0.01417; par_1p[0][2]=-7.285E-5;
901 par_1p[1][0]=-0.3683; par_1p[1][1]=0.01807; par_1p[1][2]=-9.514E-5;
902 par_3p[0][0]=-0.3055; par_3p[0][1]=0.01149; par_3p[0][2]=-5.855E-5;
903 par_3p[1][0]=-0.3410; par_3p[1][1]=0.01638; par_3p[1][2]=-9.465E-5;
906 if(type1>=0 && type1<=2)
908 scale1=E1>100.0 ? 1.0 : 1.0/std::abs((par_1p[order1][0]+par_1p[order1][1]*E1+par_1p[order1][2]*E1*E1)*slope_1p[order1]);
913 if(type1>=3 && type1<=5)
915 scale1=E1>100.0 ? 1.0 : 1.0/std::abs((par_3p[order1][0]+par_3p[order1][1]*E1+par_3p[order1][2]*E1*E1)*slope_3p[order1]);
920 if(type2>=0 && type2<=2)
922 scale2=E2>100.0 ? 1.0 : 1.0/std::abs((par_1p[order2][0]+par_1p[order2][1]*E2+par_1p[order2][2]*E2*E2)*slope_1p[order2]);
927 if(type2>=3 && type2<=5)
929 scale2=E2>100.0 ? 1.0 : 1.0/std::abs((par_3p[order2][0]+par_3p[order2][1]*E2+par_3p[order2][2]*E2*E2)*slope_3p[order2]);
948 double norm=4851900.0;
951 p[4]=1.433E5/(5.0*
norm);
p[5]=-1.229E5/(6.0*
norm);
p[6]=3.434E4/(7.0*
norm);
954 double x1= mnu+0.5*binsize < 1.777-0.113 ? mnu+0.5*binsize : 1.777-0.113;
955 double x2= mnu-0.5*binsize > 0.0 ? mnu-0.5*binsize : 0.0;
956 for(
int i=0;
i<7;
i++)
964 if(preparedInput.
m_fUseVerbose==1) Warning(
"DiTauMassTools",
"Warning in MissingMassCalculator::MnuProbability: negative probability!!! ");
969 if(preparedInput.
m_fUseVerbose==1) Warning(
"DiTauMassTools",
"Warning in MissingMassCalculator::MnuProbability: probability > 1!!! ");
980 const double norm=4851900.0;
982 p[0]=-288.6;
p[1]=6.217E4;
p[2]=2.122E4;
p[3]=-9.067E4;
983 p[4]=1.433E5;
p[5]=-1.229E5;
p[6]=3.434E4;
985 for(
int i=0;
i<7;
i++)
992 if(preparedInput.
m_fUseVerbose==1) Warning(
"DiTauMassTools",
"Warning in MissingMassCalculator::MnuProbability: negative probability!!! ");
997 if(preparedInput.
m_fUseVerbose==1) Warning(
"DiTauMassTools",
"Warning in MissingMassCalculator::MnuProbability: probability > 1!!! ");
1004 const double & trueMetGuess,
const double & mht_offset) {
1015 const double n_arg=(mht-trueMetGuess-mht_offset)/preparedInput.
m_MHtSigma1;
1016 mhtprob*=
exp(-0.25*
pow(n_arg,2));
1021 const double & trueMetGuess,
const double & mht_offset) {
1028 const double n_arg=(mht-trueMetGuess-mht_offset)/5.7;
1043 double prob=1.0E-10;
1045 if(tau_type==8) tau_code = 0;
1046 else if(tau_type>=0 && tau_type<=2) tau_code = 1;
1047 else if(tau_type>=3 && tau_type<=5) tau_code = 2;
1048 else if(tau_type==6)
return prob;
1051 Warning(
"DiTauMassTools",
"---- WARNING in MissingMassCalculator::dTheta3d_probabilityFast() ----");
1052 Warning(
"DiTauMassTools",
"%s", (
"..... wrong tau_type="+
std::to_string(tau_type)).c_str());
1053 Warning(
"DiTauMassTools",
"%s", (
"..... returning prob="+
std::to_string(
prob)).c_str());
1054 Warning(
"DiTauMassTools",
"____________________________________________________________");
1059 double myDelThetaParam[6];
1061 for (
int i=0;
i<6;++
i)
1069 double dTheta3dVal=dTheta3d;
1079 Warning(
"DiTauMassTools",
"---- WARNING in MissingMassCalculator::dTheta3d_probabilityFast() ----");
1080 Warning(
"DiTauMassTools",
"%s", (
"..... wrong probability="+
std::to_string(
prob)).c_str());
1082 Warning(
"DiTauMassTools",
"____________________________________________________________");
1093 double fitval=1.0E-10;
1094 if(
x[0]>TMath::Pi() ||
x[0]<0.0)
return fitval;
1095 const double arg=
x[0];
1096 const double arg_L=
arg;
1098 const double sigmaG=
par[2];
1099 const double mpv=
par[3];
1100 const double sigmaL=
par[4];
1106 const double norm=sqrt(2.0*TMath::Pi());
1108 const double g2=TMath::Landau(arg_L,mpv,sigmaL)/
norm;
1112 if(fitval<0.0)
return 0.0;
1119 double fitval=1.0E-10;
1120 if(
x[0]>TMath::Pi() ||
x[0]<0.0)
return fitval;
1123 double normL=
par[5];
1124 if(normL<0.0) normL=0.0;
1128 const double arg_L=
x[0];
1129 const double mean=1.0;
1130 const double sigmaG=
par[2];
1131 const double mpv=
par[3];
1132 const double sigmaL=
par[4];
1133 const double g1=normL*TMath::Gaus(
arg,
mean,sigmaG);
1134 const double g2=TMath::Landau(arg_L,mpv,sigmaL);
1135 fitval=
par[0]*(
g1+
g2)/(1.0+normL);
1136 if(fitval<0.0)
return 0.0;
1143 if(P_tau<0.0)
return 0.0;
1172 if(preparedInput.
m_fUseVerbose==1) { Info(
"DiTauMassTools",
"Attempting to set LFV MMC settings"); }
1182 if(mT1>mT2) sr_switch = 0;
1187 if(mT1>mT2) sr_switch = 1;
1195 if(mT1>mT2) sr_switch = 0;
1200 if(mT1>mT2) sr_switch = 1;
1209 if(mT1>mT2) sr_switch = 0;
1214 if(mT1>mT2) sr_switch = 1;
1222 double sigmaSyst = 0.10;
1227 METresScale = 0.41*(1.0+preparedInput.
m_METresSyst*sigmaSyst);
1228 METoffset = 7.36*(1.0+preparedInput.
m_METresSyst*sigmaSyst);
1232 METresScale = 0.34*(1.0+preparedInput.
m_METresSyst*sigmaSyst);
1233 METoffset = 6.61*(1.0+preparedInput.
m_METresSyst*sigmaSyst);
1237 Info(
"DiTauMassTools",
"%s", (
"METoffset = "+
std::to_string(METoffset)).c_str());
1238 Info(
"DiTauMassTools",
"%s", (
"METresScale = "+
std::to_string(METresScale)).c_str());
1241 double sigma = preparedInput.
m_SumEt>0.0 ? METoffset+METresScale*sqrt(preparedInput.
m_SumEt) : METoffset;
1251 double sigmaSyst = 0.10;
1257 METresScale = 0.38*(1.0+preparedInput.
m_METresSyst*sigmaSyst);
1258 METoffset = 7.96*(1.0+preparedInput.
m_METresSyst*sigmaSyst);
1262 METresScale = 0.39*(1.0+preparedInput.
m_METresSyst*sigmaSyst);
1263 METoffset = 6.61*(1.0+preparedInput.
m_METresSyst*sigmaSyst);
1267 sigma = preparedInput.
m_SumEt>0.0 ? METoffset+METresScale*sqrt(preparedInput.
m_SumEt) : METoffset;
1288 if(preparedInput.
m_MetVec.R()<20.0)
1301 double sigmaSyst = 0.10;
1302 double METresScale = 0.32*(1.0+preparedInput.
m_METresSyst*sigmaSyst);
1303 double METoffset = 5.38*(1.0+preparedInput.
m_METresSyst*sigmaSyst);
1304 double sigma = preparedInput.
m_SumEt>0.0 ? METoffset+METresScale*sqrt(preparedInput.
m_SumEt) : METoffset;
1324 double sigmaSyst = 0.10;
1325 double METresScale = 0.87*(1.0+preparedInput.
m_METresSyst*sigmaSyst);
1326 double METoffset = 4.16*(1.0+preparedInput.
m_METresSyst*sigmaSyst);
1327 double sigma = preparedInput.
m_SumEt>0.0 ? METoffset+METresScale*sqrt(preparedInput.
m_SumEt) : METoffset;
1337 double sigmaSyst = 0.10;
1338 double METresScale = 0.65*(1.0+preparedInput.
m_METresSyst*sigmaSyst);
1339 double METoffset = 5.0*(1.0+preparedInput.
m_METresSyst*sigmaSyst);
1340 double sigma = preparedInput.
m_SumEt>0.0 ? METoffset+METresScale*sqrt(preparedInput.
m_SumEt) : METoffset;
1348 double sigmaSyst=0.10;
1353 double METresScale=0.86*(1.0+preparedInput.
m_METresSyst*sigmaSyst);
1354 double METoffset=3.0*(1.0+preparedInput.
m_METresSyst*sigmaSyst);
1356 sigma= preparedInput.
m_SumEt>0.0 ? METoffset+METresScale*sqrt(preparedInput.
m_SumEt) : METoffset;
1364 double dphi_scale =
x > 0.3 ? 0.9429 - 0.059*
x + 0.054*
x*
x : 0.728;
1365 double METoffset = 1.875*(1.0+preparedInput.
m_METresSyst*sigmaSyst);
1366 double METresScale1 = 8.914*(1.0+preparedInput.
m_METresSyst*sigmaSyst);
1367 double METresScale2 = -8.53*(1.0+preparedInput.
m_METresSyst*sigmaSyst);
1370 sigma = preparedInput.
m_SumEt > 80.0 ? METoffset + METresScale1*TMath::Log(sqrt(preparedInput.
m_SumEt)+METresScale2) : 5.0;
1389 double sigmaSyst=0.10;
1391 double METresScale=0.9*(1.0+preparedInput.
m_METresSyst*sigmaSyst);
1392 double METoffset=-1.8*(1.0+preparedInput.
m_METresSyst*sigmaSyst);
1393 double sigma= preparedInput.
m_SumEt>0.0 ? METoffset+METresScale*sqrt(preparedInput.
m_SumEt) : std::abs(METoffset);
1398 else if(preparedInput.
m_Njet25==0 &&
1403 double sigmaSyst=0.10;
1405 double dphi_scale =
x > 2.5 ? 11.0796 - 4.61236*
x + 0.423617*
x*
x : 2.;
1406 double METoffset = -8.51013*(1.0+preparedInput.
m_METresSyst*sigmaSyst);
1407 double METresScale1 = 8.54378*(1.0+preparedInput.
m_METresSyst*sigmaSyst);
1408 double METresScale2 = -3.97146*(1.0+preparedInput.
m_METresSyst*sigmaSyst);
1409 double sigma= preparedInput.
m_SumEt>80.0 ? METoffset+METresScale1*TMath::Log(sqrt(preparedInput.
m_SumEt)+METresScale2) : 5.;
1428 double METresScale=-1.;
1429 double METoffset=-1.;
1430 double sigmaSyst=0.10;
1435 METresScale = 1.1*(1.0+preparedInput.
m_METresSyst*sigmaSyst);
1436 METoffset = -5.0*(1.0+preparedInput.
m_METresSyst*sigmaSyst);
1439 double sigma = preparedInput.
m_SumEt>0.0 ? METoffset+METresScale*sqrt(preparedInput.
m_SumEt) : std::abs(METoffset);
1445 double dphi_scale =
x > 0.6 ? 1.42047 - 0.666644*
x + 0.199986*
x*
x : 1.02;
1446 METoffset = 1.19769*(1.0+preparedInput.
m_METresSyst*sigmaSyst);
1447 double METresScale1 = 5.61687*(1.0+preparedInput.
m_METresSyst*sigmaSyst);
1448 double METresScale2 = -4.2076*(1.0+preparedInput.
m_METresSyst*sigmaSyst);
1449 sigma= preparedInput.
m_SumEt>115.0 ? METoffset+METresScale1*TMath::Log(sqrt(preparedInput.
m_SumEt)+METresScale2) : 12.1;
1464 double sigmaSyst = 0.10;
1465 double METresScale = -1.0;
1466 double METoffset = -1.0;
1472 METresScale=-0.4307*(1.0+preparedInput.
m_METresSyst*sigmaSyst);
1473 METoffset=7.06*(1.0+preparedInput.
m_METresSyst*sigmaSyst);
1474 double METresScale2=0.07693*(1.0+preparedInput.
m_METresSyst*sigmaSyst);
1479 sigma= preparedInput.
m_SumEt>0.0 ? METoffset+METresScale*sqrt(preparedInput.
m_SumEt)+METresScale2*preparedInput.
m_SumEt : METoffset;
1484 METresScale=0.8149*(1.0+preparedInput.
m_METresSyst*sigmaSyst);
1485 METoffset=5.343*(1.0+preparedInput.
m_METresSyst*sigmaSyst);
1489 sigma= preparedInput.
m_SumEt>0.0 ? METoffset+METresScale*sqrt(preparedInput.
m_SumEt) : METoffset;
1501 double sigmaSyst=0.10;
1502 double METresScale=-1.0;
1503 double METoffset=-1.0;
1505 double min_sigma = 2.0;
1510 METoffset = 4.22581*(1.0+preparedInput.
m_METresSyst*sigmaSyst);
1511 METresScale = 0.03818*(1.0+preparedInput.
m_METresSyst*sigmaSyst);
1512 double METresScale2= 0.12623;
1513 sigma= preparedInput.
m_SumEt>0.0 ? METoffset+METresScale*sqrt(preparedInput.
m_SumEt)+METresScale2*preparedInput.
m_SumEt : min_sigma;
1515 double p0 = 2.60131;
1516 double p1const = 1.22427;
1517 double p2quad = -1.71261;
1519 sigma *= (DphiLL <
p0) ? p1const : p1const+
1520 p2quad*
p0*
p0 - 2*p2quad*
p0*DphiLL+p2quad*DphiLL*DphiLL;
1527 METoffset = 5.42506*(1.0+preparedInput.
m_METresSyst*sigmaSyst);
1528 METresScale = 5.36760*(1.0+preparedInput.
m_METresSyst*sigmaSyst);
1529 double METoffset2 = -4.86808*(1.0+preparedInput.
m_METresSyst*sigmaSyst);
1530 if (preparedInput.
m_SumEt > 0.0) {
1531 double x = sqrt(preparedInput.
m_SumEt);
1532 sigma = (
x+METoffset2 > 1) ? METoffset+METresScale*
log(
x+METoffset2) : METoffset;
1537 double p0 = 2.24786;
1538 double p1const = 0.908597;
1539 double p2quad = 0.544577;
1541 sigma *= (DphiLL <
p0) ? p1const : p1const+
1542 p2quad*
p0*
p0 - 2*p2quad*
p0*DphiLL+p2quad*DphiLL*DphiLL;