9 EventShape_ =
new TF2(
"landau2D",
"[0]*TMath::Landau(x,[1],[2],0)*TMath::Landau(y,[3],[4],0)",0,500,0,500);
10 EventShape_->SetParameters(30.7137,56.2880,23.0744,59.1015,24.9145);
26 EventShape_ =
new TF2(
"landau2D",
"[0]*TMath::Landau(x,[1],[2],0)*TMath::Landau(y,[3],[4],0)",0,500,0,500);
27 EventShape_->SetParameters(nupars[0],nupars[1],nupars[2],nupars[3],nupars[4]);
45 TLorentzVector LV_e, LV_e_;
47 TLorentzVector LV_b, LV_b_;
49 bool hasMCinfo =
true;
53 }
else hasMCinfo =
false;
58 }
else hasMCinfo =
false;
67 }
else if (fitsol.
getWpDecay() ==
"electron") {
79 }
else if (fitsol.
getWmDecay() ==
"electron") {
96 double weightmax = -1e30;
102 double q_coeff[5], q_sol[4];
104 int NSol =
quartic(q_coeff, q_sol);
107 for (
int isol = 0; isol < NSol; isol++) {
108 TopRec(LV_e, LV_e_, LV_b, LV_b_, q_sol[isol]);
110 if (weight > weightmax) {
137 TLorentzVector LV_l_,
139 TLorentzVector LV_b_) {
145 double weightmax = -1;
149 double q_coeff[5], q_sol[4];
151 int NSol =
quartic(q_coeff, q_sol);
154 for (
int isol = 0; isol < NSol; isol++) {
155 TopRec(LV_l, LV_l_, LV_b, LV_b_, q_sol[isol]);
157 if (weight > weightmax) {
172 const TLorentzVector
l,
173 const TLorentzVector b_al,
174 const TLorentzVector b_l,
179 double* koeficienty) {
181 double E, apom1, apom2, apom3;
182 double k11, k21, k31, k41, cpom1, cpom2, cpom3, l11, l21, l31, l41, l51, l61, k1, k2, k3, k4, k5,k6;
183 double l1, l2, l3, l4, l5, l6, k15, k25, k35, k45;
185 C = -al.Px()-b_al.Px()-l.Px()-b_l.Px() + px_miss;
186 D = -al.Py()-b_al.Py()-l.Py()-b_l.Py() + py_miss;
191 E = (
sqr(mt)-
sqr(
mw)-
sqr(
mb))/(2*b_al.E())-
sqr(
mw)/(2*al.E())-al.E()+al.Px()*b_al.Px()/b_al.E()+al.Py()*b_al.Py()/b_al.E()+al.Pz()*b_al.Pz()/b_al.E();
192 F = (
sqr(mat)-
sqr(
maw)-
sqr(
mab))/(2*b_l.E())-
sqr(
maw)/(2*l.E())-l.E()+l.Px()*b_l.Px()/b_l.E()+l.Py()*b_l.Py()/b_l.E()+l.Pz()*b_l.Pz()/b_l.E();
194 m1 = al.Px()/al.E()-b_al.Px()/b_al.E();
195 m2 = al.Py()/al.E()-b_al.Py()/b_al.E();
196 m3 = al.Pz()/al.E()-b_al.Pz()/b_al.E();
198 n1 = l.Px()/l.E()-b_l.Px()/b_l.E();
199 n2 = l.Py()/l.E()-b_l.Py()/b_l.E();
200 n3 = l.Pz()/l.E()-b_l.Pz()/b_l.E();
203 apom1 =
sqr(al.Px())-
sqr(al.E());
204 apom2 =
sqr(al.Py())-
sqr(al.E());
205 apom3 =
sqr(al.Pz())-
sqr(al.E());
214 cpom1 =
sqr(l.Px())-
sqr(l.E());
215 cpom2 =
sqr(l.Py())-
sqr(l.E());
216 cpom3 =
sqr(l.Pz())-
sqr(l.E());
236 l5 = l51*k61/(
sqr(k51));
258 int moc=(int(log10(fabs(koeficienty[0])))+int(log10(fabs(koeficienty[4]))))/2;
260 koeficienty[0]=koeficienty[0]/TMath::Power(10,moc);
261 koeficienty[1]=koeficienty[1]/TMath::Power(10,moc);
262 koeficienty[2]=koeficienty[2]/TMath::Power(10,moc);
263 koeficienty[3]=koeficienty[3]/TMath::Power(10,moc);
264 koeficienty[4]=koeficienty[4]/TMath::Power(10,moc);
268 const TLorentzVector
l,
269 const TLorentzVector b_al,
270 const TLorentzVector b_l,
275 double pxp, pyp, pzp, pup, pvp, pwp;
280 pzp = -1/
n3*(
n1*pxp +
n2*pyp -
F);
285 LV_n_.SetXYZM(pxp, pyp, pzp, 0.0);
286 LV_n.SetXYZM(pup, pvp, pwp, 0.0);
294 t_ttboost = -aux.BoostVector();
319 double w, b0, b1, b2;
325 if (koeficienty[4]==0.0)
326 return cubic(koeficienty, koreny);
328 w = koeficienty[3]/(4*koeficienty[4]);
330 b2 = -6*
sqr(w) + koeficienty[2]/koeficienty[4];
332 b1 = (8*
sqr(w) - 2*koeficienty[2]/koeficienty[4])*w + koeficienty[1]/koeficienty[4];
333 b0 = ((-3*
sqr(w) + koeficienty[2]/koeficienty[4])*w - koeficienty[1]/koeficienty[4])*w + koeficienty[0]/koeficienty[4];
339 c[0] =
sqr(b1) - 4*b0*b2;
342 i =
cubic(c, koreny);
353 for (i=-1; i<=1; i+=2) {
356 d1 = (t!=0.0)? -i*0.5*b1/t : i*
sqrt(-z - b2);
357 h = 0.25*
sqr(d1) -
d0;
361 *px++ = -0.5*d1 - h - w;
362 *px++ = -0.5*d1 + h - w;
380 double w,
p,
q, dis,
h,
phi;
382 if (coeffs[3]!=0.0) {
384 w = coeffs[2]/(3*coeffs[3]);
385 p =
sqr(coeffs[1]/(3*coeffs[3])-
sqr(w))*(coeffs[1]/(3*coeffs[3])-
sqr(w));
386 q = -0.5*(2*
sqr(w)*w-(coeffs[1]*w-coeffs[0])/coeffs[3]);
394 if (h<-1.0) h = -1.0;
397 p = 2*TMath::Power(-p, 1.0/6.0);
400 if (koreny[1]<koreny[0])
SWAP(koreny[0], koreny[1]);
402 if (koreny[2]<koreny[1])
SWAP(koreny[1], koreny[2]);
403 if (koreny[1]<koreny[0])
SWAP(koreny[0], koreny[1]);
409 h = TMath::Power(fabs(q+dis), 1.0/3.0);
410 p = TMath::Power(fabs(q-dis), 1.0/3.0);
411 koreny[0] = ((q+dis>0.0)? h : -
h) + ((q-dis>0.0)? p : -
p) - w;
417 for (i=0; i<nreal; i++) {
418 h = coeffs[1] + koreny[
i] * (2 * coeffs[2] + 3 * koreny[
i] * coeffs[3]);
420 koreny[
i] -= (coeffs[0] + koreny[
i] * (coeffs[1] + koreny[
i] * (coeffs[2] + koreny[
i] * coeffs[3])))/h;
424 else if (coeffs[2]!=0.0) {
426 p = 0.5*coeffs[1]/coeffs[2];
427 dis =
sqr(p) - coeffs[0]/coeffs[2];
431 koreny[0] = -p - dis;
432 koreny[1] = -p + dis;
440 else if (coeffs[1]!=0.0) {
442 koreny[0] = -coeffs[0]/coeffs[1];
455 if (realtwo < realone) {
456 double aux = realtwo;
int quartic(double *q_coeff, double *q_sol)
pat::Jet getCalJetBbar() const
void setRecWeightMax(double wgt)
void SWAP(double &realone, double &realtwo)
int cubic(double *c_coeff, double *c_sol)
void SetConstraints(double xx=0, double yy=0)
const reco::GenParticle * getGenN() const
pat::Electron getElectronm() const
std::string getWmDecay() const
std::string getWpDecay() const
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
void TopRec(const TLorentzVector al, const TLorentzVector l, const TLorentzVector b_al, const TLorentzVector b_l, double sol)
virtual double energy() const
energy
const reco::GenParticle * getGenNbar() const
NeutrinoSolution getNuSolution(TLorentzVector LV_l, TLorentzVector LV_l_, TLorentzVector LV_b, TLorentzVector LV_b_)
reco::LeafCandidate neutrino
TtDilepEvtSolution addKinSolInfo(TtDilepEvtSolution *asol)
Cos< T >::type cos(const T &t)
pat::Electron getElectronp() const
pat::Muon getMuonm() const
virtual double px() const
x coordinate of momentum vector
pat::Jet getCalJetB() const
virtual double pz() const
z coordinate of momentum vector
pat::Muon getMuonp() const
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
reco::LeafCandidate neutrinoBar
void setRecTopMass(double mass)
virtual double py() const
y coordinate of momentum vector
void FindCoeff(const TLorentzVector al, const TLorentzVector l, const TLorentzVector b_al, const TLorentzVector b_l, double mt, double mat, double pxboost, double pyboost, double *q_coeff)
Power< A, B >::type pow(const A &a, const B &b)
double WeightSolfromShape()