JHUGen MELA  JHUGen v7.5.6, MELA v2.4.2
Matrix element calculations as used in JHUGen.
TUtil Namespace Reference

Functions

void applyLeptonMassCorrection (bool flag=true)
 
void applyJetMassCorrection (bool flag=true)
 
void setLeptonMassScheme (TVar::FermionMassRemoval scheme=TVar::ConserveDifermionMass)
 
void setJetMassScheme (TVar::FermionMassRemoval scheme=TVar::ConserveDifermionMass)
 
void constrainedRemovePairMass (TLorentzVector &p1, TLorentzVector &p2, double m1=0, double m2=0)
 
void scaleMomentumToEnergy (const TLorentzVector &massiveJet, TLorentzVector &masslessJet, double mass=0)
 
std::pair< TLorentzVector, TLorentzVector > removeMassFromPair (TLorentzVector const &jet1, int const &jet1Id, TLorentzVector const &jet2, int const &jet2Id, double m1=0, double m2=0)
 
void adjustTopDaughters (SimpleParticleCollection_t &daughters)
 
void computeFakeJet (TLorentzVector const &realJet, TLorentzVector const &others, TLorentzVector &fakeJet)
 
std::pair< TLorentzVector, TLorentzVector > ComplexBoost (TVector3 const &beta, TLorentzVector const &p4)
 
void computeAngles (float &costhetastar, float &costheta1, float &costheta2, float &Phi, float &Phi1, TLorentzVector Z1_lept1, int Z1_lept1Id, TLorentzVector Z1_lept2, int Z1_lept2Id, TLorentzVector Z2_lept1, int Z2_lept1Id, TLorentzVector Z2_lept2, int Z2_lept2Id)
 
void computeAnglesCS (float const &pbeam, float &costhetastar, float &costheta1, float &costheta2, float &Phi, float &Phi1, TLorentzVector Z1_lept1, int Z1_lept1Id, TLorentzVector Z1_lept2, int Z1_lept2Id, TLorentzVector Z2_lept1, int Z2_lept1Id, TLorentzVector Z2_lept2, int Z2_lept2Id)
 
void computeVBFAngles (float &costhetastar, float &costheta1, float &costheta2, float &Phi, float &Phi1, float &Q2V1, float &Q2V2, TLorentzVector p4M11, int Z1_lept1Id, TLorentzVector p4M12, int Z1_lept2Id, TLorentzVector p4M21, int Z2_lept1Id, TLorentzVector p4M22, int Z2_lept2Id, TLorentzVector jet1, int jet1Id, TLorentzVector jet2, int jet2Id, TLorentzVector *injet1=0, int injet1Id=0, TLorentzVector *injet2=0, int injet2Id=0)
 
void computeVBFAngles_ComplexBoost (float &costhetastar, float &costheta1_real, float &costheta1_imag, float &costheta2_real, float &costheta2_imag, float &Phi, float &Phi1, float &Q2V1, float &Q2V2, TLorentzVector p4M11, int Z1_lept1Id, TLorentzVector p4M12, int Z1_lept2Id, TLorentzVector p4M21, int Z2_lept1Id, TLorentzVector p4M22, int Z2_lept2Id, TLorentzVector jet1, int jet1Id, TLorentzVector jet2, int jet2Id, TLorentzVector *injet1=0, int injet1Id=0, TLorentzVector *injet2=0, int injet2Id=0)
 
void computeVHAngles (float &costhetastar, float &costheta1, float &costheta2, float &Phi, float &Phi1, float &m1, float &m2, TLorentzVector p4M11, int Z1_lept1Id, TLorentzVector p4M12, int Z1_lept2Id, TLorentzVector p4M21, int Z2_lept1Id, TLorentzVector p4M22, int Z2_lept2Id, TLorentzVector jet1, int jet1Id, TLorentzVector jet2, int jet2Id, TLorentzVector *injet1=0, int injet1Id=0, TLorentzVector *injet2=0, int injet2Id=0)
 
void computeTTHAngles (float &hs, float &hincoming, float &hTT, float &PhiTT, float &Phi1, float &hbb, float &hWW, float &Phibb, float &Phi1bb, float &hWplusf, float &PhiWplusf, float &hWminusf, float &PhiWminusf, TLorentzVector p4M11, int Z1_lept1Id, TLorentzVector p4M12, int Z1_lept2Id, TLorentzVector p4M21, int Z2_lept1Id, TLorentzVector p4M22, int Z2_lept2Id, TLorentzVector b, int bId, TLorentzVector Wplusf, int WplusfId, TLorentzVector Wplusfb, int WplusfbId, TLorentzVector bbar, int bbarId, TLorentzVector Wminusf, int WminusfId, TLorentzVector Wminusfb, int WminusfbId, TLorentzVector *injet1=0, int injet1Id=0, TLorentzVector *injet2=0, int injet2Id=0)
 
void SetEwkCouplingParameters (double ext_Gf, double ext_aemmz, double ext_mW, double ext_mZ, double ext_xW, int ext_ewscheme)
 
void SetMass (double inmass, int ipart)
 
void SetDecayWidth (double inwidth, int ipart)
 
double GetMass (int ipart)
 
double GetDecayWidth (int ipart)
 
double GetMass (const MELAParticle *part)
 
double GetDecayWidth (const MELAParticle *part)
 
void GetMassWidth (int ipart, double &m, double &ga)
 
void GetMassWidth (const MELAParticle *part, double &m, double &ga)
 
void SetCKMElements (double *invckm_ud, double *invckm_us, double *invckm_cd, double *invckm_cs, double *invckm_ts, double *invckm_tb, double *invckm_ub=0, double *invckm_cb=0, double *invckm_td=0)
 
void SetMadgraphCKMElements (double ckmlambda=0.2265, double ckma=0.79, double ckmrho=0.141, double ckmeta=0)
 
double GetCKMElement (int iquark, int jquark)
 
std::complex< double > GetMadgraphCKMElement (int iquark, int jquark)
 
double InterpretScaleScheme (const TVar::Production &production, const TVar::MatrixElement &matrixElement, const TVar::EventScaleScheme &scheme, TLorentzVector p[mxpart])
 
void SetAlphaS (double &Q_ren, double &Q_fac, double multiplier_ren, double multiplier_fac, int mynloop, int mynflav, std::string mypartons)
 
void GetAlphaS (double *alphas_, double *alphasmz_)
 
bool MCFM_chooser (const TVar::Process &process, const TVar::Production &production, const TVar::LeptonInterference &leptonInterf, const TVar::VerbosityLevel &verbosity, const TVar::simple_event_record &mela_event)
 
bool MCFM_SetupParticleCouplings (const TVar::Process &process, const TVar::Production &production, const TVar::VerbosityLevel &verbosity, const TVar::simple_event_record &mela_event, std::vector< int > *partOrder, std::vector< int > *apartOrder)
 
TString GetMCFMParticleLabel (const int &pid, bool useQJ, bool useExtendedConventions)
 
void InitJHUGenMELA (const char *pathtoPDFSet, int PDFMember, double collider_sqrts)
 
void SetJHUGenHiggsMassWidth (double MReso, double GaReso)
 
void SetJHUGenDistinguishWWCouplings (bool doAllow)
 
void ResetAmplitudeIncludes ()
 
void SetMadgraphSpinZeroCouplings (SpinZeroCouplings const *Hcouplings)
 
void SetMCFMSpinZeroCouplings (bool useBSM, SpinZeroCouplings const *Hcouplings, bool forceZZ)
 
void SetMCFMaTQGCCouplings (bool useBSM, aTQGCCouplings const *couplings)
 
void SetJHUGenSpinZeroVVCouplings (double Hvvcoupl[SIZE_HVV][2], double Hvvpcoupl[SIZE_HVV][2], double Hvpvpcoupl[SIZE_HVV][2], int Hvvcoupl_cqsq[SIZE_HVV_CQSQ], double HvvLambda_qsq[SIZE_HVV_LAMBDAQSQ][SIZE_HVV_CQSQ], bool useWWcoupl)
 
void SetJHUGenSpinZeroGGCouplings (double Hggcoupl[SIZE_HGG][2])
 
void SetJHUGenSpinZeroQQCouplings (double Hqqcoupl[SIZE_HQQ][2])
 
void SetJHUGenSpinOneCouplings (double Zqqcoupl[SIZE_ZQQ][2], double Zvvcoupl[SIZE_ZVV][2])
 
void SetJHUGenSpinTwoCouplings (double Gacoupl[SIZE_GGG][2], double Gvvcoupl[SIZE_GVV][2], double Gvvpcoupl[SIZE_GVV][2], double Gvpvpcoupl[SIZE_GVV][2], double qLeftRightcoupl[SIZE_GQQ][2])
 
void SetJHUGenVprimeContactCouplings (double Zpffcoupl[SIZE_Vpff][2], double Wpffcoupl[SIZE_Vpff][2])
 
void SetMCFMAZffCouplings (bool useBSM, AZffCouplings const *Zcouplings)
 
void SetJHUGenAZffCouplings (bool needAZff, double AZffcoupl[SIZE_AZff][2])
 
bool MCFM_masscuts (double s[][mxpart], const TVar::Process &process)
 
bool MCFM_smalls (double s[][mxpart], int npart)
 
double SumMatrixElementPDF (const TVar::Process &process, const TVar::Production &production, const TVar::MatrixElement &matrixElement, const TVar::LeptonInterference &leptonInterf, TVar::event_scales_type *event_scales, MelaIO *RcdME, const double &EBEAM, TVar::VerbosityLevel verbosity)
 
double JHUGenMatEl (const TVar::Process &process, const TVar::Production &production, const TVar::MatrixElement &matrixElement, TVar::event_scales_type *event_scales, MelaIO *RcdME, const double &EBEAM, TVar::VerbosityLevel verbosity)
 
double MadgraphMatEl (const TVar::Process &process, const TVar::Production &production, const TVar::MatrixElement &matrixElement, TVar::event_scales_type *event_scales, MelaIO *RcdME, const double &EBEAM, TVar::VerbosityLevel verbosity)
 
double HJJMatEl (const TVar::Process &process, const TVar::Production &production, const TVar::MatrixElement &matrixElement, TVar::event_scales_type *event_scales, MelaIO *RcdME, const double &EBEAM, TVar::VerbosityLevel verbosity)
 
double VHiggsMatEl (const TVar::Process &process, const TVar::Production &production, const TVar::MatrixElement &matrixElement, TVar::event_scales_type *event_scales, MelaIO *RcdME, const double &EBEAM, bool includeHiggsDecay, TVar::VerbosityLevel verbosity)
 
double TTHiggsMatEl (const TVar::Process &process, const TVar::Production &production, const TVar::MatrixElement &matrixElement, TVar::event_scales_type *event_scales, MelaIO *RcdME, const double &EBEAM, int topDecay, int topProcess, TVar::VerbosityLevel verbosity)
 
double BBHiggsMatEl (const TVar::Process &process, const TVar::Production &production, const TVar::MatrixElement &matrixElement, TVar::event_scales_type *event_scales, MelaIO *RcdME, const double &EBEAM, int botProcess, TVar::VerbosityLevel verbosity)
 
int WipeMEArray (const TVar::Process &process, const TVar::Production &production, const int id[mxpart], double msq[nmsq][nmsq], const TVar::VerbosityLevel &verbosity)
 
bool CheckPartonMomFraction (const TLorentzVector &p0, const TLorentzVector &p1, double xx[2], const double &EBEAM, const TVar::VerbosityLevel &verbosity)
 
void ComputePDF (const TLorentzVector &p0, const TLorentzVector &p1, double fx1[nmsq], double fx2[nmsq], const double &EBEAM, const TVar::VerbosityLevel &verbosity)
 
double SumMEPDF (const TLorentzVector &p0, const TLorentzVector &p1, double msq[nmsq][nmsq], MelaIO *RcdME, const double &EBEAM, const TVar::VerbosityLevel &verbosity)
 
double ResonancePropagator (double const &sqrts, TVar::ResonancePropagatorScheme scheme)
 
void GetBoostedParticleVectors (MELACandidate *melaCand, TVar::simple_event_record &mela_event, TVar::VerbosityLevel verbosity=TVar::DEBUG)
 
MELACandidateConvertVectorFormat (SimpleParticleCollection_t *pDaughters, SimpleParticleCollection_t *pAssociated, SimpleParticleCollection_t *pMothers, bool isGen, std::vector< MELAParticle * > *particleList, std::vector< MELACandidate * > *candList)
 
MELAThreeBodyDecayCandidateConvertThreeBodyDecayCandidate (SimpleParticleCollection_t *tbdDaughters, std::vector< MELAParticle * > *particleList, std::vector< MELAThreeBodyDecayCandidate * > *tbdCandList)
 
void PrintCandidateSummary (MELACandidate *cand)
 
void PrintCandidateSummary (TVar::simple_event_record *cand)
 

Variables

bool forbidMassiveLeptons = true
 Remove fermion mass if the flag is set to true. More...
 
bool forbidMassiveJets = true
 
TVar::FermionMassRemoval LeptonMassScheme = TVar::ConserveDifermionMass
 
TVar::FermionMassRemoval JetMassScheme = TVar::ConserveDifermionMass
 

Function Documentation

◆ adjustTopDaughters()

void TUtil::adjustTopDaughters ( SimpleParticleCollection_t daughters)

Definition at line 134 of file TUtil.cc.

134  { // Daughters are arranged as b, Wf, Wfb
135  if (daughters.size()!=3) return; // Cannot work if the number of daughters is not exactly 3.
136  pair<TLorentzVector, TLorentzVector> corrWpair = TUtil::removeMassFromPair(
137  daughters.at(1).second, daughters.at(1).first,
138  daughters.at(2).second, daughters.at(2).first
139  );
140  daughters.at(1).second = corrWpair.first;
141  daughters.at(2).second = corrWpair.second;
142  TLorentzVector pW = daughters.at(1).second+daughters.at(2).second;
143  TVector3 pW_boost_old = -pW.BoostVector();
144  pair<TLorentzVector, TLorentzVector> corrbW = TUtil::removeMassFromPair(
145  daughters.at(0).second, daughters.at(0).first,
146  pW, -daughters.at(0).first, // Trick the function
147  0., pW.M() // Conserve W mass, ensures Wf+Wfb=W after re-boosting Wf and Wfb to the new W frame.
148  );
149  daughters.at(0).second=corrbW.first;
150  pW=corrbW.second;
151  TVector3 pW_boost_new = pW.BoostVector();
152  for (unsigned int idau=1; idau<daughters.size(); idau++){
153  daughters.at(idau).second.Boost(pW_boost_old);
154  daughters.at(idau).second.Boost(pW_boost_new);
155  }
156 }

◆ applyJetMassCorrection()

void TUtil::applyJetMassCorrection ( bool  flag = true)

Definition at line 38 of file TUtil.cc.

38 { TUtil::forbidMassiveJets = flag; }

◆ applyLeptonMassCorrection()

void TUtil::applyLeptonMassCorrection ( bool  flag = true)

Definition at line 37 of file TUtil.cc.

◆ BBHiggsMatEl()

double TUtil::BBHiggsMatEl ( const TVar::Process process,
const TVar::Production production,
const TVar::MatrixElement matrixElement,
TVar::event_scales_type event_scales,
MelaIO RcdME,
const double &  EBEAM,
int  botProcess,
TVar::VerbosityLevel  verbosity 
)

Definition at line 7827 of file TUtil.cc.

7833  {
7834  const double GeV=1./100.; // JHUGen mom. scale factor
7835  double sum_msqjk = 0;
7836  double MatElsq[nmsq][nmsq]={ { 0 } };
7837  double MatElsq_tmp[nmsq][nmsq]={ { 0 } };
7838 
7839  if (matrixElement!=TVar::JHUGen){ if (verbosity>=TVar::ERROR) MELAerr << "TUtil::BBHiggsMatEl: Non-JHUGen MEs are not supported." << endl; return sum_msqjk; }
7840  if (production!=TVar::bbH){ if (verbosity>=TVar::ERROR) MELAerr << "TUtil::BBHiggsMatEl: Only bbH is supported." << endl; return sum_msqjk; }
7841 
7842  int partIncCode=TVar::kUseAssociated_Jets; // Look for jets
7843  int nRequested_AssociatedJets=2;
7844 
7845  simple_event_record mela_event;
7846  mela_event.AssociationCode=partIncCode;
7847  mela_event.nRequested_AssociatedJets=nRequested_AssociatedJets;
7849  RcdME->melaCand,
7850  mela_event,
7851  verbosity
7852  );
7853 
7854  if (mela_event.pAssociated.size()<2){
7855  if (verbosity>=TVar::ERROR) MELAerr
7856  << "TUtil::BBHiggsMatEl: Number of stable bs (" << mela_event.pAssociated.size() << ")"
7857  <<" in bbH process is not 2!" << endl;
7858  return sum_msqjk;
7859  }
7860 
7861  SimpleParticleCollection_t topDaughters;
7862  SimpleParticleCollection_t antitopDaughters;
7863  bool isUnknown[2]; isUnknown[0]=false; isUnknown[1]=false;
7864 
7865  if (mela_event.pAssociated.at(0).first>=0){ topDaughters.push_back(mela_event.pAssociated.at(0)); isUnknown[0]=(PDGHelpers::isAnUnknownJet(mela_event.pAssociated.at(0).first)); }
7866  else antitopDaughters.push_back(mela_event.pAssociated.at(0));
7867  if (mela_event.pAssociated.at(1).first<=0){ antitopDaughters.push_back(mela_event.pAssociated.at(1)); isUnknown[1]=(PDGHelpers::isAnUnknownJet(mela_event.pAssociated.at(1).first)); }
7868  else topDaughters.push_back(mela_event.pAssociated.at(1));
7869 
7870  // Start assigning the momenta
7871  // 0,1: p1 p2
7872  // 2-4: H,tb,t
7873  // 5-8: bb,W-,f,fb
7874  // 9-12: b,W+,fb,f
7875  double p4[13][4]={ { 0 } };
7876  double MYIDUP_prod[2]={ 0 };
7877  TLorentzVector MomStore[mxpart];
7878  for (int i = 0; i < mxpart; i++) MomStore[i].SetXYZT(0, 0, 0, 0);
7879  for (int ipar=0; ipar<2; ipar++){
7880  TLorentzVector* momTmp = &(mela_event.pMothers.at(ipar).second);
7881  int* idtmp = &(mela_event.pMothers.at(ipar).first);
7882  if (!PDGHelpers::isAnUnknownJet(*idtmp)) MYIDUP_prod[ipar] = *idtmp;
7883  else MYIDUP_prod[ipar] = 0;
7884  if (momTmp->T()>0.){
7885  p4[ipar][0] = -momTmp->T()*GeV;
7886  p4[ipar][1] = -momTmp->X()*GeV;
7887  p4[ipar][2] = -momTmp->Y()*GeV;
7888  p4[ipar][3] = -momTmp->Z()*GeV;
7889  MomStore[ipar] = (*momTmp);
7890  }
7891  else{
7892  p4[ipar][0] = momTmp->T()*GeV;
7893  p4[ipar][1] = momTmp->X()*GeV;
7894  p4[ipar][2] = momTmp->Y()*GeV;
7895  p4[ipar][3] = momTmp->Z()*GeV;
7896  MomStore[ipar] = -(*momTmp);
7897  MYIDUP_prod[ipar] = -MYIDUP_prod[ipar];
7898  }
7899  }
7900 
7901  // Assign b momenta
7902  for (unsigned int ipar=0; ipar<topDaughters.size(); ipar++){
7903  TLorentzVector* momTmp = &(topDaughters.at(ipar).second);
7904  p4[4][0] = momTmp->T()*GeV;
7905  p4[4][1] = momTmp->X()*GeV;
7906  p4[4][2] = momTmp->Y()*GeV;
7907  p4[4][3] = momTmp->Z()*GeV;
7908  MomStore[6] = MomStore[6] + (*momTmp); // MomStore (I1, I2, 0, 0, 0, H, J1, J2)
7909  }
7910 
7911  // Assign bb momenta
7912  for (unsigned int ipar=0; ipar<antitopDaughters.size(); ipar++){
7913  TLorentzVector* momTmp = &(antitopDaughters.at(ipar).second);
7914  p4[3][0] = momTmp->T()*GeV;
7915  p4[3][1] = momTmp->X()*GeV;
7916  p4[3][2] = momTmp->Y()*GeV;
7917  p4[3][3] = momTmp->Z()*GeV;
7918  MomStore[7] = MomStore[7] + (*momTmp); // MomStore (I1, I2, 0, 0, 0, H, J1, J2)
7919  }
7920 
7921  for (unsigned int ipar=0; ipar<mela_event.pDaughters.size(); ipar++){
7922  TLorentzVector* momTmp = &(mela_event.pDaughters.at(ipar).second);
7923  p4[2][0] += momTmp->T()*GeV;
7924  p4[2][1] += momTmp->X()*GeV;
7925  p4[2][2] += momTmp->Y()*GeV;
7926  p4[2][3] += momTmp->Z()*GeV;
7927  MomStore[5] = MomStore[5] + (*momTmp); // i==(2, 3, 4) is (J1, J2, H), recorded as MomStore (I1, I2, 0, 0, 0, H, J1, J2)
7928  }
7929 
7930  if (verbosity >= TVar::DEBUG){
7931  for (int ii=0; ii<13; ii++){ MELAout << "p4[" << ii << "] = "; for (int jj=0; jj<4; jj++) MELAout << p4[ii][jj]/GeV << '\t'; MELAout << endl; }
7932  }
7933 
7934  double defaultRenScale = scale_.scale;
7935  double defaultFacScale = facscale_.facscale;
7936  //MELAout << "Default scales: " << defaultRenScale << '\t' << defaultFacScale << endl;
7937  int defaultNloop = nlooprun_.nlooprun;
7938  int defaultNflav = nflav_.nflav;
7939  string defaultPdflabel = pdlabel_.pdlabel;
7940  double renQ = InterpretScaleScheme(production, matrixElement, event_scales->renomalizationScheme, MomStore);
7941  double facQ = InterpretScaleScheme(production, matrixElement, event_scales->factorizationScheme, MomStore);
7942  SetAlphaS(renQ, facQ, event_scales->ren_scale_factor, event_scales->fac_scale_factor, 1, 5, "cteq6_l");
7943  double alphasVal, alphasmzVal;
7944  GetAlphaS(&alphasVal, &alphasmzVal);
7945  RcdME->setRenormalizationScale(renQ);
7946  RcdME->setFactorizationScale(facQ);
7947  RcdME->setAlphaS(alphasVal);
7948  RcdME->setAlphaSatMZ(alphasmzVal);
7949  RcdME->setHiggsMassWidth(masses_mcfm_.hmass, masses_mcfm_.hwidth, 0);
7951  if (verbosity>=TVar::DEBUG){
7952  MELAout
7953  << "TUtil::BBHiggsMatEl: Set AlphaS:\n"
7954  << "\tBefore set, alphas scale: " << defaultRenScale << ", PDF scale: " << defaultFacScale << '\n'
7955  << "\trenQ: " << renQ << " ( x " << event_scales->ren_scale_factor << "), facQ: " << facQ << " ( x " << event_scales->fac_scale_factor << ")\n"
7956  << "\tAfter set, alphas scale: " << scale_.scale << ", PDF scale: " << facscale_.facscale << ", alphas(Qren): " << alphasVal << ", alphas(MZ): " << alphasmzVal << endl;
7957  }
7958 
7959  __modttbhiggs_MOD_evalxsec_pp_bbbh(p4, &botProcess, MatElsq);
7960  if (isUnknown[0] && isUnknown[1]){
7961  for (unsigned int ix=0; ix<4; ix++) swap(p4[3][ix], p4[4][ix]);
7962  __modttbhiggs_MOD_evalxsec_pp_bbbh(p4, &botProcess, MatElsq_tmp);
7963  for (int ix=0; ix<11; ix++){ for (int iy=0; iy<11; iy++) MatElsq[iy][ix] = (MatElsq[iy][ix]+MatElsq_tmp[iy][ix])/2.; }
7964  }
7965 
7966  int GeVexponent_MEsq = 4-(1+nRequested_AssociatedJets)*2;
7967  double constant = pow(GeV, -GeVexponent_MEsq);
7968  for (int ii=0; ii<nmsq; ii++){ for (int jj=0; jj<nmsq; jj++) MatElsq[jj][ii] *= constant; }
7969  if (verbosity>=TVar::DEBUG){
7970  MELAout << "TUtil::BBHiggsMatEl: MEsq[ip][jp] = " << endl;
7971  for (int iquark=-5; iquark<=5; iquark++){
7972  for (int jquark=-5; jquark<=5; jquark++) MELAout << MatElsq[jquark+5][iquark+5] << '\t';
7973  MELAout << endl;
7974  }
7975  }
7976  sum_msqjk = SumMEPDF(MomStore[0], MomStore[1], MatElsq, RcdME, EBEAM, verbosity);
7977 
7978  if (verbosity>=TVar::DEBUG){
7979  MELAout
7980  << "TUtil::BBHiggsMatEl: Reset AlphaS:\n"
7981  << "\tBefore reset, alphas scale: " << scale_.scale << ", PDF scale: " << facscale_.facscale << endl;
7982  }
7983  SetAlphaS(defaultRenScale, defaultFacScale, 1., 1., defaultNloop, defaultNflav, defaultPdflabel);
7984  if (verbosity>=TVar::DEBUG){
7985  GetAlphaS(&alphasVal, &alphasmzVal);
7986  MELAout
7987  << "TUtil::BBHiggsMatEl: Reset AlphaS result:\n"
7988  << "\tAfter reset, alphas scale: " << scale_.scale << ", PDF scale: " << facscale_.facscale << ", alphas(Qren): " << alphasVal << ", alphas(MZ): " << alphasmzVal << endl;
7989  }
7990  return sum_msqjk;
7991 }

◆ CheckPartonMomFraction()

bool TUtil::CheckPartonMomFraction ( const TLorentzVector &  p0,
const TLorentzVector &  p1,
double  xx[2],
const double &  EBEAM,
const TVar::VerbosityLevel verbosity 
)

Definition at line 8117 of file TUtil.cc.

8117  {
8118  //Make sure parton Level Energy fraction is [0,1]
8119  //phase space function already makes sure the parton energy fraction between [min,1]
8120  xx[0]=p0.P()/EBEAM;
8121  xx[1]=p1.P()/EBEAM;
8122  if (
8123  xx[0]>1. || xx[0]<=xmin_.xmin
8124  ||
8125  xx[1]>1. || xx[1]<=xmin_.xmin
8126  ||
8127  EBEAM<=0.
8128  ){
8129  if (verbosity>=TVar::ERROR){
8130  if (xx[0]>1. || xx[1]>1.) MELAerr << "TUtil::CheckPartonMomFraction: At least one of the parton momentum fractions is greater than 1." << endl;
8131  else if (xx[0]<=xmin_.xmin || xx[1]<=xmin_.xmin) MELAerr << "TUtil::CheckPartonMomFraction: At least one of the parton momentum fractions is less than or equal to " << xmin_.xmin << "." << endl;
8132  else MELAerr << "TUtil::CheckPartonMomFraction: EBEAM=" << EBEAM << "<=0." << endl;
8133  }
8134  return false;
8135  }
8136  else{
8137  if (verbosity>=TVar::DEBUG) MELAout << "TUtil::CheckPartonMomFraction: xx[0]: " << xx[0] << ", xx[1] = " << xx[1] << ", xmin = " << xmin_.xmin << endl;
8138  return true;
8139  }
8140 }

◆ ComplexBoost()

std::pair< TLorentzVector, TLorentzVector > TUtil::ComplexBoost ( TVector3 const &  beta,
TLorentzVector const &  p4 
)

Definition at line 168 of file TUtil.cc.

168  {
169  double bx=beta.X();
170  double by=beta.Y();
171  double bz=beta.Z();
172  double b2 = bx*bx + by*by + bz*bz;
173  double gammasqinv = 1.-b2;
174  double gamma=0.;
175 
176  double bp = bx*p4.X() + by*p4.Y() + bz*p4.Z();
177  double gammap_real=0;
178  double gammap_imag=0;
179  TLorentzVector p4new_real(0, 0, 0, 0), p4new_imag(0, 0, 0, 0);
180  if (gammasqinv>0.){
181  gamma = 1./sqrt(gammasqinv);
182  if (b2>0.) gammap_real = (gamma-1.)/b2;
183 
184  p4new_real.SetX(p4.X() + gammap_real*bp*bx + gamma*bx*p4.T());
185  p4new_real.SetY(p4.Y() + gammap_real*bp*by + gamma*by*p4.T());
186  p4new_real.SetZ(p4.Z() + gammap_real*bp*bz + gamma*bz*p4.T());
187  p4new_real.SetT(gamma*(p4.T() + bp));
188  }
189  else if (gammasqinv<0.){
190  gamma = -1./sqrt(-gammasqinv);
191  if (b2>0.){
192  gammap_real = -1./b2;
193  gammap_imag = gamma/b2;
194  }
195 
196  p4new_real.SetX(p4.X() + gammap_real*bp*bx);
197  p4new_real.SetY(p4.Y() + gammap_real*bp*by);
198  p4new_real.SetZ(p4.Z() + gammap_real*bp*bz);
199  p4new_real.SetT(0.);
200  p4new_imag.SetX(gammap_imag*bp*bx + gamma*bx*p4.T());
201  p4new_imag.SetY(gammap_imag*bp*by + gamma*by*p4.T());
202  p4new_imag.SetZ(gammap_imag*bp*bz + gamma*bz*p4.T());
203  p4new_imag.SetT(gamma*(p4.T() + bp));
204  }
205 
206  return (pair<TLorentzVector, TLorentzVector>(p4new_real, p4new_imag));
207 }

◆ computeAngles()

void TUtil::computeAngles ( float &  costhetastar,
float &  costheta1,
float &  costheta2,
float &  Phi,
float &  Phi1,
TLorentzVector  Z1_lept1,
int  Z1_lept1Id,
TLorentzVector  Z1_lept2,
int  Z1_lept2Id,
TLorentzVector  Z2_lept1,
int  Z2_lept1Id,
TLorentzVector  Z2_lept2,
int  Z2_lept2Id 
)

Compute decay angles from the lepton four-vectors and pdgIds.
Theta1 is the angle corresponding to Z1. Z1_lept1 and Z1_lept2 are supposed to come from the same Z. Leptons are re-ordered internally according to a standard convention: lept1 = negative-charged lepton (for OS pairs).

Definition at line 210 of file TUtil.cc.

220  {
221  TLorentzVector const nullFourVector(0, 0, 0, 0);
222  if (p4M12==nullFourVector || p4M22==nullFourVector){
223  pair<TLorentzVector, TLorentzVector> f13Pair = TUtil::removeMassFromPair(p4M11, Z1_lept1Id, p4M21, Z2_lept1Id);
224  p4M11 = f13Pair.first;
225  p4M21 = f13Pair.second;
226  }
227  else if (p4M11==nullFourVector || p4M21==nullFourVector){
228  pair<TLorentzVector, TLorentzVector> f24Pair = TUtil::removeMassFromPair(p4M12, Z1_lept2Id, p4M22, Z2_lept2Id);
229  p4M12 = f24Pair.first;
230  p4M22 = f24Pair.second;
231  }
232  else{
233  pair<TLorentzVector, TLorentzVector> f12Pair = TUtil::removeMassFromPair(p4M11, Z1_lept1Id, p4M12, Z1_lept2Id);
234  pair<TLorentzVector, TLorentzVector> f34Pair = TUtil::removeMassFromPair(p4M21, Z2_lept1Id, p4M22, Z2_lept2Id);
235  p4M11 = f12Pair.first;
236  p4M12 = f12Pair.second;
237  p4M21 = f34Pair.first;
238  p4M22 = f34Pair.second;
239  }
240 
241  //build Z 4-vectors
242  TLorentzVector p4Z1 = p4M11 + p4M12;
243  TLorentzVector p4Z2 = p4M21 + p4M22;
244 
245  // Sort Z1 leptons so that...
246  if (
247  Z1_lept2Id!=-9000
248  &&
249  (
250  (Z1_lept1Id*Z1_lept2Id<0 && Z1_lept1Id<0) // ...for OS pairs, lep1 is the particle.
251  ||
252  ((Z1_lept1Id*Z1_lept2Id>0 || (Z1_lept1Id==0 && Z1_lept2Id==0)) && p4M11.Phi()<=p4M12.Phi()) // ...for SS pairs, a random deterministic convention is used.
253  )
254  ) swap(p4M11, p4M12);
255  // Same for Z2 leptons
256  if (
257  Z2_lept2Id!=-9000
258  &&
259  (
260  (Z2_lept1Id*Z2_lept2Id<0 && Z2_lept1Id<0)
261  ||
262  ((Z2_lept1Id*Z2_lept2Id>0 || (Z2_lept1Id==0 && Z2_lept2Id==0)) && p4M21.Phi()<=p4M22.Phi())
263  )
264  ) swap(p4M21, p4M22);
265 
266  // BEGIN THE CALCULATION
267 
268  // build H 4-vectors
269  TLorentzVector p4H = p4Z1 + p4Z2;
270 
271  // -----------------------------------
272 
274  TVector3 boostX = -(p4H.BoostVector());
275  TLorentzVector thep4Z1inXFrame(p4Z1);
276  TLorentzVector thep4Z2inXFrame(p4Z2);
277  thep4Z1inXFrame.Boost(boostX);
278  thep4Z2inXFrame.Boost(boostX);
279  TVector3 theZ1X_p3 = thep4Z1inXFrame.Vect();
280  TVector3 theZ2X_p3 = thep4Z2inXFrame.Vect();
281  costhetastar = theZ1X_p3.CosTheta();
282 
283  TVector3 boostV1(0, 0, 0);
284  TVector3 boostV2(0, 0, 0);
286  if (!(fabs(Z1_lept1Id)==21 || fabs(Z1_lept1Id)==22 || fabs(Z1_lept2Id)==21 || fabs(Z1_lept2Id)==22)){
287  boostV1 = -(p4Z1.BoostVector());
288  if (boostV1.Mag()>=1.) {
289  MELAout << "Warning: Mela::computeAngles: Z1 boost with beta=1, scaling down" << endl;
290  boostV1*=0.9999/boostV1.Mag();
291  }
292  TLorentzVector p4M11_BV1(p4M11);
293  TLorentzVector p4M12_BV1(p4M12);
294  TLorentzVector p4M21_BV1(p4M21);
295  TLorentzVector p4M22_BV1(p4M22);
296  p4M11_BV1.Boost(boostV1);
297  p4M12_BV1.Boost(boostV1);
298  p4M21_BV1.Boost(boostV1);
299  p4M22_BV1.Boost(boostV1);
300 
301  TLorentzVector p4V2_BV1 = p4M21_BV1 + p4M22_BV1;
303  costheta1 = -p4V2_BV1.Vect().Unit().Dot(p4M11_BV1.Vect().Unit());
304  }
305  else costheta1 = 0;
306 
308  if (!(fabs(Z2_lept1Id)==21 || fabs(Z2_lept1Id)==22 || fabs(Z2_lept2Id)==21 || fabs(Z2_lept2Id)==22)){
309  boostV2 = -(p4Z2.BoostVector());
310  if (boostV2.Mag()>=1.) {
311  MELAout << "Warning: Mela::computeAngles: Z2 boost with beta=1, scaling down" << endl;
312  boostV2*=0.9999/boostV2.Mag();
313  }
314  TLorentzVector p4M11_BV2(p4M11);
315  TLorentzVector p4M12_BV2(p4M12);
316  TLorentzVector p4M21_BV2(p4M21);
317  TLorentzVector p4M22_BV2(p4M22);
318  p4M11_BV2.Boost(boostV2);
319  p4M12_BV2.Boost(boostV2);
320  p4M21_BV2.Boost(boostV2);
321  p4M22_BV2.Boost(boostV2);
322 
323  TLorentzVector p4V1_BV2 = p4M11_BV2 + p4M12_BV2;
325  costheta2 = -p4V1_BV2.Vect().Unit().Dot(p4M21_BV2.Vect().Unit());
326  }
327  else costheta2 = 0;
328 
330  TLorentzVector p4M11_BX(p4M11);
331  TLorentzVector p4M12_BX(p4M12);
332  TLorentzVector p4M21_BX(p4M21);
333  TLorentzVector p4M22_BX(p4M22);
334 
335  p4M11_BX.Boost(boostX);
336  p4M12_BX.Boost(boostX);
337  p4M21_BX.Boost(boostX);
338  p4M22_BX.Boost(boostX);
339  TLorentzVector p4V1_BX = p4M11_BX + p4M12_BX;
340 
341  TVector3 const beamAxis(0, 0, 1);
342  TVector3 p3V1_BX = p4V1_BX.Vect().Unit();
343  TVector3 normal1_BX = (p4M11_BX.Vect().Cross(p4M12_BX.Vect())).Unit();
344  TVector3 normal2_BX = (p4M21_BX.Vect().Cross(p4M22_BX.Vect())).Unit();
345  TVector3 normalSC_BX = (beamAxis.Cross(p3V1_BX)).Unit();
346 
347 
349  float tmpSgnPhi = p3V1_BX.Dot(normal1_BX.Cross(normal2_BX));
350  float sgnPhi = 0;
351  if (fabs(tmpSgnPhi)>0.) sgnPhi = tmpSgnPhi/fabs(tmpSgnPhi);
352  float dot_BX12 = normal1_BX.Dot(normal2_BX);
353  if (fabs(dot_BX12)>=1.) dot_BX12 *= 1./fabs(dot_BX12);
354  Phi = sgnPhi * acos(-1.*dot_BX12);
355 
356 
358  float tmpSgnPhi1 = p3V1_BX.Dot(normal1_BX.Cross(normalSC_BX));
359  float sgnPhi1 = 0;
360  if (fabs(tmpSgnPhi1)>0.) sgnPhi1 = tmpSgnPhi1/fabs(tmpSgnPhi1);
361  float dot_BX1SC = normal1_BX.Dot(normalSC_BX);
362  if (fabs(dot_BX1SC)>=1.) dot_BX1SC *= 1./fabs(dot_BX1SC);
363  Phi1 = sgnPhi1 * acos(dot_BX1SC);
364 
365  if (isnan(costhetastar) || isnan(costheta1) || isnan(costheta2) || isnan(Phi) || isnan(Phi1)){
366  MELAout << "WARNING: NaN in computeAngles: "
367  << costhetastar << " "
368  << costheta1 << " "
369  << costheta2 << " "
370  << Phi << " "
371  << Phi1 << " " << endl;
372  MELAout << " boostV1: " <<boostV1.Pt() << " " << boostV1.Eta() << " " << boostV1.Phi() << " " << boostV1.Mag() << endl;
373  MELAout << " boostV2: " <<boostV2.Pt() << " " << boostV2.Eta() << " " << boostV2.Phi() << " " << boostV2.Mag() << endl;
374  }
375 }

◆ computeAnglesCS()

void TUtil::computeAnglesCS ( float const &  pbeam,
float &  costhetastar,
float &  costheta1,
float &  costheta2,
float &  Phi,
float &  Phi1,
TLorentzVector  Z1_lept1,
int  Z1_lept1Id,
TLorentzVector  Z1_lept2,
int  Z1_lept2Id,
TLorentzVector  Z2_lept1,
int  Z2_lept1Id,
TLorentzVector  Z2_lept2,
int  Z2_lept2Id 
)

Definition at line 376 of file TUtil.cc.

387  {
388  TLorentzVector const nullFourVector(0, 0, 0, 0);
389  if (p4M12==nullFourVector || p4M22==nullFourVector){
390  pair<TLorentzVector, TLorentzVector> f13Pair = TUtil::removeMassFromPair(p4M11, Z1_lept1Id, p4M21, Z2_lept1Id);
391  p4M11 = f13Pair.first;
392  p4M21 = f13Pair.second;
393  }
394  else if (p4M11==nullFourVector || p4M21==nullFourVector){
395  pair<TLorentzVector, TLorentzVector> f24Pair = TUtil::removeMassFromPair(p4M12, Z1_lept2Id, p4M22, Z2_lept2Id);
396  p4M12 = f24Pair.first;
397  p4M22 = f24Pair.second;
398  }
399  else{
400  pair<TLorentzVector, TLorentzVector> f12Pair = TUtil::removeMassFromPair(p4M11, Z1_lept1Id, p4M12, Z1_lept2Id);
401  pair<TLorentzVector, TLorentzVector> f34Pair = TUtil::removeMassFromPair(p4M21, Z2_lept1Id, p4M22, Z2_lept2Id);
402  p4M11 = f12Pair.first;
403  p4M12 = f12Pair.second;
404  p4M21 = f34Pair.first;
405  p4M22 = f34Pair.second;
406  }
407 
408  TVector3 LabXaxis(1.0, 0.0, 0.0);
409  TVector3 LabYaxis(0.0, 1.0, 0.0);
410  TVector3 LabZaxis(0.0, 0.0, 1.0);
411 
412  float Mprot = 0.938;
413  float Ebeam = sqrt(pbeam*pbeam + Mprot*Mprot);
414 
415  TLorentzVector targ(0., 0., -pbeam, Ebeam);
416  TLorentzVector beam(0., 0., pbeam, Ebeam);
417 
418  //build Z 4-vectors
419  TLorentzVector p4Z1 = p4M11 + p4M12;
420  TLorentzVector p4Z2 = p4M21 + p4M22;
421 
422  // Sort Z1 leptons so that:
423  if (
424  Z1_lept2Id!=9000
425  &&
426  (
427  (Z1_lept1Id*Z1_lept2Id<0 && Z1_lept1Id<0) // for OS pairs: lep1 must be the negative one
428  ||
429  ((Z1_lept1Id*Z1_lept2Id>0 || (Z1_lept1Id==0 && Z1_lept2Id==0)) && p4M11.Phi()<=p4M12.Phi()) //for SS pairs: use random deterministic convention
430  )
431  ) swap(p4M11, p4M12);
432  // Same for Z2 leptons
433  if (
434  Z2_lept2Id!=9000
435  &&
436  (
437  (Z2_lept1Id*Z2_lept2Id<0 && Z2_lept1Id<0)
438  ||
439  ((Z2_lept1Id*Z2_lept2Id>0 || (Z2_lept1Id==0 && Z2_lept2Id==0)) && p4M21.Phi()<=p4M22.Phi())
440  )
441  ) swap(p4M21, p4M22);
442 
443 
444  //build H 4-vectors
445  TLorentzVector p4H = p4Z1 + p4Z2;
446  TVector3 boostX = -(p4H.BoostVector());
447 
449  // Collin-Sopper calculation:
450  // in the CS frame, the z-axis is along the bisectrice of one beam and the opposite of the other beam,
451  // after their boost in X
453  // Rotation for the CS Frame
454 
455  TRotation rotationCS;
456 
457  TLorentzVector beaminX(beam);
458  TLorentzVector targinX(targ);
459  targinX.Boost(boostX);
460  beaminX.Boost(boostX);
461 
462  //Bisectrice: sum of unit vectors (remember: you need to invert one beam vector)
463  TVector3 beam_targ_bisecinX((beaminX.Vect().Unit() - targinX.Vect().Unit()).Unit());
464 
465  // Define a rotationCS Matrix, with Z along the bisectric,
466  TVector3 newZaxisCS(beam_targ_bisecinX.Unit());
467  TVector3 newYaxisCS(beaminX.Vect().Unit().Cross(newZaxisCS).Unit());
468  TVector3 newXaxisCS(newYaxisCS.Unit().Cross(newZaxisCS).Unit());
469  rotationCS.RotateAxes(newXaxisCS, newYaxisCS, newZaxisCS);
470  rotationCS.Invert();
471 
473  TLorentzVector thep4Z1inXFrame_rotCS(p4Z1);
474  TLorentzVector thep4Z2inXFrame_rotCS(p4Z2);
475  thep4Z1inXFrame_rotCS.Transform(rotationCS);
476  thep4Z2inXFrame_rotCS.Transform(rotationCS);
477  thep4Z1inXFrame_rotCS.Boost(boostX);
478  thep4Z2inXFrame_rotCS.Boost(boostX);
479  TVector3 theZ1XrotCS_p3 = TVector3(thep4Z1inXFrame_rotCS.X(), thep4Z1inXFrame_rotCS.Y(), thep4Z1inXFrame_rotCS.Z());
480  costhetastar = theZ1XrotCS_p3.CosTheta();
481 
483  // TVector3 boostX = -(thep4H.BoostVector());
484  TLorentzVector p4M11_BX_rotCS(p4M11);
485  TLorentzVector p4M12_BX_rotCS(p4M12);
486  TLorentzVector p4M21_BX_rotCS(p4M21);
487  TLorentzVector p4M22_BX_rotCS(p4M22);
488  p4M11_BX_rotCS.Transform(rotationCS);
489  p4M12_BX_rotCS.Transform(rotationCS);
490  p4M21_BX_rotCS.Transform(rotationCS);
491  p4M22_BX_rotCS.Transform(rotationCS);
492  p4M11_BX_rotCS.Boost(boostX);
493  p4M12_BX_rotCS.Boost(boostX);
494  p4M21_BX_rotCS.Boost(boostX);
495  p4M22_BX_rotCS.Boost(boostX);
496 
497  TLorentzVector p4Z1_BX_rotCS = p4M11_BX_rotCS + p4M12_BX_rotCS;
498  TVector3 p3V1_BX_rotCS = (p4Z1_BX_rotCS.Vect()).Unit();
499  TVector3 const beamAxis(0, 0, 1);
500  TVector3 normal1_BX_rotCS = (p4M11_BX_rotCS.Vect().Cross(p4M12_BX_rotCS.Vect())).Unit();
501  TVector3 normal2_BX_rotCS = (p4M21_BX_rotCS.Vect().Cross(p4M22_BX_rotCS.Vect())).Unit();
502  TVector3 normalSC_BX_rotCS = (beamAxis.Cross(p3V1_BX_rotCS)).Unit();
503 
505  float tmpSgnPhi = p3V1_BX_rotCS.Dot(normal1_BX_rotCS.Cross(normal2_BX_rotCS));
506  float sgnPhi = 0;
507  if (fabs(tmpSgnPhi)>0.) sgnPhi = tmpSgnPhi/fabs(tmpSgnPhi);
508  float dot_BX12 = normal1_BX_rotCS.Dot(normal2_BX_rotCS);
509  if (fabs(dot_BX12)>=1.) dot_BX12 *= 1./fabs(dot_BX12);
510  Phi = sgnPhi * acos(-1.*dot_BX12);
511 
513  float tmpSgnPhi1 = p3V1_BX_rotCS.Dot(normal1_BX_rotCS.Cross(normalSC_BX_rotCS));
514  float sgnPhi1 = 0;
515  if (fabs(tmpSgnPhi1)>0.) sgnPhi1 = tmpSgnPhi1/fabs(tmpSgnPhi1);
516  float dot_BX1SC = normal1_BX_rotCS.Dot(normalSC_BX_rotCS);
517  if (fabs(dot_BX1SC)>=1.) dot_BX1SC *= 1./fabs(dot_BX1SC);
518  Phi1 = sgnPhi1 * acos(dot_BX1SC);
519 
521  if (!(fabs(Z1_lept1Id)==21 || fabs(Z1_lept1Id)==22 || fabs(Z1_lept2Id)==21 || fabs(Z1_lept2Id)==22)){
522  //define Z1 rotation
523  TRotation rotationZ1;
524  TVector3 newZaxisZ1(thep4Z1inXFrame_rotCS.Vect().Unit());
525  TVector3 newXaxisZ1(newYaxisCS.Cross(newZaxisZ1).Unit());
526  TVector3 newYaxisZ1(newZaxisZ1.Cross(newXaxisZ1).Unit());
527  rotationZ1.RotateAxes(newXaxisZ1, newYaxisZ1, newZaxisZ1);
528  rotationZ1.Invert();
529 
530  TLorentzVector thep4Z1inXFrame_rotCS_rotZ1(thep4Z1inXFrame_rotCS);
531  thep4Z1inXFrame_rotCS_rotZ1.Transform(rotationZ1);
532  TVector3 boostZ1inX_rotCS_rotZ1= -(thep4Z1inXFrame_rotCS_rotZ1.BoostVector());
533 
534  TLorentzVector p4M11_BX_rotCS_rotZ1(p4M11_BX_rotCS);
535  TLorentzVector p4M12_BX_rotCS_rotZ1(p4M12_BX_rotCS);
536  TLorentzVector p4M21_BX_rotCS_rotZ1(p4M21_BX_rotCS);
537  TLorentzVector p4M22_BX_rotCS_rotZ1(p4M22_BX_rotCS);
538  p4M11_BX_rotCS_rotZ1.Transform(rotationZ1);
539  p4M12_BX_rotCS_rotZ1.Transform(rotationZ1);
540  p4M21_BX_rotCS_rotZ1.Transform(rotationZ1);
541  p4M22_BX_rotCS_rotZ1.Transform(rotationZ1);
542  p4M11_BX_rotCS_rotZ1.Boost(boostZ1inX_rotCS_rotZ1);
543  p4M12_BX_rotCS_rotZ1.Boost(boostZ1inX_rotCS_rotZ1);
544  p4M21_BX_rotCS_rotZ1.Boost(boostZ1inX_rotCS_rotZ1);
545  p4M22_BX_rotCS_rotZ1.Boost(boostZ1inX_rotCS_rotZ1);
546 
547  TLorentzVector p4V2_BX_rotCS_rotZ1 = p4M21_BX_rotCS_rotZ1 + p4M22_BX_rotCS_rotZ1;
549  costheta1 = -p4V2_BX_rotCS_rotZ1.Vect().Dot(p4M11_BX_rotCS_rotZ1.Vect())/p4V2_BX_rotCS_rotZ1.Vect().Mag()/p4M11_BX_rotCS_rotZ1.Vect().Mag();
550  }
551  else costheta1=0;
552 
554  if (!(fabs(Z2_lept1Id)==21 || fabs(Z2_lept1Id)==22 || fabs(Z2_lept2Id)==21 || fabs(Z2_lept2Id)==22)){
555  //define Z2 rotation
556  TRotation rotationZ2;
557  TVector3 newZaxisZ2(thep4Z2inXFrame_rotCS.Vect().Unit());
558  TVector3 newXaxisZ2(newYaxisCS.Cross(newZaxisZ2).Unit());
559  TVector3 newYaxisZ2(newZaxisZ2.Cross(newXaxisZ2).Unit());
560  rotationZ2.RotateAxes(newXaxisZ2, newYaxisZ2, newZaxisZ2);
561  rotationZ2.Invert();
562 
563  TLorentzVector thep4Z2inXFrame_rotCS_rotZ2(thep4Z2inXFrame_rotCS);
564  thep4Z2inXFrame_rotCS_rotZ2.Transform(rotationZ2);
565  TVector3 boostZ2inX_rotCS_rotZ2= -(thep4Z2inXFrame_rotCS_rotZ2.BoostVector());
566 
567  TLorentzVector p4M11_BX_rotCS_rotZ2(p4M11_BX_rotCS);
568  TLorentzVector p4M12_BX_rotCS_rotZ2(p4M12_BX_rotCS);
569  TLorentzVector p4M21_BX_rotCS_rotZ2(p4M21_BX_rotCS);
570  TLorentzVector p4M22_BX_rotCS_rotZ2(p4M22_BX_rotCS);
571  p4M11_BX_rotCS_rotZ2.Transform(rotationZ2);
572  p4M12_BX_rotCS_rotZ2.Transform(rotationZ2);
573  p4M21_BX_rotCS_rotZ2.Transform(rotationZ2);
574  p4M22_BX_rotCS_rotZ2.Transform(rotationZ2);
575  p4M11_BX_rotCS_rotZ2.Boost(boostZ2inX_rotCS_rotZ2);
576  p4M12_BX_rotCS_rotZ2.Boost(boostZ2inX_rotCS_rotZ2);
577  p4M21_BX_rotCS_rotZ2.Boost(boostZ2inX_rotCS_rotZ2);
578  p4M22_BX_rotCS_rotZ2.Boost(boostZ2inX_rotCS_rotZ2);
579 
580 
581  TLorentzVector p4V1_BX_rotCS_rotZ2= p4M11_BX_rotCS_rotZ2 + p4M12_BX_rotCS_rotZ2;
583  costheta2 = -p4V1_BX_rotCS_rotZ2.Vect().Dot(p4M21_BX_rotCS_rotZ2.Vect())/p4V1_BX_rotCS_rotZ2.Vect().Mag()/p4M21_BX_rotCS_rotZ2.Vect().Mag();
584  }
585  else costheta2=0;
586 
587  if (isnan(costhetastar) || isnan(costheta1) || isnan(costheta2) || isnan(Phi) || isnan(Phi1)){
588  MELAout << "WARNING: NaN in computeAngles: "
589  << costhetastar << " "
590  << costheta1 << " "
591  << costheta2 << " "
592  << Phi << " "
593  << Phi1 << " " << endl;
594  }
595 }

◆ computeFakeJet()

void TUtil::computeFakeJet ( TLorentzVector const &  realJet,
TLorentzVector const &  others,
TLorentzVector &  fakeJet 
)

Definition at line 158 of file TUtil.cc.

158  {
159  TLorentzVector masslessRealJet(0, 0, 0, 0);
160  if (TUtil::forbidMassiveJets) TUtil::scaleMomentumToEnergy(realJet, masslessRealJet);
161  else masslessRealJet = realJet;
162  fakeJet = others + masslessRealJet;
163  fakeJet.SetVect(-fakeJet.Vect());
164  fakeJet.SetE(fakeJet.P());
165 }

◆ ComputePDF()

void TUtil::ComputePDF ( const TLorentzVector &  p0,
const TLorentzVector &  p1,
double  fx1[nmsq],
double  fx2[nmsq],
const double &  EBEAM,
const TVar::VerbosityLevel verbosity 
)

Definition at line 8142 of file TUtil.cc.

8142  {
8143  if (verbosity>=TVar::DEBUG) MELAout << "Begin TUtil::ComputePDF"<< endl;
8144  double xx[2]={ 0 };
8145  if (CheckPartonMomFraction(p0, p1, xx, EBEAM, verbosity)){
8147  double fx1x2_jhu[2][13]={ { 0 } };
8148  if (verbosity>=TVar::DEBUG) MELAout << "TUtil::ComputePDF: Calling setpdfs with xx[0]: " << xx[0] << ", xx[1] = " << xx[1] << endl;
8149  __modkinematics_MOD_setpdfs(&(xx[0]), &(xx[1]), fx1x2_jhu);
8150  if (verbosity>=TVar::DEBUG) MELAout << "TUtil::ComputePDF: called"<< endl;
8151  for (int ip=-6; ip<=6; ip++){
8152  // JHUGen assignment is in JHU id coventions (up <-> down, g==g)
8153  int fac=0;
8154  if (ip!=0 && (abs(ip)%2==0)) fac=-1;
8155  else if (ip!=0) fac=+1;
8156  if (ip<0) fac=-fac;
8157  int jp=ip+fac;
8158  fx1[jp+5]=fx1x2_jhu[0][ip+6];
8159  fx2[jp+5]=fx1x2_jhu[1][ip+6];
8160  }
8161  /*
8163  //Calculate Pdf
8164  //Parton Density Function is always evalualted at pT=0 frame
8165  //Always pass address through fortran function
8166  fdist_(&density_.ih1, &xx[0], &facscale_.facscale, fx1);
8167  fdist_(&density_.ih2, &xx[1], &facscale_.facscale, fx2);
8168  */
8169  }
8170  if (verbosity>=TVar::DEBUG){
8171  MELAout << "End TUtil::ComputePDF:"<< endl;
8172  for (int ip=-nf; ip<=nf; ip++) MELAout << "(fx1, fx2)[" << ip << "] = (" << fx1[ip+5] << " , " << fx2[ip+5] << ")" << endl;
8173  }
8174 }

◆ computeTTHAngles()

void TUtil::computeTTHAngles ( float &  hs,
float &  hincoming,
float &  hTT,
float &  PhiTT,
float &  Phi1,
float &  hbb,
float &  hWW,
float &  Phibb,
float &  Phi1bb,
float &  hWplusf,
float &  PhiWplusf,
float &  hWminusf,
float &  PhiWminusf,
TLorentzVector  p4M11,
int  Z1_lept1Id,
TLorentzVector  p4M12,
int  Z1_lept2Id,
TLorentzVector  p4M21,
int  Z2_lept1Id,
TLorentzVector  p4M22,
int  Z2_lept2Id,
TLorentzVector  b,
int  bId,
TLorentzVector  Wplusf,
int  WplusfId,
TLorentzVector  Wplusfb,
int  WplusfbId,
TLorentzVector  bbar,
int  bbarId,
TLorentzVector  Wminusf,
int  WminusfId,
TLorentzVector  Wminusfb,
int  WminusfbId,
TLorentzVector *  injet1 = 0,
int  injet1Id = 0,
TLorentzVector *  injet2 = 0,
int  injet2Id = 0 
)

Definition at line 991 of file TUtil.cc.

1025  {
1026  TLorentzVector const nullFourVector(0, 0, 0, 0);
1027  TVector3 const beamAxis(0, 0, 1);
1028  TVector3 const xAxis(1, 0, 0);
1029 
1030  // Initialize output values
1031  hs=hincoming=hTT=PhiTT=Phi1
1032  =hbb=hWW=Phibb=Phi1bb
1033  =hWplusf=PhiWplusf
1034  =hWminusf=PhiWminusf=0;
1035  if (
1036  bId!=-9000 && !(PDGHelpers::isATopQuark(bId) || PDGHelpers::isATauLepton(bId)) && WplusfId==-9000 && WplusfbId==-9000
1037  &&
1038  bbarId!=-9000 && !(PDGHelpers::isATopQuark(bbarId) || PDGHelpers::isATauLepton(bbarId)) && WminusfId==-9000 && WminusfbId==-9000
1039  ){
1040  float m1_dummy=0, m2_dummy=0;
1041  return TUtil::computeVHAngles(
1042  hs, hincoming, hTT, PhiTT, Phi1,
1043  m1_dummy, m2_dummy,
1044  p4M11, Z1_lept1Id,
1045  p4M12, Z1_lept2Id,
1046  p4M21, Z2_lept1Id,
1047  p4M22, Z2_lept2Id,
1048  b, bId,
1049  bbar, bbarId,
1050  injet1, injet1Id,
1051  injet2, injet2Id
1052  );
1053  }
1054 
1055  // Swap Wplus daughters if needed
1056  if (
1057  WplusfId!=-9000 && WplusfbId!=-9000
1058  &&
1059  (
1060  (WplusfId*WplusfbId<0 && WplusfId<0) // for OS pairs: Wplusf must be the particle
1061  ||
1062  ((WplusfId*WplusfbId>0 || (WplusfId==0 && WplusfbId==0)) && Wplusf.Phi()<=Wplusfb.Phi()) // for SS pairs: use random deterministic convention
1063  )
1064  ){
1065  swap(Wplusf, Wplusfb);
1066  swap(WplusfId, WplusfbId);
1067  }
1068  // Swap Wminus daughters if needed
1069  if (
1070  WminusfId!=-9000 && WminusfbId!=-9000
1071  &&
1072  (
1073  (WminusfId*WminusfbId<0 && WminusfId<0) // for OS pairs: Wminusf must be the particle
1074  ||
1075  ((WminusfId*WminusfbId>0 || (WminusfId==0 && WminusfbId==0)) && Wminusf.Phi()<=Wminusfb.Phi()) // for SS pairs: use random deterministic convention
1076  )
1077  ){
1078  swap(Wminusf, Wminusfb);
1079  swap(WminusfId, WminusfbId);
1080  }
1081 
1082  // Correct the T daughters
1083  if (bId!=-9000 && WplusfId!=-9000 && WplusfbId!=-9000){
1084  SimpleParticleCollection_t tmp_daus;
1085  tmp_daus.reserve(3);
1086  tmp_daus.emplace_back(bId, b);
1087  tmp_daus.emplace_back(WplusfId, Wplusf);
1088  tmp_daus.emplace_back(WplusfbId, Wplusfb);
1089  TUtil::adjustTopDaughters(tmp_daus);
1090  b = tmp_daus.at(0).second;
1091  Wplusf = tmp_daus.at(1).second;
1092  Wplusfb = tmp_daus.at(2).second;
1093  }
1094  else if (WplusfId!=-9000 && WplusfbId!=-9000){
1095  pair<TLorentzVector, TLorentzVector> Wffb = TUtil::removeMassFromPair(Wplusf, WplusfId, Wplusfb, WplusfbId);
1096  Wplusf = Wffb.first;
1097  Wplusfb = Wffb.second;
1098  }
1099  // Correct the TBar daughters
1100  if (bbarId!=-9000 && WminusfId!=-9000 && WminusfbId!=-9000){
1101  SimpleParticleCollection_t tmp_daus;
1102  tmp_daus.reserve(3);
1103  tmp_daus.emplace_back(bbarId, bbar);
1104  tmp_daus.emplace_back(WminusfId, Wminusf);
1105  tmp_daus.emplace_back(WminusfbId, Wminusfb);
1106  TUtil::adjustTopDaughters(tmp_daus);
1107  bbar = tmp_daus.at(0).second;
1108  Wminusf = tmp_daus.at(1).second;
1109  Wminusfb = tmp_daus.at(2).second;
1110  }
1111  else if (WminusfId!=-9000 && WminusfbId!=-9000){
1112  pair<TLorentzVector, TLorentzVector> Wffb = TUtil::removeMassFromPair(Wminusf, WminusfId, Wminusfb, WminusfbId);
1113  Wminusf = Wffb.first;
1114  Wminusfb = Wffb.second;
1115  }
1116  // If the Ws are not present but the bs are, the masses of the bs should not be removed. This is because the bs are now either tops or taus (based on the similar if-statement above).
1117 
1118  // Build Z 4-vectors
1119  TLorentzVector p4Z1 = p4M11 + p4M12;
1120  TLorentzVector p4Z2 = p4M21 + p4M22;
1121  // No longer need to use p4Mxy
1122  TLorentzVector pH = p4Z1 + p4Z2;
1123 
1124  TLorentzVector pWplus = Wplusf + Wplusfb;
1125  TLorentzVector pTop = b + pWplus;
1126 
1127  TLorentzVector pWminus = Wminusf + Wminusfb;
1128  TLorentzVector pATop = bbar + pWminus;
1129 
1130  TLorentzVector pTT = pTop + pATop;
1131  TLorentzVector pTTH = pTT + pH;
1132 
1133  //Find the incoming partons - first boost so the pT(TTH) = 0, then boost away the pz.
1134  //This preserves the z direction.
1135  //Then, assume that the partons come in this z direction.
1136  //This is exactly correct at LO (since pT=0 anyway).
1137  //Then associate the one going forwards with jet1 and the one going backwards with jet2
1138  TLorentzRotation movingframe;
1139  TLorentzVector pTTH_perp(pTTH.X(), pTTH.Y(), 0, pTTH.T());
1140  movingframe.Boost(-pTTH_perp.BoostVector());
1141  pTTH.Boost(-pTTH_perp.BoostVector());
1142  movingframe.Boost(-pTTH.BoostVector());
1143  pTTH.Boost(-pTTH.BoostVector()); //make sure to boost TTH AFTER boosting movingframe
1144 
1145  TLorentzVector P1(0, 0, -pTTH.T()/2, pTTH.T()/2);
1146  TLorentzVector P2(0, 0, pTTH.T()/2, pTTH.T()/2);
1147  // Transform incoming partons back to the original frame
1148  P1.Transform(movingframe.Inverse());
1149  P2.Transform(movingframe.Inverse());
1150  pTTH.Transform(movingframe.Inverse());
1151  // movingframe and TTH_T will not be used anymore
1152  // Handle gen. partons if they are available
1153  if (injet1 && injet2 && fabs((*injet1+*injet2).P()-pTTH.P())<pTTH.P()*1e-4){
1154  P1=*injet1;
1155  P2=*injet2;
1156  // Apply convention for incoming (!) particles
1157  if (
1158  (injet1Id*injet2Id<0 && injet1Id>0) // for OS pairs: parton 2 must be the particle
1159  ||
1160  (injet1Id*injet2Id>0 && P1.Z()>=P2.Z()) //for SS pairs: parton 2 must have the greater pz
1161  ){
1162  swap(P1, P2);
1163  swap(injet1Id, injet2Id);
1164  }
1165  }
1166 
1167  // Rotate every vector such that Z1 - Z2 axis is the "beam axis" analogue of decay
1168  TLorentzRotation ZZframe;
1169  bool applyZZframe=false;
1170  if (p4Z1==nullFourVector || p4Z2==nullFourVector){ // Higgs is undecayed
1171  TVector3 pNewAxis = (p4Z2-p4Z1).Vect().Unit(); // Let Z2 be in the z direction so that once the direction of H is reversed, Z1 is in the z direction
1172  if (pNewAxis != nullFourVector.Vect()){
1173  TVector3 pNewAxisPerp = pNewAxis.Cross(beamAxis);
1174  ZZframe.Rotate(acos(pNewAxis.Dot(beamAxis)), pNewAxisPerp);
1175  applyZZframe=true;
1176  }
1177  }
1178  else{
1179  TVector3 pHboost = pH.BoostVector();
1180  ZZframe.Boost(-pHboost);
1181  p4Z1.Boost(-pHboost);
1182  p4Z2.Boost(-pHboost);
1183  TVector3 pNewAxis = (p4Z2-p4Z1).Vect().Unit(); // Let Z2 be in the z direction so that once the direction of H is reversed, Z1 is in the z direction
1184  TVector3 pNewAxisPerp = pNewAxis.Cross(beamAxis);
1185  ZZframe.Rotate(acos(pNewAxis.Dot(beamAxis)), pNewAxisPerp);
1186  // Boost p4Z1 and p4Z2 back so that you can apply the transformation separately
1187  p4Z1.Boost(pHboost);
1188  p4Z2.Boost(pHboost);
1189  applyZZframe=true;
1190  }
1191  if (applyZZframe){
1192  P1.Transform(ZZframe); P2.Transform(ZZframe);
1193  p4Z1 = -p4Z1; p4Z1.Transform(ZZframe); p4Z1 = -p4Z1;
1194  p4Z2 = -p4Z2; p4Z2.Transform(ZZframe); p4Z2 = -p4Z2;
1195  b = -b; b.Transform(ZZframe); b = -b;
1196  Wplusf = -Wplusf; Wplusf.Transform(ZZframe); Wplusf = -Wplusf;
1197  Wplusfb = -Wplusfb; Wplusfb.Transform(ZZframe); Wplusfb = -Wplusfb;
1198  bbar = -bbar; bbar.Transform(ZZframe); bbar = -bbar;
1199  Wminusf = -Wminusf; Wminusf.Transform(ZZframe); Wminusf = -Wminusf;
1200  Wminusfb = -Wminusfb; Wminusfb.Transform(ZZframe); Wminusfb = -Wminusfb;
1201  }
1202  // Re-assign derived momenta
1203  pH = p4Z1 + p4Z2;
1204  pWplus = Wplusf + Wplusfb;
1205  pTop = b + pWplus;
1206  pWminus = Wminusf + Wminusfb;
1207  pATop = bbar + pWminus;
1208  pTT = pTop + pATop;
1209  pTTH = pTT + pH;
1210 
1212  hs,
1213  hincoming,
1214  hTT,
1215  PhiTT,
1216  Phi1,
1217  -P1, 23, // Id is 23 to avoid an attempt to remove quark mass
1218  -P2, 0, // Id is 0 to avoid swapping
1219  pTop, 23,
1220  pATop, 0
1221  );
1222 
1223  // Boost everything to Higgs frame AFTER ttH-frame angle computations
1224  // This is to avoid an undetermined z axis in the above angles when Higgs is undecayed
1225  {
1226  TVector3 pHboost = pH.BoostVector();
1227 
1228  P1.Boost(-pHboost);
1229  P2.Boost(-pHboost);
1230  // No need for Z1 and Z2
1231  //p4Z1.Boost(-pHboost);
1232  //p4Z2.Boost(-pHboost);
1233  b.Boost(-pHboost);
1234  Wplusf.Boost(-pHboost);
1235  Wplusfb.Boost(-pHboost);
1236  bbar.Boost(-pHboost);
1237  Wminusf.Boost(-pHboost);
1238  Wminusfb.Boost(-pHboost);
1239 
1240  // Re-assign derived momenta
1241  // No need for the Higgs in Higgs frame
1242  //pH = p4Z1 + p4Z2;
1243  pWplus = Wplusf + Wplusfb;
1244  pTop = b + pWplus;
1245  pWminus = Wminusf + Wminusfb;
1246  pATop = bbar + pWminus;
1247  pTT = pTop + pATop;
1248  // No need for the TTH system in Higgs frame
1249  //pTTH = pTT + pH;
1250  }
1251 
1252  {
1253  TLorentzRotation TTframe;
1254 
1255  // z rotation
1256  TVector3 nNewZAxis = (-P1-P2-pTop-pATop).Vect().Unit(); // Let the z axis be formed by the (-P1-P2)--TT axis in the Higgs frame
1257  if (nNewZAxis != nullFourVector.Vect()){
1258  TVector3 nNewZAxisPerp = nNewZAxis.Cross(beamAxis);
1259  TTframe.Rotate(acos(nNewZAxis.Dot(beamAxis)), nNewZAxisPerp);
1260  }
1261 
1262  P1.Transform(TTframe);
1263  P2.Transform(TTframe);
1264  b.Transform(TTframe);
1265  Wplusf.Transform(TTframe);
1266  Wplusfb.Transform(TTframe);
1267  bbar.Transform(TTframe);
1268  Wminusf.Transform(TTframe);
1269  Wminusfb.Transform(TTframe);
1270 
1271  // Re-assign derived momenta
1272  pWplus = Wplusf + Wplusfb;
1273  pTop = b + pWplus;
1274  pWminus = Wminusf + Wminusfb;
1275  pATop = bbar + pWminus;
1276  }
1277 
1278  // Compute TT angles
1279  {
1280  float hs_dummy;
1281  int id_dummy_Wplus=24;
1282  int id_dummy_Wminus=-24;
1283  if (WplusfId!=-9000 && WplusfbId!=-9000) id_dummy_Wplus=-9000;
1284  if (WminusfId!=-9000 && WminusfbId!=-9000) id_dummy_Wminus=-9000;
1286  hs_dummy,
1287  hbb,
1288  hWW,
1289  Phibb, // -\Phi_b from arxiv:1606.03107
1290  Phi1bb, // This angle is the one between the bb plane and the TT-H plane instead of that between the WW plane and the TT-H plane as defined in arxiv:1606.03107.
1291  b, bId,
1292  bbar, bbarId,
1293  pWplus, id_dummy_Wplus,
1294  pWminus, id_dummy_Wminus
1295  );
1296  }
1297 
1298  // Wplus frame
1299  if (WplusfId!=-9000 && WplusfbId!=-9000){
1300  TLorentzVector pATop_tmp = pATop;
1301  TVector3 pWplus_boost = (Wplusf+Wplusfb).BoostVector();
1302  b.Boost(-pWplus_boost);
1303  Wplusf.Boost(-pWplus_boost);
1304  Wplusfb.Boost(-pWplus_boost);
1305  pATop_tmp.Boost(-pWplus_boost);
1306 
1307  TLorentzRotation Wplusframe;
1308 
1309  // z rotation
1310  TVector3 nNewZAxis = (b+Wplusf+Wplusfb-pATop_tmp).Vect().Unit(); // Let the z axis be formed by the TBar direction
1311  if (nNewZAxis != nullFourVector.Vect()){
1312  TVector3 nNewZAxisPerp = nNewZAxis.Cross(beamAxis);
1313  Wplusframe.Rotate(acos(nNewZAxis.Dot(beamAxis)), nNewZAxisPerp);
1314  }
1315 
1316  b.Transform(Wplusframe);
1317  Wplusf.Transform(Wplusframe);
1318  Wplusfb.Transform(Wplusframe);
1319 
1320  TVector3 n3_Wb = -b.Vect().Unit();
1321  TVector3 nW = ((Wplusf-Wplusfb).Vect().Cross(n3_Wb)).Unit();
1322  TVector3 nS = (beamAxis.Cross(n3_Wb)).Unit();
1323 
1324  // hWplusf
1325  hWplusf = n3_Wb.Dot(Wplusf.Vect().Unit());
1326  // PhiWplusf
1327  float tmpSgnPhiWplusf = n3_Wb.Dot(nW.Cross(nS));
1328  float sgnPhiWplusf = 0;
1329  if (fabs(tmpSgnPhiWplusf)>0.) sgnPhiWplusf = tmpSgnPhiWplusf/fabs(tmpSgnPhiWplusf);
1330  float dot_nWnS = nW.Dot(nS);
1331  if (fabs(dot_nWnS)>=1.) dot_nWnS *= 1./fabs(dot_nWnS);
1332  PhiWplusf = sgnPhiWplusf * acos(dot_nWnS);
1333  /*
1334  b.Transform(Wplusframe.Inverse());
1335  Wplusf.Transform(Wplusframe.Inverse());
1336  Wplusfb.Transform(Wplusframe.Inverse());
1337  */
1338  }
1339 
1340  // Wminus frame
1341  if (WminusfId!=-9000 && WminusfbId!=-9000){
1342  TLorentzVector pTop_tmp = pTop;
1343  TVector3 pWminus_boost = (Wminusf+Wminusfb).BoostVector();
1344  bbar.Boost(-pWminus_boost);
1345  Wminusf.Boost(-pWminus_boost);
1346  Wminusfb.Boost(-pWminus_boost);
1347  pTop_tmp.Boost(-pWminus_boost);
1348 
1349  TLorentzRotation Wminusframe;
1350 
1351  // z rotation
1352  TVector3 nNewZAxis = (pTop_tmp-bbar-Wminusf-Wminusfb).Vect().Unit(); // Let the z axis be formed by the T direction
1353  if (nNewZAxis != nullFourVector.Vect()){
1354  TVector3 nNewZAxisPerp = nNewZAxis.Cross(beamAxis);
1355  Wminusframe.Rotate(acos(nNewZAxis.Dot(beamAxis)), nNewZAxisPerp);
1356  }
1357 
1358  bbar.Transform(Wminusframe);
1359  Wminusf.Transform(Wminusframe);
1360  Wminusfb.Transform(Wminusframe);
1361 
1362  TVector3 n3_Wb = -bbar.Vect().Unit();
1363  TVector3 nW = ((Wminusf-Wminusfb).Vect().Cross(n3_Wb)).Unit();
1364  TVector3 nS = (beamAxis.Cross(n3_Wb)).Unit();
1365 
1366  // hWminusf
1367  hWminusf = n3_Wb.Dot(Wminusf.Vect().Unit());
1368  // PhiWminusf
1369  float tmpSgnPhiWminusf = n3_Wb.Dot(nW.Cross(nS));
1370  float sgnPhiWminusf = 0;
1371  if (fabs(tmpSgnPhiWminusf)>0.) sgnPhiWminusf = tmpSgnPhiWminusf/fabs(tmpSgnPhiWminusf);
1372  float dot_nWnS = nW.Dot(nS);
1373  if (fabs(dot_nWnS)>=1.) dot_nWnS *= 1./fabs(dot_nWnS);
1374  PhiWminusf = sgnPhiWminusf * acos(dot_nWnS);
1375  /*
1376  bbar.Transform(Wminusframe.Inverse());
1377  Wminusf.Transform(Wminusframe.Inverse());
1378  Wminusfb.Transform(Wminusframe.Inverse());
1379  */
1380  }
1381 }

◆ computeVBFAngles()

void TUtil::computeVBFAngles ( float &  costhetastar,
float &  costheta1,
float &  costheta2,
float &  Phi,
float &  Phi1,
float &  Q2V1,
float &  Q2V2,
TLorentzVector  p4M11,
int  Z1_lept1Id,
TLorentzVector  p4M12,
int  Z1_lept2Id,
TLorentzVector  p4M21,
int  Z2_lept1Id,
TLorentzVector  p4M22,
int  Z2_lept2Id,
TLorentzVector  jet1,
int  jet1Id,
TLorentzVector  jet2,
int  jet2Id,
TLorentzVector *  injet1 = 0,
int  injet1Id = 0,
TLorentzVector *  injet2 = 0,
int  injet2Id = 0 
)

Definition at line 598 of file TUtil.cc.

614  {
615  TLorentzVector const nullFourVector(0, 0, 0, 0);
616 
617  TLorentzVector jet1massless, jet2massless;
618  pair<TLorentzVector, TLorentzVector> jetPair = TUtil::removeMassFromPair(jet1, jet1Id, jet2, jet2Id);
619  jet1massless = jetPair.first;
620  jet2massless = jetPair.second;
621 
622  //build Z 4-vectors
623  TLorentzVector p4Z1 = p4M11 + p4M12;
624  TLorentzVector p4Z2 = p4M21 + p4M22;
625  TLorentzVector pH = p4Z1+p4Z2;
626  //jet1 is defined as going forwards (bigger pz), jet2 going backwards (smaller pz)
627  if (jet1massless.Z() < jet2massless.Z()) { swap(jet1massless, jet2massless); swap(jet1Id, jet2Id); }
628 
629  //Find the incoming partons - first boost so the pT(HJJ) = 0, then boost away the pz.
630  //This preserves the z direction. Then assume that the partons come in this z direction.
631  //This is exactly correct at LO (since pT=0 anyway).
632  //Then associate the one going forwards with jet1 and the one going backwards with jet2
633  TLorentzRotation movingframe;
634  TLorentzVector pHJJ = pH+jet1massless+jet2massless;
635  TLorentzVector pHJJ_perp(pHJJ.X(), pHJJ.Y(), 0, pHJJ.T());
636  movingframe.Boost(-pHJJ_perp.BoostVector());
637  pHJJ.Boost(-pHJJ_perp.BoostVector());
638  movingframe.Boost(-pHJJ.BoostVector());
639  pHJJ.Boost(-pHJJ.BoostVector()); //make sure to boost HJJ AFTER boosting movingframe
640 
641  TLorentzVector P1(0, 0, pHJJ.T()/2, pHJJ.T()/2);
642  TLorentzVector P2(0, 0, -pHJJ.T()/2, pHJJ.T()/2);
643  // Transform incoming partons back to original frame
644  P1.Transform(movingframe.Inverse());
645  P2.Transform(movingframe.Inverse());
646  pHJJ.Transform(movingframe.Inverse());
647  // movingframe and HJJ_T will not be used anymore
648  // Handle gen. partons if they are available
649  if (injet1 && injet2 && fabs((*injet1+*injet2).P()-pHJJ.P())<pHJJ.P()*1e-4){
650  P1=*injet1;
651  P2=*injet2;
652  if (P1.Z() < P2.Z()){
653  swap(P1, P2);
654  swap(injet1Id, injet2Id);
655  }
656  // In the case of gen. partons, check if the intermediates are a Z or a W.
657  int diff1Id = jet1Id-injet1Id;
658  int diff2Id = jet2Id-injet2Id;
659  if (
660  !( // THIS IS A NOT-IF!
661  (diff1Id==0 && diff2Id==0 && !(injet1Id==21 || injet2Id==21)) // Two Z bosons
662  ||
663  ((fabs(diff1Id)==1 || fabs(diff1Id)==3 || fabs(diff1Id)==5) && (fabs(diff2Id)==1 || fabs(diff2Id)==3 || fabs(diff2Id)==5)) // Two W bosons, do not check W+ vs W-
664  )
665  ){
666  int diff12Id = jet1Id-injet2Id;
667  int diff21Id = jet2Id-injet1Id;
668  if (
669  ((diff12Id==0 || diff21Id==0) && !(injet1Id==21 || injet2Id==21)) // At least one Z boson
670  ||
671  ((fabs(diff12Id)==1 || fabs(diff12Id)==3 || fabs(diff12Id)==5) || (fabs(diff21Id)==1 || fabs(diff21Id)==3 || fabs(diff21Id)==5)) // At least one W boson
672  ){
673  swap(P1, P2);
674  swap(injet1Id, injet2Id);
675  }
676  }
677  }
678 
679  TLorentzRotation ZZframe;
680  ZZframe.Boost(-pH.BoostVector());
681  P1.Transform(ZZframe);
682  P2.Transform(ZZframe);
683  p4Z1.Transform(ZZframe);
684  p4Z2.Transform(ZZframe);
685  jet1massless.Transform(ZZframe);
686  jet2massless.Transform(ZZframe);
687 
688  TLorentzVector fermion1, fermion2, antifermion1, antifermion2;
689  // Consider cases with gen. partons
690  // By default, fermion1/2 are jet1/2 unless incoming partons are specifically anti-quarks!
691  if (injet1 && injet1Id<0){
692  fermion1=-P1;
693  antifermion1 = jet1massless;
694  }
695  else{
696  fermion1 = jet1massless;
697  antifermion1=-P1;
698  }
699  if (injet2 && injet2Id<0){
700  fermion2=-P2;
701  antifermion2 = jet2massless;
702  }
703  else{
704  fermion2 = jet2massless;
705  antifermion2=-P2;
706  }
707 
708  // Computations in the frame of X
709  TLorentzVector V1 = fermion1 + antifermion1; // Outgoing V1
710  TLorentzVector V2 = fermion2 + antifermion2; // Outgoing V2
711  TVector3 normvec1 = fermion1.Vect().Cross(antifermion1.Vect()).Unit(); // p11 x p12
712  TVector3 normvec2 = fermion2.Vect().Cross(antifermion2.Vect()).Unit(); // p21 x p22
713  TVector3 normvec3 = p4Z2.Vect().Cross(V1.Vect()).Unit(); // z x V1
714  double cosPhi = normvec1.Dot(normvec2);
715  double sgnPhi = normvec1.Cross(normvec2).Dot(V1.Vect());
716  if (fabs(sgnPhi)>0.) sgnPhi = sgnPhi/fabs(sgnPhi);
717  double cosPhi1 = normvec1.Dot(normvec3);
718  double sgnPhi1 = normvec1.Cross(normvec3).Dot(V1.Vect());
719  if (fabs(sgnPhi1)>0.) sgnPhi1 = sgnPhi1/fabs(sgnPhi1);
720  if (fabs(cosPhi)>1) cosPhi *= 1./fabs(cosPhi);
721  if (fabs(cosPhi1)>1) cosPhi1 *= 1./fabs(cosPhi1);
722  Phi = acos(-cosPhi)*sgnPhi;
723  Phi1 = acos(cosPhi1)*sgnPhi1;
724  costhetastar = V1.Vect().Unit().Dot(p4Z2.Vect().Unit()); // Note that p4Z2 is still in outgoing convention, so in incoming terms, this is equivalent to putting p4Z1.
725  Q2V1 = -(V1.M2());
726  Q2V2 = -(V2.M2());
727 
728  // Computations that would have been in the frame of X had V1 and V2 not been virtual
729  costheta1 = V1.Vect().Unit().Dot(fermion1.Vect().Unit());
730  costheta2 = V2.Vect().Unit().Dot(fermion2.Vect().Unit());
731 }

◆ computeVBFAngles_ComplexBoost()

void TUtil::computeVBFAngles_ComplexBoost ( float &  costhetastar,
float &  costheta1_real,
float &  costheta1_imag,
float &  costheta2_real,
float &  costheta2_imag,
float &  Phi,
float &  Phi1,
float &  Q2V1,
float &  Q2V2,
TLorentzVector  p4M11,
int  Z1_lept1Id,
TLorentzVector  p4M12,
int  Z1_lept2Id,
TLorentzVector  p4M21,
int  Z2_lept1Id,
TLorentzVector  p4M22,
int  Z2_lept2Id,
TLorentzVector  jet1,
int  jet1Id,
TLorentzVector  jet2,
int  jet2Id,
TLorentzVector *  injet1 = 0,
int  injet1Id = 0,
TLorentzVector *  injet2 = 0,
int  injet2Id = 0 
)

Definition at line 732 of file TUtil.cc.

748  {
749  TLorentzVector const nullFourVector(0, 0, 0, 0);
750 
751  TLorentzVector jet1massless, jet2massless;
752  pair<TLorentzVector, TLorentzVector> jetPair = TUtil::removeMassFromPair(jet1, jet1Id, jet2, jet2Id);
753  jet1massless = jetPair.first;
754  jet2massless = jetPair.second;
755 
756  //build Z 4-vectors
757  TLorentzVector p4Z1 = p4M11 + p4M12;
758  TLorentzVector p4Z2 = p4M21 + p4M22;
759  TLorentzVector pH = p4Z1+p4Z2;
760  //jet1 is defined as going forwards (bigger pz), jet2 going backwards (smaller pz)
761  if (jet1massless.Z() < jet2massless.Z()) { swap(jet1massless, jet2massless); swap(jet1Id, jet2Id); }
762 
763  //Find the incoming partons - first boost so the pT(HJJ) = 0, then boost away the pz.
764  //This preserves the z direction. Then assume that the partons come in this z direction.
765  //This is exactly correct at LO (since pT=0 anyway).
766  //Then associate the one going forwards with jet1 and the one going backwards with jet2
767  TLorentzRotation movingframe;
768  TLorentzVector pHJJ = pH+jet1massless+jet2massless;
769  TLorentzVector pHJJ_perp(pHJJ.X(), pHJJ.Y(), 0, pHJJ.T());
770  movingframe.Boost(-pHJJ_perp.BoostVector());
771  pHJJ.Boost(-pHJJ_perp.BoostVector());
772  movingframe.Boost(-pHJJ.BoostVector());
773  pHJJ.Boost(-pHJJ.BoostVector()); //make sure to boost HJJ AFTER boosting movingframe
774 
775  TLorentzVector P1(0, 0, pHJJ.T()/2, pHJJ.T()/2);
776  TLorentzVector P2(0, 0, -pHJJ.T()/2, pHJJ.T()/2);
777  // Transform incoming partons back to original frame
778  P1.Transform(movingframe.Inverse());
779  P2.Transform(movingframe.Inverse());
780  pHJJ.Transform(movingframe.Inverse());
781  // movingframe and HJJ_T will not be used anymore
782  // Handle gen. partons if they are available
783  if (injet1 && injet2 && fabs((*injet1+*injet2).P()-pHJJ.P())<pHJJ.P()*1e-4){
784  P1=*injet1;
785  P2=*injet2;
786  if (P1.Z() < P2.Z()){
787  swap(P1, P2);
788  swap(injet1Id, injet2Id);
789  }
790  // In the case of gen. partons, check if the intermediates are a Z or a W.
791  int diff1Id = jet1Id-injet1Id;
792  int diff2Id = jet2Id-injet2Id;
793  if (
794  !( // THIS IS A NOT-IF!
795  (diff1Id==0 && diff2Id==0 && !(injet1Id==21 || injet2Id==21)) // Two Z bosons
796  ||
797  ((fabs(diff1Id)==1 || fabs(diff1Id)==3 || fabs(diff1Id)==5) && (fabs(diff2Id)==1 || fabs(diff2Id)==3 || fabs(diff2Id)==5)) // Two W bosons, do not check W+ vs W-
798  )
799  ){
800  int diff12Id = jet1Id-injet2Id;
801  int diff21Id = jet2Id-injet1Id;
802  if (
803  ((diff12Id==0 || diff21Id==0) && !(injet1Id==21 || injet2Id==21)) // At least one Z boson
804  ||
805  ((fabs(diff12Id)==1 || fabs(diff12Id)==3 || fabs(diff12Id)==5) || (fabs(diff21Id)==1 || fabs(diff21Id)==3 || fabs(diff21Id)==5)) // At least one W boson
806  ){
807  swap(P1, P2);
808  swap(injet1Id, injet2Id);
809  }
810  }
811  }
812 
813  TLorentzRotation ZZframe;
814  ZZframe.Boost(-pH.BoostVector());
815  P1.Transform(ZZframe);
816  P2.Transform(ZZframe);
817  p4Z1.Transform(ZZframe);
818  p4Z2.Transform(ZZframe);
819  jet1massless.Transform(ZZframe);
820  jet2massless.Transform(ZZframe);
821 
822  TLorentzVector fermion1, fermion2, antifermion1, antifermion2;
823  // Consider cases with gen. partons
824  // By default, fermion1/2 are jet1/2 unless incoming partons are specifically anti-quarks!
825  if (injet1 && injet1Id<0){
826  fermion1=-P1;
827  antifermion1 = jet1massless;
828  }
829  else{
830  fermion1 = jet1massless;
831  antifermion1=-P1;
832  }
833  if (injet2 && injet2Id<0){
834  fermion2=-P2;
835  antifermion2 = jet2massless;
836  }
837  else{
838  fermion2 = jet2massless;
839  antifermion2=-P2;
840  }
841 
842  // Computations in the frame of X
843  TLorentzVector V1 = fermion1 + antifermion1; // Outgoing V1
844  TLorentzVector V2 = fermion2 + antifermion2; // Outgoing V2
845  TVector3 normvec1 = fermion1.Vect().Cross(antifermion1.Vect()).Unit(); // p11 x p12
846  TVector3 normvec2 = fermion2.Vect().Cross(antifermion2.Vect()).Unit(); // p21 x p22
847  TVector3 normvec3 = p4Z2.Vect().Cross(V1.Vect()).Unit(); // z x V1
848  double cosPhi = normvec1.Dot(normvec2);
849  double sgnPhi = normvec1.Cross(normvec2).Dot(V1.Vect());
850  if (fabs(sgnPhi)>0.) sgnPhi = sgnPhi/fabs(sgnPhi);
851  double cosPhi1 = normvec1.Dot(normvec3);
852  double sgnPhi1 = normvec1.Cross(normvec3).Dot(V1.Vect());
853  if (fabs(sgnPhi1)>0.) sgnPhi1 = sgnPhi1/fabs(sgnPhi1);
854  if (fabs(cosPhi)>1) cosPhi *= 1./fabs(cosPhi);
855  if (fabs(cosPhi1)>1) cosPhi1 *= 1./fabs(cosPhi1);
856  Phi = acos(-cosPhi)*sgnPhi;
857  Phi1 = acos(cosPhi1)*sgnPhi1;
858  costhetastar = V1.Vect().Unit().Dot(p4Z2.Vect().Unit()); // Note that p4Z2 is still in outgoing convention, so in incoming terms, this is equivalent to putting p4Z1.
859  Q2V1 = -(V1.M2());
860  Q2V2 = -(V2.M2());
861 
862  // Up to here, everything has to be the same as TUtil::computeVBFAngles
863  // Computations that would have been truly in the frame of X had V1 and V2 not been virtual:
864  // Use TUtil::ComplexBoost to evade imaginary gamma problems when beta**2<0
865  pair<TLorentzVector, TLorentzVector> V2_BV1 = TUtil::ComplexBoost(V1.BoostVector(), V2);
866  pair<TLorentzVector, TLorentzVector> fermion1_BV1 = TUtil::ComplexBoost(V1.BoostVector(), fermion1);
867  costheta1_real = -(V2_BV1.first.Vect().Unit().Dot(fermion1_BV1.first.Vect().Unit()) - V2_BV1.second.Vect().Unit().Dot(fermion1_BV1.second.Vect().Unit()));
868  costheta1_imag = -(V2_BV1.first.Vect().Unit().Dot(fermion1_BV1.second.Vect().Unit()) + V2_BV1.second.Vect().Unit().Dot(fermion1_BV1.first.Vect().Unit()));
869 
870  pair<TLorentzVector, TLorentzVector> V1_BV2 = TUtil::ComplexBoost(V2.BoostVector(), V1);
871  pair<TLorentzVector, TLorentzVector> fermion2_BV2 = TUtil::ComplexBoost(V2.BoostVector(), fermion2);
872  costheta2_real = -(V1_BV2.first.Vect().Unit().Dot(fermion2_BV2.first.Vect().Unit()) - V1_BV2.second.Vect().Unit().Dot(fermion2_BV2.second.Vect().Unit()));
873  costheta2_imag = -(V1_BV2.first.Vect().Unit().Dot(fermion2_BV2.second.Vect().Unit()) + V1_BV2.second.Vect().Unit().Dot(fermion2_BV2.first.Vect().Unit()));
874 }

◆ computeVHAngles()

void TUtil::computeVHAngles ( float &  costhetastar,
float &  costheta1,
float &  costheta2,
float &  Phi,
float &  Phi1,
float &  m1,
float &  m2,
TLorentzVector  p4M11,
int  Z1_lept1Id,
TLorentzVector  p4M12,
int  Z1_lept2Id,
TLorentzVector  p4M21,
int  Z2_lept1Id,
TLorentzVector  p4M22,
int  Z2_lept2Id,
TLorentzVector  jet1,
int  jet1Id,
TLorentzVector  jet2,
int  jet2Id,
TLorentzVector *  injet1 = 0,
int  injet1Id = 0,
TLorentzVector *  injet2 = 0,
int  injet2Id = 0 
)

Definition at line 875 of file TUtil.cc.

891  {
892  TLorentzVector const nullFourVector(0, 0, 0, 0);
893 
894  TLorentzVector jet1massless, jet2massless;
895  pair<TLorentzVector, TLorentzVector> jetPair = TUtil::removeMassFromPair(jet1, jet1Id, jet2, jet2Id);
896  jet1massless = jetPair.first;
897  jet2massless = jetPair.second;
898 
899  // Build Z 4-vectors
900  TLorentzVector p4Z1 = p4M11 + p4M12;
901  TLorentzVector p4Z2 = p4M21 + p4M22;
902  TLorentzVector pH = p4Z1 + p4Z2;
903 
904  // Apply convention for outgoing particles
905  if (
906  (jet1Id*jet2Id<0 && jet1Id<0) // for OS pairs: jet1 must be the particle
907  ||
908  ((jet1Id*jet2Id>0 || (jet1Id==0 && jet2Id==0)) && jet1massless.Phi()<=jet2massless.Phi()) // for SS pairs: use random deterministic convention
909  ){
910  swap(jet1massless, jet2massless);
911  swap(jet1Id, jet2Id);
912  }
913 
914  //Find the incoming partons - first boost so the pT(HJJ) = 0, then boost away the pz.
915  //This preserves the z direction.
916  //Then, assume that the partons come in this z direction.
917  //This is exactly correct at LO (since pT=0 anyway).
918  //Then associate the one going forwards with jet1 and the one going backwards with jet2
919  TLorentzRotation movingframe;
920  TLorentzVector pHJJ = pH+jet1massless+jet2massless;
921  TLorentzVector pHJJ_perp(pHJJ.X(), pHJJ.Y(), 0, pHJJ.T());
922  movingframe.Boost(-pHJJ_perp.BoostVector());
923  pHJJ.Boost(-pHJJ_perp.BoostVector());
924  movingframe.Boost(-pHJJ.BoostVector());
925  pHJJ.Boost(-pHJJ.BoostVector()); //make sure to boost HJJ AFTER boosting movingframe
926 
927  TLorentzVector P1(0, 0, -pHJJ.T()/2, pHJJ.T()/2);
928  TLorentzVector P2(0, 0, pHJJ.T()/2, pHJJ.T()/2);
929  // Transform incoming partons back to the original frame
930  P1.Transform(movingframe.Inverse());
931  P2.Transform(movingframe.Inverse());
932  pHJJ.Transform(movingframe.Inverse());
933  // movingframe and HJJ_T will not be used anymore
934  // Handle gen. partons if they are available
935  if (injet1 && injet2 && fabs((*injet1+*injet2).P()-pHJJ.P())<pHJJ.P()*1e-4){
936  P1=*injet1;
937  P2=*injet2;
938  // Apply convention for incoming (!) particles
939  if (
940  (injet1Id*injet2Id<0 && injet1Id>0) // for OS pairs: parton 2 must be the particle
941  ||
942  (injet1Id*injet2Id>0 && P1.Z()>=P2.Z()) //for SS pairs: use random deterministic convention
943  ){
944  swap(P1, P2);
945  swap(injet1Id, injet2Id);
946  }
947  }
948 
949  // Rotate every vector such that Z1 - Z2 axis is the "beam axis" analogue of decay
950  TLorentzRotation ZZframe;
951  TVector3 const beamAxis(0, 0, 1);
952  if (p4Z1==nullFourVector || p4Z2==nullFourVector){
953  TVector3 pNewAxis = (p4Z2-p4Z1).Vect().Unit(); // Let Z2 be in the z direction so that once the direction of H is reversed, Z1 is in the z direction
954  if (pNewAxis != nullFourVector.Vect()){
955  TVector3 pNewAxisPerp = pNewAxis.Cross(beamAxis);
956  ZZframe.Rotate(acos(pNewAxis.Dot(beamAxis)), pNewAxisPerp);
957 
958  P1.Transform(ZZframe);
959  P2.Transform(ZZframe);
960  jet1massless = -jet1massless; jet1massless.Transform(ZZframe); jet1massless = -jet1massless;
961  jet2massless = -jet2massless; jet2massless.Transform(ZZframe); jet2massless = -jet2massless;
962  }
963  }
964  else{
965  ZZframe.Boost(-pH.BoostVector());
966  p4Z1.Boost(-pH.BoostVector());
967  p4Z2.Boost(-pH.BoostVector());
968  TVector3 pNewAxis = (p4Z2-p4Z1).Vect().Unit(); // Let Z2 be in the z direction so that once the direction of H is reversed, Z1 is in the z direction
969  TVector3 pNewAxisPerp = pNewAxis.Cross(beamAxis);
970  ZZframe.Rotate(acos(pNewAxis.Dot(beamAxis)), pNewAxisPerp);
971  P1.Transform(ZZframe);
972  P2.Transform(ZZframe);
973  jet1massless = -jet1massless; jet1massless.Transform(ZZframe); jet1massless = -jet1massless;
974  jet2massless = -jet2massless; jet2massless.Transform(ZZframe); jet2massless = -jet2massless;
975  }
976 
978  costhetastar,
979  costheta1,
980  costheta2,
981  Phi,
982  Phi1,
983  -P1, 23, // Id is 23 to avoid an attempt to remove quark mass
984  -P2, 0, // Id is 0 to avoid swapping
985  jet1massless, 23,
986  jet2massless, 0
987  );
988  m1 = (P1 + P2).M();
989  m2 = (jet1massless + jet2massless).M();
990 }

◆ constrainedRemovePairMass()

void TUtil::constrainedRemovePairMass ( TLorentzVector &  p1,
TLorentzVector &  p2,
double  m1 = 0,
double  m2 = 0 
)

Definition at line 41 of file TUtil.cc.

41  {
42  TLorentzVector const nullFourVector(0, 0, 0, 0);
43  TLorentzVector p1hat, p2hat;
44  if (p1==nullFourVector || p2==nullFourVector) return;
45 
46  /***** shiftMass in C++ *****/
47  TLorentzVector p12=p1+p2;
48  TLorentzVector diffp2p1=p2-p1;
49  double p1sq = p1.M2();
50  double p2sq = p2.M2();
51  double p1p2 = p1.Dot(p2);
52  double m1sq = m1*fabs(m1);
53  double m2sq = m2*fabs(m2);
54  double p12sq = p12.M2();
55 
56  TLorentzVector avec=(p1sq*p2 - p2sq*p1 + p1p2*diffp2p1);
57  double a = avec.M2();
58  double b = (p12sq + m2sq - m1sq) * (pow(p1p2, 2) - p1sq*p2sq);
59  double c = pow((p12sq + m2sq - m1sq), 2)*p1sq/4. - pow((p1sq + p1p2), 2)*m2sq;
60  double eta = (-b - sqrt(fabs(b*b -4.*a*c)))/(2.*a);
61  double xi = (p12sq + m2sq - m1sq - 2.*eta*(p2sq + p1p2))/(2.*(p1sq + p1p2));
62 
63  p1hat = (1.-xi)*p1 + (1.-eta)*p2;
64  p2hat = xi*p1 + eta*p2;
65  p1=p1hat;
66  p2=p2hat;
67 }

◆ ConvertThreeBodyDecayCandidate()

MELAThreeBodyDecayCandidate * TUtil::ConvertThreeBodyDecayCandidate ( SimpleParticleCollection_t tbdDaughters,
std::vector< MELAParticle * > *  particleList,
std::vector< MELAThreeBodyDecayCandidate * > *  tbdCandList 
)

Definition at line 8819 of file TUtil.cc.

8825  {
8826  MELAThreeBodyDecayCandidate* cand=nullptr;
8827 
8828  if (!tbdDaughters){ MELAerr << "TUtil::ConvertThreeBodyDecayCandidate: No daughters!" << endl; return cand; }
8829  else if (tbdDaughters->empty()){ MELAerr << "TUtil::ConvertThreeBodyDecayCandidate: Daughter size==0!" << endl; return cand; }
8830  else if (!(tbdDaughters->size()==1 || tbdDaughters->size()==3)){ MELAerr << "TUtil::ConvertThreeBodyDecayCandidate: Daughter size " << tbdDaughters->size() << "!=1 or 3 is not supported!" << endl; return cand; }
8831 
8832  if (tbdDaughters->size()==1){
8833  if (abs((tbdDaughters->at(0)).first)==6 || (tbdDaughters->at(0)).first==0){
8834  cand = new MELAThreeBodyDecayCandidate((tbdDaughters->at(0)).first, (tbdDaughters->at(0)).second);
8835  tbdCandList->push_back(cand);
8836  }
8837  }
8838  else if (tbdDaughters->size()==3){
8839  MELAParticle* partnerPart = new MELAParticle((tbdDaughters->at(0)).first, (tbdDaughters->at(0)).second);
8840  MELAParticle* Wf = new MELAParticle((tbdDaughters->at(1)).first, (tbdDaughters->at(1)).second);
8841  MELAParticle* Wfb = new MELAParticle((tbdDaughters->at(2)).first, (tbdDaughters->at(2)).second);
8842 
8843  if (Wf->id<0 || Wfb->id>0) std::swap(Wf, Wfb);
8844 
8845  particleList->push_back(partnerPart);
8846  particleList->push_back(Wf);
8847  particleList->push_back(Wfb);
8848 
8849  cand = new MELAThreeBodyDecayCandidate(partnerPart, Wf, Wfb);
8850  tbdCandList->push_back(cand);
8851  }
8852  return cand;
8853 }

◆ ConvertVectorFormat()

MELACandidate * TUtil::ConvertVectorFormat ( SimpleParticleCollection_t pDaughters,
SimpleParticleCollection_t pAssociated,
SimpleParticleCollection_t pMothers,
bool  isGen,
std::vector< MELAParticle * > *  particleList,
std::vector< MELACandidate * > *  candList 
)

Definition at line 8675 of file TUtil.cc.

8684  {
8685  MELACandidate* cand=nullptr;
8686 
8687  if (!pDaughters){ MELAerr << "TUtil::ConvertVectorFormat: No daughters!" << endl; return cand; }
8688  else if (pDaughters->size()==0){ MELAerr << "TUtil::ConvertVectorFormat: Daughter size==0!" << endl; return cand; }
8689  else if (pDaughters->size()>4){ MELAerr << "TUtil::ConvertVectorFormat: Daughter size " << pDaughters->size() << ">4 is not supported!" << endl; return cand; }
8690  if (pMothers && pMothers->size()!=2){ MELAerr << "TUtil::ConvertVectorFormat: Mothers momentum size (" << pMothers->size() << ") has to have had been 2! Continuing by omitting mothers." << endl; /*return cand;*/ }
8691 
8692  // Create mother, daughter and associated particle MELAParticle objects
8693  std::vector<MELAParticle*> daughters;
8694  std::vector<MELAParticle*> aparticles;
8695  std::vector<MELAParticle*> mothers;
8696  for (auto& spart:(*pDaughters)){
8697  MELAParticle* onePart = new MELAParticle(spart.first, spart.second);
8698  onePart->setGenStatus(1); // Final state status
8699  if (particleList) particleList->push_back(onePart);
8700  daughters.push_back(onePart);
8701  }
8702  if (pAssociated){
8703  for (auto& spart:(*pAssociated)){
8704  MELAParticle* onePart = new MELAParticle(spart.first, spart.second);
8705  onePart->setGenStatus(1); // Final state status
8706  if (particleList) particleList->push_back(onePart);
8707  aparticles.push_back(onePart);
8708  }
8709  }
8710  if (pMothers && pMothers->size()==2){
8711  for (auto& spart:(*pMothers)){
8712  MELAParticle* onePart = new MELAParticle(spart.first, spart.second);
8713  onePart->setGenStatus(-1); // Mother status
8714  if (particleList) particleList->push_back(onePart);
8715  mothers.push_back(onePart);
8716  }
8717  }
8718 
8719  // Create the candidate
8720  /***** Adaptation of LHEAnalyzer::Event::constructVVCandidates *****/
8721  /*
8722  The assumption is that the daughters make sense for either ffb, gamgam, Zgam, ZZ or WW.
8723  No checking is done on whether particle-antiparticle pairing is correct when necessary.
8724  If not, you will get a seg. fault!
8725  */
8726 
8727  // Undecayed Higgs
8728  if (daughters.size()==1){
8729  cand = new MELACandidate(25, (daughters.at(0))->p4); // No sorting!
8730  cand->setDecayMode(TVar::CandidateDecay_Stable); // Explicitly set the decay mode in case the default of MELACandidate changes in the future
8731  }
8732  // GG / ff final states
8733  else if (daughters.size()==2){
8734  MELAParticle* F1 = daughters.at(0);
8735  MELAParticle* F2 = daughters.at(1);
8736  TLorentzVector pH = F1->p4+F2->p4;
8737  cand = new MELACandidate(25, pH);
8738  cand->addDaughter(F1);
8739  cand->addDaughter(F2);
8743  cand->sortDaughters();
8744  PDGHelpers::setCandidateDecayMode(defaultHDecayMode);
8745  }
8746  // ZG / WG
8747  else if (daughters.size()==3){
8748  MELAParticle* F1 = daughters.at(0);
8749  MELAParticle* F2 = daughters.at(1);
8750  MELAParticle* gamma = daughters.at(2);
8751  if (PDGHelpers::isAPhoton(F1->id)){
8752  MELAParticle* tmp = F1;
8753  F1 = gamma;
8754  gamma = tmp;
8755  }
8756  else if (PDGHelpers::isAPhoton(F2->id)){
8757  MELAParticle* tmp = F2;
8758  F2 = gamma;
8759  gamma = tmp;
8760  }
8761  TLorentzVector pH = F1->p4+F2->p4+gamma->p4;
8762  double charge = F1->charge()+F2->charge()+gamma->charge();
8763  cand = new MELACandidate(25, pH);
8764  cand->addDaughter(F1);
8765  cand->addDaughter(F2);
8766  cand->addDaughter(gamma);
8768  if (fabs(charge)<0.01) PDGHelpers::setCandidateDecayMode(TVar::CandidateDecay_ZG); // ZG
8770  cand->sortDaughters();
8771  PDGHelpers::setCandidateDecayMode(defaultHDecayMode);
8772  }
8773  // ZZ / WW / ZW (!)
8774  else/* if (daughters.size()==4)*/{
8775  TLorentzVector pH(0, 0, 0, 0);
8776  double charge = 0.;
8777  for (unsigned char ip=0; ip<4; ip++){ pH = pH + (daughters.at(ip))->p4; charge += (daughters.at(ip))->charge(); }
8778  cand = new MELACandidate(25, pH);
8779  for (unsigned char ip=0; ip<4; ip++) cand->addDaughter(daughters.at(ip));
8780  // FIXME/REIMPLEMENT: ZW trickier than I thought: Summing over charges over all 4f is not enough, affects SSSF pairing in ZZ
8781  //TVar::CandidateDecayMode defaultHDecayMode = PDGHelpers::HDecayMode;
8782  //if (fabs(charge)>0.01) PDGHelpers::setCandidateDecayMode(TVar::CandidateDecay_ZW);
8783  if (
8787  ){
8788  MELAerr << "TUtil::ConvertVectorFormat: PDGHelpers::HDecayMode = " << PDGHelpers::HDecayMode << " is set incorrectly for Ndaughters=" << daughters.size() << ". There is no automatic mechnism for this scenario. ";
8789  MELAerr << "Suggestion: Call PDGHelpers::setCandidateDecayMode(TVar::CandidateDecay_XY) before this call." << endl;
8790  assert(0);
8791  }
8792  cand->sortDaughters();
8793  //PDGHelpers::setCandidateDecayMode(defaultHDecayMode);
8794  }
8795 
8796  /***** Adaptation of LHEAnalyzer::Event::addVVCandidateMother *****/
8797  if (!mothers.empty()){ // ==2
8798  for (auto& part:mothers) cand->addMother(part);
8799  if (isGen) cand->setGenStatus(-1); // Candidate is a gen. particle!
8800  }
8801  /***** Adaptation of LHEAnalyzer::Event::addVVCandidateAppendages *****/
8802  if (!aparticles.empty()){
8803  for (auto& part:aparticles){
8804  const int& partId = part->id;
8805  if (PDGHelpers::isALepton(partId)) cand->addAssociatedLepton(part);
8806  else if (PDGHelpers::isANeutrino(partId)) cand->addAssociatedNeutrino(part); // Be careful: Neutrinos are neutrinos, but also "leptons" in MELACandidate!
8807  else if (PDGHelpers::isAPhoton(partId)) cand->addAssociatedPhoton(part);
8808  else if (PDGHelpers::isAJet(partId)) cand->addAssociatedJet(part);
8809  }
8810  cand->addAssociatedVs(); // For the VH topology
8811  }
8812 
8813  if (candList && cand) candList->push_back(cand);
8814  return cand;
8815 }

◆ GetAlphaS()

void TUtil::GetAlphaS ( double *  alphas_,
double *  alphasmz_ 
)

Definition at line 1849 of file TUtil.cc.

1849  {
1850  double alphasVal=0, alphasmzVal=0;
1851  __modjhugenmela_MOD_getalphasalphasmz(&alphasVal, &alphasmzVal);
1852  if (alphas_!=0) *alphas_ = alphasVal;
1853  if (alphasmz_!=0) *alphasmz_ = alphasmzVal;
1854 }

◆ GetBoostedParticleVectors()

void TUtil::GetBoostedParticleVectors ( MELACandidate melaCand,
TVar::simple_event_record mela_event,
TVar::VerbosityLevel  verbosity = TVar::DEBUG 
)

Definition at line 8212 of file TUtil.cc.

8216  {
8217  if (verbosity>=TVar::DEBUG) MELAout << "Begin GetBoostedParticleVectors" << endl;
8218  // This is the beginning of one long function.
8219 
8220  int const& code = mela_event.AssociationCode;
8221  if (verbosity>=TVar::DEBUG) MELAout << "TUtil::GetBoostedParticleVectors: code=" << code << endl;
8222  int const& aVhypo = mela_event.AssociationVCompatibility;
8223  TLorentzVector const nullFourVector(0, 0, 0, 0);
8224 
8225  SimpleParticleCollection_t daughters;
8226  vector<int> idVstar; idVstar.reserve(2);
8227  if (melaCand->getNDaughters()==0){
8228  // Undecayed Higgs has V1=H, V2=empty, no sortedDaughters!
8229  daughters.push_back(SimpleParticle_t(melaCand->id, melaCand->p4));
8230  idVstar.push_back(melaCand->id);
8231  idVstar.push_back(-9000);
8232  }
8233  else{
8234  // H->ffb has V1=f->f, V2=fb->fb
8235  // H->GG has V1=G->G, V2=G->G
8236  // H->ZG has V1=Z->ffb, V2=G->G
8237  // Everything else is as expected.
8238  for (unsigned char iv=0; iv<2; iv++){ // 2 Vs are guaranteed in MELACandidate.
8239  MELAParticle* Vdau = melaCand->getSortedV(iv);
8240  if (Vdau){
8241  int idtmp = Vdau->id;
8242  for (MELAParticle* Vdau_i:Vdau->getDaughters()){
8243  if (Vdau_i && Vdau_i->passSelection) daughters.push_back(SimpleParticle_t(Vdau_i->id, Vdau_i->p4));
8244  }
8245  if (idtmp!=0 || Vdau->getNDaughters()>0){ // Avoid "empty" intermediate Vs of the MELACandidate object
8246  if (Vdau->getNDaughters()>=2 && PDGHelpers::isAPhoton(idtmp)) idtmp=23; // Special case to avoid V->2f with massless decay mode (could happen by mistake)
8247  idVstar.push_back(idtmp);
8248  }
8249  }
8250  else idVstar.push_back(-9000);
8251  }
8252  }
8253  if (daughters.size()>=2){
8254  size_t nffs = daughters.size()/2;
8255  for (size_t iv=0; iv<nffs; iv++){
8256  pair<TLorentzVector, TLorentzVector> corrPair = TUtil::removeMassFromPair(
8257  daughters.at(2*iv+0).second, daughters.at(2*iv+0).first,
8258  daughters.at(2*iv+1).second, daughters.at(2*iv+1).first
8259  );
8260  daughters.at(2*iv+0).second = corrPair.first;
8261  daughters.at(2*iv+1).second = corrPair.second;
8262  }
8263  if (2*nffs<daughters.size()){
8264  TLorentzVector tmp = nullFourVector;
8265  SimpleParticle_t& lastDau = daughters.back();
8266  pair<TLorentzVector, TLorentzVector> corrPair = TUtil::removeMassFromPair(
8267  lastDau.second, lastDau.first,
8268  tmp, -9000
8269  );
8270  lastDau.second = corrPair.first;
8271  }
8272  }
8273 
8274  /***** ASSOCIATED PARTICLES *****/
8275  if (verbosity>=TVar::DEBUG){
8276  MELAout << "TUtil::GetBoostedParticleVectors: nRequestedLeps=" << mela_event.nRequested_AssociatedLeptons << endl;
8277  MELAout << "TUtil::GetBoostedParticleVectors: nRequestedJets=" << mela_event.nRequested_AssociatedJets << endl;
8278  MELAout << "TUtil::GetBoostedParticleVectors: nRequestedPhotons=" << mela_event.nRequested_AssociatedPhotons << endl;
8279  }
8280  int nsatisfied_jets=0;
8281  int nsatisfied_lnus=0;
8282  int nsatisfied_gammas=0;
8283  vector<MELAParticle*> candidateVs; // Used if aVhypo!=0
8284  SimpleParticleCollection_t associated;
8285  if (aVhypo!=0){
8286  if (verbosity>=TVar::DEBUG) MELAout << "TUtil::GetBoostedParticleVectors: aVhypo!=0 case start" << endl;
8287 
8288  vector<MELAParticle*> asortedVs = melaCand->getAssociatedSortedVs();
8289  for (MELAParticle* Vdau:asortedVs){ // Loop over associated Vs
8290  if (Vdau){
8291  bool doAdd=false;
8292  int idV = Vdau->id;
8293  if ((abs(idV)==aVhypo || idV==0) && Vdau->getNDaughters()>0 && Vdau->passSelection){ // If the V is unknown or compatible with the requested hypothesis
8294  doAdd=true;
8295  for (MELAParticle* Vdau_i:Vdau->getDaughters()){ // Loop over the daughters of V
8296  if (!Vdau_i){ doAdd=false; break; }
8297  else if (
8298  (mela_event.nRequested_AssociatedLeptons==0 && (PDGHelpers::isALepton(Vdau_i->id) || PDGHelpers::isANeutrino(Vdau_i->id)))
8299  ||
8300  (mela_event.nRequested_AssociatedJets==0 && PDGHelpers::isAJet(Vdau_i->id))
8301  ||
8302  !Vdau_i->passSelection // Protection against incorrect Vdau passSelection flag
8303  ){
8304  doAdd=false; break;
8305  }
8306  }
8307  }
8308  if (doAdd) candidateVs.push_back(Vdau);
8309  }
8310  } // End loop over associated Vs
8311 
8312  if (verbosity>=TVar::DEBUG) MELAout << "TUtil::GetBoostedParticleVectors: candidateVs size = " << candidateVs.size() << endl;
8313 
8314  // Pick however many candidates necessary to fill up the requested number of jets or lepton(+)neutrinos
8315  for (MELAParticle* Vdau:candidateVs){
8316  SimpleParticleCollection_t associated_tmp;
8317  for (MELAParticle* part:Vdau->getDaughters()){ // Loop over the daughters of V
8318  if (
8319  part->passSelection
8320  &&
8321  (PDGHelpers::isALepton(part->id) || PDGHelpers::isANeutrino(part->id))
8322  &&
8323  nsatisfied_lnus<mela_event.nRequested_AssociatedLeptons
8324  ){
8325  nsatisfied_lnus++;
8326  associated_tmp.push_back(SimpleParticle_t(part->id, part->p4));
8327  }
8328  else if (
8329  part->passSelection
8330  &&
8331  PDGHelpers::isAJet(part->id)
8332  &&
8333  nsatisfied_jets<mela_event.nRequested_AssociatedJets
8334  ){
8335  nsatisfied_jets++;
8336  associated_tmp.push_back(SimpleParticle_t(part->id, part->p4));
8337  }
8338  }
8339  // Add the id of the intermediate V into the idVstar array
8340  if (associated_tmp.size()>=2 || (associated_tmp.size()==1 && PDGHelpers::isAPhoton(associated_tmp.at(0).first))) idVstar.push_back(Vdau->id); // Only add the V-id of pairs that passed
8341  // Adjust the kinematics of associated V-originating particles
8342  if (associated_tmp.size()>=2){ // ==1 means a photon, so omit it here.
8343  unsigned int nffs = associated_tmp.size()/2;
8344  for (unsigned int iv=0; iv<nffs; iv++){
8345  pair<TLorentzVector, TLorentzVector> corrPair = TUtil::removeMassFromPair(
8346  associated_tmp.at(2*iv+0).second, associated_tmp.at(2*iv+0).first,
8347  associated_tmp.at(2*iv+1).second, associated_tmp.at(2*iv+1).first
8348  );
8349  associated_tmp.at(2*iv+0).second = corrPair.first;
8350  associated_tmp.at(2*iv+1).second = corrPair.second;
8351  }
8352  if (2*nffs<associated_tmp.size()){
8353  TLorentzVector tmp = nullFourVector;
8354  pair<TLorentzVector, TLorentzVector> corrPair = TUtil::removeMassFromPair(
8355  associated_tmp.at(associated_tmp.size()-1).second, associated_tmp.at(associated_tmp.size()-1).first,
8356  tmp, -9000
8357  );
8358  associated_tmp.at(associated_tmp.size()-1).second = corrPair.first;
8359  }
8360  }
8361  for (SimpleParticle_t& sp:associated_tmp) associated.push_back(sp); // Fill associated at the last step
8362  }
8363 
8364  if (verbosity>=TVar::DEBUG) MELAout << "TUtil::GetBoostedParticleVectors: aVhypo!=0 case associated.size=" << associated.size() << endl;
8365  }
8366  else{ // Could be split to aVhypo==0 and aVhypo<0 if associated V+jets is needed
8367  // Associated leptons
8368  if (verbosity>=TVar::DEBUG) MELAout << "TUtil::GetBoostedParticleVectors: aVhypo==0 case begin" << endl;
8369 
8370  if (code%TVar::kUseAssociated_Leptons==0){
8371  SimpleParticleCollection_t associated_tmp;
8372  for (MELAParticle* part:melaCand->getAssociatedLeptons()){
8373  if (part && part->passSelection && nsatisfied_lnus<mela_event.nRequested_AssociatedLeptons){
8374  nsatisfied_lnus++;
8375  associated_tmp.push_back(SimpleParticle_t(part->id, part->p4));
8376  }
8377  }
8378 
8379  if (verbosity>=TVar::DEBUG) MELAout << "TUtil::GetBoostedParticleVectors: aVhypo==0 lep case associated_tmp.size=" << associated_tmp.size() << endl;
8380 
8381  // Adjust the kinematics of associated non-V-originating particles
8382  if (associated_tmp.size()>=1){
8383  size_t nffs = associated_tmp.size()/2;
8384  for (size_t iv=0; iv<nffs; iv++){
8385  if (verbosity>=TVar::DEBUG) MELAout << "TUtil::GetBoostedParticleVectors: Removing mass from lepton pair " << 2*iv+0 << '\t' << 2*iv+1 << endl;
8386  pair<TLorentzVector, TLorentzVector> corrPair = TUtil::removeMassFromPair(
8387  associated_tmp.at(2*iv+0).second, associated_tmp.at(2*iv+0).first,
8388  associated_tmp.at(2*iv+1).second, associated_tmp.at(2*iv+1).first
8389  );
8390  associated_tmp.at(2*iv+0).second = corrPair.first;
8391  associated_tmp.at(2*iv+1).second = corrPair.second;
8392  }
8393  if (2*nffs<associated_tmp.size()){
8394  if (verbosity>=TVar::DEBUG) MELAout << "TUtil::GetBoostedParticleVectors: Removing mass from last lepton " << associated_tmp.size()-1 << endl;
8395  TLorentzVector tmp = nullFourVector;
8396  SimpleParticle_t& lastAssociated = associated_tmp.at(associated_tmp.size()-1);
8397  pair<TLorentzVector, TLorentzVector> corrPair = TUtil::removeMassFromPair(
8398  lastAssociated.second, lastAssociated.first,
8399  tmp, -9000
8400  );
8401  lastAssociated.second = corrPair.first;
8402  }
8403  }
8404  for (SimpleParticle_t& sp:associated_tmp) associated.push_back(sp); // Fill associated at the last step
8405  }
8406  // Associated jets
8407  if (code%TVar::kUseAssociated_Jets==0){
8408  SimpleParticleCollection_t associated_tmp;
8409  for (MELAParticle* part:melaCand->getAssociatedJets()){
8410  if (part && part->passSelection && nsatisfied_jets<mela_event.nRequested_AssociatedJets){
8411  nsatisfied_jets++;
8412  associated_tmp.push_back(SimpleParticle_t(part->id, part->p4));
8413  }
8414  }
8415 
8416  if (verbosity>=TVar::DEBUG) MELAout << "TUtil::GetBoostedParticleVectors: aVhypo==0 jet case associated_tmp.size=" << associated_tmp.size() << endl;
8417 
8418  // Adjust the kinematics of associated non-V-originating particles
8419  if (associated_tmp.size()>=1){
8420  unsigned int nffs = associated_tmp.size()/2;
8421  for (unsigned int iv=0; iv<nffs; iv++){
8422  if (verbosity>=TVar::DEBUG) MELAout << "TUtil::GetBoostedParticleVectors: Removing mass from jet pair " << 2*iv+0 << '\t' << 2*iv+1 << endl;
8423  pair<TLorentzVector, TLorentzVector> corrPair = TUtil::removeMassFromPair(
8424  associated_tmp.at(2*iv+0).second, associated_tmp.at(2*iv+0).first,
8425  associated_tmp.at(2*iv+1).second, associated_tmp.at(2*iv+1).first
8426  );
8427  associated_tmp.at(2*iv+0).second = corrPair.first;
8428  associated_tmp.at(2*iv+1).second = corrPair.second;
8429  }
8430  if (2*nffs<associated_tmp.size()){
8431  if (verbosity>=TVar::DEBUG) MELAout << "TUtil::GetBoostedParticleVectors: Removing mass from last jet " << associated_tmp.size()-1 << endl;
8432  TLorentzVector tmp = nullFourVector;
8433  SimpleParticle_t& lastAssociated = associated_tmp.at(associated_tmp.size()-1);
8434  pair<TLorentzVector, TLorentzVector> corrPair = TUtil::removeMassFromPair(
8435  lastAssociated.second, lastAssociated.first,
8436  tmp, -9000
8437  );
8438  lastAssociated.second = corrPair.first;
8439  }
8440  }
8441  for (SimpleParticle_t& sp:associated_tmp) associated.push_back(sp); // Fill associated at the last step
8442  }
8443 
8444  } // End if(aVhypo!=0)-else statement
8445 
8446  if (code%TVar::kUseAssociated_Photons==0){
8447  for (MELAParticle* part:melaCand->getAssociatedPhotons()){
8448  if (part && part->passSelection && nsatisfied_gammas<mela_event.nRequested_AssociatedPhotons){
8449  nsatisfied_gammas++;
8450  associated.push_back(SimpleParticle_t(part->id, part->p4));
8451  }
8452  }
8453  }
8454  /***** END ASSOCIATED PARTICLES *****/
8455 
8456  if (verbosity>=TVar::DEBUG) MELAout << "TUtil::GetBoostedParticleVectors: associated.size=" << associated.size() << endl;
8457 
8458  /***** ASSOCIATED TOP OBJECTS *****/
8459  int nsatisfied_tops=0;
8460  int nsatisfied_antitops=0;
8461  vector<SimpleParticleCollection_t> topDaughters;
8462  vector<SimpleParticleCollection_t> antitopDaughters;
8463  SimpleParticleCollection_t stableTops;
8464  SimpleParticleCollection_t stableAntitops;
8465 
8466  vector<MELATopCandidate_t*> tops;
8467  vector<MELATopCandidate_t*> topbars;
8468  vector<MELATopCandidate_t*> unknowntops;
8469  if (code%TVar::kUseAssociated_StableTops==0 && code%TVar::kUseAssociated_UnstableTops==0 && verbosity>=TVar::INFO) MELAerr << "TUtil::GetBoostedParticleVectors: Stable and unstable tops are not supported at the same time!" << endl;
8471 
8472  for (MELATopCandidate_t* theTop:melaCand->getAssociatedTops()){
8473  if (theTop && theTop->passSelection){
8474  vector<MELATopCandidate_t*>* particleArray;
8475  if (theTop->id==6) particleArray = &tops;
8476  else if (theTop->id==-6) particleArray = &topbars;
8477  else particleArray = &unknowntops;
8478  if (
8480  ||
8481  (theTop->getNDaughters()==3 && code%TVar::kUseAssociated_UnstableTops==0)
8482  ) particleArray->push_back(theTop);
8483  }
8484  }
8485  if (verbosity>=TVar::DEBUG){ MELAout << "TUtil::GetBoostedParticleVectors: tops.size=" << tops.size() << ", topbars.size=" << topbars.size() << ", unknowntops.size=" << unknowntops.size() << endl; }
8486 
8487  // Fill the stable/unstable top arrays
8488  for (MELATopCandidate_t* theTop:tops){
8489  if (code%TVar::kUseAssociated_StableTops==0 && nsatisfied_tops<mela_event.nRequested_Tops){ // Case with no daughters needed
8490  nsatisfied_tops++;
8491  stableTops.push_back(SimpleParticle_t(theTop->id, theTop->p4));
8492  }
8493  else if (code%TVar::kUseAssociated_UnstableTops==0 && theTop->getNDaughters()==3 && nsatisfied_tops<mela_event.nRequested_Tops){ // Case with daughters needed
8494  nsatisfied_tops++;
8495  SimpleParticleCollection_t vdaughters;
8496 
8497  MELAParticle* bottom = theTop->getPartnerParticle();
8498  MELAParticle* Wf = theTop->getWFermion();
8499  MELAParticle* Wfb = theTop->getWAntifermion();
8500  if (bottom) vdaughters.push_back(SimpleParticle_t(bottom->id, bottom->p4));
8501  if (Wf) vdaughters.push_back(SimpleParticle_t(Wf->id, Wf->p4));
8502  if (Wfb) vdaughters.push_back(SimpleParticle_t(Wfb->id, Wfb->p4));
8503 
8504  TUtil::adjustTopDaughters(vdaughters); // Adjust top daughter kinematics
8505  if (vdaughters.size()==3) topDaughters.push_back(vdaughters);
8506  }
8507  }
8508  for (MELATopCandidate_t* theTop:topbars){
8509  if (code%TVar::kUseAssociated_StableTops==0 && nsatisfied_antitops<mela_event.nRequested_Antitops){ // Case with no daughters needed
8510  nsatisfied_antitops++;
8511  stableAntitops.push_back(SimpleParticle_t(theTop->id, theTop->p4));
8512  }
8513  else if (code%TVar::kUseAssociated_UnstableTops==0 && nsatisfied_antitops<mela_event.nRequested_Antitops){ // Case with daughters needed
8514  nsatisfied_antitops++;
8515  SimpleParticleCollection_t vdaughters;
8516 
8517  MELAParticle* bottom = theTop->getPartnerParticle();
8518  MELAParticle* Wf = theTop->getWFermion();
8519  MELAParticle* Wfb = theTop->getWAntifermion();
8520  if (bottom) vdaughters.push_back(SimpleParticle_t(bottom->id, bottom->p4));
8521  if (Wf) vdaughters.push_back(SimpleParticle_t(Wf->id, Wf->p4));
8522  if (Wfb) vdaughters.push_back(SimpleParticle_t(Wfb->id, Wfb->p4));
8523 
8524  TUtil::adjustTopDaughters(vdaughters); // Adjust top daughter kinematics
8525  if (vdaughters.size()==3) antitopDaughters.push_back(vdaughters);
8526  }
8527  else break;
8528  }
8529  // Loop over the unknown-id tops
8530  // Fill tops, then antitops from the unknown tops
8531  for (MELATopCandidate_t* theTop:unknowntops){
8532  // t, then tb cases with no daughters needed
8533  if (code%TVar::kUseAssociated_StableTops==0 && nsatisfied_tops<mela_event.nRequested_Tops){
8534  nsatisfied_tops++;
8535  stableTops.push_back(SimpleParticle_t(theTop->id, theTop->p4));
8536  }
8537  else if (code%TVar::kUseAssociated_StableTops==0 && nsatisfied_antitops<mela_event.nRequested_Antitops){
8538  nsatisfied_antitops++;
8539  stableAntitops.push_back(SimpleParticle_t(theTop->id, theTop->p4));
8540  }
8541  // t, then tb cases with daughters needed
8542  else if (code%TVar::kUseAssociated_UnstableTops==0 && nsatisfied_tops<mela_event.nRequested_Tops){
8543  nsatisfied_tops++;
8544  SimpleParticleCollection_t vdaughters;
8545 
8546  MELAParticle* bottom = theTop->getPartnerParticle();
8547  MELAParticle* Wf = theTop->getWFermion();
8548  MELAParticle* Wfb = theTop->getWAntifermion();
8549  if (bottom) vdaughters.push_back(SimpleParticle_t(bottom->id, bottom->p4));
8550  if (Wf) vdaughters.push_back(SimpleParticle_t(Wf->id, Wf->p4));
8551  if (Wfb) vdaughters.push_back(SimpleParticle_t(Wfb->id, Wfb->p4));
8552 
8553  TUtil::adjustTopDaughters(vdaughters); // Adjust top daughter kinematics
8554  if (vdaughters.size()==3) topDaughters.push_back(vdaughters);
8555  }
8556  else if (code%TVar::kUseAssociated_UnstableTops==0 && nsatisfied_antitops<mela_event.nRequested_Antitops){
8557  nsatisfied_antitops++;
8558  SimpleParticleCollection_t vdaughters;
8559 
8560  MELAParticle* bottom = theTop->getPartnerParticle();
8561  MELAParticle* Wf = theTop->getWFermion();
8562  MELAParticle* Wfb = theTop->getWAntifermion();
8563  if (bottom) vdaughters.push_back(SimpleParticle_t(bottom->id, bottom->p4));
8564  if (Wf) vdaughters.push_back(SimpleParticle_t(Wf->id, Wf->p4));
8565  if (Wfb) vdaughters.push_back(SimpleParticle_t(Wfb->id, Wfb->p4));
8566 
8567  TUtil::adjustTopDaughters(vdaughters); // Adjust top daughter kinematics
8568  if (vdaughters.size()==3) antitopDaughters.push_back(vdaughters);
8569  }
8570  }
8571 
8572  }
8573  /***** END ASSOCIATED TOP OBJECTS *****/
8574  if (verbosity>=TVar::DEBUG){
8575  MELAout << "TUtil::GetBoostedParticleVectors: stableTops.size=" << stableTops.size() << endl;
8576  MELAout << "TUtil::GetBoostedParticleVectors: stableAntitops.size=" << stableAntitops.size() << endl;
8577  MELAout << "TUtil::GetBoostedParticleVectors: topDaughters.size=" << topDaughters.size() << endl;
8578  for (unsigned int itop=0; itop<topDaughters.size(); itop++) MELAout << "TUtil::GetBoostedParticleVectors: topDaughters.at(" << itop << ").size=" << topDaughters.at(itop).size() << endl;
8579  MELAout << "TUtil::GetBoostedParticleVectors: antitopDaughters.size=" << antitopDaughters.size() << endl;
8580  for (unsigned int itop=0; itop<antitopDaughters.size(); itop++) MELAout << "TUtil::GetBoostedParticleVectors: antitopDaughters.at(" << itop << ").size=" << antitopDaughters.at(itop).size() << endl;
8581  }
8582 
8583  /***** BOOSTS TO THE CORRECT PT=0 FRAME *****/
8584  // Gather all final state particles collected for this frame
8585  TLorentzVector pTotal(0, 0, 0, 0);
8586  for (SimpleParticle_t const& sp:daughters) pTotal = pTotal + sp.second;
8587  for (SimpleParticle_t const& sp:associated) pTotal = pTotal + sp.second;
8588  for (SimpleParticle_t const& sp:stableTops) pTotal = pTotal + sp.second;
8589  for (SimpleParticle_t const& sp:stableAntitops) pTotal = pTotal + sp.second;
8590  for (SimpleParticleCollection_t const& spc:topDaughters){ for (SimpleParticle_t const& sp:spc) pTotal = pTotal + sp.second; }
8591  for (SimpleParticleCollection_t const& spc:antitopDaughters){ for (SimpleParticle_t const& sp:spc) pTotal = pTotal + sp.second; }
8592 
8593  // Get the boost vector and boost all final state particles
8594  double qX = pTotal.X();
8595  double qY = pTotal.Y();
8596  double qE = pTotal.T();
8597  if ((qX*qX+qY*qY)>0.){
8598  TVector3 boostV(-qX/qE, -qY/qE, 0.);
8599  for (SimpleParticle_t& sp:daughters) sp.second.Boost(boostV);
8600  for (SimpleParticle_t& sp:associated) sp.second.Boost(boostV);
8601  for (SimpleParticle_t& sp:stableTops) sp.second.Boost(boostV);
8602  for (SimpleParticle_t& sp:stableAntitops) sp.second.Boost(boostV);
8603  for (SimpleParticleCollection_t& spc:topDaughters){ for (SimpleParticle_t& sp:spc) sp.second.Boost(boostV); }
8604  for (SimpleParticleCollection_t& spc:antitopDaughters){ for (SimpleParticle_t& sp:spc) sp.second.Boost(boostV); }
8605  pTotal.Boost(boostV);
8606  }
8607 
8608  // Mothers need special treatment:
8609  // In case they are undefined, mother id is unknown, and mothers are ordered as M1==(pz>0) and M2==(pz<0).
8610  // In case they are defined, mothers are first matched to the assumed momenta through their pz's.
8611  // They are ordered by M1==f, M2==fb afterward if this is possible.
8612  // Notice that the momenta of the mother objects are not actually used. If the event is truly a gen. particle, everything would be in the pT=0 frame to begin with, and everybody is happy in reweighting.
8613  double sysPz= pTotal.Z();
8614  double sysE = pTotal.T();
8615  double pz0 = (sysE+sysPz)/2.;
8616  double pz1 = -(sysE-sysPz)/2.;
8617  double E0 = pz0;
8618  double E1 = -pz1;
8619  int motherId[2]={ 0, 0 };
8620  if (melaCand->getNMothers()==2){
8621  for (int ip=0; ip<2; ip++) motherId[ip]=melaCand->getMother(ip)->id;
8622  // Match the "assumed" M'1==(larger signed pz) and M'2==(smaller signed pz) to the pz of the actual mothers:
8623  // Swap pZs to get the correct momentum matching default M1, M2.
8624  if (TMath::Sign(1., melaCand->getMother(0)->z()-melaCand->getMother(1)->z())!=TMath::Sign(1., pz0-pz1)){ swap(pz0, pz1); swap(E0, E1); }
8625  // Swap the ids of mothers and their pT=0-assumed momenta to achieve ordering as "incoming" q-qbar
8626  if ((motherId[0]<0 && motherId[1]>=0) || (motherId[1]>0 && motherId[0]<=0)){
8627  swap(pz0, pz1);
8628  swap(E0, E1);
8629  swap(motherId[0], motherId[1]);
8630  }
8631  }
8632  TLorentzVector pM[2];
8633  pM[0].SetXYZT(0., 0., pz0, E0);
8634  pM[1].SetXYZT(0., 0., pz1, E1);
8635 
8636  // Fill the ids of the V intermediates to the candidate daughters
8637  mela_event.intermediateVid.clear();
8638  TUtilHelpers::copyVector(idVstar, mela_event.intermediateVid);
8639  // Fill the mothers
8640  mela_event.pMothers.clear();
8641  for (unsigned int ip=0; ip<2; ip++){ mela_event.pMothers.push_back(SimpleParticle_t(motherId[ip], pM[ip])); }
8642  // Fill the daughters
8643  mela_event.pDaughters.clear();
8644  TUtilHelpers::copyVector(daughters, mela_event.pDaughters);
8645  // Fill the associated particles
8646  mela_event.pAssociated.clear();
8647  TUtilHelpers::copyVector(associated, mela_event.pAssociated);
8648  // Fill the stable tops and antitops
8649  mela_event.pStableTops.clear();
8650  TUtilHelpers::copyVector(stableTops, mela_event.pStableTops);
8651  mela_event.pStableAntitops.clear();
8652  TUtilHelpers::copyVector(stableAntitops, mela_event.pStableAntitops);
8653  // Fill the daughters of unstable tops and antitops
8654  mela_event.pTopDaughters.clear();
8655  TUtilHelpers::copyVector(topDaughters, mela_event.pTopDaughters);
8656  mela_event.pAntitopDaughters.clear();
8657  TUtilHelpers::copyVector(antitopDaughters, mela_event.pAntitopDaughters);
8658 
8659  // This is the end of one long function.
8660  if (verbosity>=TVar::DEBUG){
8661  MELAout << "TUtil::GetBoostedParticleVectors mela_event.intermediateVid.size=" << mela_event.intermediateVid.size() << endl;
8662  MELAout << "TUtil::GetBoostedParticleVectors mela_event.pMothers.size=" << mela_event.pMothers.size() << endl;
8663  MELAout << "TUtil::GetBoostedParticleVectors mela_event.pDaughters.size=" << mela_event.pDaughters.size() << endl;
8664  MELAout << "TUtil::GetBoostedParticleVectors mela_event.pAssociated.size=" << mela_event.pAssociated.size() << endl;
8665  MELAout << "TUtil::GetBoostedParticleVectors mela_event.pStableTops.size=" << mela_event.pStableTops.size() << endl;
8666  MELAout << "TUtil::GetBoostedParticleVectors mela_event.pStableAntitops.size=" << mela_event.pStableAntitops.size() << endl;
8667  MELAout << "TUtil::GetBoostedParticleVectors mela_event.pTopDaughters.size=" << mela_event.pTopDaughters.size() << endl;
8668  MELAout << "TUtil::GetBoostedParticleVectors mela_event.pAntitopDaughters.size=" << mela_event.pAntitopDaughters.size() << endl;
8669  MELAout << "End GetBoostedParticleVectors" << endl;
8670  }
8671 }

◆ GetCKMElement()

double TUtil::GetCKMElement ( int  iquark,
int  jquark 
)

Definition at line 1537 of file TUtil.cc.

1537  {
1538  return __modparameters_MOD_ckmbare(&iquark, &jquark);
1539 }

◆ GetDecayWidth() [1/2]

double TUtil::GetDecayWidth ( const MELAParticle part)

Definition at line 1641 of file TUtil.cc.

1641  {
1642  if (part==nullptr) return GetDecayWidth(-9000);
1643  return GetDecayWidth(part->id);
1644 }

◆ GetDecayWidth() [2/2]

double TUtil::GetDecayWidth ( int  ipart)

Definition at line 1619 of file TUtil.cc.

1619  {
1620  const int ipartabs = abs(ipart);
1621 
1622  // MCFM widths
1623  if (ipartabs==6) return masses_mcfm_.twidth;
1624  else if (ipartabs==15) return masses_mcfm_.tauwidth;
1625  else if (ipartabs==23) return masses_mcfm_.zwidth;
1626  else if (ipartabs==24) return masses_mcfm_.wwidth;
1627  else if (ipartabs==25) return masses_mcfm_.hwidth;
1628  else{
1629  // JHUGen widths
1630  const double GeV=1./100.;
1631  int jpart = convertLHEreverse(&ipart);
1632  double joutwidth = __modparameters_MOD_getdecaywidth(&jpart);
1633  double outwidth = joutwidth/GeV;
1634  return outwidth;
1635  }
1636 }

◆ GetMadgraphCKMElement()

complex< double > TUtil::GetMadgraphCKMElement ( int  iquark,
int  jquark 
)

Definition at line 1540 of file TUtil.cc.

1540  {
1541  switch(iquark){
1542  case 1:
1543  if(jquark == 1){
1544  return std::complex<double>(madMela::params_c_.mdl_ckm1x1[0], madMela::params_c_.mdl_ckm1x1[1]);
1545  } else if(jquark == 2){
1546  return std::complex<double>(madMela::params_c_.mdl_ckm1x2[0], madMela::params_c_.mdl_ckm1x2[1]);
1547  } else if(jquark == 3){
1548  return std::complex<double>(madMela::params_c_.mdl_ckm1x3[0], madMela::params_c_.mdl_ckm1x3[1]);
1549  } else{
1550  MELAerr << "TUtil::GetMadgraphCKMElement: Invalid second index!" << endl;
1551  }
1552  break;
1553  case 2:
1554  if(jquark == 1){
1555  return std::complex<double>(madMela::params_c_.mdl_ckm2x1[0], madMela::params_c_.mdl_ckm2x1[1]);
1556  } else if(jquark == 2){
1557  return std::complex<double>(madMela::params_c_.mdl_ckm2x2[0], madMela::params_c_.mdl_ckm2x2[1]);
1558  } else if(jquark == 3){
1559  return std::complex<double>(madMela::params_c_.mdl_ckm2x3[0], madMela::params_c_.mdl_ckm2x3[1]);
1560  } else{
1561  MELAerr << "TUtil::GetMadgraphCKMElement: Invalid second index!" << endl;
1562  }
1563  break;
1564  case 3:
1565  if(jquark == 1){
1566  return std::complex<double>(madMela::params_c_.mdl_ckm3x1[0], madMela::params_c_.mdl_ckm3x1[1]);
1567  } else if(jquark == 2){
1568  return std::complex<double>(madMela::params_c_.mdl_ckm3x2[0], madMela::params_c_.mdl_ckm3x2[1]);
1569  } else if(jquark == 3){
1570  return std::complex<double>(madMela::params_c_.mdl_ckm3x3[0], madMela::params_c_.mdl_ckm3x3[1]);
1571  } else{
1572  MELAerr << "TUtil::GetMadgraphCKMElement: Invalid second index!" << endl;
1573  }
1574  break;
1575  default:
1576  MELAerr << "TUtil::GetMadgraphCKMElement: Invalid first index!" << endl;
1577  break;
1578  }
1579  return std::complex<double>(0);
1580 }

◆ GetMass() [1/2]

double TUtil::GetMass ( const MELAParticle part)

Definition at line 1637 of file TUtil.cc.

1637  {
1638  if (part==nullptr) return GetMass(-9000);
1639  return GetMass(part->id);
1640 }

◆ GetMass() [2/2]

double TUtil::GetMass ( int  ipart)

Definition at line 1582 of file TUtil.cc.

1582  {
1583  const int ipartabs = abs(ipart);
1584 
1585  if (ipartabs==8) return spinzerohiggs_anomcoupl_.mt_4gen;
1586  else if (ipartabs==7) return spinzerohiggs_anomcoupl_.mb_4gen;
1587  else if (ipartabs==6) return masses_mcfm_.mt;
1588  else if (ipartabs==5) return masses_mcfm_.mb;
1589  else if (ipartabs==4) return masses_mcfm_.mc;
1590  else if (ipartabs==3) return masses_mcfm_.ms;
1591  else if (ipartabs==2) return masses_mcfm_.mu;
1592  else if (ipartabs==1) return masses_mcfm_.md;
1593  else if (ipartabs==11) return masses_mcfm_.mel;
1594  else if (ipartabs==13) return masses_mcfm_.mmu;
1595  else if (ipartabs==15) return masses_mcfm_.mtau;
1596  else if (ipartabs==23) return masses_mcfm_.zmass;
1597  else if (ipartabs==24) return masses_mcfm_.wmass;
1598  else if (ipartabs==25) return masses_mcfm_.hmass;
1599  else{
1600  // JHUGen masses
1601  if (
1602  ipartabs<=6 // (d, u, s, c, b, t)
1603  ||
1604  (ipartabs>=11 && ipartabs<=16) // (l, nu) x (e, mu, tau)
1605  ||
1606  ipartabs==23 || ipartabs==24 || ipartabs==25 // Z, W, H
1607  ||
1608  ipartabs==32 || ipartabs==34 // Z', W+-'
1609  ){
1610  const double GeV=1./100.;
1611  int jpart = convertLHEreverse(&ipart);
1612  double joutmass = __modparameters_MOD_getmass(&jpart);
1613  double outmass = joutmass/GeV;
1614  return outmass;
1615  }
1616  else return 0;
1617  }
1618 }

◆ GetMassWidth() [1/2]

void TUtil::GetMassWidth ( const MELAParticle part,
double &  m,
double &  ga 
)

Definition at line 1649 of file TUtil.cc.

1649  {
1650  if (part==nullptr) return GetMassWidth(-9000, m, ga);
1651  return GetMassWidth(part->id, m, ga);
1652 }

◆ GetMassWidth() [2/2]

void TUtil::GetMassWidth ( int  ipart,
double &  m,
double &  ga 
)

Definition at line 1645 of file TUtil.cc.

1645  {
1646  m=TUtil::GetMass(ipart);
1647  ga=TUtil::GetDecayWidth(ipart);
1648 }

◆ GetMCFMParticleLabel()

TString TUtil::GetMCFMParticleLabel ( const int &  pid,
bool  useQJ,
bool  useExtendedConventions 
)

Definition at line 3304 of file TUtil.cc.

3304  {
3305  if (PDGHelpers::isAnUnknownJet(pid)){
3306  if (useQJ) return TString("qj");
3307  else return TString("pp");
3308  }
3309  else if (PDGHelpers::isAGluon(pid)) return TString("ig");
3310  else if (pid==1) return TString("dq");
3311  else if (pid==2) return TString("uq");
3312  else if (pid==3) return TString("sq");
3313  else if (pid==4) return TString("cq");
3314  else if (pid==5) return TString("bq");
3315  else if (pid==-1) return TString("da");
3316  else if (pid==-2) return TString("ua");
3317  else if (pid==-3) return TString("sa");
3318  else if (pid==-4) return TString("ca");
3319  else if (pid==-5) return TString("ba");
3320  else if (abs(pid)==6) return TString("qj"); // No tops!
3321  else if (pid==11) return TString("el");
3322  else if (pid==13) return TString("ml");
3323  else if (pid==15) return TString("tl");
3324  else if (pid==-11) return TString("ea");
3325  else if (pid==-13) return TString("ma");
3326  else if (pid==-15) return TString("ta");
3327  else if (std::abs(pid)>=12 && std::abs(pid)<=16){
3328  if (!useExtendedConventions){
3329  if (pid>0) return TString("nl");
3330  else return TString("na");
3331  }
3332  else{
3333  if (pid==12) return TString("ne");
3334  else if (pid==14) return TString("nm");
3335  else if (pid==16) return TString("nt");
3336  else if (pid==-12) return TString("ke");
3337  else if (pid==-14) return TString("km");
3338  else/* if (pid==-16)*/ return TString("kt");
3339  }
3340  }
3341  else return TString(" ");
3342 }

◆ HJJMatEl()

double TUtil::HJJMatEl ( const TVar::Process process,
const TVar::Production production,
const TVar::MatrixElement matrixElement,
TVar::event_scales_type event_scales,
MelaIO RcdME,
const double &  EBEAM,
TVar::VerbosityLevel  verbosity 
)

Definition at line 5383 of file TUtil.cc.

5388  {
5389  const double GeV=1./100.; // JHUGen mom. scale factor
5390  double sum_msqjk = 0;
5391  // by default assume only gg productions
5392  // FOTRAN convention -5 -4 -3 -2 -1 0 1 2 3 4 5
5393  // parton flavor bbar cbar sbar ubar dbar g d u s c b
5394  // C++ convention 0 1 2 3 4 5 6 7 8 9 10
5395  //2-D matrix is reversed in fortran
5396  // msq[ parton2 ] [ parton1 ]
5397  // flavor_msq[jj][ii] = fx1[ii]*fx2[jj]*msq[jj][ii];
5398  double MatElsq[nmsq][nmsq]={ { 0 } };
5399  double MatElsq_tmp[nmsq][nmsq]={ { 0 } }; // For H+J
5400  double msq_tmp=0; // For "*_exact"
5401 
5402  if (matrixElement!=TVar::JHUGen){ if (verbosity>=TVar::ERROR) MELAerr << "TUtil::HJJMatEl: Non-JHUGen MEs are not supported" << endl; return sum_msqjk; }
5403  if (!(production == TVar::JJQCD || production == TVar::JJVBF || production == TVar::JQCD)){ if (verbosity>=TVar::ERROR) MELAerr << "TUtil::HJJMatEl: Production is not supported!" << endl; return sum_msqjk; }
5404 
5405  // Notice that partIncCode is specific for this subroutine
5406  int nRequested_AssociatedJets=2;
5407  if (production == TVar::JQCD) nRequested_AssociatedJets=1;
5408  int partIncCode=TVar::kUseAssociated_Jets; // Only use associated partons in the pT=0 frame boost
5409  simple_event_record mela_event;
5410  mela_event.AssociationCode=partIncCode;
5411  mela_event.nRequested_AssociatedJets=nRequested_AssociatedJets;
5413  RcdME->melaCand,
5414  mela_event,
5415  verbosity
5416  );
5417  if (mela_event.pAssociated.size()==0){ if (verbosity>=TVar::ERROR) MELAerr << "TUtil::HJJMatEl: Number of associated particles is 0!" << endl; return sum_msqjk; }
5418 
5419  int MYIDUP_tmp[4]={ 0 }; // "Incoming" partons 1, 2, "outgoing" partons 3, 4
5420  double p4[5][4]={ { 0 } };
5421  double pOneJet[4][4] ={ { 0 } }; // For HJ
5422  TLorentzVector MomStore[mxpart];
5423  for (int i = 0; i < mxpart; i++) MomStore[i].SetXYZT(0, 0, 0, 0);
5424 
5425  // p4(0:4,i) = (E(i),px(i),py(i),pz(i))
5426  // i=0,1: g1,g2 or q1, qb2 (outgoing convention)
5427  // i=2,3: J1, J2 in outgoing convention when possible
5428  // i=4: H
5429  for (int ipar=0; ipar<2; ipar++){
5430  TLorentzVector* momTmp = &(mela_event.pMothers.at(ipar).second);
5431  int* idtmp = &(mela_event.pMothers.at(ipar).first);
5432  if (!PDGHelpers::isAnUnknownJet(*idtmp)) MYIDUP_tmp[ipar] = *idtmp;
5433  else MYIDUP_tmp[ipar] = 0;
5434  if (momTmp->T()>0.){
5435  p4[ipar][0] = momTmp->T()*GeV;
5436  p4[ipar][1] = momTmp->X()*GeV;
5437  p4[ipar][2] = momTmp->Y()*GeV;
5438  p4[ipar][3] = momTmp->Z()*GeV;
5439  MomStore[ipar] = (*momTmp);
5440  }
5441  else{
5442  p4[ipar][0] = -momTmp->T()*GeV;
5443  p4[ipar][1] = -momTmp->X()*GeV;
5444  p4[ipar][2] = -momTmp->Y()*GeV;
5445  p4[ipar][3] = -momTmp->Z()*GeV;
5446  MomStore[ipar] = -(*momTmp);
5447  MYIDUP_tmp[ipar] = -MYIDUP_tmp[ipar];
5448  }
5449  }
5450  for (unsigned int ipar=0; ipar<2; ipar++){
5451  if (ipar<mela_event.pAssociated.size()){
5452  TLorentzVector* momTmp = &(mela_event.pAssociated.at(ipar).second);
5453  int* idtmp = &(mela_event.pAssociated.at(ipar).first);
5454  if (!PDGHelpers::isAnUnknownJet(*idtmp)) MYIDUP_tmp[ipar+2] = *idtmp;
5455  else MYIDUP_tmp[ipar+2] = 0;
5456  p4[ipar+2][0] = momTmp->T()*GeV;
5457  p4[ipar+2][1] = momTmp->X()*GeV;
5458  p4[ipar+2][2] = momTmp->Y()*GeV;
5459  p4[ipar+2][3] = momTmp->Z()*GeV;
5460  MomStore[ipar+6] = (*momTmp); // i==(2, 3, 4) is (J1, J2, H), recorded as MomStore (I1, I2, 0, 0, 0, H, J1, J2)
5461  }
5462  else MYIDUP_tmp[ipar+2] = -9000; // No need to set p4, which is already 0 by initialization
5463  }
5464  for (unsigned int ipar=0; ipar<mela_event.pDaughters.size(); ipar++){
5465  TLorentzVector* momTmp = &(mela_event.pDaughters.at(ipar).second);
5466  p4[4][0] += momTmp->T()*GeV;
5467  p4[4][1] += momTmp->X()*GeV;
5468  p4[4][2] += momTmp->Y()*GeV;
5469  p4[4][3] += momTmp->Z()*GeV;
5470  MomStore[5] = MomStore[5] + (*momTmp); // i==(2, 3, 4) is (J1, J2, H), recorded as MomStore (I1, I2, 0, 0, 0, H, J1, J2)
5471  }
5472  // Momenta for HJ
5473  for (unsigned int i = 0; i < 4; i++){
5474  if (i<2){ for (unsigned int j = 0; j < 4; j++) pOneJet[i][j] = p4[i][j]; } // p1 p2
5475  else if (i==2){ for (unsigned int j = 0; j < 4; j++) pOneJet[i][j] = p4[4][j]; } // H
5476  else{ for (unsigned int j = 0; j < 4; j++) pOneJet[i][j] = p4[2][j]; } // J1
5477  }
5478  if (verbosity >= TVar::DEBUG){
5479  for (unsigned int i=0; i<5; i++) MELAout << "p["<<i<<"] (Px, Py, Pz, E, M):\t" << p4[i][1]/GeV << '\t' << p4[i][2]/GeV << '\t' << p4[i][3]/GeV << '\t' << p4[i][0]/GeV << '\t' << sqrt(fabs(pow(p4[i][0], 2)-pow(p4[i][1], 2)-pow(p4[i][2], 2)-pow(p4[i][3], 2)))/GeV << endl;
5480  MELAout << "One-jet momenta: " << endl;
5481  for (unsigned int i=0; i<4; i++) MELAout << "pOneJet["<<i<<"] (Px, Py, Pz, E, M):\t" << pOneJet[i][1]/GeV << '\t' << pOneJet[i][2]/GeV << '\t' << pOneJet[i][3]/GeV << '\t' << pOneJet[i][0]/GeV << '\t' << sqrt(fabs(pow(pOneJet[i][0], 2)-pow(pOneJet[i][1], 2)-pow(pOneJet[i][2], 2)-pow(pOneJet[i][3], 2)))/GeV << endl;
5482  }
5483 
5484  double defaultRenScale = scale_.scale;
5485  double defaultFacScale = facscale_.facscale;
5486  int defaultNloop = nlooprun_.nlooprun;
5487  int defaultNflav = nflav_.nflav;
5488  string defaultPdflabel = pdlabel_.pdlabel;
5489  double renQ = InterpretScaleScheme(production, matrixElement, event_scales->renomalizationScheme, MomStore);
5490  double facQ = InterpretScaleScheme(production, matrixElement, event_scales->factorizationScheme, MomStore);
5491  SetAlphaS(renQ, facQ, event_scales->ren_scale_factor, event_scales->fac_scale_factor, 1, 5, "cteq6_l");
5492  double alphasVal, alphasmzVal;
5493  GetAlphaS(&alphasVal, &alphasmzVal);
5494  RcdME->setRenormalizationScale(renQ);
5495  RcdME->setFactorizationScale(facQ);
5496  RcdME->setAlphaS(alphasVal);
5497  RcdME->setAlphaSatMZ(alphasmzVal);
5498  RcdME->setHiggsMassWidth(masses_mcfm_.hmass, masses_mcfm_.hwidth, 0);
5500  if (verbosity>=TVar::DEBUG){
5501  MELAout
5502  << "TUtil::HJJMatEl: Set AlphaS:\n"
5503  << "\tBefore set, alphas scale: " << defaultRenScale << ", PDF scale: " << defaultFacScale << '\n'
5504  << "\trenQ: " << renQ << " ( x " << event_scales->ren_scale_factor << "), facQ: " << facQ << " ( x " << event_scales->fac_scale_factor << ")\n"
5505  << "\tAfter set, alphas scale: " << scale_.scale << ", PDF scale: " << facscale_.facscale << ", alphas(Qren): " << alphasVal << ", alphas(MZ): " << alphasmzVal << endl;
5506  }
5507 
5508  // Since we have a lot of these checks, do them here.
5509  bool partonIsUnknown[4];
5510  for (unsigned int ip=0; ip<4; ip++) partonIsUnknown[ip] = (MYIDUP_tmp[ip]==0);
5511 
5512  // NOTE ON HJ AND HJJ CHANNEL HASHES:
5513  // THEY ONLY RETURN ISEL>=JSEL CASES. ISEL<JSEL NEEDS TO BE DONE MANUALLY.
5514  if (production == TVar::JQCD){ // Computation is already for all possible qqb/qg/qbg/gg, and incoming q, qb and g flavor have 1-1 correspondence to the outgoing jet flavor.
5515  __modhiggsj_MOD_evalamp_hj(pOneJet, MatElsq_tmp);
5516  for (int isel=-5; isel<=5; isel++){
5517  if (!partonIsUnknown[0] && !((PDGHelpers::isAGluon(MYIDUP_tmp[0]) && isel==0) || MYIDUP_tmp[0]==isel)) continue;
5518  for (int jsel=-5; jsel<=5; jsel++){
5519  if (!partonIsUnknown[1] && !((PDGHelpers::isAGluon(MYIDUP_tmp[1]) && jsel==0) || MYIDUP_tmp[1]==jsel)) continue;
5520  int rsel;
5521  if (isel!=0 && jsel!=0) rsel=0; // Covers qqb->Hg
5522  else if (isel==0) rsel=jsel; // Covers gg->Hg, gq->Hq, gqb->Hqb
5523  else rsel=isel; // Covers qg->Hq, qbg->Hqb
5524  if (!partonIsUnknown[2] && !((PDGHelpers::isAGluon(MYIDUP_tmp[2]) && rsel==0) || MYIDUP_tmp[2]==rsel)) continue;
5525  MatElsq[jsel+5][isel+5] = MatElsq_tmp[jsel+5][isel+5]; // Assign only those that match gen. info, if present at all.
5526  if (verbosity >= TVar::DEBUG) MELAout << "Channel (isel, jsel)=" << isel << ", " << jsel << endl;
5527  }
5528  }
5529  }
5530  else if (production == TVar::JJQCD){
5531  const std::vector<TNumericUtil::intTriplet_t>& ijsel = Get_JHUGenHash_OnshellHJJHash();
5532  int nijchannels = ijsel.size();
5533  for (int ic=0; ic<nijchannels; ic++){
5534  // Emulate EvalWeighted_HJJ_test
5535  int isel = ijsel[ic][0];
5536  int jsel = ijsel[ic][1];
5537  int code = ijsel[ic][2];
5538 
5539  if (verbosity >= TVar::DEBUG_VERBOSE) MELAout << "HJJ channel " << ic << " code " << code << endl;
5540 
5541  // Default assignments
5542  if (verbosity >= TVar::DEBUG_VERBOSE) MELAout << "HJJ mother unswapped case" << endl;
5543  int rsel=isel;
5544  int ssel=jsel;
5545 
5546  if (
5547  (partonIsUnknown[0] || ((PDGHelpers::isAGluon(MYIDUP_tmp[0]) && isel==0) || MYIDUP_tmp[0]==isel))
5548  &&
5549  (partonIsUnknown[1] || ((PDGHelpers::isAGluon(MYIDUP_tmp[1]) && jsel==0) || MYIDUP_tmp[1]==jsel))
5550  ){ // Do it this way to be able to swap isel and jsel later
5551 
5552  if (isel==0 && jsel==0){ // gg->?
5553  if (code==2){ // gg->qqb
5554  // Only compute u-ub. The amplitude is multiplied by nf=5
5555  rsel=1;
5556  ssel=-1;
5557  if (
5558  (partonIsUnknown[2] || (PDGHelpers::isAQuark(MYIDUP_tmp[2]) && MYIDUP_tmp[2]>0))
5559  &&
5560  (partonIsUnknown[3] || (PDGHelpers::isAQuark(MYIDUP_tmp[3]) && MYIDUP_tmp[3]<0))
5561  ){
5562  __modhiggsjj_MOD_evalamp_sbfh_unsymm_sa_select_exact(p4, &isel, &jsel, &rsel, &ssel, &msq_tmp);
5563  MatElsq[jsel+5][isel+5] += msq_tmp; // Assign only those that match gen. info, if present at all.
5564  if (verbosity >= TVar::DEBUG_VERBOSE) MELAout << "Channel (isel, jsel, rsel, ssel)=" << isel << ", " << jsel << ", " << rsel << ", " << ssel << '\t' << msq_tmp << endl;
5565  }
5566  if (
5567  (partonIsUnknown[2] || (PDGHelpers::isAQuark(MYIDUP_tmp[2]) && MYIDUP_tmp[2]<0))
5568  &&
5569  (partonIsUnknown[3] || (PDGHelpers::isAQuark(MYIDUP_tmp[3]) && MYIDUP_tmp[3]>0))
5570  ){
5571  __modhiggsjj_MOD_evalamp_sbfh_unsymm_sa_select_exact(p4, &isel, &jsel, &ssel, &rsel, &msq_tmp);
5572  MatElsq[jsel+5][isel+5] += msq_tmp; // Assign only those that match gen. info, if present at all.
5573  if (verbosity >= TVar::DEBUG_VERBOSE) MELAout << "Channel (isel, jsel, rsel, ssel)=" << isel << ", " << jsel << ", " << ssel << ", " << rsel << '\t' << msq_tmp << endl;
5574  }
5575  }
5576  else{ // gg->gg
5577  // rsel=ssel=g already
5578  if (
5579  (partonIsUnknown[2] || (PDGHelpers::isAGluon(MYIDUP_tmp[2]) && rsel==0))
5580  &&
5581  (partonIsUnknown[3] || (PDGHelpers::isAGluon(MYIDUP_tmp[3]) && ssel==0))
5582  ){
5583  __modhiggsjj_MOD_evalamp_sbfh_unsymm_sa_select_exact(p4, &isel, &jsel, &rsel, &ssel, &msq_tmp);
5584  MatElsq[jsel+5][isel+5] += msq_tmp; // Assign only those that match gen. info, if present at all.
5585  if (verbosity >= TVar::DEBUG_VERBOSE) MELAout << "Channel (isel, jsel, rsel, ssel)=" << isel << ", " << jsel << ", " << rsel << ", " << ssel << '\t' << msq_tmp << endl;
5586  }
5587  }
5588  }
5589  else if (isel==0 || jsel==0){ // qg/qbg/gq/gqb->qg/qbg/gq/gqb
5590  if (
5591  (partonIsUnknown[2] || ((PDGHelpers::isAGluon(MYIDUP_tmp[2]) && rsel==0) || MYIDUP_tmp[2]==rsel))
5592  &&
5593  (partonIsUnknown[3] || ((PDGHelpers::isAGluon(MYIDUP_tmp[3]) && ssel==0) || MYIDUP_tmp[3]==ssel))
5594  ){
5595  __modhiggsjj_MOD_evalamp_sbfh_unsymm_sa_select_exact(p4, &isel, &jsel, &rsel, &ssel, &msq_tmp);
5596  MatElsq[jsel+5][isel+5] += msq_tmp; // Assign only those that match gen. info, if present at all.
5597  if (verbosity >= TVar::DEBUG_VERBOSE) MELAout << "Channel (isel, jsel, rsel, ssel)=" << isel << ", " << jsel << ", " << rsel << ", " << ssel << '\t' << msq_tmp << endl;
5598  }
5599  if (
5600  (partonIsUnknown[2] || ((PDGHelpers::isAGluon(MYIDUP_tmp[2]) && ssel==0) || MYIDUP_tmp[2]==ssel))
5601  &&
5602  (partonIsUnknown[3] || ((PDGHelpers::isAGluon(MYIDUP_tmp[3]) && rsel==0) || MYIDUP_tmp[3]==rsel))
5603  ){
5604  __modhiggsjj_MOD_evalamp_sbfh_unsymm_sa_select_exact(p4, &isel, &jsel, &ssel, &rsel, &msq_tmp);
5605  MatElsq[jsel+5][isel+5] += msq_tmp; // Assign only those that match gen. info, if present at all.
5606  if (verbosity >= TVar::DEBUG_VERBOSE) MELAout << "Channel (isel, jsel, rsel, ssel)=" << isel << ", " << jsel << ", " << ssel << ", " << rsel << '\t' << msq_tmp << endl;
5607  }
5608  }
5609  else if ((isel>0 && jsel<0) || (isel<0 && jsel>0)){ // qQb/qbQ->?
5610  if (code==1 && isel==-jsel){ // qqb/qbq->gg
5611  rsel=0; ssel=0;
5612  if (
5613  (partonIsUnknown[2] || PDGHelpers::isAGluon(MYIDUP_tmp[2]))
5614  &&
5615  (partonIsUnknown[3] || PDGHelpers::isAGluon(MYIDUP_tmp[3]))
5616  ){
5617  __modhiggsjj_MOD_evalamp_sbfh_unsymm_sa_select_exact(p4, &isel, &jsel, &rsel, &ssel, &msq_tmp);
5618  MatElsq[jsel+5][isel+5] += msq_tmp; // Assign only those that match gen. info, if present at all.
5619  if (verbosity >= TVar::DEBUG_VERBOSE) MELAout << "Channel (isel, jsel, rsel, ssel)=" << isel << ", " << jsel << ", " << rsel << ", " << ssel << '\t' << msq_tmp << endl;
5620  }
5621  }
5622  else if (code==3 && isel==-jsel){ // qqb->QQb
5623  if (abs(isel)!=1){ rsel=1; ssel=-1; } // Make sure rsel, ssel are not of same flavor as isel, jsel
5624  else{ rsel=2; ssel=-2; }
5625  // The amplitude is aready multiplied by nf-1, so no need to calculate everything (nf-1) times.
5626  if (
5627  (partonIsUnknown[2] && partonIsUnknown[3])
5628  ||
5629  (partonIsUnknown[2] && std::abs(MYIDUP_tmp[3])!=std::abs(isel) && MYIDUP_tmp[3]<0)
5630  ||
5631  (std::abs(MYIDUP_tmp[2])!=std::abs(isel) && MYIDUP_tmp[2]>0 && partonIsUnknown[3])
5632  ||
5633  (std::abs(MYIDUP_tmp[2])!=std::abs(isel) && MYIDUP_tmp[2]==-MYIDUP_tmp[3] && MYIDUP_tmp[2]>0)
5634  ){
5635  __modhiggsjj_MOD_evalamp_sbfh_unsymm_sa_select_exact(p4, &isel, &jsel, &rsel, &ssel, &msq_tmp);
5636  MatElsq[jsel+5][isel+5] += msq_tmp; // Assign only those that match gen. info, if present at all.
5637  if (verbosity >= TVar::DEBUG_VERBOSE) MELAout << "Channel (isel, jsel, rsel, ssel)=" << isel << ", " << jsel << ", " << rsel << ", " << ssel << '\t' << msq_tmp << endl;
5638  }
5639  if (
5640  (partonIsUnknown[2] && partonIsUnknown[3])
5641  ||
5642  (partonIsUnknown[2] && std::abs(MYIDUP_tmp[3])!=std::abs(isel) && MYIDUP_tmp[3]>0)
5643  ||
5644  (std::abs(MYIDUP_tmp[2])!=std::abs(isel) && MYIDUP_tmp[2]<0 && partonIsUnknown[3])
5645  ||
5646  (std::abs(MYIDUP_tmp[2])!=std::abs(isel) && MYIDUP_tmp[2]==-MYIDUP_tmp[3] && MYIDUP_tmp[2]<0)
5647  ){
5648  __modhiggsjj_MOD_evalamp_sbfh_unsymm_sa_select_exact(p4, &isel, &jsel, &ssel, &rsel, &msq_tmp);
5649  MatElsq[jsel+5][isel+5] += msq_tmp; // Assign only those that match gen. info, if present at all.
5650  if (verbosity >= TVar::DEBUG_VERBOSE) MELAout << "Channel (isel, jsel, rsel, ssel)=" << isel << ", " << jsel << ", " << ssel << ", " << rsel << '\t' << msq_tmp << endl;
5651  }
5652  }
5653  else{ // qQb/qbQ->qQb/qbQ
5654  if (
5655  (partonIsUnknown[2] || MYIDUP_tmp[2]==rsel)
5656  &&
5657  (partonIsUnknown[3] || MYIDUP_tmp[3]==ssel)
5658  ){
5659  __modhiggsjj_MOD_evalamp_sbfh_unsymm_sa_select_exact(p4, &isel, &jsel, &rsel, &ssel, &msq_tmp);
5660  MatElsq[jsel+5][isel+5] += msq_tmp; // Assign only those that match gen. info, if present at all.
5661  if (verbosity >= TVar::DEBUG_VERBOSE) MELAout << "Channel (isel, jsel, rsel, ssel)=" << isel << ", " << jsel << ", " << rsel << ", " << ssel << '\t' << msq_tmp << endl;
5662  }
5663  if (
5664  (partonIsUnknown[2] || MYIDUP_tmp[2]==ssel)
5665  &&
5666  (partonIsUnknown[3] || MYIDUP_tmp[3]==rsel)
5667  ){
5668  __modhiggsjj_MOD_evalamp_sbfh_unsymm_sa_select_exact(p4, &isel, &jsel, &ssel, &rsel, &msq_tmp);
5669  MatElsq[jsel+5][isel+5] += msq_tmp; // Assign only those that match gen. info, if present at all.
5670  if (verbosity >= TVar::DEBUG_VERBOSE) MELAout << "Channel (isel, jsel, rsel, ssel)=" << isel << ", " << jsel << ", " << rsel << ", " << ssel << '\t' << msq_tmp << endl;
5671  }
5672  }
5673  }
5674  else{
5675  if (
5676  (partonIsUnknown[2] || MYIDUP_tmp[2]==rsel)
5677  &&
5678  (partonIsUnknown[3] || MYIDUP_tmp[3]==ssel)
5679  ){
5680  __modhiggsjj_MOD_evalamp_sbfh_unsymm_sa_select_exact(p4, &isel, &jsel, &rsel, &ssel, &msq_tmp);
5681  MatElsq[jsel+5][isel+5] += msq_tmp; // Assign only those that match gen. info, if present at all.
5682  if (verbosity >= TVar::DEBUG_VERBOSE) MELAout << "Channel (isel, jsel, rsel, ssel)=" << isel << ", " << jsel << ", " << rsel << ", " << ssel << '\t' << msq_tmp << endl;
5683  }
5684  if (
5685  rsel!=ssel
5686  &&
5687  (partonIsUnknown[2] || MYIDUP_tmp[2]==ssel)
5688  &&
5689  (partonIsUnknown[3] || MYIDUP_tmp[3]==rsel)
5690  ){
5691  __modhiggsjj_MOD_evalamp_sbfh_unsymm_sa_select_exact(p4, &isel, &jsel, &ssel, &rsel, &msq_tmp);
5692  MatElsq[jsel+5][isel+5] += msq_tmp; // Assign only those that match gen. info, if present at all.
5693  if (verbosity >= TVar::DEBUG_VERBOSE) MELAout << "Channel (isel, jsel, rsel, ssel)=" << isel << ", " << jsel << ", " << ssel << ", " << rsel << '\t' << msq_tmp << endl;
5694  }
5695  }
5696  } // End unswapped isel>=jsel cases
5697 
5698  if (isel==jsel) continue;
5699  isel = ijsel[ic][1];
5700  jsel = ijsel[ic][0];
5701 
5702  if (verbosity >= TVar::DEBUG_VERBOSE) MELAout << "HJJ mother swapped case" << endl;
5703  // Reset to default assignments
5704  rsel=isel;
5705  ssel=jsel;
5706 
5707  if (
5708  (partonIsUnknown[0] || ((PDGHelpers::isAGluon(MYIDUP_tmp[0]) && isel==0) || MYIDUP_tmp[0]==isel))
5709  &&
5710  (partonIsUnknown[1] || ((PDGHelpers::isAGluon(MYIDUP_tmp[1]) && jsel==0) || MYIDUP_tmp[1]==jsel))
5711  ){
5712  // isel==jsel==0 is already eliminated by isel!=jsel condition
5713  if (isel==0 || jsel==0){ // qg/qbg/gq/gqb->qg/qbg/gq/gqb
5714  if (
5715  (partonIsUnknown[2] || ((PDGHelpers::isAGluon(MYIDUP_tmp[2]) && rsel==0) || MYIDUP_tmp[2]==rsel))
5716  &&
5717  (partonIsUnknown[3] || ((PDGHelpers::isAGluon(MYIDUP_tmp[3]) && ssel==0) || MYIDUP_tmp[3]==ssel))
5718  ){
5719  __modhiggsjj_MOD_evalamp_sbfh_unsymm_sa_select_exact(p4, &isel, &jsel, &rsel, &ssel, &msq_tmp);
5720  MatElsq[jsel+5][isel+5] += msq_tmp; // Assign only those that match gen. info, if present at all.
5721  if (verbosity >= TVar::DEBUG_VERBOSE) MELAout << "Channel (isel, jsel, rsel, ssel)=" << isel << ", " << jsel << ", " << rsel << ", " << ssel << '\t' << msq_tmp << endl;
5722  }
5723  if (
5724  (partonIsUnknown[2] || ((PDGHelpers::isAGluon(MYIDUP_tmp[2]) && ssel==0) || MYIDUP_tmp[2]==ssel))
5725  &&
5726  (partonIsUnknown[3] || ((PDGHelpers::isAGluon(MYIDUP_tmp[3]) && rsel==0) || MYIDUP_tmp[3]==rsel))
5727  ){
5728  __modhiggsjj_MOD_evalamp_sbfh_unsymm_sa_select_exact(p4, &isel, &jsel, &ssel, &rsel, &msq_tmp);
5729  MatElsq[jsel+5][isel+5] += msq_tmp; // Assign only those that match gen. info, if present at all.
5730  if (verbosity >= TVar::DEBUG_VERBOSE) MELAout << "Channel (isel, jsel, rsel, ssel)=" << isel << ", " << jsel << ", " << ssel << ", " << rsel << '\t' << msq_tmp << endl;
5731  }
5732  }
5733  else if ((isel>0 && jsel<0) || (isel<0 && jsel>0)){ // qQb/qbQ->?
5734  if (code==1 && isel==-jsel){ // qqb/qbq->gg
5735  rsel=0; ssel=0;
5736  if (
5737  (partonIsUnknown[2] || PDGHelpers::isAGluon(MYIDUP_tmp[2]))
5738  &&
5739  (partonIsUnknown[3] || PDGHelpers::isAGluon(MYIDUP_tmp[3]))
5740  ){
5741  __modhiggsjj_MOD_evalamp_sbfh_unsymm_sa_select_exact(p4, &isel, &jsel, &rsel, &ssel, &msq_tmp);
5742  MatElsq[jsel+5][isel+5] += msq_tmp; // Assign only those that match gen. info, if present at all.
5743  if (verbosity >= TVar::DEBUG_VERBOSE) MELAout << "Channel (isel, jsel, rsel, ssel)=" << isel << ", " << jsel << ", " << rsel << ", " << ssel << '\t' << msq_tmp << endl;
5744  }
5745  }
5746  else if(code==3 && isel==-jsel){ // qqb->QQb
5747  if (abs(isel)!=1){ rsel=1; ssel=-1; } // Make sure rsel, ssel are not of same flavor as isel, jsel
5748  else{ rsel=2; ssel=-2; }
5749  // The amplitude is aready multiplied by nf-1, so no need to calculate everything (nf-1) times.
5750  if (
5751  (partonIsUnknown[2] && partonIsUnknown[3])
5752  ||
5753  (partonIsUnknown[2] && std::abs(MYIDUP_tmp[3])!=std::abs(isel) && MYIDUP_tmp[3]<0)
5754  ||
5755  (std::abs(MYIDUP_tmp[2])!=std::abs(isel) && MYIDUP_tmp[2]>0 && partonIsUnknown[3])
5756  ||
5757  (std::abs(MYIDUP_tmp[2])!=std::abs(isel) && MYIDUP_tmp[2]==-MYIDUP_tmp[3] && MYIDUP_tmp[2]>0)
5758  ){
5759  __modhiggsjj_MOD_evalamp_sbfh_unsymm_sa_select_exact(p4, &isel, &jsel, &rsel, &ssel, &msq_tmp);
5760  MatElsq[jsel+5][isel+5] += msq_tmp; // Assign only those that match gen. info, if present at all.
5761  if (verbosity >= TVar::DEBUG_VERBOSE) MELAout << "Channel (isel, jsel, rsel, ssel)=" << isel << ", " << jsel << ", " << rsel << ", " << ssel << '\t' << msq_tmp << endl;
5762  }
5763  if (
5764  (partonIsUnknown[2] && partonIsUnknown[3])
5765  ||
5766  (partonIsUnknown[2] && std::abs(MYIDUP_tmp[3])!=std::abs(isel) && MYIDUP_tmp[3]>0)
5767  ||
5768  (std::abs(MYIDUP_tmp[2])!=std::abs(isel) && MYIDUP_tmp[2]<0 && partonIsUnknown[3])
5769  ||
5770  (std::abs(MYIDUP_tmp[2])!=std::abs(isel) && MYIDUP_tmp[2]==-MYIDUP_tmp[3] && MYIDUP_tmp[2]<0)
5771  ){
5772  __modhiggsjj_MOD_evalamp_sbfh_unsymm_sa_select_exact(p4, &isel, &jsel, &ssel, &rsel, &msq_tmp);
5773  MatElsq[jsel+5][isel+5] += msq_tmp; // Assign only those that match gen. info, if present at all.
5774  if (verbosity >= TVar::DEBUG_VERBOSE) MELAout << "Channel (isel, jsel, rsel, ssel)=" << isel << ", " << jsel << ", " << ssel << ", " << rsel << '\t' << msq_tmp << endl;
5775  }
5776  }
5777  else{ // qQb/qbQ->qQb/qbQ
5778  if (
5779  (partonIsUnknown[2] || MYIDUP_tmp[2]==rsel)
5780  &&
5781  (partonIsUnknown[3] || MYIDUP_tmp[3]==ssel)
5782  ){
5783  __modhiggsjj_MOD_evalamp_sbfh_unsymm_sa_select_exact(p4, &isel, &jsel, &rsel, &ssel, &msq_tmp);
5784  MatElsq[jsel+5][isel+5] += msq_tmp; // Assign only those that match gen. info, if present at all.
5785  if (verbosity >= TVar::DEBUG_VERBOSE) MELAout << "Channel (isel, jsel, rsel, ssel)=" << isel << ", " << jsel << ", " << rsel << ", " << ssel << '\t' << msq_tmp << endl;
5786  }
5787  if (
5788  (partonIsUnknown[2] || MYIDUP_tmp[2]==ssel)
5789  &&
5790  (partonIsUnknown[3] || MYIDUP_tmp[3]==rsel)
5791  ){
5792  __modhiggsjj_MOD_evalamp_sbfh_unsymm_sa_select_exact(p4, &isel, &jsel, &ssel, &rsel, &msq_tmp);
5793  MatElsq[jsel+5][isel+5] += msq_tmp; // Assign only those that match gen. info, if present at all.
5794  if (verbosity >= TVar::DEBUG_VERBOSE) MELAout << "Channel (isel, jsel, rsel, ssel)=" << isel << ", " << jsel << ", " << ssel << ", " << rsel << '\t' << msq_tmp << endl;
5795  }
5796  }
5797  }
5798  else{
5799  if (
5800  (partonIsUnknown[2] || MYIDUP_tmp[2]==rsel)
5801  &&
5802  (partonIsUnknown[3] || MYIDUP_tmp[3]==ssel)
5803  ){
5804  __modhiggsjj_MOD_evalamp_sbfh_unsymm_sa_select_exact(p4, &isel, &jsel, &rsel, &ssel, &msq_tmp);
5805  MatElsq[jsel+5][isel+5] += msq_tmp; // Assign only those that match gen. info, if present at all.
5806  if (verbosity >= TVar::DEBUG_VERBOSE) MELAout << "Channel (isel, jsel, rsel, ssel)=" << isel << ", " << jsel << ", " << rsel << ", " << ssel << '\t' << msq_tmp << endl;
5807  }
5808  if (
5809  rsel!=ssel
5810  &&
5811  (partonIsUnknown[2] || MYIDUP_tmp[2]==ssel)
5812  &&
5813  (partonIsUnknown[3] || MYIDUP_tmp[3]==rsel)
5814  ){
5815  __modhiggsjj_MOD_evalamp_sbfh_unsymm_sa_select_exact(p4, &isel, &jsel, &ssel, &rsel, &msq_tmp);
5816  MatElsq[jsel+5][isel+5] += msq_tmp; // Assign only those that match gen. info, if present at all.
5817  if (verbosity >= TVar::DEBUG_VERBOSE) MELAout << "Channel (isel, jsel, rsel, ssel)=" << isel << ", " << jsel << ", " << ssel << ", " << rsel << '\t' << msq_tmp << endl;
5818  }
5819  }
5820  } // End swapped isel<jsel cases
5821  } // End loop over ic<nijchannels
5822  } // End production == TVar::JJQCD
5823  else if (production == TVar::JJVBF){
5824  int isel, jsel, rsel, ssel;
5825  /*
5826  1234/1243 [0] vs [1] correspond to transposing 12 and 34 at the same time.
5827  Eg. 12->34 == udbar->udbar
5828  1234[0] : 1=u, 2=dbar, 3=u, 4=dbar
5829  1243[0] : 1=u, 2=dbar, 4=u, 3=dbar
5830  1234[1] : 2=u, 1=dbar, 4=u, 3=dbar
5831  1243[1] : 2=u, 1=dbar, 3=u, 4=dbar
5832  */
5833  double ckm_takeout=1;
5834  double msq_uu_zz_ijrs1234[2]={ 0 };
5835  double msq_uu_zz_ijrs1243[2]={ 0 };
5836  double msq_dd_zz_ijrs1234[2]={ 0 };
5837  double msq_dd_zz_ijrs1243[2]={ 0 };
5838  double msq_ubarubar_zz_ijrs1234[2]={ 0 };
5839  double msq_ubarubar_zz_ijrs1243[2]={ 0 };
5840  double msq_dbardbar_zz_ijrs1234[2]={ 0 };
5841  double msq_dbardbar_zz_ijrs1243[2]={ 0 };
5842  double msq_uu_zzid_ijrs1234[2]={ 0 };
5843  double msq_uu_zzid_ijrs1243[2]={ 0 };
5844  double msq_dd_zzid_ijrs1234[2]={ 0 };
5845  double msq_dd_zzid_ijrs1243[2]={ 0 };
5846  double msq_ubarubar_zzid_ijrs1234[2]={ 0 };
5847  double msq_ubarubar_zzid_ijrs1243[2]={ 0 };
5848  double msq_dbardbar_zzid_ijrs1234[2]={ 0 };
5849  double msq_dbardbar_zzid_ijrs1243[2]={ 0 };
5850  double msq_udbar_zz_ijrs1234[2]={ 0 };
5851  double msq_udbar_zz_ijrs1243[2]={ 0 };
5852  double msq_dubar_zz_ijrs1234[2]={ 0 };
5853  double msq_dubar_zz_ijrs1243[2]={ 0 };
5854 
5855  double msq_uubar_zz_ijrs1234[2]={ 0 };
5856  double msq_uubar_zz_ijrs1243[2]={ 0 };
5857  double msq_ddbar_zz_ijrs1234[2]={ 0 };
5858  double msq_ddbar_zz_ijrs1243[2]={ 0 };
5859  double msq_uubar_ww_ijrs1234[2]={ 0 };
5860  double msq_uubar_ww_ijrs1243[2]={ 0 };
5861  double msq_ddbar_ww_ijrs1234[2]={ 0 };
5862  double msq_ddbar_ww_ijrs1243[2]={ 0 };
5863 
5864  double msq_ud_wwonly_ijrs1234[2]={ 0 };
5865  double msq_ud_wwonly_ijrs1243[2]={ 0 };
5866  double msq_ubardbar_wwonly_ijrs1234[2]={ 0 };
5867  double msq_ubardbar_wwonly_ijrs1243[2]={ 0 };
5868  // ud, ubardbar ZZ(+)WW case to be added separately inside a loop.
5869 
5870  // NOTE: The order should be u>c>d>s>b; particle>antiparticle
5871  if (
5872  (partonIsUnknown[0] || (PDGHelpers::isUpTypeQuark(MYIDUP_tmp[0]) && MYIDUP_tmp[0]>0))
5873  &&
5874  (partonIsUnknown[1] || (PDGHelpers::isUpTypeQuark(MYIDUP_tmp[1]) && MYIDUP_tmp[1]>0))
5875  &&
5876  (partonIsUnknown[2] || (PDGHelpers::isUpTypeQuark(MYIDUP_tmp[2]) && MYIDUP_tmp[2]>0))
5877  &&
5878  (partonIsUnknown[3] || (PDGHelpers::isUpTypeQuark(MYIDUP_tmp[3]) && MYIDUP_tmp[3]>0))
5879  ){
5880  isel=2; jsel=4; // uu'->(ZZ)->uu'
5881  rsel=isel; ssel=jsel;
5882  __modhiggsjj_MOD_evalamp_wbfh_unsymm_sa_select_exact(p4, &isel, &jsel, &rsel, &ssel, &(msq_uu_zz_ijrs1234[0]));
5883  __modhiggsjj_MOD_evalamp_wbfh_unsymm_sa_select_exact(p4, &isel, &jsel, &ssel, &rsel, &(msq_uu_zz_ijrs1243[0]));
5884  // Swapping i/j vs r/s makes no physical difference here.
5885  msq_uu_zz_ijrs1234[1] = msq_uu_zz_ijrs1234[0];
5886  msq_uu_zz_ijrs1243[1] = msq_uu_zz_ijrs1243[0];
5887 
5888  isel=2; jsel=2; // uu->(ZZ)->uu
5889  rsel=isel; ssel=jsel;
5890  __modhiggsjj_MOD_evalamp_wbfh_unsymm_sa_select_exact(p4, &isel, &jsel, &rsel, &ssel, &(msq_uu_zzid_ijrs1234[0]));
5891  __modhiggsjj_MOD_evalamp_wbfh_unsymm_sa_select_exact(p4, &isel, &jsel, &ssel, &rsel, &(msq_uu_zzid_ijrs1243[0]));
5892  // Swapping i/j vs r/s makes no physical difference here.
5893  msq_uu_zzid_ijrs1234[1] = msq_uu_zzid_ijrs1234[0];
5894  msq_uu_zzid_ijrs1243[1] = msq_uu_zzid_ijrs1243[0];
5895  }
5896 
5897  if (
5898  (partonIsUnknown[0] || (PDGHelpers::isDownTypeQuark(MYIDUP_tmp[0]) && MYIDUP_tmp[0]>0))
5899  &&
5900  (partonIsUnknown[1] || (PDGHelpers::isDownTypeQuark(MYIDUP_tmp[1]) && MYIDUP_tmp[1]>0))
5901  &&
5902  (partonIsUnknown[2] || (PDGHelpers::isDownTypeQuark(MYIDUP_tmp[2]) && MYIDUP_tmp[2]>0))
5903  &&
5904  (partonIsUnknown[3] || (PDGHelpers::isDownTypeQuark(MYIDUP_tmp[3]) && MYIDUP_tmp[3]>0))
5905  ){
5906  isel=1; jsel=3; // dd'->(ZZ)->dd'
5907  rsel=isel; ssel=jsel;
5908  __modhiggsjj_MOD_evalamp_wbfh_unsymm_sa_select_exact(p4, &isel, &jsel, &rsel, &ssel, &(msq_dd_zz_ijrs1234[0]));
5909  __modhiggsjj_MOD_evalamp_wbfh_unsymm_sa_select_exact(p4, &isel, &jsel, &ssel, &rsel, &(msq_dd_zz_ijrs1243[0]));
5910  // Swapping i/j vs r/s makes no physical difference here.
5911  msq_dd_zz_ijrs1234[1] = msq_dd_zz_ijrs1234[0];
5912  msq_dd_zz_ijrs1243[1] = msq_dd_zz_ijrs1243[0];
5913 
5914  isel=1; jsel=1; // dd->(ZZ)->dd
5915  rsel=isel; ssel=jsel;
5916  __modhiggsjj_MOD_evalamp_wbfh_unsymm_sa_select_exact(p4, &isel, &jsel, &rsel, &ssel, &(msq_dd_zzid_ijrs1234[0]));
5917  __modhiggsjj_MOD_evalamp_wbfh_unsymm_sa_select_exact(p4, &isel, &jsel, &ssel, &rsel, &(msq_dd_zzid_ijrs1243[0]));
5918  // Swapping i/j vs r/s makes no physical difference here.
5919  msq_dd_zzid_ijrs1234[1] = msq_dd_zzid_ijrs1234[0];
5920  msq_dd_zzid_ijrs1243[1] = msq_dd_zzid_ijrs1243[0];
5921  }
5922 
5923  if (
5924  (partonIsUnknown[0] || (PDGHelpers::isUpTypeQuark(MYIDUP_tmp[0]) && MYIDUP_tmp[0]<0))
5925  &&
5926  (partonIsUnknown[1] || (PDGHelpers::isUpTypeQuark(MYIDUP_tmp[1]) && MYIDUP_tmp[1]<0))
5927  &&
5928  (partonIsUnknown[2] || (PDGHelpers::isUpTypeQuark(MYIDUP_tmp[2]) && MYIDUP_tmp[2]<0))
5929  &&
5930  (partonIsUnknown[3] || (PDGHelpers::isUpTypeQuark(MYIDUP_tmp[3]) && MYIDUP_tmp[3]<0))
5931  ){
5932  isel=-2; jsel=-4; // ubarubar'->(ZZ)->ubarubar'
5933  rsel=isel; ssel=jsel;
5934  __modhiggsjj_MOD_evalamp_wbfh_unsymm_sa_select_exact(p4, &isel, &jsel, &rsel, &ssel, &(msq_ubarubar_zz_ijrs1234[0]));
5935  __modhiggsjj_MOD_evalamp_wbfh_unsymm_sa_select_exact(p4, &isel, &jsel, &ssel, &rsel, &(msq_ubarubar_zz_ijrs1243[0]));
5936  // Swapping i/j vs r/s makes no physical difference here.
5937  msq_ubarubar_zz_ijrs1234[1] = msq_ubarubar_zz_ijrs1234[0];
5938  msq_ubarubar_zz_ijrs1243[1] = msq_ubarubar_zz_ijrs1243[0];
5939 
5940  isel=-2; jsel=-2; // ubarubar->(ZZ)->ubarubar
5941  rsel=isel; ssel=jsel;
5942  __modhiggsjj_MOD_evalamp_wbfh_unsymm_sa_select_exact(p4, &isel, &jsel, &rsel, &ssel, &(msq_ubarubar_zzid_ijrs1234[0]));
5943  __modhiggsjj_MOD_evalamp_wbfh_unsymm_sa_select_exact(p4, &isel, &jsel, &ssel, &rsel, &(msq_ubarubar_zzid_ijrs1243[0]));
5944  // Swapping i/j vs r/s makes no physical difference here.
5945  msq_ubarubar_zzid_ijrs1234[1] = msq_ubarubar_zzid_ijrs1234[0];
5946  msq_ubarubar_zzid_ijrs1243[1] = msq_ubarubar_zzid_ijrs1243[0];
5947  }
5948 
5949  if (
5950  (partonIsUnknown[0] || (PDGHelpers::isDownTypeQuark(MYIDUP_tmp[0]) && MYIDUP_tmp[0]<0))
5951  &&
5952  (partonIsUnknown[1] || (PDGHelpers::isDownTypeQuark(MYIDUP_tmp[1]) && MYIDUP_tmp[1]<0))
5953  &&
5954  (partonIsUnknown[2] || (PDGHelpers::isDownTypeQuark(MYIDUP_tmp[2]) && MYIDUP_tmp[2]<0))
5955  &&
5956  (partonIsUnknown[3] || (PDGHelpers::isDownTypeQuark(MYIDUP_tmp[3]) && MYIDUP_tmp[3]<0))
5957  ){
5958  isel=-1; jsel=-3; // dbardbar'->(ZZ)->dbardbar'
5959  rsel=isel; ssel=jsel;
5960  __modhiggsjj_MOD_evalamp_wbfh_unsymm_sa_select_exact(p4, &isel, &jsel, &rsel, &ssel, &(msq_dbardbar_zz_ijrs1234[0]));
5961  __modhiggsjj_MOD_evalamp_wbfh_unsymm_sa_select_exact(p4, &isel, &jsel, &ssel, &rsel, &(msq_dbardbar_zz_ijrs1243[0]));
5962  // Swapping i/j vs r/s makes no physical difference here.
5963  msq_dbardbar_zz_ijrs1234[1] = msq_dbardbar_zz_ijrs1234[0];
5964  msq_dbardbar_zz_ijrs1243[1] = msq_dbardbar_zz_ijrs1243[0];
5965 
5966  isel=-1; jsel=-1; // dbardbar->(ZZ)->dbardbar
5967  rsel=isel; ssel=jsel;
5968  __modhiggsjj_MOD_evalamp_wbfh_unsymm_sa_select_exact(p4, &isel, &jsel, &rsel, &ssel, &(msq_dbardbar_zzid_ijrs1234[0]));
5969  __modhiggsjj_MOD_evalamp_wbfh_unsymm_sa_select_exact(p4, &isel, &jsel, &ssel, &rsel, &(msq_dbardbar_zzid_ijrs1243[0]));
5970  // Swapping i/j vs r/s makes no physical difference here.
5971  msq_dbardbar_zzid_ijrs1234[1] = msq_dbardbar_zzid_ijrs1234[0];
5972  msq_dbardbar_zzid_ijrs1243[1] = msq_dbardbar_zzid_ijrs1243[0];
5973  }
5974 
5975  if (
5976  (
5977  (partonIsUnknown[0] && partonIsUnknown[1])
5978  ||
5979  (
5980  (PDGHelpers::isUpTypeQuark(MYIDUP_tmp[0]) && MYIDUP_tmp[0]>0 && PDGHelpers::isDownTypeQuark(MYIDUP_tmp[1]) && MYIDUP_tmp[1]<0)
5981  ||
5982  (PDGHelpers::isUpTypeQuark(MYIDUP_tmp[1]) && MYIDUP_tmp[1]>0 && PDGHelpers::isDownTypeQuark(MYIDUP_tmp[0]) && MYIDUP_tmp[0]<0)
5983  )
5984  ||
5985  (partonIsUnknown[0] && ((PDGHelpers::isUpTypeQuark(MYIDUP_tmp[1]) && MYIDUP_tmp[1]>0) || (PDGHelpers::isDownTypeQuark(MYIDUP_tmp[1]) && MYIDUP_tmp[1]<0)))
5986  ||
5987  (partonIsUnknown[1] && ((PDGHelpers::isUpTypeQuark(MYIDUP_tmp[0]) && MYIDUP_tmp[0]>0) || (PDGHelpers::isDownTypeQuark(MYIDUP_tmp[0]) && MYIDUP_tmp[0]<0)))
5988  )
5989  &&
5990  (
5991  (partonIsUnknown[2] && partonIsUnknown[3])
5992  ||
5993  (
5994  (PDGHelpers::isUpTypeQuark(MYIDUP_tmp[2]) && MYIDUP_tmp[2]>0 && PDGHelpers::isDownTypeQuark(MYIDUP_tmp[3]) && MYIDUP_tmp[3]<0)
5995  ||
5996  (PDGHelpers::isUpTypeQuark(MYIDUP_tmp[3]) && MYIDUP_tmp[3]>0 && PDGHelpers::isDownTypeQuark(MYIDUP_tmp[2]) && MYIDUP_tmp[2]<0)
5997  )
5998  ||
5999  (partonIsUnknown[2] && ((PDGHelpers::isUpTypeQuark(MYIDUP_tmp[3]) && MYIDUP_tmp[3]>0) || (PDGHelpers::isDownTypeQuark(MYIDUP_tmp[3]) && MYIDUP_tmp[3]<0)))
6000  ||
6001  (partonIsUnknown[3] && ((PDGHelpers::isUpTypeQuark(MYIDUP_tmp[2]) && MYIDUP_tmp[2]>0) || (PDGHelpers::isDownTypeQuark(MYIDUP_tmp[2]) && MYIDUP_tmp[2]<0)))
6002  )
6003  ){
6004  isel=2; jsel=-1; // udbar->(ZZ)->udbar
6005  rsel=isel; ssel=jsel;
6006  __modhiggsjj_MOD_evalamp_wbfh_unsymm_sa_select_exact(p4, &isel, &jsel, &rsel, &ssel, &(msq_udbar_zz_ijrs1234[0]));
6007  __modhiggsjj_MOD_evalamp_wbfh_unsymm_sa_select_exact(p4, &isel, &jsel, &ssel, &rsel, &(msq_udbar_zz_ijrs1243[0]));
6008  __modhiggsjj_MOD_evalamp_wbfh_unsymm_sa_select_exact(p4, &jsel, &isel, &ssel, &rsel, &(msq_udbar_zz_ijrs1234[1]));
6009  __modhiggsjj_MOD_evalamp_wbfh_unsymm_sa_select_exact(p4, &jsel, &isel, &rsel, &ssel, &(msq_udbar_zz_ijrs1243[1]));
6010  }
6011 
6012  if (
6013  (
6014  (partonIsUnknown[0] && partonIsUnknown[1])
6015  ||
6016  (
6017  (PDGHelpers::isUpTypeQuark(MYIDUP_tmp[0]) && MYIDUP_tmp[0]<0 && PDGHelpers::isDownTypeQuark(MYIDUP_tmp[1]) && MYIDUP_tmp[1]>0)
6018  ||
6019  (PDGHelpers::isUpTypeQuark(MYIDUP_tmp[1]) && MYIDUP_tmp[1]<0 && PDGHelpers::isDownTypeQuark(MYIDUP_tmp[0]) && MYIDUP_tmp[0]>0)
6020  )
6021  ||
6022  (partonIsUnknown[0] && ((PDGHelpers::isUpTypeQuark(MYIDUP_tmp[1]) && MYIDUP_tmp[1]<0) || (PDGHelpers::isDownTypeQuark(MYIDUP_tmp[1]) && MYIDUP_tmp[1]>0)))
6023  ||
6024  (partonIsUnknown[1] && ((PDGHelpers::isUpTypeQuark(MYIDUP_tmp[0]) && MYIDUP_tmp[0]<0) || (PDGHelpers::isDownTypeQuark(MYIDUP_tmp[0]) && MYIDUP_tmp[0]>0)))
6025  )
6026  &&
6027  (
6028  (partonIsUnknown[2] && partonIsUnknown[3])
6029  ||
6030  (
6031  (PDGHelpers::isUpTypeQuark(MYIDUP_tmp[2]) && MYIDUP_tmp[2]<0 && PDGHelpers::isDownTypeQuark(MYIDUP_tmp[3]) && MYIDUP_tmp[3]>0)
6032  ||
6033  (PDGHelpers::isUpTypeQuark(MYIDUP_tmp[3]) && MYIDUP_tmp[3]<0 && PDGHelpers::isDownTypeQuark(MYIDUP_tmp[2]) && MYIDUP_tmp[2]>0)
6034  )
6035  ||
6036  (partonIsUnknown[2] && ((PDGHelpers::isUpTypeQuark(MYIDUP_tmp[3]) && MYIDUP_tmp[3]<0) || (PDGHelpers::isDownTypeQuark(MYIDUP_tmp[3]) && MYIDUP_tmp[3]>0)))
6037  ||
6038  (partonIsUnknown[3] && ((PDGHelpers::isUpTypeQuark(MYIDUP_tmp[2]) && MYIDUP_tmp[2]<0) || (PDGHelpers::isDownTypeQuark(MYIDUP_tmp[2]) && MYIDUP_tmp[2]>0)))
6039  )
6040  ){
6041  isel=1; jsel=-2; // dubar->(ZZ)->dubar
6042  rsel=isel; ssel=jsel;
6043  __modhiggsjj_MOD_evalamp_wbfh_unsymm_sa_select_exact(p4, &isel, &jsel, &rsel, &ssel, &(msq_dubar_zz_ijrs1234[0]));
6044  __modhiggsjj_MOD_evalamp_wbfh_unsymm_sa_select_exact(p4, &isel, &jsel, &ssel, &rsel, &(msq_dubar_zz_ijrs1243[0]));
6045  __modhiggsjj_MOD_evalamp_wbfh_unsymm_sa_select_exact(p4, &jsel, &isel, &ssel, &rsel, &(msq_dubar_zz_ijrs1234[1]));
6046  __modhiggsjj_MOD_evalamp_wbfh_unsymm_sa_select_exact(p4, &jsel, &isel, &rsel, &ssel, &(msq_dubar_zz_ijrs1243[1]));
6047  }
6048 
6049  if (
6050  (partonIsUnknown[0] && partonIsUnknown[1])
6051  ||
6052  (PDGHelpers::isUpTypeQuark(MYIDUP_tmp[0]) && PDGHelpers::isUpTypeQuark(MYIDUP_tmp[1]) && MYIDUP_tmp[0]*MYIDUP_tmp[1]<0)
6053  ||
6054  (partonIsUnknown[0] && PDGHelpers::isUpTypeQuark(MYIDUP_tmp[1]))
6055  ||
6056  (partonIsUnknown[1] && PDGHelpers::isUpTypeQuark(MYIDUP_tmp[0]))
6057  ){
6058  isel=2; jsel=-2; // uubar->(ZZ)->uubar
6059  if (
6060  (partonIsUnknown[2] && partonIsUnknown[3])
6061  ||
6062  (PDGHelpers::isUpTypeQuark(MYIDUP_tmp[2]) && PDGHelpers::isUpTypeQuark(MYIDUP_tmp[3]) && MYIDUP_tmp[2]*MYIDUP_tmp[3]<0)
6063  ||
6064  (partonIsUnknown[2] && PDGHelpers::isUpTypeQuark(MYIDUP_tmp[3]))
6065  ||
6066  (partonIsUnknown[3] && PDGHelpers::isUpTypeQuark(MYIDUP_tmp[2]))
6067  ){
6068  rsel=isel; ssel=jsel; // uubar->(ZZ)->uubar
6069  __modhiggsjj_MOD_evalamp_wbfh_unsymm_sa_select_exact(p4, &isel, &jsel, &rsel, &ssel, &(msq_uubar_zz_ijrs1234[0]));
6070  __modhiggsjj_MOD_evalamp_wbfh_unsymm_sa_select_exact(p4, &isel, &jsel, &ssel, &rsel, &(msq_uubar_zz_ijrs1243[0]));
6071  __modhiggsjj_MOD_evalamp_wbfh_unsymm_sa_select_exact(p4, &jsel, &isel, &ssel, &rsel, &(msq_uubar_zz_ijrs1234[1]));
6072  __modhiggsjj_MOD_evalamp_wbfh_unsymm_sa_select_exact(p4, &jsel, &isel, &rsel, &ssel, &(msq_uubar_zz_ijrs1243[1]));
6073  }
6074  if (
6075  (partonIsUnknown[2] && partonIsUnknown[3])
6076  ||
6077  (PDGHelpers::isDownTypeQuark(MYIDUP_tmp[2]) && PDGHelpers::isDownTypeQuark(MYIDUP_tmp[3]) && MYIDUP_tmp[2]*MYIDUP_tmp[3]<0)
6078  ||
6079  (partonIsUnknown[2] && PDGHelpers::isDownTypeQuark(MYIDUP_tmp[3]))
6080  ||
6081  (partonIsUnknown[3] && PDGHelpers::isDownTypeQuark(MYIDUP_tmp[2]))
6082  ){
6083  rsel=-1; ssel=1; // uubar->(WW)->ddbar
6084  double ckm_ir = 0.;
6085  double ckm_js = 0.;
6086  while (ckm_ir==0.){
6087  rsel += 2;
6088  ssel -= 2;
6089  if (abs(rsel)>=6){
6090  rsel=-1; ssel=1;
6091  isel+=2; jsel-=2;
6092  continue;
6093  }
6094  if (abs(isel)>=6) break;
6095  ckm_ir = __modparameters_MOD_ckmbare(&isel, &rsel);
6096  ckm_js = __modparameters_MOD_ckmbare(&jsel, &ssel);
6097  }
6098  if (ckm_ir!=0.){
6099  __modhiggsjj_MOD_evalamp_wbfh_unsymm_sa_select_exact(p4, &isel, &jsel, &rsel, &ssel, &(msq_uubar_ww_ijrs1234[0]));
6100  __modhiggsjj_MOD_evalamp_wbfh_unsymm_sa_select_exact(p4, &isel, &jsel, &ssel, &rsel, &(msq_uubar_ww_ijrs1243[0]));
6101  __modhiggsjj_MOD_evalamp_wbfh_unsymm_sa_select_exact(p4, &jsel, &isel, &ssel, &rsel, &(msq_uubar_ww_ijrs1234[1]));
6102  __modhiggsjj_MOD_evalamp_wbfh_unsymm_sa_select_exact(p4, &jsel, &isel, &rsel, &ssel, &(msq_uubar_ww_ijrs1243[1]));
6103  ckm_takeout = pow(ckm_ir*ckm_js, 2);
6104  for (unsigned int iswap=0; iswap<2; iswap++){
6105  msq_uubar_ww_ijrs1234[iswap] /= ckm_takeout;
6106  msq_uubar_ww_ijrs1243[iswap] /= ckm_takeout;
6107  }
6108  }
6109  }
6110  }
6111 
6112  if (
6113  (partonIsUnknown[0] && partonIsUnknown[1])
6114  ||
6115  (PDGHelpers::isDownTypeQuark(MYIDUP_tmp[0]) && PDGHelpers::isDownTypeQuark(MYIDUP_tmp[1]) && MYIDUP_tmp[0]*MYIDUP_tmp[1]<0)
6116  ||
6117  (partonIsUnknown[0] && PDGHelpers::isDownTypeQuark(MYIDUP_tmp[1]))
6118  ||
6119  (partonIsUnknown[1] && PDGHelpers::isDownTypeQuark(MYIDUP_tmp[0]))
6120  ){
6121  isel=1; jsel=-1;
6122  if (
6123  (partonIsUnknown[2] && partonIsUnknown[3])
6124  ||
6125  (PDGHelpers::isDownTypeQuark(MYIDUP_tmp[2]) && PDGHelpers::isDownTypeQuark(MYIDUP_tmp[3]) && MYIDUP_tmp[2]*MYIDUP_tmp[3]<0)
6126  ||
6127  (partonIsUnknown[2] && PDGHelpers::isDownTypeQuark(MYIDUP_tmp[3]))
6128  ||
6129  (partonIsUnknown[3] && PDGHelpers::isDownTypeQuark(MYIDUP_tmp[2]))
6130  ){
6131  rsel=isel; ssel=jsel; // ddbar->(ZZ)->ddbar
6132  __modhiggsjj_MOD_evalamp_wbfh_unsymm_sa_select_exact(p4, &isel, &jsel, &rsel, &ssel, &(msq_ddbar_zz_ijrs1234[0]));
6133  __modhiggsjj_MOD_evalamp_wbfh_unsymm_sa_select_exact(p4, &isel, &jsel, &ssel, &rsel, &(msq_ddbar_zz_ijrs1243[0]));
6134  __modhiggsjj_MOD_evalamp_wbfh_unsymm_sa_select_exact(p4, &jsel, &isel, &ssel, &rsel, &(msq_ddbar_zz_ijrs1234[1]));
6135  __modhiggsjj_MOD_evalamp_wbfh_unsymm_sa_select_exact(p4, &jsel, &isel, &rsel, &ssel, &(msq_ddbar_zz_ijrs1243[1]));
6136  }
6137  if (
6138  (partonIsUnknown[2] && partonIsUnknown[3])
6139  ||
6140  (PDGHelpers::isUpTypeQuark(MYIDUP_tmp[2]) && PDGHelpers::isUpTypeQuark(MYIDUP_tmp[3]) && MYIDUP_tmp[2]*MYIDUP_tmp[3]<0)
6141  ||
6142  (partonIsUnknown[2] && PDGHelpers::isUpTypeQuark(MYIDUP_tmp[3]))
6143  ||
6144  (partonIsUnknown[3] && PDGHelpers::isUpTypeQuark(MYIDUP_tmp[2]))
6145  ){
6146  rsel=0; ssel=0; // ddbar->(WW)->uubar
6147  double ckm_ir = 0.;
6148  double ckm_js = 0.;
6149  while (ckm_ir==0.){
6150  rsel += 2;
6151  ssel -= 2;
6152  if (abs(rsel)>=6){
6153  rsel=0; ssel=0;
6154  isel+=2; jsel-=2;
6155  continue;
6156  }
6157  if (abs(isel)>=6) break;
6158  ckm_ir = __modparameters_MOD_ckmbare(&isel, &rsel);
6159  ckm_js = __modparameters_MOD_ckmbare(&jsel, &ssel);
6160  }
6161  if (ckm_ir!=0.){
6162  __modhiggsjj_MOD_evalamp_wbfh_unsymm_sa_select_exact(p4, &isel, &jsel, &rsel, &ssel, &(msq_ddbar_ww_ijrs1234[0]));
6163  __modhiggsjj_MOD_evalamp_wbfh_unsymm_sa_select_exact(p4, &isel, &jsel, &ssel, &rsel, &(msq_ddbar_ww_ijrs1243[0]));
6164  __modhiggsjj_MOD_evalamp_wbfh_unsymm_sa_select_exact(p4, &jsel, &isel, &ssel, &rsel, &(msq_ddbar_ww_ijrs1234[1]));
6165  __modhiggsjj_MOD_evalamp_wbfh_unsymm_sa_select_exact(p4, &jsel, &isel, &rsel, &ssel, &(msq_ddbar_ww_ijrs1243[1]));
6166  ckm_takeout = pow(ckm_ir*ckm_js, 2);
6167  for (unsigned int iswap=0; iswap<2; iswap++){
6168  msq_ddbar_ww_ijrs1234[iswap] /= ckm_takeout;
6169  msq_ddbar_ww_ijrs1243[iswap] /= ckm_takeout;
6170  }
6171  }
6172  }
6173  }
6174 
6175  if (
6176  (
6177  (partonIsUnknown[0] && partonIsUnknown[1])
6178  ||
6179  (
6180  (PDGHelpers::isUpTypeQuark(MYIDUP_tmp[0]) && MYIDUP_tmp[0]>0 && PDGHelpers::isDownTypeQuark(MYIDUP_tmp[1]) && MYIDUP_tmp[1]>0)
6181  ||
6182  (PDGHelpers::isUpTypeQuark(MYIDUP_tmp[1]) && MYIDUP_tmp[1]>0 && PDGHelpers::isDownTypeQuark(MYIDUP_tmp[0]) && MYIDUP_tmp[0]>0)
6183  )
6184  ||
6185  (partonIsUnknown[0] && ((PDGHelpers::isUpTypeQuark(MYIDUP_tmp[1]) && MYIDUP_tmp[1]>0) || (PDGHelpers::isDownTypeQuark(MYIDUP_tmp[1]) && MYIDUP_tmp[1]>0)))
6186  ||
6187  (partonIsUnknown[1] && ((PDGHelpers::isUpTypeQuark(MYIDUP_tmp[0]) && MYIDUP_tmp[0]>0) || (PDGHelpers::isDownTypeQuark(MYIDUP_tmp[0]) && MYIDUP_tmp[0]>0)))
6188  )
6189  &&
6190  (
6191  (partonIsUnknown[2] && partonIsUnknown[3])
6192  ||
6193  (
6194  (PDGHelpers::isUpTypeQuark(MYIDUP_tmp[2]) && MYIDUP_tmp[2]>0 && PDGHelpers::isDownTypeQuark(MYIDUP_tmp[3]) && MYIDUP_tmp[3]>0)
6195  ||
6196  (PDGHelpers::isUpTypeQuark(MYIDUP_tmp[3]) && MYIDUP_tmp[3]>0 && PDGHelpers::isDownTypeQuark(MYIDUP_tmp[2]) && MYIDUP_tmp[2]>0)
6197  )
6198  ||
6199  (partonIsUnknown[2] && ((PDGHelpers::isUpTypeQuark(MYIDUP_tmp[3]) && MYIDUP_tmp[3]>0) || (PDGHelpers::isDownTypeQuark(MYIDUP_tmp[3]) && MYIDUP_tmp[3]>0)))
6200  ||
6201  (partonIsUnknown[3] && ((PDGHelpers::isUpTypeQuark(MYIDUP_tmp[2]) && MYIDUP_tmp[2]>0) || (PDGHelpers::isDownTypeQuark(MYIDUP_tmp[2]) && MYIDUP_tmp[2]>0)))
6202  )
6203  ){
6204  // ud->(WW)->d'u'
6205  double ckm_ir = 0.;
6206  double ckm_js = 0.;
6207  const unsigned int nCombinations = 6;
6208  int ijrs_arr[nCombinations][4] ={
6209  { 2, 3, 1, 4 },
6210  { 2, 3, 5, 4 },
6211  { 2, 5, 1, 4 },
6212  { 2, 5, 3, 4 },
6213  { 2, 1, 3, 4 },
6214  { 2, 1, 5, 4 }
6215  };
6216  for (unsigned int ijrs=0; ijrs<nCombinations; ijrs++){
6217  isel = ijrs_arr[ijrs][0];
6218  jsel = ijrs_arr[ijrs][1];
6219  rsel = ijrs_arr[ijrs][2];
6220  ssel = ijrs_arr[ijrs][3];
6221  ckm_ir = __modparameters_MOD_ckmbare(&isel, &rsel);
6222  ckm_js = __modparameters_MOD_ckmbare(&jsel, &ssel);
6223  if (ckm_ir!=0. && ckm_js!=0.) break;
6224  }
6225  if (ckm_ir!=0. && ckm_js!=0.){
6226  __modhiggsjj_MOD_evalamp_wbfh_unsymm_sa_select_exact(p4, &isel, &jsel, &rsel, &ssel, &(msq_ud_wwonly_ijrs1234[0]));
6227  __modhiggsjj_MOD_evalamp_wbfh_unsymm_sa_select_exact(p4, &isel, &jsel, &ssel, &rsel, &(msq_ud_wwonly_ijrs1243[0]));
6228  __modhiggsjj_MOD_evalamp_wbfh_unsymm_sa_select_exact(p4, &jsel, &isel, &ssel, &rsel, &(msq_ud_wwonly_ijrs1234[1]));
6229  __modhiggsjj_MOD_evalamp_wbfh_unsymm_sa_select_exact(p4, &jsel, &isel, &rsel, &ssel, &(msq_ud_wwonly_ijrs1243[1]));
6230  ckm_takeout = pow(ckm_ir*ckm_js, 2);
6231  for (unsigned int iswap=0; iswap<2; iswap++){
6232  msq_ud_wwonly_ijrs1234[iswap] /= ckm_takeout;
6233  msq_ud_wwonly_ijrs1243[iswap] /= ckm_takeout;
6234  }
6235  }
6236  }
6237 
6238  if (
6239  (
6240  (partonIsUnknown[0] && partonIsUnknown[1])
6241  ||
6242  (
6243  (PDGHelpers::isUpTypeQuark(MYIDUP_tmp[0]) && MYIDUP_tmp[0]<0 && PDGHelpers::isDownTypeQuark(MYIDUP_tmp[1]) && MYIDUP_tmp[1]<0)
6244  ||
6245  (PDGHelpers::isUpTypeQuark(MYIDUP_tmp[1]) && MYIDUP_tmp[1]<0 && PDGHelpers::isDownTypeQuark(MYIDUP_tmp[0]) && MYIDUP_tmp[0]<0)
6246  )
6247  ||
6248  (partonIsUnknown[0] && ((PDGHelpers::isUpTypeQuark(MYIDUP_tmp[1]) && MYIDUP_tmp[1]<0) || (PDGHelpers::isDownTypeQuark(MYIDUP_tmp[1]) && MYIDUP_tmp[1]<0)))
6249  ||
6250  (partonIsUnknown[1] && ((PDGHelpers::isUpTypeQuark(MYIDUP_tmp[0]) && MYIDUP_tmp[0]<0) || (PDGHelpers::isDownTypeQuark(MYIDUP_tmp[0]) && MYIDUP_tmp[0]<0)))
6251  )
6252  &&
6253  (
6254  (partonIsUnknown[2] && partonIsUnknown[3])
6255  ||
6256  (
6257  (PDGHelpers::isUpTypeQuark(MYIDUP_tmp[2]) && MYIDUP_tmp[2]<0 && PDGHelpers::isDownTypeQuark(MYIDUP_tmp[3]) && MYIDUP_tmp[3]<0)
6258  ||
6259  (PDGHelpers::isUpTypeQuark(MYIDUP_tmp[3]) && MYIDUP_tmp[3]<0 && PDGHelpers::isDownTypeQuark(MYIDUP_tmp[2]) && MYIDUP_tmp[2]<0)
6260  )
6261  ||
6262  (partonIsUnknown[2] && ((PDGHelpers::isUpTypeQuark(MYIDUP_tmp[3]) && MYIDUP_tmp[3]<0) || (PDGHelpers::isDownTypeQuark(MYIDUP_tmp[3]) && MYIDUP_tmp[3]<0)))
6263  ||
6264  (partonIsUnknown[3] && ((PDGHelpers::isUpTypeQuark(MYIDUP_tmp[2]) && MYIDUP_tmp[2]<0) || (PDGHelpers::isDownTypeQuark(MYIDUP_tmp[2]) && MYIDUP_tmp[2]<0)))
6265  )
6266  ){
6267  // ubardbar->(WW)->dbar'ubar'
6268  double ckm_ir = 0.;
6269  double ckm_js = 0.;
6270  const unsigned int nCombinations = 6;
6271  int ijrs_arr[nCombinations][4] ={
6272  { -2, -3, -1, -4 },
6273  { -2, -3, -5, -4 },
6274  { -2, -5, -1, -4 },
6275  { -2, -5, -3, -4 },
6276  { -2, -1, -3, -4 },
6277  { -2, -1, -5, -4 }
6278  };
6279  for (unsigned int ijrs=0; ijrs<nCombinations; ijrs++){
6280  isel = ijrs_arr[ijrs][0];
6281  jsel = ijrs_arr[ijrs][1];
6282  rsel = ijrs_arr[ijrs][2];
6283  ssel = ijrs_arr[ijrs][3];
6284  ckm_ir = __modparameters_MOD_ckmbare(&isel, &rsel);
6285  ckm_js = __modparameters_MOD_ckmbare(&jsel, &ssel);
6286  if (ckm_ir!=0. && ckm_js!=0.) break;
6287  }
6288  if (ckm_ir!=0. && ckm_js!=0.){
6289  __modhiggsjj_MOD_evalamp_wbfh_unsymm_sa_select_exact(p4, &isel, &jsel, &rsel, &ssel, &(msq_ubardbar_wwonly_ijrs1234[0]));
6290  __modhiggsjj_MOD_evalamp_wbfh_unsymm_sa_select_exact(p4, &isel, &jsel, &ssel, &rsel, &(msq_ubardbar_wwonly_ijrs1243[0]));
6291  __modhiggsjj_MOD_evalamp_wbfh_unsymm_sa_select_exact(p4, &jsel, &isel, &ssel, &rsel, &(msq_ubardbar_wwonly_ijrs1234[1]));
6292  __modhiggsjj_MOD_evalamp_wbfh_unsymm_sa_select_exact(p4, &jsel, &isel, &rsel, &ssel, &(msq_ubardbar_wwonly_ijrs1243[1]));
6293  ckm_takeout = pow(ckm_ir*ckm_js, 2);
6294  for (unsigned int iswap=0; iswap<2; iswap++){
6295  msq_ubardbar_wwonly_ijrs1234[iswap] /= ckm_takeout;
6296  msq_ubardbar_wwonly_ijrs1243[iswap] /= ckm_takeout;
6297  }
6298  }
6299  }
6300 
6301  if (verbosity>=TVar::DEBUG_VERBOSE){
6302  MELAout << "TUtil::HJJMatEl: The pre-computed MEs:" << endl;
6303  for (unsigned int iswap=0; iswap<2; iswap++){
6304  MELAout
6305  << "\tmsq_uu_zz_ijrs1234[" << iswap << "] = " << msq_uu_zz_ijrs1234[iswap] << '\n'
6306  << "\tmsq_uu_zz_ijrs1243[" << iswap << "] = " << msq_uu_zz_ijrs1243[iswap] << '\n'
6307  << "\tmsq_dd_zz_ijrs1234[" << iswap << "] = " << msq_dd_zz_ijrs1234[iswap] << '\n'
6308  << "\tmsq_dd_zz_ijrs1243[" << iswap << "] = " << msq_dd_zz_ijrs1243[iswap] << '\n'
6309  << "\tmsq_ubarubar_zz_ijrs1234[" << iswap << "] = " << msq_ubarubar_zz_ijrs1234[iswap] << '\n'
6310  << "\tmsq_ubarubar_zz_ijrs1243[" << iswap << "] = " << msq_ubarubar_zz_ijrs1243[iswap] << '\n'
6311  << "\tmsq_dbardbar_zz_ijrs1234[" << iswap << "] = " << msq_dbardbar_zz_ijrs1234[iswap] << '\n'
6312  << "\tmsq_dbardbar_zz_ijrs1243[" << iswap << "] = " << msq_dbardbar_zz_ijrs1243[iswap] << '\n'
6313  << "\tmsq_uu_zzid_ijrs1234[" << iswap << "] = " << msq_uu_zzid_ijrs1234[iswap] << '\n'
6314  << "\tmsq_uu_zzid_ijrs1243[" << iswap << "] = " << msq_uu_zzid_ijrs1243[iswap] << '\n'
6315  << "\tmsq_dd_zzid_ijrs1234[" << iswap << "] = " << msq_dd_zzid_ijrs1234[iswap] << '\n'
6316  << "\tmsq_dd_zzid_ijrs1243[" << iswap << "] = " << msq_dd_zzid_ijrs1243[iswap] << '\n'
6317  << "\tmsq_ubarubar_zzid_ijrs1234[" << iswap << "] = " << msq_ubarubar_zzid_ijrs1234[iswap] << '\n'
6318  << "\tmsq_ubarubar_zzid_ijrs1243[" << iswap << "] = " << msq_ubarubar_zzid_ijrs1243[iswap] << '\n'
6319  << "\tmsq_dbardbar_zzid_ijrs1234[" << iswap << "] = " << msq_dbardbar_zzid_ijrs1234[iswap] << '\n'
6320  << "\tmsq_dbardbar_zzid_ijrs1243[" << iswap << "] = " << msq_dbardbar_zzid_ijrs1243[iswap] << '\n'
6321  << "\tmsq_udbar_zz_ijrs1234[" << iswap << "] = " << msq_udbar_zz_ijrs1234[iswap] << '\n'
6322  << "\tmsq_udbar_zz_ijrs1243[" << iswap << "] = " << msq_udbar_zz_ijrs1243[iswap] << '\n'
6323  << "\tmsq_dubar_zz_ijrs1234[" << iswap << "] = " << msq_dubar_zz_ijrs1234[iswap] << '\n'
6324  << "\tmsq_dubar_zz_ijrs1243[" << iswap << "] = " << msq_dubar_zz_ijrs1243[iswap] << '\n'
6325  << "\tmsq_uubar_zz_ijrs1234[" << iswap << "] = " << msq_uubar_zz_ijrs1234[iswap] << '\n'
6326  << "\tmsq_uubar_zz_ijrs1243[" << iswap << "] = " << msq_uubar_zz_ijrs1243[iswap] << '\n'
6327  << "\tmsq_ddbar_zz_ijrs1234[" << iswap << "] = " << msq_ddbar_zz_ijrs1234[iswap] << '\n'
6328  << "\tmsq_ddbar_zz_ijrs1243[" << iswap << "] = " << msq_ddbar_zz_ijrs1243[iswap] << '\n'
6329  << "\tmsq_uubar_ww_ijrs1234[" << iswap << "] = " << msq_uubar_ww_ijrs1234[iswap] << '\n'
6330  << "\tmsq_uubar_ww_ijrs1243[" << iswap << "] = " << msq_uubar_ww_ijrs1243[iswap] << '\n'
6331  << "\tmsq_ddbar_ww_ijrs1234[" << iswap << "] = " << msq_ddbar_ww_ijrs1234[iswap] << '\n'
6332  << "\tmsq_ddbar_ww_ijrs1243[" << iswap << "] = " << msq_ddbar_ww_ijrs1243[iswap] << '\n'
6333  << "\tmsq_ud_wwonly_ijrs1234[" << iswap << "] = " << msq_ud_wwonly_ijrs1234[iswap] << '\n'
6334  << "\tmsq_ud_wwonly_ijrs1243[" << iswap << "] = " << msq_ud_wwonly_ijrs1243[iswap] << '\n'
6335  << "\tmsq_ubardbar_wwonly_ijrs1234[" << iswap << "] = " << msq_ubardbar_wwonly_ijrs1234[iswap] << '\n'
6336  << "\tmsq_ubardbar_wwonly_ijrs1243[" << iswap << "] = " << msq_ubardbar_wwonly_ijrs1243[iswap]
6337  << endl;
6338  }
6339  }
6340 
6341  const std::vector<TNumericUtil::intTriplet_t>& ijsel = Get_JHUGenHash_OnshellVBFHash();
6342  int nijchannels = ijsel.size();
6343  // BEGIN COMPUTATION
6344  for (int ic=0; ic<nijchannels; ic++){
6345  // Emulate EvalWeighted_HJJ_test
6346  isel = ijsel[ic][0];
6347  jsel = ijsel[ic][1];
6348  int code = ijsel[ic][2];
6349  bool ijselIsUpType[2];
6350  bool ijselIsDownType[2];
6351  bool ijselIsParticle[2];
6352  bool ijselIsAntiparticle[2];
6353 
6354  if (verbosity >= TVar::DEBUG_VERBOSE) MELAout << "VBF channel " << ic << " code " << code << endl;
6355 
6356  // Default assignments
6357  if (verbosity >= TVar::DEBUG_VERBOSE) MELAout << "VBF mother unswapped case" << endl;
6358  // Set r=i, s=j default values
6359  rsel=isel;
6360  ssel=jsel;
6361  // Set i-j bools
6362  ijselIsUpType[0] = (PDGHelpers::isUpTypeQuark(isel));
6363  ijselIsUpType[1] = (PDGHelpers::isUpTypeQuark(jsel));
6364  ijselIsDownType[0] = (PDGHelpers::isDownTypeQuark(isel));
6365  ijselIsDownType[1] = (PDGHelpers::isDownTypeQuark(jsel));
6366  ijselIsParticle[0] = (isel>0); ijselIsAntiparticle[0] = (isel<0);
6367  ijselIsParticle[1] = (jsel>0); ijselIsAntiparticle[1] = (jsel<0);
6368 
6369  if (
6370  (partonIsUnknown[0] || MYIDUP_tmp[0]==isel)
6371  &&
6372  (partonIsUnknown[1] || MYIDUP_tmp[1]==jsel)
6373  ){ // Do it this way to be able to swap isel and jsel later
6374  if (code==1){ // Only ZZ->H possible
6375  // rsel=isel and ssel=jsel already
6376  if (
6377  (partonIsUnknown[2] || MYIDUP_tmp[2]==rsel)
6378  &&
6379  (partonIsUnknown[3] || MYIDUP_tmp[3]==ssel)
6380  ){
6381  msq_tmp=0;
6382  if (ijselIsUpType[0] && ijselIsUpType[1]){
6383  if (ijselIsParticle[0] && ijselIsParticle[1]){
6384  if (isel!=jsel) msq_tmp = msq_uu_zz_ijrs1234[0];
6385  else msq_tmp = msq_uu_zzid_ijrs1234[0];
6386  }
6387  else if (ijselIsAntiparticle[0] && ijselIsAntiparticle[1]){
6388  if (isel!=jsel) msq_tmp = msq_ubarubar_zz_ijrs1234[0];
6389  else msq_tmp = msq_ubarubar_zzid_ijrs1234[0];
6390  }
6391  else if (ijselIsParticle[0] && ijselIsAntiparticle[1]) msq_tmp = msq_uubar_zz_ijrs1234[0];
6392  }
6393  else if (ijselIsDownType[0] && ijselIsDownType[1]){
6394  if (ijselIsParticle[0] && ijselIsParticle[1]){
6395  if (isel!=jsel) msq_tmp = msq_dd_zz_ijrs1234[0];
6396  else msq_tmp = msq_dd_zzid_ijrs1234[0];
6397  }
6398  else if (ijselIsAntiparticle[0] && ijselIsAntiparticle[1]){
6399  if (isel!=jsel) msq_tmp = msq_dbardbar_zz_ijrs1234[0];
6400  else msq_tmp = msq_dbardbar_zzid_ijrs1234[0];
6401  }
6402  else if (ijselIsParticle[0] && ijselIsAntiparticle[1]) msq_tmp = msq_ddbar_zz_ijrs1234[0];
6403  }
6404  else if (ijselIsUpType[0] && ijselIsDownType[1] && ijselIsParticle[0] && ijselIsAntiparticle[1]) msq_tmp = msq_udbar_zz_ijrs1234[0];
6405  else if (ijselIsDownType[0] && ijselIsUpType[1] && ijselIsParticle[0] && ijselIsAntiparticle[1]) msq_tmp = msq_dubar_zz_ijrs1234[0];
6406  MatElsq[jsel+5][isel+5] += msq_tmp; // Assign only those that match gen. info, if present at all.
6407  if (verbosity >= TVar::DEBUG_VERBOSE) MELAout << "Channel (isel, jsel, rsel, ssel)=" << isel << ", " << jsel << ", " << rsel << ", " << ssel << '\t' << msq_tmp << endl;
6408  }
6409  if (
6410  rsel!=ssel
6411  &&
6412  (partonIsUnknown[2] || MYIDUP_tmp[2]==ssel)
6413  &&
6414  (partonIsUnknown[3] || MYIDUP_tmp[3]==rsel)
6415  ){
6416  msq_tmp=0;
6417  if (ijselIsUpType[0] && ijselIsUpType[1]){
6418  if (ijselIsParticle[0] && ijselIsParticle[1]){
6419  if (isel!=jsel) msq_tmp = msq_uu_zz_ijrs1243[0];
6420  else msq_tmp = msq_uu_zzid_ijrs1243[0];
6421  }
6422  else if (ijselIsAntiparticle[0] && ijselIsAntiparticle[1]){
6423  if (isel!=jsel) msq_tmp = msq_ubarubar_zz_ijrs1243[0];
6424  else msq_tmp = msq_ubarubar_zzid_ijrs1243[0];
6425  }
6426  else if (ijselIsParticle[0] && ijselIsAntiparticle[1]) msq_tmp = msq_uubar_zz_ijrs1243[0];
6427  }
6428  else if (ijselIsDownType[0] && ijselIsDownType[1]){
6429  if (ijselIsParticle[0] && ijselIsParticle[1]){
6430  if (isel!=jsel) msq_tmp = msq_dd_zz_ijrs1243[0];
6431  else msq_tmp = msq_dd_zzid_ijrs1243[0];
6432  }
6433  else if (ijselIsAntiparticle[0] && ijselIsAntiparticle[1]){
6434  if (isel!=jsel) msq_tmp = msq_dbardbar_zz_ijrs1243[0];
6435  else msq_tmp = msq_dbardbar_zzid_ijrs1243[0];
6436  }
6437  else if (ijselIsParticle[0] && ijselIsAntiparticle[1]) msq_tmp = msq_ddbar_zz_ijrs1243[0];
6438  }
6439  else if (ijselIsUpType[0] && ijselIsDownType[1] && ijselIsParticle[0] && ijselIsAntiparticle[1]) msq_tmp = msq_udbar_zz_ijrs1243[0];
6440  else if (ijselIsDownType[0] && ijselIsUpType[1] && ijselIsParticle[0] && ijselIsAntiparticle[1]) msq_tmp = msq_dubar_zz_ijrs1243[0];
6441  MatElsq[jsel+5][isel+5] += msq_tmp; // Assign only those that match gen. info, if present at all.
6442  if (verbosity >= TVar::DEBUG_VERBOSE) MELAout << "Channel (isel, jsel, rsel, ssel)=" << isel << ", " << jsel << ", " << ssel << ", " << rsel << '\t' << msq_tmp << endl;
6443  }
6444  }
6445  else if (code==0){ // code==0 means WW->H is also possible with no interference to ZZ->H, for example u ub -> d db.
6446  vector<int> possible_rsel;
6447  vector<int> possible_ssel;
6448  vector<double> possible_Vsqir;
6449  vector<double> possible_Vsqjs;
6450  if (ijselIsUpType[0]){ possible_rsel.push_back(1); possible_rsel.push_back(3); possible_rsel.push_back(5); }
6451  else if (ijselIsDownType[0]){ possible_rsel.push_back(2); possible_rsel.push_back(4); }
6452  for (unsigned int ix=0; ix<possible_rsel.size(); ix++){
6453  rsel=possible_rsel.at(ix);
6454  double ckmval = pow(__modparameters_MOD_ckmbare(&isel, &rsel), 2);
6455  possible_Vsqir.push_back(ckmval);
6456  }
6457  if (ijselIsUpType[1]){ possible_ssel.push_back(1); possible_ssel.push_back(3); possible_ssel.push_back(5); }
6458  else if (ijselIsDownType[1]){ possible_ssel.push_back(2); possible_ssel.push_back(4); }
6459  for (unsigned int iy=0; iy<possible_ssel.size(); iy++){
6460  ssel=possible_ssel.at(iy);
6461  double ckmval = pow(__modparameters_MOD_ckmbare(&jsel, &ssel), 2);
6462  possible_Vsqjs.push_back(ckmval);
6463  }
6464 
6465  // Combine the ME and ME_swap based on actual ids
6466  for (unsigned int ix=0; ix<possible_rsel.size(); ix++){
6467  rsel=possible_rsel.at(ix)*TMath::Sign(1, isel);
6468  for (unsigned int iy=0; iy<possible_ssel.size(); iy++){
6469  ssel=possible_ssel.at(iy)*TMath::Sign(1, jsel);
6470  double ckmval = possible_Vsqir.at(ix)*possible_Vsqjs.at(iy);
6471  if (
6472  (partonIsUnknown[2] || MYIDUP_tmp[2]==rsel)
6473  &&
6474  (partonIsUnknown[3] || MYIDUP_tmp[3]==ssel)
6475  ){
6476  msq_tmp=0;
6477  if (ijselIsUpType[0] && ijselIsUpType[1] && ijselIsParticle[0] && ijselIsAntiparticle[1]) msq_tmp = msq_uubar_ww_ijrs1234[0];
6478  else if (ijselIsDownType[0] && ijselIsDownType[1] && ijselIsParticle[0] && ijselIsAntiparticle[1]) msq_tmp = msq_ddbar_ww_ijrs1234[0];
6479  msq_tmp *= ckmval;
6480  MatElsq[jsel+5][isel+5] += msq_tmp; // Assign only those that match gen. info, if present at all.
6481  if (verbosity >= TVar::DEBUG_VERBOSE) MELAout << "Channel (isel, jsel, rsel, ssel)=" << isel << ", " << jsel << ", " << rsel << ", " << ssel << '\t' << msq_tmp << endl;
6482  }
6483  if (
6484  rsel!=ssel
6485  &&
6486  (partonIsUnknown[2] || MYIDUP_tmp[2]==ssel)
6487  &&
6488  (partonIsUnknown[3] || MYIDUP_tmp[3]==rsel)
6489  ){
6490  msq_tmp=0;
6491  if (ijselIsUpType[0] && ijselIsUpType[1] && ijselIsParticle[0] && ijselIsAntiparticle[1]) msq_tmp = msq_uubar_ww_ijrs1243[0];
6492  else if (ijselIsDownType[0] && ijselIsDownType[1] && ijselIsParticle[0] && ijselIsAntiparticle[1]) msq_tmp = msq_ddbar_ww_ijrs1243[0];
6493  msq_tmp *= ckmval;
6494  MatElsq[jsel+5][isel+5] += msq_tmp; // Assign only those that match gen. info, if present at all.
6495  if (verbosity >= TVar::DEBUG_VERBOSE) MELAout << "Channel (isel, jsel, rsel, ssel)=" << isel << ", " << jsel << ", " << ssel << ", " << rsel << '\t' << msq_tmp << endl;
6496  }
6497  }
6498  }
6499  }
6500  else{ // code==2 means states with WW/ZZ interference allowed, for example u1 d2 -> u3 d4 + d4 u3.
6501  vector<int> possible_rsel;
6502  vector<int> possible_ssel;
6503  vector<double> possible_Vsqir;
6504  vector<double> possible_Vsqjs;
6505  if (ijselIsUpType[0]){ possible_rsel.push_back(1); possible_rsel.push_back(3); possible_rsel.push_back(5); }
6506  else if (ijselIsDownType[0]){ possible_rsel.push_back(2); possible_rsel.push_back(4); }
6507  for (unsigned int ix=0; ix<possible_rsel.size(); ix++){
6508  rsel=possible_rsel.at(ix);
6509  double ckmval = pow(__modparameters_MOD_ckmbare(&isel, &rsel), 2);
6510  possible_Vsqir.push_back(ckmval);
6511  }
6512  if (ijselIsUpType[1]){ possible_ssel.push_back(1); possible_ssel.push_back(3); possible_ssel.push_back(5); }
6513  else if (ijselIsDownType[1]){ possible_ssel.push_back(2); possible_ssel.push_back(4); }
6514  for (unsigned int iy=0; iy<possible_ssel.size(); iy++){
6515  ssel=possible_ssel.at(iy);
6516  double ckmval = pow(__modparameters_MOD_ckmbare(&jsel, &ssel), 2);
6517  possible_Vsqjs.push_back(ckmval);
6518  }
6519 
6520  // Loop over all possible combinations to get interference correct
6521  for (unsigned int ix=0; ix<possible_rsel.size(); ix++){
6522  rsel=possible_rsel.at(ix)*TMath::Sign(1, isel);
6523  for (unsigned int iy=0; iy<possible_ssel.size(); iy++){
6524  ssel=possible_ssel.at(iy)*TMath::Sign(1, jsel);
6525  double ckmval = possible_Vsqir.at(ix)*possible_Vsqjs.at(iy);
6526  if (
6527  (partonIsUnknown[2] || MYIDUP_tmp[2]==rsel)
6528  &&
6529  (partonIsUnknown[3] || MYIDUP_tmp[3]==ssel)
6530  ){
6531  if (rsel!=jsel && ssel!=isel){
6532  msq_tmp=0;
6533  if (ijselIsUpType[0] && ijselIsDownType[1]){
6534  if (ijselIsParticle[0] && ijselIsParticle[1]) msq_tmp = msq_ud_wwonly_ijrs1234[0];
6535  else if (ijselIsAntiparticle[0] && ijselIsAntiparticle[1]) msq_tmp = msq_ubardbar_wwonly_ijrs1234[0];
6536  }
6537  msq_tmp *= ckmval;
6538  MatElsq[jsel+5][isel+5] += msq_tmp; // Assign only those that match gen. info, if present at all.
6539  if (verbosity >= TVar::DEBUG_VERBOSE) MELAout << "Channel (isel, jsel, rsel, ssel)=" << isel << ", " << jsel << ", " << rsel << ", " << ssel << '\t' << msq_tmp << endl;
6540  }
6541  else{
6542  __modhiggsjj_MOD_evalamp_wbfh_unsymm_sa_select_exact(p4, &isel, &jsel, &rsel, &ssel, &msq_tmp);
6543  MatElsq[jsel+5][isel+5] += msq_tmp; // Assign only those that match gen. info, if present at all.
6544  if (verbosity >= TVar::DEBUG_VERBOSE) MELAout << "Channel (isel, jsel, rsel, ssel)=" << isel << ", " << jsel << ", " << rsel << ", " << ssel << '\t' << msq_tmp << endl;
6545  }
6546  }
6547  if (
6548  rsel!=ssel
6549  &&
6550  (partonIsUnknown[2] || MYIDUP_tmp[2]==ssel)
6551  &&
6552  (partonIsUnknown[3] || MYIDUP_tmp[3]==rsel)
6553  ){
6554  if (rsel!=jsel && ssel!=isel){
6555  msq_tmp=0;
6556  if (ijselIsUpType[0] && ijselIsDownType[1]){
6557  if (ijselIsParticle[0] && ijselIsParticle[1]) msq_tmp = msq_ud_wwonly_ijrs1243[0];
6558  else if (ijselIsAntiparticle[0] && ijselIsAntiparticle[1]) msq_tmp = msq_ubardbar_wwonly_ijrs1243[0];
6559  }
6560  msq_tmp *= ckmval;
6561  MatElsq[jsel+5][isel+5] += msq_tmp; // Assign only those that match gen. info, if present at all.
6562  if (verbosity >= TVar::DEBUG_VERBOSE) MELAout << "Channel (isel, jsel, rsel, ssel)=" << isel << ", " << jsel << ", " << ssel << ", " << rsel << '\t' << msq_tmp << endl;
6563  }
6564  else{
6565  __modhiggsjj_MOD_evalamp_wbfh_unsymm_sa_select_exact(p4, &isel, &jsel, &ssel, &rsel, &msq_tmp);
6566  MatElsq[jsel+5][isel+5] += msq_tmp; // Assign only those that match gen. info, if present at all.
6567  if (verbosity >= TVar::DEBUG_VERBOSE) MELAout << "Channel (isel, jsel, rsel, ssel)=" << isel << ", " << jsel << ", " << ssel << ", " << rsel << '\t' << msq_tmp << endl;
6568  }
6569  }
6570  }
6571  }
6572  }
6573  } // End unswapped isel>=jsel cases
6574 
6575  if (isel==jsel) continue;
6576  isel = ijsel[ic][1];
6577  jsel = ijsel[ic][0];
6578 
6579  // Reset to default assignments
6580  if (verbosity >= TVar::DEBUG_VERBOSE) MELAout << "VBF mother swapped case" << endl;
6581  // Set r=i, s=j default values
6582  rsel=isel;
6583  ssel=jsel;
6584  // Set i-j bools
6585  ijselIsUpType[0] = (PDGHelpers::isUpTypeQuark(isel));
6586  ijselIsUpType[1] = (PDGHelpers::isUpTypeQuark(jsel));
6587  ijselIsDownType[0] = (PDGHelpers::isDownTypeQuark(isel));
6588  ijselIsDownType[1] = (PDGHelpers::isDownTypeQuark(jsel));
6589  ijselIsParticle[0] = (isel>0); ijselIsAntiparticle[0] = (isel<0);
6590  ijselIsParticle[1] = (jsel>0); ijselIsAntiparticle[1] = (jsel<0);
6591 
6592  if (
6593  (partonIsUnknown[0] || ((PDGHelpers::isAGluon(MYIDUP_tmp[0]) && isel==0) || MYIDUP_tmp[0]==isel))
6594  &&
6595  (partonIsUnknown[1] || ((PDGHelpers::isAGluon(MYIDUP_tmp[1]) && jsel==0) || MYIDUP_tmp[1]==jsel))
6596  ){
6597  // isel==jsel==0 is already eliminated by isel!=jsel condition
6598  if (code==1){ // Only ZZ->H possible
6599  // rsel=isel and ssel=jsel already
6600  if (
6601  (partonIsUnknown[2] || MYIDUP_tmp[2]==rsel)
6602  &&
6603  (partonIsUnknown[3] || MYIDUP_tmp[3]==ssel)
6604  ){
6605  msq_tmp=0;
6606  if (ijselIsUpType[1] && ijselIsUpType[0]){
6607  if (ijselIsParticle[1] && ijselIsParticle[0]){
6608  if (isel!=jsel) msq_tmp = msq_uu_zz_ijrs1234[1];
6609  else msq_tmp = msq_uu_zzid_ijrs1234[1];
6610  }
6611  else if (ijselIsAntiparticle[1] && ijselIsAntiparticle[0]){
6612  if (isel!=jsel) msq_tmp = msq_ubarubar_zz_ijrs1234[1];
6613  else msq_tmp = msq_ubarubar_zzid_ijrs1234[1];
6614  }
6615  else if (ijselIsParticle[1] && ijselIsAntiparticle[0]) msq_tmp = msq_uubar_zz_ijrs1234[1];
6616  }
6617  else if (ijselIsDownType[1] && ijselIsDownType[0]){
6618  if (ijselIsParticle[1] && ijselIsParticle[0]){
6619  if (isel!=jsel) msq_tmp = msq_dd_zz_ijrs1234[1];
6620  else msq_tmp = msq_dd_zzid_ijrs1234[1];
6621  }
6622  else if (ijselIsAntiparticle[1] && ijselIsAntiparticle[0]){
6623  if (isel!=jsel) msq_tmp = msq_dbardbar_zz_ijrs1234[1];
6624  else msq_tmp = msq_dbardbar_zzid_ijrs1234[1];
6625  }
6626  else if (ijselIsParticle[1] && ijselIsAntiparticle[0]) msq_tmp = msq_ddbar_zz_ijrs1234[1];
6627  }
6628  else if (ijselIsUpType[1] && ijselIsDownType[0] && ijselIsParticle[1] && ijselIsAntiparticle[0]) msq_tmp = msq_udbar_zz_ijrs1234[1];
6629  else if (ijselIsDownType[1] && ijselIsUpType[0] && ijselIsParticle[1] && ijselIsAntiparticle[0]) msq_tmp = msq_dubar_zz_ijrs1234[1];
6630  MatElsq[jsel+5][isel+5] += msq_tmp; // Assign only those that match gen. info, if present at all.
6631  if (verbosity >= TVar::DEBUG_VERBOSE) MELAout << "Channel (isel, jsel, rsel, ssel)=" << isel << ", " << jsel << ", " << rsel << ", " << ssel << '\t' << msq_tmp << endl;
6632  }
6633  if (
6634  rsel!=ssel
6635  &&
6636  (partonIsUnknown[2] || MYIDUP_tmp[2]==ssel)
6637  &&
6638  (partonIsUnknown[3] || MYIDUP_tmp[3]==rsel)
6639  ){
6640  msq_tmp=0;
6641  if (ijselIsUpType[1] && ijselIsUpType[0]){
6642  if (ijselIsParticle[1] && ijselIsParticle[0]){
6643  if (isel!=jsel) msq_tmp = msq_uu_zz_ijrs1243[1];
6644  else msq_tmp = msq_uu_zzid_ijrs1243[1];
6645  }
6646  else if (ijselIsAntiparticle[1] && ijselIsAntiparticle[0]){
6647  if (isel!=jsel) msq_tmp = msq_ubarubar_zz_ijrs1243[1];
6648  else msq_tmp = msq_ubarubar_zzid_ijrs1243[1];
6649  }
6650  else if (ijselIsParticle[1] && ijselIsAntiparticle[0]) msq_tmp = msq_uubar_zz_ijrs1243[1];
6651  }
6652  else if (ijselIsDownType[1] && ijselIsDownType[0]){
6653  if (ijselIsParticle[1] && ijselIsParticle[0]){
6654  if (isel!=jsel) msq_tmp = msq_dd_zz_ijrs1243[1];
6655  else msq_tmp = msq_dd_zzid_ijrs1243[1];
6656  }
6657  else if (ijselIsAntiparticle[1] && ijselIsAntiparticle[0]){
6658  if (isel!=jsel) msq_tmp = msq_dbardbar_zz_ijrs1243[1];
6659  else msq_tmp = msq_dbardbar_zzid_ijrs1243[1];
6660  }
6661  else if (ijselIsParticle[1] && ijselIsAntiparticle[0]) msq_tmp = msq_ddbar_zz_ijrs1243[1];
6662  }
6663  else if (ijselIsUpType[1] && ijselIsDownType[0] && ijselIsParticle[1] && ijselIsAntiparticle[0]) msq_tmp = msq_udbar_zz_ijrs1243[1];
6664  else if (ijselIsDownType[1] && ijselIsUpType[0] && ijselIsParticle[1] && ijselIsAntiparticle[0]) msq_tmp = msq_dubar_zz_ijrs1243[1];
6665  MatElsq[jsel+5][isel+5] += msq_tmp; // Assign only those that match gen. info, if present at all.
6666  if (verbosity >= TVar::DEBUG_VERBOSE) MELAout << "Channel (isel, jsel, rsel, ssel)=" << isel << ", " << jsel << ", " << ssel << ", " << rsel << '\t' << msq_tmp << endl;
6667  }
6668  }
6669  else if (code==0){ // code==0 means WW->H is also possible with no interference to ZZ->H, for example u ub -> d db.
6670  vector<int> possible_rsel;
6671  vector<int> possible_ssel;
6672  vector<double> possible_Vsqir;
6673  vector<double> possible_Vsqjs;
6674  if (ijselIsUpType[0]){ possible_rsel.push_back(1); possible_rsel.push_back(3); possible_rsel.push_back(5); }
6675  else if (ijselIsDownType[0]){ possible_rsel.push_back(2); possible_rsel.push_back(4); }
6676  for (unsigned int ix=0; ix<possible_rsel.size(); ix++){
6677  rsel=possible_rsel.at(ix);
6678  double ckmval = pow(__modparameters_MOD_ckmbare(&isel, &rsel), 2);
6679  possible_Vsqir.push_back(ckmval);
6680  }
6681  if (ijselIsUpType[1]){ possible_ssel.push_back(1); possible_ssel.push_back(3); possible_ssel.push_back(5); }
6682  else if (ijselIsDownType[1]){ possible_ssel.push_back(2); possible_ssel.push_back(4); }
6683  for (unsigned int iy=0; iy<possible_ssel.size(); iy++){
6684  ssel=possible_ssel.at(iy);
6685  double ckmval = pow(__modparameters_MOD_ckmbare(&jsel, &ssel), 2);
6686  possible_Vsqjs.push_back(ckmval);
6687  }
6688 
6689  // Combine the ME and ME_swap based on actual ids
6690  for (unsigned int ix=0; ix<possible_rsel.size(); ix++){
6691  rsel=possible_rsel.at(ix)*TMath::Sign(1, isel);
6692  for (unsigned int iy=0; iy<possible_ssel.size(); iy++){
6693  ssel=possible_ssel.at(iy)*TMath::Sign(1, jsel);
6694  double ckmval = possible_Vsqir.at(ix)*possible_Vsqjs.at(iy);
6695  if (
6696  (partonIsUnknown[2] || MYIDUP_tmp[2]==rsel)
6697  &&
6698  (partonIsUnknown[3] || MYIDUP_tmp[3]==ssel)
6699  ){
6700  msq_tmp=0;
6701  if (ijselIsUpType[1] && ijselIsUpType[0] && ijselIsParticle[1] && ijselIsAntiparticle[0]) msq_tmp = msq_uubar_ww_ijrs1234[1];
6702  else if (ijselIsDownType[1] && ijselIsDownType[0] && ijselIsParticle[1] && ijselIsAntiparticle[0]) msq_tmp = msq_ddbar_ww_ijrs1234[1];
6703  msq_tmp *= ckmval;
6704  MatElsq[jsel+5][isel+5] += msq_tmp; // Assign only those that match gen. info, if present at all.
6705  if (verbosity >= TVar::DEBUG_VERBOSE) MELAout << "Channel (isel, jsel, rsel, ssel)=" << isel << ", " << jsel << ", " << rsel << ", " << ssel << '\t' << msq_tmp << endl;
6706  }
6707  if (
6708  rsel!=ssel
6709  &&
6710  (partonIsUnknown[2] || MYIDUP_tmp[2]==ssel)
6711  &&
6712  (partonIsUnknown[3] || MYIDUP_tmp[3]==rsel)
6713  ){
6714  msq_tmp=0;
6715  if (ijselIsUpType[1] && ijselIsUpType[0] && ijselIsParticle[1] && ijselIsAntiparticle[0]) msq_tmp = msq_uubar_ww_ijrs1243[1];
6716  else if (ijselIsDownType[1] && ijselIsDownType[0] && ijselIsParticle[1] && ijselIsAntiparticle[0]) msq_tmp = msq_ddbar_ww_ijrs1243[1];
6717  msq_tmp *= ckmval;
6718  MatElsq[jsel+5][isel+5] += msq_tmp; // Assign only those that match gen. info, if present at all.
6719  if (verbosity >= TVar::DEBUG_VERBOSE) MELAout << "Channel (isel, jsel, rsel, ssel)=" << isel << ", " << jsel << ", " << ssel << ", " << rsel << '\t' << msq_tmp << endl;
6720  }
6721  }
6722  }
6723  }
6724  else{ // code==2 means states with WW/ZZ interference allowed, for example u1 d2 -> u3 d4 + d4 u3.
6725  vector<int> possible_rsel;
6726  vector<int> possible_ssel;
6727  vector<double> possible_Vsqir;
6728  vector<double> possible_Vsqjs;
6729  if (ijselIsUpType[0]){ possible_rsel.push_back(1); possible_rsel.push_back(3); possible_rsel.push_back(5); }
6730  else if (ijselIsDownType[0]){ possible_rsel.push_back(2); possible_rsel.push_back(4); }
6731  for (unsigned int ix=0; ix<possible_rsel.size(); ix++){
6732  rsel=possible_rsel.at(ix);
6733  double ckmval = pow(__modparameters_MOD_ckmbare(&isel, &rsel), 2);
6734  possible_Vsqir.push_back(ckmval);
6735  }
6736  if (ijselIsUpType[1]){ possible_ssel.push_back(1); possible_ssel.push_back(3); possible_ssel.push_back(5); }
6737  else if (ijselIsDownType[1]){ possible_ssel.push_back(2); possible_ssel.push_back(4); }
6738  for (unsigned int iy=0; iy<possible_ssel.size(); iy++){
6739  ssel=possible_ssel.at(iy);
6740  double ckmval = pow(__modparameters_MOD_ckmbare(&jsel, &ssel), 2);
6741  possible_Vsqjs.push_back(ckmval);
6742  }
6743 
6744  // Loop over all possible combinations to get interference correct
6745  for (unsigned int ix=0; ix<possible_rsel.size(); ix++){
6746  rsel=possible_rsel.at(ix)*TMath::Sign(1, isel);
6747  for (unsigned int iy=0; iy<possible_ssel.size(); iy++){
6748  ssel=possible_ssel.at(iy)*TMath::Sign(1, jsel);
6749  double ckmval = possible_Vsqir.at(ix)*possible_Vsqjs.at(iy);
6750  if (
6751  (partonIsUnknown[2] || MYIDUP_tmp[2]==rsel)
6752  &&
6753  (partonIsUnknown[3] || MYIDUP_tmp[3]==ssel)
6754  ){
6755  if (rsel!=jsel && ssel!=isel){
6756  msq_tmp=0;
6757  if (ijselIsUpType[1] && ijselIsDownType[0]){
6758  if (ijselIsParticle[1] && ijselIsParticle[0]) msq_tmp = msq_ud_wwonly_ijrs1234[1];
6759  else if (ijselIsAntiparticle[1] && ijselIsAntiparticle[0]) msq_tmp = msq_ubardbar_wwonly_ijrs1234[1];
6760  }
6761  msq_tmp *= ckmval;
6762  MatElsq[jsel+5][isel+5] += msq_tmp; // Assign only those that match gen. info, if present at all.
6763  if (verbosity >= TVar::DEBUG_VERBOSE) MELAout << "Channel (isel, jsel, rsel, ssel)=" << isel << ", " << jsel << ", " << rsel << ", " << ssel << '\t' << msq_tmp << endl;
6764  }
6765  else{
6766  __modhiggsjj_MOD_evalamp_wbfh_unsymm_sa_select_exact(p4, &isel, &jsel, &rsel, &ssel, &msq_tmp);
6767  MatElsq[jsel+5][isel+5] += msq_tmp; // Assign only those that match gen. info, if present at all.
6768  if (verbosity >= TVar::DEBUG_VERBOSE) MELAout << "Channel (isel, jsel, rsel, ssel)=" << isel << ", " << jsel << ", " << rsel << ", " << ssel << '\t' << msq_tmp << endl;
6769  }
6770  }
6771  if (
6772  rsel!=ssel
6773  &&
6774  (partonIsUnknown[2] || MYIDUP_tmp[2]==ssel)
6775  &&
6776  (partonIsUnknown[3] || MYIDUP_tmp[3]==rsel)
6777  ){
6778  if (rsel!=jsel && ssel!=isel){
6779  msq_tmp=0;
6780  if (ijselIsUpType[1] && ijselIsDownType[0]){
6781  if (ijselIsParticle[1] && ijselIsParticle[0]) msq_tmp = msq_ud_wwonly_ijrs1243[1];
6782  else if (ijselIsAntiparticle[1] && ijselIsAntiparticle[0]) msq_tmp = msq_ubardbar_wwonly_ijrs1243[1];
6783  }
6784  msq_tmp *= ckmval;
6785  MatElsq[jsel+5][isel+5] += msq_tmp; // Assign only those that match gen. info, if present at all.
6786  if (verbosity >= TVar::DEBUG_VERBOSE) MELAout << "Channel (isel, jsel, rsel, ssel)=" << isel << ", " << jsel << ", " << ssel << ", " << rsel << '\t' << msq_tmp << endl;
6787  }
6788  else{
6789  __modhiggsjj_MOD_evalamp_wbfh_unsymm_sa_select_exact(p4, &isel, &jsel, &ssel, &rsel, &msq_tmp);
6790  MatElsq[jsel+5][isel+5] += msq_tmp; // Assign only those that match gen. info, if present at all.
6791  if (verbosity >= TVar::DEBUG_VERBOSE) MELAout << "Channel (isel, jsel, rsel, ssel)=" << isel << ", " << jsel << ", " << ssel << ", " << rsel << '\t' << msq_tmp << endl;
6792  }
6793  }
6794  }
6795  }
6796  }
6797  } // End swapped isel<jsel cases
6798  } // End loop over ic<nijchannels
6799  // END COMPUTATION
6800  } // End production == TVar::JJVBF
6801 
6802  int GeVexponent_MEsq = 4-(1+nRequested_AssociatedJets)*2;
6803  double constant = pow(GeV, -GeVexponent_MEsq);
6804  for (int ii=0; ii<nmsq; ii++){ for (int jj=0; jj<nmsq; jj++) MatElsq[jj][ii] *= constant; }
6805  // FOTRAN convention -5 -4 -3 -2 -1 0 1 2 3 4 5
6806  // parton flavor bbar cbar sbar ubar dbar g d u s c b
6807  // C++ convention 0 1 2 3 4 5 6 7 8 9 10
6808  if (verbosity >= TVar::DEBUG){
6809  MELAout << "MatElsq:\n";
6810  for (int ii = 0; ii < nmsq; ii++){ for (int jj = 0; jj < nmsq; jj++) MELAout << MatElsq[jj][ii] << '\t'; MELAout << endl; }
6811  }
6812  sum_msqjk = SumMEPDF(MomStore[0], MomStore[1], MatElsq, RcdME, EBEAM, verbosity);
6813  /*
6814  if (verbosity >= TVar::ERROR && (std::isnan(sum_msqjk) || std::isinf(sum_msqjk))){
6815  MELAout << "TUtil::HJJMatEl: FAILURE!" << endl;
6816  MELAout << "MatElsq:\n";
6817  for (int ii = 0; ii < nmsq; ii++){ for (int jj = 0; jj < nmsq; jj++) MELAout << MatElsq[jj][ii] << '\t'; MELAout << endl; }
6818  double fx[2][nmsq];
6819  RcdME->getPartonWeights(fx[0], fx[1]);
6820  for (int ii = 0; ii < nmsq; ii++){ for (int jj = 0; jj < 2; jj++) MELAout << fx[jj][ii] << '\t'; MELAout << endl; }
6821  for (int i=0; i<5; i++) MELAout << "p["<<i<<"] (Px, Py, Pz, E, M):\t" << p4[i][1]/GeV << '\t' << p4[i][2]/GeV << '\t' << p4[i][3]/GeV << '\t' << p4[i][0]/GeV << '\t' << sqrt(fabs(pow(p4[i][0], 2)-pow(p4[i][1], 2)-pow(p4[i][2], 2)-pow(p4[i][3], 2)))/GeV << endl;
6822  TUtil::PrintCandidateSummary(RcdME->melaCand);
6823  MELAout << endl;
6824  }
6825  */
6826 
6827  if (verbosity>=TVar::DEBUG){
6828  MELAout
6829  << "TUtil::HJJMatEl: Reset AlphaS:\n"
6830  << "\tBefore reset, alphas scale: " << scale_.scale << ", PDF scale: " << facscale_.facscale << endl;
6831  }
6832  SetAlphaS(defaultRenScale, defaultFacScale, 1., 1., defaultNloop, defaultNflav, defaultPdflabel);
6833  if (verbosity>=TVar::DEBUG){
6834  GetAlphaS(&alphasVal, &alphasmzVal);
6835  MELAout
6836  << "TUtil::HJJMatEl: Reset AlphaS result:\n"
6837  << "\tAfter reset, alphas scale: " << scale_.scale << ", PDF scale: " << facscale_.facscale << ", alphas(Qren): " << alphasVal << ", alphas(MZ): " << alphasmzVal << endl;
6838  }
6839  return sum_msqjk;
6840 }

◆ InitJHUGenMELA()

void TUtil::InitJHUGenMELA ( const char *  pathtoPDFSet,
int  PDFMember,
double  collider_sqrts 
)

Definition at line 3392 of file TUtil.cc.

3392  {
3393  const double GeV = 1./100.;
3394  collider_sqrts *= GeV; // GeV units in JHUGen
3395 
3396  char path_pdf_c[200];
3397  sprintf(path_pdf_c, "%s", pathtoPDFSet);
3398  int pathpdfLength = strlen(path_pdf_c);
3399 
3400  __modjhugen_MOD_initfirsttime(path_pdf_c, &pathpdfLength, &PDFMember, &collider_sqrts);
3401 }

◆ InterpretScaleScheme()

double TUtil::InterpretScaleScheme ( const TVar::Production production,
const TVar::MatrixElement matrixElement,
const TVar::EventScaleScheme scheme,
TLorentzVector  p[mxpart] 
)

Definition at line 1654 of file TUtil.cc.

1654  {
1655  double Q=0;
1656  TLorentzVector const nullFourVector(0, 0, 0, 0);
1657  if (scheme == TVar::Fixed_mH) Q = masses_mcfm_.hmass;
1658  else if (scheme == TVar::Fixed_mW) Q = masses_mcfm_.wmass;
1659  else if (scheme == TVar::Fixed_mZ) Q = masses_mcfm_.zmass;
1660  else if (scheme == TVar::Fixed_mWPlusmH) Q = (masses_mcfm_.wmass+masses_mcfm_.hmass);
1661  else if (scheme == TVar::Fixed_mZPlusmH) Q = (masses_mcfm_.zmass+masses_mcfm_.hmass);
1662  else if (scheme == TVar::Fixed_TwomtPlusmH) Q = (2.*masses_mcfm_.mt+masses_mcfm_.hmass);
1663  else if (scheme == TVar::Fixed_mtPlusmH) Q = masses_mcfm_.mt+masses_mcfm_.hmass;
1664  else if (scheme == TVar::Dynamic_qH){
1665  TLorentzVector pTotal = p[2]+p[3]+p[4]+p[5];
1666  Q = fabs(pTotal.M());
1667  }
1668  else if (scheme == TVar::Dynamic_qJJH){
1669  TLorentzVector pTotal = p[2]+p[3]+p[4]+p[5]+p[6]+p[7];
1670  Q = fabs(pTotal.M());
1671  }
1672  else if (scheme == TVar::Dynamic_qJJ_qH){
1673  TLorentzVector qH = p[2]+p[3]+p[4]+p[5];
1674  TLorentzVector qJJ = p[6]+p[7];
1675  Q = fabs(qH.M()+qJJ.M());
1676  }
1677  else if (scheme == TVar::Dynamic_qJ_qJ_qH){
1678  TLorentzVector qH = p[2]+p[3]+p[4]+p[5];
1679  Q = fabs(qH.M()+p[6].M()+p[7].M());
1680  }
1681  else if (scheme == TVar::Dynamic_HT){
1682  for (int c=2; c<mxpart; c++) Q += p[c].Pt(); // Scalar sum of all pTs
1683  }
1684  else if (scheme == TVar::Dynamic_Leading_pTJ){
1685  // pT of the hardest jet, should be just p[6].Pt() if jets are already ordered in pT
1686  for (int c=6; c<mxpart; c++) Q = std::max(Q, p[c].Pt());
1687  }
1688  else if (scheme == TVar::Dynamic_Softest_pTJ){
1689  // pT of the softest jet, should be just p[7].Pt() if jets are already ordered in pT
1690  Q = p[6].Pt();
1691  for (int c=7; c<mxpart; c++){ if (p[c].Pt()>0.) Q = std::min(Q, p[c].Pt()); }
1692  if (Q<0.) Q = 0;
1693  }
1694  else if (scheme == TVar::DefaultScaleScheme){
1695  // Defaults are dynamic scales except in ttH and bbH.
1696  if (matrixElement==TVar::JHUGen || matrixElement==TVar::MADGRAPH){
1697  if (
1698  production == TVar::JJQCD
1699  || production == TVar::JJVBF
1700  || production == TVar::JQCD
1701  || production == TVar::ZZGG
1702  || production == TVar::ZZQQB
1703  || production == TVar::ZZQQB_STU
1704  || production == TVar::ZZQQB_S
1705  || production == TVar::ZZQQB_TU
1706  || production == TVar::ZZINDEPENDENT
1707  || production == TVar::Lep_WH || production == TVar::Had_WH
1708  || production == TVar::Lep_ZH || production == TVar::Had_ZH
1709  || production == TVar::GammaH
1710  ){
1711  TLorentzVector pTotal = p[2]+p[3]+p[4]+p[5];
1712  Q = fabs(pTotal.M());
1713  }
1714  else if (
1715  production == TVar::ttH
1716  ||
1717  production == TVar::bbH
1718  ||
1719  production == TVar::ZZQQB
1720  ) Q = (2.*masses_mcfm_.mt+masses_mcfm_.hmass);
1721  }
1722  else if (matrixElement==TVar::MCFM){
1723  if (
1724  production == TVar::ZZGG
1725  || production == TVar::ZZINDEPENDENT
1726  || production == TVar::ZZQQB
1727  || production == TVar::ZZQQB_STU
1728 
1729  || production == TVar::JQCD
1730 
1731  || production == TVar::JJQCD
1732  || production == TVar::JJVBF
1733  || production == TVar::JJEW
1734  || production == TVar::JJEWQCD
1735  || production == TVar::Lep_WH || production == TVar::Had_WH
1736  || production == TVar::Lep_ZH || production == TVar::Had_ZH
1737 
1738  || production == TVar::ZZQQB_S
1739  || production == TVar::JJQCD_S
1740  || production == TVar::JJVBF_S
1741  || production == TVar::JJEW_S
1742  || production == TVar::JJEWQCD_S
1743  || production == TVar::Lep_WH_S || production == TVar::Had_WH_S
1744  || production == TVar::Lep_ZH_S || production == TVar::Had_ZH_S
1745 
1746  || production == TVar::ZZQQB_TU
1747  || production == TVar::JJQCD_TU
1748  || production == TVar::JJVBF_TU
1749  || production == TVar::JJEW_TU
1750  || production == TVar::JJEWQCD_TU
1751  || production == TVar::Lep_WH_TU || production == TVar::Had_WH_TU
1752  || production == TVar::Lep_ZH_TU || production == TVar::Had_ZH_TU
1753 
1754  || production == TVar::GammaH
1755  ){
1756  TLorentzVector pTotal = p[2]+p[3]+p[4]+p[5];
1757  Q = fabs(pTotal.M());
1758  }
1759  else if (
1760  production == TVar::ttH
1761  || production == TVar::bbH
1762  ){ // ttH and bbH are not implemented through MCFM, will need revision if they are implemented.
1763  TLorentzVector pTotal = p[2]+p[3]+p[4]+p[5]+p[6]+p[7];
1764  Q = fabs(pTotal.M());
1765  }
1766  }
1767  }
1768 
1769  if (Q<=0.){
1770  MELAerr << "Scaling " << scheme << " fails for production " << production << ", defaulting to dynamic scheme m3456 " << endl;
1771  TLorentzVector pTotal = p[2]+p[3]+p[4]+p[5];
1772  Q = fabs(pTotal.M());
1773  }
1774  return Q;
1775 }

◆ JHUGenMatEl()

double TUtil::JHUGenMatEl ( const TVar::Process process,
const TVar::Production production,
const TVar::MatrixElement matrixElement,
TVar::event_scales_type event_scales,
MelaIO RcdME,
const double &  EBEAM,
TVar::VerbosityLevel  verbosity 
)

Definition at line 4887 of file TUtil.cc.

4892  {
4893  const double GeV=1./100.; // JHUGen mom. scale factor
4894  double MatElSq=0; // Return value
4895 
4896  if (matrixElement!=TVar::JHUGen){ if (verbosity>=TVar::ERROR) MELAerr << "TUtil::JHUGenMatEl: Non-JHUGen MEs are not supported" << endl; return MatElSq; }
4897  bool isSpinZero = (
4899  || process == TVar::H0minus
4900  || process == TVar::H0hplus
4902  || process == TVar::H0_Zgs
4903  || process == TVar::H0_gsgs
4904  || process == TVar::H0_Zgs_PS
4908  );
4909  bool isSpinOne = (
4911  || process == TVar::H1plus
4913  );
4914  bool isSpinTwo = (
4916  || process == TVar::H2_g1
4917  || process == TVar::H2_g8
4918  || process == TVar::H2_g4
4919  || process == TVar::H2_g5
4920  || process == TVar::H2_g2
4921  || process == TVar::H2_g3
4922  || process == TVar::H2_g6
4923  || process == TVar::H2_g7
4924  || process == TVar::H2_g9
4925  || process == TVar::H2_g10
4927  );
4928  if (!(isSpinZero || isSpinOne || isSpinTwo)){ if (verbosity>=TVar::ERROR) MELAerr << "TUtil::JHUGenMatEl: Process " << TVar::ProcessName(process) << " (" << process << ")" << " not supported." << endl; return MatElSq; }
4929  if (verbosity>=TVar::DEBUG){
4930  MELAout << "TUtil::JHUGenMatEl: Process " << TVar::ProcessName(process) << " is computing a spin-";
4931  if (isSpinZero) MELAout << "0";
4932  else if (isSpinOne) MELAout << "1";
4933  else if (isSpinTwo) MELAout << "2";
4934  else MELAout << "?";
4935  MELAout << " ME with production " << TVar::ProductionName(production) << "." << endl;
4936  }
4937 
4938  double msq[nmsq][nmsq]={ { 0 } }; // ME**2[parton2][parton1] for each incoming parton 1 and 2, used in RcdME
4939  int MYIDUP_tmp[4]={ 0 }; // Initial assignment array, unconverted. 0==Unassigned
4940  vector<pair<int, int>> idarray[2]; // All possible ids for each daughter based on the value of MYIDUP_tmp[0:3] and the desired V ids taken from mela_event.intermediateVid.at(0:1)
4941  int MYIDUP[4]={ 0 }; // "Working" assignment, converted
4942  int idfirst[2]={ 0 }; // Used to set DecayMode1, = MYIDUP[0:1]
4943  int idsecond[2]={ 0 }; // Used to set DecayMode2, = MYIDUP[2:3]
4944  double p4[6][4]={ { 0 } }; // Mom (*GeV) to pass into JHUGen
4945  TLorentzVector MomStore[mxpart]; // Mom (in natural units) to compute alphaS
4946  for (int i = 0; i < mxpart; i++) MomStore[i].SetXYZT(0, 0, 0, 0);
4947 
4948  // Notice that partIncCode is specific for this subroutine
4949  int partIncCode=TVar::kNoAssociated; // Do not use associated particles in the pT=0 frame boost
4950  simple_event_record mela_event;
4951  mela_event.AssociationCode=partIncCode;
4953  RcdME->melaCand,
4954  mela_event,
4955  verbosity
4956  );
4957  if (mela_event.pDaughters.size()<2 || mela_event.intermediateVid.size()!=2){
4958  if (verbosity>=TVar::ERROR) MELAerr << "TUtil::JHUGenMatEl: Number of daughters " << mela_event.pDaughters.size() << " or number of intermediate Vs " << mela_event.intermediateVid << " not supported!" << endl;
4959  return MatElSq;
4960  }
4961 
4962  // p(i,0:3) = (E(i),px(i),py(i),pz(i))
4963  // i=0,1: g1,g2 or q1, qb2 (outgoing convention)
4964  // i=2,3: correspond to MY_IDUP(0),MY_IDUP(1)
4965  // i=4,5: correspond to MY_IDUP(2),MY_IDUP(3)
4966  for (int ipar=0; ipar<2; ipar++){
4967  if (mela_event.pMothers.at(ipar).second.T()>0.){
4968  p4[ipar][0] = -mela_event.pMothers.at(ipar).second.T()*GeV;
4969  p4[ipar][1] = -mela_event.pMothers.at(ipar).second.X()*GeV;
4970  p4[ipar][2] = -mela_event.pMothers.at(ipar).second.Y()*GeV;
4971  p4[ipar][3] = -mela_event.pMothers.at(ipar).second.Z()*GeV;
4972  MomStore[ipar] = mela_event.pMothers.at(ipar).second;
4973  }
4974  else{
4975  p4[ipar][0] = mela_event.pMothers.at(ipar).second.T()*GeV;
4976  p4[ipar][1] = mela_event.pMothers.at(ipar).second.X()*GeV;
4977  p4[ipar][2] = mela_event.pMothers.at(ipar).second.Y()*GeV;
4978  p4[ipar][3] = mela_event.pMothers.at(ipar).second.Z()*GeV;
4979  MomStore[ipar] = -mela_event.pMothers.at(ipar).second;
4980  }
4981  // From Markus:
4982  // Note that the momentum no.2, p(1:4, 2), is a dummy which is not used in case production == TVar::ZZINDEPENDENT.
4983  if (ipar==1 && production == TVar::ZZINDEPENDENT){ for (int ix=0; ix<4; ix++){ p4[0][ix] += p4[ipar][ix]; p4[ipar][ix]=0.; } }
4984  }
4985  //initialize decayed particles
4986  if (mela_event.pDaughters.size()==2){
4987  for (unsigned int ipar=0; ipar<mela_event.pDaughters.size(); ipar++){
4988  TLorentzVector* momTmp = &(mela_event.pDaughters.at(ipar).second);
4989  int* idtmp = &(mela_event.pDaughters.at(ipar).first);
4990 
4991  int arrindex = 2*ipar;
4992  if (!PDGHelpers::isAnUnknownJet(*idtmp)) MYIDUP_tmp[arrindex] = *idtmp;
4993  else MYIDUP_tmp[arrindex] = 0;
4994  MYIDUP_tmp[arrindex+1] = -9000;
4995  p4[arrindex+2][0] = momTmp->T()*GeV;
4996  p4[arrindex+2][1] = momTmp->X()*GeV;
4997  p4[arrindex+2][2] = momTmp->Y()*GeV;
4998  p4[arrindex+2][3] = momTmp->Z()*GeV;
4999  MomStore[arrindex+2] = *momTmp;
5000  if (verbosity >= TVar::DEBUG) MELAout << "MYIDUP_tmp[" << arrindex << "(" << ipar << ")" << "]=" << MYIDUP_tmp[arrindex] << endl;
5001  }
5002  }
5003  else{
5004  for (unsigned int ipar=0; ipar<4; ipar++){
5005  if (ipar<mela_event.pDaughters.size()){
5006  TLorentzVector* momTmp = &(mela_event.pDaughters.at(ipar).second);
5007  int* idtmp = &(mela_event.pDaughters.at(ipar).first);
5008 
5009  if (!PDGHelpers::isAnUnknownJet(*idtmp)) MYIDUP_tmp[ipar] = *idtmp;
5010  else MYIDUP_tmp[ipar] = 0;
5011  p4[ipar+2][0] = momTmp->T()*GeV;
5012  p4[ipar+2][1] = momTmp->X()*GeV;
5013  p4[ipar+2][2] = momTmp->Y()*GeV;
5014  p4[ipar+2][3] = momTmp->Z()*GeV;
5015  MomStore[ipar+2] = *momTmp;
5016  }
5017  else MYIDUP_tmp[ipar] = -9000; // No need to set p4, which is already 0 by initialization
5018  // __modparameters_MOD_not_a_particle__?
5019  if (verbosity >= TVar::DEBUG) MELAout << "MYIDUP_tmp[" << ipar << "]=" << MYIDUP_tmp[ipar] << endl;
5020  }
5021  }
5022 
5023  // Set alphas
5024  double defaultRenScale = scale_.scale;
5025  double defaultFacScale = facscale_.facscale;
5026  int defaultNloop = nlooprun_.nlooprun;
5027  int defaultNflav = nflav_.nflav;
5028  string defaultPdflabel = pdlabel_.pdlabel;
5029  double renQ = InterpretScaleScheme(production, matrixElement, event_scales->renomalizationScheme, MomStore);
5030  double facQ = InterpretScaleScheme(production, matrixElement, event_scales->factorizationScheme, MomStore);
5031  SetAlphaS(renQ, facQ, event_scales->ren_scale_factor, event_scales->fac_scale_factor, 1, 5, "cteq6_l"); // Set AlphaS(|Q|/2, mynloop, mynflav, mypartonPDF)
5032  double alphasVal, alphasmzVal;
5033  GetAlphaS(&alphasVal, &alphasmzVal);
5034  RcdME->setRenormalizationScale(renQ);
5035  RcdME->setFactorizationScale(facQ);
5036  RcdME->setAlphaS(alphasVal);
5037  RcdME->setAlphaSatMZ(alphasmzVal);
5038  RcdME->setHiggsMassWidth(masses_mcfm_.hmass, masses_mcfm_.hwidth, 0);
5040  if (verbosity>=TVar::DEBUG){
5041  MELAout
5042  << "TUtil::JHUGenMatEl: Set AlphaS:\n"
5043  << "\tBefore set, alphas scale: " << defaultRenScale << ", PDF scale: " << defaultFacScale << '\n'
5044  << "\trenQ: " << renQ << " ( x " << event_scales->ren_scale_factor << "), facQ: " << facQ << " ( x " << event_scales->fac_scale_factor << ")\n"
5045  << "\tAfter set, alphas scale: " << scale_.scale << ", PDF scale: " << facscale_.facscale << ", alphas(Qren): " << alphasVal << ", alphas(MZ): " << alphasmzVal << endl;
5046  }
5047 
5048  // Determine te actual ids to compute the ME. Assign ids if any are unknown.
5049  for (int iv=0; iv<2; iv++){ // Max. 2 vector bosons
5050  if (MYIDUP_tmp[2*iv+0]!=0 && MYIDUP_tmp[2*iv+1]!=0){ // Z->2l,2nu,2q, W->lnu,qq', G
5051  // OSSF pairs or just one "V-daughter"
5052  if (
5053  TMath::Sign(1, MYIDUP_tmp[2*iv+0])==TMath::Sign(1, -MYIDUP_tmp[2*iv+1])
5054  ||
5055  (MYIDUP_tmp[2*iv+0]==-9000 || MYIDUP_tmp[2*iv+1]==-9000)
5056  ) idarray[iv].push_back(pair<int, int>(MYIDUP_tmp[2*iv+0], MYIDUP_tmp[2*iv+1]));
5057  // SSSF pairs, ordered already by phi, so avoid the re-ordering inside the ME
5058  else if (MYIDUP_tmp[2*iv+0]<0) idarray[iv].push_back(pair<int, int>(-MYIDUP_tmp[2*iv+0], MYIDUP_tmp[2*iv+1])); // Reverse sign of first daughter if SS(--)SF pair
5059  else idarray[iv].push_back(pair<int, int>(MYIDUP_tmp[2*iv+0], -MYIDUP_tmp[2*iv+1])); // Reverse sign of daughter if SS(++)SF pair
5060  }
5061  else if (MYIDUP_tmp[2*iv+0]!=0){ // ->f?, one quark is known
5062  if (PDGHelpers::isAWBoson(mela_event.intermediateVid.at(iv))){ // (W+/-)->f?
5063  if (PDGHelpers::isUpTypeQuark(MYIDUP_tmp[2*iv+0])){ // (W+)->u?
5064  int id_dn = TMath::Sign(1, -MYIDUP_tmp[2*iv+0]);
5065  int id_st = TMath::Sign(3, -MYIDUP_tmp[2*iv+0]);
5066  int id_bt = TMath::Sign(5, -MYIDUP_tmp[2*iv+0]);
5067  idarray[iv].push_back(pair<int, int>(MYIDUP_tmp[2*iv+0], id_dn));
5068  idarray[iv].push_back(pair<int, int>(MYIDUP_tmp[2*iv+0], id_st));
5069  idarray[iv].push_back(pair<int, int>(MYIDUP_tmp[2*iv+0], id_bt));
5070  }
5071  else if (PDGHelpers::isDownTypeQuark(MYIDUP_tmp[2*iv+0])){ // (W-)->d?
5072  int id_up = TMath::Sign(2, -MYIDUP_tmp[2*iv+0]);
5073  int id_ch = TMath::Sign(4, -MYIDUP_tmp[2*iv+0]);
5074  idarray[iv].push_back(pair<int, int>(MYIDUP_tmp[2*iv+0], id_up));
5075  idarray[iv].push_back(pair<int, int>(MYIDUP_tmp[2*iv+0], id_ch));
5076  }
5077  }
5078  else if (PDGHelpers::isAZBoson(mela_event.intermediateVid.at(iv))){ // Z->f?
5079  idarray[iv].push_back(pair<int, int>(MYIDUP_tmp[2*iv+0], -MYIDUP_tmp[2*iv+0]));
5080  }
5081  }
5082  else if (MYIDUP_tmp[2*iv+1]!=0){ // ->?fb, one quark is known
5083  if (PDGHelpers::isAWBoson(mela_event.intermediateVid.at(iv))){ // (W+/-)->?fb
5084  if (PDGHelpers::isUpTypeQuark(MYIDUP_tmp[2*iv+1])){ // (W-)->?ub
5085  int id_dn = TMath::Sign(1, -MYIDUP_tmp[2*iv+1]);
5086  int id_st = TMath::Sign(3, -MYIDUP_tmp[2*iv+1]);
5087  int id_bt = TMath::Sign(5, -MYIDUP_tmp[2*iv+1]);
5088  idarray[iv].push_back(pair<int, int>(id_dn, MYIDUP_tmp[2*iv+1]));
5089  idarray[iv].push_back(pair<int, int>(id_st, MYIDUP_tmp[2*iv+1]));
5090  idarray[iv].push_back(pair<int, int>(id_bt, MYIDUP_tmp[2*iv+1]));
5091  }
5092  else if (PDGHelpers::isDownTypeQuark(MYIDUP_tmp[2*iv+1])){ // (W+)->?db
5093  int id_up = TMath::Sign(2, -MYIDUP_tmp[2*iv+1]);
5094  int id_ch = TMath::Sign(4, -MYIDUP_tmp[2*iv+1]);
5095  idarray[iv].push_back(pair<int, int>(id_up, MYIDUP_tmp[2*iv+1]));
5096  idarray[iv].push_back(pair<int, int>(id_ch, MYIDUP_tmp[2*iv+1]));
5097  }
5098  }
5099  else if (PDGHelpers::isAZBoson(mela_event.intermediateVid.at(iv))){ // Z->?fb
5100  idarray[iv].push_back(pair<int, int>(-MYIDUP_tmp[2*iv+1], MYIDUP_tmp[2*iv+1]));
5101  }
5102  }
5103  else{ // Both fermions unknown
5104  if (PDGHelpers::isAWBoson(mela_event.intermediateVid.at(iv))){ // (W+/-)->??
5105  for (int iqu=1; iqu<=2; iqu++){
5106  int id_up = iqu*2;
5107  for (int iqd=1; iqd<=3; iqd++){
5108  int id_dn = iqd*2-1;
5109  if (iv==0){ idarray[iv].push_back(pair<int, int>(id_up, -id_dn)); idarray[iv].push_back(pair<int, int>(-id_dn, id_up)); }
5110  else{ idarray[iv].push_back(pair<int, int>(id_dn, -id_up)); idarray[iv].push_back(pair<int, int>(-id_up, id_dn)); }
5111  }
5112  }
5113  }
5114  else if (PDGHelpers::isAZBoson(mela_event.intermediateVid.at(iv))){ // Z->??
5115  for (int iq=1; iq<=5; iq++){ idarray[iv].push_back(pair<int, int>(iq, -iq)); idarray[iv].push_back(pair<int, int>(-iq, iq)); }
5116  }
5117  }
5118  }
5119 
5120  // Variables to set L1/2 and R1/2 couplings into RcdME
5121  const int InvalidMode=-1, WWMode=0, ZZMode=1, ZgMode=5, ggMode=7;
5122  int VVMode=InvalidMode;
5123  if (PDGHelpers::isAWBoson(mela_event.intermediateVid.at(0)) && PDGHelpers::isAWBoson(mela_event.intermediateVid.at(1))) VVMode=WWMode;
5124  else if (PDGHelpers::isAZBoson(mela_event.intermediateVid.at(0)) && PDGHelpers::isAZBoson(mela_event.intermediateVid.at(1))) VVMode=ZZMode;
5125  else if (PDGHelpers::isAPhoton(mela_event.intermediateVid.at(0)) && PDGHelpers::isAPhoton(mela_event.intermediateVid.at(1))) VVMode=ggMode;
5126  else if (
5127  (PDGHelpers::isAZBoson(mela_event.intermediateVid.at(0)) && PDGHelpers::isAPhoton(mela_event.intermediateVid.at(1)))
5128  ||
5129  (PDGHelpers::isAZBoson(mela_event.intermediateVid.at(1)) && PDGHelpers::isAPhoton(mela_event.intermediateVid.at(0)))
5130  ) VVMode=ZgMode;
5131  double aL1=0, aL2=0, aR1=0, aR2=0;
5132 
5133  int nNonZero=0;
5134  for (unsigned int v1=0; v1<idarray[0].size(); v1++){
5135  for (unsigned int v2=0; v2<idarray[1].size(); v2++){
5136  // Convert the particle ids to JHU convention
5137  if (idarray[0].at(v1).first!=-9000) MYIDUP[0] = convertLHEreverse(&(idarray[0].at(v1).first));
5138  if (idarray[0].at(v1).second!=-9000) MYIDUP[1] = convertLHEreverse(&(idarray[0].at(v1).second));
5139  if (idarray[1].at(v2).first!=-9000) MYIDUP[2] = convertLHEreverse(&(idarray[1].at(v2).first));
5140  if (idarray[1].at(v2).second!=-9000) MYIDUP[3] = convertLHEreverse(&(idarray[1].at(v2).second));
5141 
5142  // Check working ids
5143  if (verbosity>=TVar::DEBUG){ for (unsigned int idau=0; idau<4; idau++) MELAout << "MYIDUP[" << idau << "]=" << MYIDUP[idau] << endl; }
5144 
5145  // Determine M_V and Ga_V in JHUGen, needed for g1 vs everything else.
5146  for (int ip=0; ip<2; ip++){ idfirst[ip]=MYIDUP[ip]; idsecond[ip]=MYIDUP[ip+2]; }
5147  __modjhugenmela_MOD_setdecaymodes(idfirst, idsecond); // Set M_V and Ga_V in JHUGen
5148  if (verbosity>=TVar::DEBUG){
5149  double mv, gv;
5150  __modjhugenmela_MOD_getmvgv(&mv, &gv);
5151  MELAout << "TUtil::JHUGenMatEl: M_V=" << mv/GeV << ", Ga_V=" << gv/GeV << endl;
5153  MELAout << "TUtil::JHUGenMatEl: M_Vprime=" << mv/GeV << ", Ga_Vprime=" << gv/GeV << endl;
5154  }
5155 
5156  // Sum over possible left/right couplings of the Vs
5157  double aLRtmp[4]={ 0 };
5158  __modjhugenmela_MOD_getdecaycouplings(&VVMode, MYIDUP, &(aLRtmp[0]), &(aLRtmp[1]), &(aLRtmp[2]), &(aLRtmp[3]));
5159  if (idarray[0].size()>1){
5160  aL1 = sqrt(pow(aL1, 2)+pow(aLRtmp[0], 2));
5161  aR1 = sqrt(pow(aR1, 2)+pow(aLRtmp[1], 2));
5162  }
5163  else{
5164  aL1 = aLRtmp[0];
5165  aR1 = aLRtmp[1];
5166  }
5167  if (idarray[1].size()>1){
5168  aL2 = sqrt(pow(aL2, 2)+pow(aLRtmp[2], 2));
5169  aR2 = sqrt(pow(aR2, 2)+pow(aLRtmp[3], 2));
5170  }
5171  else{
5172  aL2 = aLRtmp[2];
5173  aR2 = aLRtmp[3];
5174  }
5175 
5176  double MatElTmp=0.;
5177  if (production == TVar::ZZGG){
5178  if (isSpinZero) __modhiggs_MOD_evalamp_gg_h_vv(p4, MYIDUP, &MatElTmp);
5179  else if (isSpinTwo) __modgraviton_MOD_evalamp_gg_g_vv(p4, MYIDUP, &MatElTmp);
5180  }
5181  else if (production == TVar::ZZQQB){
5182  if (isSpinOne) __modzprime_MOD_evalamp_qqb_zprime_vv(p4, MYIDUP, &MatElTmp);
5183  else if (isSpinTwo) __modgraviton_MOD_evalamp_qqb_g_vv(p4, MYIDUP, &MatElTmp);
5184  }
5185  else if (production == TVar::ZZINDEPENDENT){
5186  if (isSpinZero) __modhiggs_MOD_evalamp_h_vv(p4, MYIDUP, &MatElTmp);
5187  else if (isSpinOne) __modzprime_MOD_evalamp_zprime_vv(p4, MYIDUP, &MatElTmp);
5188  else if (isSpinTwo) __modgraviton_MOD_evalamp_g_vv(p4, MYIDUP, &MatElTmp);
5189  }
5190  // Add CKM elements since they are not included
5191  if (PDGHelpers::isAWBoson(mela_event.intermediateVid.at(0))) MatElTmp *= pow(__modparameters_MOD_ckmbare(&(idarray[0].at(v1).first), &(idarray[0].at(v1).second)), 2);
5192  if (PDGHelpers::isAWBoson(mela_event.intermediateVid.at(1))) MatElTmp *= pow(__modparameters_MOD_ckmbare(&(idarray[1].at(v2).first), &(idarray[1].at(v2).second)), 2);
5193 
5194  if (verbosity >= TVar::DEBUG) MELAout << "=====\nTUtil::JHUGenMatEl: Instance MatElTmp = " << MatElTmp << "\n=====" << endl;
5195  MatElSq += MatElTmp;
5196  if (MatElTmp>0.) nNonZero++;
5197  }
5198  }
5199  if (nNonZero>0) MatElSq /= ((double)nNonZero);
5200  if (verbosity >= TVar::DEBUG){
5201  MELAout << "TUtil::JHUGenMatEl: Number of matrix element instances computed: " << nNonZero << endl;
5202  MELAout << "TUtil::JHUGenMatEl: MatElSq after division = " << MatElSq << endl;
5203  }
5204 
5205  // Set aL/R 1,2 into RcdME
5206  RcdME->setVDaughterCouplings(aL1, aR1, 0);
5207  RcdME->setVDaughterCouplings(aL2, aR2, 1);
5208  if (verbosity >= TVar::DEBUG_VERBOSE) MELAout
5209  << "TUtil::JHUGenMatEl: aL1, aR1, aL2, aR2: "
5210  << aL1 << ", " << aR1 << ", " << aL2 << ", " << aR2
5211  << endl;
5212 
5213  // This constant is needed to account for the different units used in JHUGen compared to MCFM
5214  int GeVexponent_MEsq = 4-((int)mela_event.pDaughters.size())*2;
5215  if (production == TVar::ZZINDEPENDENT) GeVexponent_MEsq += 2; // Amplitude missing m from production and 1/m**2 from propagator == Amplitude missing 1/m == MEsq missing 1/m**2
5216  double constant = pow(GeV, -GeVexponent_MEsq);
5217  MatElSq *= constant;
5218 
5219  // Set RcdME information for ME and parton distributions, taking into account the mothers if id!=0 (i.e. if not unknown).
5220  if (mela_event.pMothers.at(0).first!=0 && mela_event.pMothers.at(1).first!=0){
5221  int ix=5, iy=5;
5222  if (abs(mela_event.pMothers.at(0).first)<6) ix=mela_event.pMothers.at(0).first + 5;
5223  if (abs(mela_event.pMothers.at(1).first)<6) iy=mela_event.pMothers.at(1).first + 5;
5224  msq[iy][ix]=MatElSq; // Note that SumMEPdf receives a transposed msq
5225  }
5226  else{
5227  if (production == TVar::ZZGG || production == TVar::ZZINDEPENDENT) msq[5][5]=MatElSq;
5228  else if (production == TVar::ZZQQB){
5229  for (int ix=0; ix<5; ix++){ msq[ix][10-ix]=MatElSq; msq[10-ix][ix]=MatElSq; }
5230  }
5231  }
5232  if (production!=TVar::ZZINDEPENDENT) SumMEPDF(MomStore[0], MomStore[1], msq, RcdME, EBEAM, verbosity);
5233  else{ // If production is ZZINDEPENDENT, only set gg index with fx1,2[g,g]=1.
5234  double fx_dummy[nmsq]={ 0 }; fx_dummy[5]=1.;
5235  RcdME->setPartonWeights(fx_dummy, fx_dummy);
5236  RcdME->setMEArray(msq, true);
5237  RcdME->computeWeightedMEArray();
5238  }
5239 
5240  if (verbosity >= TVar::DEBUG) MELAout << "TUtil::JHUGenMatEl: Final MatElSq = " << MatElSq << endl;
5241 
5242  // Reset alphas
5243  if (verbosity>=TVar::DEBUG){
5244  MELAout
5245  << "TUtil::JHUGenMatEl: Reset AlphaS:\n"
5246  << "\tBefore reset, alphas scale: " << scale_.scale << ", PDF scale: " << facscale_.facscale << endl;
5247  }
5248  SetAlphaS(defaultRenScale, defaultFacScale, 1., 1., defaultNloop, defaultNflav, defaultPdflabel);
5249  if (verbosity>=TVar::DEBUG){
5250  GetAlphaS(&alphasVal, &alphasmzVal);
5251  MELAout
5252  << "TUtil::JHUGenMatEl: Reset AlphaS result:\n"
5253  << "\tAfter reset, alphas scale: " << scale_.scale << ", PDF scale: " << facscale_.facscale << ", alphas(Qren): " << alphasVal << ", alphas(MZ): " << alphasmzVal << endl;
5254  }
5255  return MatElSq;
5256 }

◆ MadgraphMatEl()

double TUtil::MadgraphMatEl ( const TVar::Process process,
const TVar::Production production,
const TVar::MatrixElement matrixElement,
TVar::event_scales_type event_scales,
MelaIO RcdME,
const double &  EBEAM,
TVar::VerbosityLevel  verbosity 
)

Definition at line 5258 of file TUtil.cc.

5263  {
5264  double MatElSq = 0;
5265  if (matrixElement!=TVar::MADGRAPH){ if (verbosity>=TVar::ERROR) MELAerr << "TUtil::MadgraphMatEl: Non-Madgraph MEs are not supported" << endl; return MatElSq; }
5266  simple_event_record mela_event;
5267  int partIncCode=TVar::kNoAssociated; // Do not use associated particles in the pT=0 frame boost
5268  mela_event.AssociationCode=partIncCode;
5270  RcdME->melaCand,
5271  mela_event,
5272  verbosity
5273  );
5274 
5275  const int nPDG = mela_event.pDaughters.size() + mela_event.pAssociated.size() + mela_event.pMothers.size();
5276  TLorentzVector MomStore[mxpart]; // Mom (in natural units) to compute alphaS
5277  for (int i = 0; i < mxpart; i++) MomStore[i].SetXYZT(0, 0, 0, 0);
5278 
5279  // vector<int> pdgs(nPDG);
5280  // vector<vector<double>> p(nPDG, vector<double>(4));
5281 
5282  int pdgs[nPDG];
5283  double* p = new double[4*nPDG];
5284 
5285  int i = 0;
5286  for (SimpleParticle_t particle : mela_event.pMothers){
5287  pdgs[i] = particle.first;
5288  p[i*4+0] = particle.second.E();
5289  p[i*4+1] = particle.second.Px();
5290  p[i*4+2] = particle.second.Py();
5291  p[i*4+3] = particle.second.Pz();
5292  MomStore[i] = particle.second;
5293  i++;
5294  }
5295 
5296  bool previously_swapped = false; //stupid madgraph and their ordered id code
5297  for (SimpleParticle_t particle : mela_event.pDaughters){
5298  bool swap_spaces = false;
5299  if((i == 2 || i == 4) && particle.first > 0){ //negatives go first
5300  i++;
5301  swap_spaces = true;
5302  if(verbosity >= TVar::DEBUG) MELAout << "Swapping daughters at index " << i << " and " << i-1 << endl;
5303  }
5304  pdgs[i] = particle.first;
5305  p[i*4+0] = particle.second.E();
5306  p[i*4+1] = particle.second.Px();
5307  p[i*4+2] = particle.second.Py();
5308  p[i*4+3] = particle.second.Pz();
5309  MomStore[i] = particle.second;
5310  if(previously_swapped){
5311  i += 2;
5312  previously_swapped = false;
5313  }
5314  else if(swap_spaces){
5315  i--;
5316  previously_swapped = true;
5317  } else{
5318  i++;
5319  }
5320  }
5321  if(abs(pdgs[2]) > abs(pdgs[4])){ // absolute values of id are sorted
5322  swap(pdgs[2], pdgs[4]);
5323  swap(pdgs[3], pdgs[5]);
5324  for(i=0; i<4; i++){
5325  swap(p[2*4+i], p[4*4+i]);
5326  swap(p[3*4+i], p[5*4+i]);
5327  }
5328  }
5329  // Set alphas
5330  double defaultRenScale = scale_.scale;
5331  double defaultFacScale = facscale_.facscale;
5332  int defaultNloop = nlooprun_.nlooprun;
5333  int defaultNflav = nflav_.nflav;
5334  string defaultPdflabel = pdlabel_.pdlabel;
5335  double renQ = InterpretScaleScheme(production, matrixElement, event_scales->renomalizationScheme, MomStore);
5336  double facQ = InterpretScaleScheme(production, matrixElement, event_scales->factorizationScheme, MomStore);
5337  SetAlphaS(renQ, facQ, event_scales->ren_scale_factor, event_scales->fac_scale_factor, 1, 5, "cteq6_l"); // Set AlphaS(|Q|/2, mynloop, mynflav, mypartonPDF)
5338  double alphasVal, alphasmzVal;
5339  GetAlphaS(&alphasVal, &alphasmzVal);
5340  RcdME->setRenormalizationScale(renQ);
5341  RcdME->setFactorizationScale(facQ);
5342  RcdME->setAlphaS(alphasVal);
5343  RcdME->setAlphaSatMZ(alphasmzVal);
5344  RcdME->setHiggsMassWidth(masses_mcfm_.hmass, masses_mcfm_.hwidth, 0);
5346  if (verbosity>=TVar::DEBUG){
5347  MELAout
5348  << "TUtil::MadgraphMatEl: Set AlphaS:\n"
5349  << "\tBefore set, alphas scale: " << defaultRenScale << ", PDF scale: " << defaultFacScale << '\n'
5350  << "\trenQ: " << renQ << " ( x " << event_scales->ren_scale_factor << "), facQ: " << facQ << " ( x " << event_scales->fac_scale_factor << ")\n"
5351  << "\tAfter set, alphas scale: " << scale_.scale << ", PDF scale: " << facscale_.facscale << ", alphas(Qren): " << alphasVal << ", alphas(MZ): " << alphasmzVal << endl;
5352  }
5353  int procid = -1; //always set to -1 just cause
5354  double scale2 = 1; //This is useless for calculations
5355  if (verbosity>=TVar::DEBUG_VERBOSE){
5356  // MELAout << "Input vectors to MADGRAPH function in order as id, px, py, pz, E:" << endl;
5357  // for(int i = 0; i < nPDG; i++){
5358  // MELAout << "id of " << pdgs[i] << " & vector of " << p[i][1] << ", " << p[i][2] << ", " << p[i][3] << ", " << p[i][0] << endl;
5359  // }
5360  MELAout << "Raw Input to FORTRAN:" << endl;
5361  for(int i = 0; i < nPDG; i++){
5362  for(int j = 0; j < 4; j++){
5363  MELAout << p[i*4+j] << " ";
5364  }
5365  MELAout << endl;
5366  }
5367  }
5368  madMela::update_all_coup(process, production);
5369  int nhel = -1;
5371  process, production,
5372  pdgs, procid, nPDG, p,
5373  alphasVal, scale2, nhel, MatElSq
5374  );
5375 
5376  if(verbosity >= TVar::DEBUG) MELAout << " smatrixhel returns prob of " << MatElSq << endl;
5377  delete p;
5378  p = nullptr;
5379  return MatElSq;
5380 }

◆ MCFM_chooser()

bool TUtil::MCFM_chooser ( const TVar::Process process,
const TVar::Production production,
const TVar::LeptonInterference leptonInterf,
const TVar::VerbosityLevel verbosity,
const TVar::simple_event_record mela_event 
)

Definition at line 1857 of file TUtil.cc.

1861  {
1862  bool result = true;
1863 
1864  unsigned int ndau = mela_event.pDaughters.size();
1865  int* pId = new int[ndau];
1866  for (unsigned int ip=0; ip<ndau; ip++){
1867  pId[ip]=mela_event.pDaughters.at(ip).first;
1868  }
1869  bool isWW = (ndau>=4 && PDGHelpers::isAWBoson(mela_event.intermediateVid.at(0)) && PDGHelpers::isAWBoson(mela_event.intermediateVid.at(1)));
1870  bool isZZ = (ndau>=4 && PDGHelpers::isAZBoson(mela_event.intermediateVid.at(0)) && PDGHelpers::isAZBoson(mela_event.intermediateVid.at(1)));
1871  bool hasZZ4fInterf = isZZ && abs(pId[0])==abs(pId[2]) && abs(pId[1])==abs(pId[3]) && !PDGHelpers::isAnUnknownJet(pId[0]) && !PDGHelpers::isAnUnknownJet(pId[3]);
1872  //bool isZJJ = false;
1873  //if (ndau>=4) isZJJ = (PDGHelpers::isAZBoson(mela_event.intermediateVid.at(0)) && PDGHelpers::isAJet(pId[2]) && PDGHelpers::isAJet(pId[3])); // Notice both isZZ and isZJJ could be true
1874  //bool isZG = (ndau>=3 && PDGHelpers::isAZBoson(mela_event.intermediateVid.at(0)) && PDGHelpers::isAPhoton(mela_event.intermediateVid.at(1)));
1875  bool isGG = (ndau>=2 && PDGHelpers::isAPhoton(mela_event.intermediateVid.at(0)) && PDGHelpers::isAPhoton(mela_event.intermediateVid.at(1)));
1876  if (verbosity>=TVar::DEBUG) MELAout << "TUtil::MCFM_chooser: isWW=" << (int)isWW << ", isZZ=" << (int)isZZ << ", hasZZ4fInterf=" << (int)hasZZ4fInterf << endl;
1877 
1878  npart_.npart=4; // Default number of particles is just 4, indicating no associated particles
1879  sprintf(runstring_.runstring, "test");
1880 
1881  if (
1882  ndau>=4
1883  &&
1884  (
1885  ((production == TVar::ZZQQB_STU || production == TVar::ZZQQB_S || production == TVar::ZZQQB_TU) && process == TVar::bkgZZ)
1886  ||
1887  ((production == TVar::ZZINDEPENDENT || production == TVar::ZZQQB) && process == TVar::bkgZZ)
1888  )
1889  ){
1890  //81 ' f(p1)+f(p2) --> Z^0(-->mu^-(p3)+mu^+(p4)) + Z^0(-->e^-(p5)+e^+(p6))'
1891  //86 ' f(p1)+f(p2) --> Z^0(-->e^-(p5)+e^+(p6))+Z^0(-->mu^-(p3)+mu^+(p4)) (NO GAMMA*)'
1892  //90 ' f(p1)+f(p2) --> Z^0(-->e^-(p3)+e^+(p4)) + Z^0(-->e^-(p5)+e^+(p6))' 'L'
1893 
1894  nqcdjets_.nqcdjets=0;
1895  srdiags_.srdiags=true;
1896  nwz_.nwz=0; ckmfill_(&(nwz_.nwz));
1897  bveg1_mcfm_.ndim=10;
1898  breit_.n2=1;
1899  breit_.n3=1;
1900  breit_.mass2=masses_mcfm_.zmass;
1901  breit_.width2=masses_mcfm_.zwidth;
1902  breit_.mass3=masses_mcfm_.zmass;
1903  breit_.width3=masses_mcfm_.zwidth;
1904 
1905  vsymfact_.vsymfact=1.0;
1906  interference_.interference=false;
1907  if (hasZZ4fInterf && (leptonInterf==TVar::DefaultLeptonInterf || leptonInterf==TVar::InterfOn)){
1908  //90 ' f(p1)+f(p2) --> Z^0(-->e^-(p3)+e^+(p4)) + Z^0(-->e^-(p5)+e^+(p6))' 'L'
1909  vsymfact_.vsymfact=0.5;
1910  interference_.interference=true;
1911  }
1912 
1913  if (verbosity>=TVar::DEBUG) MELAout << "TUtil::MCFM_chooser: Setup is (production, process)=(" << TVar::ProductionName(production) << ", " << TVar::ProcessName(process) << ")" << endl;
1914 
1915  }
1916  else if (
1917  ndau>=4
1918  &&
1919  ((production == TVar::ZZINDEPENDENT || production == TVar::ZZQQB) && process == TVar::bkgWW)
1920  ){
1921  // Processes 61 (4l), 62 (2l2q), 64 (2q2l)
1922 
1923  nqcdjets_.nqcdjets=0;
1924  nwz_.nwz=1; ckmfill_(&(nwz_.nwz));
1925  bveg1_mcfm_.ndim=10;
1926  breit_.n2=1;
1927  breit_.n3=1;
1928  breit_.mass2=masses_mcfm_.wmass;
1929  breit_.width2=masses_mcfm_.wwidth;
1930  breit_.mass3=masses_mcfm_.wmass;
1931  breit_.width3=masses_mcfm_.wwidth;
1932  srdiags_.srdiags=true;
1933 
1934  if (verbosity>=TVar::DEBUG) MELAout << "TUtil::MCFM_chooser: Setup is (production, process)=(" << TVar::ProductionName(production) << ", " << TVar::ProcessName(process) << ")" << endl;
1935 
1936  }
1937  else if (
1938  (ndau>=4 || ndau==2)
1939  &&
1940  production == TVar::JJQCD
1941  &&
1943  ){
1944  // -- 44 ' f(p1)+f(p2) --> Z^0(-->e^-(p3)+e^+(p4))+f(p5)+f(p6)'
1945  // these settings are identical to use the chooser_() function
1946 
1947  flags_.Gflag=true;
1948  flags_.Qflag=true;
1949  flags_.QandGflag=true; // This is in case NLO is implemented.
1950  bveg1_mcfm_.ndim=10;
1951  breit_.n2=0;
1952  breit_.n3=1;
1953  nqcdjets_.nqcdjets=2;
1954  nwz_.nwz=0; ckmfill_(&(nwz_.nwz));
1955  breit_.mass3=masses_mcfm_.zmass;
1956  breit_.width3=masses_mcfm_.zwidth;
1957 
1958  if (verbosity>=TVar::DEBUG) MELAout << "TUtil::MCFM_chooser: Setup is (production, process)=(" << TVar::ProductionName(production) << ", " << TVar::ProcessName(process) << ")" << endl;
1959 
1960  }
1961  else if (
1962  ndau==3
1963  &&
1964  (production == TVar::ZZQQB || production == TVar::ZZINDEPENDENT)
1965  &&
1967  ){
1968  // -- 300 ' f(p1)+f(p2) --> Z^0(-->e^-(p3)+e^+(p4))+gamma(p5)'
1969  // -- 305 ' f(p1)+f(p2) --> Z^0(-->3*(nu(p3)+nu~(p4)))-(sum over 3 nu)+gamma(p5)'
1970 
1971  nqcdjets_.nqcdjets=0;
1972  bveg1_mcfm_.ndim=7;
1973  breit_.n2=0;
1974  breit_.n3=1;
1975  breit_.mass3=masses_mcfm_.zmass;
1976  breit_.width3=masses_mcfm_.zwidth;
1977  //lastphot_.lastphot=5; // Done during particle label assignment
1978  nwz_.nwz=0; ckmfill_(&(nwz_.nwz));
1979 
1980  if (verbosity>=TVar::DEBUG) MELAout << "TUtil::MCFM_chooser: Setup is (production, process)=(" << TVar::ProductionName(production) << ", " << TVar::ProcessName(process) << ")" << endl;
1981 
1982  }
1983  else if (
1984  isGG
1985  &&
1986  (production == TVar::ZZQQB || production == TVar::ZZINDEPENDENT || production == TVar::ZZGG)
1987  &&
1989  ){
1990  // -- 285 ' f(p1)+f(p2) --> gamma(p3)+gamma(p4)'
1991 
1992  nqcdjets_.nqcdjets=0;
1993  bveg1_mcfm_.ndim=4;
1994  breit_.n3=0;
1995  lastphot_.lastphot=4;
1996  nwz_.nwz=0; ckmfill_(&(nwz_.nwz));
1997  if (production == TVar::ZZQQB || production == TVar::ZZINDEPENDENT) noglue_.omitgg=true;
1998  else noglue_.omitgg=false;
1999 
2000  if (verbosity>=TVar::DEBUG) MELAout << "TUtil::MCFM_chooser: Setup is (production, process)=(" << TVar::ProductionName(production) << ", " << TVar::ProcessName(process) << ")" << endl;
2001 
2002  }
2003  else if (
2004  ndau>=4
2005  &&
2006  production == TVar::ZZGG
2007  &&
2009  ){
2010  /*
2011  nprocs:
2012  c--- 128 ' f(p1)+f(p2) --> H(--> Z^0(e^-(p3)+e^+(p4)) + Z^0(mu^-(p5)+mu^+(p6)) [top, bottom loops, exact]' 'L'
2013  c--- 129 ' f(p1)+f(p2) --> H(--> Z^0(e^-(p3)+e^+(p4)) + Z^0(mu^-(p5)+mu^+(p6)) [only H, gg->ZZ intf.]' 'L' -> NOT IMPLEMENTED
2014  c--- 130 ' f(p1)+f(p2) --> H(--> Z^0(e^-(p3)+e^+(p4)) + Z^0(mu^-(p5)+mu^+(p6)) [H squared and H, gg->ZZ intf.]' 'L'
2015  c--- 131 ' f(p1)+f(p2) --> Z^0(e^-(p3)+e^+(p4)) + Z^0(mu^-(p5)+mu^+(p6) [gg only, (H + gg->ZZ) squared]' 'L'
2016  c--- 132 ' f(p1)+f(p2) --> Z^0(e^-(p3)+e^+(p4)) + Z^0(mu^-(p5)+mu^+(p6) [(gg->ZZ) squared]' 'L'
2017  */
2018 
2019  nqcdjets_.nqcdjets=0;
2020  nwz_.nwz=0; ckmfill_(&(nwz_.nwz));
2021  bveg1_mcfm_.ndim=10;
2022  breit_.n2=1;
2023  breit_.n3=1;
2024  breit_.mass2 =masses_mcfm_.zmass;
2025  breit_.width2=masses_mcfm_.zwidth;
2026  breit_.mass3 =masses_mcfm_.zmass;
2027  breit_.width3=masses_mcfm_.zwidth;
2028 
2029  vsymfact_.vsymfact=1.0;
2030  interference_.interference=false;
2031  if (hasZZ4fInterf && (leptonInterf==TVar::DefaultLeptonInterf || leptonInterf==TVar::InterfOn)){
2032  vsymfact_.vsymfact=0.5;
2033  interference_.interference=true;
2034  }
2035 
2036  if (verbosity>=TVar::DEBUG) MELAout << "TUtil::MCFM_chooser: Setup is (production, process)=(" << TVar::ProductionName(production) << ", " << TVar::ProcessName(process) << ")" << endl;
2037 
2038  }
2039  else if (
2040  ndau>=4
2041  &&
2042  production == TVar::ZZGG
2043  &&
2044  (
2045  (
2047  )
2048  ||
2049  (
2050  ((isWW || isZZ) && (process == TVar::bkgWWZZ || process == TVar::HSMHiggs_WWZZ || process == TVar::bkgWWZZ_SMHiggs))
2051  )
2052  )
2053  ){ // gg->VV
2054  // Processes 1281, 1311, 1321
2055 
2056  nwz_.nwz=0; ckmfill_(&(nwz_.nwz));
2057  nqcdjets_.nqcdjets=0;
2058  bveg1_mcfm_.ndim=10;
2059  breit_.n2=1;
2060  breit_.n3=1;
2061  nuflav_.nuflav=1; // Keep this at 1. Mela controls how many flavors in a more exact way.
2062 
2063  if (verbosity>=TVar::DEBUG) MELAout << "TUtil::MCFM_chooser: Setup is (production, process)=(" << TVar::ProductionName(production) << ", " << TVar::ProcessName(process) << ")" << endl;
2064 
2065  }
2066  // JJ + ZZ->4f
2067  else if ( // Check for support in qq'H+2J
2068  ndau>=4
2069  &&
2070  (
2071  production == TVar::Had_WH || production == TVar::Had_ZH
2072  || production == TVar::Had_WH_S || production == TVar::Had_ZH_S
2073  || production == TVar::Had_WH_TU || production == TVar::Had_ZH_TU
2074  || production == TVar::Lep_WH || production == TVar::Lep_ZH
2075  || production == TVar::Lep_WH_S || production == TVar::Lep_ZH_S
2076  || production == TVar::Lep_WH_TU || production == TVar::Lep_ZH_TU
2077  || production == TVar::JJVBF || production == TVar::JJEW
2078  || production == TVar::JJVBF_S || production == TVar::JJEW_S
2079  || production == TVar::JJVBF_TU || production == TVar::JJEW_TU
2080  )
2081  &&
2083  ){
2084  // 220 ' f(p1)+f(p2) --> Z(e-(p3),e^+(p4))Z(mu-(p5),mu+(p6)))+f(p7)+f(p8) [weak]' 'L'
2085 
2086  if (process == TVar::bkgZZ) sprintf(runstring_.runstring, "wbfBO");
2087  else if (process == TVar::HSMHiggs) sprintf(runstring_.runstring, "wbfHO");
2088 
2089  npart_.npart=6;
2090  nwz_.nwz=2; ckmfill_(&(nwz_.nwz));
2091  bveg1_mcfm_.ndim=16;
2092  nqcdjets_.nqcdjets=2;
2093  breit_.n2=1;
2094  breit_.n3=1;
2095  breit_.mass2 =masses_mcfm_.zmass;
2096  breit_.width2=masses_mcfm_.zwidth;
2097  breit_.mass3 =masses_mcfm_.zmass;
2098  breit_.width3=masses_mcfm_.zwidth;
2099 
2100  vsymfact_.vsymfact=1.0;
2101  interference_.interference=false;
2102  if (hasZZ4fInterf && (leptonInterf==TVar::DefaultLeptonInterf || leptonInterf==TVar::InterfOn)){
2103  vsymfact_.vsymfact=0.5;
2104  interference_.interference=true;
2105  }
2106 
2107  if (verbosity>=TVar::DEBUG) MELAout << "TUtil::MCFM_chooser: Setup is (production, process)=(" << TVar::ProductionName(production) << ", " << TVar::ProcessName(process) << ")" << endl;
2108 
2109  }
2110  // JJ + WW->4f
2111  else if ( // Check for support in qq'H+2J
2112  ndau>=4
2113  &&
2114  (
2115  production == TVar::Had_WH || production == TVar::Had_ZH
2116  || production == TVar::Had_WH_S || production == TVar::Had_ZH_S
2117  || production == TVar::Had_WH_TU || production == TVar::Had_ZH_TU
2118  || production == TVar::Lep_WH || production == TVar::Lep_ZH
2119  || production == TVar::Lep_WH_S || production == TVar::Lep_ZH_S
2120  || production == TVar::Lep_WH_TU || production == TVar::Lep_ZH_TU
2121  || production == TVar::JJVBF || production == TVar::JJEW
2122  || production == TVar::JJVBF_S || production == TVar::JJEW_S
2123  || production == TVar::JJVBF_TU || production == TVar::JJEW_TU
2124  )
2125  &&
2127  ){
2128  // Process 224
2129 
2130  if (process == TVar::bkgWW) sprintf(runstring_.runstring, "wbfBO");
2131  else if (process == TVar::HSMHiggs) sprintf(runstring_.runstring, "wbfHO");
2132 
2133  npart_.npart=6;
2134  nwz_.nwz=2; ckmfill_(&(nwz_.nwz));
2135  bveg1_mcfm_.ndim=16;
2136  nqcdjets_.nqcdjets=2;
2137  breit_.n2=1;
2138  breit_.n3=1;
2139  breit_.mass2 =masses_mcfm_.wmass;
2140  breit_.width2=masses_mcfm_.wwidth;
2141  breit_.mass3 =masses_mcfm_.wmass;
2142  breit_.width3=masses_mcfm_.wwidth;
2143 
2144  if (verbosity>=TVar::DEBUG) MELAout << "TUtil::MCFM_chooser: Setup is (production, process)=(" << TVar::ProductionName(production) << ", " << TVar::ProcessName(process) << ")" << endl;
2145 
2146  }
2147  // JJ + VV->4f
2148  else if ( // Check for support in qq'H+2J
2149  ndau>=4
2150  &&
2151  (
2152  production == TVar::Had_WH || production == TVar::Had_ZH
2153  || production == TVar::Had_WH_S || production == TVar::Had_ZH_S
2154  || production == TVar::Had_WH_TU || production == TVar::Had_ZH_TU
2155  || production == TVar::Lep_WH || production == TVar::Lep_ZH
2156  || production == TVar::Lep_WH_S || production == TVar::Lep_ZH_S
2157  || production == TVar::Lep_WH_TU || production == TVar::Lep_ZH_TU
2158  || production == TVar::JJVBF || production == TVar::JJEW
2159  || production == TVar::JJVBF_S || production == TVar::JJEW_S
2160  || production == TVar::JJVBF_TU || production == TVar::JJEW_TU
2161  )
2162  &&
2163  ((isZZ || isWW) && (process == TVar::bkgWWZZ || process == TVar::HSMHiggs_WWZZ || process == TVar::bkgWWZZ_SMHiggs))
2164  ){
2165  // Procsss 226
2166 
2167  if (process == TVar::bkgWWZZ) sprintf(runstring_.runstring, "wbfBO");
2168  else if (process == TVar::HSMHiggs_WWZZ) sprintf(runstring_.runstring, "wbfHO");
2169 
2170  npart_.npart=6;
2171  nwz_.nwz=2; ckmfill_(&(nwz_.nwz));
2172  bveg1_mcfm_.ndim=16;
2173  nqcdjets_.nqcdjets=2;
2174  breit_.n2=1;
2175  breit_.n3=1;
2176  breit_.mass2 =masses_mcfm_.wmass;
2177  breit_.width2=masses_mcfm_.wwidth;
2178  breit_.mass3 =masses_mcfm_.wmass;
2179  breit_.width3=masses_mcfm_.wwidth;
2180 
2181  if (verbosity>=TVar::DEBUG) MELAout << "TUtil::MCFM_chooser: Setup is (production, process)=(" << TVar::ProductionName(production) << ", " << TVar::ProcessName(process) << ")" << endl;
2182 
2183  }
2184  // JJ + ZZ->4f (QCD)
2185  else if (
2186  ndau>=4
2187  &&
2188  (
2189  production == TVar::JJQCD/* || production == TVar::JJQCD_S || production == TVar::JJQCD_TU*/
2190  || production == TVar::JJEWQCD || production == TVar::JJEWQCD_S || production == TVar::JJEWQCD_TU
2191  )
2192  &&
2193  (isZZ && process == TVar::bkgZZ) // ME is bkg-only
2194  ){
2195  // 2201 ' f(p1)+f(p2) --> Z(e-(p3),e^+(p4))Z(mu-(p5),mu+(p6)))+f(p7)+f(p8) [strong]' 'L'
2196  /*
2197  NOTE TO DEVELOPER
2198  MCFM also sets common/VVstrong/VVstrong (logical) here, but it only controls which ww_ZZqq function is called.
2199  It is irrelevant as long as eventgeneration through lowint is not used directly through MELA.
2200  */
2201  npart_.npart=6;
2202  nwz_.nwz=2; ckmfill_(&(nwz_.nwz));
2203  bveg1_mcfm_.ndim=16;
2204  nqcdjets_.nqcdjets=2;
2205  breit_.n2=1;
2206  breit_.n3=1;
2207  breit_.mass2 =masses_mcfm_.zmass;
2208  breit_.width2=masses_mcfm_.zwidth;
2209  breit_.mass3 =masses_mcfm_.zmass;
2210  breit_.width3=masses_mcfm_.zwidth;
2211 
2212  vsymfact_.vsymfact=1.0;
2213  interference_.interference=false;
2214  if (hasZZ4fInterf && (leptonInterf==TVar::DefaultLeptonInterf || leptonInterf==TVar::InterfOn)){
2215  vsymfact_.vsymfact=0.5;
2216  interference_.interference=true;
2217  }
2218 
2219  if (verbosity>=TVar::DEBUG) MELAout << "TUtil::MCFM_chooser: Setup is (production, process)=(" << TVar::ProductionName(production) << ", " << TVar::ProcessName(process) << ")" << endl;
2220 
2221  }
2222  // JJ + WW->4f (QCD)
2223  else if (
2224  ndau>=4
2225  &&
2226  (
2227  production == TVar::JJQCD/* || production == TVar::JJQCD_S || production == TVar::JJQCD_TU*/
2228  || production == TVar::JJEWQCD || production == TVar::JJEWQCD_S || production == TVar::JJEWQCD_TU
2229  )
2230  &&
2231  (isWW && process == TVar::bkgWW) // ME is bkg-only
2232  ){
2233  // Process 2241
2234  /*
2235  NOTE TO DEVELOPER
2236  MCFM also sets common/VVstrong/VVstrong (logical) here, but it only controls which ww_ZZqq function is called.
2237  It is irrelevant as long as eventgeneration through lowint is not used directly through MELA.
2238  */
2239  npart_.npart=6;
2240  nwz_.nwz=2; ckmfill_(&(nwz_.nwz));
2241  bveg1_mcfm_.ndim=16;
2242  nqcdjets_.nqcdjets=2;
2243  breit_.n2=1;
2244  breit_.n3=1;
2245  breit_.mass2 =masses_mcfm_.wmass;
2246  breit_.width2=masses_mcfm_.wwidth;
2247  breit_.mass3 =masses_mcfm_.wmass;
2248  breit_.width3=masses_mcfm_.wwidth;
2249 
2250  if (verbosity>=TVar::DEBUG) MELAout << "TUtil::MCFM_chooser: Setup is (production, process)=(" << TVar::ProductionName(production) << ", " << TVar::ProcessName(process) << ")" << endl;
2251 
2252  }
2253  // JJ + VV->4f (QCD)
2254  else if (
2255  ndau>=4
2256  &&
2257  (
2258  production == TVar::JJQCD/* || production == TVar::JJQCD_S || production == TVar::JJQCD_TU*/
2259  || production == TVar::JJEWQCD || production == TVar::JJEWQCD_S || production == TVar::JJEWQCD_TU
2260  )
2261  &&
2262  ((isZZ || isWW) && process == TVar::bkgWWZZ)
2263  ){
2264  // Procsss 2261 (not supported yet)
2265  MELAerr << "TUtil::MCFM_chooser: MCFM does not support QCD JJ+VV->4f interaction yet. Please contact the MELA authors if you need more information." << endl;
2266  result = false;
2267 
2268  }
2269  else{
2270  MELAerr << "TUtil::MCFM_chooser: Can't identify (process, production) = (" << process << ", " << production << ")" << endl;
2271  MELAerr << "TUtil::MCFM_chooser: ndau: " << ndau << '\t';
2272  MELAerr << "TUtil::MCFM_chooser: isZZ: " << isZZ << '\t';
2273  MELAerr << "TUtil::MCFM_chooser: isWW: " << isWW << '\t';
2274  MELAerr << "TUtil::MCFM_chooser: isGG: " << isGG << '\t';
2275  MELAerr << endl;
2276  result = false;
2277  }
2278 
2279  delete[] pId;
2280  return result;
2281 }

◆ MCFM_masscuts()

bool TUtil::MCFM_masscuts ( double  s[][mxpart],
const TVar::Process process 
)

Definition at line 3344 of file TUtil.cc.

3344  {
3345  double minZmassSqr=10*10;
3346  if (
3347  process == TVar::bkgZZ
3348  &&
3349  (s[2][3]<minZmassSqr || s[4][5]<minZmassSqr)
3350  ) return true;
3351  return false;
3352 }

◆ MCFM_SetupParticleCouplings()

bool TUtil::MCFM_SetupParticleCouplings ( const TVar::Process process,
const TVar::Production production,
const TVar::VerbosityLevel verbosity,
const TVar::simple_event_record mela_event,
std::vector< int > *  partOrder,
std::vector< int > *  apartOrder 
)

Definition at line 2282 of file TUtil.cc.

2287  {
2288  bool result=true;
2289 
2290  // Initialize Z couplings
2291  zcouple_.q1=0;
2292  zcouple_.l1=0;
2293  zcouple_.r1=0;
2294  zcouple_.q2=0;
2295  zcouple_.l2=0;
2296  zcouple_.r2=0;
2297 
2298  // Initialize plabels
2299  TString strplabel[mxpart];
2300  for (int ip=0; ip<mxpart; ip++) strplabel[ip]=" ";
2301 
2302  // Channel checks
2303  unsigned int ndau = mela_event.pDaughters.size();
2304  if (ndau<1) return false;
2305  unsigned int napart = mela_event.pAssociated.size();
2306  bool isWW = (ndau>=4 && PDGHelpers::isAWBoson(mela_event.intermediateVid.at(0)) && PDGHelpers::isAWBoson(mela_event.intermediateVid.at(1)));
2307  bool isZZ = (ndau>=4 && PDGHelpers::isAZBoson(mela_event.intermediateVid.at(0)) && PDGHelpers::isAZBoson(mela_event.intermediateVid.at(1)));
2308  //bool hasZZ4fInterf = isZZ && abs(pId[0])==abs(pId[2]) && abs(pId[1])==abs(pId[3]) && !PDGHelpers::isAnUnknownJet(pId[0]) && !PDGHelpers::isAnUnknownJet(pId[3]);
2309  bool isZJJ = false;
2310  if (ndau>=4) isZJJ = PDGHelpers::isAZBoson(mela_event.intermediateVid.at(0)); // No check on whether daughters 2 and 3 are jets. Notice both isZZ and isZJJ could be true
2311  else if (ndau==2 && process == TVar::bkgZJets){ // Check whether the two daughters can create a Z
2312  isZJJ = (
2314  ||
2315  ((PDGHelpers::isAnUnknownJet(mela_event.intermediateVid.at(0)) || PDGHelpers::isAQuark(mela_event.intermediateVid.at(0))) && (PDGHelpers::isAnUnknownJet(mela_event.intermediateVid.at(1)) || PDGHelpers::isAQuark(mela_event.intermediateVid.at(1))))
2316  );
2317  }
2318  bool isZG = (ndau>=3 && PDGHelpers::isAZBoson(mela_event.intermediateVid.at(0)) && PDGHelpers::isAPhoton(mela_event.intermediateVid.at(1)));
2319  bool isGG = (ndau>=2 && PDGHelpers::isAPhoton(mela_event.intermediateVid.at(0)) && PDGHelpers::isAPhoton(mela_event.intermediateVid.at(1)));
2320  bool hasZ1 = (isZZ || isZG || isZJJ);
2321  bool hasZ2 = isZZ;
2322  bool hasW1 = isWW;
2323  bool hasW2 = isWW;
2324  if (verbosity>=TVar::DEBUG){
2325  MELAout << "TUtil::MCFM_SetupParticleCouplings(" << TVar::ProductionName(production) << ", " << TVar::ProcessName(process) << "):\nInitial configuration ";
2326  vector<TString> strcfgs;
2327  if (isGG) strcfgs.push_back(TString("GG"));
2328  if (isZG) strcfgs.push_back(TString("ZG"));
2329  if (isZZ) strcfgs.push_back(TString("ZZ"));
2330  if (isZJJ) strcfgs.push_back(TString("ZJJ"));
2331  if (isWW) strcfgs.push_back(TString("WW"));
2332  if (!strcfgs.empty()){
2333  MELAout << "is ";
2334  for (unsigned int istr=0; istr<strcfgs.size(); istr++){
2335  if (istr==0) MELAout << strcfgs.at(istr);
2336  else MELAout << ", " << strcfgs.at(istr);
2337  }
2338  MELAout << ".";
2339  }
2340  else MELAout << "has no valid decay!";
2341  MELAout << endl;
2342  }
2343 
2344  // Setup the ordering arrays
2345  int* pApartOrder = 0;
2346  int* pApartId = 0;
2347  if (napart>0){
2348  pApartOrder = new int[napart];
2349  pApartId = new int[napart];
2350  for (unsigned int ip=0; ip<napart; ip++){
2351  pApartOrder[ip]=ip; // This order USUALLY does not change!
2352  pApartId[ip]=mela_event.pAssociated.at(ip).first; // This order does not change.
2353  }
2354  }
2355  int* pOrder = new int[ndau];
2356  int* pZOrder = new int[ndau];
2357  int* pWOrder = new int[ndau];
2358  int* pId = new int[ndau];
2359  for (unsigned int ip=0; ip<ndau; ip++){
2360  pOrder[ip]=ip; // This order does not change
2361  pZOrder[ip]=ip;
2362  pWOrder[ip]=ip;
2363  pId[ip]=mela_event.pDaughters.at(ip).first; // This order does not change.
2364  }
2365 
2366  // Special case checks
2367  bool useQQBZGAM = (isZG && process == TVar::bkgZGamma && (production == TVar::ZZQQB || production == TVar::ZZINDEPENDENT));
2368  bool useQQVVQQ =
2369  (
2372  || ((isZZ || isWW) && (process == TVar::bkgWWZZ || process == TVar::HSMHiggs_WWZZ || process == TVar::bkgWWZZ_SMHiggs)))
2373  &&
2374  (production == TVar::Had_WH || production == TVar::Had_ZH
2375  || production == TVar::Had_WH_S || production == TVar::Had_ZH_S
2376  || production == TVar::Had_WH_TU || production == TVar::Had_ZH_TU
2377  || production == TVar::Lep_WH || production == TVar::Lep_ZH
2378  || production == TVar::Lep_WH_S || production == TVar::Lep_ZH_S
2379  || production == TVar::Lep_WH_TU || production == TVar::Lep_ZH_TU
2380  || production == TVar::JJVBF || production == TVar::JJEW
2381  || production == TVar::JJVBF_S || production == TVar::JJEW_S
2382  || production == TVar::JJVBF_TU || production == TVar::JJEW_TU)
2383  );
2384  bool useQQVVQQstrong =
2385  (
2386  ((isZZ && process == TVar::bkgZZ) || (isWW && process == TVar::bkgWW) || ((isZZ || isWW) && process == TVar::bkgWWZZ))
2387  &&
2388  (production == TVar::JJQCD || production == TVar::JJQCD_S || production == TVar::JJQCD_TU)
2389  );
2390  bool useQQVVQQboth =
2391  (
2392  ((isZZ && process == TVar::bkgZZ) || (isWW && process == TVar::bkgWW) || ((isZZ || isWW) && process == TVar::bkgWWZZ))
2393  &&
2394  (production == TVar::JJEWQCD || production == TVar::JJEWQCD_S || production == TVar::JJEWQCD_TU)
2395  );
2396  bool useQQVVQQany = useQQVVQQ || useQQVVQQstrong || useQQVVQQboth;
2397 
2398  /**************************/
2399  /* Begin the setup checks */
2400  /**************************/
2401  // Check first if the decay mode is valid and the number of associated particles is consistent with the requested number
2402  if (
2403  !(isWW || isZZ || isZJJ || isZG || isGG) // Only ZZ, WW, ZG or GG supported in MCFM
2404  ||
2405  ((int)napart<(mela_event.nRequested_AssociatedJets+mela_event.nRequested_AssociatedLeptons)) // Associated particle not found
2406  ) result=false;
2407  else{
2408 
2409  if (isWW && !hasZ1 && !hasZ2){
2410  // Default swap is 3-5
2411  // For ggVV amplitudes, MCFM generates W+W- and does 3-5 swap inside the ME, so by definition, this is ok.
2412  // For VBFWW amplitudes, MCFM generates W-W+ in the phase space and does a 4-6 swap before passing to the ME. The ordering here is W+W-, so this is equivalent to doing a 3-5 swap to get the corresponding ZZ-like combinations.
2413  swap(pZOrder[0], pZOrder[2]);
2414 
2415  int V1id, V2id;
2416  if (!PDGHelpers::isAnUnknownJet(pId[pZOrder[0]]) && !PDGHelpers::isAnUnknownJet(pId[pZOrder[1]])) V1id = PDGHelpers::getCoupledVertex(pId[pZOrder[0]], pId[pZOrder[1]]);
2417  else V1id = 23;
2418  if (!PDGHelpers::isAnUnknownJet(pId[pZOrder[2]]) && !PDGHelpers::isAnUnknownJet(pId[pZOrder[3]])) V2id = PDGHelpers::getCoupledVertex(pId[pZOrder[2]], pId[pZOrder[3]]);
2419  else V2id = 23;
2420  hasZ1=hasZ1 || PDGHelpers::isAZBoson(V1id);
2421  hasZ2=hasZ2 || PDGHelpers::isAZBoson(V2id);
2422  if (!hasZ1 && hasZ2){
2423  swap(pZOrder[0], pZOrder[2]);
2424  swap(pZOrder[1], pZOrder[3]);
2425  swap(hasZ1, hasZ2);
2426  }
2427  if (verbosity>=TVar::DEBUG){
2428  if (hasZ1) MELAout << "TUtil::MCFM_SetupParticleCouplings: Found a Z1";
2429  if (hasZ2) MELAout << " and a Z2";
2430  if (hasZ1 || hasZ2) MELAout << " in WW." << endl;
2431  }
2432  }
2433  if (isZZ && !hasW1 && !hasW2){
2434  swap(pWOrder[0], pWOrder[2]);
2435 
2436  int V1id, V2id;
2437  if (!PDGHelpers::isAnUnknownJet(pId[pWOrder[0]]) && !PDGHelpers::isAnUnknownJet(pId[pWOrder[1]])) V1id = PDGHelpers::getCoupledVertex(pId[pWOrder[0]], pId[pWOrder[1]]);
2438  else V1id = 24;
2439  if (!PDGHelpers::isAnUnknownJet(pId[pWOrder[2]]) && !PDGHelpers::isAnUnknownJet(pId[pWOrder[3]])) V2id = PDGHelpers::getCoupledVertex(pId[pWOrder[2]], pId[pWOrder[3]]);
2440  else V2id = -24;
2441  if (PDGHelpers::isAWBoson(V1id) && PDGHelpers::isAWBoson(V2id)){
2442  if (V1id<0 || V2id>0){
2443  swap(pWOrder[0], pWOrder[2]);
2444  swap(pWOrder[1], pWOrder[3]);
2445  }
2446  hasW1=true;
2447  hasW2=true;
2448  }
2449  if (verbosity>=TVar::DEBUG){
2450  if (hasW1) MELAout << "TUtil::MCFM_SetupParticleCouplings: Found a W1(" << V1id << ")";
2451  if (hasW2) MELAout << " and a W2(" << V2id << ")";
2452  if (hasW1 || hasW2) MELAout << " in ZZ." << endl;
2453  }
2454  }
2455 
2456  /*******************/
2457  /* Particle labels */
2458  /*******************/
2459  // Mother particles
2460  // Default labels for most processes
2461  strplabel[0]="pp";
2462  strplabel[1]="pp";
2463  if (useQQVVQQany){ // Special case if using qqZZ/VVqq*
2464  if (verbosity>=TVar::DEBUG) MELAout << "TUtil::MCFM_SetupParticleCouplings: Setting up mother labels for MCFM:";
2465  for (int ip=0; ip<min(2, (int)mela_event.pMothers.size()); ip++){
2466  const int& idmot = mela_event.pMothers.at(ip).first;
2467  if (!PDGHelpers::isAnUnknownJet(idmot)) strplabel[ip]=TUtil::GetMCFMParticleLabel(idmot, false, useQQVVQQany);
2468  if (verbosity>=TVar::DEBUG) MELAout << " " << idmot << "=" << strplabel[ip];
2469  // No need to check unknown parton case, already "pp"
2470  }
2471  if (verbosity>=TVar::DEBUG) MELAout << endl;
2472  }
2473 
2474  // Decay and associated particles
2475  // 0-jet processes, set only decay labels (and plabel[5/6]=pp due to NLO stuff)
2476  if (isZJJ && production == TVar::JJQCD && process == TVar::bkgZJets){
2477  strplabel[2]="el";
2478  strplabel[3]="ea";
2479  strplabel[4]="pp";
2480  strplabel[5]="pp";
2481  strplabel[6]="pp";
2482  }
2483  else if (production == TVar::ZZGG && (
2485  ||
2486  ((isWW || isZZ) && (process == TVar::bkgWWZZ || process == TVar::HSMHiggs_WWZZ || process == TVar::bkgWWZZ_SMHiggs))
2487  )
2488  ){
2489  strplabel[2]="el";
2490  strplabel[3]="ea";
2491  strplabel[4]="nl";
2492  strplabel[5]="na";
2493  strplabel[6]="pp";
2494 
2495  string strrun = runstring_.runstring;
2496  if (isWW && ((!hasZ1 || !hasZ2) || (process == TVar::bkgWW || process == TVar::HSMHiggs || process == TVar::bkgWW_SMHiggs))) strrun += "_ww";
2497  else if (isZZ && (!hasW1 || !hasW2)) strrun += "_zz";
2498  sprintf(runstring_.runstring, strrun.c_str());
2499  }
2500  else if (isZG && (production == TVar::ZZQQB || production == TVar::ZZINDEPENDENT) && process == TVar::bkgZGamma){
2501  lastphot_.lastphot=5;
2502  strplabel[4]="ga";
2503  strplabel[5]="pp";
2504  }
2505  else if (isGG && (production == TVar::ZZGG || production == TVar::ZZQQB || production == TVar::ZZINDEPENDENT) && process == TVar::bkgGammaGamma){
2506  //lastphot_.lastphot=4; // Done in chooser
2507  strplabel[2]="ga";
2508  strplabel[3]="ga";
2509  strplabel[4]="pp";
2510  }
2511  else if (isWW && (production == TVar::ZZINDEPENDENT || production == TVar::ZZQQB) && process == TVar::bkgWW){
2512  strplabel[6]="pp";
2513  zcouple_.l1=1.;
2514 
2515  if (PDGHelpers::isANeutrino(pId[pWOrder[0]])){
2516  strplabel[2]="nl";
2517  strplabel[3]="ea";
2518  }
2519  else if (PDGHelpers::isAJet(pId[pWOrder[1]])){
2520  strplabel[2]="qj";
2521  strplabel[3]="qj";
2522  zcouple_.l1 *= sqrt(6.);
2523  nqcdjets_.nqcdjets += 2;
2524  }
2525  else result = false;
2526 
2527  if (PDGHelpers::isANeutrino(pId[pWOrder[3]])){
2528  strplabel[4]="el";
2529  strplabel[5]="na";
2530  }
2531  else if (PDGHelpers::isAJet(pId[pWOrder[3]])){
2532  strplabel[4]="qj";
2533  strplabel[5]="qj";
2534  zcouple_.l1 *= sqrt(6.);
2535  nqcdjets_.nqcdjets += 2;
2536  }
2537  else result = false;
2538  if (PDGHelpers::isAJet(pId[pWOrder[0]]) && PDGHelpers::isAJet(pId[pWOrder[3]])) result = false; // MCFM does not support WW->4q
2539  }
2540  // 2-jet processes
2541  // Most of the associated particle labels are set below
2542  // VH productions loop over all possible associated particles to assign V daughters as the first two particles in particle-antiparticle order
2543  else if ((isWW || isZZ) && napart>=2 && (production == TVar::Lep_ZH || production == TVar::Lep_ZH_S || production == TVar::Lep_ZH_TU)){
2544  spinzerohiggs_anomcoupl_.channeltoggle_stu = int(production == TVar::Lep_ZH)*2 + int(production == TVar::Lep_ZH_TU)*1 + int(production == TVar::Lep_ZH_S)*0;
2545  spinzerohiggs_anomcoupl_.vvhvvtoggle_vbfvh = 1;
2546 
2548  string strrun = runstring_.runstring;
2549  if (isWW && (!hasZ1 || !hasZ2)) strrun += "_ww";
2550  else if (isZZ && (!hasW1 || !hasW2)) strrun += "_zz";
2551  sprintf(runstring_.runstring, strrun.c_str());
2552  }
2553 
2554  bool hasZll=false;
2555  bool hasZnn=false;
2556  for (unsigned int ix=0; ix<napart; ix++){
2557  if (PDGHelpers::isAJet(pApartId[ix])) continue;
2558  for (unsigned int iy=ix+1; iy<napart; iy++){
2559  if (PDGHelpers::isAJet(pApartId[iy])) continue;
2560  int Vid = PDGHelpers::getCoupledVertex(pApartId[ix], pApartId[iy]);
2561  if (PDGHelpers::isAZBoson(Vid) && PDGHelpers::isALepton(pApartId[ix])){
2562  int i1=ix; int i2=iy;
2563  if (pApartId[ix]<0){ swap(i1, i2); }
2564  int* tmpOrder = new int[napart];
2565  tmpOrder[0] = i1; tmpOrder[1] = i2;
2566  unsigned int ctr=2;
2567  for (unsigned int ipart=0; ipart<napart; ipart++){ if (ctr<napart && pApartOrder[ipart]!=i1 && pApartOrder[ipart]!=i2){ tmpOrder[ctr] = pApartOrder[ipart]; ctr++; } }
2568  delete[] pApartOrder; pApartOrder = tmpOrder;
2569  hasZll=true;
2570  break;
2571  }
2572  else if (PDGHelpers::isAZBoson(Vid) && PDGHelpers::isANeutrino(pApartId[ix])){
2573  int i1=ix; int i2=iy;
2574  if (pApartId[ix]<0){ swap(i1, i2); }
2575  int* tmpOrder = new int[napart];
2576  tmpOrder[0] = i1; tmpOrder[1] = i2;
2577  unsigned int ctr=2;
2578  for (unsigned int ipart=0; ipart<napart; ipart++){ if (ctr<napart && pApartOrder[ipart]!=i1 && pApartOrder[ipart]!=i2){ tmpOrder[ctr] = pApartOrder[ipart]; ctr++; } }
2579  delete[] pApartOrder; pApartOrder = tmpOrder;
2580  hasZnn=true;
2581  break;
2582  }
2583  if (hasZll || hasZnn) break;
2584  }
2585  }
2586  unsigned int iout=6;
2587  unsigned int jout=7;
2588  if (useQQVVQQany){
2589  int qqvvqq_apartordering[2]={ -1, -1 };
2591  mela_event.pMothers.at(0).first, mela_event.pMothers.at(1).first,
2592  pApartId[pApartOrder[0]], pApartId[pApartOrder[1]],
2593  qqvvqq_apartordering
2594  );
2595  if (qqvvqq_apartordering[0]==-1 || qqvvqq_apartordering[1]==-1) result=false;
2596  else if (qqvvqq_apartordering[0]>qqvvqq_apartordering[1]){
2597  swap(iout, jout);
2598  swap(pApartOrder[0], pApartOrder[1]);
2599  }
2600  }
2601  if (hasZll){
2602  strplabel[iout]="el";
2603  strplabel[jout]="ea";
2604  }
2605  else if (hasZnn){
2606  strplabel[iout]="nl";
2607  strplabel[jout]="na";
2608  }
2609  else result = false;
2610  }
2611  else if ((isWW || isZZ) && napart>=2 && (production == TVar::Lep_WH || production == TVar::Lep_WH_S || production == TVar::Lep_WH_TU)){
2612  spinzerohiggs_anomcoupl_.channeltoggle_stu = int(production == TVar::Lep_WH)*2 + int(production == TVar::Lep_WH_TU)*1 + int(production == TVar::Lep_WH_S)*0;
2613  spinzerohiggs_anomcoupl_.vvhvvtoggle_vbfvh = 1;
2614 
2616  string strrun = runstring_.runstring;
2617  if (isWW && (!hasZ1 || !hasZ2)) strrun += "_ww";
2618  else if (isZZ && (!hasW1 || !hasW2)) strrun += "_zz";
2619  sprintf(runstring_.runstring, strrun.c_str());
2620  }
2621 
2622  bool hasWplus=false;
2623  bool hasWminus=false;
2624  for (unsigned int ix=0; ix<napart; ix++){
2625  if (PDGHelpers::isAJet(pApartId[ix])) continue;
2626  for (unsigned int iy=ix+1; iy<napart; iy++){
2627  if (PDGHelpers::isAJet(pApartId[iy])) continue;
2628  int Vid = PDGHelpers::getCoupledVertex(pApartId[ix], pApartId[iy]);
2629  if (
2631  &&
2632  (
2633  (PDGHelpers::isALepton(pApartId[ix]) && pApartId[ix]<0)
2634  ||
2635  (PDGHelpers::isALepton(pApartId[iy]) && pApartId[iy]<0)
2636  )
2637  ){
2638  int i1=ix; int i2=iy;
2639  if (pApartId[ix]<0){ swap(i1, i2); }
2640  int* tmpOrder = new int[napart];
2641  tmpOrder[0] = i1; tmpOrder[1] = i2;
2642  unsigned int ctr=2;
2643  for (unsigned int ipart=0; ipart<napart; ipart++){ if (ctr<napart && pApartOrder[ipart]!=i1 && pApartOrder[ipart]!=i2){ tmpOrder[ctr] = pApartOrder[ipart]; ctr++; } }
2644  delete[] pApartOrder; pApartOrder = tmpOrder;
2645  hasWplus=true;
2646  break;
2647  }
2648  else if (
2650  &&
2651  (
2652  (PDGHelpers::isALepton(pApartId[ix]) && pApartId[ix]>0)
2653  ||
2654  (PDGHelpers::isALepton(pApartId[iy]) && pApartId[iy]>0)
2655  )
2656  ){
2657  int i1=ix; int i2=iy;
2658  if (pApartId[ix]<0){ swap(i1, i2); }
2659  int* tmpOrder = new int[napart];
2660  tmpOrder[0] = i1; tmpOrder[1] = i2;
2661  unsigned int ctr=2;
2662  for (unsigned int ipart=0; ipart<napart; ipart++){ if (ctr<napart && pApartOrder[ipart]!=i1 && pApartOrder[ipart]!=i2){ tmpOrder[ctr] = pApartOrder[ipart]; ctr++; } }
2663  delete[] pApartOrder; pApartOrder = tmpOrder;
2664  hasWminus=true;
2665  break;
2666  }
2667  }
2668  if (hasWplus || hasWminus) break;
2669  }
2670  unsigned int iout=6;
2671  unsigned int jout=7;
2672  if (useQQVVQQany){
2673  int qqvvqq_apartordering[2]={ -1, -1 };
2675  mela_event.pMothers.at(0).first, mela_event.pMothers.at(1).first,
2676  pApartId[pApartOrder[0]], pApartId[pApartOrder[1]],
2677  qqvvqq_apartordering
2678  );
2679  if (qqvvqq_apartordering[0]==-1 || qqvvqq_apartordering[1]==-1) result=false;
2680  else if (qqvvqq_apartordering[0]>qqvvqq_apartordering[1]){
2681  swap(iout, jout);
2682  swap(pApartOrder[0], pApartOrder[1]);
2683  }
2684  }
2685  if (hasWplus){ // W+
2686  strplabel[iout]="nl";
2687  strplabel[jout]="ea";
2688  }
2689  else if (hasWminus){ // W-
2690  strplabel[iout]="el";
2691  strplabel[jout]="na";
2692  }
2693  else result = false;
2694  }
2695  else if ((isWW || isZZ) && napart>=2 && (production == TVar::Had_ZH || production == TVar::Had_ZH_S || production == TVar::Had_ZH_TU)){
2696  spinzerohiggs_anomcoupl_.channeltoggle_stu = int(production == TVar::Had_ZH)*2 + int(production == TVar::Had_ZH_TU)*1 + int(production == TVar::Had_ZH_S)*0;
2697  spinzerohiggs_anomcoupl_.vvhvvtoggle_vbfvh = 1;
2698 
2700  string strrun = runstring_.runstring;
2701  if (isWW && (!hasZ1 || !hasZ2)) strrun += "_ww";
2702  else if (isZZ && (!hasW1 || !hasW2)) strrun += "_zz";
2703  sprintf(runstring_.runstring, strrun.c_str());
2704  }
2705 
2706  bool hasZuu=false;
2707  bool hasZdd=false;
2708  bool hasZjj=false;
2709  for (unsigned int ix=0; ix<napart; ix++){
2710  if (!PDGHelpers::isAJet(pApartId[ix])) continue;
2711  for (unsigned int iy=ix+1; iy<napart; iy++){
2712  if (!PDGHelpers::isAJet(pApartId[iy])) continue;
2713  int Vid;
2714  if (!PDGHelpers::isAnUnknownJet(pApartId[ix]) && !PDGHelpers::isAnUnknownJet(pApartId[iy])) Vid = PDGHelpers::getCoupledVertex(pApartId[ix], pApartId[iy]);
2715  else Vid = 23;
2716  if (PDGHelpers::isAZBoson(Vid) && (PDGHelpers::isUpTypeQuark(pApartId[ix]) || PDGHelpers::isUpTypeQuark(pApartId[iy]))){
2717  int i1=ix; int i2=iy;
2718  if (pApartId[ix]<0 || pApartId[iy]>0){ swap(i1, i2); }
2719  int* tmpOrder = new int[napart];
2720  tmpOrder[0] = i1; tmpOrder[1] = i2;
2721  unsigned int ctr=2;
2722  for (unsigned int ipart=0; ipart<napart; ipart++){ if (ctr<napart && pApartOrder[ipart]!=i1 && pApartOrder[ipart]!=i2){ tmpOrder[ctr] = pApartOrder[ipart]; ctr++; } }
2723  delete[] pApartOrder; pApartOrder = tmpOrder;
2724  hasZuu=true;
2725  break;
2726  }
2727  else if (PDGHelpers::isAZBoson(Vid) && (PDGHelpers::isDownTypeQuark(pApartId[ix]) || PDGHelpers::isDownTypeQuark(pApartId[iy]))){
2728  int i1=ix; int i2=iy;
2729  if (pApartId[ix]<0 || pApartId[iy]>0){ swap(i1, i2); }
2730  int* tmpOrder = new int[napart];
2731  tmpOrder[0] = i1; tmpOrder[1] = i2;
2732  unsigned int ctr=2;
2733  for (unsigned int ipart=0; ipart<napart; ipart++){ if (ctr<napart && pApartOrder[ipart]!=i1 && pApartOrder[ipart]!=i2){ tmpOrder[ctr] = pApartOrder[ipart]; ctr++; } }
2734  delete[] pApartOrder; pApartOrder = tmpOrder;
2735  hasZdd=true;
2736  break;
2737  }
2738  else if (PDGHelpers::isAZBoson(Vid)){
2739  int i1=ix; int i2=iy;
2740  int* tmpOrder = new int[napart];
2741  tmpOrder[0] = i1; tmpOrder[1] = i2;
2742  unsigned int ctr=2;
2743  for (unsigned int ipart=0; ipart<napart; ipart++){ if (ctr<napart && pApartOrder[ipart]!=i1 && pApartOrder[ipart]!=i2){ tmpOrder[ctr] = pApartOrder[ipart]; ctr++; } }
2744  delete[] pApartOrder; pApartOrder = tmpOrder;
2745  hasZjj=true;
2746  break;
2747  }
2748  if (hasZuu || hasZdd || hasZjj) break;
2749  }
2750  }
2751  if (useQQVVQQany){
2752  int qqvvqq_apartordering[2]={ -1, -1 };
2754  mela_event.pMothers.at(0).first, mela_event.pMothers.at(1).first,
2755  pApartId[pApartOrder[0]], pApartId[pApartOrder[1]],
2756  qqvvqq_apartordering
2757  );
2758  if (qqvvqq_apartordering[0]==-1 || qqvvqq_apartordering[1]==-1) result=false;
2759  else if (qqvvqq_apartordering[0]>qqvvqq_apartordering[1]) swap(pApartOrder[0], pApartOrder[1]);
2760  }
2761  if (hasZuu || hasZdd){
2762  strplabel[6]=TUtil::GetMCFMParticleLabel(pApartId[pApartOrder[0]], true, useQQVVQQany);
2763  strplabel[7]=TUtil::GetMCFMParticleLabel(pApartId[pApartOrder[1]], true, useQQVVQQany);
2764  }
2765  else if (hasZjj){
2766  strplabel[6]="qj";
2767  strplabel[7]="qj";
2768  }
2769  else result = false;
2770  }
2771  else if ((isWW || isZZ) && napart>=2 && (production == TVar::Had_WH || production == TVar::Had_WH_S || production == TVar::Had_WH_TU)){
2772  spinzerohiggs_anomcoupl_.channeltoggle_stu = int(production == TVar::Had_WH)*2 + int(production == TVar::Had_WH_TU)*1 + int(production == TVar::Had_WH_S)*0;
2773  spinzerohiggs_anomcoupl_.vvhvvtoggle_vbfvh = 1;
2774 
2776  string strrun = runstring_.runstring;
2777  if (isWW && (!hasZ1 || !hasZ2)) strrun += "_ww";
2778  else if (isZZ && (!hasW1 || !hasW2)) strrun += "_zz";
2779  sprintf(runstring_.runstring, strrun.c_str());
2780  }
2781 
2782  bool hasWplus=false;
2783  bool hasWminus=false;
2784  bool hasWjj=false;
2785  for (unsigned int ix=0; ix<napart; ix++){
2786  if (!PDGHelpers::isAJet(pApartId[ix])) continue;
2787  for (unsigned int iy=ix+1; iy<napart; iy++){
2788  if (!PDGHelpers::isAJet(pApartId[iy])) continue;
2789  int Vid;
2790  if (!PDGHelpers::isAnUnknownJet(pApartId[ix]) && !PDGHelpers::isAnUnknownJet(pApartId[iy])) Vid = PDGHelpers::getCoupledVertex(pApartId[ix], pApartId[iy]);
2791  else if (
2792  (PDGHelpers::isUpTypeQuark(pApartId[ix]) && pApartId[ix]<0) || (PDGHelpers::isUpTypeQuark(pApartId[iy]) && pApartId[iy]<0) ||
2793  (PDGHelpers::isDownTypeQuark(pApartId[ix]) && pApartId[ix]>0) || (PDGHelpers::isDownTypeQuark(pApartId[iy]) && pApartId[iy]>0)
2794  ) Vid=-24;
2795  else Vid = 24;
2796  if (
2798  &&
2799  (
2800  ((PDGHelpers::isDownTypeQuark(pApartId[ix]) && pApartId[ix]<0) || (PDGHelpers::isUpTypeQuark(pApartId[iy]) && pApartId[iy]>0))
2801  ||
2802  ((PDGHelpers::isDownTypeQuark(pApartId[iy]) && pApartId[iy]<0) || (PDGHelpers::isUpTypeQuark(pApartId[ix]) && pApartId[ix]>0))
2803  )
2804  ){
2805  int i1=ix; int i2=iy;
2806  if (pApartId[ix]<0 || pApartId[iy]>0){ swap(i1, i2); }
2807  int* tmpOrder = new int[napart];
2808  tmpOrder[0] = i1; tmpOrder[1] = i2;
2809  unsigned int ctr=2;
2810  for (unsigned int ipart=0; ipart<napart; ipart++){ if (ctr<napart && pApartOrder[ipart]!=i1 && pApartOrder[ipart]!=i2){ tmpOrder[ctr] = pApartOrder[ipart]; ctr++; } }
2811  delete[] pApartOrder; pApartOrder = tmpOrder;
2812  hasWplus=true;
2813  break;
2814  }
2815  else if (
2817  &&
2818  (
2819  ((PDGHelpers::isDownTypeQuark(pApartId[ix]) && pApartId[ix]>0) || (PDGHelpers::isUpTypeQuark(pApartId[iy]) && pApartId[iy]<0))
2820  ||
2821  ((PDGHelpers::isDownTypeQuark(pApartId[iy]) && pApartId[iy]>0) || (PDGHelpers::isUpTypeQuark(pApartId[ix]) && pApartId[ix]<0))
2822  )
2823  ){
2824  int i1=ix; int i2=iy;
2825  if (pApartId[ix]<0 || pApartId[iy]>0){ swap(i1, i2); }
2826  int* tmpOrder = new int[napart];
2827  tmpOrder[0] = i1; tmpOrder[1] = i2;
2828  unsigned int ctr=2;
2829  for (unsigned int ipart=0; ipart<napart; ipart++){ if (ctr<napart && pApartOrder[ipart]!=i1 && pApartOrder[ipart]!=i2){ tmpOrder[ctr] = pApartOrder[ipart]; ctr++; } }
2830  delete[] pApartOrder; pApartOrder = tmpOrder;
2831  hasWminus=true;
2832  break;
2833  }
2834  else if (PDGHelpers::isAWBoson(Vid)){
2835  int i1=ix; int i2=iy;
2836  int* tmpOrder = new int[napart];
2837  tmpOrder[0] = i1; tmpOrder[1] = i2;
2838  unsigned int ctr=2;
2839  for (unsigned int ipart=0; ipart<napart; ipart++){ if (ctr<napart && pApartOrder[ipart]!=i1 && pApartOrder[ipart]!=i2){ tmpOrder[ctr] = pApartOrder[ipart]; ctr++; } }
2840  delete[] pApartOrder; pApartOrder = tmpOrder;
2841  hasWjj=true;
2842  break;
2843  }
2844  }
2845  if (hasWplus || hasWminus || hasWjj) break;
2846  }
2847  if (useQQVVQQany){
2848  int qqvvqq_apartordering[2]={ -1, -1 };
2850  mela_event.pMothers.at(0).first, mela_event.pMothers.at(1).first,
2851  pApartId[pApartOrder[0]], pApartId[pApartOrder[1]],
2852  qqvvqq_apartordering
2853  );
2854  if (qqvvqq_apartordering[0]==-1 || qqvvqq_apartordering[1]==-1) result=false;
2855  else if (qqvvqq_apartordering[0]>qqvvqq_apartordering[1]) swap(pApartOrder[0], pApartOrder[1]);
2856  }
2857  if (hasWplus || hasWminus){ // W+ or W-
2858  strplabel[6]=TUtil::GetMCFMParticleLabel(pApartId[pApartOrder[0]], true, useQQVVQQany);
2859  strplabel[7]=TUtil::GetMCFMParticleLabel(pApartId[pApartOrder[1]], true, useQQVVQQany);
2860  }
2861  else if (hasWjj){ // W+/-
2862  strplabel[6]="qj";
2863  strplabel[7]="qj";
2864  }
2865  else result = false;
2866  }
2867  else if ((isWW || isZZ) && napart>=2 && (production == TVar::JJQCD || production == TVar::JJQCD_S || production == TVar::JJQCD_TU)){
2868  spinzerohiggs_anomcoupl_.channeltoggle_stu = int(production == TVar::JJQCD)*2 + int(production == TVar::JJQCD_TU)*1 + int(production == TVar::JJQCD_S)*0;;
2869  spinzerohiggs_anomcoupl_.vvhvvtoggle_vbfvh = 2; // Doesn't matter, already JJQCD
2870 
2871  if (process == TVar::bkgWWZZ/* || process == TVar::HSMHiggs_WWZZ || process == TVar::bkgWWZZ_SMHiggs*/){
2872  string strrun = runstring_.runstring;
2873  if (isWW && (!hasZ1 || !hasZ2)) strrun += "_ww";
2874  else if (isZZ && (!hasW1 || !hasW2)) strrun += "_zz";
2875  sprintf(runstring_.runstring, strrun.c_str());
2876  }
2877 
2878  if (useQQVVQQany){
2879  int qqvvqq_apartordering[2]={ -1, -1 };
2881  mela_event.pMothers.at(0).first, mela_event.pMothers.at(1).first,
2882  pApartId[pApartOrder[0]], pApartId[pApartOrder[1]],
2883  qqvvqq_apartordering
2884  );
2885  if (qqvvqq_apartordering[0]==-1 || qqvvqq_apartordering[1]==-1) result=false;
2886  else if (qqvvqq_apartordering[0]>qqvvqq_apartordering[1]) swap(pApartOrder[0], pApartOrder[1]);
2887  }
2888  strplabel[6]=TUtil::GetMCFMParticleLabel(pApartId[pApartOrder[0]], false, useQQVVQQany);
2889  strplabel[7]=TUtil::GetMCFMParticleLabel(pApartId[pApartOrder[1]], false, useQQVVQQany);
2890  }
2891  else if ((isWW || isZZ) && napart>=2 && (production == TVar::JJVBF || production == TVar::JJVBF_S || production == TVar::JJVBF_TU)){
2892  spinzerohiggs_anomcoupl_.channeltoggle_stu = int(production == TVar::JJVBF)*2 + int(production == TVar::JJVBF_TU)*1 + int(production == TVar::JJVBF_S)*0;;
2893  spinzerohiggs_anomcoupl_.vvhvvtoggle_vbfvh = 0; // VBF-only process
2894 
2896  string strrun = runstring_.runstring;
2897  if (isWW && (!hasZ1 || !hasZ2)) strrun += "_ww";
2898  else if (isZZ && (!hasW1 || !hasW2)) strrun += "_zz";
2899  sprintf(runstring_.runstring, strrun.c_str());
2900  }
2901 
2902  if (useQQVVQQany){
2903  int qqvvqq_apartordering[2]={ -1, -1 };
2905  mela_event.pMothers.at(0).first, mela_event.pMothers.at(1).first,
2906  pApartId[pApartOrder[0]], pApartId[pApartOrder[1]],
2907  qqvvqq_apartordering
2908  );
2909  if (qqvvqq_apartordering[0]==-1 || qqvvqq_apartordering[1]==-1) result=false;
2910  else if (qqvvqq_apartordering[0]>qqvvqq_apartordering[1]) swap(pApartOrder[0], pApartOrder[1]);
2911  }
2912  strplabel[6]=TUtil::GetMCFMParticleLabel(pApartId[pApartOrder[0]], true, useQQVVQQany);
2913  strplabel[7]=TUtil::GetMCFMParticleLabel(pApartId[pApartOrder[1]], true, useQQVVQQany);
2914  }
2915  else if ((isWW || isZZ) && napart>=2 && (production == TVar::JJEW || production == TVar::JJEWQCD || production == TVar::JJEW_S || production == TVar::JJEWQCD_S || production == TVar::JJEW_TU || production == TVar::JJEWQCD_TU)){
2916  spinzerohiggs_anomcoupl_.channeltoggle_stu = int(production == TVar::JJEWQCD || production == TVar::JJEW)*2 + int(production == TVar::JJEWQCD_TU || production == TVar::JJEW_TU)*1 + int(production == TVar::JJEWQCD_S || production == TVar::JJEW_S)*0;;
2917  spinzerohiggs_anomcoupl_.vvhvvtoggle_vbfvh = 2; // VBF+VH process
2918 
2920  string strrun = runstring_.runstring;
2921  if (isWW && (!hasZ1 || !hasZ2)) strrun += "_ww";
2922  else if (isZZ && (!hasW1 || !hasW2)) strrun += "_zz";
2923  sprintf(runstring_.runstring, strrun.c_str());
2924  }
2925 
2926  if (useQQVVQQany){
2927  int qqvvqq_apartordering[2]={ -1, -1 };
2929  mela_event.pMothers.at(0).first, mela_event.pMothers.at(1).first,
2930  pApartId[pApartOrder[0]], pApartId[pApartOrder[1]],
2931  qqvvqq_apartordering
2932  );
2933  if (qqvvqq_apartordering[0]==-1 || qqvvqq_apartordering[1]==-1) result=false;
2934  else if (qqvvqq_apartordering[0]>qqvvqq_apartordering[1]) swap(pApartOrder[0], pApartOrder[1]);
2935  }
2936  strplabel[6]=TUtil::GetMCFMParticleLabel(pApartId[pApartOrder[0]], false, useQQVVQQany);
2937  strplabel[7]=TUtil::GetMCFMParticleLabel(pApartId[pApartOrder[1]], false, useQQVVQQany);
2938  }
2939 
2940  // Couplings for Z1
2941  if (isWW && (production == TVar::ZZINDEPENDENT || production == TVar::ZZQQB) && process == TVar::bkgWW){} // Skip this one, already handled above
2942  else if (hasZ1){
2943  if (PDGHelpers::isALepton(pId[pZOrder[0]]) && PDGHelpers::isALepton(pId[pZOrder[1]])){
2944  if (verbosity>=TVar::DEBUG) MELAout << "- Setting Z1->ll couplings." << endl;
2945 
2946  zcouple_.q1=-1.0;
2947  zcouple_.l1=zcouple_.le;
2948  zcouple_.r1=zcouple_.re;
2949 
2950  // Special Z1->ll cases
2951  if (useQQBZGAM){
2952  strplabel[2]="el";
2953  strplabel[3]="ea";
2954  }
2955  else if (useQQVVQQany){
2956  strplabel[2]=TUtil::GetMCFMParticleLabel(pId[pZOrder[0]], false, useQQVVQQany);
2957  strplabel[3]=TUtil::GetMCFMParticleLabel(pId[pZOrder[1]], false, useQQVVQQany);
2958  }
2959  else if (anomzffcouplings_.AllowAnomalousZffCouplings == 1){
2960  strplabel[2]=TUtil::GetMCFMParticleLabel(pId[pZOrder[2]], false, false);
2961  strplabel[3]=TUtil::GetMCFMParticleLabel(pId[pZOrder[2]], false, false);
2962  }
2963  // End special Z1->ll cases
2964  }
2965  else if (PDGHelpers::isANeutrino(pId[pZOrder[0]]) && PDGHelpers::isANeutrino(pId[pZOrder[1]])){
2966  if (verbosity>=TVar::DEBUG) MELAout << "- Setting Z1->nn couplings." << endl;
2967 
2968  zcouple_.q1=0;
2969  zcouple_.l1=zcouple_.ln;
2970  zcouple_.r1=zcouple_.rn;
2971 
2972  // Special Z1->nn cases
2973  if (useQQBZGAM){
2974  strplabel[2]="nl";
2975  strplabel[3]="na";
2976  }
2977  else if (useQQVVQQany){
2978  strplabel[2]=TUtil::GetMCFMParticleLabel(pId[pZOrder[0]], false, useQQVVQQany);
2979  strplabel[3]=TUtil::GetMCFMParticleLabel(pId[pZOrder[1]], false, useQQVVQQany);
2980  }
2981  else if (anomzffcouplings_.AllowAnomalousZffCouplings == 1){
2982  strplabel[2]=TUtil::GetMCFMParticleLabel(pId[pZOrder[2]], false, false);
2983  strplabel[3]=TUtil::GetMCFMParticleLabel(pId[pZOrder[2]], false, false);
2984  }
2985  // End special Z1->nn cases
2986  }
2987  else if (PDGHelpers::isAJet(pId[pZOrder[0]]) && PDGHelpers::isAJet(pId[pZOrder[1]])){
2988  if (verbosity>=TVar::DEBUG) MELAout << "- Setting Z1->jj couplings." << endl;
2989 
2990  nqcdjets_.nqcdjets += 2;
2991  int jetid=(PDGHelpers::isAnUnknownJet(pId[pZOrder[0]]) ? abs(pId[pZOrder[1]]) : abs(pId[pZOrder[0]]));
2992  if (!PDGHelpers::isAnUnknownJet(jetid)){
2993  if (jetid==6) jetid = 2;
2994  zcouple_.q1=ewcharge_.Q[5+jetid];
2995  zcouple_.l1=zcouple_.l[-1+jetid];
2996  zcouple_.r1=zcouple_.r[-1+jetid];
2997 
2998  // Special Z1->qq cases
2999  if (useQQBZGAM){
3000  strplabel[2]="el";// Trick MCFM, not implemented properly
3001  strplabel[3]="ea";
3002  }
3003  else if (useQQVVQQany){
3004  strplabel[2]=TUtil::GetMCFMParticleLabel(pId[pZOrder[0]], false, useQQVVQQany);
3005  strplabel[3]=TUtil::GetMCFMParticleLabel(pId[pZOrder[1]], false, useQQVVQQany);
3006  }
3007  else if (anomzffcouplings_.AllowAnomalousZffCouplings == 1){
3008  strplabel[2]=TUtil::GetMCFMParticleLabel(pId[pZOrder[2]], false, false);
3009  strplabel[3]=TUtil::GetMCFMParticleLabel(pId[pZOrder[2]], false, false);
3010  }
3011  }
3012  else{
3013  double gV_up = (zcouple_.l[-1+2]+zcouple_.r[-1+2])/2.;
3014  double gV_dn = (zcouple_.l[-1+1]+zcouple_.r[-1+1])/2.;
3015  double gA_up = (zcouple_.l[-1+2]-zcouple_.r[-1+2])/2.;
3016  double gA_dn = (zcouple_.l[-1+1]-zcouple_.r[-1+1])/2.;
3017  double yy_up = pow(gV_up, 2) + pow(gA_up, 2);
3018  double yy_dn = pow(gV_dn, 2) + pow(gA_dn, 2);
3019  double xx_up = gV_up*gA_up;
3020  double xx_dn = gV_dn*gA_dn;
3021  double yy = (2.*yy_up+3.*yy_dn);
3022  double xx = (2.*xx_up+3.*xx_dn);
3023  double discriminant = pow(yy, 2)-4.*pow(xx, 2);
3024  double gVsq = (yy+sqrt(fabs(discriminant)))/2.;
3025  double gAsq = pow(xx, 2)/gVsq;
3026  double gV=-sqrt(gVsq);
3027  double gA=-sqrt(gAsq);
3028  zcouple_.l1 = (gV+gA);
3029  zcouple_.r1 = (gV-gA);
3030  zcouple_.q1=sqrt(pow(ewcharge_.Q[5+1], 2)*3.+pow(ewcharge_.Q[5+2], 2)*2.);
3031 
3032  // Special Z1->qq cases
3033  if (useQQBZGAM){
3034  strplabel[2]="el";// Trick MCFM, not implemented properly
3035  strplabel[3]="ea";
3036  }
3037  else if (useQQVVQQany){
3038  strplabel[2]="qj";
3039  strplabel[3]="qj";
3040  }
3041  else if (anomzffcouplings_.AllowAnomalousZffCouplings == 1){
3042  strplabel[2]=TUtil::GetMCFMParticleLabel(pId[pZOrder[2]], false, false);
3043  strplabel[3]=TUtil::GetMCFMParticleLabel(pId[pZOrder[2]], false, false);
3044  }
3045  }
3046  if (!useQQVVQQany){ // colfac34_56 handles all couplings instead of this simple scaling (Reason: WW final states)
3047  zcouple_.l1 *= sqrt(3.);
3048  zcouple_.r1 *= sqrt(3.);
3049  zcouple_.q1 *= sqrt(3.);
3050  }
3051  } // End Z1 daughter id tests
3052  } // End ZZ/ZG/ZJJ Z1 couplings
3053  else if (useQQVVQQany){
3054  strplabel[2]=TUtil::GetMCFMParticleLabel(pId[pZOrder[0]], false, useQQVVQQany);
3055  strplabel[3]=TUtil::GetMCFMParticleLabel(pId[pZOrder[1]], false, useQQVVQQany);
3056  }
3057  else if (anomzffcouplings_.AllowAnomalousZffCouplings == 1){
3058  strplabel[2]=TUtil::GetMCFMParticleLabel(pId[pZOrder[2]], false, false);
3059  strplabel[3]=TUtil::GetMCFMParticleLabel(pId[pZOrder[2]], false, false);
3060  }
3061 
3062  // Couplings for Z2
3063  if (
3064  (isWW && (production == TVar::ZZINDEPENDENT || production == TVar::ZZQQB) && process == TVar::bkgWW) // Skip this one, already handled above
3065  ||
3066  (isZJJ && production == TVar::JJQCD && process == TVar::bkgZJets) // No need to handle
3067  ){}
3068  else if (hasZ2){
3069  if (PDGHelpers::isALepton(pId[pZOrder[2]]) && PDGHelpers::isALepton(pId[pZOrder[3]])){
3070  if (verbosity>=TVar::DEBUG) MELAout << "- Setting Z2->ll couplings." << endl;
3071  zcouple_.q2=-1.0;
3072  zcouple_.l2=zcouple_.le;
3073  zcouple_.r2=zcouple_.re;
3074 
3075  // Special Z2->ll cases
3076  if (useQQVVQQany){
3077  strplabel[4]=TUtil::GetMCFMParticleLabel(pId[pZOrder[2]], false, useQQVVQQany);
3078  strplabel[5]=TUtil::GetMCFMParticleLabel(pId[pZOrder[3]], false, useQQVVQQany);
3079  }
3080  else if (anomzffcouplings_.AllowAnomalousZffCouplings == 1){
3081  strplabel[4]=TUtil::GetMCFMParticleLabel(pId[pZOrder[2]], false, false);
3082  strplabel[5]=TUtil::GetMCFMParticleLabel(pId[pZOrder[2]], false, false);
3083  }
3084  // End special Z2->ll cases
3085  }
3086  else if (PDGHelpers::isANeutrino(pId[pZOrder[2]]) && PDGHelpers::isANeutrino(pId[pZOrder[3]])){
3087  if (verbosity>=TVar::DEBUG) MELAout << "- Setting Z2->nn couplings." << endl;
3088  zcouple_.q2=0;
3089  zcouple_.l2=zcouple_.ln;
3090  zcouple_.r2=zcouple_.rn;
3091 
3092  // Special Z2->nn cases
3093  if (useQQVVQQany){
3094  strplabel[4]=TUtil::GetMCFMParticleLabel(pId[pZOrder[2]], false, useQQVVQQany);
3095  strplabel[5]=TUtil::GetMCFMParticleLabel(pId[pZOrder[3]], false, useQQVVQQany);
3096  }
3097  else if (anomzffcouplings_.AllowAnomalousZffCouplings == 1){
3098  strplabel[4]=TUtil::GetMCFMParticleLabel(pId[pZOrder[2]], false, false);
3099  strplabel[5]=TUtil::GetMCFMParticleLabel(pId[pZOrder[2]], false, false);
3100  }
3101  // End special Z2->nn cases
3102  }
3103  else if (PDGHelpers::isAJet(pId[pZOrder[2]]) && PDGHelpers::isAJet(pId[pZOrder[3]])){
3104  if (verbosity>=TVar::DEBUG) MELAout << "- Setting Z2->jj couplings." << endl;
3105 
3106  nqcdjets_.nqcdjets += 2;
3107  int jetid=(PDGHelpers::isAnUnknownJet(pId[pZOrder[2]]) ? abs(pId[pZOrder[3]]) : abs(pId[pZOrder[2]]));
3108  if (!PDGHelpers::isAnUnknownJet(jetid)){
3109  if (jetid==6) jetid = 2;
3110  zcouple_.q2=ewcharge_.Q[5+jetid];
3111  zcouple_.l2=zcouple_.l[-1+jetid];
3112  zcouple_.r2=zcouple_.r[-1+jetid];
3113 
3114  // Special Z2->qq cases
3115  if (useQQVVQQany){
3116  strplabel[4]=TUtil::GetMCFMParticleLabel(pId[pZOrder[2]], false, useQQVVQQany);
3117  strplabel[5]=TUtil::GetMCFMParticleLabel(pId[pZOrder[3]], false, useQQVVQQany);
3118  }
3119  else if (anomzffcouplings_.AllowAnomalousZffCouplings == 1){
3120  strplabel[4]=TUtil::GetMCFMParticleLabel(pId[pZOrder[2]], false, false);
3121  strplabel[5]=TUtil::GetMCFMParticleLabel(pId[pZOrder[2]], false, false);
3122  }
3123  }
3124  else{
3125  double gV_up = (zcouple_.l[-1+2]+zcouple_.r[-1+2])/2.;
3126  double gV_dn = (zcouple_.l[-1+1]+zcouple_.r[-1+1])/2.;
3127  double gA_up = (zcouple_.l[-1+2]-zcouple_.r[-1+2])/2.;
3128  double gA_dn = (zcouple_.l[-1+1]-zcouple_.r[-1+1])/2.;
3129  double yy_up = pow(gV_up, 2) + pow(gA_up, 2);
3130  double yy_dn = pow(gV_dn, 2) + pow(gA_dn, 2);
3131  double xx_up = gV_up*gA_up;
3132  double xx_dn = gV_dn*gA_dn;
3133  double yy = (2.*yy_up+3.*yy_dn);
3134  double xx = (2.*xx_up+3.*xx_dn);
3135  double discriminant = pow(yy, 2)-4.*pow(xx, 2);
3136  double gVsq = (yy+sqrt(fabs(discriminant)))/2.;
3137  double gAsq = pow(xx, 2)/gVsq;
3138  double gV=-sqrt(gVsq);
3139  double gA=-sqrt(gAsq);
3140  zcouple_.l2 = (gV+gA);
3141  zcouple_.r2 = (gV-gA);
3142  zcouple_.q2=sqrt(pow(ewcharge_.Q[5+1], 2)*3.+pow(ewcharge_.Q[5+2], 2)*2.);
3143 
3144  // Special Z2->qq cases
3145  if (useQQVVQQany){
3146  strplabel[4]="qj";
3147  strplabel[5]="qj";
3148  }
3149  else if (anomzffcouplings_.AllowAnomalousZffCouplings == 1){
3150  strplabel[4]=TUtil::GetMCFMParticleLabel(pId[pZOrder[2]], false, false);
3151  strplabel[5]=TUtil::GetMCFMParticleLabel(pId[pZOrder[2]], false, false);
3152  }
3153  }
3154  if (!useQQVVQQany){ // colfac34_56 handles all couplings instead of this simple scaling (Reason: WW Final states)
3155  zcouple_.l2 *= sqrt(3.);
3156  zcouple_.r2 *= sqrt(3.);
3157  zcouple_.q2 *= sqrt(3.);
3158  }
3159  } // End Z2 daughter id tests
3160  } // End ZZ Z2 couplings
3161  else if (useQQVVQQany){
3162  strplabel[4]=TUtil::GetMCFMParticleLabel(pId[pZOrder[2]], false, useQQVVQQany);
3163  strplabel[5]=TUtil::GetMCFMParticleLabel(pId[pZOrder[3]], false, useQQVVQQany);
3164  }
3165  else if (anomzffcouplings_.AllowAnomalousZffCouplings == 1){
3166  strplabel[4]=TUtil::GetMCFMParticleLabel(pId[pZOrder[2]], false, false);
3167  strplabel[5]=TUtil::GetMCFMParticleLabel(pId[pZOrder[2]], false, false);
3168  }
3169 
3170  } // End check WW, ZZ, ZG etc.
3171 
3172  int* ordering=nullptr;
3173  if (ndau<=2){
3174  if (production == TVar::ZZGG){
3175  if (process == TVar::bkgGammaGamma){ ordering = pOrder; if (!isGG) result = false; }
3176  }
3177  else if (production == TVar::ZZINDEPENDENT || production == TVar::ZZQQB){
3178  if (process == TVar::bkgGammaGamma){ ordering = pZOrder; if (!isGG) result = false; }
3179  else if (process == TVar::bkgZGamma){ ordering = pZOrder; if (!hasZ1 || !isZG) result = false; }
3180  }
3181  else if (production == TVar::JJQCD){
3182  if (process == TVar::bkgZJets){ ordering = pZOrder; if (!hasZ1 || !isZJJ) result = false; }
3183  }
3184  }
3185  else if (ndau<=3){
3186  if (production == TVar::ZZINDEPENDENT || production == TVar::ZZQQB){
3187  if (process == TVar::bkgZGamma){ ordering = pZOrder; if (!hasZ1 || !isZG) result = false; }
3188  }
3189  }
3190  else{
3191 
3192  if (
3193  (production == TVar::ZZINDEPENDENT || production == TVar::ZZQQB)
3194  ||
3195  ((production == TVar::ZZQQB_STU || production == TVar::ZZQQB_S || production == TVar::ZZQQB_TU) && process == TVar::bkgZZ)
3196  ){
3197  // Just get the default ordering
3198  if (production == TVar::ZZINDEPENDENT || production == TVar::ZZQQB){
3199  if (process == TVar::bkgZGamma){ ordering = pZOrder; if (!hasZ1) result = false; }
3200  else if (process == TVar::bkgZZ){ ordering = pZOrder; if (!hasZ1 || !hasZ2) result = false; }
3201  else if (process == TVar::bkgWW){ ordering = pWOrder; if (!hasW1 || !hasW2) result = false; }
3202  }
3203  // bkgZZ process with S/T+U/STU separation needs ZZ ordering
3204  else{ ordering = pZOrder; if (!hasZ1 || !hasZ2) result = false; }
3205  }
3206  else if (production == TVar::ZZGG){
3207  // ggZZ/WW/VV
3208  // All of these require ZZ ordering since they use either ZZ ME or VV ME
3210  ordering = pZOrder;
3211  if (
3212  !(
3213  (hasZ1 && hasZ2)
3214  ||
3215  (process == TVar::HSMHiggs && hasW1 && hasW2)
3216  )
3217  ) result = false;
3218  }
3220  ordering = pZOrder;
3221  if (!hasZ1 || !hasZ2 || !hasW1 || !hasW2) result = false;
3222  }
3223  else if (process == TVar::bkgWW_SMHiggs || process == TVar::bkgWW){
3224  ordering = pZOrder;
3225  if (!hasW1 || !hasW2) result = false;
3226  }
3227  }
3228  else if (
3229  production == TVar::Had_WH || production == TVar::Had_ZH
3230  || production == TVar::Had_WH_S || production == TVar::Had_ZH_S
3231  || production == TVar::Had_WH_TU || production == TVar::Had_ZH_TU
3232  || production == TVar::Lep_WH || production == TVar::Lep_ZH
3233  || production == TVar::Lep_WH_S || production == TVar::Lep_ZH_S
3234  || production == TVar::Lep_WH_TU || production == TVar::Lep_ZH_TU
3235  || production == TVar::JJVBF || production == TVar::JJEW || production == TVar::JJEWQCD
3236  || production == TVar::JJVBF_S || production == TVar::JJEW_S || production == TVar::JJEWQCD_S
3237  || production == TVar::JJVBF_TU || production == TVar::JJEW_TU || production == TVar::JJEWQCD_TU
3238  || production == TVar::JJQCD || production == TVar::JJQCD_S || production == TVar::JJQCD_TU
3239  ){
3240  // Z+2 jets
3241  // Just get the default ordering
3242  if (process == TVar::bkgZJets){ ordering = pZOrder; if (!hasZ1 || !isZJJ) result = false; }
3243  // VBF or QCD MCFM SBI, S or B
3244  // All of these require ZZ ordering since they use either ZZ ME or VV ME
3246  ordering = pZOrder;
3247  if (
3248  !(
3249  (hasZ1 && hasZ2)
3250  ||
3251  (process == TVar::HSMHiggs && hasW1 && hasW2)
3252  )
3253  ) result = false;
3254  }
3256  ordering = pZOrder;
3257  if (!hasZ1 || !hasZ2 || !hasW1 || !hasW2) result = false;
3258  }
3259  else if (process == TVar::bkgWW_SMHiggs || process == TVar::bkgWW){
3260  ordering = pZOrder;
3261  if (!hasW1 || !hasW2) result = false;
3262  }
3263  }
3264 
3265  }
3266 
3267  if (partOrder && ordering) { for (unsigned int ip=0; ip<ndau; ip++) partOrder->push_back(ordering[ip]); }
3268  if (apartOrder && pApartOrder) { for (unsigned int ip=0; ip<napart; ip++) apartOrder->push_back(pApartOrder[ip]); }
3269  for (int ip=0; ip<mxpart; ip++) sprintf((plabel_.plabel)[ip], strplabel[ip].Data());
3270 
3271  if (verbosity>=TVar::DEBUG){
3272  MELAout << "TUtil::MCFM_SetupParticleCouplings: Summary (result=" << (int)result << "):\n";
3273 
3274  MELAout << "\trunstring=" << runstring_.runstring << endl;
3275 
3276  if (hasZ1) MELAout << "\tProcess found a Z1." << endl;
3277  if (hasZ2) MELAout << "\tProcess found a Z2." << endl;
3278  if (hasW1) MELAout << "\tProcess found a W1." << endl;
3279  if (hasW2) MELAout << "\tProcess found a W2." << endl;
3280  MELAout << "\t(l1, l2) = (" << zcouple_.l1 << ", " << zcouple_.l2 << ")" << endl;
3281  MELAout << "\t(r1, r2) = (" << zcouple_.r1 << ", " << zcouple_.r2 << ")" << endl;
3282  MELAout << "\t(q1, q2) = (" << zcouple_.q1 << ", " << zcouple_.q2 << ")" << endl;
3283 
3284  MELAout << "\tplabels:\n";
3285  for (int ip=0; ip<mxpart; ip++) MELAout << "\t[" << ip << "]=" << (plabel_.plabel)[ip] << endl;
3286  if (partOrder){
3287  if (!partOrder->empty()) MELAout << "\tpartOrder[" << partOrder->size() << "]:\n";
3288  for (unsigned int ip=0; ip<partOrder->size(); ip++) MELAout << "\t[" << ip << "] -> " << partOrder->at(ip) << endl;
3289  }
3290  if (apartOrder){
3291  if (!apartOrder->empty()) MELAout << "\tapartOrder[" << apartOrder->size() << "]:\n";
3292  for (unsigned int ip=0; ip<apartOrder->size(); ip++) MELAout << "\t[" << ip << "] -> " << apartOrder->at(ip) << endl;
3293  }
3294  }
3295 
3296  delete[] pId;
3297  delete[] pWOrder;
3298  delete[] pZOrder;
3299  delete[] pOrder;
3300  if (pApartOrder) delete[] pApartOrder;
3301  if (pApartId) delete[] pApartId;
3302  return result;
3303 }

◆ MCFM_smalls()

bool TUtil::MCFM_smalls ( double  s[][mxpart],
int  npart 
)

Definition at line 3353 of file TUtil.cc.

3353  {
3354 
3355  // Reject event if any s(i,j) is too small
3356  // cutoff is defined in technical.Dat
3357 
3358  if (
3359  npart == 3 &&
3360  (
3361  (-s[5-1][1-1]< cutoff_.cutoff) //gamma p1
3362  || (-s[5-1][2-1]< cutoff_.cutoff) //gamma p2
3363  || (-s[4-1][1-1]< cutoff_.cutoff) //e+ p1
3364  || (-s[4-1][2-1]< cutoff_.cutoff) //e- p2
3365  || (-s[3-1][1-1]< cutoff_.cutoff) //nu p1
3366  || (-s[3-1][2-1]< cutoff_.cutoff) //nu p2
3367  || (+s[5-1][4-1]< cutoff_.cutoff) //gamma e+
3368  || (+s[5-1][3-1]< cutoff_.cutoff) //gamma nu
3369  || (+s[4-1][3-1]< cutoff_.cutoff) //e+ nu
3370  )
3371  )
3372  return true;
3373 
3374  else if (
3375  npart == 4 &&
3376  (
3377  (-s[5-1][1-1]< cutoff_.cutoff) //e- p1
3378  || (-s[5-1][2-1]< cutoff_.cutoff) //e- p2
3379  || (-s[6-1][1-1]< cutoff_.cutoff) //nb p1
3380  || (-s[6-1][2-1]< cutoff_.cutoff) //nb p2
3381  || (+s[6-1][5-1]< cutoff_.cutoff) //e- nb
3382  )
3383 
3384  )
3385 
3386  return true;
3387 
3388  return false;
3389 }

◆ PrintCandidateSummary() [1/2]

void TUtil::PrintCandidateSummary ( MELACandidate cand)

Definition at line 8855 of file TUtil.cc.

8855  {
8856  MELAout << "***** TUtil::PrintCandidateSummary *****" << endl;
8857  MELAout << "Candidate: " << cand << endl;
8858  if (cand) MELAout << *cand;
8859 }

◆ PrintCandidateSummary() [2/2]

void TUtil::PrintCandidateSummary ( TVar::simple_event_record cand)

Definition at line 8861 of file TUtil.cc.

8861  {
8862  MELAout << "***** TUtil::PrintCandidateSummary (Simple Event Record) *****" << endl;
8863  MELAout << "Candidate: " << cand << endl;
8864  if (cand){
8865  MELAout << "\tAssociationCode: " << cand->AssociationCode << endl;
8866  MELAout << "\tAssociationVCompatibility: " << cand->AssociationVCompatibility << endl;
8867  MELAout << "\tnRequested_AssociatedJets: " << cand->nRequested_AssociatedJets << endl;
8868  MELAout << "\tnRequested_AssociatedLeptons: " << cand->nRequested_AssociatedLeptons << endl;
8869  MELAout << "\tnRequested_AssociatedPhotons: " << cand->nRequested_AssociatedPhotons << endl;
8870  MELAout << "\tnRequested_Tops: " << cand->nRequested_Tops << endl;
8871  MELAout << "\tnRequested_Antitops: " << cand->nRequested_Antitops << endl;
8872  MELAout << "\tHas " << cand->pMothers.size() << " mothers" << endl;
8873  for (unsigned int ip=0; ip<cand->pMothers.size(); ip++){
8874  SimpleParticle_t* part = &(cand->pMothers.at(ip));
8875  MELAout
8876  << "\t\tV" << ip << " (" << part->first << ") (X,Y,Z,T)=( "
8877  << part->second.X() << " , "
8878  << part->second.Y() << " , "
8879  << part->second.Z() << " , "
8880  << part->second.T() << " )" << endl;
8881  }
8882  MELAout << "\tHas " << cand->intermediateVid.size() << " sorted daughter Vs" << endl;
8883  for (unsigned int iv=0; iv<cand->intermediateVid.size(); iv++) MELAout << "\t\tV" << iv << " (" << cand->intermediateVid.at(iv) << ")" << endl;
8884  MELAout << "\tHas " << cand->pDaughters.size() << " daughters" << endl;
8885  for (unsigned int ip=0; ip<cand->pDaughters.size(); ip++){
8886  SimpleParticle_t* part = &(cand->pDaughters.at(ip));
8887  MELAout
8888  << "\t\tDau[" << ip << "] (" << part->first << ") (X,Y,Z,T)=( "
8889  << part->second.X() << " , "
8890  << part->second.Y() << " , "
8891  << part->second.Z() << " , "
8892  << part->second.T() << " )" << endl;
8893  }
8894  MELAout << "\tHas " << cand->pAssociated.size() << " associated particles" << endl;
8895  for (unsigned int ip=0; ip<cand->pAssociated.size(); ip++){
8896  SimpleParticle_t* part = &(cand->pAssociated.at(ip));
8897  MELAout
8898  << "\t\tAPart[" << ip << "] (" << part->first << ") (X,Y,Z,T)=( "
8899  << part->second.X() << " , "
8900  << part->second.Y() << " , "
8901  << part->second.Z() << " , "
8902  << part->second.T() << " )" << endl;
8903  }
8904  MELAout << "\tHas " << cand->pStableTops.size() << " stable tops" << endl;
8905  for (unsigned int ip=0; ip<cand->pStableTops.size(); ip++){
8906  SimpleParticle_t* part = &(cand->pStableTops.at(ip));
8907  MELAout
8908  << "\t\tAPart[" << ip << "] (" << part->first << ") (X,Y,Z,T)=( "
8909  << part->second.X() << " , "
8910  << part->second.Y() << " , "
8911  << part->second.Z() << " , "
8912  << part->second.T() << " )" << endl;
8913  }
8914  MELAout << "\tHas " << cand->pStableAntitops.size() << " stable antitops" << endl;
8915  for (unsigned int ip=0; ip<cand->pStableAntitops.size(); ip++){
8916  SimpleParticle_t* part = &(cand->pStableAntitops.at(ip));
8917  MELAout
8918  << "\t\tAPart[" << ip << "] (" << part->first << ") (X,Y,Z,T)=( "
8919  << part->second.X() << " , "
8920  << part->second.Y() << " , "
8921  << part->second.Z() << " , "
8922  << part->second.T() << " )" << endl;
8923  }
8924 
8925  MELAout << "\tHas " << cand->pTopDaughters.size() << " unstable tops" << endl;
8926  for (unsigned int ip=0; ip<cand->pTopDaughters.size(); ip++){
8927  MELAout << "\t\tTop[" << ip << "] daughters:" << endl;
8928  for (unsigned int jp=0; jp<cand->pTopDaughters.at(ip).size(); jp++){
8929  SimpleParticle_t* part = &(cand->pTopDaughters.at(ip).at(jp));
8930  MELAout
8931  << "\t\t- Top daughter[" << ip << jp << "] (" << part->first << ") (X,Y,Z,T)=( "
8932  << part->second.X() << " , "
8933  << part->second.Y() << " , "
8934  << part->second.Z() << " , "
8935  << part->second.T() << " )" << endl;
8936  }
8937  }
8938  MELAout << "\tHas " << cand->pAntitopDaughters.size() << " unstable antitops" << endl;
8939  for (unsigned int ip=0; ip<cand->pAntitopDaughters.size(); ip++){
8940  MELAout << "\t\tAntitop[" << ip << "] daughters:" << endl;
8941  for (unsigned int jp=0; jp<cand->pAntitopDaughters.at(ip).size(); jp++){
8942  SimpleParticle_t* part = &(cand->pAntitopDaughters.at(ip).at(jp));
8943  MELAout
8944  << "\t\t- Antitop daughter[" << ip << jp << "] (" << part->first << ") (X,Y,Z,T)=( "
8945  << part->second.X() << " , "
8946  << part->second.Y() << " , "
8947  << part->second.Z() << " , "
8948  << part->second.T() << " )" << endl;
8949  }
8950  }
8951  }
8952 }

◆ removeMassFromPair()

std::pair< TLorentzVector, TLorentzVector > TUtil::removeMassFromPair ( TLorentzVector const &  jet1,
int const &  jet1Id,
TLorentzVector const &  jet2,
int const &  jet2Id,
double  m1 = 0,
double  m2 = 0 
)

Definition at line 76 of file TUtil.cc.

80  {
81  TLorentzVector const nullFourVector(0, 0, 0, 0);
82  TLorentzVector jet1massless(0, 0, 0, 0), jet2massless(0, 0, 0, 0);
83 
84  if (
86  &&
87  ((PDGHelpers::isAJet(jet1Id) && !PDGHelpers::isATopQuark(jet1Id)) || (PDGHelpers::isAJet(jet2Id) && !PDGHelpers::isATopQuark(jet2Id)))
88  ){
90  jet1massless=jet1;
91  jet2massless=jet2;
92  }
93  else if (jet1==nullFourVector || jet2==nullFourVector || jet1==jet2 || JetMassScheme==TVar::MomentumToEnergy){
94  TUtil::scaleMomentumToEnergy(jet1, jet1massless, m1);
95  TUtil::scaleMomentumToEnergy(jet2, jet2massless, m2);
96  }
98  jet1massless=jet1;
99  jet2massless=jet2;
100  TUtil::constrainedRemovePairMass(jet1massless, jet2massless, m1, m2);
101  }
102  else{
103  jet1massless=jet1;
104  jet2massless=jet2;
105  }
106  }
109  jet1massless=jet1;
110  jet2massless=jet2;
111  }
112  else if (jet1==nullFourVector || jet2==nullFourVector || jet1==jet2 || LeptonMassScheme==TVar::MomentumToEnergy){
113  TUtil::scaleMomentumToEnergy(jet1, jet1massless, m1);
114  TUtil::scaleMomentumToEnergy(jet2, jet2massless, m2);
115  }
117  jet1massless=jet1;
118  jet2massless=jet2;
119  TUtil::constrainedRemovePairMass(jet1massless, jet2massless, m1, m2);
120  }
121  else{
122  jet1massless=jet1;
123  jet2massless=jet2;
124  }
125  }
126  else{
127  jet1massless=jet1;
128  jet2massless=jet2;
129  }
130 
131  pair<TLorentzVector, TLorentzVector> result(jet1massless, jet2massless);
132  return result;
133 }

◆ ResetAmplitudeIncludes()

void TUtil::ResetAmplitudeIncludes ( )

Definition at line 3412 of file TUtil.cc.

3412  {
3414 }

◆ ResonancePropagator()

double TUtil::ResonancePropagator ( double const &  sqrts,
TVar::ResonancePropagatorScheme  scheme 
)

Definition at line 8194 of file TUtil.cc.

8194  {
8196 
8197  const double GeV=1./100.; // JHUGen mom. scale factor
8198  int isch=(int)scheme;
8199  double shat_jhu = pow(sqrts*GeV, 2);
8200  double prop = __modkinematics_MOD_getbwpropagator(&shat_jhu, &isch);
8201  if (scheme!=TVar::NoPropagator) prop *= pow(GeV, 4);
8202  return prop;
8203 }

◆ scaleMomentumToEnergy()

void TUtil::scaleMomentumToEnergy ( const TLorentzVector &  massiveJet,
TLorentzVector &  masslessJet,
double  mass = 0 
)

Definition at line 68 of file TUtil.cc.

68  {
69  double energy, p3, newp3, ratio;
70  energy = massiveJet.T();
71  p3 = massiveJet.P();
72  newp3 = sqrt(max(pow(energy, 2)-mass*fabs(mass), 0.));
73  ratio = (p3>0. ? (newp3/p3) : 1.);
74  masslessJet.SetXYZT(massiveJet.X()*ratio, massiveJet.Y()*ratio, massiveJet.Z()*ratio, energy);
75 }

◆ SetAlphaS()

void TUtil::SetAlphaS ( double &  Q_ren,
double &  Q_fac,
double  multiplier_ren,
double  multiplier_fac,
int  mynloop,
int  mynflav,
std::string  mypartons 
)

◆ SetCKMElements()

void TUtil::SetCKMElements ( double *  invckm_ud,
double *  invckm_us,
double *  invckm_cd,
double *  invckm_cs,
double *  invckm_ts,
double *  invckm_tb,
double *  invckm_ub = 0,
double *  invckm_cb = 0,
double *  invckm_td = 0 
)

Definition at line 1513 of file TUtil.cc.

1513  {
1514  __modparameters_MOD_computeckmelements(invckm_ud, invckm_us, invckm_cd, invckm_cs, invckm_ts, invckm_tb, invckm_ub, invckm_cb, invckm_td);
1515 
1516  int i, j;
1517  i=2; j=1;
1518  cabib_.Vud = __modparameters_MOD_ckmbare(&i, &j);
1519  i=2; j=3;
1520  cabib_.Vus = __modparameters_MOD_ckmbare(&i, &j);
1521  i=2; j=5;
1522  cabib_.Vub = __modparameters_MOD_ckmbare(&i, &j);
1523  i=4; j=1;
1524  cabib_.Vcd = __modparameters_MOD_ckmbare(&i, &j);
1525  i=4; j=3;
1526  cabib_.Vcs = __modparameters_MOD_ckmbare(&i, &j);
1527  i=4; j=5;
1528  cabib_.Vcb = __modparameters_MOD_ckmbare(&i, &j);
1529  // Do not call ckmfill_(), it is called by MCFM_chooser!
1530 }

◆ SetDecayWidth()

void TUtil::SetDecayWidth ( double  inwidth,
int  ipart 
)

Definition at line 1497 of file TUtil.cc.

1497  {
1498  const int ipartabs = abs(ipart);
1499  // No need to recalculate couplings
1500  // MCFM masses
1501  if (ipartabs==6) { masses_mcfm_.twidth=inwidth; madMela::widths_.mdl_wt=inwidth; }
1502  else if (ipartabs==15) masses_mcfm_.tauwidth=inwidth;
1503  else if (ipartabs==23) { masses_mcfm_.zwidth=inwidth; madMela::widths_.mdl_wz=inwidth; }
1504  else if (ipartabs==24) { masses_mcfm_.wwidth=inwidth; madMela::widths_.mdl_ww=inwidth; }
1505  else if (ipartabs==25) { masses_mcfm_.hwidth=inwidth; madMela::widths_.mdl_wh=inwidth; }
1506 
1507  // JHUGen masses
1508  const double GeV=1./100.;
1509  double jinwidth = inwidth*GeV;
1510  int jpart = convertLHEreverse(&ipart);
1511  __modparameters_MOD_setdecaywidth(&jinwidth, &jpart);
1512 }

◆ SetEwkCouplingParameters()

void TUtil::SetEwkCouplingParameters ( double  ext_Gf,
double  ext_aemmz,
double  ext_mW,
double  ext_mZ,
double  ext_xW,
int  ext_ewscheme 
)

Definition at line 1388 of file TUtil.cc.

1388  {
1389  // Set JHUGen couplings
1390  const double GeV=1./100.;
1391  double ext_mZ_jhu = ext_mZ*GeV;
1392  double ext_mW_jhu = ext_mW*GeV;
1393  double ext_Gf_jhu = ext_Gf/pow(GeV, 2);
1394  __modjhugenmela_MOD_setewparameters(&ext_mZ_jhu, &ext_mW_jhu, &ext_Gf_jhu, &ext_aemmz, &ext_xW);
1395 
1396  // Set MCFM couplings
1397  if (ext_ewscheme<-1 || ext_ewscheme>3) ext_ewscheme=3;
1398  ewinput_.Gf_inp = ext_Gf;
1399  ewinput_.aemmz_inp = ext_aemmz;
1400  ewinput_.wmass_inp = ext_mW;
1401  ewinput_.zmass_inp = ext_mZ;
1402  ewinput_.xw_inp = ext_xW;
1403  ewscheme_.ewscheme = ext_ewscheme;
1404  coupling_();
1405 
1406  // SETTINGS TO MATCH JHUGen ME/generator:
1407  /*
1408  ewscheme_.ewscheme = 3; // Switch ewscheme to full control, default is 1
1409  ewinput_.Gf_inp=1.16639E-05;
1410  ewinput_.aemmz_inp=1./128.;
1411  ewinput_.wmass_inp=80.399;
1412  ewinput_.zmass_inp=91.1876;
1413  ewinput_.xw_inp=0.23119;
1414  */
1415 
1416  // Settings used in Run I MC, un-synchronized to JHUGen and Run II generation
1417  /*
1418  ewinput_.Gf_inp = 1.16639E-05;
1419  ewinput_.wmass_inp = 80.385;
1420  ewinput_.zmass_inp = 91.1876;
1421  //ewinput_.aemmz_inp = 7.81751e-3; // Not used in the compiled new default MCFM ewcheme=1
1422  //ewinput_.xw_inp = 0.23116864; // Not used in the compiled new default MCFM ewcheme=1
1423  ewinput_.aemmz_inp = 7.562468901984759e-3;
1424  ewinput_.xw_inp = 0.2228972225239183;
1425  */
1426 
1427  // INPUT SETTINGS in default MCFM generator:
1428  /*
1429  ewscheme_.ewscheme = 1;
1430  ewinput_.Gf_inp=1.16639E-05;
1431  ewinput_.wmass_inp=80.398;
1432  ewinput_.zmass_inp=91.1876;
1433  ewinput_.aemmz_inp=7.7585538055706e-3;
1434  ewinput_.xw_inp=0.2312;
1435  */
1436 
1437  // ACTUAL SETTINGS in default MCFM generator, gives the same values as above but is more explicit
1438  /*
1439  ewscheme_.ewscheme = 3;
1440  ewinput_.Gf_inp=1.16639E-05;
1441  ewinput_.wmass_inp=80.398;
1442  ewinput_.zmass_inp=91.1876;
1443  ewinput_.aemmz_inp=7.55638390728736e-3;
1444  ewinput_.xw_inp=0.22264585341299625;
1445  */
1446 }

◆ setJetMassScheme()

void TUtil::setJetMassScheme ( TVar::FermionMassRemoval  scheme = TVar::ConserveDifermionMass)

Definition at line 40 of file TUtil.cc.

40 { JetMassScheme=scheme; }

◆ SetJHUGenAZffCouplings()

void TUtil::SetJHUGenAZffCouplings ( bool  needAZff,
double  AZffcoupl[SIZE_AZff][2] 
)

Definition at line 4234 of file TUtil.cc.

4234  {
4236  if (needAZff) __modjhugenmela_MOD_setazffcouplings(AZffcoupl);
4237 }

◆ SetJHUGenDistinguishWWCouplings()

void TUtil::SetJHUGenDistinguishWWCouplings ( bool  doAllow)

Definition at line 3408 of file TUtil.cc.

3408  {
3409  int iAllow = (doAllow ? 1 : 0);
3411 }

◆ SetJHUGenHiggsMassWidth()

void TUtil::SetJHUGenHiggsMassWidth ( double  MReso,
double  GaReso 
)

Definition at line 3402 of file TUtil.cc.

3402  {
3403  const double GeV = 1./100.;
3404  MReso *= GeV; // GeV units in JHUGen
3405  GaReso *= GeV; // GeV units in JHUGen
3406  __modjhugenmela_MOD_sethiggsmasswidth(&MReso, &GaReso);
3407 }

◆ SetJHUGenSpinOneCouplings()

void TUtil::SetJHUGenSpinOneCouplings ( double  Zqqcoupl[SIZE_ZQQ][2],
double  Zvvcoupl[SIZE_ZVV][2] 
)

Definition at line 4227 of file TUtil.cc.

4227 { __modjhugenmela_MOD_setspinonecouplings(Zqqcoupl, Zvvcoupl); }

◆ SetJHUGenSpinTwoCouplings()

void TUtil::SetJHUGenSpinTwoCouplings ( double  Gacoupl[SIZE_GGG][2],
double  Gvvcoupl[SIZE_GVV][2],
double  Gvvpcoupl[SIZE_GVV][2],
double  Gvpvpcoupl[SIZE_GVV][2],
double  qLeftRightcoupl[SIZE_GQQ][2] 
)

Definition at line 4228 of file TUtil.cc.

4228  {
4229  __modjhugenmela_MOD_setspintwocouplings(Gacoupl, Gvvcoupl, Gvvpcoupl, Gvpvpcoupl, qLeftRightcoupl);
4230 }

◆ SetJHUGenSpinZeroGGCouplings()

void TUtil::SetJHUGenSpinZeroGGCouplings ( double  Hggcoupl[SIZE_HGG][2])

Definition at line 4225 of file TUtil.cc.

◆ SetJHUGenSpinZeroQQCouplings()

void TUtil::SetJHUGenSpinZeroQQCouplings ( double  Hqqcoupl[SIZE_HQQ][2])

Definition at line 4226 of file TUtil.cc.

◆ SetJHUGenSpinZeroVVCouplings()

void TUtil::SetJHUGenSpinZeroVVCouplings ( double  Hvvcoupl[SIZE_HVV][2],
double  Hvvpcoupl[SIZE_HVV][2],
double  Hvpvpcoupl[SIZE_HVV][2],
int  Hvvcoupl_cqsq[SIZE_HVV_CQSQ],
double  HvvLambda_qsq[SIZE_HVV_LAMBDAQSQ][SIZE_HVV_CQSQ],
bool  useWWcoupl 
)

Definition at line 4219 of file TUtil.cc.

4219  {
4220  const double GeV = 1./100.;
4221  int iWWcoupl = (useWWcoupl ? 1 : 0);
4222  for (int c=0; c<SIZE_HVV_LAMBDAQSQ; c++){ for (int k=0; k<SIZE_HVV_CQSQ; k++) HvvLambda_qsq[c][k] *= GeV; } // GeV units in JHUGen
4223  __modjhugenmela_MOD_setspinzerovvcouplings(Hvvcoupl, Hvvpcoupl, Hvpvpcoupl, Hvvcoupl_cqsq, HvvLambda_qsq, &iWWcoupl);
4224 }

◆ SetJHUGenVprimeContactCouplings()

void TUtil::SetJHUGenVprimeContactCouplings ( double  Zpffcoupl[SIZE_Vpff][2],
double  Wpffcoupl[SIZE_Vpff][2] 
)

Definition at line 4231 of file TUtil.cc.

4231  {
4232  __modjhugenmela_MOD_setvprimecontactcouplings(Zpffcoupl, Wpffcoupl);
4233 }

◆ setLeptonMassScheme()

void TUtil::setLeptonMassScheme ( TVar::FermionMassRemoval  scheme = TVar::ConserveDifermionMass)

Definition at line 39 of file TUtil.cc.

39 { LeptonMassScheme=scheme; }

◆ SetMadgraphCKMElements()

void TUtil::SetMadgraphCKMElements ( double  ckmlambda = 0.2265,
double  ckma = 0.79,
double  ckmrho = 0.141,
double  ckmeta = 0 
)

Definition at line 1531 of file TUtil.cc.

1531  {
1532  madMela::params_r_.mdl_ckmlambda = ckmlambda;
1533  madMela::params_r_.mdl_ckma = ckma;
1534  madMela::params_r_.mdl_ckmrho = ckmrho;
1535  madMela::params_r_.mdl_ckmeta = ckmeta;
1536 }

◆ SetMadgraphSpinZeroCouplings()

void TUtil::SetMadgraphSpinZeroCouplings ( SpinZeroCouplings const *  Hcouplings)

Definition at line 3415 of file TUtil.cc.

3415  {
3416  madMela::setDefaultMadgraphValues();//reset couplings
3417  madMela::params_r_.mdl_ch = Hcouplings->SMEFTSimcoupl[gMDL_ch];
3418  madMela::params_r_.mdl_chbox = Hcouplings->SMEFTSimcoupl[gMDL_chbox];
3419  madMela::params_r_.mdl_chdd = Hcouplings->SMEFTSimcoupl[gMDL_chdd];
3420  madMela::params_r_.mdl_chg = Hcouplings->SMEFTSimcoupl[gMDL_chg];
3421  madMela::params_r_.mdl_chw = Hcouplings->SMEFTSimcoupl[gMDL_chw];
3422  madMela::params_r_.mdl_chb = Hcouplings->SMEFTSimcoupl[gMDL_chb];
3423  madMela::params_r_.mdl_chwb = Hcouplings->SMEFTSimcoupl[gMDL_chwb];
3424  madMela::params_r_.mdl_cehre = Hcouplings->SMEFTSimcoupl[gMDL_cehre];
3425  madMela::params_r_.mdl_cuhre = Hcouplings->SMEFTSimcoupl[gMDL_cuhre];
3426  madMela::params_r_.mdl_cdhre = Hcouplings->SMEFTSimcoupl[gMDL_cdhre];
3427  madMela::params_r_.mdl_cewre = Hcouplings->SMEFTSimcoupl[gMDL_cewre];
3428  madMela::params_r_.mdl_cebre = Hcouplings->SMEFTSimcoupl[gMDL_cebre];
3429  madMela::params_r_.mdl_cugre = Hcouplings->SMEFTSimcoupl[gMDL_cugre];
3430  madMela::params_r_.mdl_cuwre = Hcouplings->SMEFTSimcoupl[gMDL_cuwre];
3431  madMela::params_r_.mdl_cubre = Hcouplings->SMEFTSimcoupl[gMDL_cubre];
3432  madMela::params_r_.mdl_cdgre = Hcouplings->SMEFTSimcoupl[gMDL_cdgre];
3433  madMela::params_r_.mdl_cdwre = Hcouplings->SMEFTSimcoupl[gMDL_cdwre];
3434  madMela::params_r_.mdl_cdbre = Hcouplings->SMEFTSimcoupl[gMDL_cdbre];
3435  madMela::params_r_.mdl_chl1 = Hcouplings->SMEFTSimcoupl[gMDL_chl1];
3436  madMela::params_r_.mdl_chl3 = Hcouplings->SMEFTSimcoupl[gMDL_chl3];
3437  madMela::params_r_.mdl_che = Hcouplings->SMEFTSimcoupl[gMDL_che];
3438  madMela::params_r_.mdl_chq1 = Hcouplings->SMEFTSimcoupl[gMDL_chq1];
3439  madMela::params_r_.mdl_chq3 = Hcouplings->SMEFTSimcoupl[gMDL_chq3];
3440  madMela::params_r_.mdl_chu = Hcouplings->SMEFTSimcoupl[gMDL_chu];
3441  madMela::params_r_.mdl_chd = Hcouplings->SMEFTSimcoupl[gMDL_chd];
3442  madMela::params_r_.mdl_chudre = Hcouplings->SMEFTSimcoupl[gMDL_chudre];
3443  madMela::params_r_.mdl_cll = Hcouplings->SMEFTSimcoupl[gMDL_cll];
3444  madMela::params_r_.mdl_cll1 = Hcouplings->SMEFTSimcoupl[gMDL_cll1];
3445  madMela::params_r_.mdl_cqq1 = Hcouplings->SMEFTSimcoupl[gMDL_cqq1];
3446  madMela::params_r_.mdl_cqq11 = Hcouplings->SMEFTSimcoupl[gMDL_cqq11];
3447  madMela::params_r_.mdl_cqq3 = Hcouplings->SMEFTSimcoupl[gMDL_cqq3];
3448  madMela::params_r_.mdl_cqq31 = Hcouplings->SMEFTSimcoupl[gMDL_cqq31];
3449  madMela::params_r_.mdl_clq1 = Hcouplings->SMEFTSimcoupl[gMDL_clq1];
3450  madMela::params_r_.mdl_clq3 = Hcouplings->SMEFTSimcoupl[gMDL_clq3];
3451  madMela::params_r_.mdl_cee = Hcouplings->SMEFTSimcoupl[gMDL_cee];
3452  madMela::params_r_.mdl_cuu = Hcouplings->SMEFTSimcoupl[gMDL_cuu];
3453  madMela::params_r_.mdl_cuu1 = Hcouplings->SMEFTSimcoupl[gMDL_cuu1];
3454  madMela::params_r_.mdl_cdd = Hcouplings->SMEFTSimcoupl[gMDL_cdd];
3455  madMela::params_r_.mdl_cdd1 = Hcouplings->SMEFTSimcoupl[gMDL_cdd1];
3456  madMela::params_r_.mdl_ceu = Hcouplings->SMEFTSimcoupl[gMDL_ceu];
3457  madMela::params_r_.mdl_ced = Hcouplings->SMEFTSimcoupl[gMDL_ced];
3458  madMela::params_r_.mdl_cud1 = Hcouplings->SMEFTSimcoupl[gMDL_cud1];
3459  madMela::params_r_.mdl_cud8 = Hcouplings->SMEFTSimcoupl[gMDL_cud8];
3460  madMela::params_r_.mdl_cle = Hcouplings->SMEFTSimcoupl[gMDL_cle];
3461  madMela::params_r_.mdl_clu = Hcouplings->SMEFTSimcoupl[gMDL_clu];
3462  madMela::params_r_.mdl_cld = Hcouplings->SMEFTSimcoupl[gMDL_cld];
3463  madMela::params_r_.mdl_cqe = Hcouplings->SMEFTSimcoupl[gMDL_cqe];
3464  madMela::params_r_.mdl_cqu1 = Hcouplings->SMEFTSimcoupl[gMDL_cqu1];
3465  madMela::params_r_.mdl_cqu8 = Hcouplings->SMEFTSimcoupl[gMDL_cqu8];
3466  madMela::params_r_.mdl_cqd1 = Hcouplings->SMEFTSimcoupl[gMDL_cqd1];
3467  madMela::params_r_.mdl_cqd8 = Hcouplings->SMEFTSimcoupl[gMDL_cqd8];
3468  madMela::params_r_.mdl_cledqre = Hcouplings->SMEFTSimcoupl[gMDL_cledqre];
3469  madMela::params_r_.mdl_cquqd1re = Hcouplings->SMEFTSimcoupl[gMDL_cquqd1re];
3470  madMela::params_r_.mdl_cquqd11re = Hcouplings->SMEFTSimcoupl[gMDL_cquqd11re];
3471  madMela::params_r_.mdl_cquqd8re = Hcouplings->SMEFTSimcoupl[gMDL_cquqd8re];
3472  madMela::params_r_.mdl_cquqd81re = Hcouplings->SMEFTSimcoupl[gMDL_cquqd81re];
3473  madMela::params_r_.mdl_clequ1re = Hcouplings->SMEFTSimcoupl[gMDL_clequ1re];
3474  madMela::params_r_.mdl_clequ3re = Hcouplings->SMEFTSimcoupl[gMDL_clequ3re];
3475  madMela::params_r_.mdl_cgtil = Hcouplings->SMEFTSimcoupl[gMDL_cgtil];
3476  madMela::params_r_.mdl_cwtil = Hcouplings->SMEFTSimcoupl[gMDL_cwtil];
3477  madMela::params_r_.mdl_chgtil = Hcouplings->SMEFTSimcoupl[gMDL_chgtil];
3478  madMela::params_r_.mdl_chwtil = Hcouplings->SMEFTSimcoupl[gMDL_chwtil];
3479  madMela::params_r_.mdl_chbtil = Hcouplings->SMEFTSimcoupl[gMDL_chbtil];
3480  madMela::params_r_.mdl_chwbtil = Hcouplings->SMEFTSimcoupl[gMDL_chwbtil];
3481  madMela::params_r_.mdl_cewim = Hcouplings->SMEFTSimcoupl[gMDL_cewim];
3482  madMela::params_r_.mdl_cebim = Hcouplings->SMEFTSimcoupl[gMDL_cebim];
3483  madMela::params_r_.mdl_cugim = Hcouplings->SMEFTSimcoupl[gMDL_cugim];
3484  madMela::params_r_.mdl_cuwim = Hcouplings->SMEFTSimcoupl[gMDL_cuwim];
3485  madMela::params_r_.mdl_cubim = Hcouplings->SMEFTSimcoupl[gMDL_cubim];
3486  madMela::params_r_.mdl_cdgim = Hcouplings->SMEFTSimcoupl[gMDL_cdgim];
3487  madMela::params_r_.mdl_cdwim = Hcouplings->SMEFTSimcoupl[gMDL_cdwim];
3488  madMela::params_r_.mdl_cdbim = Hcouplings->SMEFTSimcoupl[gMDL_cdbim];
3489  madMela::params_r_.mdl_chudim = Hcouplings->SMEFTSimcoupl[gMDL_chudim];
3490  madMela::params_r_.mdl_cehim = Hcouplings->SMEFTSimcoupl[gMDL_cehim];
3491  madMela::params_r_.mdl_cuhim = Hcouplings->SMEFTSimcoupl[gMDL_cuhim];
3492  madMela::params_r_.mdl_cdhim = Hcouplings->SMEFTSimcoupl[gMDL_cdhim];
3493  madMela::params_r_.mdl_cledqim = Hcouplings->SMEFTSimcoupl[gMDL_cledqim];
3494  madMela::params_r_.mdl_cquqd1im = Hcouplings->SMEFTSimcoupl[gMDL_cquqd1im];
3495  madMela::params_r_.mdl_cquqd8im = Hcouplings->SMEFTSimcoupl[gMDL_cquqd8im];
3496  madMela::params_r_.mdl_cquqd11im = Hcouplings->SMEFTSimcoupl[gMDL_cquqd11im];
3497  madMela::params_r_.mdl_cquqd81im = Hcouplings->SMEFTSimcoupl[gMDL_cquqd81im];
3498  madMela::params_r_.mdl_clequ1im = Hcouplings->SMEFTSimcoupl[gMDL_clequ1im];
3499  madMela::params_r_.mdl_clequ3im = Hcouplings->SMEFTSimcoupl[gMDL_clequ3im];
3500 }

◆ SetMass()

void TUtil::SetMass ( double  inmass,
int  ipart 
)

Definition at line 1447 of file TUtil.cc.

1447  {
1448  const int ipartabs = abs(ipart);
1449  bool runcoupling_mcfm=false;
1450  bool runcoupling_jhugen=false;
1451 
1452  // MCFM masses
1453  // Tprime and bprime masses are not defined in masses.f
1454  if (ipartabs==8) spinzerohiggs_anomcoupl_.mt_4gen = inmass;
1455  else if (ipartabs==7) spinzerohiggs_anomcoupl_.mb_4gen = inmass;
1456  else if (ipartabs==6){ masses_mcfm_.mt=inmass; runcoupling_mcfm=true; madMela::mad_masses_.mdl_mt=inmass; madMela::params_r_.mdl_ymt=inmass; }
1457  else if (ipartabs==5){ masses_mcfm_.mb=inmass; masses_mcfm_.mbsq = pow(masses_mcfm_.mb, 2); runcoupling_mcfm=true; madMela::mad_masses_.mdl_mb=inmass; madMela::params_r_.mdl_ymb=inmass; }
1458  else if (ipartabs==4){ masses_mcfm_.mc=inmass; masses_mcfm_.mcsq = pow(masses_mcfm_.mc, 2); runcoupling_mcfm=true; madMela::mad_masses_.mdl_mc=inmass; madMela::params_r_.mdl_ymc=inmass; }
1459  else if (ipartabs==3){ masses_mcfm_.ms=inmass; madMela::mad_masses_.mdl_ms=inmass; madMela::params_r_.mdl_yms=inmass; }
1460  else if (ipartabs==2){ masses_mcfm_.mu=inmass; madMela::mad_masses_.mdl_mu=inmass; madMela::params_r_.mdl_ymup=inmass; }
1461  else if (ipartabs==1){ masses_mcfm_.md=inmass; madMela::mad_masses_.mdl_md=inmass; madMela::params_r_.mdl_ymdo=inmass; }
1462  else if (ipartabs==11){ masses_mcfm_.mel=inmass; madMela::mad_masses_.mdl_me=inmass; madMela::params_r_.mdl_yme=inmass; }
1463  else if (ipartabs==13){ masses_mcfm_.mmu=inmass; madMela::mad_masses_.mdl_mmu=inmass; madMela::params_r_.mdl_ymm=inmass; }
1464  else if (ipartabs==15){ masses_mcfm_.mtau=inmass; masses_mcfm_.mtausq = pow(masses_mcfm_.mtau, 2); madMela::mad_masses_.mdl_mta=inmass; madMela::params_r_.mdl_ymtau=inmass; }
1465  else if (ipartabs==23){ masses_mcfm_.zmass=inmass; ewinput_.zmass_inp = inmass; runcoupling_mcfm=true; madMela::mad_masses_.mdl_mz=inmass; }
1466  else if (ipartabs==24){ masses_mcfm_.wmass=inmass; ewinput_.wmass_inp = inmass; runcoupling_mcfm=true; madMela::mad_masses_.mdl_mw=inmass; }
1467  else if (ipartabs==25){ masses_mcfm_.hmass=inmass; madMela::mad_masses_.mdl_mh=inmass; }
1468 
1469  // JHUGen masses
1470  if (
1471  ipartabs<=6
1472  ||
1473  (ipartabs>=11 && ipartabs<=16)
1474  ||
1475  ipartabs==23 || ipartabs==24 || ipartabs==25
1476  ||
1477  ipartabs==32 || ipartabs==34
1478  ){
1479  runcoupling_jhugen=(
1480  ipartabs==23
1481  ||
1482  ipartabs==24
1483  );
1484  const double GeV=1./100.;
1485  double jinmass = inmass*GeV;
1486  int jpart = convertLHEreverse(&ipart);
1487  __modparameters_MOD_setmass(&jinmass, &jpart);
1488  }
1489 
1490  // Recalculate couplings
1491  if (runcoupling_mcfm || runcoupling_jhugen){
1492  SetEwkCouplingParameters(ewcouple_.Gf, em_.aemmz, masses_mcfm_.wmass, masses_mcfm_.zmass, ewcouple_.xw, ewscheme_.ewscheme);
1493  madMela::params_r_.mdl_gf = ewcouple_.Gf;
1495  }
1496 }

◆ SetMCFMaTQGCCouplings()

void TUtil::SetMCFMaTQGCCouplings ( bool  useBSM,
aTQGCCouplings const *  couplings 
)

Definition at line 4134 of file TUtil.cc.

4134  {
4135  if (!useBSM){
4136  for (int im=0; im<2; im++){
4137  if (im==0){
4138  spinzerohiggs_anomcoupl_.dV_A[im] = 1;
4139  spinzerohiggs_anomcoupl_.dP_A[im] = 1;
4140  spinzerohiggs_anomcoupl_.dM_A[im] = 1;
4141 
4142  spinzerohiggs_anomcoupl_.dV_Z[im] = 1;
4143  spinzerohiggs_anomcoupl_.dP_Z[im] = 1;
4144  spinzerohiggs_anomcoupl_.dM_Z[im] = 1;
4145 
4146  spinzerohiggs_anomcoupl_.dZZWpWm[im] = 1;
4147  spinzerohiggs_anomcoupl_.dZAWpWm[im] = 1;
4148  spinzerohiggs_anomcoupl_.dAAWpWm[im] = 1;
4149  }
4150  else{
4151  spinzerohiggs_anomcoupl_.dV_A[im] = 0;
4152  spinzerohiggs_anomcoupl_.dP_A[im] = 0;
4153  spinzerohiggs_anomcoupl_.dM_A[im] = 0;
4154 
4155  spinzerohiggs_anomcoupl_.dV_Z[im] = 0;
4156  spinzerohiggs_anomcoupl_.dP_Z[im] = 0;
4157  spinzerohiggs_anomcoupl_.dM_Z[im] = 0;
4158 
4159  spinzerohiggs_anomcoupl_.dZZWpWm[im] = 0;
4160  spinzerohiggs_anomcoupl_.dZAWpWm[im] = 0;
4161  spinzerohiggs_anomcoupl_.dAAWpWm[im] = 0;
4162  }
4163  spinzerohiggs_anomcoupl_.dFour_A[im] = 0;
4164  spinzerohiggs_anomcoupl_.dFour_Z[im] = 0;
4165  }
4166  }
4167  else{
4168  for (int im=0; im<2; im++){
4169  spinzerohiggs_anomcoupl_.dV_A[im] = (couplings->aTQGCcoupl)[gATQGC_dVA][im];
4170  spinzerohiggs_anomcoupl_.dP_A[im] = (couplings->aTQGCcoupl)[gATQGC_dPA][im];
4171  spinzerohiggs_anomcoupl_.dM_A[im] = (couplings->aTQGCcoupl)[gATQGC_dMA][im];
4172  spinzerohiggs_anomcoupl_.dFour_A[im] = (couplings->aTQGCcoupl)[gATQGC_dFourA][im];
4173 
4174  spinzerohiggs_anomcoupl_.dV_Z[im] = (couplings->aTQGCcoupl)[gATQGC_dVZ][im];
4175  spinzerohiggs_anomcoupl_.dP_Z[im] = (couplings->aTQGCcoupl)[gATQGC_dPZ][im];
4176  spinzerohiggs_anomcoupl_.dM_Z[im] = (couplings->aTQGCcoupl)[gATQGC_dMZ][im];
4177  spinzerohiggs_anomcoupl_.dFour_Z[im] = (couplings->aTQGCcoupl)[gATQGC_dFourZ][im];
4178 
4179  spinzerohiggs_anomcoupl_.dAAWpWm[im] = (couplings->aTQGCcoupl)[gATQGC_dAAWpWm][im];
4180  spinzerohiggs_anomcoupl_.dZAWpWm[im] = (couplings->aTQGCcoupl)[gATQGC_dZAWpWm][im];
4181  spinzerohiggs_anomcoupl_.dZZWpWm[im] = (couplings->aTQGCcoupl)[gATQGC_dZZWpWm][im];
4182  }
4183  }
4184 }

◆ SetMCFMAZffCouplings()

void TUtil::SetMCFMAZffCouplings ( bool  useBSM,
AZffCouplings const *  Zcouplings 
)

Definition at line 4185 of file TUtil.cc.

4185  {
4186  if (useBSM){
4187  // BSM (all imaginary parts = 0 => unset, only setting the real parts)
4188  anomzffcouplings_.AllowAnomalousZffCouplings = 1;
4189  anomzffcouplings_.reZ = (Zcouplings->AZffcoupl)[gAZff_ZllRH][0];
4190  anomzffcouplings_.leZ = (Zcouplings->AZffcoupl)[gAZff_ZllLH][0];
4191  anomzffcouplings_.rquZ = (Zcouplings->AZffcoupl)[gAZff_ZuuRH][0];
4192  anomzffcouplings_.lquZ = (Zcouplings->AZffcoupl)[gAZff_ZuuLH][0];
4193  anomzffcouplings_.rqdZ = (Zcouplings->AZffcoupl)[gAZff_ZddRH][0];
4194  anomzffcouplings_.lqdZ = (Zcouplings->AZffcoupl)[gAZff_ZddLH][0];
4195  anomzffcouplings_.rnZ = (Zcouplings->AZffcoupl)[gAZff_ZnunuRH][0];
4196  anomzffcouplings_.lnZ = (Zcouplings->AZffcoupl)[gAZff_ZnunuLH][0];
4197  anomzffcouplings_.clanou = (Zcouplings->AZffcoupl)[gAZff_uZLH][0];
4198  anomzffcouplings_.cranou = (Zcouplings->AZffcoupl)[gAZff_uZRH][0];
4199  anomzffcouplings_.clanod = (Zcouplings->AZffcoupl)[gAZff_dZLH][0];
4200  anomzffcouplings_.cranod = (Zcouplings->AZffcoupl)[gAZff_dZRH][0];
4201  }
4202  else{
4203  // SM
4204  anomzffcouplings_.AllowAnomalousZffCouplings = 0;
4205  anomzffcouplings_.reZ = 0;
4206  anomzffcouplings_.leZ = 0;
4207  anomzffcouplings_.rquZ = 0;
4208  anomzffcouplings_.lquZ = 0;
4209  anomzffcouplings_.rqdZ = 0;
4210  anomzffcouplings_.lqdZ = 0;
4211  anomzffcouplings_.rnZ = 0;
4212  anomzffcouplings_.lnZ = 0;
4213  anomzffcouplings_.clanou = 0;
4214  anomzffcouplings_.cranou = 0;
4215  anomzffcouplings_.clanod = 0;
4216  anomzffcouplings_.cranod = 0;
4217  }
4218 }

◆ SetMCFMSpinZeroCouplings()

void TUtil::SetMCFMSpinZeroCouplings ( bool  useBSM,
SpinZeroCouplings const *  Hcouplings,
bool  forceZZ 
)

Definition at line 3501 of file TUtil.cc.

3501  {
3502  if (!useBSM){
3503  spinzerohiggs_anomcoupl_.AllowAnomalousCouplings = 0;
3504  spinzerohiggs_anomcoupl_.distinguish_HWWcouplings = 0;
3505 
3506  /***** REGULAR RESONANCE *****/
3507  //
3508  spinzerohiggs_anomcoupl_.cz_q1sq = 0;
3509  spinzerohiggs_anomcoupl_.Lambda_z11 = 100;
3510  spinzerohiggs_anomcoupl_.Lambda_z21 = 100;
3511  spinzerohiggs_anomcoupl_.Lambda_z31 = 100;
3512  spinzerohiggs_anomcoupl_.Lambda_z41 = 100;
3513  spinzerohiggs_anomcoupl_.cz_q2sq = 0;
3514  spinzerohiggs_anomcoupl_.Lambda_z12 = 100;
3515  spinzerohiggs_anomcoupl_.Lambda_z22 = 100;
3516  spinzerohiggs_anomcoupl_.Lambda_z32 = 100;
3517  spinzerohiggs_anomcoupl_.Lambda_z42 = 100;
3518  spinzerohiggs_anomcoupl_.cz_q12sq = 0;
3519  spinzerohiggs_anomcoupl_.Lambda_z10 = 100;
3520  spinzerohiggs_anomcoupl_.Lambda_z20 = 100;
3521  spinzerohiggs_anomcoupl_.Lambda_z30 = 100;
3522  spinzerohiggs_anomcoupl_.Lambda_z40 = 100;
3523  //
3524  spinzerohiggs_anomcoupl_.cw_q1sq = 0;
3525  spinzerohiggs_anomcoupl_.Lambda_w11 = 100;
3526  spinzerohiggs_anomcoupl_.Lambda_w21 = 100;
3527  spinzerohiggs_anomcoupl_.Lambda_w31 = 100;
3528  spinzerohiggs_anomcoupl_.Lambda_w41 = 100;
3529  spinzerohiggs_anomcoupl_.cw_q2sq = 0;
3530  spinzerohiggs_anomcoupl_.Lambda_w12 = 100;
3531  spinzerohiggs_anomcoupl_.Lambda_w22 = 100;
3532  spinzerohiggs_anomcoupl_.Lambda_w32 = 100;
3533  spinzerohiggs_anomcoupl_.Lambda_w42 = 100;
3534  spinzerohiggs_anomcoupl_.cw_q12sq = 0;
3535  spinzerohiggs_anomcoupl_.Lambda_w10 = 100;
3536  spinzerohiggs_anomcoupl_.Lambda_w20 = 100;
3537  spinzerohiggs_anomcoupl_.Lambda_w30 = 100;
3538  spinzerohiggs_anomcoupl_.Lambda_w40 = 100;
3539  //
3540  // Just in case, not really needed to set to the default value
3541  spinzerohiggs_anomcoupl_.kappa_top[0] = 1; spinzerohiggs_anomcoupl_.kappa_top[1] = 0;
3542  spinzerohiggs_anomcoupl_.kappa_bot[0] = 1; spinzerohiggs_anomcoupl_.kappa_bot[1] = 0;
3543  spinzerohiggs_anomcoupl_.ghz1[0] = 1; spinzerohiggs_anomcoupl_.ghz1[1] = 0;
3544  spinzerohiggs_anomcoupl_.ghw1[0] = 1; spinzerohiggs_anomcoupl_.ghw1[1] = 0;
3545  for (int im=0; im<2; im++){
3546  spinzerohiggs_anomcoupl_.kappa_tilde_top[im] = 0;
3547  spinzerohiggs_anomcoupl_.kappa_tilde_bot[im] = 0;
3548  spinzerohiggs_anomcoupl_.ghg2[im] = 0;
3549  spinzerohiggs_anomcoupl_.ghg3[im] = 0;
3550  spinzerohiggs_anomcoupl_.ghg4[im] = 0;
3551  spinzerohiggs_anomcoupl_.kappa_4gen_top[im] = 0;
3552  spinzerohiggs_anomcoupl_.kappa_4gen_bot[im] = 0;
3553  spinzerohiggs_anomcoupl_.kappa_tilde_4gen_top[im] = 0;
3554  spinzerohiggs_anomcoupl_.kappa_tilde_4gen_bot[im] = 0;
3555  spinzerohiggs_anomcoupl_.ghg2_4gen[im] = 0;
3556  spinzerohiggs_anomcoupl_.ghg3_4gen[im] = 0;
3557  spinzerohiggs_anomcoupl_.ghg4_4gen[im] = 0;
3558  //
3559  spinzerohiggs_anomcoupl_.ghz2[im] = 0;
3560  spinzerohiggs_anomcoupl_.ghz3[im] = 0;
3561  spinzerohiggs_anomcoupl_.ghz4[im] = 0;
3562  spinzerohiggs_anomcoupl_.ghz1_prime[im] = 0;
3563  spinzerohiggs_anomcoupl_.ghz1_prime2[im] = 0;
3564  spinzerohiggs_anomcoupl_.ghz1_prime3[im] = 0;
3565  spinzerohiggs_anomcoupl_.ghz1_prime4[im] = 0;
3566  spinzerohiggs_anomcoupl_.ghz1_prime5[im] = 0;
3567  spinzerohiggs_anomcoupl_.ghz1_prime6[im] = 0;
3568  spinzerohiggs_anomcoupl_.ghz1_prime7[im] = 0;
3569  spinzerohiggs_anomcoupl_.ghz2_prime[im] = 0;
3570  spinzerohiggs_anomcoupl_.ghz2_prime2[im] = 0;
3571  spinzerohiggs_anomcoupl_.ghz2_prime3[im] = 0;
3572  spinzerohiggs_anomcoupl_.ghz2_prime4[im] = 0;
3573  spinzerohiggs_anomcoupl_.ghz2_prime5[im] = 0;
3574  spinzerohiggs_anomcoupl_.ghz2_prime6[im] = 0;
3575  spinzerohiggs_anomcoupl_.ghz2_prime7[im] = 0;
3576  spinzerohiggs_anomcoupl_.ghz3_prime[im] = 0;
3577  spinzerohiggs_anomcoupl_.ghz3_prime2[im] = 0;
3578  spinzerohiggs_anomcoupl_.ghz3_prime3[im] = 0;
3579  spinzerohiggs_anomcoupl_.ghz3_prime4[im] = 0;
3580  spinzerohiggs_anomcoupl_.ghz3_prime5[im] = 0;
3581  spinzerohiggs_anomcoupl_.ghz3_prime6[im] = 0;
3582  spinzerohiggs_anomcoupl_.ghz3_prime7[im] = 0;
3583  spinzerohiggs_anomcoupl_.ghz4_prime[im] = 0;
3584  spinzerohiggs_anomcoupl_.ghz4_prime2[im] = 0;
3585  spinzerohiggs_anomcoupl_.ghz4_prime3[im] = 0;
3586  spinzerohiggs_anomcoupl_.ghz4_prime4[im] = 0;
3587  spinzerohiggs_anomcoupl_.ghz4_prime5[im] = 0;
3588  spinzerohiggs_anomcoupl_.ghz4_prime6[im] = 0;
3589  spinzerohiggs_anomcoupl_.ghz4_prime7[im] = 0;
3590  //
3591  spinzerohiggs_anomcoupl_.ghzgs1_prime2[im] = 0;
3592  spinzerohiggs_anomcoupl_.ghzgs2[im] = 0;
3593  spinzerohiggs_anomcoupl_.ghzgs3[im] = 0;
3594  spinzerohiggs_anomcoupl_.ghzgs4[im] = 0;
3595  spinzerohiggs_anomcoupl_.ghgsgs2[im] = 0;
3596  spinzerohiggs_anomcoupl_.ghgsgs3[im] = 0;
3597  spinzerohiggs_anomcoupl_.ghgsgs4[im] = 0;
3598  //
3599  spinzerohiggs_anomcoupl_.ghw2[im] = 0;
3600  spinzerohiggs_anomcoupl_.ghw3[im] = 0;
3601  spinzerohiggs_anomcoupl_.ghw4[im] = 0;
3602  spinzerohiggs_anomcoupl_.ghw1_prime[im] = 0;
3603  spinzerohiggs_anomcoupl_.ghw1_prime2[im] = 0;
3604  spinzerohiggs_anomcoupl_.ghw1_prime3[im] = 0;
3605  spinzerohiggs_anomcoupl_.ghw1_prime4[im] = 0;
3606  spinzerohiggs_anomcoupl_.ghw1_prime5[im] = 0;
3607  spinzerohiggs_anomcoupl_.ghw1_prime6[im] = 0;
3608  spinzerohiggs_anomcoupl_.ghw1_prime7[im] = 0;
3609  spinzerohiggs_anomcoupl_.ghw2_prime[im] = 0;
3610  spinzerohiggs_anomcoupl_.ghw2_prime2[im] = 0;
3611  spinzerohiggs_anomcoupl_.ghw2_prime3[im] = 0;
3612  spinzerohiggs_anomcoupl_.ghw2_prime4[im] = 0;
3613  spinzerohiggs_anomcoupl_.ghw2_prime5[im] = 0;
3614  spinzerohiggs_anomcoupl_.ghw2_prime6[im] = 0;
3615  spinzerohiggs_anomcoupl_.ghw2_prime7[im] = 0;
3616  spinzerohiggs_anomcoupl_.ghw3_prime[im] = 0;
3617  spinzerohiggs_anomcoupl_.ghw3_prime2[im] = 0;
3618  spinzerohiggs_anomcoupl_.ghw3_prime3[im] = 0;
3619  spinzerohiggs_anomcoupl_.ghw3_prime4[im] = 0;
3620  spinzerohiggs_anomcoupl_.ghw3_prime5[im] = 0;
3621  spinzerohiggs_anomcoupl_.ghw3_prime6[im] = 0;
3622  spinzerohiggs_anomcoupl_.ghw3_prime7[im] = 0;
3623  spinzerohiggs_anomcoupl_.ghw4_prime[im] = 0;
3624  spinzerohiggs_anomcoupl_.ghw4_prime2[im] = 0;
3625  spinzerohiggs_anomcoupl_.ghw4_prime3[im] = 0;
3626  spinzerohiggs_anomcoupl_.ghw4_prime4[im] = 0;
3627  spinzerohiggs_anomcoupl_.ghw4_prime5[im] = 0;
3628  spinzerohiggs_anomcoupl_.ghw4_prime6[im] = 0;
3629  spinzerohiggs_anomcoupl_.ghw4_prime7[im] = 0;
3630 
3631  }
3632  /***** END REGULAR RESONANCE *****/
3633  //
3634  /***** SECOND RESONANCE *****/
3635  //
3636  spinzerohiggs_anomcoupl_.c2z_q1sq = 0;
3637  spinzerohiggs_anomcoupl_.Lambda2_z11 = 100;
3638  spinzerohiggs_anomcoupl_.Lambda2_z21 = 100;
3639  spinzerohiggs_anomcoupl_.Lambda2_z31 = 100;
3640  spinzerohiggs_anomcoupl_.Lambda2_z41 = 100;
3641  spinzerohiggs_anomcoupl_.c2z_q2sq = 0;
3642  spinzerohiggs_anomcoupl_.Lambda2_z12 = 100;
3643  spinzerohiggs_anomcoupl_.Lambda2_z22 = 100;
3644  spinzerohiggs_anomcoupl_.Lambda2_z32 = 100;
3645  spinzerohiggs_anomcoupl_.Lambda2_z42 = 100;
3646  spinzerohiggs_anomcoupl_.c2z_q12sq = 0;
3647  spinzerohiggs_anomcoupl_.Lambda2_z10 = 100;
3648  spinzerohiggs_anomcoupl_.Lambda2_z20 = 100;
3649  spinzerohiggs_anomcoupl_.Lambda2_z30 = 100;
3650  spinzerohiggs_anomcoupl_.Lambda2_z40 = 100;
3651  //
3652  spinzerohiggs_anomcoupl_.c2w_q1sq = 0;
3653  spinzerohiggs_anomcoupl_.Lambda2_w11 = 100;
3654  spinzerohiggs_anomcoupl_.Lambda2_w21 = 100;
3655  spinzerohiggs_anomcoupl_.Lambda2_w31 = 100;
3656  spinzerohiggs_anomcoupl_.Lambda2_w41 = 100;
3657  spinzerohiggs_anomcoupl_.c2w_q2sq = 0;
3658  spinzerohiggs_anomcoupl_.Lambda2_w12 = 100;
3659  spinzerohiggs_anomcoupl_.Lambda2_w22 = 100;
3660  spinzerohiggs_anomcoupl_.Lambda2_w32 = 100;
3661  spinzerohiggs_anomcoupl_.Lambda2_w42 = 100;
3662  spinzerohiggs_anomcoupl_.c2w_q12sq = 0;
3663  spinzerohiggs_anomcoupl_.Lambda2_w10 = 100;
3664  spinzerohiggs_anomcoupl_.Lambda2_w20 = 100;
3665  spinzerohiggs_anomcoupl_.Lambda2_w30 = 100;
3666  spinzerohiggs_anomcoupl_.Lambda2_w40 = 100;
3667  //
3668  // AllowAnomalousCouplings==0, so these are still treated as 1 when h2mass>=0
3669  spinzerohiggs_anomcoupl_.kappa2_top[0] = 0; spinzerohiggs_anomcoupl_.kappa2_top[1] = 0;
3670  spinzerohiggs_anomcoupl_.kappa2_bot[0] = 0; spinzerohiggs_anomcoupl_.kappa2_bot[1] = 0;
3671  spinzerohiggs_anomcoupl_.gh2z1[0] = 0; spinzerohiggs_anomcoupl_.gh2z1[1] = 0;
3672  spinzerohiggs_anomcoupl_.gh2w1[0] = 0; spinzerohiggs_anomcoupl_.gh2w1[1] = 0;
3673  for (int im=0; im<2; im++){
3674  spinzerohiggs_anomcoupl_.kappa2_tilde_top[im] = 0;
3675  spinzerohiggs_anomcoupl_.kappa2_tilde_bot[im] = 0;
3676  spinzerohiggs_anomcoupl_.gh2g2[im] = 0;
3677  spinzerohiggs_anomcoupl_.gh2g3[im] = 0;
3678  spinzerohiggs_anomcoupl_.gh2g4[im] = 0;
3679  spinzerohiggs_anomcoupl_.kappa2_4gen_top[im] = 0;
3680  spinzerohiggs_anomcoupl_.kappa2_4gen_bot[im] = 0;
3681  spinzerohiggs_anomcoupl_.kappa2_tilde_4gen_top[im] = 0;
3682  spinzerohiggs_anomcoupl_.kappa2_tilde_4gen_bot[im] = 0;
3683  spinzerohiggs_anomcoupl_.gh2g2_4gen[im] = 0;
3684  spinzerohiggs_anomcoupl_.gh2g3_4gen[im] = 0;
3685  spinzerohiggs_anomcoupl_.gh2g4_4gen[im] = 0;
3686  //
3687  spinzerohiggs_anomcoupl_.gh2z2[im] = 0;
3688  spinzerohiggs_anomcoupl_.gh2z3[im] = 0;
3689  spinzerohiggs_anomcoupl_.gh2z4[im] = 0;
3690  spinzerohiggs_anomcoupl_.gh2z1_prime[im] = 0;
3691  spinzerohiggs_anomcoupl_.gh2z1_prime2[im] = 0;
3692  spinzerohiggs_anomcoupl_.gh2z1_prime3[im] = 0;
3693  spinzerohiggs_anomcoupl_.gh2z1_prime4[im] = 0;
3694  spinzerohiggs_anomcoupl_.gh2z1_prime5[im] = 0;
3695  spinzerohiggs_anomcoupl_.gh2z1_prime6[im] = 0;
3696  spinzerohiggs_anomcoupl_.gh2z1_prime7[im] = 0;
3697  spinzerohiggs_anomcoupl_.gh2z2_prime[im] = 0;
3698  spinzerohiggs_anomcoupl_.gh2z2_prime2[im] = 0;
3699  spinzerohiggs_anomcoupl_.gh2z2_prime3[im] = 0;
3700  spinzerohiggs_anomcoupl_.gh2z2_prime4[im] = 0;
3701  spinzerohiggs_anomcoupl_.gh2z2_prime5[im] = 0;
3702  spinzerohiggs_anomcoupl_.gh2z2_prime6[im] = 0;
3703  spinzerohiggs_anomcoupl_.gh2z2_prime7[im] = 0;
3704  spinzerohiggs_anomcoupl_.gh2z3_prime[im] = 0;
3705  spinzerohiggs_anomcoupl_.gh2z3_prime2[im] = 0;
3706  spinzerohiggs_anomcoupl_.gh2z3_prime3[im] = 0;
3707  spinzerohiggs_anomcoupl_.gh2z3_prime4[im] = 0;
3708  spinzerohiggs_anomcoupl_.gh2z3_prime5[im] = 0;
3709  spinzerohiggs_anomcoupl_.gh2z3_prime6[im] = 0;
3710  spinzerohiggs_anomcoupl_.gh2z3_prime7[im] = 0;
3711  spinzerohiggs_anomcoupl_.gh2z4_prime[im] = 0;
3712  spinzerohiggs_anomcoupl_.gh2z4_prime2[im] = 0;
3713  spinzerohiggs_anomcoupl_.gh2z4_prime3[im] = 0;
3714  spinzerohiggs_anomcoupl_.gh2z4_prime4[im] = 0;
3715  spinzerohiggs_anomcoupl_.gh2z4_prime5[im] = 0;
3716  spinzerohiggs_anomcoupl_.gh2z4_prime6[im] = 0;
3717  spinzerohiggs_anomcoupl_.gh2z4_prime7[im] = 0;
3718  //
3719  spinzerohiggs_anomcoupl_.gh2zgs1_prime2[im] = 0;
3720  spinzerohiggs_anomcoupl_.gh2zgs2[im] = 0;
3721  spinzerohiggs_anomcoupl_.gh2zgs3[im] = 0;
3722  spinzerohiggs_anomcoupl_.gh2zgs4[im] = 0;
3723  spinzerohiggs_anomcoupl_.gh2gsgs2[im] = 0;
3724  spinzerohiggs_anomcoupl_.gh2gsgs3[im] = 0;
3725  spinzerohiggs_anomcoupl_.gh2gsgs4[im] = 0;
3726  //
3727  spinzerohiggs_anomcoupl_.gh2w2[im] = 0;
3728  spinzerohiggs_anomcoupl_.gh2w3[im] = 0;
3729  spinzerohiggs_anomcoupl_.gh2w4[im] = 0;
3730  spinzerohiggs_anomcoupl_.gh2w1_prime[im] = 0;
3731  spinzerohiggs_anomcoupl_.gh2w1_prime2[im] = 0;
3732  spinzerohiggs_anomcoupl_.gh2w1_prime3[im] = 0;
3733  spinzerohiggs_anomcoupl_.gh2w1_prime4[im] = 0;
3734  spinzerohiggs_anomcoupl_.gh2w1_prime5[im] = 0;
3735  spinzerohiggs_anomcoupl_.gh2w1_prime6[im] = 0;
3736  spinzerohiggs_anomcoupl_.gh2w1_prime7[im] = 0;
3737  spinzerohiggs_anomcoupl_.gh2w2_prime[im] = 0;
3738  spinzerohiggs_anomcoupl_.gh2w2_prime2[im] = 0;
3739  spinzerohiggs_anomcoupl_.gh2w2_prime3[im] = 0;
3740  spinzerohiggs_anomcoupl_.gh2w2_prime4[im] = 0;
3741  spinzerohiggs_anomcoupl_.gh2w2_prime5[im] = 0;
3742  spinzerohiggs_anomcoupl_.gh2w2_prime6[im] = 0;
3743  spinzerohiggs_anomcoupl_.gh2w2_prime7[im] = 0;
3744  spinzerohiggs_anomcoupl_.gh2w3_prime[im] = 0;
3745  spinzerohiggs_anomcoupl_.gh2w3_prime2[im] = 0;
3746  spinzerohiggs_anomcoupl_.gh2w3_prime3[im] = 0;
3747  spinzerohiggs_anomcoupl_.gh2w3_prime4[im] = 0;
3748  spinzerohiggs_anomcoupl_.gh2w3_prime5[im] = 0;
3749  spinzerohiggs_anomcoupl_.gh2w3_prime6[im] = 0;
3750  spinzerohiggs_anomcoupl_.gh2w3_prime7[im] = 0;
3751  spinzerohiggs_anomcoupl_.gh2w4_prime[im] = 0;
3752  spinzerohiggs_anomcoupl_.gh2w4_prime2[im] = 0;
3753  spinzerohiggs_anomcoupl_.gh2w4_prime3[im] = 0;
3754  spinzerohiggs_anomcoupl_.gh2w4_prime4[im] = 0;
3755  spinzerohiggs_anomcoupl_.gh2w4_prime5[im] = 0;
3756  spinzerohiggs_anomcoupl_.gh2w4_prime6[im] = 0;
3757  spinzerohiggs_anomcoupl_.gh2w4_prime7[im] = 0;
3758  }
3759  /***** END SECOND RESONANCE *****/
3760  }
3761  else{
3762  spinzerohiggs_anomcoupl_.AllowAnomalousCouplings = 1;
3763  spinzerohiggs_anomcoupl_.distinguish_HWWcouplings = ((Hcouplings->separateWWZZcouplings && !forceZZ) ? 1 : 0);
3764 
3765  /***** REGULAR RESONANCE *****/
3766  //
3767  spinzerohiggs_anomcoupl_.cz_q1sq = (Hcouplings->HzzCLambda_qsq)[cLambdaHIGGS_VV_QSQ1];
3768  spinzerohiggs_anomcoupl_.Lambda_z11 = (Hcouplings->HzzLambda_qsq)[LambdaHIGGS_QSQ_VV_1][cLambdaHIGGS_VV_QSQ1];
3769  spinzerohiggs_anomcoupl_.Lambda_z21 = (Hcouplings->HzzLambda_qsq)[LambdaHIGGS_QSQ_VV_2][cLambdaHIGGS_VV_QSQ1];
3770  spinzerohiggs_anomcoupl_.Lambda_z31 = (Hcouplings->HzzLambda_qsq)[LambdaHIGGS_QSQ_VV_3][cLambdaHIGGS_VV_QSQ1];
3771  spinzerohiggs_anomcoupl_.Lambda_z41 = (Hcouplings->HzzLambda_qsq)[LambdaHIGGS_QSQ_VV_4][cLambdaHIGGS_VV_QSQ1];
3772  spinzerohiggs_anomcoupl_.cz_q2sq = (Hcouplings->HzzCLambda_qsq)[cLambdaHIGGS_VV_QSQ2];
3773  spinzerohiggs_anomcoupl_.Lambda_z12 = (Hcouplings->HzzLambda_qsq)[LambdaHIGGS_QSQ_VV_1][cLambdaHIGGS_VV_QSQ2];
3774  spinzerohiggs_anomcoupl_.Lambda_z22 = (Hcouplings->HzzLambda_qsq)[LambdaHIGGS_QSQ_VV_2][cLambdaHIGGS_VV_QSQ2];
3775  spinzerohiggs_anomcoupl_.Lambda_z32 = (Hcouplings->HzzLambda_qsq)[LambdaHIGGS_QSQ_VV_3][cLambdaHIGGS_VV_QSQ2];
3776  spinzerohiggs_anomcoupl_.Lambda_z42 = (Hcouplings->HzzLambda_qsq)[LambdaHIGGS_QSQ_VV_4][cLambdaHIGGS_VV_QSQ2];
3777  spinzerohiggs_anomcoupl_.cz_q12sq = (Hcouplings->HzzCLambda_qsq)[cLambdaHIGGS_VV_QSQ12];
3778  spinzerohiggs_anomcoupl_.Lambda_z10 = (Hcouplings->HzzLambda_qsq)[LambdaHIGGS_QSQ_VV_1][cLambdaHIGGS_VV_QSQ12];
3779  spinzerohiggs_anomcoupl_.Lambda_z20 = (Hcouplings->HzzLambda_qsq)[LambdaHIGGS_QSQ_VV_2][cLambdaHIGGS_VV_QSQ12];
3780  spinzerohiggs_anomcoupl_.Lambda_z30 = (Hcouplings->HzzLambda_qsq)[LambdaHIGGS_QSQ_VV_3][cLambdaHIGGS_VV_QSQ12];
3781  spinzerohiggs_anomcoupl_.Lambda_z40 = (Hcouplings->HzzLambda_qsq)[LambdaHIGGS_QSQ_VV_4][cLambdaHIGGS_VV_QSQ12];
3782  //
3783  for (int im=0; im<2; im++){
3784  spinzerohiggs_anomcoupl_.kappa_top[im] = (Hcouplings->Httcoupl)[gHIGGS_KAPPA][im];
3785  spinzerohiggs_anomcoupl_.kappa_bot[im] = (Hcouplings->Hbbcoupl)[gHIGGS_KAPPA][im];
3786  spinzerohiggs_anomcoupl_.kappa_tilde_top[im] = (Hcouplings->Httcoupl)[gHIGGS_KAPPA_TILDE][im];
3787  spinzerohiggs_anomcoupl_.kappa_tilde_bot[im] = (Hcouplings->Hbbcoupl)[gHIGGS_KAPPA_TILDE][im];
3788  spinzerohiggs_anomcoupl_.ghg2[im] = (Hcouplings->Hggcoupl)[gHIGGS_GG_2][im];
3789  spinzerohiggs_anomcoupl_.ghg3[im] = (Hcouplings->Hggcoupl)[gHIGGS_GG_3][im];
3790  spinzerohiggs_anomcoupl_.ghg4[im] = (Hcouplings->Hggcoupl)[gHIGGS_GG_4][im];
3791  spinzerohiggs_anomcoupl_.kappa_4gen_top[im] = (Hcouplings->Ht4t4coupl)[gHIGGS_KAPPA][im];
3792  spinzerohiggs_anomcoupl_.kappa_4gen_bot[im] = (Hcouplings->Hb4b4coupl)[gHIGGS_KAPPA][im];
3793  spinzerohiggs_anomcoupl_.kappa_tilde_4gen_top[im] = (Hcouplings->Ht4t4coupl)[gHIGGS_KAPPA_TILDE][im];
3794  spinzerohiggs_anomcoupl_.kappa_tilde_4gen_bot[im] = (Hcouplings->Hb4b4coupl)[gHIGGS_KAPPA_TILDE][im];
3795  spinzerohiggs_anomcoupl_.ghg2_4gen[im] = (Hcouplings->Hg4g4coupl)[gHIGGS_GG_2][im];
3796  spinzerohiggs_anomcoupl_.ghg3_4gen[im] = (Hcouplings->Hg4g4coupl)[gHIGGS_GG_3][im];
3797  spinzerohiggs_anomcoupl_.ghg4_4gen[im] = (Hcouplings->Hg4g4coupl)[gHIGGS_GG_4][im];
3798  //
3799  spinzerohiggs_anomcoupl_.ghz1[im] = (Hcouplings->Hzzcoupl)[gHIGGS_VV_1][im];
3800  spinzerohiggs_anomcoupl_.ghz2[im] = (Hcouplings->Hzzcoupl)[gHIGGS_VV_2][im];
3801  spinzerohiggs_anomcoupl_.ghz3[im] = (Hcouplings->Hzzcoupl)[gHIGGS_VV_3][im];
3802  spinzerohiggs_anomcoupl_.ghz4[im] = (Hcouplings->Hzzcoupl)[gHIGGS_VV_4][im];
3803  spinzerohiggs_anomcoupl_.ghz1_prime[im] = (Hcouplings->Hzzcoupl)[gHIGGS_VV_1_PRIME][im];
3804  spinzerohiggs_anomcoupl_.ghz1_prime2[im] = (Hcouplings->Hzzcoupl)[gHIGGS_VV_1_PRIME2][im];
3805  spinzerohiggs_anomcoupl_.ghz1_prime3[im] = (Hcouplings->Hzzcoupl)[gHIGGS_VV_1_PRIME3][im];
3806  spinzerohiggs_anomcoupl_.ghz1_prime4[im] = (Hcouplings->Hzzcoupl)[gHIGGS_VV_1_PRIME4][im];
3807  spinzerohiggs_anomcoupl_.ghz1_prime5[im] = (Hcouplings->Hzzcoupl)[gHIGGS_VV_1_PRIME5][im];
3808  spinzerohiggs_anomcoupl_.ghz1_prime6[im] = (Hcouplings->Hzzcoupl)[gHIGGS_VV_1_PRIME6][im];
3809  spinzerohiggs_anomcoupl_.ghz1_prime7[im] = (Hcouplings->Hzzcoupl)[gHIGGS_VV_1_PRIME7][im];
3810  spinzerohiggs_anomcoupl_.ghz2_prime[im] = (Hcouplings->Hzzcoupl)[gHIGGS_VV_2_PRIME][im];
3811  spinzerohiggs_anomcoupl_.ghz2_prime2[im] = (Hcouplings->Hzzcoupl)[gHIGGS_VV_2_PRIME2][im];
3812  spinzerohiggs_anomcoupl_.ghz2_prime3[im] = (Hcouplings->Hzzcoupl)[gHIGGS_VV_2_PRIME3][im];
3813  spinzerohiggs_anomcoupl_.ghz2_prime4[im] = (Hcouplings->Hzzcoupl)[gHIGGS_VV_2_PRIME4][im];
3814  spinzerohiggs_anomcoupl_.ghz2_prime5[im] = (Hcouplings->Hzzcoupl)[gHIGGS_VV_2_PRIME5][im];
3815  spinzerohiggs_anomcoupl_.ghz2_prime6[im] = (Hcouplings->Hzzcoupl)[gHIGGS_VV_2_PRIME6][im];
3816  spinzerohiggs_anomcoupl_.ghz2_prime7[im] = (Hcouplings->Hzzcoupl)[gHIGGS_VV_2_PRIME7][im];
3817  spinzerohiggs_anomcoupl_.ghz3_prime[im] = (Hcouplings->Hzzcoupl)[gHIGGS_VV_3_PRIME][im];
3818  spinzerohiggs_anomcoupl_.ghz3_prime2[im] = (Hcouplings->Hzzcoupl)[gHIGGS_VV_3_PRIME2][im];
3819  spinzerohiggs_anomcoupl_.ghz3_prime3[im] = (Hcouplings->Hzzcoupl)[gHIGGS_VV_3_PRIME3][im];
3820  spinzerohiggs_anomcoupl_.ghz3_prime4[im] = (Hcouplings->Hzzcoupl)[gHIGGS_VV_3_PRIME4][im];
3821  spinzerohiggs_anomcoupl_.ghz3_prime5[im] = (Hcouplings->Hzzcoupl)[gHIGGS_VV_3_PRIME5][im];
3822  spinzerohiggs_anomcoupl_.ghz3_prime6[im] = (Hcouplings->Hzzcoupl)[gHIGGS_VV_3_PRIME6][im];
3823  spinzerohiggs_anomcoupl_.ghz3_prime7[im] = (Hcouplings->Hzzcoupl)[gHIGGS_VV_3_PRIME7][im];
3824  spinzerohiggs_anomcoupl_.ghz4_prime[im] = (Hcouplings->Hzzcoupl)[gHIGGS_VV_4_PRIME][im];
3825  spinzerohiggs_anomcoupl_.ghz4_prime2[im] = (Hcouplings->Hzzcoupl)[gHIGGS_VV_4_PRIME2][im];
3826  spinzerohiggs_anomcoupl_.ghz4_prime3[im] = (Hcouplings->Hzzcoupl)[gHIGGS_VV_4_PRIME3][im];
3827  spinzerohiggs_anomcoupl_.ghz4_prime4[im] = (Hcouplings->Hzzcoupl)[gHIGGS_VV_4_PRIME4][im];
3828  spinzerohiggs_anomcoupl_.ghz4_prime5[im] = (Hcouplings->Hzzcoupl)[gHIGGS_VV_4_PRIME5][im];
3829  spinzerohiggs_anomcoupl_.ghz4_prime6[im] = (Hcouplings->Hzzcoupl)[gHIGGS_VV_4_PRIME6][im];
3830  spinzerohiggs_anomcoupl_.ghz4_prime7[im] = (Hcouplings->Hzzcoupl)[gHIGGS_VV_4_PRIME7][im];
3831  //
3832  spinzerohiggs_anomcoupl_.ghzgs1_prime2[im] = (Hcouplings->Hzzcoupl)[gHIGGS_ZA_1_PRIME2][im];
3833  spinzerohiggs_anomcoupl_.ghzgs2[im] = (Hcouplings->Hzzcoupl)[gHIGGS_ZA_2][im];
3834  spinzerohiggs_anomcoupl_.ghzgs3[im] = (Hcouplings->Hzzcoupl)[gHIGGS_ZA_3][im];
3835  spinzerohiggs_anomcoupl_.ghzgs4[im] = (Hcouplings->Hzzcoupl)[gHIGGS_ZA_4][im];
3836  spinzerohiggs_anomcoupl_.ghgsgs2[im] = (Hcouplings->Hzzcoupl)[gHIGGS_AA_2][im];
3837  spinzerohiggs_anomcoupl_.ghgsgs3[im] = (Hcouplings->Hzzcoupl)[gHIGGS_AA_3][im];
3838  spinzerohiggs_anomcoupl_.ghgsgs4[im] = (Hcouplings->Hzzcoupl)[gHIGGS_AA_4][im];
3839  }
3840  //
3841  if (spinzerohiggs_anomcoupl_.distinguish_HWWcouplings==1){
3842  //
3843  spinzerohiggs_anomcoupl_.cw_q1sq = (Hcouplings->HwwCLambda_qsq)[cLambdaHIGGS_VV_QSQ1];
3844  spinzerohiggs_anomcoupl_.Lambda_w11 = (Hcouplings->HwwLambda_qsq)[LambdaHIGGS_QSQ_VV_1][cLambdaHIGGS_VV_QSQ1];
3845  spinzerohiggs_anomcoupl_.Lambda_w21 = (Hcouplings->HwwLambda_qsq)[LambdaHIGGS_QSQ_VV_2][cLambdaHIGGS_VV_QSQ1];
3846  spinzerohiggs_anomcoupl_.Lambda_w31 = (Hcouplings->HwwLambda_qsq)[LambdaHIGGS_QSQ_VV_3][cLambdaHIGGS_VV_QSQ1];
3847  spinzerohiggs_anomcoupl_.Lambda_w41 = (Hcouplings->HwwLambda_qsq)[LambdaHIGGS_QSQ_VV_4][cLambdaHIGGS_VV_QSQ1];
3848  spinzerohiggs_anomcoupl_.cw_q2sq = (Hcouplings->HwwCLambda_qsq)[cLambdaHIGGS_VV_QSQ2];
3849  spinzerohiggs_anomcoupl_.Lambda_w12 = (Hcouplings->HwwLambda_qsq)[LambdaHIGGS_QSQ_VV_1][cLambdaHIGGS_VV_QSQ2];
3850  spinzerohiggs_anomcoupl_.Lambda_w22 = (Hcouplings->HwwLambda_qsq)[LambdaHIGGS_QSQ_VV_2][cLambdaHIGGS_VV_QSQ2];
3851  spinzerohiggs_anomcoupl_.Lambda_w32 = (Hcouplings->HwwLambda_qsq)[LambdaHIGGS_QSQ_VV_3][cLambdaHIGGS_VV_QSQ2];
3852  spinzerohiggs_anomcoupl_.Lambda_w42 = (Hcouplings->HwwLambda_qsq)[LambdaHIGGS_QSQ_VV_4][cLambdaHIGGS_VV_QSQ2];
3853  spinzerohiggs_anomcoupl_.cw_q12sq = (Hcouplings->HwwCLambda_qsq)[cLambdaHIGGS_VV_QSQ12];
3854  spinzerohiggs_anomcoupl_.Lambda_w10 = (Hcouplings->HwwLambda_qsq)[LambdaHIGGS_QSQ_VV_1][cLambdaHIGGS_VV_QSQ12];
3855  spinzerohiggs_anomcoupl_.Lambda_w20 = (Hcouplings->HwwLambda_qsq)[LambdaHIGGS_QSQ_VV_2][cLambdaHIGGS_VV_QSQ12];
3856  spinzerohiggs_anomcoupl_.Lambda_w30 = (Hcouplings->HwwLambda_qsq)[LambdaHIGGS_QSQ_VV_3][cLambdaHIGGS_VV_QSQ12];
3857  spinzerohiggs_anomcoupl_.Lambda_w40 = (Hcouplings->HwwLambda_qsq)[LambdaHIGGS_QSQ_VV_4][cLambdaHIGGS_VV_QSQ12];
3858  //
3859  for (int im=0; im<2; im++){
3860  spinzerohiggs_anomcoupl_.ghw1[im] = (Hcouplings->Hwwcoupl)[gHIGGS_VV_1][im];
3861  spinzerohiggs_anomcoupl_.ghw2[im] = (Hcouplings->Hwwcoupl)[gHIGGS_VV_2][im];
3862  spinzerohiggs_anomcoupl_.ghw3[im] = (Hcouplings->Hwwcoupl)[gHIGGS_VV_3][im];
3863  spinzerohiggs_anomcoupl_.ghw4[im] = (Hcouplings->Hwwcoupl)[gHIGGS_VV_4][im];
3864  spinzerohiggs_anomcoupl_.ghw1_prime[im] = (Hcouplings->Hwwcoupl)[gHIGGS_VV_1_PRIME][im];
3865  spinzerohiggs_anomcoupl_.ghw1_prime2[im] = (Hcouplings->Hwwcoupl)[gHIGGS_VV_1_PRIME2][im];
3866  spinzerohiggs_anomcoupl_.ghw1_prime3[im] = (Hcouplings->Hwwcoupl)[gHIGGS_VV_1_PRIME3][im];
3867  spinzerohiggs_anomcoupl_.ghw1_prime4[im] = (Hcouplings->Hwwcoupl)[gHIGGS_VV_1_PRIME4][im];
3868  spinzerohiggs_anomcoupl_.ghw1_prime5[im] = (Hcouplings->Hwwcoupl)[gHIGGS_VV_1_PRIME5][im];
3869  spinzerohiggs_anomcoupl_.ghw1_prime6[im] = (Hcouplings->Hwwcoupl)[gHIGGS_VV_1_PRIME6][im];
3870  spinzerohiggs_anomcoupl_.ghw1_prime7[im] = (Hcouplings->Hwwcoupl)[gHIGGS_VV_1_PRIME7][im];
3871  spinzerohiggs_anomcoupl_.ghw2_prime[im] = (Hcouplings->Hwwcoupl)[gHIGGS_VV_2_PRIME][im];
3872  spinzerohiggs_anomcoupl_.ghw2_prime2[im] = (Hcouplings->Hwwcoupl)[gHIGGS_VV_2_PRIME2][im];
3873  spinzerohiggs_anomcoupl_.ghw2_prime3[im] = (Hcouplings->Hwwcoupl)[gHIGGS_VV_2_PRIME3][im];
3874  spinzerohiggs_anomcoupl_.ghw2_prime4[im] = (Hcouplings->Hwwcoupl)[gHIGGS_VV_2_PRIME4][im];
3875  spinzerohiggs_anomcoupl_.ghw2_prime5[im] = (Hcouplings->Hwwcoupl)[gHIGGS_VV_2_PRIME5][im];
3876  spinzerohiggs_anomcoupl_.ghw2_prime6[im] = (Hcouplings->Hwwcoupl)[gHIGGS_VV_2_PRIME6][im];
3877  spinzerohiggs_anomcoupl_.ghw2_prime7[im] = (Hcouplings->Hwwcoupl)[gHIGGS_VV_2_PRIME7][im];
3878  spinzerohiggs_anomcoupl_.ghw3_prime[im] = (Hcouplings->Hwwcoupl)[gHIGGS_VV_3_PRIME][im];
3879  spinzerohiggs_anomcoupl_.ghw3_prime2[im] = (Hcouplings->Hwwcoupl)[gHIGGS_VV_3_PRIME2][im];
3880  spinzerohiggs_anomcoupl_.ghw3_prime3[im] = (Hcouplings->Hwwcoupl)[gHIGGS_VV_3_PRIME3][im];
3881  spinzerohiggs_anomcoupl_.ghw3_prime4[im] = (Hcouplings->Hwwcoupl)[gHIGGS_VV_3_PRIME4][im];
3882  spinzerohiggs_anomcoupl_.ghw3_prime5[im] = (Hcouplings->Hwwcoupl)[gHIGGS_VV_3_PRIME5][im];
3883  spinzerohiggs_anomcoupl_.ghw3_prime6[im] = (Hcouplings->Hwwcoupl)[gHIGGS_VV_3_PRIME6][im];
3884  spinzerohiggs_anomcoupl_.ghw3_prime7[im] = (Hcouplings->Hwwcoupl)[gHIGGS_VV_3_PRIME7][im];
3885  spinzerohiggs_anomcoupl_.ghw4_prime[im] = (Hcouplings->Hwwcoupl)[gHIGGS_VV_4_PRIME][im];
3886  spinzerohiggs_anomcoupl_.ghw4_prime2[im] = (Hcouplings->Hwwcoupl)[gHIGGS_VV_4_PRIME2][im];
3887  spinzerohiggs_anomcoupl_.ghw4_prime3[im] = (Hcouplings->Hwwcoupl)[gHIGGS_VV_4_PRIME3][im];
3888  spinzerohiggs_anomcoupl_.ghw4_prime4[im] = (Hcouplings->Hwwcoupl)[gHIGGS_VV_4_PRIME4][im];
3889  spinzerohiggs_anomcoupl_.ghw4_prime5[im] = (Hcouplings->Hwwcoupl)[gHIGGS_VV_4_PRIME5][im];
3890  spinzerohiggs_anomcoupl_.ghw4_prime6[im] = (Hcouplings->Hwwcoupl)[gHIGGS_VV_4_PRIME6][im];
3891  spinzerohiggs_anomcoupl_.ghw4_prime7[im] = (Hcouplings->Hwwcoupl)[gHIGGS_VV_4_PRIME7][im];
3892  }
3893  }
3894  else{
3895  //
3896  spinzerohiggs_anomcoupl_.cw_q1sq = (Hcouplings->HzzCLambda_qsq)[cLambdaHIGGS_VV_QSQ1];
3897  spinzerohiggs_anomcoupl_.Lambda_w11 = (Hcouplings->HzzLambda_qsq)[LambdaHIGGS_QSQ_VV_1][cLambdaHIGGS_VV_QSQ1];
3898  spinzerohiggs_anomcoupl_.Lambda_w21 = (Hcouplings->HzzLambda_qsq)[LambdaHIGGS_QSQ_VV_2][cLambdaHIGGS_VV_QSQ1];
3899  spinzerohiggs_anomcoupl_.Lambda_w31 = (Hcouplings->HzzLambda_qsq)[LambdaHIGGS_QSQ_VV_3][cLambdaHIGGS_VV_QSQ1];
3900  spinzerohiggs_anomcoupl_.Lambda_w41 = (Hcouplings->HzzLambda_qsq)[LambdaHIGGS_QSQ_VV_4][cLambdaHIGGS_VV_QSQ1];
3901  spinzerohiggs_anomcoupl_.cw_q2sq = (Hcouplings->HzzCLambda_qsq)[cLambdaHIGGS_VV_QSQ2];
3902  spinzerohiggs_anomcoupl_.Lambda_w12 = (Hcouplings->HzzLambda_qsq)[LambdaHIGGS_QSQ_VV_1][cLambdaHIGGS_VV_QSQ2];
3903  spinzerohiggs_anomcoupl_.Lambda_w22 = (Hcouplings->HzzLambda_qsq)[LambdaHIGGS_QSQ_VV_2][cLambdaHIGGS_VV_QSQ2];
3904  spinzerohiggs_anomcoupl_.Lambda_w32 = (Hcouplings->HzzLambda_qsq)[LambdaHIGGS_QSQ_VV_3][cLambdaHIGGS_VV_QSQ2];
3905  spinzerohiggs_anomcoupl_.Lambda_w42 = (Hcouplings->HzzLambda_qsq)[LambdaHIGGS_QSQ_VV_4][cLambdaHIGGS_VV_QSQ2];
3906  spinzerohiggs_anomcoupl_.cw_q12sq = (Hcouplings->HzzCLambda_qsq)[cLambdaHIGGS_VV_QSQ12];
3907  spinzerohiggs_anomcoupl_.Lambda_w10 = (Hcouplings->HzzLambda_qsq)[LambdaHIGGS_QSQ_VV_1][cLambdaHIGGS_VV_QSQ12];
3908  spinzerohiggs_anomcoupl_.Lambda_w20 = (Hcouplings->HzzLambda_qsq)[LambdaHIGGS_QSQ_VV_2][cLambdaHIGGS_VV_QSQ12];
3909  spinzerohiggs_anomcoupl_.Lambda_w30 = (Hcouplings->HzzLambda_qsq)[LambdaHIGGS_QSQ_VV_3][cLambdaHIGGS_VV_QSQ12];
3910  spinzerohiggs_anomcoupl_.Lambda_w40 = (Hcouplings->HzzLambda_qsq)[LambdaHIGGS_QSQ_VV_4][cLambdaHIGGS_VV_QSQ12];
3911  //
3912  for (int im=0; im<2; im++){
3913  spinzerohiggs_anomcoupl_.ghw1[im] = (Hcouplings->Hzzcoupl)[gHIGGS_VV_1][im];
3914  spinzerohiggs_anomcoupl_.ghw2[im] = (Hcouplings->Hzzcoupl)[gHIGGS_VV_2][im];
3915  spinzerohiggs_anomcoupl_.ghw3[im] = (Hcouplings->Hzzcoupl)[gHIGGS_VV_3][im];
3916  spinzerohiggs_anomcoupl_.ghw4[im] = (Hcouplings->Hzzcoupl)[gHIGGS_VV_4][im];
3917  spinzerohiggs_anomcoupl_.ghw1_prime[im] = (Hcouplings->Hzzcoupl)[gHIGGS_VV_1_PRIME][im];
3918  spinzerohiggs_anomcoupl_.ghw1_prime2[im] = (Hcouplings->Hzzcoupl)[gHIGGS_VV_1_PRIME2][im];
3919  spinzerohiggs_anomcoupl_.ghw1_prime3[im] = (Hcouplings->Hzzcoupl)[gHIGGS_VV_1_PRIME3][im];
3920  spinzerohiggs_anomcoupl_.ghw1_prime4[im] = (Hcouplings->Hzzcoupl)[gHIGGS_VV_1_PRIME4][im];
3921  spinzerohiggs_anomcoupl_.ghw1_prime5[im] = (Hcouplings->Hzzcoupl)[gHIGGS_VV_1_PRIME5][im];
3922  spinzerohiggs_anomcoupl_.ghw1_prime6[im] = (Hcouplings->Hzzcoupl)[gHIGGS_VV_1_PRIME6][im];
3923  spinzerohiggs_anomcoupl_.ghw1_prime7[im] = (Hcouplings->Hzzcoupl)[gHIGGS_VV_1_PRIME7][im];
3924  spinzerohiggs_anomcoupl_.ghw2_prime[im] = (Hcouplings->Hzzcoupl)[gHIGGS_VV_2_PRIME][im];
3925  spinzerohiggs_anomcoupl_.ghw2_prime2[im] = (Hcouplings->Hzzcoupl)[gHIGGS_VV_2_PRIME2][im];
3926  spinzerohiggs_anomcoupl_.ghw2_prime3[im] = (Hcouplings->Hzzcoupl)[gHIGGS_VV_2_PRIME3][im];
3927  spinzerohiggs_anomcoupl_.ghw2_prime4[im] = (Hcouplings->Hzzcoupl)[gHIGGS_VV_2_PRIME4][im];
3928  spinzerohiggs_anomcoupl_.ghw2_prime5[im] = (Hcouplings->Hzzcoupl)[gHIGGS_VV_2_PRIME5][im];
3929  spinzerohiggs_anomcoupl_.ghw2_prime6[im] = (Hcouplings->Hzzcoupl)[gHIGGS_VV_2_PRIME6][im];
3930  spinzerohiggs_anomcoupl_.ghw2_prime7[im] = (Hcouplings->Hzzcoupl)[gHIGGS_VV_2_PRIME7][im];
3931  spinzerohiggs_anomcoupl_.ghw3_prime[im] = (Hcouplings->Hzzcoupl)[gHIGGS_VV_3_PRIME][im];
3932  spinzerohiggs_anomcoupl_.ghw3_prime2[im] = (Hcouplings->Hzzcoupl)[gHIGGS_VV_3_PRIME2][im];
3933  spinzerohiggs_anomcoupl_.ghw3_prime3[im] = (Hcouplings->Hzzcoupl)[gHIGGS_VV_3_PRIME3][im];
3934  spinzerohiggs_anomcoupl_.ghw3_prime4[im] = (Hcouplings->Hzzcoupl)[gHIGGS_VV_3_PRIME4][im];
3935  spinzerohiggs_anomcoupl_.ghw3_prime5[im] = (Hcouplings->Hzzcoupl)[gHIGGS_VV_3_PRIME5][im];
3936  spinzerohiggs_anomcoupl_.ghw3_prime6[im] = (Hcouplings->Hzzcoupl)[gHIGGS_VV_3_PRIME6][im];
3937  spinzerohiggs_anomcoupl_.ghw3_prime7[im] = (Hcouplings->Hzzcoupl)[gHIGGS_VV_3_PRIME7][im];
3938  spinzerohiggs_anomcoupl_.ghw4_prime[im] = (Hcouplings->Hzzcoupl)[gHIGGS_VV_4_PRIME][im];
3939  spinzerohiggs_anomcoupl_.ghw4_prime2[im] = (Hcouplings->Hzzcoupl)[gHIGGS_VV_4_PRIME2][im];
3940  spinzerohiggs_anomcoupl_.ghw4_prime3[im] = (Hcouplings->Hzzcoupl)[gHIGGS_VV_4_PRIME3][im];
3941  spinzerohiggs_anomcoupl_.ghw4_prime4[im] = (Hcouplings->Hzzcoupl)[gHIGGS_VV_4_PRIME4][im];
3942  spinzerohiggs_anomcoupl_.ghw4_prime5[im] = (Hcouplings->Hzzcoupl)[gHIGGS_VV_4_PRIME5][im];
3943  spinzerohiggs_anomcoupl_.ghw4_prime6[im] = (Hcouplings->Hzzcoupl)[gHIGGS_VV_4_PRIME6][im];
3944  spinzerohiggs_anomcoupl_.ghw4_prime7[im] = (Hcouplings->Hzzcoupl)[gHIGGS_VV_4_PRIME7][im];
3945  }
3946  }
3947  /***** END REGULAR RESONANCE *****/
3948  //
3949  /***** SECOND RESONANCE *****/
3950  //
3951  spinzerohiggs_anomcoupl_.c2z_q1sq = (Hcouplings->H2zzCLambda_qsq)[cLambdaHIGGS_VV_QSQ1];
3952  spinzerohiggs_anomcoupl_.Lambda2_z11 = (Hcouplings->H2zzLambda_qsq)[LambdaHIGGS_QSQ_VV_1][cLambdaHIGGS_VV_QSQ1];
3953  spinzerohiggs_anomcoupl_.Lambda2_z21 = (Hcouplings->H2zzLambda_qsq)[LambdaHIGGS_QSQ_VV_2][cLambdaHIGGS_VV_QSQ1];
3954  spinzerohiggs_anomcoupl_.Lambda2_z31 = (Hcouplings->H2zzLambda_qsq)[LambdaHIGGS_QSQ_VV_3][cLambdaHIGGS_VV_QSQ1];
3955  spinzerohiggs_anomcoupl_.Lambda2_z41 = (Hcouplings->H2zzLambda_qsq)[LambdaHIGGS_QSQ_VV_4][cLambdaHIGGS_VV_QSQ1];
3956  spinzerohiggs_anomcoupl_.c2z_q2sq = (Hcouplings->H2zzCLambda_qsq)[cLambdaHIGGS_VV_QSQ2];
3957  spinzerohiggs_anomcoupl_.Lambda2_z12 = (Hcouplings->H2zzLambda_qsq)[LambdaHIGGS_QSQ_VV_1][cLambdaHIGGS_VV_QSQ2];
3958  spinzerohiggs_anomcoupl_.Lambda2_z22 = (Hcouplings->H2zzLambda_qsq)[LambdaHIGGS_QSQ_VV_2][cLambdaHIGGS_VV_QSQ2];
3959  spinzerohiggs_anomcoupl_.Lambda2_z32 = (Hcouplings->H2zzLambda_qsq)[LambdaHIGGS_QSQ_VV_3][cLambdaHIGGS_VV_QSQ2];
3960  spinzerohiggs_anomcoupl_.Lambda2_z42 = (Hcouplings->H2zzLambda_qsq)[LambdaHIGGS_QSQ_VV_4][cLambdaHIGGS_VV_QSQ2];
3961  spinzerohiggs_anomcoupl_.c2z_q12sq = (Hcouplings->H2zzCLambda_qsq)[cLambdaHIGGS_VV_QSQ12];
3962  spinzerohiggs_anomcoupl_.Lambda2_z10 = (Hcouplings->H2zzLambda_qsq)[LambdaHIGGS_QSQ_VV_1][cLambdaHIGGS_VV_QSQ12];
3963  spinzerohiggs_anomcoupl_.Lambda2_z20 = (Hcouplings->H2zzLambda_qsq)[LambdaHIGGS_QSQ_VV_2][cLambdaHIGGS_VV_QSQ12];
3964  spinzerohiggs_anomcoupl_.Lambda2_z30 = (Hcouplings->H2zzLambda_qsq)[LambdaHIGGS_QSQ_VV_3][cLambdaHIGGS_VV_QSQ12];
3965  spinzerohiggs_anomcoupl_.Lambda2_z40 = (Hcouplings->H2zzLambda_qsq)[LambdaHIGGS_QSQ_VV_4][cLambdaHIGGS_VV_QSQ12];
3966  //
3967  for (int im=0; im<2; im++){
3968  spinzerohiggs_anomcoupl_.kappa2_top[im] = (Hcouplings->H2ttcoupl)[gHIGGS_KAPPA][im];
3969  spinzerohiggs_anomcoupl_.kappa2_bot[im] = (Hcouplings->H2bbcoupl)[gHIGGS_KAPPA][im];
3970  spinzerohiggs_anomcoupl_.kappa2_tilde_top[im] = (Hcouplings->H2ttcoupl)[gHIGGS_KAPPA_TILDE][im];
3971  spinzerohiggs_anomcoupl_.kappa2_tilde_bot[im] = (Hcouplings->H2bbcoupl)[gHIGGS_KAPPA_TILDE][im];
3972  spinzerohiggs_anomcoupl_.gh2g2[im] = (Hcouplings->H2ggcoupl)[gHIGGS_GG_2][im];
3973  spinzerohiggs_anomcoupl_.gh2g3[im] = (Hcouplings->H2ggcoupl)[gHIGGS_GG_3][im];
3974  spinzerohiggs_anomcoupl_.gh2g4[im] = (Hcouplings->H2ggcoupl)[gHIGGS_GG_4][im];
3975  spinzerohiggs_anomcoupl_.kappa2_4gen_top[im] = (Hcouplings->H2t4t4coupl)[gHIGGS_KAPPA][im];
3976  spinzerohiggs_anomcoupl_.kappa2_4gen_bot[im] = (Hcouplings->H2b4b4coupl)[gHIGGS_KAPPA][im];
3977  spinzerohiggs_anomcoupl_.kappa2_tilde_4gen_top[im] = (Hcouplings->H2t4t4coupl)[gHIGGS_KAPPA_TILDE][im];
3978  spinzerohiggs_anomcoupl_.kappa2_tilde_4gen_bot[im] = (Hcouplings->H2b4b4coupl)[gHIGGS_KAPPA_TILDE][im];
3979  spinzerohiggs_anomcoupl_.gh2g2_4gen[im] = (Hcouplings->H2g4g4coupl)[gHIGGS_GG_2][im];
3980  spinzerohiggs_anomcoupl_.gh2g3_4gen[im] = (Hcouplings->H2g4g4coupl)[gHIGGS_GG_3][im];
3981  spinzerohiggs_anomcoupl_.gh2g4_4gen[im] = (Hcouplings->H2g4g4coupl)[gHIGGS_GG_4][im];
3982  //
3983  spinzerohiggs_anomcoupl_.gh2z1[im] = (Hcouplings->H2zzcoupl)[gHIGGS_VV_1][im];
3984  spinzerohiggs_anomcoupl_.gh2z2[im] = (Hcouplings->H2zzcoupl)[gHIGGS_VV_2][im];
3985  spinzerohiggs_anomcoupl_.gh2z3[im] = (Hcouplings->H2zzcoupl)[gHIGGS_VV_3][im];
3986  spinzerohiggs_anomcoupl_.gh2z4[im] = (Hcouplings->H2zzcoupl)[gHIGGS_VV_4][im];
3987  spinzerohiggs_anomcoupl_.gh2z1_prime[im] = (Hcouplings->H2zzcoupl)[gHIGGS_VV_1_PRIME][im];
3988  spinzerohiggs_anomcoupl_.gh2z1_prime2[im] = (Hcouplings->H2zzcoupl)[gHIGGS_VV_1_PRIME2][im];
3989  spinzerohiggs_anomcoupl_.gh2z1_prime3[im] = (Hcouplings->H2zzcoupl)[gHIGGS_VV_1_PRIME3][im];
3990  spinzerohiggs_anomcoupl_.gh2z1_prime4[im] = (Hcouplings->H2zzcoupl)[gHIGGS_VV_1_PRIME4][im];
3991  spinzerohiggs_anomcoupl_.gh2z1_prime5[im] = (Hcouplings->H2zzcoupl)[gHIGGS_VV_1_PRIME5][im];
3992  spinzerohiggs_anomcoupl_.gh2z1_prime6[im] = (Hcouplings->H2zzcoupl)[gHIGGS_VV_1_PRIME6][im];
3993  spinzerohiggs_anomcoupl_.gh2z1_prime7[im] = (Hcouplings->H2zzcoupl)[gHIGGS_VV_1_PRIME7][im];
3994  spinzerohiggs_anomcoupl_.gh2z2_prime[im] = (Hcouplings->H2zzcoupl)[gHIGGS_VV_2_PRIME][im];
3995  spinzerohiggs_anomcoupl_.gh2z2_prime2[im] = (Hcouplings->H2zzcoupl)[gHIGGS_VV_2_PRIME2][im];
3996  spinzerohiggs_anomcoupl_.gh2z2_prime3[im] = (Hcouplings->H2zzcoupl)[gHIGGS_VV_2_PRIME3][im];
3997  spinzerohiggs_anomcoupl_.gh2z2_prime4[im] = (Hcouplings->H2zzcoupl)[gHIGGS_VV_2_PRIME4][im];
3998  spinzerohiggs_anomcoupl_.gh2z2_prime5[im] = (Hcouplings->H2zzcoupl)[gHIGGS_VV_2_PRIME5][im];
3999  spinzerohiggs_anomcoupl_.gh2z2_prime6[im] = (Hcouplings->H2zzcoupl)[gHIGGS_VV_2_PRIME6][im];
4000  spinzerohiggs_anomcoupl_.gh2z2_prime7[im] = (Hcouplings->H2zzcoupl)[gHIGGS_VV_2_PRIME7][im];
4001  spinzerohiggs_anomcoupl_.gh2z3_prime[im] = (Hcouplings->H2zzcoupl)[gHIGGS_VV_3_PRIME][im];
4002  spinzerohiggs_anomcoupl_.gh2z3_prime2[im] = (Hcouplings->H2zzcoupl)[gHIGGS_VV_3_PRIME2][im];
4003  spinzerohiggs_anomcoupl_.gh2z3_prime3[im] = (Hcouplings->H2zzcoupl)[gHIGGS_VV_3_PRIME3][im];
4004  spinzerohiggs_anomcoupl_.gh2z3_prime4[im] = (Hcouplings->H2zzcoupl)[gHIGGS_VV_3_PRIME4][im];
4005  spinzerohiggs_anomcoupl_.gh2z3_prime5[im] = (Hcouplings->H2zzcoupl)[gHIGGS_VV_3_PRIME5][im];
4006  spinzerohiggs_anomcoupl_.gh2z3_prime6[im] = (Hcouplings->H2zzcoupl)[gHIGGS_VV_3_PRIME6][im];
4007  spinzerohiggs_anomcoupl_.gh2z3_prime7[im] = (Hcouplings->H2zzcoupl)[gHIGGS_VV_3_PRIME7][im];
4008  spinzerohiggs_anomcoupl_.gh2z4_prime[im] = (Hcouplings->H2zzcoupl)[gHIGGS_VV_4_PRIME][im];
4009  spinzerohiggs_anomcoupl_.gh2z4_prime2[im] = (Hcouplings->H2zzcoupl)[gHIGGS_VV_4_PRIME2][im];
4010  spinzerohiggs_anomcoupl_.gh2z4_prime3[im] = (Hcouplings->H2zzcoupl)[gHIGGS_VV_4_PRIME3][im];
4011  spinzerohiggs_anomcoupl_.gh2z4_prime4[im] = (Hcouplings->H2zzcoupl)[gHIGGS_VV_4_PRIME4][im];
4012  spinzerohiggs_anomcoupl_.gh2z4_prime5[im] = (Hcouplings->H2zzcoupl)[gHIGGS_VV_4_PRIME5][im];
4013  spinzerohiggs_anomcoupl_.gh2z4_prime6[im] = (Hcouplings->H2zzcoupl)[gHIGGS_VV_4_PRIME6][im];
4014  spinzerohiggs_anomcoupl_.gh2z4_prime7[im] = (Hcouplings->H2zzcoupl)[gHIGGS_VV_4_PRIME7][im];
4015  //
4016  spinzerohiggs_anomcoupl_.gh2zgs1_prime2[im] = (Hcouplings->H2zzcoupl)[gHIGGS_ZA_1_PRIME2][im];
4017  spinzerohiggs_anomcoupl_.gh2zgs2[im] = (Hcouplings->H2zzcoupl)[gHIGGS_ZA_2][im];
4018  spinzerohiggs_anomcoupl_.gh2zgs3[im] = (Hcouplings->H2zzcoupl)[gHIGGS_ZA_3][im];
4019  spinzerohiggs_anomcoupl_.gh2zgs4[im] = (Hcouplings->H2zzcoupl)[gHIGGS_ZA_4][im];
4020  spinzerohiggs_anomcoupl_.gh2gsgs2[im] = (Hcouplings->H2zzcoupl)[gHIGGS_AA_2][im];
4021  spinzerohiggs_anomcoupl_.gh2gsgs3[im] = (Hcouplings->H2zzcoupl)[gHIGGS_AA_3][im];
4022  spinzerohiggs_anomcoupl_.gh2gsgs4[im] = (Hcouplings->H2zzcoupl)[gHIGGS_AA_4][im];
4023  }
4024  //
4025  if (spinzerohiggs_anomcoupl_.distinguish_HWWcouplings==1){
4026  //
4027  spinzerohiggs_anomcoupl_.c2w_q1sq = (Hcouplings->H2wwCLambda_qsq)[cLambdaHIGGS_VV_QSQ1];
4028  spinzerohiggs_anomcoupl_.Lambda2_w11 = (Hcouplings->H2wwLambda_qsq)[LambdaHIGGS_QSQ_VV_1][cLambdaHIGGS_VV_QSQ1];
4029  spinzerohiggs_anomcoupl_.Lambda2_w21 = (Hcouplings->H2wwLambda_qsq)[LambdaHIGGS_QSQ_VV_2][cLambdaHIGGS_VV_QSQ1];
4030  spinzerohiggs_anomcoupl_.Lambda2_w31 = (Hcouplings->H2wwLambda_qsq)[LambdaHIGGS_QSQ_VV_3][cLambdaHIGGS_VV_QSQ1];
4031  spinzerohiggs_anomcoupl_.Lambda2_w41 = (Hcouplings->H2wwLambda_qsq)[LambdaHIGGS_QSQ_VV_4][cLambdaHIGGS_VV_QSQ1];
4032  spinzerohiggs_anomcoupl_.c2w_q2sq = (Hcouplings->H2wwCLambda_qsq)[cLambdaHIGGS_VV_QSQ2];
4033  spinzerohiggs_anomcoupl_.Lambda2_w12 = (Hcouplings->H2wwLambda_qsq)[LambdaHIGGS_QSQ_VV_1][cLambdaHIGGS_VV_QSQ2];
4034  spinzerohiggs_anomcoupl_.Lambda2_w22 = (Hcouplings->H2wwLambda_qsq)[LambdaHIGGS_QSQ_VV_2][cLambdaHIGGS_VV_QSQ2];
4035  spinzerohiggs_anomcoupl_.Lambda2_w32 = (Hcouplings->H2wwLambda_qsq)[LambdaHIGGS_QSQ_VV_3][cLambdaHIGGS_VV_QSQ2];
4036  spinzerohiggs_anomcoupl_.Lambda2_w42 = (Hcouplings->H2wwLambda_qsq)[LambdaHIGGS_QSQ_VV_4][cLambdaHIGGS_VV_QSQ2];
4037  spinzerohiggs_anomcoupl_.c2w_q12sq = (Hcouplings->H2wwCLambda_qsq)[cLambdaHIGGS_VV_QSQ12];
4038  spinzerohiggs_anomcoupl_.Lambda2_w10 = (Hcouplings->H2wwLambda_qsq)[LambdaHIGGS_QSQ_VV_1][cLambdaHIGGS_VV_QSQ12];
4039  spinzerohiggs_anomcoupl_.Lambda2_w20 = (Hcouplings->H2wwLambda_qsq)[LambdaHIGGS_QSQ_VV_2][cLambdaHIGGS_VV_QSQ12];
4040  spinzerohiggs_anomcoupl_.Lambda2_w30 = (Hcouplings->H2wwLambda_qsq)[LambdaHIGGS_QSQ_VV_3][cLambdaHIGGS_VV_QSQ12];
4041  spinzerohiggs_anomcoupl_.Lambda2_w40 = (Hcouplings->H2wwLambda_qsq)[LambdaHIGGS_QSQ_VV_4][cLambdaHIGGS_VV_QSQ12];
4042  //
4043  for (int im=0; im<2; im++){
4044  spinzerohiggs_anomcoupl_.gh2w1[im] = (Hcouplings->H2wwcoupl)[gHIGGS_VV_1][im];
4045  spinzerohiggs_anomcoupl_.gh2w2[im] = (Hcouplings->H2wwcoupl)[gHIGGS_VV_2][im];
4046  spinzerohiggs_anomcoupl_.gh2w3[im] = (Hcouplings->H2wwcoupl)[gHIGGS_VV_3][im];
4047  spinzerohiggs_anomcoupl_.gh2w4[im] = (Hcouplings->H2wwcoupl)[gHIGGS_VV_4][im];
4048  spinzerohiggs_anomcoupl_.gh2w1_prime[im] = (Hcouplings->H2wwcoupl)[gHIGGS_VV_1_PRIME][im];
4049  spinzerohiggs_anomcoupl_.gh2w1_prime2[im] = (Hcouplings->H2wwcoupl)[gHIGGS_VV_1_PRIME2][im];
4050  spinzerohiggs_anomcoupl_.gh2w1_prime3[im] = (Hcouplings->H2wwcoupl)[gHIGGS_VV_1_PRIME3][im];
4051  spinzerohiggs_anomcoupl_.gh2w1_prime4[im] = (Hcouplings->H2wwcoupl)[gHIGGS_VV_1_PRIME4][im];
4052  spinzerohiggs_anomcoupl_.gh2w1_prime5[im] = (Hcouplings->H2wwcoupl)[gHIGGS_VV_1_PRIME5][im];
4053  spinzerohiggs_anomcoupl_.gh2w1_prime6[im] = (Hcouplings->H2wwcoupl)[gHIGGS_VV_1_PRIME6][im];
4054  spinzerohiggs_anomcoupl_.gh2w1_prime7[im] = (Hcouplings->H2wwcoupl)[gHIGGS_VV_1_PRIME7][im];
4055  spinzerohiggs_anomcoupl_.gh2w2_prime[im] = (Hcouplings->H2wwcoupl)[gHIGGS_VV_2_PRIME][im];
4056  spinzerohiggs_anomcoupl_.gh2w2_prime2[im] = (Hcouplings->H2wwcoupl)[gHIGGS_VV_2_PRIME2][im];
4057  spinzerohiggs_anomcoupl_.gh2w2_prime3[im] = (Hcouplings->H2wwcoupl)[gHIGGS_VV_2_PRIME3][im];
4058  spinzerohiggs_anomcoupl_.gh2w2_prime4[im] = (Hcouplings->H2wwcoupl)[gHIGGS_VV_2_PRIME4][im];
4059  spinzerohiggs_anomcoupl_.gh2w2_prime5[im] = (Hcouplings->H2wwcoupl)[gHIGGS_VV_2_PRIME5][im];
4060  spinzerohiggs_anomcoupl_.gh2w2_prime6[im] = (Hcouplings->H2wwcoupl)[gHIGGS_VV_2_PRIME6][im];
4061  spinzerohiggs_anomcoupl_.gh2w2_prime7[im] = (Hcouplings->H2wwcoupl)[gHIGGS_VV_2_PRIME7][im];
4062  spinzerohiggs_anomcoupl_.gh2w3_prime[im] = (Hcouplings->H2wwcoupl)[gHIGGS_VV_3_PRIME][im];
4063  spinzerohiggs_anomcoupl_.gh2w3_prime2[im] = (Hcouplings->H2wwcoupl)[gHIGGS_VV_3_PRIME2][im];
4064  spinzerohiggs_anomcoupl_.gh2w3_prime3[im] = (Hcouplings->H2wwcoupl)[gHIGGS_VV_3_PRIME3][im];
4065  spinzerohiggs_anomcoupl_.gh2w3_prime4[im] = (Hcouplings->H2wwcoupl)[gHIGGS_VV_3_PRIME4][im];
4066  spinzerohiggs_anomcoupl_.gh2w3_prime5[im] = (Hcouplings->H2wwcoupl)[gHIGGS_VV_3_PRIME5][im];
4067  spinzerohiggs_anomcoupl_.gh2w3_prime6[im] = (Hcouplings->H2wwcoupl)[gHIGGS_VV_3_PRIME6][im];
4068  spinzerohiggs_anomcoupl_.gh2w3_prime7[im] = (Hcouplings->H2wwcoupl)[gHIGGS_VV_3_PRIME7][im];
4069  spinzerohiggs_anomcoupl_.gh2w4_prime[im] = (Hcouplings->H2wwcoupl)[gHIGGS_VV_4_PRIME][im];
4070  spinzerohiggs_anomcoupl_.gh2w4_prime2[im] = (Hcouplings->H2wwcoupl)[gHIGGS_VV_4_PRIME2][im];
4071  spinzerohiggs_anomcoupl_.gh2w4_prime3[im] = (Hcouplings->H2wwcoupl)[gHIGGS_VV_4_PRIME3][im];
4072  spinzerohiggs_anomcoupl_.gh2w4_prime4[im] = (Hcouplings->H2wwcoupl)[gHIGGS_VV_4_PRIME4][im];
4073  spinzerohiggs_anomcoupl_.gh2w4_prime5[im] = (Hcouplings->H2wwcoupl)[gHIGGS_VV_4_PRIME5][im];
4074  spinzerohiggs_anomcoupl_.gh2w4_prime6[im] = (Hcouplings->H2wwcoupl)[gHIGGS_VV_4_PRIME6][im];
4075  spinzerohiggs_anomcoupl_.gh2w4_prime7[im] = (Hcouplings->H2wwcoupl)[gHIGGS_VV_4_PRIME7][im];
4076  }
4077  }
4078  else{
4079  //
4080  spinzerohiggs_anomcoupl_.c2w_q1sq = (Hcouplings->H2zzCLambda_qsq)[cLambdaHIGGS_VV_QSQ1];
4081  spinzerohiggs_anomcoupl_.Lambda2_w11 = (Hcouplings->H2zzLambda_qsq)[LambdaHIGGS_QSQ_VV_1][cLambdaHIGGS_VV_QSQ1];
4082  spinzerohiggs_anomcoupl_.Lambda2_w21 = (Hcouplings->H2zzLambda_qsq)[LambdaHIGGS_QSQ_VV_2][cLambdaHIGGS_VV_QSQ1];
4083  spinzerohiggs_anomcoupl_.Lambda2_w31 = (Hcouplings->H2zzLambda_qsq)[LambdaHIGGS_QSQ_VV_3][cLambdaHIGGS_VV_QSQ1];
4084  spinzerohiggs_anomcoupl_.Lambda2_w41 = (Hcouplings->H2zzLambda_qsq)[LambdaHIGGS_QSQ_VV_4][cLambdaHIGGS_VV_QSQ1];
4085  spinzerohiggs_anomcoupl_.c2w_q2sq = (Hcouplings->H2zzCLambda_qsq)[cLambdaHIGGS_VV_QSQ2];
4086  spinzerohiggs_anomcoupl_.Lambda2_w12 = (Hcouplings->H2zzLambda_qsq)[LambdaHIGGS_QSQ_VV_1][cLambdaHIGGS_VV_QSQ2];
4087  spinzerohiggs_anomcoupl_.Lambda2_w22 = (Hcouplings->H2zzLambda_qsq)[LambdaHIGGS_QSQ_VV_2][cLambdaHIGGS_VV_QSQ2];
4088  spinzerohiggs_anomcoupl_.Lambda2_w32 = (Hcouplings->H2zzLambda_qsq)[LambdaHIGGS_QSQ_VV_3][cLambdaHIGGS_VV_QSQ2];
4089  spinzerohiggs_anomcoupl_.Lambda2_w42 = (Hcouplings->H2zzLambda_qsq)[LambdaHIGGS_QSQ_VV_4][cLambdaHIGGS_VV_QSQ2];
4090  spinzerohiggs_anomcoupl_.c2w_q12sq = (Hcouplings->H2zzCLambda_qsq)[cLambdaHIGGS_VV_QSQ12];
4091  spinzerohiggs_anomcoupl_.Lambda2_w10 = (Hcouplings->H2zzLambda_qsq)[LambdaHIGGS_QSQ_VV_1][cLambdaHIGGS_VV_QSQ12];
4092  spinzerohiggs_anomcoupl_.Lambda2_w20 = (Hcouplings->H2zzLambda_qsq)[LambdaHIGGS_QSQ_VV_2][cLambdaHIGGS_VV_QSQ12];
4093  spinzerohiggs_anomcoupl_.Lambda2_w30 = (Hcouplings->H2zzLambda_qsq)[LambdaHIGGS_QSQ_VV_3][cLambdaHIGGS_VV_QSQ12];
4094  spinzerohiggs_anomcoupl_.Lambda2_w40 = (Hcouplings->H2zzLambda_qsq)[LambdaHIGGS_QSQ_VV_4][cLambdaHIGGS_VV_QSQ12];
4095  //
4096  for (int im=0; im<2; im++){
4097  spinzerohiggs_anomcoupl_.gh2w1[im] = (Hcouplings->H2zzcoupl)[gHIGGS_VV_1][im];
4098  spinzerohiggs_anomcoupl_.gh2w2[im] = (Hcouplings->H2zzcoupl)[gHIGGS_VV_2][im];
4099  spinzerohiggs_anomcoupl_.gh2w3[im] = (Hcouplings->H2zzcoupl)[gHIGGS_VV_3][im];
4100  spinzerohiggs_anomcoupl_.gh2w4[im] = (Hcouplings->H2zzcoupl)[gHIGGS_VV_4][im];
4101  spinzerohiggs_anomcoupl_.gh2w1_prime[im] = (Hcouplings->H2zzcoupl)[gHIGGS_VV_1_PRIME][im];
4102  spinzerohiggs_anomcoupl_.gh2w1_prime2[im] = (Hcouplings->H2zzcoupl)[gHIGGS_VV_1_PRIME2][im];
4103  spinzerohiggs_anomcoupl_.gh2w1_prime3[im] = (Hcouplings->H2zzcoupl)[gHIGGS_VV_1_PRIME3][im];
4104  spinzerohiggs_anomcoupl_.gh2w1_prime4[im] = (Hcouplings->H2zzcoupl)[gHIGGS_VV_1_PRIME4][im];
4105  spinzerohiggs_anomcoupl_.gh2w1_prime5[im] = (Hcouplings->H2zzcoupl)[gHIGGS_VV_1_PRIME5][im];
4106  spinzerohiggs_anomcoupl_.gh2w1_prime6[im] = (Hcouplings->H2zzcoupl)[gHIGGS_VV_1_PRIME6][im];
4107  spinzerohiggs_anomcoupl_.gh2w1_prime7[im] = (Hcouplings->H2zzcoupl)[gHIGGS_VV_1_PRIME7][im];
4108  spinzerohiggs_anomcoupl_.gh2w2_prime[im] = (Hcouplings->H2zzcoupl)[gHIGGS_VV_2_PRIME][im];
4109  spinzerohiggs_anomcoupl_.gh2w2_prime2[im] = (Hcouplings->H2zzcoupl)[gHIGGS_VV_2_PRIME2][im];
4110  spinzerohiggs_anomcoupl_.gh2w2_prime3[im] = (Hcouplings->H2zzcoupl)[gHIGGS_VV_2_PRIME3][im];
4111  spinzerohiggs_anomcoupl_.gh2w2_prime4[im] = (Hcouplings->H2zzcoupl)[gHIGGS_VV_2_PRIME4][im];
4112  spinzerohiggs_anomcoupl_.gh2w2_prime5[im] = (Hcouplings->H2zzcoupl)[gHIGGS_VV_2_PRIME5][im];
4113  spinzerohiggs_anomcoupl_.gh2w2_prime6[im] = (Hcouplings->H2zzcoupl)[gHIGGS_VV_2_PRIME6][im];
4114  spinzerohiggs_anomcoupl_.gh2w2_prime7[im] = (Hcouplings->H2zzcoupl)[gHIGGS_VV_2_PRIME7][im];
4115  spinzerohiggs_anomcoupl_.gh2w3_prime[im] = (Hcouplings->H2zzcoupl)[gHIGGS_VV_3_PRIME][im];
4116  spinzerohiggs_anomcoupl_.gh2w3_prime2[im] = (Hcouplings->H2zzcoupl)[gHIGGS_VV_3_PRIME2][im];
4117  spinzerohiggs_anomcoupl_.gh2w3_prime3[im] = (Hcouplings->H2zzcoupl)[gHIGGS_VV_3_PRIME3][im];
4118  spinzerohiggs_anomcoupl_.gh2w3_prime4[im] = (Hcouplings->H2zzcoupl)[gHIGGS_VV_3_PRIME4][im];
4119  spinzerohiggs_anomcoupl_.gh2w3_prime5[im] = (Hcouplings->H2zzcoupl)[gHIGGS_VV_3_PRIME5][im];
4120  spinzerohiggs_anomcoupl_.gh2w3_prime6[im] = (Hcouplings->H2zzcoupl)[gHIGGS_VV_3_PRIME6][im];
4121  spinzerohiggs_anomcoupl_.gh2w3_prime7[im] = (Hcouplings->H2zzcoupl)[gHIGGS_VV_3_PRIME7][im];
4122  spinzerohiggs_anomcoupl_.gh2w4_prime[im] = (Hcouplings->H2zzcoupl)[gHIGGS_VV_4_PRIME][im];
4123  spinzerohiggs_anomcoupl_.gh2w4_prime2[im] = (Hcouplings->H2zzcoupl)[gHIGGS_VV_4_PRIME2][im];
4124  spinzerohiggs_anomcoupl_.gh2w4_prime3[im] = (Hcouplings->H2zzcoupl)[gHIGGS_VV_4_PRIME3][im];
4125  spinzerohiggs_anomcoupl_.gh2w4_prime4[im] = (Hcouplings->H2zzcoupl)[gHIGGS_VV_4_PRIME4][im];
4126  spinzerohiggs_anomcoupl_.gh2w4_prime5[im] = (Hcouplings->H2zzcoupl)[gHIGGS_VV_4_PRIME5][im];
4127  spinzerohiggs_anomcoupl_.gh2w4_prime6[im] = (Hcouplings->H2zzcoupl)[gHIGGS_VV_4_PRIME6][im];
4128  spinzerohiggs_anomcoupl_.gh2w4_prime7[im] = (Hcouplings->H2zzcoupl)[gHIGGS_VV_4_PRIME7][im];
4129  }
4130  }
4131  /***** END SECOND RESONANCE *****/
4132  }
4133 }

◆ SumMatrixElementPDF()

double TUtil::SumMatrixElementPDF ( const TVar::Process process,
const TVar::Production production,
const TVar::MatrixElement matrixElement,
const TVar::LeptonInterference leptonInterf,
TVar::event_scales_type event_scales,
MelaIO RcdME,
const double &  EBEAM,
TVar::VerbosityLevel  verbosity 
)

Definition at line 4244 of file TUtil.cc.

4249  {
4250  if (verbosity>=TVar::DEBUG) MELAout << "Begin SumMatrixElementPDF" << endl;
4251  double msqjk=0;
4252 
4253  int nRequested_AssociatedJets=0;
4254  int nRequested_AssociatedLeptons=0;
4255  int AssociationVCompatibility=0;
4256  int partIncCode=TVar::kNoAssociated; // Do not use associated particles in the pT=0 frame boost
4257  if (production == TVar::JQCD){ // Use asociated jets in the pT=0 frame boost
4258  partIncCode=TVar::kUseAssociated_Jets;
4259  nRequested_AssociatedJets = 1;
4260  if (verbosity>=TVar::DEBUG) MELAout << "TUtil::SumMatrixElementPDF: Requesting " << nRequested_AssociatedJets << " jets" << endl;
4261  }
4262  else if (
4263  production == TVar::Had_WH || production == TVar::Had_ZH
4264  || production == TVar::JJVBF || production == TVar::JJEW || production == TVar::JJEWQCD
4265  || production == TVar::Had_WH_S || production == TVar::Had_ZH_S
4266  || production == TVar::JJVBF_S || production == TVar::JJEW_S || production == TVar::JJEWQCD_S
4267  || production == TVar::Had_WH_TU || production == TVar::Had_ZH_TU
4268  || production == TVar::JJVBF_TU || production == TVar::JJEW_TU || production == TVar::JJEWQCD_TU
4269  || ((process == TVar::bkgZZ || process == TVar::bkgWW || process == TVar::bkgWWZZ) && (production == TVar::JJQCD || production == TVar::JJQCD_S || production == TVar::JJQCD_TU))
4270  || (process == TVar::bkgZJets && production == TVar::JJQCD && RcdME->melaCand->getDecayMode()==TVar::CandidateDecay_ff)
4271  ){ // Use associated jets in the pT=0 frame boost
4272  partIncCode=TVar::kUseAssociated_Jets;
4273  nRequested_AssociatedJets = 2;
4274  if (verbosity>=TVar::DEBUG) MELAout << "TUtil::SumMatrixElementPDF: Requesting " << nRequested_AssociatedJets << " jets" << endl;
4275  }
4276  else if (
4277  production == TVar::Lep_ZH || production == TVar::Lep_WH
4278  || production == TVar::Lep_ZH_S || production == TVar::Lep_WH_S
4279  || production == TVar::Lep_ZH_TU || production == TVar::Lep_WH_TU
4280  ){ // Only use associated leptons(+)neutrinos
4281  partIncCode=TVar::kUseAssociated_Leptons;
4282  nRequested_AssociatedLeptons = 2;
4283  }
4284  if (
4285  production == TVar::Had_WH || production == TVar::Lep_WH
4286  || production == TVar::Had_WH_S || production == TVar::Lep_WH_S
4287  || production == TVar::Had_WH_TU || production == TVar::Lep_WH_TU
4288  ) AssociationVCompatibility=24;
4289  else if (
4290  production == TVar::Had_ZH || production == TVar::Lep_ZH
4291  || production == TVar::Had_ZH_S || production == TVar::Lep_ZH_S
4292  || production == TVar::Had_ZH_TU || production == TVar::Lep_ZH_TU
4293  ) AssociationVCompatibility=23;
4294  simple_event_record mela_event;
4295  mela_event.AssociationCode=partIncCode;
4296  mela_event.AssociationVCompatibility=AssociationVCompatibility;
4297  mela_event.nRequested_AssociatedJets=nRequested_AssociatedJets;
4298  mela_event.nRequested_AssociatedLeptons=nRequested_AssociatedLeptons;
4300  RcdME->melaCand,
4301  mela_event,
4302  verbosity
4303  );
4304 
4305  double xx[2]={ 0 };
4306  vector<int> partOrder;
4307  vector<int> apartOrder;
4308  bool doProceed =
4309  CheckPartonMomFraction(mela_event.pMothers.at(0).second, mela_event.pMothers.at(1).second, xx, EBEAM, verbosity) // Check momentum transfers
4310  &&
4311  TUtil::MCFM_chooser(process, production, leptonInterf, verbosity, mela_event); // Set some of the specifics of the process through this function
4312  if (doProceed) doProceed = TUtil::MCFM_SetupParticleCouplings(process, production, verbosity, mela_event, &partOrder, &apartOrder); // Set the specifics of the daughter or associated particle couplings through this function
4313  if (doProceed){
4314  if (partOrder.size()!=mela_event.pDaughters.size()){
4315  if (verbosity >= TVar::ERROR){
4316  MELAerr << "TUtil::SumMatrixElementPDF: Ordering size " << partOrder.size() << " and number of daughter particles " << mela_event.pDaughters.size() << " are not the same!" << endl;
4317  TUtil::PrintCandidateSummary(&mela_event);
4318  }
4319  doProceed=false;
4320  }
4321  if (apartOrder.size()!=mela_event.pAssociated.size()){
4322  if (verbosity >= TVar::ERROR){
4323  MELAerr << "TUtil::SumMatrixElementPDF: Ordering size " << apartOrder.size() << " and number of associated particles " << mela_event.pAssociated.size() << " are not the same!" << endl;
4324  TUtil::PrintCandidateSummary(&mela_event);
4325  }
4326  doProceed=false;
4327  }
4328  }
4329  if (doProceed){
4330  int NPart=npart_.npart+2; // +2 for mothers
4331  double p4[4][mxpart]={ { 0 } };
4332  double p4_tmp[4][mxpart]={ { 0 } };
4333  int id[mxpart]; for (int ipar=0; ipar<mxpart; ipar++) id[ipar]=-9000;
4334  double msq[nmsq][nmsq]={ { 0 } };
4335  double msq_tmp[nmsq][nmsq]={ { 0 } };
4336  int channeltoggle=0;
4337 
4338  TLorentzVector MomStore[mxpart];
4339  for (int i = 0; i < mxpart; i++) MomStore[i].SetXYZT(0, 0, 0, 0);
4340 
4341  //Convert TLorentzVector into 4xNPart Matrix
4342  //reverse sign of incident partons
4343  for (int ipar=0; ipar<2; ipar++){
4344  if (mela_event.pMothers.at(ipar).second.T()>0.){
4345  p4[0][ipar] = -mela_event.pMothers.at(ipar).second.X();
4346  p4[1][ipar] = -mela_event.pMothers.at(ipar).second.Y();
4347  p4[2][ipar] = -mela_event.pMothers.at(ipar).second.Z();
4348  p4[3][ipar] = -mela_event.pMothers.at(ipar).second.T();
4349  MomStore[ipar] = mela_event.pMothers.at(ipar).second;
4350  id[ipar] = mela_event.pMothers.at(ipar).first;
4351  }
4352  else{
4353  p4[0][ipar] = mela_event.pMothers.at(ipar).second.X();
4354  p4[1][ipar] = mela_event.pMothers.at(ipar).second.Y();
4355  p4[2][ipar] = mela_event.pMothers.at(ipar).second.Z();
4356  p4[3][ipar] = mela_event.pMothers.at(ipar).second.T();
4357  MomStore[ipar] = -mela_event.pMothers.at(ipar).second;
4358  id[ipar] = mela_event.pMothers.at(ipar).first;
4359  }
4360  }
4361 
4362  // Determine if the decay mode involves WW or ZZ, to be used for ZZ or WW-specific signal MEs
4363  //bool isZG = (PDGHelpers::isAZBoson(mela_event.intermediateVid.at(0)) && PDGHelpers::isAPhoton(mela_event.intermediateVid.at(1)));
4364  bool isWW = (PDGHelpers::isAWBoson(mela_event.intermediateVid.at(0)) && PDGHelpers::isAWBoson(mela_event.intermediateVid.at(1)));
4365  bool isZZ = (PDGHelpers::isAZBoson(mela_event.intermediateVid.at(0)) && PDGHelpers::isAZBoson(mela_event.intermediateVid.at(1)));
4366  bool isGG = (PDGHelpers::isAPhoton(mela_event.intermediateVid.at(0)) && PDGHelpers::isAPhoton(mela_event.intermediateVid.at(1)));
4367  //initialize decayed particles
4368  for (int ix=0; ix<(int)partOrder.size(); ix++){
4369  int ipar = min((int)mxpart, min(NPart, 2))+ix;
4370  if (ipar>=mxpart) break;
4371  TLorentzVector* momTmp = &(mela_event.pDaughters.at(partOrder.at(ix)).second);
4372  p4[0][ipar] = momTmp->X();
4373  p4[1][ipar] = momTmp->Y();
4374  p4[2][ipar] = momTmp->Z();
4375  p4[3][ipar] = momTmp->T();
4376  MomStore[ipar]=*momTmp;
4377  id[ipar] = mela_event.pDaughters.at(partOrder.at(ix)).first;
4378  }
4379  for (int ix=0; ix<(int)apartOrder.size(); ix++){
4380  int ipar = min((int)mxpart, min(NPart, (int)(partOrder.size()+2)))+ix;
4381  if (ipar>=mxpart) break;
4382  TLorentzVector* momTmp = &(mela_event.pAssociated.at(apartOrder.at(ix)).second);
4383  p4[0][ipar] = momTmp->X();
4384  p4[1][ipar] = momTmp->Y();
4385  p4[2][ipar] = momTmp->Z();
4386  p4[3][ipar] = momTmp->T();
4387  MomStore[ipar]=*momTmp;
4388  id[ipar] = mela_event.pAssociated.at(apartOrder.at(ix)).first;
4389  }
4390 
4391  if (verbosity >= TVar::DEBUG){ for (int i=0; i<NPart; i++) MELAout << "p["<<i<<"] (Px, Py, Pz, E):\t" << p4[0][i] << '\t' << p4[1][i] << '\t' << p4[2][i] << '\t' << p4[3][i] << endl; }
4392 
4393  double defaultRenScale = scale_.scale;
4394  double defaultFacScale = facscale_.facscale;
4395  int defaultNloop = nlooprun_.nlooprun;
4396  int defaultNflav = nflav_.nflav;
4397  string defaultPdflabel = pdlabel_.pdlabel;
4398  double renQ = InterpretScaleScheme(production, matrixElement, event_scales->renomalizationScheme, MomStore);
4399  double facQ = InterpretScaleScheme(production, matrixElement, event_scales->factorizationScheme, MomStore);
4400  SetAlphaS(renQ, facQ, event_scales->ren_scale_factor, event_scales->fac_scale_factor, 1, 5, "cteq6_l");
4401  double alphasVal, alphasmzVal;
4402  GetAlphaS(&alphasVal, &alphasmzVal);
4403  RcdME->setRenormalizationScale(renQ);
4404  RcdME->setFactorizationScale(facQ);
4405  RcdME->setAlphaS(alphasVal);
4406  RcdME->setAlphaSatMZ(alphasmzVal);
4407  RcdME->setHiggsMassWidth(masses_mcfm_.hmass, masses_mcfm_.hwidth, 0);
4409  if (verbosity>=TVar::DEBUG){
4410  MELAout
4411  << "TUtil::SumMatrixElementPDF: Set AlphaS:\n"
4412  << "\tBefore set, alphas scale: " << defaultRenScale << ", PDF scale: " << defaultFacScale << '\n'
4413  << "\trenQ: " << renQ << " ( x " << event_scales->ren_scale_factor << "), facQ: " << facQ << " ( x " << event_scales->fac_scale_factor << ")\n"
4414  << "\tAfter set, alphas scale: " << scale_.scale << ", PDF scale: " << facscale_.facscale << ", alphas(Qren): " << alphasVal << ", alphas(MZ): " << alphasmzVal << endl;
4415  }
4416 
4417  int nInstances=0;
4418  if (
4419  (production == TVar::ZZINDEPENDENT || production == TVar::ZZQQB)
4420  ||
4421  ((production == TVar::ZZQQB_STU || production == TVar::ZZQQB_S || production == TVar::ZZQQB_TU) && process == TVar::bkgZZ)
4422  ){
4423  if (production == TVar::ZZINDEPENDENT || production == TVar::ZZQQB){
4424  if (process == TVar::bkgGammaGamma){ qqb_gamgam_(p4[0], msq[0]); msq[5][5]=0; } // This function actually computes qqb/gg -> GG, so need to set msq[g][g]=0
4425  else if (process == TVar::bkgZGamma) qqb_zgam_(p4[0], msq[0]);
4426  else if (process == TVar::bkgZZ) qqb_zz_(p4[0], msq[0]);
4427  else if (process == TVar::bkgWW) qqb_ww_(p4[0], msq[0]);
4428  }
4429  else{
4430  if (production == TVar::ZZQQB_STU) channeltoggle=0;
4431  else if (production == TVar::ZZQQB_S) channeltoggle=1;
4432  else/* if (production == TVar::ZZQQB_TU)*/ channeltoggle=2;
4433  qqb_zz_stu_(p4[0], msq[0], &channeltoggle);
4434  }
4435  nInstances=WipeMEArray(process, production, id, msq, verbosity);
4436 
4437  // Sum over valid MEs without PDF weights
4438  // By far the dominant contribution is uub initial state.
4439  for (int iquark=-5; iquark<=5; iquark++){
4440  for (int jquark=-5; jquark<=5; jquark++){
4441  if (
4442  (PDGHelpers::isAnUnknownJet(id[0]) || (PDGHelpers::isAGluon(id[0]) && iquark==0) || iquark==id[0])
4443  &&
4444  (PDGHelpers::isAnUnknownJet(id[1]) || (PDGHelpers::isAGluon(id[1]) && jquark==0) || jquark==id[1])
4445  ){
4446  if (
4448  &&
4450  ) msqjk = msq[3][7]+msq[7][3]; // Use only uub initial state
4451  else if (
4453  ) msqjk = msq[jquark+5][-jquark+5];
4454  else if (
4456  ) msqjk = msq[-iquark+5][iquark+5];
4457  else msqjk += msq[jquark+5][iquark+5];
4458  }
4459  }
4460  }
4461  SumMEPDF(MomStore[0], MomStore[1], msq, RcdME, EBEAM, verbosity);
4462  }
4463  else if (production == TVar::ZZGG){
4464  if (isZZ){
4465  if (process == TVar::HSMHiggs) gg_hzz_tb_(p4[0], msq[0]); // |ggHZZ|**2
4466  else if (process == TVar::bkgZZ_SMHiggs) gg_zz_all_(p4[0], msq[0]); // |ggZZ + ggHZZ|**2
4467  else if (process == TVar::bkgZZ) gg_zz_(p4[0], &(msq[5][5])); // |ggZZ|**2
4468  // The following WWZZ processes need no swapping because ZZ->4f (same type) is ordered such that 3/5 (C++: 2/4) swap gives W+W-.
4469  else if (process == TVar::HSMHiggs_WWZZ) gg_hvv_tb_(p4[0], msq[0]); // |ggHZZ+WW|**2
4470  else if (process == TVar::bkgWWZZ_SMHiggs) gg_vv_all_(p4[0], msq[0]); // |ggZZ + ggHZZ (+WW)|**2
4471  else if (process == TVar::bkgWWZZ) gg_vv_(p4[0], &(msq[5][5])); // |ggZZ+WW|**2
4472 
4473  if (verbosity>=TVar::DEBUG){
4474  MELAout << "\tTUtil::SumMatrixElementPDF: ZZGG && ZZ/WW/ZZ+WW MEs using ZZ (runstring: " << runstring_.runstring << ")" << endl;
4475  for (int i=0; i<NPart; i++) MELAout << "\tp["<<i<<"] (Px, Py, Pz, E):\t" << p4[0][i] << '\t' << p4[1][i] << '\t' << p4[2][i] << '\t' << p4[3][i] << endl;
4476  }
4477  }
4478  else if (isWW){
4479  if (process == TVar::HSMHiggs || process == TVar::HSMHiggs_WWZZ) gg_hvv_tb_(p4[0], msq[0]); // |ggHZZ+WW|**2
4480  else if (process == TVar::bkgWW_SMHiggs || process == TVar::bkgWWZZ_SMHiggs) gg_vv_all_(p4[0], msq[0]); // |ggZZ + ggHZZ (+WW)|**2
4481  else if (process == TVar::bkgWW || process == TVar::bkgWWZZ) gg_vv_(p4[0], &(msq[5][5])); // |ggZZ+WW|**2
4482  if (verbosity>=TVar::DEBUG){
4483  MELAout << "\tTUtil::SumMatrixElementPDF: ZZGG && ZZ/WW/ZZ+WW MEs using WW (runstring: " << runstring_.runstring << ")" << endl;
4484  for (int i=0; i<NPart; i++) MELAout << "\tp["<<i<<"] (Px, Py, Pz, E):\t" << p4[0][i] << '\t' << p4[1][i] << '\t' << p4[2][i] << '\t' << p4[3][i] << endl;
4485  }
4486  }
4487  else if (isGG){
4488  if (process == TVar::bkgGammaGamma){
4489  qqb_gamgam_(p4[0], msq[0]);
4490  for (int iquark=-5; iquark<=5; iquark++){
4491  for (int jquark=-5; jquark<=5; jquark++){
4492  if (iquark==0 && jquark==0) continue;
4493  msq[jquark+5][iquark+5] = 0;
4494  }
4495  }
4496  }
4497  }
4498 
4499  nInstances=WipeMEArray(process, production, id, msq, verbosity);
4500  if (
4502  &&
4504  ){
4505  msqjk = msq[5][5];
4506  }
4507  SumMEPDF(MomStore[0], MomStore[1], msq, RcdME, EBEAM, verbosity);
4508  }
4509  else if (
4510  production == TVar::Had_WH || production == TVar::Had_ZH
4511  || production == TVar::Had_WH_S || production == TVar::Had_ZH_S
4512  || production == TVar::Had_WH_TU || production == TVar::Had_ZH_TU
4513  || production == TVar::Lep_WH || production == TVar::Lep_ZH
4514  || production == TVar::Lep_WH_S || production == TVar::Lep_ZH_S
4515  || production == TVar::Lep_WH_TU || production == TVar::Lep_ZH_TU
4516  || production == TVar::JJVBF || production == TVar::JJEW || production == TVar::JJEWQCD
4517  || production == TVar::JJVBF_S || production == TVar::JJEW_S || production == TVar::JJEWQCD_S
4518  || production == TVar::JJVBF_TU || production == TVar::JJEW_TU || production == TVar::JJEWQCD_TU
4519  || production == TVar::JJQCD || production == TVar::JJQCD_S || production == TVar::JJQCD_TU
4520  ){
4521  // Z+2 jets
4522  if (process == TVar::bkgZJets) qqb_z2jet_(p4[0], msq[0]);
4523  // VBF or QCD MCFM SBI, S or B
4524  else if (isZZ && (process == TVar::bkgZZ_SMHiggs || process == TVar::HSMHiggs || process == TVar::bkgZZ)){
4525  if (
4526  production == TVar::Had_WH || production == TVar::Had_ZH
4527  || production == TVar::Had_WH_S || production == TVar::Had_ZH_S
4528  || production == TVar::Had_WH_TU || production == TVar::Had_ZH_TU
4529  || production == TVar::Lep_WH || production == TVar::Lep_ZH
4530  || production == TVar::Lep_WH_S || production == TVar::Lep_ZH_S
4531  || production == TVar::Lep_WH_TU || production == TVar::Lep_ZH_TU
4532  || production == TVar::JJVBF || production == TVar::JJEW
4533  || production == TVar::JJVBF_S || production == TVar::JJEW_S
4534  || production == TVar::JJVBF_TU || production == TVar::JJEW_TU
4535  ){
4536  /*
4537  if (process == TVar::bkgZZ){//
4538  qq_zzqq_bkg_(p4[0], msq[0]);
4539  if (PDGHelpers::isAnUnknownJet(id[partOrder.size()+2]) && PDGHelpers::isAnUnknownJet(id[partOrder.size()+3])){
4540  for (unsigned int ix=0; ix<4; ix++){
4541  for (int ip=0; ip<mxpart; ip++) p4_tmp[ix][ip]=p4[ix][ip];
4542  swap(p4_tmp[ix][partOrder.size()+2], p4_tmp[ix][partOrder.size()+3]);
4543  }
4544  qq_zzqq_bkg_(p4_tmp[0], msq_tmp[0]);
4545  for (int iquark=-5; iquark<=5; iquark++){ for (int jquark=-5; jquark<=5; jquark++){ msq[jquark+5][iquark+5] = (msq[jquark+5][iquark+5] + msq_tmp[jquark+5][iquark+5]); if (iquark==jquark) msq[jquark+5][iquark+5]*=0.5; } }
4546  }
4547  }
4548  else{//
4549  */
4550  qq_zzqq_(p4[0], msq[0]);
4551  if (PDGHelpers::isAnUnknownJet(id[partOrder.size()+2]) && PDGHelpers::isAnUnknownJet(id[partOrder.size()+3])){
4552  for (unsigned int ix=0; ix<4; ix++){
4553  for (int ip=0; ip<mxpart; ip++) p4_tmp[ix][ip]=p4[ix][ip];
4554  swap(p4_tmp[ix][partOrder.size()+2], p4_tmp[ix][partOrder.size()+3]);
4555  }
4556  qq_zzqq_(p4_tmp[0], msq_tmp[0]);
4557  for (int iquark=-5; iquark<=5; iquark++){ for (int jquark=-5; jquark<=5; jquark++){ msq[jquark+5][iquark+5] = (msq[jquark+5][iquark+5] + msq_tmp[jquark+5][iquark+5]); if (iquark==jquark) msq[jquark+5][iquark+5]*=0.5; } }
4558  }
4559  else if (PDGHelpers::isAnUnknownJet(id[partOrder.size()+2]) || PDGHelpers::isAnUnknownJet(id[partOrder.size()+3])){
4560  for (unsigned int ix=0; ix<4; ix++){
4561  for (int ip=0; ip<mxpart; ip++) p4_tmp[ix][ip]=p4[ix][ip];
4562  swap(p4_tmp[ix][partOrder.size()+2], p4_tmp[ix][partOrder.size()+3]);
4563  }
4564  TString strlabel[2] ={ (plabel_.plabel)[7], (plabel_.plabel)[6] }; for (unsigned int il=0; il<2; il++) strlabel[il].Resize(2);
4565  for (int ip=0; ip<mxpart; ip++){
4566  if (ip!=6 && ip!=7) sprintf((plabel_.plabel)[ip], (plabel_.plabel)[ip]);
4567  else sprintf((plabel_.plabel)[ip], strlabel[ip-6].Data());
4568  }
4569  qq_zzqq_(p4_tmp[0], msq_tmp[0]);
4570  if (verbosity>=TVar::DEBUG){
4571  MELAout << "TUtil::SumMatrixElementPDF: Adding missing contributions:\n";
4572  MELAout << "\tplabels:\n";
4573  for (int ip=0; ip<mxpart; ip++) MELAout << "\t[" << ip << "]=" << (plabel_.plabel)[ip] << endl;
4574  MELAout << "\tMEsq initial:" << endl;
4575  for (int iquark=-5; iquark<=5; iquark++){
4576  for (int jquark=-5; jquark<=5; jquark++) MELAout << msq[jquark+5][iquark+5] << '\t';
4577  MELAout << endl;
4578  }
4579  MELAout << "\tMEsq added:" << endl;
4580  for (int iquark=-5; iquark<=5; iquark++){
4581  for (int jquark=-5; jquark<=5; jquark++) MELAout << msq_tmp[jquark+5][iquark+5] << '\t';
4582  MELAout << endl;
4583  }
4584  }
4585  for (int iquark=-5; iquark<=5; iquark++){
4586  for (int jquark=-5; jquark<=5; jquark++){
4587  if (msq[jquark+5][iquark+5]==0.) msq[jquark+5][iquark+5] = msq_tmp[jquark+5][iquark+5];
4588  }
4589  }
4590  }
4591  //}//
4592  }
4593  else if (
4594  production == TVar::JJQCD || production == TVar::JJQCD_S || production == TVar::JJQCD_TU
4595  ){
4596  qq_zzqqstrong_(p4[0], msq[0]);
4597  if (PDGHelpers::isAnUnknownJet(id[partOrder.size()+2]) && PDGHelpers::isAnUnknownJet(id[partOrder.size()+3])){
4598  for (unsigned int ix=0; ix<4; ix++){
4599  for (int ip=0; ip<mxpart; ip++) p4_tmp[ix][ip]=p4[ix][ip];
4600  swap(p4_tmp[ix][partOrder.size()+2], p4_tmp[ix][partOrder.size()+3]);
4601  }
4602  qq_zzqqstrong_(p4_tmp[0], msq_tmp[0]);
4603  for (int iquark=-5; iquark<=5; iquark++){ for (int jquark=-5; jquark<=5; jquark++){ msq[jquark+5][iquark+5] = (msq[jquark+5][iquark+5] + msq_tmp[jquark+5][iquark+5]); if (iquark==jquark && iquark!=0) msq[jquark+5][iquark+5]*=0.5; } }
4604  // Subtract qqb/qbq->gg that was counted twice.
4605  TString gglabel = TUtil::GetMCFMParticleLabel(21, false, true);
4606  for (int ip=0; ip<mxpart; ip++){
4607  if (ip!=6 && ip!=7) sprintf((plabel_.plabel)[ip], (plabel_.plabel)[ip]);
4608  else sprintf((plabel_.plabel)[ip], gglabel.Data());
4609  }
4610  qq_zzqqstrong_(p4_tmp[0], msq_tmp[0]);
4611  for (int iquark=-5; iquark<=5; iquark++){ int jquark=-iquark; msq[jquark+5][iquark+5] = (msq[jquark+5][iquark+5] - msq_tmp[jquark+5][iquark+5]); }
4612  if (verbosity>=TVar::DEBUG){
4613  MELAout << "TUtil::SumMatrixElementPDF: Subtracting qqb/qbq->gg double-counted contribution:\n";
4614  MELAout << "\tplabels:\n";
4615  for (int ip=0; ip<mxpart; ip++) MELAout << "\t[" << ip << "]=" << (plabel_.plabel)[ip] << endl;
4616  MELAout << "\tMEsq:" << endl;
4617  for (int iquark=-5; iquark<=5; iquark++){
4618  for (int jquark=-5; jquark<=5; jquark++) MELAout << msq_tmp[jquark+5][iquark+5] << '\t';
4619  MELAout << endl;
4620  }
4621  }
4622  }
4623  else if ((PDGHelpers::isAnUnknownJet(id[partOrder.size()+2]) || PDGHelpers::isAnUnknownJet(id[partOrder.size()+3])) && !(PDGHelpers::isAGluon(id[partOrder.size()+2]) || PDGHelpers::isAGluon(id[partOrder.size()+3]))){
4624  for (unsigned int ix=0; ix<4; ix++){
4625  for (int ip=0; ip<mxpart; ip++) p4_tmp[ix][ip]=p4[ix][ip];
4626  swap(p4_tmp[ix][partOrder.size()+2], p4_tmp[ix][partOrder.size()+3]);
4627  }
4628  TString strlabel[2] ={ (plabel_.plabel)[7], (plabel_.plabel)[6] }; for (unsigned int il=0; il<2; il++) strlabel[il].Resize(2);
4629  for (int ip=0; ip<mxpart; ip++){
4630  if (ip!=6 && ip!=7) sprintf((plabel_.plabel)[ip], (plabel_.plabel)[ip]);
4631  else sprintf((plabel_.plabel)[ip], strlabel[ip-6].Data());
4632  }
4633  qq_zzqqstrong_(p4_tmp[0], msq_tmp[0]);
4634  if (verbosity>=TVar::DEBUG){
4635  MELAout << "TUtil::SumMatrixElementPDF: Adding missing contributions:\n";
4636  MELAout << "\tplabels:\n";
4637  for (int ip=0; ip<mxpart; ip++) MELAout << "\t[" << ip << "]=" << (plabel_.plabel)[ip] << endl;
4638  MELAout << "\tMEsq initial:" << endl;
4639  for (int iquark=-5; iquark<=5; iquark++){
4640  for (int jquark=-5; jquark<=5; jquark++) MELAout << msq[jquark+5][iquark+5] << '\t';
4641  MELAout << endl;
4642  }
4643  MELAout << "\tMEsq added:" << endl;
4644  for (int iquark=-5; iquark<=5; iquark++){
4645  for (int jquark=-5; jquark<=5; jquark++) MELAout << msq_tmp[jquark+5][iquark+5] << '\t';
4646  MELAout << endl;
4647  }
4648  }
4649  for (int iquark=-5; iquark<=5; iquark++){
4650  for (int jquark=-5; jquark<=5; jquark++){
4651  if (msq[jquark+5][iquark+5]==0.) msq[jquark+5][iquark+5] = msq_tmp[jquark+5][iquark+5];
4652  }
4653  }
4654  }
4655  }
4656  }
4657  else if (isWW && (process == TVar::bkgWW_SMHiggs || process == TVar::HSMHiggs || process == TVar::bkgWW)){
4658  if (
4659  production == TVar::Had_WH || production == TVar::Had_ZH
4660  || production == TVar::Had_WH_S || production == TVar::Had_ZH_S
4661  || production == TVar::Had_WH_TU || production == TVar::Had_ZH_TU
4662  || production == TVar::Lep_WH || production == TVar::Lep_ZH
4663  || production == TVar::Lep_WH_S || production == TVar::Lep_ZH_S
4664  || production == TVar::Lep_WH_TU || production == TVar::Lep_ZH_TU
4665  || production == TVar::JJVBF || production == TVar::JJEW
4666  || production == TVar::JJVBF_S || production == TVar::JJEW_S
4667  || production == TVar::JJVBF_TU || production == TVar::JJEW_TU
4668  ){
4669  qq_wwqq_(p4[0], msq[0]);
4670  if (PDGHelpers::isAnUnknownJet(id[partOrder.size()+2]) && PDGHelpers::isAnUnknownJet(id[partOrder.size()+3])){
4671  for (unsigned int ix=0; ix<4; ix++){
4672  for (int ip=0; ip<mxpart; ip++) p4_tmp[ix][ip]=p4[ix][ip];
4673  swap(p4_tmp[ix][partOrder.size()+2], p4_tmp[ix][partOrder.size()+3]);
4674  }
4675  qq_wwqq_(p4_tmp[0], msq_tmp[0]);
4676  for (int iquark=-5; iquark<=5; iquark++){ for (int jquark=-5; jquark<=5; jquark++){ msq[jquark+5][iquark+5] = (msq[jquark+5][iquark+5] + msq_tmp[jquark+5][iquark+5]); if (iquark==jquark) msq[jquark+5][iquark+5]*=0.5; } }
4677  }
4678  else if (PDGHelpers::isAnUnknownJet(id[partOrder.size()+2]) || PDGHelpers::isAnUnknownJet(id[partOrder.size()+3])){
4679  for (unsigned int ix=0; ix<4; ix++){
4680  for (int ip=0; ip<mxpart; ip++) p4_tmp[ix][ip]=p4[ix][ip];
4681  swap(p4_tmp[ix][partOrder.size()+2], p4_tmp[ix][partOrder.size()+3]);
4682  }
4683  TString strlabel[2] ={ (plabel_.plabel)[7], (plabel_.plabel)[6] }; for (unsigned int il=0; il<2; il++) strlabel[il].Resize(2);
4684  for (int ip=0; ip<mxpart; ip++){
4685  if (ip!=6 && ip!=7) sprintf((plabel_.plabel)[ip], (plabel_.plabel)[ip]);
4686  else sprintf((plabel_.plabel)[ip], strlabel[ip-6].Data());
4687  }
4688  qq_wwqq_(p4_tmp[0], msq_tmp[0]);
4689  if (verbosity>=TVar::DEBUG){
4690  MELAout << "TUtil::SumMatrixElementPDF: Adding missing contributions:\n";
4691  MELAout << "\tplabels:\n";
4692  for (int ip=0; ip<mxpart; ip++) MELAout << "\t[" << ip << "]=" << (plabel_.plabel)[ip] << endl;
4693  MELAout << "\tMEsq initial:" << endl;
4694  for (int iquark=-5; iquark<=5; iquark++){
4695  for (int jquark=-5; jquark<=5; jquark++) MELAout << msq[jquark+5][iquark+5] << '\t';
4696  MELAout << endl;
4697  }
4698  MELAout << "\tMEsq added:" << endl;
4699  for (int iquark=-5; iquark<=5; iquark++){
4700  for (int jquark=-5; jquark<=5; jquark++) MELAout << msq_tmp[jquark+5][iquark+5] << '\t';
4701  MELAout << endl;
4702  }
4703  }
4704  for (int iquark=-5; iquark<=5; iquark++){
4705  for (int jquark=-5; jquark<=5; jquark++){
4706  if (msq[jquark+5][iquark+5]==0.) msq[jquark+5][iquark+5] = msq_tmp[jquark+5][iquark+5];
4707  }
4708  }
4709  }
4710  }
4711  else if (
4712  production == TVar::JJQCD || production == TVar::JJQCD_S || production == TVar::JJQCD_TU
4713  ){
4714  qq_wwqqstrong_(p4[0], msq[0]);
4715  if (PDGHelpers::isAnUnknownJet(id[partOrder.size()+2]) && PDGHelpers::isAnUnknownJet(id[partOrder.size()+3])){
4716  for (unsigned int ix=0; ix<4; ix++){
4717  for (int ip=0; ip<mxpart; ip++) p4_tmp[ix][ip]=p4[ix][ip];
4718  swap(p4_tmp[ix][partOrder.size()+2], p4_tmp[ix][partOrder.size()+3]);
4719  }
4720  qq_wwqqstrong_(p4_tmp[0], msq_tmp[0]);
4721  for (int iquark=-5; iquark<=5; iquark++){ for (int jquark=-5; jquark<=5; jquark++){ msq[jquark+5][iquark+5] = (msq[jquark+5][iquark+5] + msq_tmp[jquark+5][iquark+5]); if (iquark==jquark && iquark!=0) msq[jquark+5][iquark+5]*=0.5; } }
4722  // Subtract qqb/qbq->gg that was counted twice.
4723  TString gglabel = TUtil::GetMCFMParticleLabel(21, false, true);
4724  for (int ip=0; ip<mxpart; ip++){
4725  if (ip!=6 && ip!=7) sprintf((plabel_.plabel)[ip], (plabel_.plabel)[ip]);
4726  else sprintf((plabel_.plabel)[ip], gglabel.Data());
4727  }
4728  qq_wwqqstrong_(p4_tmp[0], msq_tmp[0]);
4729  for (int iquark=-5; iquark<=5; iquark++){ int jquark=-iquark; msq[jquark+5][iquark+5] = (msq[jquark+5][iquark+5] - msq_tmp[jquark+5][iquark+5]); }
4730  if (verbosity>=TVar::DEBUG){
4731  MELAout << "TUtil::SumMatrixElementPDF: Subtracting qqb/qbq->gg double-counted contribution:\n";
4732  MELAout << "\tplabels:\n";
4733  for (int ip=0; ip<mxpart; ip++) MELAout << "\t[" << ip << "]=" << (plabel_.plabel)[ip] << endl;
4734  MELAout << "\tMEsq:" << endl;
4735  for (int iquark=-5; iquark<=5; iquark++){
4736  for (int jquark=-5; jquark<=5; jquark++) MELAout << msq_tmp[jquark+5][iquark+5] << '\t';
4737  MELAout << endl;
4738  }
4739  }
4740  }
4741  else if ((PDGHelpers::isAnUnknownJet(id[partOrder.size()+2]) || PDGHelpers::isAnUnknownJet(id[partOrder.size()+3])) && !(PDGHelpers::isAGluon(id[partOrder.size()+2]) || PDGHelpers::isAGluon(id[partOrder.size()+3]))){
4742  for (unsigned int ix=0; ix<4; ix++){
4743  for (int ip=0; ip<mxpart; ip++) p4_tmp[ix][ip]=p4[ix][ip];
4744  swap(p4_tmp[ix][partOrder.size()+2], p4_tmp[ix][partOrder.size()+3]);
4745  }
4746  TString strlabel[2] ={ (plabel_.plabel)[7], (plabel_.plabel)[6] }; for (unsigned int il=0; il<2; il++) strlabel[il].Resize(2);
4747  for (int ip=0; ip<mxpart; ip++){
4748  if (ip!=6 && ip!=7) sprintf((plabel_.plabel)[ip], (plabel_.plabel)[ip]);
4749  else sprintf((plabel_.plabel)[ip], strlabel[ip-6].Data());
4750  }
4751  qq_wwqqstrong_(p4_tmp[0], msq_tmp[0]);
4752  if (verbosity>=TVar::DEBUG){
4753  MELAout << "TUtil::SumMatrixElementPDF: Adding missing contributions:\n";
4754  MELAout << "\tplabels:\n";
4755  for (int ip=0; ip<mxpart; ip++) MELAout << "\t[" << ip << "]=" << (plabel_.plabel)[ip] << endl;
4756  MELAout << "\tMEsq initial:" << endl;
4757  for (int iquark=-5; iquark<=5; iquark++){
4758  for (int jquark=-5; jquark<=5; jquark++) MELAout << msq[jquark+5][iquark+5] << '\t';
4759  MELAout << endl;
4760  }
4761  MELAout << "\tMEsq added:" << endl;
4762  for (int iquark=-5; iquark<=5; iquark++){
4763  for (int jquark=-5; jquark<=5; jquark++) MELAout << msq_tmp[jquark+5][iquark+5] << '\t';
4764  MELAout << endl;
4765  }
4766  }
4767  for (int iquark=-5; iquark<=5; iquark++){
4768  for (int jquark=-5; jquark<=5; jquark++){
4769  if (msq[jquark+5][iquark+5]==0.) msq[jquark+5][iquark+5] = msq_tmp[jquark+5][iquark+5];
4770  }
4771  }
4772  }
4773  }
4774  }
4775  else if ((isWW || isZZ) && (process == TVar::bkgWWZZ_SMHiggs || process == TVar::HSMHiggs_WWZZ || process == TVar::bkgWWZZ)){
4776  if (
4777  production == TVar::Had_WH || production == TVar::Had_ZH
4778  || production == TVar::Had_WH_S || production == TVar::Had_ZH_S
4779  || production == TVar::Had_WH_TU || production == TVar::Had_ZH_TU
4780  || production == TVar::Lep_WH || production == TVar::Lep_ZH
4781  || production == TVar::Lep_WH_S || production == TVar::Lep_ZH_S
4782  || production == TVar::Lep_WH_TU || production == TVar::Lep_ZH_TU
4783  || production == TVar::JJVBF || production == TVar::JJEW
4784  || production == TVar::JJVBF_S || production == TVar::JJEW_S
4785  || production == TVar::JJVBF_TU || production == TVar::JJEW_TU
4786  ){
4787  qq_vvqq_(p4[0], msq[0]);
4788  if (PDGHelpers::isAnUnknownJet(id[partOrder.size()+2]) && PDGHelpers::isAnUnknownJet(id[partOrder.size()+3])){
4789  for (unsigned int ix=0; ix<4; ix++){
4790  for (int ip=0; ip<mxpart; ip++) p4_tmp[ix][ip]=p4[ix][ip];
4791  swap(p4_tmp[ix][partOrder.size()+2], p4_tmp[ix][partOrder.size()+3]);
4792  }
4793  qq_vvqq_(p4_tmp[0], msq_tmp[0]);
4794  for (int iquark=-5; iquark<=5; iquark++){ for (int jquark=-5; jquark<=5; jquark++){ msq[jquark+5][iquark+5] = (msq[jquark+5][iquark+5] + msq_tmp[jquark+5][iquark+5]); if (iquark==jquark) msq[jquark+5][iquark+5]*=0.5; } }
4795  }
4796  else if (PDGHelpers::isAnUnknownJet(id[partOrder.size()+2]) || PDGHelpers::isAnUnknownJet(id[partOrder.size()+3])){
4797  for (unsigned int ix=0; ix<4; ix++){
4798  for (int ip=0; ip<mxpart; ip++) p4_tmp[ix][ip]=p4[ix][ip];
4799  swap(p4_tmp[ix][partOrder.size()+2], p4_tmp[ix][partOrder.size()+3]);
4800  }
4801  TString strlabel[2] ={ (plabel_.plabel)[7], (plabel_.plabel)[6] }; for (unsigned int il=0; il<2; il++) strlabel[il].Resize(2);
4802  for (int ip=0; ip<mxpart; ip++){
4803  if (ip!=6 && ip!=7) sprintf((plabel_.plabel)[ip], (plabel_.plabel)[ip]);
4804  else sprintf((plabel_.plabel)[ip], strlabel[ip-6].Data());
4805  }
4806  qq_vvqq_(p4_tmp[0], msq_tmp[0]);
4807  if (verbosity>=TVar::DEBUG){
4808  MELAout << "TUtil::SumMatrixElementPDF: Adding missing contributions:\n";
4809  MELAout << "\tplabels:\n";
4810  for (int ip=0; ip<mxpart; ip++) MELAout << "\t[" << ip << "]=" << (plabel_.plabel)[ip] << endl;
4811  MELAout << "\tMEsq initial:" << endl;
4812  for (int iquark=-5; iquark<=5; iquark++){
4813  for (int jquark=-5; jquark<=5; jquark++) MELAout << msq[jquark+5][iquark+5] << '\t';
4814  MELAout << endl;
4815  }
4816  MELAout << "\tMEsq added:" << endl;
4817  for (int iquark=-5; iquark<=5; iquark++){
4818  for (int jquark=-5; jquark<=5; jquark++) MELAout << msq_tmp[jquark+5][iquark+5] << '\t';
4819  MELAout << endl;
4820  }
4821  }
4822  for (int iquark=-5; iquark<=5; iquark++){
4823  for (int jquark=-5; jquark<=5; jquark++){
4824  if (msq[jquark+5][iquark+5]==0.) msq[jquark+5][iquark+5] = msq_tmp[jquark+5][iquark+5];
4825  }
4826  }
4827  }
4828  }
4829  //else if (
4830  // production == TVar::JJQCD || production == TVar::JJQCD_S || production == TVar::JJQCD_TU
4831  // ); // No JJQCD-VV ME in MCFM
4832  }
4833 
4834  nInstances=WipeMEArray(process, production, id, msq, verbosity);
4835  msqjk = SumMEPDF(MomStore[0], MomStore[1], msq, RcdME, EBEAM, verbosity);
4836  }
4837 
4838  // Set aL/R 1,2 into RcdME
4839  if (PDGHelpers::isAZBoson(mela_event.intermediateVid.at(0))) RcdME->setVDaughterCouplings(zcouple_.l1, zcouple_.r1, 0);
4840  else if (PDGHelpers::isAWBoson(mela_event.intermediateVid.at(0))) RcdME->setVDaughterCouplings(1., 0., 0);
4841  else RcdME->setVDaughterCouplings(0., 0., 0);
4842  if (PDGHelpers::isAZBoson(mela_event.intermediateVid.at(1))) RcdME->setVDaughterCouplings(zcouple_.l2, zcouple_.r2, 1);
4843  else if (PDGHelpers::isAWBoson(mela_event.intermediateVid.at(1))) RcdME->setVDaughterCouplings(1., 0., 1);
4844  else RcdME->setVDaughterCouplings(0., 0., 1);
4845  // Reset some of these couplings if the decay is not actually ZZ or WW.
4846  if (
4848  ||
4850  ) RcdME->setVDaughterCouplings(0., 0., 1);
4851 
4852  if (msqjk != msqjk){
4853  if (verbosity>=TVar::ERROR) MELAout << "TUtil::SumMatrixElementPDF: "<< TVar::ProcessName(process) << " msqjk=" << msqjk << endl;
4854  for (int i=0; i<NPart; i++) MELAout << "p["<<i<<"] (Px, Py, Pz, E):\t" << p4[0][i] << '\t' << p4[1][i] << '\t' << p4[2][i] << '\t' << p4[3][i] << endl;
4855  MELAout << "TUtil::SumMatrixElementPDF: The number of ME instances: " << nInstances << ". MEsq[ip][jp] = " << endl;
4856  for (int iquark=-5; iquark<=5; iquark++){
4857  for (int jquark=-5; jquark<=5; jquark++) MELAout << msq[jquark+5][iquark+5] << '\t';
4858  MELAout << endl;
4859  }
4860  msqjk=0;
4861  }
4862  else if (verbosity>=TVar::DEBUG){
4863  MELAout << "TUtil::SumMatrixElementPDF: The number of ME instances: " << nInstances << ". MEsq[ip][jp] = " << endl;
4864  for (int iquark=-5; iquark<=5; iquark++){
4865  for (int jquark=-5; jquark<=5; jquark++) MELAout << msq[jquark+5][iquark+5] << '\t';
4866  MELAout << endl;
4867  }
4868  }
4869 
4870  if (verbosity>=TVar::DEBUG) MELAout
4871  << "TUtil::SumMatrixElementPDF: Reset AlphaS:\n"
4872  << "\tBefore reset, alphas scale: " << scale_.scale
4873  << ", PDF scale: " << facscale_.facscale
4874  << endl;
4875  SetAlphaS(defaultRenScale, defaultFacScale, 1., 1., defaultNloop, defaultNflav, defaultPdflabel);
4876  if (verbosity>=TVar::DEBUG) MELAout
4877  << "TUtil::SumMatrixElementPDF: Reset AlphaS result:\n"
4878  << "\tAfter reset, alphas scale: " << scale_.scale
4879  << ", PDF scale: " << facscale_.facscale
4880  << endl;
4881  } // End if doProceed
4882  if (verbosity>=TVar::DEBUG) MELAout << "End TUtil::SumMatrixElementPDF(" << msqjk << ")" << endl;
4883  return msqjk;
4884 }

◆ SumMEPDF()

double TUtil::SumMEPDF ( const TLorentzVector &  p0,
const TLorentzVector &  p1,
double  msq[nmsq][nmsq],
MelaIO RcdME,
const double &  EBEAM,
const TVar::VerbosityLevel verbosity 
)

Definition at line 8176 of file TUtil.cc.

8176  {
8177  if (verbosity>=TVar::DEBUG) MELAout << "Begin TUtil::SumMEPDF"<< endl;
8178  double fx1[nmsq]={ 0 };
8179  double fx2[nmsq]={ 0 };
8180  //double wgt_msq[nmsq][nmsq]={ { 0 } };
8181 
8182  ComputePDF(p0, p1, fx1, fx2, EBEAM, verbosity);
8183  if (verbosity>=TVar::DEBUG) MELAout << "TUtil::SumMEPDF: Setting RcdME"<< endl;
8184  RcdME->setPartonWeights(fx1, fx2);
8185  RcdME->setMEArray(msq, true);
8186  RcdME->computeWeightedMEArray();
8187  //RcdME->getWeightedMEArray(wgt_msq);
8188  if (verbosity>=TVar::DEBUG) MELAout << "End TUtil::SumMEPDF"<< endl;
8189  return RcdME->getSumME();
8190 }

◆ TTHiggsMatEl()

double TUtil::TTHiggsMatEl ( const TVar::Process process,
const TVar::Production production,
const TVar::MatrixElement matrixElement,
TVar::event_scales_type event_scales,
MelaIO RcdME,
const double &  EBEAM,
int  topDecay,
int  topProcess,
TVar::VerbosityLevel  verbosity 
)

Definition at line 7452 of file TUtil.cc.

7458  {
7459  const double GeV=1./100.; // JHUGen mom. scale factor
7460  double sum_msqjk = 0;
7461  double MatElsq[nmsq][nmsq]={ { 0 } };
7462 
7463  if (matrixElement!=TVar::JHUGen){ if (verbosity>=TVar::ERROR) MELAerr << "TUtil::TTHiggsMatEl: Non-JHUGen MEs are not supported." << endl; return sum_msqjk; }
7464  if (production!=TVar::ttH){ if (verbosity>=TVar::ERROR) MELAerr << "TUtil::TTHiggsMatEl: Only ttH is supported." << endl; return sum_msqjk; }
7465 
7466  int partIncCode;
7467  int nRequested_Tops=1;
7468  int nRequested_Antitops=1;
7469  if (topDecay>0) partIncCode=TVar::kUseAssociated_UnstableTops; // Look for unstable tops
7470  else partIncCode=TVar::kUseAssociated_StableTops; // Look for stable tops
7471 
7472  simple_event_record mela_event;
7473  mela_event.AssociationCode=partIncCode;
7474  mela_event.nRequested_Tops=nRequested_Tops;
7475  mela_event.nRequested_Antitops=nRequested_Antitops;
7477  RcdME->melaCand,
7478  mela_event,
7479  verbosity
7480  );
7481 
7482 
7483  if (topDecay==0 && (mela_event.pStableTops.size()<1 || mela_event.pStableAntitops.size()<1)){
7484  if (verbosity>=TVar::ERROR) MELAerr
7485  << "TUtil::TTHiggsMatEl: Number of stable tops (" << mela_event.pStableTops.size() << ")"
7486  << " and number of stable antitops (" << mela_event.pStableAntitops.size() << ")"
7487  << " in ttH process are not 1!" << endl;
7488  return sum_msqjk;
7489  }
7490  else if (topDecay>0 && (mela_event.pTopDaughters.size()<1 || mela_event.pAntitopDaughters.size()<1)){
7491  if (verbosity>=TVar::ERROR) MELAerr
7492  << "TUtil::TTHiggsMatEl: Number of set of top daughters (" << mela_event.pTopDaughters.size() << ")"
7493  << " and number of set of antitop daughters (" << mela_event.pAntitopDaughters.size() << ")"
7494  << " in ttH process are not 1!" << endl;
7495  return sum_msqjk;
7496  }
7497  else if (topDecay>0 && (mela_event.pTopDaughters.at(0).size()!=3 || mela_event.pAntitopDaughters.at(0).size()!=3)){
7498  if (verbosity>=TVar::ERROR) MELAerr
7499  << "TUtil::TTHiggsMatEl: Number of top daughters (" << mela_event.pTopDaughters.at(0).size() << ")"
7500  << " and number of antitop daughters (" << mela_event.pAntitopDaughters.at(0).size() << ")"
7501  << " in ttH process are not 3!" << endl;
7502  return sum_msqjk;
7503  }
7504 
7505  SimpleParticleCollection_t topDaughters;
7506  SimpleParticleCollection_t antitopDaughters;
7507  bool isUnknown[2]={ true, true };
7508 
7509  if (topDecay>0){
7510  // Daughters are assumed to have been ordered as b, Wf, Wfb already.
7511  for (unsigned int itd=0; itd<mela_event.pTopDaughters.at(0).size(); itd++) topDaughters.push_back(mela_event.pTopDaughters.at(0).at(itd));
7512  for (unsigned int itd=0; itd<mela_event.pAntitopDaughters.at(0).size(); itd++) antitopDaughters.push_back(mela_event.pAntitopDaughters.at(0).at(itd));
7513  }
7514  else{
7515  for (unsigned int itop=0; itop<mela_event.pStableTops.size(); itop++) topDaughters.push_back(mela_event.pStableTops.at(itop));
7516  for (unsigned int itop=0; itop<mela_event.pStableAntitops.size(); itop++) antitopDaughters.push_back(mela_event.pStableAntitops.at(itop));
7517  }
7518  // Check if either top is definitely identified
7519  for (unsigned int itd=0; itd<topDaughters.size(); itd++){ if (!PDGHelpers::isAnUnknownJet(topDaughters.at(itd).first)){ isUnknown[0]=false; break; } }
7520  for (unsigned int itd=0; itd<antitopDaughters.size(); itd++){ if (!PDGHelpers::isAnUnknownJet(antitopDaughters.at(itd).first)){ isUnknown[1]=false; break; } }
7521 
7522  // Start assigning the momenta
7523  // 0,1: p1 p2
7524  // 2-4: H,tb,t
7525  // 5-8: bb,W-,f,fb
7526  // 9-12: b,W+,fb,f
7527  double p4[13][4]={ { 0 } };
7528  double MYIDUP_prod[2]={ 0 };
7529  TLorentzVector MomStore[mxpart];
7530  for (int i = 0; i < mxpart; i++) MomStore[i].SetXYZT(0, 0, 0, 0);
7531  for (int ipar=0; ipar<2; ipar++){
7532  TLorentzVector* momTmp = &(mela_event.pMothers.at(ipar).second);
7533  int* idtmp = &(mela_event.pMothers.at(ipar).first);
7534  if (!PDGHelpers::isAnUnknownJet(*idtmp)) MYIDUP_prod[ipar] = *idtmp;
7535  else MYIDUP_prod[ipar] = 0;
7536  if (momTmp->T()>0.){
7537  p4[ipar][0] = -momTmp->T()*GeV;
7538  p4[ipar][1] = -momTmp->X()*GeV;
7539  p4[ipar][2] = -momTmp->Y()*GeV;
7540  p4[ipar][3] = -momTmp->Z()*GeV;
7541  MomStore[ipar] = (*momTmp);
7542  }
7543  else{
7544  p4[ipar][0] = momTmp->T()*GeV;
7545  p4[ipar][1] = momTmp->X()*GeV;
7546  p4[ipar][2] = momTmp->Y()*GeV;
7547  p4[ipar][3] = momTmp->Z()*GeV;
7548  MomStore[ipar] = -(*momTmp);
7549  MYIDUP_prod[ipar] = -MYIDUP_prod[ipar];
7550  }
7551  }
7552 
7553  // Assign top momenta
7554  // t(4) -> b(9) W+(10) (-> f(12) fb(11))
7555  const unsigned int t_pos=4;
7556  const unsigned int b_pos=9;
7557  const unsigned int Wp_pos=10;
7558  const unsigned int Wpf_pos=12;
7559  const unsigned int Wpfb_pos=11;
7560  for (unsigned int ipar=0; ipar<topDaughters.size(); ipar++){
7561  TLorentzVector* momTmp = &(topDaughters.at(ipar).second);
7562  if (topDaughters.size()==1){
7563  p4[t_pos][0] = momTmp->T()*GeV;
7564  p4[t_pos][1] = momTmp->X()*GeV;
7565  p4[t_pos][2] = momTmp->Y()*GeV;
7566  p4[t_pos][3] = momTmp->Z()*GeV;
7567  }
7568  // size==3
7569  else if (ipar==0){ // b
7570  p4[b_pos][0] = momTmp->T()*GeV;
7571  p4[b_pos][1] = momTmp->X()*GeV;
7572  p4[b_pos][2] = momTmp->Y()*GeV;
7573  p4[b_pos][3] = momTmp->Z()*GeV;
7574  }
7575  else if (ipar==2){ // Wfb
7576  p4[Wpfb_pos][0] = momTmp->T()*GeV;
7577  p4[Wpfb_pos][1] = momTmp->X()*GeV;
7578  p4[Wpfb_pos][2] = momTmp->Y()*GeV;
7579  p4[Wpfb_pos][3] = momTmp->Z()*GeV;
7580  p4[Wp_pos][0] += p4[Wpfb_pos][0];
7581  p4[Wp_pos][1] += p4[Wpfb_pos][1];
7582  p4[Wp_pos][2] += p4[Wpfb_pos][2];
7583  p4[Wp_pos][3] += p4[Wpfb_pos][3];
7584  }
7585  else/* if (ipar==1)*/{ // Wf
7586  p4[Wpf_pos][0] = momTmp->T()*GeV;
7587  p4[Wpf_pos][1] = momTmp->X()*GeV;
7588  p4[Wpf_pos][2] = momTmp->Y()*GeV;
7589  p4[Wpf_pos][3] = momTmp->Z()*GeV;
7590  p4[Wp_pos][0] += p4[Wpf_pos][0];
7591  p4[Wp_pos][1] += p4[Wpf_pos][1];
7592  p4[Wp_pos][2] += p4[Wpf_pos][2];
7593  p4[Wp_pos][3] += p4[Wpf_pos][3];
7594  }
7595  MomStore[6] = MomStore[6] + (*momTmp); // MomStore (I1, I2, 0, 0, 0, H, J1, J2)
7596  }
7597  if (topDaughters.size()!=1){ for (unsigned int ix=0; ix<4; ix++){ for (unsigned int ip=b_pos; ip<=Wp_pos; ip++) p4[t_pos][ix] = p4[ip][ix]; } }
7598 
7599  // Assign antitop momenta
7600  // tb(3) -> bb(5) W-(6) (-> f(7) fb(8))
7601  const unsigned int tb_pos=3;
7602  const unsigned int bb_pos=5;
7603  const unsigned int Wm_pos=6;
7604  const unsigned int Wmf_pos=7;
7605  const unsigned int Wmfb_pos=8;
7606  for (unsigned int ipar=0; ipar<antitopDaughters.size(); ipar++){
7607  TLorentzVector* momTmp = &(antitopDaughters.at(ipar).second);
7608  if (antitopDaughters.size()==1){
7609  p4[tb_pos][0] = momTmp->T()*GeV;
7610  p4[tb_pos][1] = momTmp->X()*GeV;
7611  p4[tb_pos][2] = momTmp->Y()*GeV;
7612  p4[tb_pos][3] = momTmp->Z()*GeV;
7613  }
7614  // size==3
7615  else if (ipar==0){ // bb
7616  p4[bb_pos][0] = momTmp->T()*GeV;
7617  p4[bb_pos][1] = momTmp->X()*GeV;
7618  p4[bb_pos][2] = momTmp->Y()*GeV;
7619  p4[bb_pos][3] = momTmp->Z()*GeV;
7620  }
7621  else if (ipar==1){ // Wf
7622  p4[Wmf_pos][0] = momTmp->T()*GeV;
7623  p4[Wmf_pos][1] = momTmp->X()*GeV;
7624  p4[Wmf_pos][2] = momTmp->Y()*GeV;
7625  p4[Wmf_pos][3] = momTmp->Z()*GeV;
7626  p4[Wm_pos][0] += p4[Wmf_pos][0];
7627  p4[Wm_pos][1] += p4[Wmf_pos][1];
7628  p4[Wm_pos][2] += p4[Wmf_pos][2];
7629  p4[Wm_pos][3] += p4[Wmf_pos][3];
7630  }
7631  else/* if (ipar==1)*/{ // Wfb
7632  p4[Wmfb_pos][0] = momTmp->T()*GeV;
7633  p4[Wmfb_pos][1] = momTmp->X()*GeV;
7634  p4[Wmfb_pos][2] = momTmp->Y()*GeV;
7635  p4[Wmfb_pos][3] = momTmp->Z()*GeV;
7636  p4[Wm_pos][0] += p4[Wmfb_pos][0];
7637  p4[Wm_pos][1] += p4[Wmfb_pos][1];
7638  p4[Wm_pos][2] += p4[Wmfb_pos][2];
7639  p4[Wm_pos][3] += p4[Wmfb_pos][3];
7640  }
7641  MomStore[7] = MomStore[7] + (*momTmp); // MomStore (I1, I2, 0, 0, 0, H, J1, J2)
7642  }
7643  if (antitopDaughters.size()!=1){ for (unsigned int ix=0; ix<4; ix++){ for (unsigned int ip=5; ip<=6; ip++) p4[tb_pos][ix] = p4[ip][ix]; } }
7644 
7645  for (unsigned int ipar=0; ipar<mela_event.pDaughters.size(); ipar++){
7646  TLorentzVector* momTmp = &(mela_event.pDaughters.at(ipar).second);
7647  p4[2][0] += momTmp->T()*GeV;
7648  p4[2][1] += momTmp->X()*GeV;
7649  p4[2][2] += momTmp->Y()*GeV;
7650  p4[2][3] += momTmp->Z()*GeV;
7651  MomStore[5] = MomStore[5] + (*momTmp); // i==(2, 3, 4) is (J1, J2, H), recorded as MomStore (I1, I2, 0, 0, 0, H, J1, J2)
7652  }
7653 
7654  if (verbosity >= TVar::DEBUG){
7655  for (int ii=0; ii<13; ii++){ MELAout << "p4[" << ii << "] = "; for (int jj=0; jj<4; jj++) MELAout << p4[ii][jj]/GeV << '\t'; MELAout << endl; }
7656  }
7657 
7658  double defaultRenScale = scale_.scale;
7659  double defaultFacScale = facscale_.facscale;
7660  int defaultNloop = nlooprun_.nlooprun;
7661  int defaultNflav = nflav_.nflav;
7662  string defaultPdflabel = pdlabel_.pdlabel;
7663  double renQ = InterpretScaleScheme(production, matrixElement, event_scales->renomalizationScheme, MomStore);
7664  double facQ = InterpretScaleScheme(production, matrixElement, event_scales->factorizationScheme, MomStore);
7665  SetAlphaS(renQ, facQ, event_scales->ren_scale_factor, event_scales->fac_scale_factor, 1, 5, "cteq6_l");
7666  double alphasVal, alphasmzVal;
7667  GetAlphaS(&alphasVal, &alphasmzVal);
7668  RcdME->setRenormalizationScale(renQ);
7669  RcdME->setFactorizationScale(facQ);
7670  RcdME->setAlphaS(alphasVal);
7671  RcdME->setAlphaSatMZ(alphasmzVal);
7672  RcdME->setHiggsMassWidth(masses_mcfm_.hmass, masses_mcfm_.hwidth, 0);
7674  if (verbosity>=TVar::DEBUG){
7675  MELAout
7676  << "TUtil::TTHiggsMatEl: Set AlphaS:\n"
7677  << "\tBefore set, alphas scale: " << defaultRenScale << ", PDF scale: " << defaultFacScale << '\n'
7678  << "\trenQ: " << renQ << " ( x " << event_scales->ren_scale_factor << "), facQ: " << facQ << " ( x " << event_scales->fac_scale_factor << ")\n"
7679  << "\tAfter set, alphas scale: " << scale_.scale << ", PDF scale: " << facscale_.facscale << ", alphas(Qren): " << alphasVal << ", alphas(MZ): " << alphasmzVal << endl;
7680  }
7681 
7683  /***** BEGIN TTH ME CALCULATION *****/
7684  for (unsigned int ib1=0; ib1<3; ib1++){
7685  if (topDaughters.size()==1 && ib1!=0) continue;
7686  else if (topDaughters.size()==3 && !PDGHelpers::isAnUnknownJet(topDaughters.at(0).first) && ib1!=0) continue;
7687  unsigned int b1index;
7688  if (ib1==0) b1index = b_pos;
7689  else if (ib1==1) b1index = Wpf_pos;
7690  else b1index = Wpfb_pos;
7691  for (unsigned int if1=0; if1<3; if1++){
7692  if (topDaughters.size()==1 && if1!=0) continue;
7693  else if (topDaughters.size()==3 && !PDGHelpers::isAnUnknownJet(topDaughters.at(1).first) && if1!=0) continue;
7694  unsigned int f1index;
7695  if (if1==0) f1index = Wpf_pos;
7696  else if (if1==2) f1index = b_pos;
7697  else f1index = Wpfb_pos;
7698  for (unsigned int ifb1=0; ifb1<3; ifb1++){
7699  if (topDaughters.size()==1 && ifb1!=0) continue;
7700  else if (topDaughters.size()==3 && !PDGHelpers::isAnUnknownJet(topDaughters.at(2).first) && ifb1!=0) continue;
7701  unsigned int fb1index;
7702  if (ifb1==2) fb1index = Wpf_pos;
7703  else if (ifb1==1) fb1index = b_pos;
7704  else fb1index = Wpfb_pos;
7705 
7706  if (b1index==f1index || b1index==fb1index || f1index==fb1index) continue;
7707 
7708  for (unsigned int ib2=0; ib2<3; ib2++){
7709  if (antitopDaughters.size()==1 && ib2!=0) continue;
7710  else if (antitopDaughters.size()==3 && !PDGHelpers::isAnUnknownJet(antitopDaughters.at(0).first) && ib2!=0) continue;
7711  unsigned int b2index;
7712  if (ib2==0) b2index = bb_pos;
7713  else if (ib2==1) b2index = Wmf_pos;
7714  else b2index = Wmfb_pos;
7715  for (unsigned int if2=0; if2<3; if2++){
7716  if (antitopDaughters.size()==1 && if2!=0) continue;
7717  else if (antitopDaughters.size()==3 && !PDGHelpers::isAnUnknownJet(antitopDaughters.at(1).first) && if2!=0) continue;
7718  unsigned int f2index;
7719  if (if2==0) f2index = Wmf_pos;
7720  else if (if2==2) f2index = bb_pos;
7721  else f2index = Wmfb_pos;
7722  for (unsigned int ifb2=0; ifb2<3; ifb2++){
7723  if (antitopDaughters.size()==1 && ifb2!=0) continue;
7724  else if (antitopDaughters.size()==3 && !PDGHelpers::isAnUnknownJet(antitopDaughters.at(2).first) && ifb2!=0) continue;
7725  unsigned int fb2index;
7726  if (ifb2==2) fb2index = Wmf_pos;
7727  else if (ifb2==1) fb2index = bb_pos;
7728  else fb2index = Wmfb_pos;
7729 
7730  if (b2index==f2index || b2index==fb2index || f2index==fb2index) continue;
7731 
7732  double p4_current[13][4]={ { 0 } };
7733  for (unsigned int ix=0; ix<4; ix++){
7734  for (unsigned int ip=0; ip<=2; ip++) p4_current[ip][ix] = p4[ip][ix]; // I1, I2, H do not change.
7735  p4_current[t_pos][ix] = p4[t_pos][ix]; // t does not change.
7736  p4_current[b1index][ix] = p4[b_pos][ix]; // Assign b to different position.
7737  p4_current[f1index][ix] = p4[Wpf_pos][ix]; // Assign Wp->f? to different position.
7738  p4_current[fb1index][ix] = p4[Wpfb_pos][ix]; // Assign Wp->?fb to different position.
7739  p4_current[Wp_pos][ix] = p4_current[Wpf_pos][ix] + p4_current[Wpfb_pos][ix]; // Re-sum W+ momentum.
7740 
7741  p4_current[tb_pos][ix] = p4[tb_pos][ix]; // tb does not change.
7742  p4_current[b2index][ix] = p4[bb_pos][ix]; // Assign bb to different position.
7743  p4_current[f2index][ix] = p4[Wmf_pos][ix]; // Assign Wm->f? to different position.
7744  p4_current[fb2index][ix] = p4[Wmfb_pos][ix]; // Assign Wm->?fb to different position.
7745  p4_current[Wm_pos][ix] = p4_current[Wmf_pos][ix] + p4_current[Wmfb_pos][ix]; // Re-sum W- momentum.
7746  }
7747  if (verbosity>=TVar::DEBUG){
7748  MELAout
7749  << "TUtil::TTHiggsMatEl: Unswapped instance for "
7750  << "b(" << b_pos << ") -> " << b1index << ", "
7751  << "Wpf(" << Wpf_pos << ") -> " << f1index << ", "
7752  << "Wpfb(" << Wpfb_pos << ") -> " << fb1index << ", "
7753  << "bb(" << bb_pos << ") -> " << b2index << ", "
7754  << "Wmf(" << Wmf_pos << ") -> " << f2index << ", "
7755  << "Wmfb(" << Wmfb_pos << ") -> " << fb2index << endl;
7756  for (int ii=0; ii<13; ii++){ MELAout << "p4_instance[" << ii << "] = "; for (int jj=0; jj<4; jj++) MELAout << p4_current[ii][jj]/GeV << '\t'; MELAout << endl; }
7757  MELAout << endl;
7758  }
7759 
7760  double MatElsq_tmp[nmsq][nmsq]={ { 0 } };
7761  double MatElsq_tmp_swap[nmsq][nmsq]={ { 0 } };
7762  __modttbhiggs_MOD_evalxsec_pp_ttbh(p4_current, &topProcess, MatElsq_tmp);
7763  if (isUnknown[0] && isUnknown[1]){
7764  for (unsigned int ix=0; ix<4; ix++){
7765  swap(p4_current[t_pos][ix], p4_current[tb_pos][ix]);
7766  swap(p4_current[b_pos][ix], p4_current[bb_pos][ix]);
7767  swap(p4_current[Wp_pos][ix], p4_current[Wm_pos][ix]);
7768  swap(p4_current[Wpf_pos][ix], p4_current[Wmf_pos][ix]);
7769  swap(p4_current[Wpfb_pos][ix], p4_current[Wmfb_pos][ix]);
7770  }
7771  __modttbhiggs_MOD_evalxsec_pp_ttbh(p4_current, &topProcess, MatElsq_tmp_swap);
7772  for (int ix=0; ix<11; ix++){ for (int iy=0; iy<11; iy++) MatElsq_tmp[iy][ix] = (MatElsq_tmp[iy][ix]+MatElsq_tmp_swap[iy][ix])/2.; }
7773  }
7774  for (int ix=0; ix<11; ix++){ for (int iy=0; iy<11; iy++) MatElsq[iy][ix] += MatElsq_tmp[iy][ix]; }
7775  if (verbosity>=TVar::DEBUG){
7776  MELAout
7777  << "TUtil::TTHiggsMatEl: Swapped instance for "
7778  << "b(" << b_pos << ") -> " << b1index << ", "
7779  << "Wpf(" << Wpf_pos << ") -> " << f1index << ", "
7780  << "Wpfb(" << Wpfb_pos << ") -> " << fb1index << ", "
7781  << "bb(" << bb_pos << ") -> " << b2index << ", "
7782  << "Wmf(" << Wmf_pos << ") -> " << f2index << ", "
7783  << "Wmfb(" << Wmfb_pos << ") -> " << fb2index << endl;
7784  for (int ii=0; ii<13; ii++){ MELAout << "p4_instance[" << ii << "] = "; for (int jj=0; jj<4; jj++) MELAout << p4_current[ii][jj]/GeV << '\t'; MELAout << endl; }
7785  MELAout << endl;
7786  }
7787  } // End loop over ifb2
7788  } // End loop over if2
7789  } // End loop over ib2
7790  } // End loop over ifb1
7791  } // End loop over if1
7792  } // End loop over ib1
7793  /***** END TTH ME CALCULATION *****/
7794  int defaultTopDecay=-1;
7795  __modjhugenmela_MOD_settopdecays(&defaultTopDecay); // reset top decay
7796 
7797  int GeVexponent_MEsq;
7798  if (topDecay>0) GeVexponent_MEsq = 4-(1+3*(nRequested_Tops+nRequested_Antitops))*2;
7799  else GeVexponent_MEsq = 4-(1+nRequested_Tops+nRequested_Antitops)*2;
7800  double constant = pow(GeV, -GeVexponent_MEsq);
7801  for (int ii=0; ii<nmsq; ii++){ for (int jj=0; jj<nmsq; jj++) MatElsq[jj][ii] *= constant; }
7802  if (verbosity>=TVar::DEBUG){
7803  MELAout << "TUtil::TTHiggsMatEl: MEsq[ip][jp] = " << endl;
7804  for (int iquark=-5; iquark<=5; iquark++){
7805  for (int jquark=-5; jquark<=5; jquark++) MELAout << MatElsq[jquark+5][iquark+5] << '\t';
7806  MELAout << endl;
7807  }
7808  }
7809  sum_msqjk = SumMEPDF(MomStore[0], MomStore[1], MatElsq, RcdME, EBEAM, verbosity);
7810 
7811  if (verbosity>=TVar::DEBUG){
7812  MELAout
7813  << "TUtil::TTHiggsMatEl: Reset AlphaS:\n"
7814  << "\tBefore reset, alphas scale: " << scale_.scale << ", PDF scale: " << facscale_.facscale << endl;
7815  }
7816  SetAlphaS(defaultRenScale, defaultFacScale, 1., 1., defaultNloop, defaultNflav, defaultPdflabel);
7817  if (verbosity>=TVar::DEBUG){
7818  GetAlphaS(&alphasVal, &alphasmzVal);
7819  MELAout
7820  << "TUtil::TTHiggsMatEl: Reset AlphaS result:\n"
7821  << "\tAfter reset, alphas scale: " << scale_.scale << ", PDF scale: " << facscale_.facscale << ", alphas(Qren): " << alphasVal << ", alphas(MZ): " << alphasmzVal << endl;
7822  }
7823  return sum_msqjk;
7824 }

◆ VHiggsMatEl()

double TUtil::VHiggsMatEl ( const TVar::Process process,
const TVar::Production production,
const TVar::MatrixElement matrixElement,
TVar::event_scales_type event_scales,
MelaIO RcdME,
const double &  EBEAM,
bool  includeHiggsDecay,
TVar::VerbosityLevel  verbosity 
)

Definition at line 6843 of file TUtil.cc.

6849  {
6850  const double GeV=1./100.; // JHUGen mom. scale factor
6851  double sum_msqjk = 0;
6852  // by default assume only gg productions
6853  // FOTRAN convention -5 -4 -3 -2 -1 0 1 2 3 4 5
6854  // parton flavor bbar cbar sbar ubar dbar g d u s c b
6855  // C++ convention 0 1 2 3 4 5 6 7 8 9 10
6856  //2-D matrix is reversed in fortran
6857  // msq[ parton2 ] [ parton1 ]
6858  // flavor_msq[jj][ii] = fx1[ii]*fx2[jj]*msq[jj][ii];
6859  double MatElsq[nmsq][nmsq]={ { 0 } };
6860 
6861  if (matrixElement!=TVar::JHUGen){ if (verbosity>=TVar::ERROR) MELAerr << "TUtil::VHiggsMatEl: Non-JHUGen MEs are not supported" << endl; return sum_msqjk; }
6862  if (!(production == TVar::Lep_ZH || production == TVar::Lep_WH || production == TVar::Had_ZH || production == TVar::Had_WH || production == TVar::GammaH)){ if (verbosity>=TVar::ERROR) MELAerr << "TUtil::VHiggsMatEl: Production is not supported!" << endl; return sum_msqjk; }
6863 
6864  int nRequested_AssociatedJets=0;
6865  int nRequested_AssociatedLeptons=0;
6866  int nRequested_AssociatedPhotons=0;
6867  int AssociationVCompatibility=0;
6868  int partIncCode=TVar::kNoAssociated; // Just to avoid warnings
6869  if (production == TVar::Had_ZH || production == TVar::Had_WH){ // Only use associated partons
6870  partIncCode=TVar::kUseAssociated_Jets;
6871  nRequested_AssociatedJets=2;
6872  }
6873  else if (production == TVar::Lep_ZH || production == TVar::Lep_WH){ // Only use associated leptons(+)neutrinos
6874  partIncCode=TVar::kUseAssociated_Leptons;
6875  nRequested_AssociatedLeptons=2;
6876  }
6877  else if (production == TVar::GammaH){ // Only use associated photon
6878  partIncCode=TVar::kUseAssociated_Photons;
6879  nRequested_AssociatedPhotons=1;
6880  }
6881  if (production == TVar::Lep_WH || production == TVar::Had_WH) AssociationVCompatibility=24;
6882  else if (production == TVar::Lep_ZH || production == TVar::Had_ZH) AssociationVCompatibility=23;
6883  else if (production == TVar::GammaH) AssociationVCompatibility=22;
6884  simple_event_record mela_event;
6885  mela_event.AssociationCode=partIncCode;
6886  mela_event.AssociationVCompatibility=AssociationVCompatibility;
6887  mela_event.nRequested_AssociatedJets=nRequested_AssociatedJets;
6888  mela_event.nRequested_AssociatedLeptons=nRequested_AssociatedLeptons;
6889  mela_event.nRequested_AssociatedPhotons=nRequested_AssociatedPhotons;
6891  RcdME->melaCand,
6892  mela_event,
6893  verbosity
6894  );
6895  if ((mela_event.pAssociated.size()<(unsigned int)(nRequested_AssociatedJets+nRequested_AssociatedLeptons) && production!=TVar::GammaH) || (mela_event.pAssociated.size()<(unsigned int)nRequested_AssociatedPhotons && production == TVar::GammaH)){
6896  if (verbosity>=TVar::ERROR){
6897  MELAerr << "TUtil::VHiggsMatEl: Number of associated particles (" << mela_event.pAssociated.size() << ") is less than ";
6898  if (production!=TVar::GammaH) MELAerr << (nRequested_AssociatedJets+nRequested_AssociatedLeptons);
6899  else MELAerr << nRequested_AssociatedPhotons;
6900  MELAerr << endl;
6901  }
6902  return sum_msqjk;
6903  }
6904 
6905  int MYIDUP_prod[4]={ 0 }; // "Incoming" partons 1, 2, "outgoing" partons 3, 4
6906  int MYIDUP_dec[2]={ -9000, -9000 }; // "Outgoing" partons 1, 2 from the Higgs (->bb)
6907  double p4[9][4] ={ { 0 } };
6908  double helicities[9] ={ 0 };
6909  int vh_ids[9] ={ 0 };
6910  TLorentzVector MomStore[mxpart];
6911  for (int i = 0; i < mxpart; i++) MomStore[i].SetXYZT(0, 0, 0, 0);
6912 
6913  // p4(0:8,i) = (E(i),px(i),py(i),pz(i))
6914  // i=0,1: q1, qb2 (outgoing convention)
6915  // i=2,3: V*, V
6916  // i=4: H
6917  // i=5,6: f, fb from V
6918  // i=7,8: b, bb from H
6919  for (int ipar=0; ipar<2; ipar++){
6920  TLorentzVector* momTmp = &(mela_event.pMothers.at(ipar).second);
6921  int* idtmp = &(mela_event.pMothers.at(ipar).first);
6922  if (!PDGHelpers::isAnUnknownJet(*idtmp)) MYIDUP_prod[ipar] = *idtmp;
6923  else MYIDUP_prod[ipar] = 0;
6924  if (momTmp->T()>0.){
6925  p4[ipar][0] = momTmp->T()*GeV;
6926  p4[ipar][1] = momTmp->X()*GeV;
6927  p4[ipar][2] = momTmp->Y()*GeV;
6928  p4[ipar][3] = momTmp->Z()*GeV;
6929  MomStore[ipar] = (*momTmp);
6930  }
6931  else{
6932  p4[ipar][0] = -momTmp->T()*GeV;
6933  p4[ipar][1] = -momTmp->X()*GeV;
6934  p4[ipar][2] = -momTmp->Y()*GeV;
6935  p4[ipar][3] = -momTmp->Z()*GeV;
6936  MomStore[ipar] = -(*momTmp);
6937  MYIDUP_prod[ipar] = -MYIDUP_prod[ipar];
6938  }
6939  }
6940  // Associated particles
6941  for (int ipar=0; ipar<(production!=TVar::GammaH ? 2 : 1); ipar++){
6942  TLorentzVector* momTmp = &(mela_event.pAssociated.at(ipar).second);
6943  int* idtmp = &(mela_event.pAssociated.at(ipar).first);
6944  if (!PDGHelpers::isAnUnknownJet(*idtmp)) MYIDUP_prod[ipar+2] = *idtmp;
6945  else MYIDUP_prod[ipar+2] = 0;
6946  p4[ipar+5][0] = momTmp->T()*GeV;
6947  p4[ipar+5][1] = momTmp->X()*GeV;
6948  p4[ipar+5][2] = momTmp->Y()*GeV;
6949  p4[ipar+5][3] = momTmp->Z()*GeV;
6950  MomStore[ipar+6] = (*momTmp);
6951  }
6952  if (production == TVar::GammaH) MYIDUP_prod[3]=-9000;
6953 
6954  if (PDGHelpers::isAGluon(MYIDUP_prod[0]) || PDGHelpers::isAGluon(MYIDUP_prod[1])){ if (verbosity>=TVar::INFO) MELAerr << "TUtil::VHiggsMatEl: Initial state gluons are not permitted!" << endl; return sum_msqjk; }
6955  if (PDGHelpers::isAGluon(MYIDUP_prod[2]) || PDGHelpers::isAGluon(MYIDUP_prod[3])){ if (verbosity>=TVar::INFO) MELAerr << "TUtil::VHiggsMatEl: Final state gluons are not permitted!" << endl; return sum_msqjk; }
6956  if (production == TVar::GammaH && !PDGHelpers::isAPhoton(MYIDUP_prod[2])){ if (verbosity>=TVar::ERROR) MELAerr << "TUtil::VHiggsMatEl: GammaH associated photon (id=" << MYIDUP_prod[2] << ") is not a photon! Please fix its id." << endl; return sum_msqjk; }
6957 
6958  // Decay V/f ids
6959  // MYIDUP_dec as size=2 because JHUGen supports b-bbar decay
6960  for (int iv=0; iv<2; iv++){
6961  int idtmp = mela_event.intermediateVid.at(iv);
6962  if (!PDGHelpers::isAnUnknownJet(idtmp)) MYIDUP_dec[iv] = idtmp;
6963  else MYIDUP_dec[iv] = 0;
6964  }
6965  // Decay daughters
6966  for (unsigned int ipar=0; ipar<mela_event.pDaughters.size(); ipar++){
6967  TLorentzVector* momTmp = &(mela_event.pDaughters.at(ipar).second);
6968  if (mela_event.pDaughters.size()==1){
6969  p4[ipar+7][0] = momTmp->T()*GeV;
6970  p4[ipar+7][1] = momTmp->X()*GeV;
6971  p4[ipar+7][2] = momTmp->Y()*GeV;
6972  p4[ipar+7][3] = momTmp->Z()*GeV;
6973  MomStore[5] = (*momTmp); // 5
6974  }
6975  else if (mela_event.pDaughters.size()==2){
6976  p4[ipar+7][0] = momTmp->T()*GeV;
6977  p4[ipar+7][1] = momTmp->X()*GeV;
6978  p4[ipar+7][2] = momTmp->Y()*GeV;
6979  p4[ipar+7][3] = momTmp->Z()*GeV;
6980  MomStore[2*ipar+2] = (*momTmp); // 2,4
6981  if (PDGHelpers::isAQuark(mela_event.pDaughters.at(ipar).first)) MYIDUP_dec[ipar]=mela_event.pDaughters.at(ipar).first;
6982  }
6983  else if (mela_event.pDaughters.size()==3){
6984  if (ipar<2){
6985  p4[7][0] += momTmp->T()*GeV;
6986  p4[7][1] += momTmp->X()*GeV;
6987  p4[7][2] += momTmp->Y()*GeV;
6988  p4[7][3] += momTmp->Z()*GeV;
6989  }
6990  else{
6991  p4[8][0] = momTmp->T()*GeV;
6992  p4[8][1] = momTmp->X()*GeV;
6993  p4[8][2] = momTmp->Y()*GeV;
6994  p4[8][3] = momTmp->Z()*GeV;
6995  }
6996  MomStore[ipar+2] = (*momTmp); // 2,3,4
6997  }
6998  else if (mela_event.pDaughters.size()==4){
6999  if (ipar<2){
7000  p4[7][0] += momTmp->T()*GeV;
7001  p4[7][1] += momTmp->X()*GeV;
7002  p4[7][2] += momTmp->Y()*GeV;
7003  p4[7][3] += momTmp->Z()*GeV;
7004  }
7005  else{
7006  p4[8][0] += momTmp->T()*GeV;
7007  p4[8][1] += momTmp->X()*GeV;
7008  p4[8][2] += momTmp->Y()*GeV;
7009  p4[8][3] += momTmp->Z()*GeV;
7010  }
7011  MomStore[ipar+2] = (*momTmp); // 2,3,4,5
7012  }
7013  else{ // Should never happen
7014  p4[7][0] += momTmp->T()*GeV;
7015  p4[7][1] += momTmp->X()*GeV;
7016  p4[7][2] += momTmp->Y()*GeV;
7017  p4[7][3] += momTmp->Z()*GeV;
7018  MomStore[5] = MomStore[5] + (*momTmp);
7019  }
7020  }
7021  for (int ix=0; ix<4; ix++){
7022  p4[3][ix] = p4[5][ix] + p4[6][ix];
7023  p4[4][ix] = p4[7][ix] + p4[8][ix];
7024  p4[2][ix] = p4[3][ix] + p4[4][ix];
7025  }
7026 
7027  vh_ids[4] = 25;
7028  if (production == TVar::Lep_ZH || production == TVar::Had_ZH || production == TVar::GammaH) vh_ids[2] = 23;
7029  else if (production == TVar::Lep_WH || production == TVar::Had_WH) vh_ids[2] = 24; // To be changed later
7030  if (production!=TVar::GammaH) vh_ids[3] = vh_ids[2]; // To be changed later for WH
7031  else vh_ids[3] = 22;
7032 
7033  // H->ffb decay is turned off, so no need to loop over helicities[7]=helicities[8]=+-1
7034  vh_ids[7] = 5; helicities[7] = 1;
7035  vh_ids[8] = -5; helicities[8] = 1;
7036  int HDKon = 0;
7037  if (includeHiggsDecay && MYIDUP_dec[0]!=-9000 && MYIDUP_dec[1]!=-9000 && MYIDUP_dec[0]==-MYIDUP_dec[1]){ // H->ffb
7038  HDKon=1;
7040  if (verbosity>=TVar::DEBUG) MELAout << "TUtil::VHiggsMatEl: HDKon" << endl;
7041  }
7042  else if (verbosity>=TVar::INFO && includeHiggsDecay) MELAerr << "TUtil::VHiggsMatEl: includeHiggsDecay=true is not supported for the present decay mode." << endl;
7043 
7044  if (verbosity>=TVar::DEBUG){
7045  for (int i=0; i<9; i++) MELAout << "p4(" << vh_ids[i] << ") = " << p4[i][0] << ", " << p4[i][1] << ", " << p4[i][2] << ", " << p4[i][3] << "\n";
7046  }
7047 
7048  double defaultRenScale = scale_.scale;
7049  double defaultFacScale = facscale_.facscale;
7050  int defaultNloop = nlooprun_.nlooprun;
7051  int defaultNflav = nflav_.nflav;
7052  string defaultPdflabel = pdlabel_.pdlabel;
7053  double renQ = InterpretScaleScheme(production, matrixElement, event_scales->renomalizationScheme, MomStore);
7054  double facQ = InterpretScaleScheme(production, matrixElement, event_scales->factorizationScheme, MomStore);
7055  SetAlphaS(renQ, facQ, event_scales->ren_scale_factor, event_scales->fac_scale_factor, 1, 5, "cteq6_l");
7056  double alphasVal, alphasmzVal;
7057  GetAlphaS(&alphasVal, &alphasmzVal);
7058  RcdME->setRenormalizationScale(renQ);
7059  RcdME->setFactorizationScale(facQ);
7060  RcdME->setAlphaS(alphasVal);
7061  RcdME->setAlphaSatMZ(alphasmzVal);
7062  RcdME->setHiggsMassWidth(masses_mcfm_.hmass, masses_mcfm_.hwidth, 0);
7064  if (verbosity>=TVar::DEBUG){
7065  MELAout
7066  << "TUtil::VHiggsMatEl: Set AlphaS:\n"
7067  << "\tBefore set, alphas scale: " << defaultRenScale << ", PDF scale: " << defaultFacScale << '\n'
7068  << "\trenQ: " << renQ << " ( x " << event_scales->ren_scale_factor << "), facQ: " << facQ << " ( x " << event_scales->fac_scale_factor << ")\n"
7069  << "\tAfter set, alphas scale: " << scale_.scale << ", PDF scale: " << facscale_.facscale << ", alphas(Qren): " << alphasVal << ", alphas(MZ): " << alphasmzVal << endl;
7070  }
7071 
7072  // Since we have a lot of these checks, do them here.
7073  bool partonIsKnown[4];
7074  for (unsigned int ip=0; ip<4; ip++) partonIsKnown[ip] = (MYIDUP_prod[ip]!=0);
7075  if ((production == TVar::Lep_WH || production == TVar::Lep_ZH || production == TVar::GammaH) && !(partonIsKnown[2] && partonIsKnown[3])){ if (verbosity>=TVar::INFO) MELAerr << "TUtil::VHiggsMatEl: Final state particles in leptonic/photonic VH have to have a definite id!" << endl; return sum_msqjk; }
7076 
7077  const double allowed_helicities[2] ={ -1, 1 }; // L,R
7078  // Setup outgoing H decay products (H->f fbar), templated with H->b bar if both fermions are unknown.
7079  vector<pair<int, int>> Hffparticles;
7080  double Hffscale=1;
7081  if (HDKon!=0){
7082  if (!PDGHelpers::isAnUnknownJet(MYIDUP_dec[0]) || !PDGHelpers::isAnUnknownJet(MYIDUP_dec[1])){ // If one particle is known, pick that line
7083  if (!PDGHelpers::isAnUnknownJet(MYIDUP_dec[0])) Hffparticles.push_back(pair<int, int>(MYIDUP_dec[0], -MYIDUP_dec[0]));
7084  else Hffparticles.push_back(pair<int, int>(-MYIDUP_dec[1], MYIDUP_dec[1]));
7085  }
7086  else{ // Else loop over possible quark lines
7087  double Hffscalesum=0;
7088  for (int hquark=1; hquark<=5; hquark++){
7089  double Hffmass = __modparameters_MOD_getmass(&hquark);
7090  Hffscalesum += Hffmass;
7091  if (hquark==5){
7092  Hffparticles.push_back(pair<int, int>(hquark, -hquark));
7093  Hffparticles.push_back(pair<int, int>(-hquark, hquark));
7094  Hffscale /= Hffmass;
7095  }
7096  }
7097  Hffscale *= Hffscalesum;
7098  }
7099  }
7100  if (verbosity>=TVar::DEBUG){
7101  MELAout << "TUtil::VHiggsMatEl: Outgoing H-> f fbar particles to compute for the ME template:" << endl;
7102  for (unsigned int ihf=0; ihf<Hffparticles.size(); ihf++) MELAout << "\t - (id8, id9) = (" << Hffparticles.at(ihf).first << ", " << Hffparticles.at(ihf).second << ")" << endl;
7103  MELAout << "TUtil::VHiggsMatEl: ME scale for the H-> f fbar particles: " << Hffscale << endl;
7104  }
7105 
7106  if (production == TVar::Lep_WH || production == TVar::Had_WH){
7107  // Setup incoming partons
7108  vector<pair<int, int>> incomingPartons;
7109  if (partonIsKnown[0] && partonIsKnown[1]) incomingPartons.push_back(pair<int, int>(MYIDUP_prod[0], MYIDUP_prod[1])); // Parton 0 and 1 are both known
7110  // FIXME: The following 2/1 assignments assume the CKM element for this pair is non-zero (there are divisions by Vckmsq_in/out later on).
7111  else if (!partonIsKnown[0] && !partonIsKnown[1]){ // Parton 0 and 1 are unknown
7112  // Consider all 4 incoming cases: d au, au d, u ad, ad u
7113  incomingPartons.push_back(pair<int, int>(1, -2)); // du~ -> W-
7114  incomingPartons.push_back(pair<int, int>(-2, 1)); // u~d -> W-
7115  incomingPartons.push_back(pair<int, int>(2, -1)); // ud~ -> W+
7116  incomingPartons.push_back(pair<int, int>(-1, 2)); // d~u -> W+
7117  }
7118  else if (!partonIsKnown[1] && partonIsKnown[0]){ // Parton 0 is known
7119  // Consider the only possible general cases
7120  if (PDGHelpers::isUpTypeQuark(MYIDUP_prod[0])){ // ud~ or u~d
7121  for (int iqf=1; iqf<=5; iqf++){
7122  if (iqf%2==0) continue;
7123  int jqf = -TMath::Sign(iqf, MYIDUP_prod[0]);
7124  double ckm_test = __modparameters_MOD_ckmbare(&(MYIDUP_prod[0]), &jqf);
7125  if (ckm_test!=0.){ incomingPartons.push_back(pair<int, int>(MYIDUP_prod[0], jqf)); break; }
7126  }
7127  }
7128  else if (PDGHelpers::isDownTypeQuark(MYIDUP_prod[0])){ // du~ or d~u
7129  for (int iqf=2; iqf<=4; iqf++){
7130  if (iqf%2==1) continue;
7131  int jqf = -TMath::Sign(iqf, MYIDUP_prod[0]);
7132  double ckm_test = __modparameters_MOD_ckmbare(&(MYIDUP_prod[0]), &jqf);
7133  if (ckm_test!=0.){ incomingPartons.push_back(pair<int, int>(MYIDUP_prod[0], jqf)); break; }
7134  }
7135  }
7136  }
7137  else/* if (!partonIsKnown[0] && partonIsKnown[1])*/{ // Parton 1 is known
7138  // Consider the only possible general cases
7139  if (PDGHelpers::isUpTypeQuark(MYIDUP_prod[1])){ // ud~ or u~d
7140  for (int iqf=1; iqf<=5; iqf++){
7141  if (iqf%2==0) continue;
7142  int jqf = -TMath::Sign(iqf, MYIDUP_prod[1]);
7143  double ckm_test = __modparameters_MOD_ckmbare(&jqf, &(MYIDUP_prod[1]));
7144  if (ckm_test!=0.){ incomingPartons.push_back(pair<int, int>(jqf, MYIDUP_prod[1])); break; }
7145  }
7146  }
7147  else if (PDGHelpers::isDownTypeQuark(MYIDUP_prod[1])){ // du~ or d~u
7148  for (int iqf=2; iqf<=4; iqf++){
7149  if (iqf%2==1) continue;
7150  int jqf = -TMath::Sign(iqf, MYIDUP_prod[1]);
7151  double ckm_test = __modparameters_MOD_ckmbare(&jqf, &(MYIDUP_prod[1]));
7152  if (ckm_test!=0.){ incomingPartons.push_back(pair<int, int>(jqf, MYIDUP_prod[1])); break; }
7153  }
7154  }
7155  }
7156  if (verbosity>=TVar::DEBUG){
7157  MELAout << "TUtil::VHiggsMatEl: Incoming partons to compute for the ME template:" << endl;
7158  for (auto& inpart:incomingPartons) MELAout << "\t - (id1, id2) = (" << inpart.first << ", " << inpart.second << ")" << endl;
7159  }
7160 
7161  // Setup outgoing partons
7162  vector<pair<int, int>> outgoingPartons;
7163  if (partonIsKnown[2] && partonIsKnown[3]) outgoingPartons.push_back(pair<int, int>(MYIDUP_prod[2], MYIDUP_prod[3])); // Parton 0 and 1 are both known or Lep_WH
7164  // FIXME: The following 2/1 assignments assume the CKM element for this pair is non-zero (there are divisions by Vckmsq_in/out later on).
7165  else if (!partonIsKnown[2] && !partonIsKnown[3]){ // Parton 0 and 1 are unknown
7166  // Consider all 4 outgoing cases: d au, au d, u ad, ad u
7167  outgoingPartons.push_back(pair<int, int>(1, -2)); // W- -> du~
7168  outgoingPartons.push_back(pair<int, int>(-2, 1)); // W- -> u~d
7169  outgoingPartons.push_back(pair<int, int>(2, -1)); // W+ -> ud~
7170  outgoingPartons.push_back(pair<int, int>(-1, 2)); // W+ -> d~u
7171  }
7172  else if (!partonIsKnown[3] && partonIsKnown[2]){ // Parton 0 is known
7173  // Consider the only possible general cases
7174  if (PDGHelpers::isUpTypeQuark(MYIDUP_prod[2])){ // ud~ or u~d
7175  for (int iqf=1; iqf<=5; iqf++){
7176  if (iqf%2==0) continue;
7177  int jqf = -TMath::Sign(iqf, MYIDUP_prod[2]);
7178  double ckm_test = __modparameters_MOD_ckmbare(&(MYIDUP_prod[2]), &jqf);
7179  if (ckm_test!=0.){ outgoingPartons.push_back(pair<int, int>(MYIDUP_prod[2], jqf)); break; }
7180  }
7181  }
7182  else if (PDGHelpers::isDownTypeQuark(MYIDUP_prod[2])){ // du~ or d~u
7183  for (int iqf=2; iqf<=4; iqf++){
7184  if (iqf%2==1) continue;
7185  int jqf = -TMath::Sign(iqf, MYIDUP_prod[2]);
7186  double ckm_test = __modparameters_MOD_ckmbare(&(MYIDUP_prod[2]), &jqf);
7187  if (ckm_test!=0.){ outgoingPartons.push_back(pair<int, int>(MYIDUP_prod[2], jqf)); break; }
7188  }
7189  }
7190  }
7191  else/* if (!partonIsKnown[2] && partonIsKnown[3])*/{ // Parton 1 is known
7192  // Consider the only possible general cases
7193  if (PDGHelpers::isUpTypeQuark(MYIDUP_prod[3])){ // ud~ or u~d
7194  for (int iqf=1; iqf<=5; iqf++){
7195  if (iqf%2==0) continue;
7196  int jqf = -TMath::Sign(iqf, MYIDUP_prod[3]);
7197  double ckm_test = __modparameters_MOD_ckmbare(&jqf, &(MYIDUP_prod[3]));
7198  if (ckm_test!=0.){ outgoingPartons.push_back(pair<int, int>(jqf, MYIDUP_prod[3])); break; }
7199  }
7200  }
7201  else if (PDGHelpers::isDownTypeQuark(MYIDUP_prod[3])){ // du~ or d~u
7202  for (int iqf=2; iqf<=4; iqf++){
7203  if (iqf%2==1) continue;
7204  int jqf = -TMath::Sign(iqf, MYIDUP_prod[3]);
7205  double ckm_test = __modparameters_MOD_ckmbare(&jqf, &(MYIDUP_prod[3]));
7206  if (ckm_test!=0.){ outgoingPartons.push_back(pair<int, int>(jqf, MYIDUP_prod[3])); break; }
7207  }
7208  }
7209  }
7210  if (verbosity>=TVar::DEBUG){
7211  MELAout << "TUtil::VHiggsMatEl: Outgoing particles to compute for the ME template:" << endl;
7212  for (auto& outpart:outgoingPartons) MELAout << "\t - (id6, id7) = (" << outpart.first << ", " << outpart.second << ")" << endl;
7213  }
7214 
7215  for (auto& inpart:incomingPartons){
7216  vh_ids[0] = inpart.first;
7217  vh_ids[1] = inpart.second;
7218  vh_ids[2] = PDGHelpers::getCoupledVertex(vh_ids[0], vh_ids[1]);
7219  if (!PDGHelpers::isAWBoson(vh_ids[2])) continue;
7220  if (verbosity>=TVar::DEBUG) MELAout << "\tIncoming " << vh_ids[0] << "," << vh_ids[1] << " -> " << vh_ids[2] << endl;
7221 
7222  double Vckmsq_in = pow(__modparameters_MOD_ckmbare(&(vh_ids[0]), &(vh_ids[1])), 2);
7223  if (verbosity>=TVar::DEBUG) MELAout << "\tNeed to divide the ME by |VCKM_incoming|**2 = " << Vckmsq_in << endl;
7224 
7225  for (auto& outpart:outgoingPartons){
7226  vh_ids[5] = outpart.first;
7227  vh_ids[6] = outpart.second;
7228  vh_ids[3] = PDGHelpers::getCoupledVertex(vh_ids[5], vh_ids[6]);
7229  if (vh_ids[2]!=vh_ids[3]) continue;
7230  if (verbosity>=TVar::DEBUG) MELAout << "\t\tOutgoing " << vh_ids[3] << " -> " << vh_ids[5] << "," << vh_ids[6] << endl;
7231 
7232  // Compute a raw ME
7233  double msq=0;
7234  for (int h01 = 0; h01 < 2; h01++){
7235  helicities[0] = allowed_helicities[h01];
7236  helicities[1] = -helicities[0];
7237  for (int h56 = 0; h56 < 2; h56++){
7238  helicities[5] = allowed_helicities[h56];
7239  helicities[6] = -helicities[5];
7240 
7241  double msq_inst=0;
7242  if (HDKon==0) __modvhiggs_MOD_evalamp_vhiggs(vh_ids, helicities, p4, &msq_inst);
7243  else{
7244  for (int h78=0; h78<2; h78++){
7245  helicities[7]=allowed_helicities[h78];
7246  helicities[8]=allowed_helicities[h78];
7247  for (unsigned int ihf=0; ihf<Hffparticles.size(); ihf++){
7248  vh_ids[7]=Hffparticles.at(ihf).first;
7249  vh_ids[8]=Hffparticles.at(ihf).second;
7250  double msq_inst_LR=0;
7251  __modvhiggs_MOD_evalamp_vhiggs(vh_ids, helicities, p4, &msq_inst_LR);
7252  msq_inst += msq_inst_LR;
7253  } // End loop over template H->f fbar products
7254  } // End loop over the spin of H->f fbar line
7255  msq_inst *= Hffscale;
7256  } // End HDKon!=0
7257  msq += msq_inst;
7258  } // End loop over h56
7259  } // End loop over h01
7260 
7261  // Determine the outgoing scale
7262  double scalesum_out=0;
7263  if (!(partonIsKnown[2] && partonIsKnown[3])){
7264  double Vckmsq_out = pow(__modparameters_MOD_ckm(&(vh_ids[5]), &(vh_ids[6])), 2);
7265  if (verbosity>=TVar::DEBUG) MELAout << "\t\tDividing ME by |VCKM_outgoing|**2 = " << Vckmsq_out << endl;
7266  msq /= Vckmsq_out;
7267  for (int outgoing1=1; outgoing1<=nf; outgoing1++){
7268  if (partonIsKnown[2] && outgoing1!=abs(vh_ids[5])) continue;
7269  if (outgoing1%2!=abs(vh_ids[5])%2 || outgoing1==6) continue;
7270  int iout = outgoing1 * TMath::Sign(1, vh_ids[5]);
7271  for (int outgoing2=1; outgoing2<=nf; outgoing2++){
7272  if (partonIsKnown[3] && outgoing2!=abs(vh_ids[6])) continue;
7273  if (outgoing2%2!=abs(vh_ids[6])%2 || outgoing2==6) continue;
7274  int jout = outgoing2 * TMath::Sign(1, vh_ids[6]);
7275  scalesum_out += pow(__modparameters_MOD_ckm(&(iout), &(jout)), 2);
7276  }
7277  }
7278  }
7279  else scalesum_out = 1;
7280  if (verbosity>=TVar::DEBUG) MELAout << "\t\tScale for outgoing particles: " << scalesum_out << endl;
7281 
7282  // Divide ME by the incoming scale factor (will be multiplied again inside the loop)
7283  if (!partonIsKnown[0] || !partonIsKnown[1]){
7284  if (verbosity>=TVar::DEBUG) MELAout << "\t\tDividing ME by |VCKM_incoming|**2 = " << Vckmsq_in << endl;
7285  msq /= Vckmsq_in;
7286  }
7287 
7288  // Sum all possible combinations
7289  for (int incoming1=1; incoming1<=nf; incoming1++){
7290  if (partonIsKnown[0] && incoming1!=abs(vh_ids[0])) continue;
7291  if (incoming1%2!=abs(vh_ids[0])%2 || incoming1==6) continue;
7292  int iin = incoming1 * TMath::Sign(1, vh_ids[0]);
7293  for (int incoming2=1; incoming2<=nf; incoming2++){
7294  if (partonIsKnown[1] && incoming2!=abs(vh_ids[1])) continue;
7295  if (incoming2%2!=abs(vh_ids[1])%2 || incoming2==6) continue;
7296  int jin = incoming2 * TMath::Sign(1, vh_ids[1]);
7297  if (verbosity>=TVar::DEBUG) MELAout << "\t\t\tiin,jin = " << iin << "," << jin << endl;
7298  double scale_in=1;
7299  if (!partonIsKnown[0] || !partonIsKnown[1]){
7300  scale_in = pow(__modparameters_MOD_ckmbare(&(iin), &(jin)), 2);
7301  if (verbosity>=TVar::DEBUG) MELAout << "\t\tScale for incoming particles: " << scale_in << endl;
7302  }
7303  MatElsq[jin+5][iin+5] += msq * 0.25 * scale_in *scalesum_out;
7304  }
7305  }
7306  // msq is now added to MatElSq.
7307  } // End loop over outgoing particle templates
7308  } // End loop over incoming parton templates
7309  } // End WH
7310  else{ // ZH, GammaH
7311  // Setup incoming partons
7312  vector<pair<int, int>> incomingPartons;
7313  if (partonIsKnown[0] && partonIsKnown[1]) incomingPartons.push_back(pair<int, int>(MYIDUP_prod[0], MYIDUP_prod[1])); // Parton 0 and 1 are both known
7314  else if (!partonIsKnown[0] && !partonIsKnown[1]){ // Parton 0 and 1 are unknown
7315  // Consider all 4 incoming cases: d ad, ad d, u au, au u
7316  incomingPartons.push_back(pair<int, int>(1, -1)); // dd~ -> Z
7317  incomingPartons.push_back(pair<int, int>(-1, 1)); // d~d -> Z
7318  incomingPartons.push_back(pair<int, int>(2, -2)); // uu~ -> Z
7319  incomingPartons.push_back(pair<int, int>(-2, 2)); // u~u -> Z
7320  }
7321  else if (!partonIsKnown[1] && partonIsKnown[0]) // Parton 0 is known
7322  incomingPartons.push_back(pair<int, int>(MYIDUP_prod[0], -MYIDUP_prod[0])); // id1, -id1
7323  else/* if (!partonIsKnown[0] && partonIsKnown[1])*/ // Parton 1 is known
7324  incomingPartons.push_back(pair<int, int>(-MYIDUP_prod[1], MYIDUP_prod[1])); // -id2, id2
7325  if (verbosity>=TVar::DEBUG){
7326  MELAout << "TUtil::VHiggsMatEl: Incoming partons to compute for the ME template:" << endl;
7327  for (auto& inpart:incomingPartons) MELAout << "\t - (id1, id2) = (" << inpart.first << ", " << inpart.second << ")" << endl;
7328  }
7329 
7330  // Setup outgoing partons
7331  vector<pair<int, int>> outgoingPartons;
7332  if ((partonIsKnown[2] && partonIsKnown[3]) || production == TVar::GammaH) outgoingPartons.push_back(pair<int, int>(MYIDUP_prod[2], MYIDUP_prod[3])); // Parton 0 and 1 are both known or Lep_ZH
7333  else if (!partonIsKnown[2] && !partonIsKnown[3]){ // Parton 0 and 1 are unknown
7334  // Consider all 4 outgoing cases: d au, au d, u ad, ad u
7335  outgoingPartons.push_back(pair<int, int>(1, -1)); // Z -> dd~
7336  outgoingPartons.push_back(pair<int, int>(-1, 1)); // Z -> d~d
7337  outgoingPartons.push_back(pair<int, int>(2, -2)); // Z -> uu~
7338  outgoingPartons.push_back(pair<int, int>(-2, 2)); // Z -> u~u
7339  }
7340  else if (!partonIsKnown[3] && partonIsKnown[2]) // Parton 0 is known
7341  outgoingPartons.push_back(pair<int, int>(MYIDUP_prod[2], -MYIDUP_prod[2])); // id1, -id1
7342  else/* if (!partonIsKnown[2] && partonIsKnown[3])*/ // Parton 1 is known
7343  outgoingPartons.push_back(pair<int, int>(-MYIDUP_prod[3], MYIDUP_prod[3])); // -id2, id2
7344  if (verbosity>=TVar::DEBUG){
7345  MELAout << "TUtil::VHiggsMatEl: Outgoing particles to compute for the ME template:" << endl;
7346  for (unsigned int op=0; op<outgoingPartons.size(); op++) MELAout << "\t - (id6, id7) = (" << outgoingPartons.at(op).first << ", " << outgoingPartons.at(op).second << ")" << endl;
7347  }
7348 
7349  for (auto& inpart:incomingPartons){
7350  vh_ids[0] = inpart.first;
7351  vh_ids[1] = inpart.second;
7352  vh_ids[2] = PDGHelpers::getCoupledVertex(vh_ids[0], vh_ids[1]);
7353  if (!PDGHelpers::isAZBoson(vh_ids[2])) continue; // Notice, Z-> Gamma + H should also have the id of the Z!
7354  if (verbosity>=TVar::DEBUG) MELAout << "\tIncoming " << vh_ids[0] << "," << vh_ids[1] << " -> " << vh_ids[2] << endl;
7355 
7356  // Scale for the incoming state is 1
7357 
7358  for (auto& outpart:outgoingPartons){
7359  vh_ids[5] = outpart.first;
7360  vh_ids[6] = outpart.second;
7361  if (production == TVar::GammaH) vh_ids[3] = 22;
7362  else{
7363  vh_ids[3] = PDGHelpers::getCoupledVertex(vh_ids[5], vh_ids[6]);
7364  if (vh_ids[2]!=vh_ids[3]) continue;
7365  }
7366  if (verbosity>=TVar::DEBUG) MELAout << "\t\tOutgoing " << vh_ids[3] << " -> " << vh_ids[5] << "," << vh_ids[6] << endl;
7367 
7368  // Compute a raw ME
7369  double msq=0;
7370  for (int h01 = 0; h01 < 2; h01++){
7371  helicities[0] = allowed_helicities[h01];
7372  helicities[1] = -helicities[0];
7373  for (int h56 = 0; h56 < 2; h56++){
7374  helicities[5] = allowed_helicities[h56];
7375  helicities[6] = -helicities[5];
7376 
7377  double msq_inst=0;
7378  if (HDKon==0) __modvhiggs_MOD_evalamp_vhiggs(vh_ids, helicities, p4, &msq_inst);
7379  else{
7380  for (int h78=0; h78<2; h78++){
7381  helicities[7]=allowed_helicities[h78];
7382  helicities[8]=allowed_helicities[h78];
7383  for (unsigned int ihf=0; ihf<Hffparticles.size(); ihf++){
7384  vh_ids[7]=Hffparticles.at(ihf).first;
7385  vh_ids[8]=Hffparticles.at(ihf).second;
7386  double msq_inst_LR=0;
7387  __modvhiggs_MOD_evalamp_vhiggs(vh_ids, helicities, p4, &msq_inst_LR);
7388  msq_inst += msq_inst_LR;
7389  } // End loop over template H->f fbar products
7390  } // End loop over the spin of H->f fbar line
7391  msq_inst *= Hffscale;
7392  } // End HDKon!=0
7393  msq += msq_inst;
7394  } // End loop over h56
7395  } // End loop over h01
7396 
7397  // Determine the outgoing scale
7398  double scale_out=1;
7399  if (!partonIsKnown[2] && !partonIsKnown[3] && production!=TVar::GammaH){
7400  if (PDGHelpers::isDownTypeQuark(vh_ids[5])) scale_out=3;
7401  else if (PDGHelpers::isUpTypeQuark(vh_ids[5])) scale_out=2;
7402  }
7403  if (verbosity>=TVar::DEBUG) MELAout << "\t\tScale for outgoing particles: " << scale_out << endl;
7404 
7405  // Sum all possible combinations
7406  for (int incoming1=1; incoming1<=nf; incoming1++){
7407  if (partonIsKnown[0] && incoming1!=abs(vh_ids[0])) continue;
7408  if (incoming1%2!=abs(vh_ids[0])%2 || incoming1==6) continue;
7409  int iin = incoming1 * TMath::Sign(1, vh_ids[0]);
7410  int jin=-iin;
7411  if (verbosity>=TVar::DEBUG) MELAout << "\t\t\tiin,jin = " << iin << "," << jin << endl;
7412  MatElsq[jin+5][iin+5] += msq * 0.25 * scale_out; // No incoming state scale
7413  }
7414  // msq is now added to MatElSq.
7415  } // End loop over outgoing particle templates
7416  } // End loop over incoming parton templates
7417  } // End ZH, GammaH
7418 
7419  int GeVexponent_MEsq;
7420  if (HDKon==0) GeVexponent_MEsq = 4-(1+nRequested_AssociatedJets+nRequested_AssociatedLeptons+nRequested_AssociatedPhotons)*2-4; // Amplitude has additional 1/m**2 from propagator == MEsq has additional 1/m**4
7421  else GeVexponent_MEsq = 4-(2+nRequested_AssociatedJets+nRequested_AssociatedLeptons+nRequested_AssociatedPhotons)*2;
7422  double constant = pow(GeV, -GeVexponent_MEsq);
7423  for (int ii=0; ii<nmsq; ii++){ for (int jj=0; jj<nmsq; jj++) MatElsq[jj][ii] *= constant; }
7424  if (verbosity >= TVar::DEBUG){
7425  MELAout << "MatElsq:\n";
7426  for (int ii = 0; ii < nmsq; ii++){ for (int jj = 0; jj < nmsq; jj++) MELAout << MatElsq[jj][ii] << '\t'; MELAout << endl; }
7427  }
7428  sum_msqjk = SumMEPDF(MomStore[0], MomStore[1], MatElsq, RcdME, EBEAM, verbosity);
7429 
7430  // Turn H_DK off
7431  if (HDKon!=0){
7432  HDKon=0;
7434  }
7435 
7436  if (verbosity>=TVar::DEBUG){
7437  MELAout
7438  << "TUtil::VHiggsMatEl: Reset AlphaS:\n"
7439  << "\tBefore reset, alphas scale: " << scale_.scale << ", PDF scale: " << facscale_.facscale << endl;
7440  }
7441  SetAlphaS(defaultRenScale, defaultFacScale, 1., 1., defaultNloop, defaultNflav, defaultPdflabel);
7442  if (verbosity>=TVar::DEBUG){
7443  GetAlphaS(&alphasVal, &alphasmzVal);
7444  MELAout
7445  << "TUtil::VHiggsMatEl: Reset AlphaS result:\n"
7446  << "\tAfter reset, alphas scale: " << scale_.scale << ", PDF scale: " << facscale_.facscale << ", alphas(Qren): " << alphasVal << ", alphas(MZ): " << alphasmzVal << endl;
7447  }
7448  return sum_msqjk;
7449 }

◆ WipeMEArray()

int TUtil::WipeMEArray ( const TVar::Process process,
const TVar::Production production,
const int  id[mxpart],
double  msq[nmsq][nmsq],
const TVar::VerbosityLevel verbosity 
)

Definition at line 7994 of file TUtil.cc.

7994  {
7995  if (verbosity>=TVar::DEBUG){
7996  MELAout << "TUtil::WipeMEArray: Initial MEsq:" << endl;
7997  for (int iquark=-5; iquark<=5; iquark++){
7998  for (int jquark=-5; jquark<=5; jquark++) MELAout << msq[jquark+5][iquark+5] << '\t';
7999  MELAout << endl;
8000  }
8001  }
8002  int nInstances=0;
8003  if (
8004  (production == TVar::ZZINDEPENDENT || production == TVar::ZZQQB)
8005  ||
8006  ((production == TVar::ZZQQB_STU || production == TVar::ZZQQB_S || production == TVar::ZZQQB_TU) && process == TVar::bkgZZ)
8007  ){
8008  // Sum over valid MEs without PDF weights
8009  // By far the dominant contribution is uub initial state.
8010  for (int iquark=-5; iquark<=5; iquark++){
8011  for (int jquark=-5; jquark<=5; jquark++){
8012  if (
8013  (PDGHelpers::isAnUnknownJet(id[0]) || (PDGHelpers::isAGluon(id[0]) && iquark==0) || iquark==id[0])
8014  &&
8015  (PDGHelpers::isAnUnknownJet(id[1]) || (PDGHelpers::isAGluon(id[1]) && jquark==0) || jquark==id[1])
8016  ){
8017  if (msq[jquark+5][iquark+5]>0.) nInstances++;
8018  }
8019  else msq[jquark+5][iquark+5]=0; // Kill the ME instance if mothers are known and their ids do not match the PDF indices.
8020  }
8021  }
8022  }
8023  else if (production == TVar::ZZGG){
8024  if (
8026  &&
8028  ){
8029  if (msq[5][5]>0.) nInstances=1;
8030  }
8031  else msq[5][5]=0; // Kill the ME instance if mothers are known and their ids do not match to gluons.
8032  }
8033  else if (
8034  production == TVar::Had_WH || production == TVar::Had_ZH
8035  || production == TVar::Had_WH_S || production == TVar::Had_ZH_S
8036  || production == TVar::Had_WH_TU || production == TVar::Had_ZH_TU
8037  || production == TVar::Lep_WH || production == TVar::Lep_ZH
8038  || production == TVar::Lep_WH_S || production == TVar::Lep_ZH_S
8039  || production == TVar::Lep_WH_TU || production == TVar::Lep_ZH_TU
8040  || production == TVar::JJVBF || production == TVar::JJEW || production == TVar::JJEWQCD
8041  || production == TVar::JJVBF_S || production == TVar::JJEW_S || production == TVar::JJEWQCD_S
8042  || production == TVar::JJVBF_TU || production == TVar::JJEW_TU || production == TVar::JJEWQCD_TU
8043  || production == TVar::JJQCD || production == TVar::JJQCD_S || production == TVar::JJQCD_TU
8044  ){
8045  // Z+2 jets
8046  if (process == TVar::bkgZJets){
8047  for (int iquark=-5; iquark<=5; iquark++){
8048  for (int jquark=-5; jquark<=5; jquark++){
8049  if (
8050  (PDGHelpers::isAnUnknownJet(id[0]) || (PDGHelpers::isAGluon(id[0]) && iquark==0) || iquark==id[0])
8051  &&
8052  (PDGHelpers::isAnUnknownJet(id[1]) || (PDGHelpers::isAGluon(id[1]) && jquark==0) || jquark==id[1])
8053  ){
8054  if (msq[jquark+5][iquark+5]>0.) nInstances++;
8055  }
8056  else msq[jquark+5][iquark+5]=0; // Kill the ME instance if mothers are known and their ids do not match the PDF indices.
8057  }
8058  }
8059  }
8060  // VBF or QCD MCFM SBI, S or B
8061  else{
8062  for (int iquark=-5; iquark<=5; iquark++){
8063  for (int jquark=-5; jquark<=5; jquark++){
8064  if (
8065  (
8066  PDGHelpers::isAnUnknownJet(id[0]) || (PDGHelpers::isAGluon(id[0]) && iquark==0) || iquark==id[0]
8067  )
8068  &&
8069  (
8070  PDGHelpers::isAnUnknownJet(id[1]) || (PDGHelpers::isAGluon(id[1]) && jquark==0) || jquark==id[1]
8071  )
8072  ){
8073  // Kill all non-VH initial parton states
8074  if (
8075  (
8076  (
8077  production == TVar::Had_WH || production == TVar::Lep_WH
8078  || production == TVar::Had_WH_S || production == TVar::Lep_WH_S
8079  || production == TVar::Had_WH_TU || production == TVar::Lep_WH_TU
8080  )
8081  &&
8082  (
8083  (TMath::Sign(1, iquark)==TMath::Sign(1, jquark))
8084  ||
8086  ||
8088  )
8089  )
8090  ||
8091  (
8092  (
8093  production == TVar::Had_ZH || production == TVar::Lep_ZH
8094  || production == TVar::Had_ZH_S || production == TVar::Lep_ZH_S
8095  || production == TVar::Had_ZH_TU || production == TVar::Lep_ZH_TU
8096  )
8097  &&
8098  (iquark!=-jquark)
8099  )
8100  ) msq[jquark+5][iquark+5]=0;
8101 
8102  // Check against a hash
8103  int order[2]={ -1, -1 };
8104  TMCFMUtils::AssociatedParticleOrdering_QQVVQQAny(iquark, jquark, id[6], id[7], order);
8105  if (order[0]<0 || order[1]<0) msq[jquark+5][iquark+5]=0;
8106 
8107  if (msq[jquark+5][iquark+5]>0.) nInstances++;
8108  }
8109  else msq[jquark+5][iquark+5]=0; // Kill the ME instance if mothers are known and their ids do not match the PDF indices.
8110  }
8111  }
8112  }
8113  }
8114  return nInstances;
8115 }

Variable Documentation

◆ forbidMassiveJets

bool TUtil::forbidMassiveJets = true

Definition at line 28 of file TUtil.cc.

◆ forbidMassiveLeptons

bool TUtil::forbidMassiveLeptons = true

Remove fermion mass if the flag is set to true.

Definition at line 27 of file TUtil.cc.

◆ JetMassScheme

Definition at line 30 of file TUtil.cc.

◆ LeptonMassScheme

Definition at line 29 of file TUtil.cc.

madMela::update_all_coup
void update_all_coup(const TVar::Process &process, const TVar::Production &production)
This is the function that redirects the SMEFTSim calculations to the correct process and production m...
Definition: MadMela.cc:414
TVar::H1plus
@ H1plus
Definition: TVar.hh:148
TVar::ERROR
@ ERROR
Definition: TVar.hh:49
TVar::bkgWW_SMHiggs
@ bkgWW_SMHiggs
Definition: TVar.hh:170
anonymous_namespace{TCouplingsBase.hh}::gMDL_cdwim
@ gMDL_cdwim
Definition: TCouplingsBase.hh:308
MelaIO::setMEArray
void setMEArray(double MEsq_[nmsq][nmsq], bool transpose=false)
Definition: MelaIO.h:63
gHIGGS_VV_4_PRIME7
@ gHIGGS_VV_4_PRIME7
Definition: raw_couplings.txt:55
anonymous_namespace{TCouplingsBase.hh}::gMDL_cee
@ gMDL_cee
Definition: TCouplingsBase.hh:272
anonymous_namespace{TCouplingsBase.hh}::gMDL_chq1
@ gMDL_chq1
Definition: TCouplingsBase.hh:259
SimpleParticle_t
std::pair< int, TLorentzVector > SimpleParticle_t
Definition: TVar.hh:24
TUtil::scaleMomentumToEnergy
void scaleMomentumToEnergy(const TLorentzVector &massiveJet, TLorentzVector &masslessJet, double mass=0)
Definition: TUtil.cc:68
TUtil::MCFM_chooser
bool MCFM_chooser(const TVar::Process &process, const TVar::Production &production, const TVar::LeptonInterference &leptonInterf, const TVar::VerbosityLevel &verbosity, const TVar::simple_event_record &mela_event)
Definition: TUtil.cc:1857
MelaIO::setFactorizationScale
void setFactorizationScale(const double &val)
Definition: MelaIO.h:135
anonymous_namespace{TCouplingsBase.hh}::gMDL_cqq3
@ gMDL_cqq3
Definition: TCouplingsBase.hh:268
gHIGGS_VV_4_PRIME4
@ gHIGGS_VV_4_PRIME4
Definition: raw_couplings.txt:43
__modhiggs_MOD_evalamp_h_vv
void __modhiggs_MOD_evalamp_h_vv(double P[6][4], int *MYIDUP, double *MatElSq)
TVar::JJVBF
@ JJVBF
Definition: TVar.hh:72
PDGHelpers::isALepton
bool isALepton(const int id)
Definition: PDGHelpers.cc:62
anonymous_namespace{TCouplingsBase.hh}::gMDL_cuhre
@ gMDL_cuhre
Definition: TCouplingsBase.hh:246
TVar::Dynamic_qJJ_qH
@ Dynamic_qJJ_qH
Definition: TVar.hh:206
anonymous_namespace{TCouplingsBase.hh}::gMDL_cgtil
@ gMDL_cgtil
Definition: TCouplingsBase.hh:296
anonymous_namespace{TCouplingsBase.hh}::gMDL_clq3
@ gMDL_clq3
Definition: TCouplingsBase.hh:271
madMela::mdl_ckm1x3
std::array< double, 2 > mdl_ckm1x3
Definition: MadMela.h:89
TVar::simple_event_record::pTopDaughters
std::vector< SimpleParticleCollection_t > pTopDaughters
Definition: TVar.hh:241
TVar::simple_event_record::pStableAntitops
SimpleParticleCollection_t pStableAntitops
Definition: TVar.hh:244
PDGHelpers::HDecayMode
TVar::CandidateDecayMode HDecayMode
Definition: PDGHelpers.cc:11
TVar::Had_ZH_S
@ Had_ZH_S
Definition: TVar.hh:86
TUtil::WipeMEArray
int WipeMEArray(const TVar::Process &process, const TVar::Production &production, const int id[mxpart], double msq[nmsq][nmsq], const TVar::VerbosityLevel &verbosity)
Definition: TUtil.cc:7994
anonymous_namespace{TCouplingsBase.hh}::gMDL_cugim
@ gMDL_cugim
Definition: TCouplingsBase.hh:304
anonymous_namespace{TCouplingsBase.hh}::gMDL_chbtil
@ gMDL_chbtil
Definition: TCouplingsBase.hh:300
TVar::H0_Zgs_PS
@ H0_Zgs_PS
Definition: TVar.hh:131
gHIGGS_VV_3_PRIME4
@ gHIGGS_VV_3_PRIME4
Definition: raw_couplings.txt:37
gHIGGS_VV_3_PRIME6
@ gHIGGS_VV_3_PRIME6
Definition: raw_couplings.txt:52
anonymous_namespace{TCouplingsBase.hh}::gMDL_cdgim
@ gMDL_cdgim
Definition: TCouplingsBase.hh:307
MelaIO::computeWeightedMEArray
void computeWeightedMEArray()
Definition: MelaIO.h:94
nuflav_
struct @21 nuflav_
gATQGC_dZZWpWm
@ gATQGC_dZZWpWm
Definition: raw_couplings.txt:174
TUtil::SumMEPDF
double SumMEPDF(const TLorentzVector &p0, const TLorentzVector &p1, double msq[nmsq][nmsq], MelaIO *RcdME, const double &EBEAM, const TVar::VerbosityLevel &verbosity)
Definition: TUtil.cc:8176
anonymous_namespace{TCouplingsBase.hh}::gMDL_cll
@ gMDL_cll
Definition: TCouplingsBase.hh:264
masses_mcfm_
#define masses_mcfm_
Definition: TMCFM.hh:130
gHIGGS_KAPPA_TILDE
@ gHIGGS_KAPPA_TILDE
Definition: raw_couplings.txt:3
anomzffcouplings_
struct @35 anomzffcouplings_
MELACandidate::addAssociatedJet
void addAssociatedJet(MELAParticle *myParticle)
Definition: MELACandidate.cc:616
MelaIO::getSumME
double getSumME() const
Definition: MelaIO.h:107
ewscheme_
struct @27 ewscheme_
TVar::Fixed_mH
@ Fixed_mH
Definition: TVar.hh:197
__modjhugenmela_MOD_setspinzerovvcouplings
void __modjhugenmela_MOD_setspinzerovvcouplings(double vvcoupl[SIZE_HVV][2], double vvpcoupl[SIZE_HVV][2], double vpvpcoupl[SIZE_HVV][2], int cqsq[SIZE_HVV_CQSQ], double Lambda_qsq[SIZE_HVV_LAMBDAQSQ][SIZE_HVV_CQSQ], int *usewwcoupl)
TJHUGenUtils::Get_JHUGenHash_OnshellVBFHash
const std::vector< TNumericUtil::intTriplet_t > & Get_JHUGenHash_OnshellVBFHash()
Definition: TJHUGenUtils.cc:42
ewinput_
struct @26 ewinput_
anonymous_namespace{TCouplingsBase.hh}::gMDL_cqd1
@ gMDL_cqd1
Definition: TCouplingsBase.hh:287
SIZE_HVV_CQSQ
@ SIZE_HVV_CQSQ
Definition: raw_couplings.txt:74
anonymous_namespace{TCouplingsBase.hh}::gMDL_cubre
@ gMDL_cubre
Definition: TCouplingsBase.hh:252
TVar::JJEWQCD
@ JJEWQCD
Definition: TVar.hh:74
TVar::H0minus
@ H0minus
Definition: TVar.hh:128
MelaIO::setAlphaS
void setAlphaS(const double &val)
Definition: MelaIO.h:137
scale_
struct @15 scale_
TUtil::InterpretScaleScheme
double InterpretScaleScheme(const TVar::Production &production, const TVar::MatrixElement &matrixElement, const TVar::EventScaleScheme &scheme, TLorentzVector p[mxpart])
Definition: TUtil.cc:1654
TVar::CandidateDecay_ZZ
@ CandidateDecay_ZZ
Definition: TVar.hh:41
gATQGC_dAAWpWm
@ gATQGC_dAAWpWm
Definition: raw_couplings.txt:172
MelaIO::setAlphaSatMZ
void setAlphaSatMZ(const double &val)
Definition: MelaIO.h:139
TVar::kNoAssociated
@ kNoAssociated
Definition: TVar.hh:30
MELAParticle::getNDaughters
int getNDaughters() const
Definition: MELAParticle.h:50
TVar::simple_event_record::nRequested_AssociatedJets
int nRequested_AssociatedJets
Definition: TVar.hh:229
ewcharge_
struct @31 ewcharge_
TVar::Fixed_mWPlusmH
@ Fixed_mWPlusmH
Definition: TVar.hh:200
__modjhugenmela_MOD_setazffcouplings
void __modjhugenmela_MOD_setazffcouplings(double AZffcoupl[SIZE_AZff][2])
TVar::bkgGammaGamma
@ bkgGammaGamma
Definition: TVar.hh:162
anonymous_namespace{TCouplingsBase.hh}::gMDL_cdd
@ gMDL_cdd
Definition: TCouplingsBase.hh:275
gHIGGS_VV_1_PRIME4
@ gHIGGS_VV_1_PRIME4
Definition: raw_couplings.txt:25
anonymous_namespace{TCouplingsBase.hh}::gMDL_cquqd11re
@ gMDL_cquqd11re
Definition: TCouplingsBase.hh:291
cLambdaHIGGS_VV_QSQ12
@ cLambdaHIGGS_VV_QSQ12
Definition: raw_couplings.txt:72
TVar::INFO
@ INFO
Definition: TVar.hh:50
TVar::Lep_WH_S
@ Lep_WH_S
Definition: TVar.hh:89
gATQGC_dMZ
@ gATQGC_dMZ
Definition: raw_couplings.txt:169
anonymous_namespace{TCouplingsBase.hh}::gMDL_chu
@ gMDL_chu
Definition: TCouplingsBase.hh:261
anonymous_namespace{TCouplingsBase.hh}::gHIGGS_GG_2
@ gHIGGS_GG_2
Definition: TCouplingsBase.hh:36
MELAParticle::getDaughters
std::vector< MELAParticle * > & getDaughters()
Definition: MELAParticle.h:59
MELACandidate::getSortedV
MELAParticle * getSortedV(int index) const
Definition: MELACandidate.cc:152
qqb_zgam_
void qqb_zgam_(double *p, double *msq)
TVar::ProductionName
TString ProductionName(TVar::Production temp)
Definition: TVar.cc:64
MELACandidate::addAssociatedNeutrino
void addAssociatedNeutrino(MELAParticle *myParticle)
Definition: MELACandidate.cc:609
gATQGC_dPZ
@ gATQGC_dPZ
Definition: raw_couplings.txt:168
__modjhugenmela_MOD_getdecaycouplings
void __modjhugenmela_MOD_getdecaycouplings(int *VVMode, int idordered[4], double *aL1, double *aR1, double *aL2, double *aR2)
MELAParticle::setGenStatus
void setGenStatus(int status_)
Definition: MELAParticle.h:43
noglue_
struct @37 noglue_
__modjhugenmela_MOD_setspinzeroqqcouplings
void __modjhugenmela_MOD_setspinzeroqqcouplings(double qqcoupl[SIZE_HQQ][2])
gATQGC_dVZ
@ gATQGC_dVZ
Definition: raw_couplings.txt:167
TVar::GammaH
@ GammaH
Definition: TVar.hh:102
mxpart
@ mxpart
Definition: TMCFM.hh:19
gHIGGS_VV_2_PRIME6
@ gHIGGS_VV_2_PRIME6
Definition: raw_couplings.txt:50
nmsq
@ nmsq
Definition: TMCFM.hh:24
__modjhugenmela_MOD_getalphasalphasmz
void __modjhugenmela_MOD_getalphasalphasmz(double *val_as, double *val_asmz)
TUtil::SetAlphaS
void SetAlphaS(double &Q_ren, double &Q_fac, double multiplier_ren, double multiplier_fac, int mynloop, int mynflav, std::string mypartons)
TVar::Dynamic_HT
@ Dynamic_HT
Definition: TVar.hh:208
qqb_gamgam_
void qqb_gamgam_(double *p, double *msq)
gHIGGS_VV_3_PRIME7
@ gHIGGS_VV_3_PRIME7
Definition: raw_couplings.txt:53
TVar::CandidateDecayMode
CandidateDecayMode
Definition: TVar.hh:37
qq_zzqq_
void qq_zzqq_(double *p, double *msq)
gAZff_ZuuRH
@ gAZff_ZuuRH
Definition: raw_couplings.txt:182
LambdaHIGGS_QSQ_VV_3
@ LambdaHIGGS_QSQ_VV_3
Definition: raw_couplings.txt:63
TVar::H2_g10
@ H2_g10
Definition: TVar.hh:160
anonymous_namespace{TCouplingsBase.hh}::gMDL_cqq11
@ gMDL_cqq11
Definition: TCouplingsBase.hh:267
MelaIO::setRenormalizationScale
void setRenormalizationScale(const double &val)
Definition: MelaIO.h:133
__modjhugenmela_MOD_sethdk
void __modjhugenmela_MOD_sethdk(int *flag)
bveg1_mcfm_
#define bveg1_mcfm_
Definition: TMCFM.hh:44
TVar::SelfDefine_spin2
@ SelfDefine_spin2
Definition: TVar.hh:181
zcouple_
struct @38 zcouple_
flags_
struct @12 flags_
TVar::CandidateDecay_Stable
@ CandidateDecay_Stable
Definition: TVar.hh:38
TVar::bkgZJets
@ bkgZJets
Definition: TVar.hh:164
gg_vv_all_
void gg_vv_all_(double *p, double *msq)
anonymous_namespace{TCouplingsBase.hh}::gMDL_cehre
@ gMDL_cehre
Definition: TCouplingsBase.hh:245
anonymous_namespace{TCouplingsBase.hh}::gMDL_cqd8
@ gMDL_cqd8
Definition: TCouplingsBase.hh:288
anonymous_namespace{TCouplingsBase.hh}::gMDL_cquqd81im
@ gMDL_cquqd81im
Definition: TCouplingsBase.hh:318
TVar::ZZINDEPENDENT
@ ZZINDEPENDENT
Definition: TVar.hh:65
gHIGGS_VV_4_PRIME3
@ gHIGGS_VV_4_PRIME3
Definition: raw_couplings.txt:42
anonymous_namespace{TCouplingsBase.hh}::gMDL_cewim
@ gMDL_cewim
Definition: TCouplingsBase.hh:302
TVar::simple_event_record::pDaughters
SimpleParticleCollection_t pDaughters
Definition: TVar.hh:237
anonymous_namespace{TCouplingsBase.hh}::gMDL_cld
@ gMDL_cld
Definition: TCouplingsBase.hh:283
TVar::kUseAssociated_StableTops
@ kUseAssociated_StableTops
Definition: TVar.hh:35
anonymous_namespace{TCouplingsBase.hh}::gMDL_cquqd8re
@ gMDL_cquqd8re
Definition: TCouplingsBase.hh:292
__modparameters_MOD_ckm
double __modparameters_MOD_ckm(int *id1in, int *id2in)
madMela::mdl_ckm3x1
std::array< double, 2 > mdl_ckm3x1
Definition: MadMela.h:90
MELACandidate::addAssociatedVs
void addAssociatedVs()
Definition: MELACandidate.cc:639
TVar::JJQCD
@ JJQCD
Definition: TVar.hh:71
__modgraviton_MOD_evalamp_qqb_g_vv
void __modgraviton_MOD_evalamp_qqb_g_vv(double P[6][4], int *MYIDUP, double *MatElSq)
MelaIO::setPartonWeights
void setPartonWeights(double partonOneWeight_[nmsq], double partonTwoWeight_[nmsq])
Definition: MelaIO.h:54
anonymous_namespace{TCouplingsBase.hh}::gMDL_chgtil
@ gMDL_chgtil
Definition: TCouplingsBase.hh:298
__modjhugenmela_MOD_setspinzeroggcouplings
void __modjhugenmela_MOD_setspinzeroggcouplings(double ggcoupl[SIZE_HGG][2])
anonymous_namespace{TCouplingsBase.hh}::gMDL_cquqd1re
@ gMDL_cquqd1re
Definition: TCouplingsBase.hh:290
qqb_zz_stu_
void qqb_zz_stu_(double *p, double *msq, int *channeltoggle)
gHIGGS_VV_2_PRIME3
@ gHIGGS_VV_2_PRIME3
Definition: raw_couplings.txt:30
TVar::HSMHiggs_WWZZ
@ HSMHiggs_WWZZ
Definition: TVar.hh:173
gATQGC_dFourZ
@ gATQGC_dFourZ
Definition: raw_couplings.txt:170
anonymous_namespace{TCouplingsBase.hh}::gMDL_cquqd1im
@ gMDL_cquqd1im
Definition: TCouplingsBase.hh:315
TVar::ZZQQB
@ ZZQQB
Definition: TVar.hh:63
TVar::CandidateDecay_WW
@ CandidateDecay_WW
Definition: TVar.hh:40
gHIGGS_VV_2_PRIME7
@ gHIGGS_VV_2_PRIME7
Definition: raw_couplings.txt:51
vsymfact_
struct @22 vsymfact_
TVar::kUseAssociated_Jets
@ kUseAssociated_Jets
Definition: TVar.hh:33
gAZff_uZLH
@ gAZff_uZLH
Definition: raw_couplings.txt:190
gHIGGS_VV_4_PRIME
@ gHIGGS_VV_4_PRIME
Definition: raw_couplings.txt:40
TUtil::PrintCandidateSummary
void PrintCandidateSummary(MELACandidate *cand)
Definition: TUtil.cc:8855
__modzprime_MOD_evalamp_qqb_zprime_vv
void __modzprime_MOD_evalamp_qqb_zprime_vv(double P[6][4], int *MYIDUP, double *MatElSq)
TVar::H1minus
@ H1minus
Definition: TVar.hh:147
MELACandidate::addAssociatedPhoton
void addAssociatedPhoton(MELAParticle *myParticle)
Definition: MELACandidate.cc:613
PDGHelpers::isAZBoson
bool isAZBoson(const int id)
Definition: PDGHelpers.cc:76
gHIGGS_AA_2
@ gHIGGS_AA_2
Definition: raw_couplings.txt:18
TVar::simple_event_record::nRequested_AssociatedPhotons
int nRequested_AssociatedPhotons
Definition: TVar.hh:231
__modhiggsj_MOD_evalamp_hj
void __modhiggsj_MOD_evalamp_hj(double P[4][4], double MatElSq[11][11])
anonymous_namespace{TCouplingsBase.hh}::gMDL_cqe
@ gMDL_cqe
Definition: TCouplingsBase.hh:284
madMela::params_c_
struct madMela::@3 params_c_
anonymous_namespace{TCouplingsBase.hh}::gMDL_chwtil
@ gMDL_chwtil
Definition: TCouplingsBase.hh:299
spinzerohiggs_anomcoupl_
struct @34 spinzerohiggs_anomcoupl_
qq_zzqqstrong_
void qq_zzqqstrong_(double *p, double *msq)
modparameters::second
real(8), parameter, public second
Definition: mod_Parameters.F90:105
modmisc::isnan
logical function isnan(x)
Definition: mod_Misc.F90:380
PDGHelpers::isAnUnknownJet
bool isAnUnknownJet(const int id)
Definition: PDGHelpers.cc:22
gHIGGS_VV_1_PRIME6
@ gHIGGS_VV_1_PRIME6
Definition: raw_couplings.txt:48
TVar::DEBUG_VERBOSE
@ DEBUG_VERBOSE
Definition: TVar.hh:52
hto_masses::msq
real *8, parameter msq
Definition: CALLING_cpHTO.f:83
breit_
struct @17 breit_
PDGHelpers::isAQuark
bool isAQuark(const int id)
Definition: PDGHelpers.cc:35
anonymous_namespace{TCouplingsBase.hh}::gMDL_cdd1
@ gMDL_cdd1
Definition: TCouplingsBase.hh:276
TVar::MADGRAPH
@ MADGRAPH
Definition: TVar.hh:59
__modjhugenmela_MOD_resetamplitudeincludes
void __modjhugenmela_MOD_resetamplitudeincludes()
TVar::H2_g7
@ H2_g7
Definition: TVar.hh:157
TUtil::forbidMassiveLeptons
bool forbidMassiveLeptons
Remove fermion mass if the flag is set to true.
Definition: TUtil.cc:27
TVar::simple_event_record::AssociationVCompatibility
int AssociationVCompatibility
Definition: TVar.hh:228
anonymous_namespace{TCouplingsBase.hh}::gMDL_cubim
@ gMDL_cubim
Definition: TCouplingsBase.hh:306
TUtil::GetAlphaS
void GetAlphaS(double *alphas_, double *alphasmz_)
Definition: TUtil.cc:1849
anonymous_namespace{TCouplingsBase.hh}::gMDL_cll1
@ gMDL_cll1
Definition: TCouplingsBase.hh:265
TVar::ZZQQB_TU
@ ZZQQB_TU
Definition: TVar.hh:92
srdiags_
struct @36 srdiags_
gAZff_ZddLH
@ gAZff_ZddLH
Definition: raw_couplings.txt:185
gAZff_ZddRH
@ gAZff_ZddRH
Definition: raw_couplings.txt:184
gHIGGS_ZA_2
@ gHIGGS_ZA_2
Definition: raw_couplings.txt:14
PDGHelpers::isANeutrino
bool isANeutrino(const int id)
Definition: PDGHelpers.cc:67
anonymous_namespace{TCouplingsBase.hh}::gMDL_cledqre
@ gMDL_cledqre
Definition: TCouplingsBase.hh:289
TVar::ZZGG
@ ZZGG
Definition: TVar.hh:62
anonymous_namespace{TCouplingsBase.hh}::gMDL_ch
@ gMDL_ch
Definition: TCouplingsBase.hh:238
TVar::ProcessName
TString ProcessName(TVar::Process temp)
Definition: TVar.cc:6
TVar::MomentumToEnergy
@ MomentumToEnergy
Definition: TVar.hh:113
TJHUGenUtils::Get_JHUGenHash_OnshellHJJHash
const std::vector< TNumericUtil::intTriplet_t > & Get_JHUGenHash_OnshellHJJHash()
Definition: TJHUGenUtils.cc:41
PDGHelpers::isAPhoton
bool isAPhoton(const int id)
Definition: PDGHelpers.cc:72
anonymous_namespace{TCouplingsBase.hh}::gMDL_clequ1im
@ gMDL_clequ1im
Definition: TCouplingsBase.hh:319
gATQGC_dZAWpWm
@ gATQGC_dZAWpWm
Definition: raw_couplings.txt:173
MelaIO::setHiggsMassWidth
void setHiggsMassWidth(const double &mass_, const double &width_, int jh)
Definition: MelaIO.h:143
TVar::H0_Zgsg1prime2
@ H0_Zgsg1prime2
Definition: TVar.hh:129
plabel_
struct @48 plabel_
TVar::simple_event_record::nRequested_Tops
int nRequested_Tops
Definition: TVar.hh:232
anonymous_namespace{TCouplingsBase.hh}::gMDL_chl1
@ gMDL_chl1
Definition: TCouplingsBase.hh:256
madMela::widths_
struct madMela::@1 widths_
MELAStreamHelpers::MELAout
MELAOutputStreamer MELAout
TVar::simple_event_record::pMothers
SimpleParticleCollection_t pMothers
Definition: TVar.hh:239
madMela::setDefaultMadgraphValues
void setDefaultMadgraphValues()
Sets the Madgraph values to their defaults. This function is called after every call to a compute fun...
Definition: MadMela.cc:249
madMela::mdl_ckm1x1
std::array< double, 2 > mdl_ckm1x1
Definition: MadMela.h:89
__modjhugenmela_MOD_resetmubarhgabarh
void __modjhugenmela_MOD_resetmubarhgabarh()
TVar::bkgWW
@ bkgWW
Definition: TVar.hh:166
TVar::DefaultLeptonInterf
@ DefaultLeptonInterf
Definition: TVar.hh:106
anonymous_namespace{TCouplingsBase.hh}::gMDL_cebre
@ gMDL_cebre
Definition: TCouplingsBase.hh:249
cutoff_
struct @24 cutoff_
TVar::H2_g5
@ H2_g5
Definition: TVar.hh:154
madMela::mdl_ckm2x3
std::array< double, 2 > mdl_ckm2x3
Definition: MadMela.h:90
anonymous_namespace{TCouplingsBase.hh}::gMDL_chwbtil
@ gMDL_chwbtil
Definition: TCouplingsBase.hh:301
MELACandidate::getAssociatedPhotons
std::vector< MELAParticle * > & getAssociatedPhotons()
Definition: MELACandidate.cc:181
gHIGGS_VV_1_PRIME
@ gHIGGS_VV_1_PRIME
Definition: raw_couplings.txt:22
anonymous_namespace{TCouplingsBase.hh}::gMDL_cquqd8im
@ gMDL_cquqd8im
Definition: TCouplingsBase.hh:316
PDGHelpers::isDownTypeQuark
bool isDownTypeQuark(const int id)
Definition: PDGHelpers.cc:45
TVar::bkgWWZZ
@ bkgWWZZ
Definition: TVar.hh:167
TVar::H0_g1prime2
@ H0_g1prime2
Definition: TVar.hh:126
PDGHelpers::isATopQuark
bool isATopQuark(const int id)
Definition: PDGHelpers.cc:50
anonymous_namespace{TCouplingsBase.hh}::gMDL_cquqd11im
@ gMDL_cquqd11im
Definition: TCouplingsBase.hh:317
anonymous_namespace{TCouplingsBase.hh}::gMDL_chq3
@ gMDL_chq3
Definition: TCouplingsBase.hh:260
anonymous_namespace{TCouplingsBase.hh}::gMDL_chudim
@ gMDL_chudim
Definition: TCouplingsBase.hh:310
qqb_z2jet_
void qqb_z2jet_(double *p, double *msq)
MELACandidate::getAssociatedSortedVs
std::vector< MELAParticle * > getAssociatedSortedVs()
Definition: MELACandidate.cc:193
MELAParticle::p4
TLorentzVector p4
Definition: MELAParticle.h:18
TVar::simple_event_record::intermediateVid
std::vector< int > intermediateVid
Definition: TVar.hh:236
TVar::H2_g3
@ H2_g3
Definition: TVar.hh:152
gHIGGS_VV_2_PRIME5
@ gHIGGS_VV_2_PRIME5
Definition: raw_couplings.txt:32
__modjhugenmela_MOD_settopdecays
void __modjhugenmela_MOD_settopdecays(int *flag)
anonymous_namespace{TCouplingsBase.hh}::gMDL_clq1
@ gMDL_clq1
Definition: TCouplingsBase.hh:270
cLambdaHIGGS_VV_QSQ2
@ cLambdaHIGGS_VV_QSQ2
Definition: raw_couplings.txt:71
madMela::mdl_ckm1x2
std::array< double, 2 > mdl_ckm1x2
Definition: MadMela.h:89
gg_zz_all_
void gg_zz_all_(double *p, double *msq)
cLambdaHIGGS_VV_QSQ1
@ cLambdaHIGGS_VV_QSQ1
Definition: raw_couplings.txt:70
MELAParticle::z
double z() const
Definition: MELAParticle.h:69
gHIGGS_VV_3_PRIME2
@ gHIGGS_VV_3_PRIME2
Definition: raw_couplings.txt:35
__modjhugenmela_MOD_setspintwocouplings
void __modjhugenmela_MOD_setspintwocouplings(double acoupl[SIZE_GGG][2], double vvcoupl[SIZE_GVV][2], double vvpcoupl[SIZE_GVV][2], double vpvpcoupl[SIZE_GVV][2], double qlr[SIZE_GQQ][2])
TVar::simple_event_record::AssociationCode
int AssociationCode
Definition: TVar.hh:227
gg_zz_
void gg_zz_(double *p, double *msq)
TVar::H0_gsgs_PS
@ H0_gsgs_PS
Definition: TVar.hh:133
__modjhugenmela_MOD_getmvprimegvprime
void __modjhugenmela_MOD_getmvprimegvprime(double *mv, double *gv)
anonymous_namespace{TCouplingsBase.hh}::gMDL_cuhim
@ gMDL_cuhim
Definition: TCouplingsBase.hh:312
gHIGGS_VV_1_PRIME7
@ gHIGGS_VV_1_PRIME7
Definition: raw_couplings.txt:49
gHIGGS_VV_4_PRIME2
@ gHIGGS_VV_4_PRIME2
Definition: raw_couplings.txt:41
anonymous_namespace{TCouplingsBase.hh}::gMDL_cewre
@ gMDL_cewre
Definition: TCouplingsBase.hh:248
PDGHelpers::getCoupledVertex
int getCoupledVertex(const int idfirst, const int idsecond, int *hel=0, int *useAHcoupl=0)
Definition: PDGHelpers.cc:235
TVar::simple_event_record::pStableTops
SimpleParticleCollection_t pStableTops
Definition: TVar.hh:243
gATQGC_dPA
@ gATQGC_dPA
Definition: raw_couplings.txt:163
TVar::HSMHiggs
@ HSMHiggs
Definition: TVar.hh:125
TVar::H2_g2
@ H2_g2
Definition: TVar.hh:151
anonymous_namespace{TCouplingsBase.hh}::gMDL_cwtil
@ gMDL_cwtil
Definition: TCouplingsBase.hh:297
PDGHelpers::isAWBoson
bool isAWBoson(const int id)
Definition: PDGHelpers.cc:80
TVar::Lep_WH_TU
@ Lep_WH_TU
Definition: TVar.hh:100
MELAParticle::charge
double charge() const
Definition: MELAParticle.cc:90
TVar::bkgZGamma
@ bkgZGamma
Definition: TVar.hh:163
TVar::H2_g9
@ H2_g9
Definition: TVar.hh:159
gHIGGS_VV_2_PRIME2
@ gHIGGS_VV_2_PRIME2
Definition: raw_couplings.txt:29
__modparameters_MOD_getmass
double __modparameters_MOD_getmass(int *part)
ckmfill_
void ckmfill_(int *nwz)
__modparameters_MOD_computeckmelements
void __modparameters_MOD_computeckmelements(double *invckm_ud, double *invckm_us, double *invckm_cd, double *invckm_cs, double *invckm_ts, double *invckm_tb, double *invckm_ub=0, double *invckm_cb=0, double *invckm_td=0)
__modhiggs_MOD_evalamp_gg_h_vv
void __modhiggs_MOD_evalamp_gg_h_vv(double P[6][4], int *MYIDUP, double *MatElSq)
TVar::Fixed_mZPlusmH
@ Fixed_mZPlusmH
Definition: TVar.hh:201
anonymous_namespace{TCouplingsBase.hh}::gMDL_chbox
@ gMDL_chbox
Definition: TCouplingsBase.hh:239
TVar::H0_gsgs
@ H0_gsgs
Definition: TVar.hh:132
gHIGGS_VV_1_PRIME2
@ gHIGGS_VV_1_PRIME2
Definition: raw_couplings.txt:23
gAZff_ZllLH
@ gAZff_ZllLH
Definition: raw_couplings.txt:181
gHIGGS_VV_3_PRIME
@ gHIGGS_VV_3_PRIME
Definition: raw_couplings.txt:34
__modjhugenmela_MOD_setewparameters
void __modjhugenmela_MOD_setewparameters(double *inMZ, double *inMW, double *inGf, double *inalpha_QED, double *inxw)
anonymous_namespace{TCouplingsBase.hh}::gMDL_cud8
@ gMDL_cud8
Definition: TCouplingsBase.hh:280
gHIGGS_VV_4
@ gHIGGS_VV_4
Definition: raw_couplings.txt:12
anonymous_namespace{TCouplingsBase.hh}::gMDL_chb
@ gMDL_chb
Definition: TCouplingsBase.hh:243
TUtil::GetDecayWidth
double GetDecayWidth(int ipart)
Definition: TUtil.cc:1619
MELACandidate::getAssociatedLeptons
std::vector< MELAParticle * > & getAssociatedLeptons()
Definition: MELACandidate.cc:179
__modttbhiggs_MOD_evalxsec_pp_ttbh
void __modttbhiggs_MOD_evalxsec_pp_ttbh(double Ptth[13][4], int *SelectProcess, double MatElSq[11][11])
MELACandidate::setDecayMode
void setDecayMode(TVar::CandidateDecayMode flag)
Definition: MELACandidate.cc:112
anonymous_namespace{TCouplingsBase.hh}::gMDL_cqq31
@ gMDL_cqq31
Definition: TCouplingsBase.hh:269
__modhiggsjj_MOD_evalamp_sbfh_unsymm_sa_select_exact
void __modhiggsjj_MOD_evalamp_sbfh_unsymm_sa_select_exact(double P[5][4], int *iSel, int *jSel, int *rSel, int *sSel, double *MatElSq)
anonymous_namespace{TCouplingsBase.hh}::gMDL_cebim
@ gMDL_cebim
Definition: TCouplingsBase.hh:303
TUtil::GetMCFMParticleLabel
TString GetMCFMParticleLabel(const int &pid, bool useQJ, bool useExtendedConventions)
Definition: TUtil.cc:3304
TUtil::computeVHAngles
void computeVHAngles(float &costhetastar, float &costheta1, float &costheta2, float &Phi, float &Phi1, float &m1, float &m2, TLorentzVector p4M11, int Z1_lept1Id, TLorentzVector p4M12, int Z1_lept2Id, TLorentzVector p4M21, int Z2_lept1Id, TLorentzVector p4M22, int Z2_lept2Id, TLorentzVector jet1, int jet1Id, TLorentzVector jet2, int jet2Id, TLorentzVector *injet1=0, int injet1Id=0, TLorentzVector *injet2=0, int injet2Id=0)
Definition: TUtil.cc:875
anonymous_namespace{TCouplingsBase.hh}::gMDL_chl3
@ gMDL_chl3
Definition: TCouplingsBase.hh:257
TVar::Had_ZH_TU
@ Had_ZH_TU
Definition: TVar.hh:97
TVar::MCFM
@ MCFM
Definition: TVar.hh:56
anonymous_namespace{TCouplingsBase.hh}::gMDL_cuwim
@ gMDL_cuwim
Definition: TCouplingsBase.hh:305
pdlabel_
struct @47 pdlabel_
TVar::Lep_ZH_S
@ Lep_ZH_S
Definition: TVar.hh:88
MELAParticle
Definition: MELAParticle.h:13
interference_
struct @23 interference_
madMela::mdl_ckm3x2
std::array< double, 2 > mdl_ckm3x2
Definition: MadMela.h:90
TUtilHelpers::copyVector
void copyVector(std::vector< T > const &input, std::vector< T > &target)
Definition: TUtilHelpers.hh:24
LambdaHIGGS_QSQ_VV_1
@ LambdaHIGGS_QSQ_VV_1
Definition: raw_couplings.txt:61
__modgraviton_MOD_evalamp_g_vv
void __modgraviton_MOD_evalamp_g_vv(double P[6][4], int *MYIDUP, double *MatElSq)
nqcdjets_
struct @18 nqcdjets_
TVar::JJEW_S
@ JJEW_S
Definition: TVar.hh:84
TVar::CandidateDecay_ZW
@ CandidateDecay_ZW
Definition: TVar.hh:42
coupling_
void coupling_()
TUtil::computeAngles
void computeAngles(float &costhetastar, float &costheta1, float &costheta2, float &Phi, float &Phi1, TLorentzVector Z1_lept1, int Z1_lept1Id, TLorentzVector Z1_lept2, int Z1_lept2Id, TLorentzVector Z2_lept1, int Z2_lept1Id, TLorentzVector Z2_lept2, int Z2_lept2Id)
Definition: TUtil.cc:210
TUtil::ComplexBoost
std::pair< TLorentzVector, TLorentzVector > ComplexBoost(TVector3 const &beta, TLorentzVector const &p4)
Definition: TUtil.cc:168
TUtil::SetEwkCouplingParameters
void SetEwkCouplingParameters(double ext_Gf, double ext_aemmz, double ext_mW, double ext_mZ, double ext_xW, int ext_ewscheme)
Definition: TUtil.cc:1388
__modgraviton_MOD_evalamp_gg_g_vv
void __modgraviton_MOD_evalamp_gg_g_vv(double P[6][4], int *MYIDUP, double *MatElSq)
__modjhugenmela_MOD_sethiggsmasswidth
void __modjhugenmela_MOD_sethiggsmasswidth(double *mass, double *width)
TVar::Dynamic_qJ_qJ_qH
@ Dynamic_qJ_qJ_qH
Definition: TVar.hh:207
TVar::ConserveDifermionMass
@ ConserveDifermionMass
Definition: TVar.hh:112
TVar::Dynamic_Softest_pTJ
@ Dynamic_Softest_pTJ
Definition: TVar.hh:210
runstring_
struct @46 runstring_
TVar::CandidateDecay_ZG
@ CandidateDecay_ZG
Definition: TVar.hh:43
gATQGC_dMA
@ gATQGC_dMA
Definition: raw_couplings.txt:164
PDGHelpers::setCandidateDecayMode
void setCandidateDecayMode(TVar::CandidateDecayMode mode)
Definition: PDGHelpers.cc:232
anonymous_namespace{TCouplingsBase.hh}::gMDL_cquqd81re
@ gMDL_cquqd81re
Definition: TCouplingsBase.hh:293
gHIGGS_AA_3
@ gHIGGS_AA_3
Definition: raw_couplings.txt:19
TVar::event_scales_type::factorizationScheme
TVar::EventScaleScheme factorizationScheme
Definition: TVar.hh:261
anonymous_namespace{TCouplingsBase.hh}::gMDL_ceu
@ gMDL_ceu
Definition: TCouplingsBase.hh:277
anonymous_namespace{TCouplingsBase.hh}::gMDL_cdgre
@ gMDL_cdgre
Definition: TCouplingsBase.hh:253
MELACandidate::addAssociatedLepton
void addAssociatedLepton(MELAParticle *myParticle)
Definition: MELACandidate.cc:606
TVar::ZZQQB_STU
@ ZZQQB_STU
Definition: TVar.hh:64
TVar::JJVBF_TU
@ JJVBF_TU
Definition: TVar.hh:94
TVar::event_scales_type::fac_scale_factor
double fac_scale_factor
Definition: TVar.hh:263
TVar::H2_g1
@ H2_g1
Definition: TVar.hh:150
anonymous_namespace{TCouplingsBase.hh}::gMDL_cugre
@ gMDL_cugre
Definition: TCouplingsBase.hh:250
TVar::Fixed_mZ
@ Fixed_mZ
Definition: TVar.hh:199
madMela::mdl_ckm2x2
std::array< double, 2 > mdl_ckm2x2
Definition: MadMela.h:90
gAZff_dZLH
@ gAZff_dZLH
Definition: raw_couplings.txt:192
anonymous_namespace{TCouplingsBase.hh}::gHIGGS_GG_3
@ gHIGGS_GG_3
Definition: TCouplingsBase.hh:37
TUtil::removeMassFromPair
std::pair< TLorentzVector, TLorentzVector > removeMassFromPair(TLorentzVector const &jet1, int const &jet1Id, TLorentzVector const &jet2, int const &jet2Id, double m1=0, double m2=0)
Definition: TUtil.cc:76
TVar::bkgWWZZ_SMHiggs
@ bkgWWZZ_SMHiggs
Definition: TVar.hh:171
gHIGGS_VV_2_PRIME
@ gHIGGS_VV_2_PRIME
Definition: raw_couplings.txt:28
gHIGGS_VV_3_PRIME5
@ gHIGGS_VV_3_PRIME5
Definition: raw_couplings.txt:38
anonymous_namespace{TCouplingsBase.hh}::gMDL_cdbim
@ gMDL_cdbim
Definition: TCouplingsBase.hh:309
TUtil::LeptonMassScheme
TVar::FermionMassRemoval LeptonMassScheme
Definition: TUtil.cc:29
TVar::NoPropagator
@ NoPropagator
Definition: TVar.hh:117
anonymous_namespace{TCouplingsBase.hh}::gMDL_cle
@ gMDL_cle
Definition: TCouplingsBase.hh:281
npart_
struct @20 npart_
TVar::JHUGen
@ JHUGen
Definition: TVar.hh:57
gHIGGS_AA_4
@ gHIGGS_AA_4
Definition: raw_couplings.txt:20
TUtil::GetMassWidth
void GetMassWidth(int ipart, double &m, double &ga)
Definition: TUtil.cc:1645
SIZE_HVV_LAMBDAQSQ
@ SIZE_HVV_LAMBDAQSQ
Definition: raw_couplings.txt:66
MELACandidate::getAssociatedTops
std::vector< MELATopCandidate_t * > & getAssociatedTops()
Definition: MELACandidate.cc:183
TVar::Had_ZH
@ Had_ZH
Definition: TVar.hh:75
qq_wwqqstrong_
void qq_wwqqstrong_(double *p, double *msq)
gHIGGS_VV_1_PRIME3
@ gHIGGS_VV_1_PRIME3
Definition: raw_couplings.txt:24
TVar::NoRemoval
@ NoRemoval
Definition: TVar.hh:111
TVar::H2_g1g5
@ H2_g1g5
Definition: TVar.hh:155
__modttbhiggs_MOD_evalxsec_pp_bbbh
void __modttbhiggs_MOD_evalxsec_pp_bbbh(double Ptth[13][4], int *SelectProcess, double MatElSq[11][11])
TVar::H2_g8
@ H2_g8
Definition: TVar.hh:158
MELAParticle::addMother
void addMother(MELAParticle *myParticle)
Definition: MELAParticle.cc:62
TUtil::ComputePDF
void ComputePDF(const TLorentzVector &p0, const TLorentzVector &p1, double fx1[nmsq], double fx2[nmsq], const double &EBEAM, const TVar::VerbosityLevel &verbosity)
Definition: TUtil.cc:8142
anonymous_namespace{TCouplingsBase.hh}::gMDL_cqu8
@ gMDL_cqu8
Definition: TCouplingsBase.hh:286
TUtil::GetMass
double GetMass(int ipart)
Definition: TUtil.cc:1582
anonymous_namespace{TCouplingsBase.hh}::gMDL_chdd
@ gMDL_chdd
Definition: TCouplingsBase.hh:240
anonymous_namespace{TCouplingsBase.hh}::gMDL_clequ3im
@ gMDL_clequ3im
Definition: TCouplingsBase.hh:320
__modvhiggs_MOD_evalamp_vhiggs
void __modvhiggs_MOD_evalamp_vhiggs(int id[9], double helicity[9], double MomExt[9][4], double *me2)
anonymous_namespace{TCouplingsBase.hh}::gMDL_cuu1
@ gMDL_cuu1
Definition: TCouplingsBase.hh:274
MELAStreamHelpers::MELAerr
MELAOutputStreamer MELAerr
madMela::mdl_ckm2x1
std::array< double, 2 > mdl_ckm2x1
Definition: MadMela.h:89
nflav_
struct @44 nflav_
__modparameters_MOD_computeewvariables
void __modparameters_MOD_computeewvariables()
madMela::mad_masses_
struct madMela::@0 mad_masses_
alphas_
double alphas_(double *q, double *amz, int *nloop)
lastphot_
struct @45 lastphot_
TUtil::MCFM_SetupParticleCouplings
bool MCFM_SetupParticleCouplings(const TVar::Process &process, const TVar::Production &production, const TVar::VerbosityLevel &verbosity, const TVar::simple_event_record &mela_event, std::vector< int > *partOrder, std::vector< int > *apartOrder)
Definition: TUtil.cc:2282
TVar::Dynamic_qH
@ Dynamic_qH
Definition: TVar.hh:204
TVar::Had_WH_S
@ Had_WH_S
Definition: TVar.hh:87
MELAParticle::passSelection
bool passSelection
Definition: MELAParticle.h:19
TVar::JJEW
@ JJEW
Definition: TVar.hh:73
TUtil::forbidMassiveJets
bool forbidMassiveJets
Definition: TUtil.cc:28
anonymous_namespace{TCouplingsBase.hh}::gMDL_cuwre
@ gMDL_cuwre
Definition: TCouplingsBase.hh:251
modparameters::b2
complex(8), public b2
Definition: mod_Parameters.F90:937
gAZff_ZllRH
@ gAZff_ZllRH
Definition: raw_couplings.txt:180
gHIGGS_VV_3
@ gHIGGS_VV_3
Definition: raw_couplings.txt:11
__modkinematics_MOD_setpdfs
void __modkinematics_MOD_setpdfs(double *x1, double *x2, double pdf[2][13])
TVar::bkgZZ_SMHiggs
@ bkgZZ_SMHiggs
Definition: TVar.hh:169
qq_vvqq_
void qq_vvqq_(double *p, double *msq)
gHIGGS_VV_1_PRIME5
@ gHIGGS_VV_1_PRIME5
Definition: raw_couplings.txt:26
madMela::smatrixhel
void smatrixhel(const TVar::Process &process, const TVar::Production &production, int pdgs[], int &procid, const int &npdg, double *p, double &alphas, double &scale2, int &nhel, double &ans)
This is the function that redirects the SMEFTsim matrix element calculation to the correct smatrix fu...
Definition: MadMela.cc:427
TVar::CandidateDecay_WG
@ CandidateDecay_WG
Definition: TVar.hh:44
gHIGGS_ZA_3
@ gHIGGS_ZA_3
Definition: raw_couplings.txt:15
madMela::params_r_
struct madMela::@2 params_r_
TVar::bkgZZ
@ bkgZZ
Definition: TVar.hh:165
TVar::simple_event_record::nRequested_Antitops
int nRequested_Antitops
Definition: TVar.hh:233
gAZff_ZnunuRH
@ gAZff_ZnunuRH
Definition: raw_couplings.txt:186
convertLHEreverse
#define convertLHEreverse
Definition: TModParameters.hh:12
TVar::InterfOn
@ InterfOn
Definition: TVar.hh:107
madMela::mdl_ckm3x3
std::array< double, 2 > mdl_ckm3x3
Definition: MadMela.h:91
__modparameters_MOD_ckmbare
double __modparameters_MOD_ckmbare(int *id1in, int *id2in)
TVar::Fixed_mW
@ Fixed_mW
Definition: TVar.hh:198
__modhiggsjj_MOD_evalamp_wbfh_unsymm_sa_select_exact
void __modhiggsjj_MOD_evalamp_wbfh_unsymm_sa_select_exact(double P[5][4], int *iSel, int *jSel, int *rSel, int *sSel, double *MatElSq)
anonymous_namespace{TCouplingsBase.hh}::gMDL_cdbre
@ gMDL_cdbre
Definition: TCouplingsBase.hh:255
TUtil::constrainedRemovePairMass
void constrainedRemovePairMass(TLorentzVector &p1, TLorentzVector &p2, double m1=0, double m2=0)
Definition: TUtil.cc:41
__modparameters_MOD_setmass
void __modparameters_MOD_setmass(double *mass, int *ipart)
TVar::Fixed_TwomtPlusmH
@ Fixed_TwomtPlusmH
Definition: TVar.hh:202
anonymous_namespace{TCouplingsBase.hh}::gMDL_cdhre
@ gMDL_cdhre
Definition: TCouplingsBase.hh:247
TVar::Had_WH_TU
@ Had_WH_TU
Definition: TVar.hh:98
anonymous_namespace{TCouplingsBase.hh}::gMDL_chudre
@ gMDL_chudre
Definition: TCouplingsBase.hh:263
TVar::event_scales_type::ren_scale_factor
double ren_scale_factor
Definition: TVar.hh:262
__modjhugenmela_MOD_getmvgv
void __modjhugenmela_MOD_getmvgv(double *mv, double *gv)
qq_wwqq_
void qq_wwqq_(double *p, double *msq)
TVar::H0_Zgs
@ H0_Zgs
Definition: TVar.hh:130
MELACandidate::getAssociatedJets
std::vector< MELAParticle * > & getAssociatedJets()
Definition: MELACandidate.cc:182
TVar::ttH
@ ttH
Definition: TVar.hh:67
anonymous_namespace{TCouplingsBase.hh}::gMDL_chw
@ gMDL_chw
Definition: TCouplingsBase.hh:242
TVar::SelfDefine_spin0
@ SelfDefine_spin0
Definition: TVar.hh:179
gg_hvv_tb_
void gg_hvv_tb_(double *p, double *msq)
PDGHelpers::isAGluon
bool isAGluon(const int id)
Definition: PDGHelpers.cc:58
TVar::simple_event_record::pAssociated
SimpleParticleCollection_t pAssociated
Definition: TVar.hh:238
nwz_
struct @39 nwz_
gHIGGS_ZA_4
@ gHIGGS_ZA_4
Definition: raw_couplings.txt:16
TVar::JQCD
@ JQCD
Definition: TVar.hh:69
MELAParticle::getMother
MELAParticle * getMother(int index) const
Definition: MELAParticle.cc:64
anonymous_namespace{TCouplingsBase.hh}::gHIGGS_GG_4
@ gHIGGS_GG_4
Definition: TCouplingsBase.hh:38
TVar::kUseAssociated_Photons
@ kUseAssociated_Photons
Definition: TVar.hh:32
npart
int npart
Definition: TMCFM.hh:77
anonymous_namespace{TCouplingsBase.hh}::gMDL_cledqim
@ gMDL_cledqim
Definition: TCouplingsBase.hh:314
TUtil::JetMassScheme
TVar::FermionMassRemoval JetMassScheme
Definition: TUtil.cc:30
__modparameters_MOD_getdecaywidth
double __modparameters_MOD_getdecaywidth(int *part)
gHIGGS_VV_4_PRIME5
@ gHIGGS_VV_4_PRIME5
Definition: raw_couplings.txt:44
anonymous_namespace{TCouplingsBase.hh}::gMDL_clequ3re
@ gMDL_clequ3re
Definition: TCouplingsBase.hh:295
anonymous_namespace{TCouplingsBase.hh}::gMDL_cehim
@ gMDL_cehim
Definition: TCouplingsBase.hh:311
TVar::H2_g6
@ H2_g6
Definition: TVar.hh:156
nf
@ nf
Definition: TMCFM.hh:17
TVar::Lep_ZH
@ Lep_ZH
Definition: TVar.hh:77
__modparameters_MOD_setdecaywidth
void __modparameters_MOD_setdecaywidth(double *width, int *ipart)
__modjhugenmela_MOD_setdecaymodes
void __modjhugenmela_MOD_setdecaymodes(int idfirst[2], int idsecond[2])
TVar::event_scales_type::renomalizationScheme
TVar::EventScaleScheme renomalizationScheme
Definition: TVar.hh:260
TUtil::adjustTopDaughters
void adjustTopDaughters(SimpleParticleCollection_t &daughters)
Definition: TUtil.cc:134
TVar::kUseAssociated_UnstableTops
@ kUseAssociated_UnstableTops
Definition: TVar.hh:34
MelaIO::setVDaughterCouplings
void setVDaughterCouplings(const double &left, const double &right, int iv)
Definition: MelaIO.h:147
gAZff_ZuuLH
@ gAZff_ZuuLH
Definition: raw_couplings.txt:183
gHIGGS_VV_1
@ gHIGGS_VV_1
Definition: raw_couplings.txt:9
anonymous_namespace{TCouplingsBase.hh}::gMDL_chg
@ gMDL_chg
Definition: TCouplingsBase.hh:241
gHIGGS_VV_2_PRIME4
@ gHIGGS_VV_2_PRIME4
Definition: raw_couplings.txt:31
TVar::ZZQQB_S
@ ZZQQB_S
Definition: TVar.hh:81
MELACandidate::sortDaughters
void sortDaughters()
Definition: MELACandidate.cc:117
TVar::simple_event_record::pAntitopDaughters
std::vector< SimpleParticleCollection_t > pAntitopDaughters
Definition: TVar.hh:242
nlooprun_
struct @43 nlooprun_
xmin_
struct @19 xmin_
cabib_
struct @40 cabib_
Q
double Q[11]
Definition: TMCFM.hh:121
gHIGGS_VV_3_PRIME3
@ gHIGGS_VV_3_PRIME3
Definition: raw_couplings.txt:36
MELACandidate
Definition: MELACandidate.h:7
anonymous_namespace{TCouplingsBase.hh}::gMDL_cdhim
@ gMDL_cdhim
Definition: TCouplingsBase.hh:313
TUtil::CheckPartonMomFraction
bool CheckPartonMomFraction(const TLorentzVector &p0, const TLorentzVector &p1, double xx[2], const double &EBEAM, const TVar::VerbosityLevel &verbosity)
Definition: TUtil.cc:8117
qqb_ww_
void qqb_ww_(double *p, double *msq)
TVar::DEBUG
@ DEBUG
Definition: TVar.hh:51
TVar::JJEWQCD_S
@ JJEWQCD_S
Definition: TVar.hh:85
TVar::simple_event_record::nRequested_AssociatedLeptons
int nRequested_AssociatedLeptons
Definition: TVar.hh:230
anonymous_namespace{TCouplingsBase.hh}::gMDL_cud1
@ gMDL_cud1
Definition: TCouplingsBase.hh:279
MELAThreeBodyDecayCandidate
Definition: MELAThreeBodyDecayCandidate.h:7
TVar::H2_g4
@ H2_g4
Definition: TVar.hh:153
anonymous_namespace{TCouplingsBase.hh}::gMDL_cqu1
@ gMDL_cqu1
Definition: TCouplingsBase.hh:285
TVar::JJEWQCD_TU
@ JJEWQCD_TU
Definition: TVar.hh:96
SimpleParticleCollection_t
std::vector< SimpleParticle_t > SimpleParticleCollection_t
Definition: TVar.hh:25
TVar::Dynamic_qJJH
@ Dynamic_qJJH
Definition: TVar.hh:205
anonymous_namespace{TCouplingsBase.hh}::gMDL_cqq1
@ gMDL_cqq1
Definition: TCouplingsBase.hh:266
__modjhugenmela_MOD_setspinonecouplings
void __modjhugenmela_MOD_setspinonecouplings(double qqcoupl[SIZE_ZQQ][2], double vvcoupl[SIZE_ZVV][2])
gHIGGS_VV_4_PRIME6
@ gHIGGS_VV_4_PRIME6
Definition: raw_couplings.txt:54
gg_vv_
void gg_vv_(double *p, double *msq)
TVar::DefaultScaleScheme
@ DefaultScaleScheme
Definition: TVar.hh:196
anonymous_namespace{TCouplingsBase.hh}::gMDL_clu
@ gMDL_clu
Definition: TCouplingsBase.hh:282
anonymous_namespace{TCouplingsBase.hh}::gMDL_cuu
@ gMDL_cuu
Definition: TCouplingsBase.hh:273
TVar::CandidateDecay_ff
@ CandidateDecay_ff
Definition: TVar.hh:39
PDGHelpers::isATauLepton
bool isATauLepton(const int id)
Definition: PDGHelpers.cc:54
TVar::Fixed_mtPlusmH
@ Fixed_mtPlusmH
Definition: TVar.hh:203
MELACandidate::getDecayMode
TVar::CandidateDecayMode getDecayMode() const
Definition: MELACandidate.h:55
__modkinematics_MOD_getbwpropagator
double __modkinematics_MOD_getbwpropagator(double *shat, int *scheme)
TVar::Had_WH
@ Had_WH
Definition: TVar.hh:76
anonymous_namespace{TCouplingsBase.hh}::gMDL_chwb
@ gMDL_chwb
Definition: TCouplingsBase.hh:244
sqrts
double sqrts
Definition: TMCFM.hh:290
gATQGC_dVA
@ gATQGC_dVA
Definition: raw_couplings.txt:162
TVar::JJEW_TU
@ JJEW_TU
Definition: TVar.hh:95
TVar::Dynamic_Leading_pTJ
@ Dynamic_Leading_pTJ
Definition: TVar.hh:209
MELAParticle::id
int id
Definition: MELAParticle.h:17
ewcouple_
struct @29 ewcouple_
gAZff_dZRH
@ gAZff_dZRH
Definition: raw_couplings.txt:191
MelaIO::melaCand
MELACandidate * melaCand
Definition: MelaIO.h:29
TMCFMUtils::AssociatedParticleOrdering_QQVVQQAny
void AssociatedParticleOrdering_QQVVQQAny(int iSel, int jSel, int rSel, int sSel, int order[2])
Definition: TMCFMUtils.cc:18
qcdcouple_
struct @28 qcdcouple_
qqb_zz_
void qqb_zz_(double *p, double *msq)
TVar::JJVBF_S
@ JJVBF_S
Definition: TVar.hh:83
TVar::Lep_WH
@ Lep_WH
Definition: TVar.hh:78
anonymous_namespace{TCouplingsBase.hh}::gMDL_cdwre
@ gMDL_cdwre
Definition: TCouplingsBase.hh:254
TVar::JJQCD_TU
@ JJQCD_TU
Definition: TVar.hh:93
TVar::simple_event_record
Definition: TVar.hh:226
gHIGGS_VV_2
@ gHIGGS_VV_2
Definition: raw_couplings.txt:10
anonymous_namespace{TCouplingsBase.hh}::gMDL_ced
@ gMDL_ced
Definition: TCouplingsBase.hh:278
TVar::SelfDefine_spin1
@ SelfDefine_spin1
Definition: TVar.hh:180
LambdaHIGGS_QSQ_VV_4
@ LambdaHIGGS_QSQ_VV_4
Definition: raw_couplings.txt:64
anonymous_namespace{TCouplingsBase.hh}::gMDL_clequ1re
@ gMDL_clequ1re
Definition: TCouplingsBase.hh:294
TVar::H0hplus
@ H0hplus
Definition: TVar.hh:127
TUtil::GetBoostedParticleVectors
void GetBoostedParticleVectors(MELACandidate *melaCand, TVar::simple_event_record &mela_event, TVar::VerbosityLevel verbosity=TVar::DEBUG)
Definition: TUtil.cc:8212
modparameters::process
integer, public process
Definition: mod_Parameters.F90:17
gHIGGS_KAPPA
@ gHIGGS_KAPPA
Definition: raw_couplings.txt:2
TVar::bbH
@ bbH
Definition: TVar.hh:68
gAZff_uZRH
@ gAZff_uZRH
Definition: raw_couplings.txt:189
__modzprime_MOD_evalamp_zprime_vv
void __modzprime_MOD_evalamp_zprime_vv(double P[6][4], int *MYIDUP, double *MatElSq)
__modjhugenmela_MOD_setvprimecontactcouplings
void __modjhugenmela_MOD_setvprimecontactcouplings(double Zpffcoupl[SIZE_Vpff][2], double Wpffcoupl[SIZE_Vpff][2])
TVar::kUseAssociated_Leptons
@ kUseAssociated_Leptons
Definition: TVar.hh:31
MELAParticle::getNMothers
int getNMothers() const
Definition: MELAParticle.h:49
gAZff_ZnunuLH
@ gAZff_ZnunuLH
Definition: raw_couplings.txt:187
__modjhugen_MOD_initfirsttime
void __modjhugen_MOD_initfirsttime(char *gridfilename, int *lenfilename, int *irep, double *collider_sqrts)
anonymous_namespace{TCouplingsBase.hh}::gMDL_chd
@ gMDL_chd
Definition: TCouplingsBase.hh:262
TVar::JJQCD_S
@ JJQCD_S
Definition: TVar.hh:82
PDGHelpers::isUpTypeQuark
bool isUpTypeQuark(const int id)
Definition: PDGHelpers.cc:40
gg_hzz_tb_
void gg_hzz_tb_(double *p, double *msq)
anonymous_namespace{TCouplingsBase.hh}::gMDL_che
@ gMDL_che
Definition: TCouplingsBase.hh:258
em_
struct @30 em_
PDGHelpers::isAJet
bool isAJet(const int id)
Definition: PDGHelpers.cc:18
TVar::Lep_ZH_TU
@ Lep_ZH_TU
Definition: TVar.hh:99
gATQGC_dFourA
@ gATQGC_dFourA
Definition: raw_couplings.txt:165
LambdaHIGGS_QSQ_VV_2
@ LambdaHIGGS_QSQ_VV_2
Definition: raw_couplings.txt:62
__modjhugenmela_MOD_setdistinguishwwcouplingsflag
void __modjhugenmela_MOD_setdistinguishwwcouplingsflag(int *doallow)
gHIGGS_ZA_1_PRIME2
@ gHIGGS_ZA_1_PRIME2
Definition: raw_couplings.txt:46
MELAParticle::addDaughter
void addDaughter(MELAParticle *myParticle)
Definition: MELAParticle.cc:63
facscale_
struct @16 facscale_
TVar::CandidateDecay_GG
@ CandidateDecay_GG
Definition: TVar.hh:45