bool MelaReweighterWW::recast(){ if (_candModified) delete _candModified; MELACandidate* melaCand = _mela->getCurrentCandidate(); _recaster->copyCandidate(melaCand, _candModified); _recaster->reduceJJtoQuarks(_candModified); _mela->setCurrentCandidate(_candModified); if (std::isnan(_candModified->getSortedDaughter(0)->t())) return false; return true; }
float MelaReweighterWW::weightStoH(){ //setupDaughters(_isVBF, id_l1, id_l2, id_n1, id_n2, l1, l2, n1, n2, associated, idsAssociated); float meSpow; _mela->setProcess(TVar::HSMHiggs, TVar::MCFM, _isVBF ? TVar::JJVBF_S : TVar::ZZGG); // Added here -- U. Sarica _mela->setMelaHiggsMassWidth(_mpole, _width, 0); // if (!_isVBF) _mela->computeP(meSpow, false); else _mela->computeProdDecP(meSpow, false); float meH; _mela->setProcess(TVar::HSMHiggs, TVar::MCFM, _isVBF ? TVar::JJVBF : TVar::ZZGG); //Added here -- U. Sarica _mela->setMelaHiggsMassWidth(125., 4.07e-3, 0); // if (!_isVBF) _mela->computeP(meH, false); else _mela->computeProdDecP(meH, false); //_mela->resetInputEvent(); //std::cout << "### meS = " << meS << " meSpow = " << meSpow << " meB = " << meB << " meSBI = " << meSBI << std::endl; //std::cout << "### weight = " << (meSBI-meS-meB)/meSpow << std::endl; return (meH)/meSpow; }
float getSuperMELA(Mela& myMela, int lepId[4], float mZZ, TVar::SuperMelaSyst syst){ float myprob=1.0; TVar::LeptonFlavor myflavor=TVar::Flavor_Dummy; if(abs(lepId[0])==abs(lepId[1]) && abs(lepId[0])==abs(lepId[2]) && abs(lepId[0])==abs(lepId[3])){ if(abs(lepId[0])==11) myflavor=TVar::Flavor_4e; else myflavor=TVar::Flavor_4mu; } else myflavor=TVar::Flavor_2e2mu; if(myflavor!=TVar::Flavor_Dummy) myMela.computePM4l(mZZ, myflavor, syst, myprob ); return myprob; };
float getJHUGenMELAWeight(Mela& myMela, int lepId[4], float angularOrdered[8], double selfDHvvcoupl[SIZE_HVV][2]){ float myprob=1.0; int myflavor=-1; if(abs(lepId[0])==abs(lepId[1]) && abs(lepId[0])==abs(lepId[2]) && abs(lepId[0])==abs(lepId[3])){ if(abs(lepId[0])==11) myflavor=1; else myflavor=2; } else myflavor=3; if(myflavor>=0) myMela.computeP(angularOrdered[0],angularOrdered[1],angularOrdered[2],angularOrdered[3], angularOrdered[4],angularOrdered[5],angularOrdered[6],angularOrdered[7], myflavor, selfDHvvcoupl, myprob ); return myprob; };
float getMCFMMELAWeight(Mela& myMela, int lepId[4], float angularOrdered[8], double ggcoupl[2],int useConstant=0){ float myprob=1.0; int myflavor=-1; if(abs(lepId[0])==abs(lepId[1]) && abs(lepId[0])==abs(lepId[2]) && abs(lepId[0])==abs(lepId[3])){ if(abs(lepId[0])==11) myflavor=1; else myflavor=2; } else myflavor=3; if(myflavor>=0) myMela.computeP(angularOrdered[0],angularOrdered[1],angularOrdered[2],angularOrdered[3], angularOrdered[4],angularOrdered[5],angularOrdered[6],angularOrdered[7], myflavor, myprob, useConstant ); return myprob; };
float MelaReweighterWW::weightStoB(){ //setupDaughters(_isVBF, id_l1, id_l2, id_n1, id_n2, l1, l2, n1, n2, associated, idsAssociated); float meS; _mela->setProcess(TVar::HSMHiggs, TVar::MCFM, _isVBF ? TVar::JJVBF_S : TVar::ZZGG); // Added here -- U. Sarica _mela->setMelaHiggsMassWidth(_mpole, _width, 0); _mela->setMelaHiggsMassWidth(125., 4.07e-3, 1); // if (!_isVBF) _mela->computeP(meS, false); else _mela->computeProdDecP(meS, false); float meB; _mela->setProcess(TVar::bkgWW, TVar::MCFM, _isVBF ? TVar::JJEW : TVar::ZZGG); if (!_isVBF) _mela->computeP(meB, false); else _mela->computeProdDecP(meB, false); //_mela->resetInputEvent(); return meB/meS; }
void MelaReweighterWW::setupDaughters(bool isVBF, const int& id_l1, const int& id_l2, const int& id_n1, const int& id_n2, const TLorentzVector& l1, const TLorentzVector& l2, const TLorentzVector& n1, const TLorentzVector& n2, const std::vector<TLorentzVector>& associated, const std::vector<int>& idsAssociated, const std::vector<TLorentzVector>& mothers, const std::vector<int>& idsMothers){ _isVBF=isVBF; _daughters->clear(); _daughters->push_back(SimpleParticle_t(id_l1, l1)); _daughters->push_back(SimpleParticle_t(id_l2, l2)); _daughters->push_back(SimpleParticle_t(id_n1, n1)); _daughters->push_back(SimpleParticle_t(id_n2, n2)); _associated->clear(); for (unsigned int i = 0; i < associated.size(); ++i){ _associated->push_back(SimpleParticle_t(idsAssociated[i], associated[i])); } _mothers->clear(); bool hasOneGluon = false; for (unsigned int i = 0; i < mothers.size(); ++i){ _mothers->push_back(SimpleParticle_t(idsMothers[i], mothers[i])); if (idsMothers[i] == 22) hasOneGluon = true; } if (_candModified != 0){ delete _candModified; _candModified = 0; } _mela->resetInputEvent(); //check charge double chargeIn = 0; for (unsigned int i = 0; i < _mothers->size(); ++i){ MELAParticle p(_mothers->at(i).first, _mothers->at(i).second); chargeIn+=p.charge(); } double chargeOut = 0; for (unsigned int i = 0; i < _associated->size(); ++i){ MELAParticle p(_associated->at(i).first, _associated->at(i).second); chargeOut+=p.charge(); } bool toRecast=true; if (chargeIn != chargeOut){ toRecast = false; //just kill the unwanted particle for (unsigned int i = 0; i < _associated->size(); ++i){ int id=_associated->at(i).first; bool antiParticleInInitialState=false; for (unsigned int j = 0; j < _mothers->size(); ++j){ if (id==-_mothers->at(j).first){ //cout << "Skipping " << id << endl; antiParticleInInitialState=true; } } if (antiParticleInInitialState) _associated->erase(_associated->begin()+i); } } _mela->setInputEvent(_daughters, _associated, _mothers, true); if (isVBF){ bool recasted = recast(); if (!recasted) { //just remove the gluon for (unsigned int i = 0; i < _associated->size(); ++i){ int id=_associated->at(i).first; if (id == 21) _associated->erase(_associated->begin()+i); } _mela->setInputEvent(_daughters, _associated, _mothers, true); } } }
void MelaReweighterWW::resetMCFM_EWKParameters(double Gf, double alphaEW, double mW, double mZ, double sin2thetaW){ _mela->resetMCFM_EWKParameters(Gf, alphaEW, mW, mZ, sin2thetaW); }