14 using ROOT::Math::PtEtaPhiMVector;
30 return prob->MetProbability(preparedInput, 1.,1.,1.,1.);
40 return prob->mEtAndTauProbability(preparedInput);
46 PtEtaPhiMVector totalTau1;
49 const double tau1_tmpp = totalTau1.P();
50 const double angle1 =
Angle(nuvec1,tauvec1);
51 Prob*=
prob->dTheta3d_probabilityFast(preparedInput, tau_type1, angle1, tau1_tmpp);
54 PtEtaPhiMVector totalTau2;
57 const double tau2_tmpp = totalTau2.P();
58 const double angle2 =
Angle(nuvec2,tauvec2);
59 Prob*=
prob->dTheta3d_probabilityFast(preparedInput, tau_type2, angle2, tau2_tmpp);
66 return prob->TauProbability(preparedInput, tau_type1, tauvec1, nuvec1, tau_type2, tauvec2, nuvec2, preparedInput.
m_MetVec.R());
68 return prob->TauProbability(preparedInput, tau_type1, tauvec1, nuvec1, tau_type2, tauvec2, nuvec2);
75 if(
prob->GetUseMnuProbability()==1){
77 else if(tau_type1==8 && (tau_type2>=0 && tau_type2<=5))
return prob->MnuProbability(preparedInput, nuvec1.M());
78 else if((tau_type1>=0 && tau_type1<=5) && tau_type2==8)
return prob->MnuProbability(preparedInput, nuvec2.M());
80 Warning(
"DiTauMassTools",
"something went really wrong in MNuProb...");
92 PtEtaPhiMVector totalTau1;
95 const double angle1 =
Angle(nuvec1,tauvec1);
96 double prob_tmp = 1
e-10;
97 if (angle1!=0.) prob_tmp=
prob->GetFormulaAngle1()->Eval(angle1);
98 if (prob_tmp<=0.) prob_tmp=1
e-10;
102 PtEtaPhiMVector totalTau2;
105 const double angle2 =
Angle(nuvec2,tauvec2);
106 double prob_tmp = 1
e-10;
107 if (angle2!=0.) prob_tmp=
prob->GetFormulaAngle2()->Eval(angle2);
108 if (prob_tmp<=0.) prob_tmp=1
e-10;
112 if (std::isnan(Prob)) Prob = 0.;
121 double R1 = nuvec1.P()/tauvec1.P();
122 double R2 = nuvec2.P()/tauvec2.P();
123 Prob*=
prob->GetFormulaRatio1()->Eval(R1);
124 Prob*=
prob->GetFormulaRatio2()->Eval(R2);
126 if (std::isnan(Prob)) Prob = 0.;
134 if(
prob->GetUseMnuProbability()==1){
136 else if(tau_type1==8 && (tau_type2>=0 && tau_type2<=5)) Prob*=
prob->GetFormulaNuMass()->Eval(nuvec1.M());
137 else if((tau_type1>=0 && tau_type1<=5) && tau_type2==8) Prob*=
prob->GetFormulaNuMass()->Eval(nuvec2.M());
139 Warning(
"DiTauMassTools",
"something went really wrong in MNuProb...");
143 if (std::isnan(Prob)) Prob = 0.;
156 double Pt_tau = tauvec.Pt();
158 if (tautype > 4 && tautype < 8)
type = 4;
161 for(
int i=0;
i<=3;
i++){
172 for(
int i=0;
i<=3;
i++){
186 if(tautype > 4 && tautype < 8)
type = 4;
221 if (!paramFilePath.empty()){
222 std::string total_path =
"DiTauMassTools/"+paramFilePath;
226 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) );
227 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) );
228 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) );
229 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) );
235 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) );
236 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) );
237 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) );
238 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) );
534 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) {
538 prob*=
f(preparedInput, tau_type1, tau_type2, tauvec1, tauvec2, nuvec1, nuvec2);
540 }
else if (oneTau ==
true) {
542 prob*=
f(preparedInput, tau_type1, tau_type2, tauvec1, tauvec2, nuvec1, nuvec2);
544 }
else if (twoTau ==
true) {
546 prob*=
f(preparedInput, tau_type1, tau_type2, tauvec1, tauvec2, nuvec1, nuvec2);
557 if(MetSigma1>1.0 && MetSigma2>1.0)
560 metprob=
exp(-0.5*(met1*met1/(MetSigma1*MetSigma1)+met2*met2/(MetSigma2*MetSigma2)))/(MetSigma1*MetSigma2*2*TMath::Pi());
564 if(preparedInput.
m_fUseVerbose==1) Warning(
"DiTauMassTools",
"MissingMassCalculator::MetProbability: either MetSigma1 or MetSigma2 are <1 GeV--- too low, returning prob=1");
619 const double mtau=1.777;
620 const double R1=nu1.E()/vis1.E();
624 double E1=0.5*(mtau*mtau+
m1*
m1-
m2*
m2)/mtau;
626 if(E1<=m1 || E1>=mtau)
628 if(preparedInput.
m_fUseVerbose==1) Warning(
"DiTauMassTools",
"Warning in MissingMassCalculator::TauProbability: bad E1, returning 0 ");
631 if(E2<=m2 || E2>=mtau)
633 if(preparedInput.
m_fUseVerbose==1) Warning(
"DiTauMassTools",
"Warning in MissingMassCalculator::TauProbability: bad E2, returning 0 ");
636 preparedInput.
m_tlv_tmp.SetPxPyPzE(0.,0.,0.,0.);
641 double V=
p/sqrt(
p*
p+mtau*mtau);
643 if(type1==8)
p0=sqrt(E2*E2-
m2*
m2);
645 prob1=0.5*mtau/(
p0*V*
pow(R1+1.0,2));
652 const int & type2,
const PtEtaPhiMVector & vis2,
const PtEtaPhiMVector & nu2)
658 const double mtau=1.777;
659 const double R1=nu1.E()/vis1.E();
660 const double R2=nu2.E()/vis2.E();
664 double E1=0.5*(mtau*mtau+
m1*
m1-
m2*
m2)/mtau;
666 if(E1<=m1 || E1>=mtau)
668 if(preparedInput.
m_fUseVerbose==1) Warning(
"DiTauMassTools",
"Warning in MissingMassCalculator::TauProbability: bad E1, returning 0 ");
671 if(E2<=m2 || E2>=mtau)
673 if(preparedInput.
m_fUseVerbose==1) Warning(
"DiTauMassTools",
"Warning in MissingMassCalculator::TauProbability: bad E2, returning 0 ");
676 preparedInput.
m_tlv_tmp.SetPxPyPzE(0.,0.,0.,0.);
681 double V=
p/sqrt(
p*
p+mtau*mtau);
683 if(type1==8)
p0=sqrt(E2*E2-
m2*
m2);
685 prob1=0.5*mtau/(
p0*V*
pow(R1+1.0,2));
693 E1=0.5*(mtau*mtau+
m1*
m1-
m2*
m2)/mtau;
695 if(E1<=m1 || E1>=mtau)
697 if(preparedInput.
m_fUseVerbose==1) Warning(
"DiTauMassTools",
"Warning in MissingMassCalculator::TauProbability: bad E1, returning 0 ");
700 if(E2<=m2 || E2>=mtau)
702 if(preparedInput.
m_fUseVerbose==1) Warning(
"DiTauMassTools",
"Warning in MissingMassCalculator::TauProbability: bad E2, returning 0 ");
705 preparedInput.
m_tlv_tmp.SetPxPyPzE(0.,0.,0.,0.);
712 V=
p/sqrt(
p*
p+mtau*mtau);
713 if(type2==8)
p0=sqrt(E2*E2-
m2*
m2);
715 prob2=0.5*mtau/(
p0*V*
pow(R2+1.0,2));
725 const int & type2,
const PtEtaPhiMVector & vis2,
const PtEtaPhiMVector & nu2,
const double & detmet) {
734 const double R1=nu1.P()/vis1.P();
735 const double R2=nu2.P()/vis2.P();
736 const double lep_p1[4]={0.417,0.64,0.52,0.678};
737 const double lep_p2[4]={0.23,0.17,0.315,0.319};
738 const double lep_p3[4]={0.18,0.33,0.41,0.299};
739 const double lep_p4[4]={0.033,0.109,0.129,0.096};
740 const double lep_p5[4]={0.145,0.107,0.259,0.304};
743 const double n_1pr[4]={-0.15,-0.13,-0.25,-0.114};
744 const double s_1pr[4]={0.40,0.54,0.62,0.57};
745 const double n_3pr[4]={-1.08,-1.57,-0.46,-0.39};
746 const double s_3pr[4]={0.53,0.85,0.61,0.53};
749 if(type1>=0 && type1<=5)
754 if(type2>=0 && type2<=5)
759 if(Plep<50.0 && Plep>=45.0)
ind=2;
760 if(Plep<45.0 && Plep>=40.0)
ind=1;
762 if(Ptau<50.0 && Ptau>=45.0) indT=2;
763 if(Ptau<45.0 && Ptau>=40.0) indT=1;
764 if(Ptau<40.0) indT=0;
765 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]);
766 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]);
768 if(type1>=0 && type1<=2)
prob=
prob*TMath::Gaus(R1,n_1pr[indT],s_1pr[indT]);
769 if(type2>=0 && type2<=2)
prob=
prob*TMath::Gaus(R2,n_1pr[indT],s_1pr[indT]);
770 if(type1>=3 && type1<=5)
prob=
prob*TMath::Gaus(R1,n_3pr[indT],s_3pr[indT]);
771 if(type2>=3 && type2<=5)
prob=
prob*TMath::Gaus(R2,n_3pr[indT],s_3pr[indT]);
776 const double R1=nu1.P()/vis1.P();
777 const double R2=nu2.P()/vis2.P();
778 const double lep_p1[4]={0.441,0.64,0.79,0.8692};
779 const double lep_p2[4]={0.218,0.28,0.29,0.3304};
780 const double lep_p3[4]={0.256,0.33,0.395,0.4105};
781 const double lep_p4[4]={0.048,0.072,0.148,0.1335};
782 const double lep_p5[4]={0.25,0.68,0.10,0.2872};
784 const double p_1prong=-3.706;
785 const double p_3prong=-5.845;
788 if(type1>=0 && type1<=5)
793 if(type2>=0 && type2<=5)
798 if(Plep<50.0 && Plep>=45.0)
ind=2;
799 if(Plep<45.0 && Plep>=40.0)
ind=1;
801 const double scale1prong=Ptau>45.0 ? 1.0 : -1.019/((Ptau*0.0074-0.059)*p_1prong);
802 const double scale3prong=Ptau>40.0 ? 1.0 : -1.24/((Ptau*0.0062-0.033)*p_3prong);
803 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]);
804 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]);
806 if(type1>=0 && type1<=2)
prob=
prob*
exp(p_1prong*R1*scale1prong)*std::abs(p_1prong*scale1prong)*0.02;
807 if(type2>=0 && type2<=2)
prob=
prob*
exp(p_1prong*R2*scale1prong)*std::abs(p_1prong*scale1prong)*0.02;
808 if(type1>=3 && type1<=5)
prob=
prob*
exp(p_3prong*R1*scale3prong)*std::abs(p_3prong*scale3prong)*0.02;
809 if(type2>=3 && type2<=5)
prob=
prob*
exp(p_3prong*R2*scale3prong)*std::abs(p_3prong*scale3prong)*0.02;
819 const double R[2]={nu1.P()/vis1.P(),nu2.P()/vis2.P()};
820 const double E[2]={(nu1+vis1).
E(),(nu2+vis2).
E()};
821 const int tau_type[2]={type1,type2};
822 int order1= vis1.Pt()>vis2.Pt() ? 0 : 1;
823 int order2= vis1.Pt()>vis2.Pt() ? 1 : 0;
828 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;
829 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;
830 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;
831 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;
833 const double C1p=0.062;
834 const double C3p=0.052;
835 const double G1p=1.055;
836 const double G3p=1.093;
839 if( tau_type[order1]>=0 && tau_type[order1]<=2 )
845 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 ?
846 par_1p[0][0]+par_1p[0][1]/(par_1p[0][2]*
x+par_1p[0][3])+par_1p[0][4]*
x : 0.01;
849 if( tau_type[order1]>=3 && tau_type[order1]<=5 )
854 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 ?
855 par_3p[0][0]+par_3p[0][1]/(par_3p[0][2]*
x+par_3p[0][3])+par_3p[0][4]*
x : 0.01;
859 if( tau_type[order2]>=0 && tau_type[order2]<=2 )
861 const double par[4]={0.1147,-0.09675,-35.0,3.711E-11};
864 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 ?
865 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;
870 if( tau_type[order2]>=3 && tau_type[order2]<=5 )
874 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 ?
875 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;
876 const double par[4]={0.2302,-2.012,-36.08,-0.000373};
884 const double R1=nu1.P()/vis1.P();
885 const double R2=nu2.P()/vis2.P();
886 const double E1=(nu1+vis1).
E();
887 const double E2=(nu2+vis2).
E();
888 int order1= vis1.Pt()>vis2.Pt() ? 0 : 1;
889 int order2= vis1.Pt()>vis2.Pt() ? 1 : 0;
890 const double slope_1p[2]={-3.185,-2.052};
891 const double slope_3p[2]={-3.876,-2.853};
894 par_1p[0][0]=-0.3745; par_1p[0][1]=0.01417; par_1p[0][2]=-7.285E-5;
895 par_1p[1][0]=-0.3683; par_1p[1][1]=0.01807; par_1p[1][2]=-9.514E-5;
896 par_3p[0][0]=-0.3055; par_3p[0][1]=0.01149; par_3p[0][2]=-5.855E-5;
897 par_3p[1][0]=-0.3410; par_3p[1][1]=0.01638; par_3p[1][2]=-9.465E-5;
900 if(type1>=0 && type1<=2)
902 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]);
907 if(type1>=3 && type1<=5)
909 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]);
914 if(type2>=0 && type2<=2)
916 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]);
921 if(type2>=3 && type2<=5)
923 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]);
942 double norm=4851900.0;
945 p[4]=1.433E5/(5.0*
norm);
p[5]=-1.229E5/(6.0*
norm);
p[6]=3.434E4/(7.0*
norm);
948 double x1= mnu+0.5*binsize < 1.777-0.113 ? mnu+0.5*binsize : 1.777-0.113;
949 double x2= mnu-0.5*binsize > 0.0 ? mnu-0.5*binsize : 0.0;
950 for(
int i=0;
i<7;
i++)
958 if(preparedInput.
m_fUseVerbose==1) Warning(
"DiTauMassTools",
"Warning in MissingMassCalculator::MnuProbability: negative probability!!! ");
963 if(preparedInput.
m_fUseVerbose==1) Warning(
"DiTauMassTools",
"Warning in MissingMassCalculator::MnuProbability: probability > 1!!! ");
974 const double norm=4851900.0;
976 p[0]=-288.6;
p[1]=6.217E4;
p[2]=2.122E4;
p[3]=-9.067E4;
977 p[4]=1.433E5;
p[5]=-1.229E5;
p[6]=3.434E4;
979 for(
int i=0;
i<7;
i++)
986 if(preparedInput.
m_fUseVerbose==1) Warning(
"DiTauMassTools",
"Warning in MissingMassCalculator::MnuProbability: negative probability!!! ");
991 if(preparedInput.
m_fUseVerbose==1) Warning(
"DiTauMassTools",
"Warning in MissingMassCalculator::MnuProbability: probability > 1!!! ");
998 const double & trueMetGuess,
const double & mht_offset) {
1009 const double n_arg=(mht-trueMetGuess-mht_offset)/preparedInput.
m_MHtSigma1;
1010 mhtprob*=
exp(-0.25*
pow(n_arg,2));
1015 const double & trueMetGuess,
const double & mht_offset) {
1022 const double n_arg=(mht-trueMetGuess-mht_offset)/5.7;
1037 double prob=1.0E-10;
1039 if(tau_type==8) tau_code = 0;
1040 else if(tau_type>=0 && tau_type<=2) tau_code = 1;
1041 else if(tau_type>=3 && tau_type<=5) tau_code = 2;
1042 else if(tau_type==6)
return prob;
1045 Warning(
"DiTauMassTools",
"---- WARNING in MissingMassCalculator::dTheta3d_probabilityFast() ----");
1046 Warning(
"DiTauMassTools",
"%s", (
"..... wrong tau_type="+
std::to_string(tau_type)).c_str());
1047 Warning(
"DiTauMassTools",
"%s", (
"..... returning prob="+
std::to_string(
prob)).c_str());
1048 Warning(
"DiTauMassTools",
"____________________________________________________________");
1053 double myDelThetaParam[6];
1055 for (
int i=0;
i<6;++
i)
1063 double dTheta3dVal=dTheta3d;
1073 Warning(
"DiTauMassTools",
"---- WARNING in MissingMassCalculator::dTheta3d_probabilityFast() ----");
1074 Warning(
"DiTauMassTools",
"%s", (
"..... wrong probability="+
std::to_string(
prob)).c_str());
1076 Warning(
"DiTauMassTools",
"____________________________________________________________");
1087 double fitval=1.0E-10;
1088 if(
x[0]>TMath::Pi() ||
x[0]<0.0)
return fitval;
1089 const double arg=
x[0];
1090 const double arg_L=
arg;
1092 const double sigmaG=
par[2];
1093 const double mpv=
par[3];
1094 const double sigmaL=
par[4];
1100 const double norm=sqrt(2.0*TMath::Pi());
1102 const double g2=TMath::Landau(arg_L,mpv,sigmaL)/
norm;
1106 if(fitval<0.0)
return 0.0;
1113 double fitval=1.0E-10;
1114 if(
x[0]>TMath::Pi() ||
x[0]<0.0)
return fitval;
1117 double normL=
par[5];
1118 if(normL<0.0) normL=0.0;
1122 const double arg_L=
x[0];
1123 const double mean=1.0;
1124 const double sigmaG=
par[2];
1125 const double mpv=
par[3];
1126 const double sigmaL=
par[4];
1127 const double g1=normL*TMath::Gaus(
arg,
mean,sigmaG);
1128 const double g2=TMath::Landau(arg_L,mpv,sigmaL);
1129 fitval=
par[0]*(
g1+
g2)/(1.0+normL);
1130 if(fitval<0.0)
return 0.0;
1137 if(P_tau<0.0)
return 0.0;
1166 if(preparedInput.
m_fUseVerbose==1) { Info(
"DiTauMassTools",
"Attempting to set LFV MMC settings"); }
1176 if(mT1>mT2) sr_switch = 0;
1181 if(mT1>mT2) sr_switch = 1;
1189 if(mT1>mT2) sr_switch = 0;
1194 if(mT1>mT2) sr_switch = 1;
1203 if(mT1>mT2) sr_switch = 0;
1208 if(mT1>mT2) sr_switch = 1;
1216 double sigmaSyst = 0.10;
1221 METresScale = 0.41*(1.0+preparedInput.
m_METresSyst*sigmaSyst);
1222 METoffset = 7.36*(1.0+preparedInput.
m_METresSyst*sigmaSyst);
1226 METresScale = 0.34*(1.0+preparedInput.
m_METresSyst*sigmaSyst);
1227 METoffset = 6.61*(1.0+preparedInput.
m_METresSyst*sigmaSyst);
1231 Info(
"DiTauMassTools",
"%s", (
"METoffset = "+
std::to_string(METoffset)).c_str());
1232 Info(
"DiTauMassTools",
"%s", (
"METresScale = "+
std::to_string(METresScale)).c_str());
1235 double sigma = preparedInput.
m_SumEt>0.0 ? METoffset+METresScale*sqrt(preparedInput.
m_SumEt) : METoffset;
1245 double sigmaSyst = 0.10;
1251 METresScale = 0.38*(1.0+preparedInput.
m_METresSyst*sigmaSyst);
1252 METoffset = 7.96*(1.0+preparedInput.
m_METresSyst*sigmaSyst);
1256 METresScale = 0.39*(1.0+preparedInput.
m_METresSyst*sigmaSyst);
1257 METoffset = 6.61*(1.0+preparedInput.
m_METresSyst*sigmaSyst);
1261 sigma = preparedInput.
m_SumEt>0.0 ? METoffset+METresScale*sqrt(preparedInput.
m_SumEt) : METoffset;
1281 if(preparedInput.
m_MetVec.R()<20.0)
1294 double sigmaSyst = 0.10;
1295 double METresScale = 0.32*(1.0+preparedInput.
m_METresSyst*sigmaSyst);
1296 double METoffset = 5.38*(1.0+preparedInput.
m_METresSyst*sigmaSyst);
1297 double sigma = preparedInput.
m_SumEt>0.0 ? METoffset+METresScale*sqrt(preparedInput.
m_SumEt) : METoffset;
1317 double sigmaSyst = 0.10;
1318 double METresScale = 0.87*(1.0+preparedInput.
m_METresSyst*sigmaSyst);
1319 double METoffset = 4.16*(1.0+preparedInput.
m_METresSyst*sigmaSyst);
1320 double sigma = preparedInput.
m_SumEt>0.0 ? METoffset+METresScale*sqrt(preparedInput.
m_SumEt) : METoffset;
1330 double sigmaSyst = 0.10;
1331 double METresScale = 0.65*(1.0+preparedInput.
m_METresSyst*sigmaSyst);
1332 double METoffset = 5.0*(1.0+preparedInput.
m_METresSyst*sigmaSyst);
1333 double sigma = preparedInput.
m_SumEt>0.0 ? METoffset+METresScale*sqrt(preparedInput.
m_SumEt) : METoffset;
1341 double sigmaSyst=0.10;
1346 double METresScale=0.86*(1.0+preparedInput.
m_METresSyst*sigmaSyst);
1347 double METoffset=3.0*(1.0+preparedInput.
m_METresSyst*sigmaSyst);
1349 sigma= preparedInput.
m_SumEt>0.0 ? METoffset+METresScale*sqrt(preparedInput.
m_SumEt) : METoffset;
1356 double dphi_scale =
x > 0.3 ? 0.9429 - 0.059*
x + 0.054*
x*
x : 0.728;
1357 double METoffset = 1.875*(1.0+preparedInput.
m_METresSyst*sigmaSyst);
1358 double METresScale1 = 8.914*(1.0+preparedInput.
m_METresSyst*sigmaSyst);
1359 double METresScale2 = -8.53*(1.0+preparedInput.
m_METresSyst*sigmaSyst);
1362 sigma = preparedInput.
m_SumEt > 80.0 ? METoffset + METresScale1*TMath::Log(sqrt(preparedInput.
m_SumEt)+METresScale2) : 5.0;
1381 double sigmaSyst=0.10;
1383 double METresScale=0.9*(1.0+preparedInput.
m_METresSyst*sigmaSyst);
1384 double METoffset=-1.8*(1.0+preparedInput.
m_METresSyst*sigmaSyst);
1385 double sigma= preparedInput.
m_SumEt>0.0 ? METoffset+METresScale*sqrt(preparedInput.
m_SumEt) : std::abs(METoffset);
1390 else if(preparedInput.
m_Njet25==0 &&
1394 double sigmaSyst=0.10;
1396 double dphi_scale =
x > 2.5 ? 11.0796 - 4.61236*
x + 0.423617*
x*
x : 2.;
1397 double METoffset = -8.51013*(1.0+preparedInput.
m_METresSyst*sigmaSyst);
1398 double METresScale1 = 8.54378*(1.0+preparedInput.
m_METresSyst*sigmaSyst);
1399 double METresScale2 = -3.97146*(1.0+preparedInput.
m_METresSyst*sigmaSyst);
1400 double sigma= preparedInput.
m_SumEt>80.0 ? METoffset+METresScale1*TMath::Log(sqrt(preparedInput.
m_SumEt)+METresScale2) : 5.;
1419 double METresScale=-1.;
1420 double METoffset=-1.;
1421 double sigmaSyst=0.10;
1426 METresScale = 1.1*(1.0+preparedInput.
m_METresSyst*sigmaSyst);
1427 METoffset = -5.0*(1.0+preparedInput.
m_METresSyst*sigmaSyst);
1430 double sigma = preparedInput.
m_SumEt>0.0 ? METoffset+METresScale*sqrt(preparedInput.
m_SumEt) : std::abs(METoffset);
1435 double dphi_scale =
x > 0.6 ? 1.42047 - 0.666644*
x + 0.199986*
x*
x : 1.02;
1436 METoffset = 1.19769*(1.0+preparedInput.
m_METresSyst*sigmaSyst);
1437 double METresScale1 = 5.61687*(1.0+preparedInput.
m_METresSyst*sigmaSyst);
1438 double METresScale2 = -4.2076*(1.0+preparedInput.
m_METresSyst*sigmaSyst);
1439 sigma= preparedInput.
m_SumEt>115.0 ? METoffset+METresScale1*TMath::Log(sqrt(preparedInput.
m_SumEt)+METresScale2) : 12.1;
1454 double sigmaSyst = 0.10;
1455 double METresScale = -1.0;
1456 double METoffset = -1.0;
1462 METresScale=-0.4307*(1.0+preparedInput.
m_METresSyst*sigmaSyst);
1463 METoffset=7.06*(1.0+preparedInput.
m_METresSyst*sigmaSyst);
1464 double METresScale2=0.07693*(1.0+preparedInput.
m_METresSyst*sigmaSyst);
1469 sigma= preparedInput.
m_SumEt>0.0 ? METoffset+METresScale*sqrt(preparedInput.
m_SumEt)+METresScale2*preparedInput.
m_SumEt : METoffset;
1474 METresScale=0.8149*(1.0+preparedInput.
m_METresSyst*sigmaSyst);
1475 METoffset=5.343*(1.0+preparedInput.
m_METresSyst*sigmaSyst);
1479 sigma= preparedInput.
m_SumEt>0.0 ? METoffset+METresScale*sqrt(preparedInput.
m_SumEt) : METoffset;
1490 double sigmaSyst=0.10;
1491 double METresScale=-1.0;
1492 double METoffset=-1.0;
1494 double min_sigma = 2.0;
1499 METoffset = 4.22581*(1.0+preparedInput.
m_METresSyst*sigmaSyst);
1500 METresScale = 0.03818*(1.0+preparedInput.
m_METresSyst*sigmaSyst);
1501 double METresScale2= 0.12623;
1502 sigma= preparedInput.
m_SumEt>0.0 ? METoffset+METresScale*sqrt(preparedInput.
m_SumEt)+METresScale2*preparedInput.
m_SumEt : min_sigma;
1504 double p0 = 2.60131;
1505 double p1const = 1.22427;
1506 double p2quad = -1.71261;
1508 sigma *= (DphiLL <
p0) ? p1const : p1const+
1509 p2quad*
p0*
p0 - 2*p2quad*
p0*DphiLL+p2quad*DphiLL*DphiLL;
1516 METoffset = 5.42506*(1.0+preparedInput.
m_METresSyst*sigmaSyst);
1517 METresScale = 5.36760*(1.0+preparedInput.
m_METresSyst*sigmaSyst);
1518 double METoffset2 = -4.86808*(1.0+preparedInput.
m_METresSyst*sigmaSyst);
1519 if (preparedInput.
m_SumEt > 0.0) {
1520 double x = sqrt(preparedInput.
m_SumEt);
1521 sigma = (
x+METoffset2 > 1) ? METoffset+METresScale*
log(
x+METoffset2) : METoffset;
1526 double p0 = 2.24786;
1527 double p1const = 0.908597;
1528 double p2quad = 0.544577;
1530 sigma *= (DphiLL <
p0) ? p1const : p1const+
1531 p2quad*
p0*
p0 - 2*p2quad*
p0*DphiLL+p2quad*DphiLL*DphiLL;