JHUGen MELA  v2.4.1
Matrix element calculations as used in JHUGen. MELA is an important tool that was used for the Higgs boson discovery and for precise measurements of its structure and interactions. Please see the website https://spin.pha.jhu.edu/ and papers cited there for more details, and kindly cite those papers when using this code.
Mela.cc
Go to the documentation of this file.
1 
44 /************** MELA interface to MCFM/JHUGen-MELA *************
45 
46 Notes:
47 1) Each specific type of computeP* function comes with its wrapper for common use.
48  Removing these wrappers from Mela will not introduce any bugs, but
49  it might affect packages that depend on it (eg. MEMCalculators).
50 2) ...
51 
52 Please adhere to the following coding conventions:
53 1) Never put return statements in the middle of the computeP* functions unless it is a wrapper.
54  Functions calling the Mela::ZZME member have to reset the couplings, so an abrupt termination
55  does not reset the couplings properly.
56 2) ...
57 
58 ***************************************************************/
59 
60 #include <vector>
61 #include <string>
62 #include <cstdio>
63 #include <cmath>
64 #include <unistd.h>
65 #include <sys/stat.h>
66 #include <sys/types.h>
67 
68 #include "Mela.h"
69 #include "ZZMatrixElement.h"
70 #include "VectorPdfFactory.h"
71 #include "TensorPdfFactory.h"
73 #include "RooqqZZ_JHU.h"
74 #include "SuperMELA.h"
75 #include "TUtilHelpers.hh"
76 #include "MELAStreamHelpers.hh"
77 
78 #include "RooMsgService.h"
79 #include "TFile.h"
80 #include "TH1F.h"
81 #include "TH2F.h"
82 #include "TH3F.h"
83 #include "TGraph.h"
84 #include "TSpline.h"
85 #include "TString.h"
86 
87 
88 using namespace std;
89 using namespace RooFit;
92 
93 
95  double LHCsqrts_,
96  double mh_,
97  TVar::VerbosityLevel verbosity_
98  ) :
99  melaRandomNumber(35797),
100  LHCsqrts(LHCsqrts_),
101  myVerbosity_(verbosity_),
102  ZZME(0),
103  auxiliaryProb(0.),
104  melaCand(0)
105 {
106  this->printLogo();
107  if (myVerbosity_>=TVar::DEBUG) MELAout << "Start Mela constructor" << endl;
108  build(mh_);
109  if (myVerbosity_>=TVar::DEBUG) MELAout << "End Mela constructor" << endl;
110 }
111 Mela::Mela(const Mela& other) :
112 melaRandomNumber(35797),
113 LHCsqrts(other.LHCsqrts),
114 myVerbosity_(other.myVerbosity_),
115 ZZME(0),
116 auxiliaryProb(0.),
117 melaCand(0)
118 {
119  double mh_ = other.ZZME->get_PrimaryHiggsMass();
120  build(mh_);
121 }
123  if (myVerbosity_>=TVar::DEBUG) MELAout << "Begin Mela destructor" << endl;
124 
125  //setRemoveLeptonMasses(false); // Use Run 1 scheme for not removing lepton masses. Notice the switch itself is defined as an extern, so it has to be set to default value at the destructor!
126  setRemoveLeptonMasses(true); // Use Run 2 scheme for removing lepton masses. Notice the switch itself is defined as an extern, so it has to be set to default value at the destructor!
127 
128  // Delete the derived RooFit objects first...
129  if (myVerbosity_>=TVar::DEBUG) MELAout << "Mela destructor: Destroying analytical PDFs" << endl;
130  delete ggSpin0Model;
131  delete spin1Model;
132  delete spin2Model;
133  delete qqZZmodel;
134  // ...then delete the observables.
135  if (myVerbosity_>=TVar::DEBUG) MELAout << "Mela destructor: Destroying analytical PDFs observables" << endl;
136  delete mzz_rrv;
137  delete z1mass_rrv;
138  delete z2mass_rrv;
139  delete costhetastar_rrv;
140  delete costheta1_rrv;
141  delete costheta2_rrv;
142  delete phi_rrv;
143  delete phi1_rrv;
144  delete Y_rrv;
145  delete upFrac_rrv;
146 
147  if (myVerbosity_>=TVar::DEBUG) MELAout << "Mela destructor: Destroying SuperDijetMELA" << endl;
148  delete superDijet;
149  if (myVerbosity_>=TVar::DEBUG) MELAout << "Mela destructor: Destroying SuperMELA" << endl;
150  delete super;
151  if (myVerbosity_>=TVar::DEBUG) MELAout << "Mela destructor: Destroying ZZME" << endl;
152  delete ZZME;
153 
154  // Delete ME constant handles
155  if (myVerbosity_>=TVar::DEBUG) MELAout << "Mela destructor: Destroying PConstant handles" << endl;
157 
158  if (myVerbosity_>=TVar::DEBUG) MELAout << "End Mela destructor" << endl;
159 }
160 
161 
163  remove("ffwarn.dat");
164  remove("br.sm1");
165  remove("br.sm2");
166  remove("input.DAT");
167  remove("process.DAT");
168  remove("Pdfdata/cteq6l1.tbl");
169  remove("Pdfdata/cteq6l.tbl");
170  remove("Pdfdata/NNPDF30_lo_as_0130.LHgrid");
171  rmdir("Pdfdata");
172 }
173 
174 
175 void Mela::build(double mh_){
176  if (myVerbosity_>=TVar::DEBUG) MELAout << "Start Mela::build" << endl;
177  //setRemoveLeptonMasses(false); // Use Run 1 scheme for not removing fermion masses
178  setRemoveLeptonMasses(true); // Use Run 2 scheme for removing fermion masses to compute MEs that expect massless fermions properly
179 
180  const double maxSqrts = 8.;
181 
182  // Create symlinks to the required files, if these are not already present (do nothing otherwise)
183  if (myVerbosity_>=TVar::DEBUG) MELAout << "Create symlinks to the required files if these are not already present:" << endl;
184 
185  const string MELAPKGPATH = TVar::GetMELAPath();
186  if (myVerbosity_>=TVar::DEBUG) MELAout << "\t- MELA package path: " << MELAPKGPATH << endl;
187 
188  const string mcfmWarning = MELAPKGPATH + "data/ffwarn.dat"; symlink(mcfmWarning.c_str(), "ffwarn.dat");
189  const string mcfm_brsm_o = MELAPKGPATH + "data/br.sm1"; symlink(mcfm_brsm_o.c_str(), "br.sm1");
190  const string mcfm_brsm_t = MELAPKGPATH + "data/br.sm2"; symlink(mcfm_brsm_t.c_str(), "br.sm2");
191  const string mcfmInput1 = MELAPKGPATH + "data/input.DAT"; symlink(mcfmInput1.c_str(), "input.DAT");
192  const string mcfmInput2 = MELAPKGPATH + "data/process.DAT"; symlink(mcfmInput2.c_str(), "process.DAT");
193  if (myVerbosity_>=TVar::DEBUG) MELAout << "\t- MCFM symlinks are done" << endl;
194  mkdir("Pdfdata", S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
195  const string mcfmInput3 = MELAPKGPATH + "data/Pdfdata/cteq6l1.tbl"; symlink(mcfmInput3.c_str(), "Pdfdata/cteq6l1.tbl");
196  const string mcfmInput4 = MELAPKGPATH + "data/Pdfdata/cteq6l.tbl"; symlink(mcfmInput4.c_str(), "Pdfdata/cteq6l.tbl");
197  if (myVerbosity_>=TVar::DEBUG) MELAout << "\t- PDF symlinks are done" << endl;
198 
199  if (myVerbosity_>=TVar::DEBUG) MELAout << "Create variables used in anaMELA" << endl;
200  mzz_rrv = new RooRealVar("mzz", "m_{ZZ}", mh_, 0., 1000.);
201  z1mass_rrv = new RooRealVar("z1mass", "m_{Z1}", 0., 160.);
202  z2mass_rrv = new RooRealVar("z2mass", "m_{Z2}", 0., 200.);
203  costhetastar_rrv = new RooRealVar("costhetastar", "cos#theta^{*}", -1., 1.);
204  costheta1_rrv = new RooRealVar("costheta1", "cos#theta_{1}", -1., 1.);
205  costheta2_rrv = new RooRealVar("costheta2", "cos#theta_{2}", -1., 1.);
206  phi_rrv= new RooRealVar("phi", "#Phi", -TMath::Pi(), TMath::Pi());
207  phi1_rrv= new RooRealVar("phi1", "#Phi_{1}", -TMath::Pi(), TMath::Pi());
208  Y_rrv = new RooRealVar("Yzz", "#Y_{ZZ}", 0, -4, 4);
209  upFrac_rrv = new RooRealVar("upFrac", "fraction up-quarks", .5, 0., 1.);
210 
211  RooSpin::modelMeasurables measurables_;
212  measurables_.h1 = costheta1_rrv;
213  measurables_.h2 = costheta2_rrv;
214  measurables_.Phi = phi_rrv;
215  measurables_.m1 = z1mass_rrv;
216  measurables_.m2 = z2mass_rrv;
217  measurables_.m12 = mzz_rrv;
218  measurables_.hs = costhetastar_rrv;
219  measurables_.Phi1 = phi1_rrv;
220  measurables_.Y = Y_rrv;
221 
222  if (myVerbosity_>=TVar::DEBUG) MELAout << "Create anaMELA PDF factories" << endl;
223  ggSpin0Model = new ScalarPdfFactory_HVV(measurables_, false, RooSpin::kVdecayType_Zll, RooSpin::kVdecayType_Zll); // RooSpin::kVdecayType_Zll,RooSpin::kVdecayType_Zll==ZZ4l
227 
228  if (myVerbosity_>=TVar::DEBUG) MELAout << "Paths for ZZMatrixElement" << endl;
229  const string path_HiggsWidthFile = MELAPKGPATH + "data/HiggsTotalWidth_YR3.txt";
230  if (myVerbosity_>=TVar::DEBUG) MELAout << "\t- Cross section/width file: " << path_HiggsWidthFile << endl;
231  const string path_nnpdf = MELAPKGPATH + "data/Pdfdata/NNPDF30_lo_as_0130.LHgrid";
232  char path_nnpdf_c[] = "Pdfdata/NNPDF30_lo_as_0130.LHgrid";
233  int pdfmember = 0;
234  if (myVerbosity_>=TVar::DEBUG) MELAout << "\t- Linking NNPDF path " << path_nnpdf.c_str() << " -> " << path_nnpdf_c << endl;
235  symlink(path_nnpdf.c_str(), path_nnpdf_c);
236  if (myVerbosity_>=TVar::DEBUG) MELAout << "Start ZZMatrixElement" << endl;
237  ZZME = new ZZMatrixElement(path_nnpdf_c, pdfmember, path_HiggsWidthFile.substr(0, path_HiggsWidthFile.length()-23).c_str(), 1000.*LHCsqrts/2., myVerbosity_);
238  if (myVerbosity_>=TVar::DEBUG) MELAout << "Set ZZMatrixElement masses" << endl;
240  setMelaHiggsMass(mh_, 0); setMelaHiggsMass(-1., 1);
241  setMelaHiggsWidth(-1., 0); setMelaHiggsWidth(-1., 1);
243  setCandidateDecayMode(TVar::CandidateDecay_ZZ); // Default decay mode is ZZ at the start
244 
245 
246  /***** CONSTANTS FOR MATRIX ELEMENTS *****/
248 
249 
250  /***** SuperMELA *****/
251  // Deactivate generation messages
252  RooMsgService::instance().getStream(1).removeTopic(NumIntegration);
253  RooMsgService::instance().setStreamStatus(1, kFALSE);
254  RooMsgService::instance().setStreamStatus(0, kFALSE);// silence also the error messages, but should really be looked at.
255 
256  if (myVerbosity_>=TVar::DEBUG) MELAout << "Start superMELA" << endl;
257  int superMELA_LHCsqrts = LHCsqrts;
258  if (superMELA_LHCsqrts > maxSqrts) superMELA_LHCsqrts = maxSqrts;
259  super = new SuperMELA(mh_, "4mu", superMELA_LHCsqrts); // preliminary intialization, we adjust the flavor later
260  char cardpath[500];
261  sprintf(cardpath, "data/CombinationInputs/SM_inputs_%dTeV/inputs_4mu.txt", superMELA_LHCsqrts);
262  string cardfile = MELAPKGPATH + cardpath;
263  super->SetPathToCards(cardfile.substr(0, cardfile.length()-14).c_str());
265  super->init();
266 
267 
268  /***** SuperDijetMela *****/
269  float superDijetSqrts = LHCsqrts;
270  if (superDijetSqrts<13.) superDijetSqrts=13.; // Dijet resolution does not exist for 7 or 8 TeV
271  superDijet = new SuperDijetMela(superDijetSqrts, myVerbosity_);
272 
273  // Initialize the couplings to 0 and end Mela constructor
275  if (myVerbosity_>=TVar::DEBUG) MELAout << "End Mela::build" << endl;
276 }
277 
278 void Mela::printLogo() const{
279  vector<string> logolines;
280  logolines.push_back("MELA (Matrix Element Likelihood Approach)");
281  logolines.push_back("");
282  logolines.push_back("Data analysis and Monte Carlo weights package");
283  logolines.push_back("for analyses of resonances produced at pp, ppbar, and e+e- colliders, featuring:");
284  logolines.push_back("");
285  logolines.push_back("* JHUGenMELA *");
286  logolines.push_back("Signal calculations based on analytical pdf.s, and JHU Generator (JHUGen) matrix elements");
287  logolines.push_back("(See JHUGen credits below)");
288  logolines.push_back("");
289  logolines.push_back("* MCFM *");
290  logolines.push_back("Signal, background, and interference calculations, modified based on JHUGen matrix elements");
291  logolines.push_back("(See MCFM credits below)");
292  logolines.push_back("");
293  logolines.push_back("For more details: http://spin.pha.jhu.edu");
294  logolines.push_back("");
295  size_t maxlinesize = 0;
296  for (auto const& l:logolines) maxlinesize = std::max(maxlinesize, l.length());
297  MELAout.writeCentered("", '*', maxlinesize+10); MELAout << endl;
298  unsigned int iline=0;
299  for (auto const& l:logolines){
300  MELAout << '*';
301  MELAout.writeCentered(l, ' ', maxlinesize+8);
302  MELAout << '*' << endl;
303  if (iline==0){ MELAout.writeCentered("", '*', maxlinesize+10); MELAout << endl; }
304  iline++;
305  }
306  MELAout.writeCentered("", '*', maxlinesize+10); MELAout << endl;
307 }
308 
309 // Set-functions
311  myME_ = myME;
312  myProduction_ = myProduction;
313  // In case s-channel processes are passed for JHUGen ME, flip them back to JHUGen-specific productions.
314  if (myME_==TVar::JHUGen){
321  }
322  myModel_ = myModel;
324 }
326  myVerbosity_=verbosity_;
332 }
334 // Should be called per-event
335 void Mela::setMelaPrimaryHiggsMass(double myHiggsMass){ ZZME->set_PrimaryHiggsMass(myHiggsMass); }
336 void Mela::setMelaHiggsMass(double myHiggsMass, int index){ ZZME->set_mHiggs(myHiggsMass, index); }
337 void Mela::setMelaHiggsWidth(double myHiggsWidth, int index){ ZZME->set_wHiggs(myHiggsWidth, index); }
338 void Mela::setMelaHiggsMassWidth(double myHiggsMass, double myHiggsWidth, int index){ ZZME->set_mHiggs_wHiggs(myHiggsMass, myHiggsWidth, index); }
344  SimpleParticleCollection_t* pDaughters,
345  SimpleParticleCollection_t* pAssociated,
346  SimpleParticleCollection_t* pMothers,
347  bool isGen
348  ){
350  pDaughters,
351  pAssociated,
352  pMothers,
353  isGen
354  );
355 }
358  SimpleParticleCollection_t* pDaughters,
359  SimpleParticleCollection_t* pAssociated,
360  SimpleParticleCollection_t* pMothers,
361  bool isGen
362  ){ ZZME->set_TempCandidate(pDaughters, pAssociated, pMothers); }
364 
365 
382  );
388  );
396  );
397 }
400 }
411  );
412 }
416  );
417 }
421  );
422 }
423 
424 
425 // Notice that this only sets the members of MELA, not TEvtProb. TEvtProb resets itself.
427  // We have a lot of them, now even more!
428 
429  //****Spin-0****//
430  differentiate_HWW_HZZ=false;
431  // Loop over the number of supported resonances
432  for (int jh=0; jh<(int)nSupportedHiggses; jh++){
433  for (int im=0; im<2; im++){
434  for (int ic=0; ic<SIZE_HGG; ic++) selfDHggcoupl[jh][ic][im]=0;
435  for (int ic=0; ic<SIZE_HGG; ic++) selfDHg4g4coupl[jh][ic][im]=0;
436 
437  for (int ic=0; ic<SIZE_HQQ; ic++) selfDHqqcoupl[jh][ic][im]=0;
438  for (int ic=0; ic<SIZE_HQQ; ic++) selfDHbbcoupl[jh][ic][im]=0;
439  for (int ic=0; ic<SIZE_HQQ; ic++) selfDHttcoupl[jh][ic][im]=0;
440  for (int ic=0; ic<SIZE_HQQ; ic++) selfDHb4b4coupl[jh][ic][im]=0;
441  for (int ic=0; ic<SIZE_HQQ; ic++) selfDHt4t4coupl[jh][ic][im]=0;
442 
443  for (int ic=0; ic<SIZE_HVV; ic++){
444  selfDHzzcoupl[jh][ic][im] = 0;
445  selfDHwwcoupl[jh][ic][im] = 0;
446  }
447  }
448  for (int ik=0; ik<SIZE_HVV_CQSQ; ik++){
449  selfDHzzCLambda_qsq[jh][ik]=0;
450  selfDHwwCLambda_qsq[jh][ik]=0;
451  for (int ic=0; ic<SIZE_HVV_LAMBDAQSQ; ic++){ // These default values do not matter as long as the c's are 0.
452  selfDHzzLambda_qsq[jh][ic][ik] = 100.;
453  selfDHwwLambda_qsq[jh][ic][ik] = 100.;
454  }
455  }
456  }
457  // Spin-0 contact terms
458  for (int im=0; im<2; im++){
459  for (int ic=0; ic<SIZE_HVV; ic++){
460  selfDHzzpcoupl[ic][im] = 0;
461  selfDHzpzpcoupl[ic][im] = 0;
462  selfDHwwpcoupl[ic][im] = 0;
463  selfDHwpwpcoupl[ic][im] = 0;
464  }
465  }
466 
467  //****Spin-1****//
468  for (int im=0; im<2; im++){
469  for (int ic=0; ic<SIZE_ZVV; ic++) selfDZvvcoupl[ic][im] = 0;
470  for (int ic=0; ic<SIZE_ZQQ; ic++) selfDZqqcoupl[ic][im] = 0;
471  }
472 
473  //****Spin-2****//
474  for (int im=0; im<2; im++){
475  for (int ic=0; ic<SIZE_GVV; ic++){
476  selfDGvvcoupl[ic][im] = 0;
477  selfDGvvpcoupl[ic][im] = 0;
478  selfDGvpvpcoupl[ic][im] = 0;
479  }
480  for (int ic=0; ic<SIZE_GGG; ic++) selfDGggcoupl[ic][im] = 0;
481  for (int ic=0; ic<SIZE_GQQ; ic++) selfDGqqcoupl[ic][im] = 0;
482  }
483 
484  // Vprime / contact couplings
485  for (int im=0; im<2; im++){
486  for (int ic=0; ic<SIZE_Vpff; ic++){
487  selfDZpffcoupl[ic][im] = 0;
488  selfDWpffcoupl[ic][im] = 0;
489  }
490  }
491  selfDM_Zprime = -1;
492  selfDGa_Zprime = 0;
493  selfDM_Wprime = -1;
494  selfDGa_Wprime = 0;
495 
496  // aTQGC couplings
497  for (int im=0; im<2; im++){
498  for (int ic=0; ic<SIZE_ATQGC; ic++) selfDaTQGCcoupl[ic][im] = 0;
499  }
500 
501  // AZff couplings
502  for (int im=0; im<2; im++){
503  for (int ic=0; ic<SIZE_AZff; ic++) selfDAZffcoupl[ic][im] = 0;
504  }
505 
506  // Did I tell you that we have a lot of them?
507 }
508 void Mela::resetMass(double inmass, int ipart){ ZZME->reset_Mass(inmass, ipart); }
509 void Mela::resetWidth(double inwidth, int ipart){ ZZME->reset_Width(inwidth, ipart); }
511 void Mela::resetMCFM_EWKParameters(double ext_Gf, double ext_aemmz, double ext_mW, double ext_mZ, double ext_xW, int ext_ewscheme){
512  ZZME->reset_MCFM_EWKParameters(ext_Gf, ext_aemmz, ext_mW, ext_mZ, ext_xW, ext_ewscheme);
513 }
514 
515 double Mela::getPrimaryMass(int ipart){ return ZZME->get_PrimaryMass(ipart); }
516 double Mela::getPrimaryWidth(int ipart){ return ZZME->get_PrimaryWidth(ipart); }
517 double Mela::getHiggsWidthAtPoleMass(double mass){ return ZZME->get_HiggsWidthAtPoleMass(mass); }
518 
519 void Mela::setRemoveLeptonMasses(bool MasslessLeptonSwitch){ TUtil::applyLeptonMassCorrection(MasslessLeptonSwitch); }
520 void Mela::setRemoveJetMasses(bool MasslessLeptonSwitch){ TUtil::applyJetMassCorrection(MasslessLeptonSwitch); }
521 void Mela::setRenFacScaleMode(TVar::EventScaleScheme renormalizationSch, TVar::EventScaleScheme factorizationSch, double ren_sf, double fac_sf){
522  ZZME->set_RenFacScaleMode(renormalizationSch, factorizationSch, ren_sf, fac_sf);
523 }
524 std::vector<TLorentzVector> Mela::calculate4Momentum(double Mx, double M1, double M2, double theta, double theta1, double theta2, double Phi1, double Phi){
525  return ZZME->Calculate4Momentum(Mx, M1, M2, theta, theta1, theta2, Phi1, Phi);
526 }
527 
529  RooSpin::modelMeasurables measurables;
530  measurables.h1 = costheta1_rrv;
531  measurables.h2 = costheta2_rrv;
532  measurables.Phi = phi_rrv;
533  measurables.m1 = z1mass_rrv;
534  measurables.m2 = z2mass_rrv;
535  measurables.m12 = mzz_rrv;
536  measurables.hs = costhetastar_rrv;
537  measurables.Phi1 = phi1_rrv;
538  measurables.Y = Y_rrv;
539  return measurables;
540 }
541 
542 
543 // Full parton-by-parton ME record
545 // Candidate functions
549 std::vector<MELATopCandidate_t*>* Mela::getTopCandidateCollection(){ return ZZME->get_TopCandidateCollection(); }
551 
552 
553 // SuperProb
554 void Mela::getPAux(float& prob){ prob = auxiliaryProb; }
555 void Mela::reset_PAux(){ auxiliaryProb=1.; } // SuperProb reset
556 
557 // Angle computation script of Mela to convert MELACandidates to m1, m2 etc.
559  float& qH,
560  float& m1,
561  float& m2,
562  float& costheta1,
563  float& costheta2,
564  float& Phi,
565  float& costhetastar,
566  float& Phi1
567 ){
569  if (myVerbosity_>=TVar::DEBUG) MELAout << "Mela: Begin computeDecayAngles" << endl;
570 
571  qH=0; m1=0; m2=0; costheta1=0; costheta2=0; Phi=0; costhetastar=0; Phi1=0;
572 
574  if (melaCand){
575  TLorentzVector const nullVector(0, 0, 0, 0);
576 
577  int partIncCode=TVar::kNoAssociated; // Only use associated partons in the pT=0 frame boost
578  simple_event_record mela_event;
579  mela_event.AssociationCode=partIncCode;
581  SimpleParticleCollection_t& daughters = mela_event.pDaughters;
582 
583  if (daughters.size()<2 || daughters.size()>4 || mela_event.intermediateVid.size()!=2){
584  if (myVerbosity_>=TVar::ERROR) MELAerr << "Mela::computeDecayAngles: Number of daughters " << daughters.size() << " or number of intermediate Vs " << mela_event.intermediateVid << " not supported!" << endl;
585  return;
586  }
587 
588  // Make sure there are exactly 4 daughters, null or not
589  if (daughters.size()%2==1){ for (unsigned int ipar=daughters.size(); ipar<4; ipar++) daughters.push_back(SimpleParticle_t(-9000, nullVector)); }
590  else if (daughters.size()==2){
591  daughters.push_back(SimpleParticle_t(-9000, nullVector));
592  daughters.insert(daughters.begin()+1, SimpleParticle_t(-9000, nullVector));
593  }
594  qH = (daughters.at(0).second+daughters.at(1).second+daughters.at(2).second+daughters.at(3).second).M();
595  m1 = (daughters.at(0).second+daughters.at(1).second).M();
596  m2 = (daughters.at(2).second+daughters.at(3).second).M();
597 
599  costhetastar, costheta1, costheta2, Phi, Phi1,
600  daughters.at(0).second, daughters.at(0).first,
601  daughters.at(1).second, daughters.at(1).first,
602  daughters.at(2).second, daughters.at(2).first,
603  daughters.at(3).second, daughters.at(3).first
604  );
605 
606  // Protect against NaN
607  if (!std::isfinite(costhetastar)) costhetastar=0;
608  if (!std::isfinite(costheta1)) costheta1=0;
609  if (!std::isfinite(costheta2)) costheta2=0;
610  if (!std::isfinite(Phi)) Phi=0;
611  if (!std::isfinite(Phi1)) Phi1=0;
612  }
613  else if (myVerbosity_>=TVar::DEBUG) MELAerr << "Mela::computeDecayAngles: No possible melaCand in TEvtProb to compute angles." << endl;
614 
615  reset_CandRef();
616  if (myVerbosity_>=TVar::DEBUG) MELAout << "Mela: End computeDecayAngles" << endl;
617 }
618 
619 // VBF angles computation script of Mela to convert MELACandidates to m1, m2 etc.
621  float& Q2V1,
622  float& Q2V2,
623  float& costheta1,
624  float& costheta2,
625  float& Phi,
626  float& costhetastar,
627  float& Phi1
628 ){
630  if (myVerbosity_>=TVar::DEBUG) MELAout << "Mela: Begin computeVBFAngles" << endl;
631 
632  Q2V1=0; Q2V2=0; costheta1=0; costheta2=0; Phi=0; costhetastar=0; Phi1=0;
633 
635  if (melaCand){
636  TLorentzVector const nullVector(0, 0, 0, 0);
637 
638  int nRequested_AssociatedJets=2;
639  int partIncCode=TVar::kUseAssociated_Jets; // Only use associated partons in the pT=0 frame boost
640  simple_event_record mela_event;
641  mela_event.AssociationCode=partIncCode;
642  mela_event.nRequested_AssociatedJets=nRequested_AssociatedJets;
644  SimpleParticleCollection_t& mothers = mela_event.pMothers;
645  SimpleParticleCollection_t& aparts = mela_event.pAssociated;
646  SimpleParticleCollection_t& daughters = mela_event.pDaughters;
647 
648  if ((int)aparts.size()!=nRequested_AssociatedJets){ if (myVerbosity_>=TVar::ERROR) MELAerr << "Mela::computeVBFAngles: Number of associated particles is not 2!" << endl; return; }
649 
650  // Make sure there are exactly 4 daughters, null or not
651  if (daughters.size()>4){ // Unsupported size, default to undecayed Higgs
652  SimpleParticle_t& firstPart = daughters.at(0);
653  firstPart.first=25;
654  for (auto it=daughters.cbegin()+1; it!=daughters.cend(); it++){ firstPart.second = firstPart.second + it->second; }
655  daughters.erase(daughters.begin()+4, daughters.end());
656  }
657  if (daughters.size()%2==1){ for (unsigned int ipar=daughters.size(); ipar<4; ipar++) daughters.push_back(SimpleParticle_t(-9000, nullVector)); }
658  else if (daughters.size()==2){
659  daughters.push_back(SimpleParticle_t(-9000, nullVector));
660  daughters.insert(daughters.begin()+1, SimpleParticle_t(-9000, nullVector));
661  }
662 
664  MELAout << "Mela::computeVBFAngles: Giving the following particles to TUtil::computeVBFAngles:" << endl;
665  for (unsigned int i=0; i<std::min(daughters.size(), (SimpleParticleCollection_t::size_type) 4); i++) MELAout << daughters.at(i) << endl;
666  for (unsigned int i=0; i<std::min(aparts.size(), (SimpleParticleCollection_t::size_type) 2); i++) MELAout << aparts.at(i) << endl;
667  for (unsigned int i=0; i<std::min(mothers.size(), (SimpleParticleCollection_t::size_type) 2); i++) MELAout << mothers.at(i) << endl;
668  }
669 
671  costhetastar, costheta1, costheta2, Phi, Phi1, Q2V1, Q2V2,
672  daughters.at(0).second, daughters.at(0).first,
673  daughters.at(1).second, daughters.at(1).first,
674  daughters.at(2).second, daughters.at(2).first,
675  daughters.at(3).second, daughters.at(3).first,
676  aparts.at(0).second, aparts.at(0).first,
677  aparts.at(1).second, aparts.at(1).first,
678  &(mothers.at(0).second), mothers.at(0).first,
679  &(mothers.at(1).second), mothers.at(1).first
680  );
681 
682  // Protect against NaN
683  if (!std::isfinite(costhetastar)) costhetastar=0;
684  if (!std::isfinite(costheta1)) costheta1=0;
685  if (!std::isfinite(costheta2)) costheta2=0;
686  if (!std::isfinite(Phi)) Phi=0;
687  if (!std::isfinite(Phi1)) Phi1=0;
688  if (!std::isfinite(Q2V1)) Q2V1=0;
689  if (!std::isfinite(Q2V2)) Q2V2=0;
690 
692  << "Mela::computeVBFAngles: (Q2_1, Q2_2, h1, h2, Phi, hs, Phi1) = "
693  << Q2V1 << ", " << Q2V2 << ", "
694  << costheta1 << ", " << costheta2 << ", " << Phi << ", "
695  << costhetastar << ", " << Phi1 << endl;
696  }
697  else if (myVerbosity_>=TVar::DEBUG) MELAerr << "Mela::computeVBFAngles: No possible melaCand in TEvtProb to compute angles." << endl;
698 
699  reset_CandRef();
700  if (myVerbosity_>=TVar::DEBUG) MELAout << "Mela: End computeVBFAngles" << endl;
701 }
703  float& Q2V1,
704  float& Q2V2,
705  float& costheta1_real, float& costheta1_imag,
706  float& costheta2_real, float& costheta2_imag,
707  float& Phi,
708  float& costhetastar,
709  float& Phi1
710 ){
712  if (myVerbosity_>=TVar::DEBUG) MELAout << "Mela: Begin computeVBFAngles_ComplexBoost" << endl;
713 
714  Q2V1=0; Q2V2=0; costheta1_real=0; costheta2_real=0; costheta1_imag=0; costheta2_imag=0; Phi=0; costhetastar=0; Phi1=0;
715 
717  if (melaCand){
718  TLorentzVector const nullVector(0, 0, 0, 0);
719 
720  int nRequested_AssociatedJets=2;
721  int partIncCode=TVar::kUseAssociated_Jets; // Only use associated partons in the pT=0 frame boost
722  simple_event_record mela_event;
723  mela_event.AssociationCode=partIncCode;
724  mela_event.nRequested_AssociatedJets=nRequested_AssociatedJets;
726  SimpleParticleCollection_t& mothers = mela_event.pMothers;
727  SimpleParticleCollection_t& aparts = mela_event.pAssociated;
728  SimpleParticleCollection_t& daughters = mela_event.pDaughters;
729 
730  if ((int) aparts.size()!=nRequested_AssociatedJets){ if (myVerbosity_>=TVar::ERROR) MELAerr << "Mela::computeVBFAngles_ComplexBoost: Number of associated particles is not 2!" << endl; return; }
731 
732  // Make sure there are exactly 4 daughters, null or not
733  if (daughters.size()>4){ // Unsupported size, default to undecayed Higgs
734  SimpleParticle_t& firstPart = daughters.at(0);
735  firstPart.first=25;
736  for (auto it=daughters.cbegin()+1; it!=daughters.cend(); it++){ firstPart.second = firstPart.second + it->second; }
737  daughters.erase(daughters.begin()+4, daughters.end());
738  }
739  if (daughters.size()%2==1){ for (unsigned int ipar=daughters.size(); ipar<4; ipar++) daughters.push_back(SimpleParticle_t(-9000, nullVector)); }
740  else if (daughters.size()==2){
741  daughters.push_back(SimpleParticle_t(-9000, nullVector));
742  daughters.insert(daughters.begin()+1, SimpleParticle_t(-9000, nullVector));
743  }
744 
746  costhetastar, costheta1_real, costheta1_imag, costheta2_real, costheta2_imag, Phi, Phi1, Q2V1, Q2V2,
747  daughters.at(0).second, daughters.at(0).first,
748  daughters.at(1).second, daughters.at(1).first,
749  daughters.at(2).second, daughters.at(2).first,
750  daughters.at(3).second, daughters.at(3).first,
751  aparts.at(0).second, aparts.at(0).first,
752  aparts.at(1).second, aparts.at(1).first,
753  &(mothers.at(0).second), mothers.at(0).first,
754  &(mothers.at(1).second), mothers.at(1).first
755  );
756 
757  // Protect against NaN
758  if (!std::isfinite(costhetastar)) costhetastar=0;
759  if (!std::isfinite(costheta1_real)) costheta1_real=0;
760  if (!std::isfinite(costheta2_real)) costheta2_real=0;
761  if (!std::isfinite(costheta1_imag)) costheta1_imag=0;
762  if (!std::isfinite(costheta2_imag)) costheta2_imag=0;
763  if (!std::isfinite(Phi)) Phi=0;
764  if (!std::isfinite(Phi1)) Phi1=0;
765  if (!std::isfinite(Q2V1)) Q2V1=0;
766  if (!std::isfinite(Q2V2)) Q2V2=0;
767 
768  if (myVerbosity_>=TVar::DEBUG) MELAout << "Mela::computeVBFAngles_ComplexBoost: result = " << Q2V1 << ", " << Q2V2
769  << ", " << costheta1_real << " + " << costheta1_imag << "i, "
770  << costheta2_real << " + " << costheta2_imag << "i, " << Phi << ", "
771  << costhetastar << ", " << Phi1 << endl;
773  << "Mela::computeVBFAngles_ComplexBoost: (Q2_1, Q2_2, h1, h2, Phi, hs, Phi1) = "
774  << Q2V1 << ", " << Q2V2 << ", "
775  << costheta1_real << " + " << costheta1_imag << "i, "
776  << costheta2_real << " + " << costheta2_imag << "i, "
777  << Phi << ", " << costhetastar << ", " << Phi1 << endl;
778  }
779  else if (myVerbosity_>=TVar::DEBUG) MELAerr << "Mela::computeVBFAngles_ComplexBoost: No possible melaCand in TEvtProb to compute angles." << endl;
780 
781  reset_CandRef();
782  if (myVerbosity_>=TVar::DEBUG) MELAout << "Mela: End computeVBFAngles_ComplexBoost" << endl;
783 }
784 
785 // VH angles computation script of Mela to convert MELACandidates to production angles.
787  float& mVstar,
788  float& mV,
789  float& costheta1,
790  float& costheta2,
791  float& Phi,
792  float& costhetastar,
793  float& Phi1
794 ){
796  if (myVerbosity_>=TVar::DEBUG) MELAout << "Mela: Begin computeVHAngles" << endl;
797 
798  mVstar = 0; mV = 0; costheta1=0; costheta2=0; Phi=0; costhetastar=0; Phi1=0;
799 
801  if (melaCand){
802  TLorentzVector const nullVector(0, 0, 0, 0);
803 
805  if (myVerbosity_>=TVar::ERROR) MELAerr << "Mela::computeVHAngles: Production is not supported! " << ProductionName(myProduction_) << endl;
806  return;
807  }
808 
809  int nRequested_AssociatedJets=0;
810  int nRequested_AssociatedLeptons=0;
811  int nRequested_AssociatedPhotons=0;
812  int AssociationVCompatibility=0;
813  int partIncCode=TVar::kNoAssociated; // Just to avoid warnings
814  if (myProduction_ == TVar::Had_ZH || myProduction_ == TVar::Had_WH){ // Only use associated partons
815  partIncCode=TVar::kUseAssociated_Jets;
816  nRequested_AssociatedJets=2;
817  }
818  else if (myProduction_ == TVar::Lep_ZH || myProduction_ == TVar::Lep_WH){ // Only use associated leptons(+)neutrinos
819  partIncCode=TVar::kUseAssociated_Leptons;
820  nRequested_AssociatedLeptons=2;
821  }
822  else if (myProduction_ == TVar::GammaH){ // Only use associated photon
823  partIncCode=TVar::kUseAssociated_Photons;
824  nRequested_AssociatedPhotons=1;
825  }
826  if (myProduction_==TVar::Lep_WH || myProduction_==TVar::Had_WH) AssociationVCompatibility=24;
827  else if (myProduction_==TVar::Lep_ZH || myProduction_==TVar::Had_ZH) AssociationVCompatibility=23;
828  else if (myProduction_==TVar::GammaH) AssociationVCompatibility=22;
829  simple_event_record mela_event;
830  mela_event.AssociationCode=partIncCode;
831  mela_event.AssociationVCompatibility=AssociationVCompatibility;
832  mela_event.nRequested_AssociatedJets=nRequested_AssociatedJets;
833  mela_event.nRequested_AssociatedLeptons=nRequested_AssociatedLeptons;
834  mela_event.nRequested_AssociatedPhotons=nRequested_AssociatedPhotons;
836  SimpleParticleCollection_t& mothers = mela_event.pMothers;
837  SimpleParticleCollection_t& aparts = mela_event.pAssociated;
838  SimpleParticleCollection_t& daughters = mela_event.pDaughters;
839 
840  if ((aparts.size()<(unsigned int) (nRequested_AssociatedJets+nRequested_AssociatedLeptons) && myProduction_!=TVar::GammaH) || (aparts.size()<(unsigned int) nRequested_AssociatedPhotons && myProduction_==TVar::GammaH)){
842  MELAerr << "Mela::computeVHAngles: Number of associated particles (" << aparts.size() << ") is less than ";
843  if (myProduction_!=TVar::GammaH) MELAerr << (nRequested_AssociatedJets+nRequested_AssociatedLeptons);
844  else MELAerr << nRequested_AssociatedPhotons;
845  MELAerr << endl;
846  }
847  return;
848  }
849 
850  // Make sure there are exactly 4 daughters, null or not
851  if (daughters.size()>4){ // Unsupported size, default to undecayed Higgs
852  SimpleParticle_t& firstPart = daughters.at(0);
853  firstPart.first=25;
854  for (auto it=daughters.cbegin()+1; it!=daughters.cend(); it++){ firstPart.second = firstPart.second + it->second; }
855  daughters.erase(daughters.begin()+4, daughters.end());
856  }
857  if (daughters.size()%2==1){ for (unsigned int ipar=daughters.size(); ipar<4; ipar++) daughters.push_back(SimpleParticle_t(-9000, nullVector)); }
858  else if (daughters.size()==2){
859  daughters.push_back(SimpleParticle_t(-9000, nullVector));
860  daughters.insert(daughters.begin()+1, SimpleParticle_t(-9000, nullVector));
861  }
862 
864  costhetastar, costheta1, costheta2, Phi, Phi1, mVstar, mV,
865  daughters.at(0).second, daughters.at(0).first,
866  daughters.at(1).second, daughters.at(1).first,
867  daughters.at(2).second, daughters.at(2).first,
868  daughters.at(3).second, daughters.at(3).first,
869  aparts.at(0).second, aparts.at(0).first,
870  aparts.at(1).second, aparts.at(1).first,
871  &(mothers.at(0).second), mothers.at(0).first,
872  &(mothers.at(1).second), mothers.at(1).first
873  );
874 
875  // Protect against NaN
876  if (!std::isfinite(costhetastar)) costhetastar=0;
877  if (!std::isfinite(costheta1)) costheta1=0;
878  if (!std::isfinite(costheta2)) costheta2=0;
879  if (!std::isfinite(Phi)) Phi=0;
880  if (!std::isfinite(Phi1)) Phi1=0;
881  if (!std::isfinite(mVstar)) mVstar=0;
882  if (!std::isfinite(mV)) mV=0;
883 
885  << "Mela::computeVHAngles: (mVstar, mV, h1, h2, Phi, hs, Phi1) = "
886  << mVstar << ", " << mV << ", " << costheta1 << ", " << costheta2 << ", " << Phi << ", "
887  << costhetastar << ", " << Phi1 << endl;
888  }
889  else if (myVerbosity_>=TVar::DEBUG) MELAerr << "Mela::computeVHAngles: No possible melaCand in TEvtProb to compute angles." << endl;
890 
891  reset_CandRef();
892  if (myVerbosity_>=TVar::DEBUG) MELAout << "Mela: End computeVHAngles" << endl;
893 }
894 
896  int topDecay,
897 
898  float& mT1,
899  float& mW1,
900  float& mT2,
901  float& mW2,
902 
903  // TTH system
904  float& costheta1,
905  float& costheta2,
906  float& Phi,
907  float& costhetastar,
908  float& Phi1,
909 
910  // TT system
911  float& hbb,
912  float& hWW,
913  float& Phibb,
914  float& Phi1bb,
915 
916  // Wplus system
917  float& hWplusf,
918  float& PhiWplusf,
919 
920  // Wminus system
921  float& hWminusf,
922  float& PhiWminusf
923 ){
925  if (myVerbosity_>=TVar::DEBUG) MELAout << "Mela: Begin computeVBFAngles" << endl;
926 
927  mT1=mT2=mW1=mW2
928  =costheta1=costheta2=Phi=costhetastar=Phi1
929  =hbb=hWW=Phibb=Phi1bb
930  =hWplusf=PhiWplusf
931  =hWminusf=PhiWminusf=0;
932 
934  if (melaCand){
935  TLorentzVector const nullVector(0, 0, 0, 0);
936 
937  int partIncCode;
938  int nRequested_Tops=1;
939  int nRequested_Antitops=1;
940  if (topDecay>0) partIncCode=TVar::kUseAssociated_UnstableTops; // Look for unstable tops
941  else partIncCode=TVar::kUseAssociated_StableTops; // Look for stable tops
942 
943  simple_event_record mela_event;
944  mela_event.AssociationCode=partIncCode;
945  mela_event.nRequested_Tops=nRequested_Tops;
946  mela_event.nRequested_Antitops=nRequested_Antitops;
948  SimpleParticleCollection_t& mothers = mela_event.pMothers;
949  //SimpleParticleCollection_t& aparts = mela_event.pAssociated;
950  SimpleParticleCollection_t& daughters = mela_event.pDaughters;
951 
952  SimpleParticleCollection_t topDaughters; topDaughters.reserve(3);
953  SimpleParticleCollection_t antitopDaughters; antitopDaughters.reserve(3);
954 
955  if (topDecay>0){
956  // Daughters are assumed to have been ordered as b, Wf, Wfb already.
957  for (unsigned int itd=0; itd<mela_event.pTopDaughters.at(0).size(); itd++) topDaughters.push_back(mela_event.pTopDaughters.at(0).at(itd));
958  for (unsigned int itd=0; itd<mela_event.pAntitopDaughters.at(0).size(); itd++) antitopDaughters.push_back(mela_event.pAntitopDaughters.at(0).at(itd));
959  }
960  else{
961  for (unsigned int itop=0; itop<mela_event.pStableTops.size(); itop++) topDaughters.push_back(mela_event.pStableTops.at(itop));
962  for (unsigned int itop=0; itop<mela_event.pStableAntitops.size(); itop++) antitopDaughters.push_back(mela_event.pStableAntitops.at(itop));
963  }
964 
965  if (topDecay==0 && (mela_event.pStableTops.size()<1 || mela_event.pStableAntitops.size()<1)){
967  << "TUtil::TTHiggsMatEl: Number of stable tops (" << mela_event.pStableTops.size() << ")"
968  << " and number of stable antitops (" << mela_event.pStableAntitops.size() << ")"
969  << " in ttH process are not 1!" << endl;
970  return;
971  }
972  else if (topDecay>0 && (mela_event.pTopDaughters.size()<1 || mela_event.pAntitopDaughters.size()<1)){
974  << "Mela::computeTTHAngles: Number of set of top daughters (" << mela_event.pTopDaughters.size() << ")"
975  << " and number of set of antitop daughters (" << mela_event.pAntitopDaughters.size() << ")"
976  << " in ttH process are not 1!" << endl;
977  return;
978  }
979  else if (topDecay>0 && (mela_event.pTopDaughters.at(0).size()!=3 || mela_event.pAntitopDaughters.at(0).size()!=3)){
981  << "Mela::computeTTHAngles: Number of top daughters (" << mela_event.pTopDaughters.at(0).size() << ")"
982  << " and number of antitop daughters (" << mela_event.pAntitopDaughters.at(0).size() << ")"
983  << " in ttH process are not 3!" << endl;
984  return;
985  }
986  if (topDaughters.size()<3){ for (size_t ip=topDaughters.size(); ip<3; ip++) topDaughters.emplace_back(-9000, nullVector); }
987  if (antitopDaughters.size()<3){ for (size_t ip=antitopDaughters.size(); ip<3; ip++) antitopDaughters.emplace_back(-9000, nullVector); }
988 
989  // Make sure there are exactly 4 daughters, null or not
990  if (daughters.size()>4){ // Unsupported size, default to undecayed Higgs
991  SimpleParticle_t& firstPart = daughters.at(0);
992  firstPart.first=25;
993  for (auto it=daughters.cbegin()+1; it!=daughters.cend(); it++){ firstPart.second = firstPart.second + it->second; }
994  daughters.erase(daughters.begin()+4, daughters.end());
995  }
996  if (daughters.size()%2==1){ for (unsigned int ipar=daughters.size(); ipar<4; ipar++) daughters.push_back(SimpleParticle_t(-9000, nullVector)); }
997  else if (daughters.size()==2){
998  daughters.push_back(SimpleParticle_t(-9000, nullVector));
999  daughters.insert(daughters.begin()+1, SimpleParticle_t(-9000, nullVector));
1000  }
1001 
1002  // Compute masses
1003  {
1004  TLorentzVector pT;
1005  TLorentzVector pW;
1006  for (size_t ip=0; ip<topDaughters.size(); ip++){
1007  if (ip>0){ pT += topDaughters.at(ip).second; pW += topDaughters.at(ip).second; }
1008  else pT += topDaughters.at(ip).second;
1009  }
1010  mT1=pT.M();
1011  mW1=pW.M();
1012  }
1013  {
1014  TLorentzVector pT;
1015  TLorentzVector pW;
1016  for (size_t ip=0; ip<antitopDaughters.size(); ip++){
1017  if (ip>0){ pT += antitopDaughters.at(ip).second; pW += antitopDaughters.at(ip).second; }
1018  else pT += antitopDaughters.at(ip).second;
1019  }
1020  mT2=pT.M();
1021  mW2=pW.M();
1022  }
1023 
1025  costhetastar, costheta1, costheta2, Phi, Phi1,
1026  hbb, hWW, Phibb, Phi1bb,
1027  hWplusf, PhiWplusf,
1028  hWminusf, PhiWminusf,
1029 
1030  daughters.at(0).second, daughters.at(0).first,
1031  daughters.at(1).second, daughters.at(1).first,
1032  daughters.at(2).second, daughters.at(2).first,
1033  daughters.at(3).second, daughters.at(3).first,
1034 
1035  topDaughters.at(0).second, topDaughters.at(0).first,
1036  topDaughters.at(1).second, topDaughters.at(1).first,
1037  topDaughters.at(2).second, topDaughters.at(2).first,
1038 
1039  antitopDaughters.at(0).second, antitopDaughters.at(0).first,
1040  antitopDaughters.at(1).second, antitopDaughters.at(1).first,
1041  antitopDaughters.at(2).second, antitopDaughters.at(2).first,
1042 
1043  &(mothers.at(0).second), mothers.at(0).first,
1044  &(mothers.at(1).second), mothers.at(1).first
1045  );
1046 
1047  // Protect against NaN
1048  if (!std::isfinite(costhetastar)) costhetastar=0;
1049  if (!std::isfinite(costheta1)) costheta1=0;
1050  if (!std::isfinite(costheta2)) costheta2=0;
1051  if (!std::isfinite(Phi)) Phi=0;
1052  if (!std::isfinite(Phi1)) Phi1=0;
1053 
1054  if (!std::isfinite(hbb)) hbb=0;
1055  if (!std::isfinite(hWW)) hWW=0;
1056  if (!std::isfinite(Phibb)) Phibb=0;
1057  if (!std::isfinite(Phi1bb)) Phi1bb=0;
1058 
1059  if (!std::isfinite(hWplusf)) hWplusf=0;
1060  if (!std::isfinite(PhiWplusf)) PhiWplusf=0;
1061 
1062  if (!std::isfinite(hWminusf)) hWminusf=0;
1063  if (!std::isfinite(PhiWminusf)) PhiWminusf=0;
1064 
1066  << "Mela::computeTTHAngles: (h1, h2, Phi, hs, Phi1) = "
1067  << costheta1 << ", " << costheta2 << ", " << Phi << ", "
1068  << costhetastar << ", " << Phi1 << endl;
1069  }
1070  else if (myVerbosity_>=TVar::DEBUG) MELAerr << "Mela::computeTTHAngles: No possible melaCand in TEvtProb to compute angles." << endl;
1071 
1072  reset_CandRef();
1073  if (myVerbosity_>=TVar::DEBUG) MELAout << "Mela: End computeTTHAngles" << endl;
1074 }
1075 
1076 // Regular probabilities
1078  double selfDHvvcoupl_input[nSupportedHiggses][SIZE_HVV][2],
1079  float& prob,
1080  bool useConstant
1081  ){
1082  //remove this line, it's here for counting purposes. Zpffcoupl
1083  // Don't set these, and you will get 0.
1084  if (myME_==TVar::JHUGen){
1085  for (int jh=0; jh<(int)nSupportedHiggses; jh++){
1086  // JHUGen ME production side is Hqq=1, Hgg=1
1087  selfDHqqcoupl[jh][0][0] = 1.0;
1088  selfDHggcoupl[jh][0][0] = 1.0;
1089  }
1090  }
1091  else if (myME_==TVar::MCFM){
1092  for (int jh=0; jh<(int)nSupportedHiggses; jh++){
1093  // MCFM ME production side is Htt=Hbb=1
1094  selfDHttcoupl[jh][0][0] = 1.0;
1095  selfDHbbcoupl[jh][0][0] = 1.0;
1096  }
1097  }
1098  for (int jh=0; jh<(int)nSupportedHiggses; jh++){
1099  for (int im=0; im<2; im++){
1100  for (int ic=0; ic<SIZE_HVV; ic++){
1101  selfDHzzcoupl[jh][ic][im] = selfDHvvcoupl_input[jh][ic][im];
1102  selfDHwwcoupl[jh][ic][im] = selfDHvvcoupl_input[jh][ic][im]; // Just for extra protection since differentiate_HWW_HZZ is set to false.
1103  }
1104  }
1105  }
1106 
1107  computeP(
1108  prob,
1109  useConstant
1110  );
1111 }
1113  double selfDZqqcoupl_input[SIZE_ZQQ][2],
1114  double selfDZvvcoupl_input[SIZE_ZVV][2],
1115  float& prob,
1116  bool useConstant
1117  ){
1118  for (int im=0; im<2; im++){
1119  for (int ic=0; ic<SIZE_ZQQ; ic++) selfDZqqcoupl[ic][im] = selfDZqqcoupl_input[ic][im];
1120  for (int ic=0; ic<SIZE_ZVV; ic++) selfDZvvcoupl[ic][im] = selfDZvvcoupl_input[ic][im];
1121  }
1122 
1123  computeP(
1124  prob,
1125  useConstant
1126  );
1127 }
1129  double selfDZvvcoupl_input[SIZE_ZVV][2],
1130  float& prob,
1131  bool useConstant
1132  ){
1133  // Initialize the quark_left_right couplings
1134  selfDZqqcoupl[0][0]=1.0;
1135  selfDZqqcoupl[1][0]=1.0;
1136 
1137  for (int im=0; im<2; im++){
1138  for (int ic=0; ic<SIZE_ZVV; ic++) selfDZvvcoupl[ic][im] = selfDZvvcoupl_input[ic][im];
1139  }
1140 
1141  computeP(
1142  prob,
1143  useConstant
1144  );
1145 }
1147  double selfDGggcoupl_input[SIZE_GGG][2],
1148  double selfDGqqcoupl_input[SIZE_GQQ][2],
1149  double selfDGvvcoupl_input[SIZE_GVV][2],
1150  float& prob,
1151  bool useConstant
1152  ){
1153  for (int im=0; im<2; im++){
1154  for (int ic=0; ic<SIZE_GGG; ic++) selfDGggcoupl[ic][im] = selfDGggcoupl_input[ic][im];
1155  for (int ic=0; ic<SIZE_GQQ; ic++) selfDGqqcoupl[ic][im] = selfDGqqcoupl_input[ic][im];
1156  for (int ic=0; ic<SIZE_GVV; ic++) selfDGvvcoupl[ic][im] = selfDGvvcoupl_input[ic][im];
1157  }
1158 
1159  computeP(
1160  prob,
1161  useConstant
1162  );
1163 }
1165  double selfDGggcoupl_input[SIZE_GGG][2],
1166  double selfDGvvcoupl_input[SIZE_GVV][2],
1167  float& prob,
1168  bool useConstant
1169  ){
1170  selfDGqqcoupl[0][0]=1.0; // Set these incorrectly, and you see left-right asymmetries in qqG (or nothing)
1171  selfDGqqcoupl[1][0]=1.0;
1172 
1173  for (int im=0; im<2; im++){
1174  for (int ic=0; ic<SIZE_GGG; ic++) selfDGggcoupl[ic][im] = selfDGggcoupl_input[ic][im];
1175  for (int ic=0; ic<SIZE_GVV; ic++) selfDGvvcoupl[ic][im] = selfDGvvcoupl_input[ic][im];
1176  }
1177 
1178  computeP(
1179  prob,
1180  useConstant
1181  );
1182 }
1184  float& prob,
1185  bool useConstant
1186  ){
1187  if (myVerbosity_>=TVar::DEBUG) MELAout << "Mela: Begin computeP" << endl;
1188  reset_PAux();
1189 
1191  if (melaCand){
1192  TLorentzVector const nullVector(0, 0, 0, 0);
1193  float mZZ=0, mZ1=0, mZ2=0, costheta1=0, costheta2=0, Phi=0, costhetastar=0, Phi1=0;
1194 
1195  if (myME_ == TVar::ANALYTICAL){
1197  mZZ, mZ1, mZ2,
1198  costheta1, costheta2, Phi,
1199  costhetastar, Phi1
1200  );
1201  costhetastar_rrv->setVal(costhetastar);
1202  costheta1_rrv->setVal(costheta1);
1203  costheta2_rrv->setVal(costheta2);
1204  phi_rrv->setVal(Phi);
1205  phi1_rrv->setVal(Phi1);
1206  z1mass_rrv->setVal(mZ1);
1207  z2mass_rrv->setVal(mZ2);
1208  mzz_rrv->setVal(mZZ);
1209  Y_rrv->setConstant(true); // Just to avoid integrating over this variable unnecessarily
1210 
1211  bool computeAnaMELA = configureAnalyticalPDFs();
1212  if (computeAnaMELA){
1214  RooAbsPdf* integral = (RooAbsPdf*)pdf->createIntegral(RooArgSet(*costhetastar_rrv, *phi1_rrv));
1215  prob = integral->getVal();
1216  delete integral;
1217  }
1218  else prob = pdf->getVal();
1219  }
1220  else if (myVerbosity_>=TVar::ERROR) MELAerr << "Mela::computeP: The specified anaMELA configuration is not valid!" << endl;
1221 
1222  Y_rrv->setConstant(false);
1223  }
1224  else if (myME_ == TVar::JHUGen || myME_ == TVar::MCFM){
1225  setAZffCouplings();
1230  ZZME->computeXS(prob);
1231  }
1232  else{
1234  mZZ, mZ1, mZ2,
1235  costheta1, costheta2, Phi,
1236  costhetastar, Phi1
1237  );
1238 
1239  if (myVerbosity_>=TVar::DEBUG){ // Notify first
1240  MELAout << "Mela::computeP: Condition (myME_ == TVar::MCFM && myProduction_ == TVar::ZZINDEPENDENT && myModel_ == TVar::bkgZZ/WW/ZGamma/ZJJ/GammaGamma)." << endl;
1241  vector<TLorentzVector> pDauVec = calculate4Momentum(mZZ, mZ1, mZ1, acos(costhetastar), acos(costheta1), acos(costheta2), Phi1, Phi);
1242  MELAout
1243  << "\tOriginal mZZ=" << mZZ << " "
1244  << "m1=" << mZ1 << " "
1245  << "m2=" << mZ2 << " "
1246  << "h1=" << costheta1 << " "
1247  << "h2=" << costheta2 << " "
1248  << "Phi=" << Phi << " "
1249  << "hs=" << costhetastar << " "
1250  << "Phi1=" << Phi1 << endl;
1251  MELAout << "\tfor daughters:" << endl;
1252  for (int iv=0; iv<2; iv++){
1253  for (int idau=0; idau<min(2, melaCand->getSortedV(iv)->getNDaughters()); idau++){
1254  MELAout
1255  << "id=" << melaCand->getSortedV(iv)->getDaughter(idau)->id << " "
1256  << "x=" << pDauVec.at(2*iv+idau).X() << " "
1257  << "y=" << pDauVec.at(2*iv+idau).Y() << " "
1258  << "z=" << pDauVec.at(2*iv+idau).Z() << " "
1259  << "t=" << pDauVec.at(2*iv+idau).T() << endl;
1260  }
1261  }
1262 
1263  }
1264 
1265  prob = 0;
1266  int gridsize_hs = 5;
1267  double hs_min = 0; //-1.;
1268  double hs_max = 1;
1269  double hs_step = (hs_max - hs_min) / double(gridsize_hs);
1270 
1271  int gridsize_phi1 = 5;
1272  double phi1_min = 0; //-TMath::Pi();
1273  double phi1_max = TMath::Pi();
1274  double phi1_step = (phi1_max - phi1_min) / double(gridsize_phi1);
1275 
1276  for (int i_hs = 0; i_hs < gridsize_hs + 1; i_hs++){
1277  double hs_val = hs_min + i_hs * hs_step;
1278  for (int i_phi1 = 0; i_phi1 < gridsize_phi1 + 1; i_phi1++){
1279  double phi1_val = phi1_min + i_phi1 * phi1_step;
1280  float temp_prob=0;
1281 
1282  // Get identical 4-vectors
1284  vector<TLorentzVector> pDauVec = calculate4Momentum(mZZ, mZ1, mZ2, acos(hs_val), acos(costheta1), acos(costheta2), phi1_val, Phi);
1285  for (int iv=0; iv<2; iv++){
1286  for (int idau=0; idau<min(2, melaCand->getSortedV(iv)->getNDaughters()); idau++){
1287  SimpleParticle_t tmpPair(melaCand->getSortedV(iv)->getDaughter(idau)->id, pDauVec.at(2*iv+idau));
1288  daughters.push_back(tmpPair);
1289  }
1290  }
1291  if (myVerbosity_>=TVar::DEBUG){ // Summarize the integrated particles
1292  MELAout << "Mela::computeP: hs, Phi1 are now " << hs_val << " " << phi1_val << endl;
1293  unsigned int idau=1;
1294  for (SimpleParticle_t const& tmpPart:daughters){
1295  MELAout << "Dau " << idau << " "
1296  << "id=" << tmpPart.first << " "
1297  << "x=" << tmpPart.second.X() << " "
1298  << "y=" << tmpPart.second.Y() << " "
1299  << "z=" << tmpPart.second.Z() << " "
1300  << "t=" << tmpPart.second.T() << endl;
1301  idau++;
1302  }
1303  }
1304  vector<MELAParticle*> partList_tmp;
1305  vector<MELACandidate*> candList_tmp;
1307  &daughters,
1308  0,
1309  0,
1310  false,
1311  &partList_tmp,
1312  &candList_tmp
1313  );
1314  if (myVerbosity_>=TVar::ERROR && !cand_tmp) MELAerr << "Mela::computeP: Failed to construct temporary candidate!" << endl;
1315  setCurrentCandidate(cand_tmp);
1316  if (myVerbosity_>=TVar::DEBUG && cand_tmp){ MELAout << "Mela::computeP: ZZINDEPENDENT calculation produces candidate:" << endl; TUtil::PrintCandidateSummary(cand_tmp); }
1317  // calculate the ME
1318  ZZME->computeXS(temp_prob);
1319  // Delete the temporary particles
1320  for (MELACandidate* tmpPart:candList_tmp) delete tmpPart; // Only one candidate should really be here
1321  for (MELAParticle* tmpPart:partList_tmp) delete tmpPart;
1323  prob += temp_prob;
1324  }
1325  }
1326  prob = prob / float((gridsize_hs + 1) * (gridsize_phi1 +1));
1327  }
1328  }
1329 
1330  if (useConstant) computeConstant(prob);
1331  }
1332 
1334  reset_CandRef();
1335  if (myVerbosity_>=TVar::DEBUG) MELAout << "Mela: End computeP" << endl;
1336 }
1337 
1338 
1340  TVar::MatrixElement myME,
1341  TVar::Process myType,
1342  float& prob
1343  ){
1344  if (myVerbosity_>=TVar::DEBUG) MELAout << "Mela: Begin computeD_CP" << endl;
1345  double coupl_mix[nSupportedHiggses][SIZE_HVV][2] ={ { { 0 } } };
1346  double coupl_1[nSupportedHiggses][SIZE_HVV][2] ={ { { 0 } } };
1347  double coupl_2[nSupportedHiggses][SIZE_HVV][2] ={ { { 0 } } };
1348 
1349  switch (myType){
1350  case TVar::D_g1g4:
1351  coupl_mix[0][0][0] =1.;
1352  coupl_mix[0][3][0] =2.521;
1353  coupl_1[0][0][0] =1.;
1354  coupl_2[0][3][0] =2.521;
1355  break;
1356  case TVar::D_g1g4_pi_2:
1357  coupl_mix[0][0][0] =1.;
1358  coupl_mix[0][3][1] =2.521;
1359  coupl_1[0][0][0] =1.;
1360  coupl_2[0][3][1] =2.521;
1361  break;
1362  case TVar::D_g1g2:
1363  coupl_mix[0][0][0] =1.;
1364  coupl_mix[0][1][0] = 1.638;
1365  coupl_1[0][0][0] =1.;
1366  coupl_2[0][1][0] = 1.638;
1367  break;
1368  case TVar::D_g1g2_pi_2:
1369  coupl_mix[0][0][0] =1.;
1370  coupl_mix[0][1][1] = 1.638;
1371  coupl_1[0][0][0] =1.;
1372  coupl_2[0][1][1] = 1.638;
1373  break;
1374  case TVar::D_g1g1prime2:
1375  coupl_mix[0][0][0] =1.;
1376  coupl_mix[0][11][0] = 12046.01;
1377  coupl_1[0][0][0] =1.;
1378  coupl_2[0][11][0] = 12046.01;
1379  break;
1380  case TVar::D_zzzg:
1381  coupl_mix[0][0][0] =1.;
1382  coupl_mix[0][4][0] = 0.0688;
1383  coupl_1[0][0][0] =1.;
1384  coupl_2[0][4][0] = 0.0688;
1385  break;
1386  case TVar::D_zzgg:
1387  coupl_mix[0][0][0] =1.;
1388  coupl_mix[0][7][0] = -0.0898;
1389  coupl_1[0][0][0] =1.;
1390  coupl_2[0][7][0] = -0.0898;
1391  break;
1392  case TVar::D_zzzg_PS:
1393  coupl_mix[0][0][0] =1.;
1394  coupl_mix[0][6][0] = 0.0855;
1395  coupl_1[0][0][0] =1.;
1396  coupl_2[0][6][0] = 0.0855;
1397  break;
1398  case TVar::D_zzgg_PS:
1399  coupl_mix[0][0][0] =1.;
1400  coupl_mix[0][9][0] = -0.0907;
1401  coupl_1[0][0][0] =1.;
1402  coupl_2[0][9][0] = -0.0907;
1403  break;
1404  case TVar::D_zzzg_g1prime2:
1405  coupl_mix[0][0][0] =1.;
1406  coupl_mix[0][30][0] = -7591.914;
1407  coupl_1[0][0][0] =1.;
1408  coupl_2[0][30][0] = -7591.914;
1409  break;
1411  coupl_mix[0][0][0] =1.;
1412  coupl_mix[0][30][1] = -7591.914;
1413  coupl_1[0][0][0] =1.;
1414  coupl_2[0][30][1] = -7591.914;
1415  break;
1416  default:
1417  MELAout <<"Error: Not supported!"<<endl;
1418  }
1419 
1420  float pMix, p1, p2;
1422  computeP_selfDspin0(coupl_mix, pMix, true);
1423  computeP_selfDspin0(coupl_1, p1, true);
1424  computeP_selfDspin0(coupl_2, p2, true);
1425  prob = pMix- p1- p2;
1426  if (myVerbosity_>=TVar::DEBUG) MELAout << "Mela: End computeD_CP" << endl;
1427 }
1428 
1429 
1431  double selfDHvvcoupl_input[nSupportedHiggses][SIZE_HVV][2],
1432  double selfDHwwcoupl_input[nSupportedHiggses][SIZE_HVV][2],
1433  double selfDaTQGCcoupl_input[SIZE_ATQGC][2],
1434  double selfDAZffcoupl_input[SIZE_AZff][2],
1435  float& prob,
1436  bool useConstant
1437  ){
1438  for (int jh=0; jh<(int)nSupportedHiggses; jh++){
1439  for (int im=0; im<2; im++){
1440  for (int ic=0; ic<SIZE_HVV; ic++){
1441  selfDHzzcoupl[jh][ic][im] = selfDHvvcoupl_input[jh][ic][im];
1442  selfDHwwcoupl[jh][ic][im] = selfDHwwcoupl_input[jh][ic][im]; // Just for extra protection since differentiate_HWW_HZZ is set to false.
1443  }
1444  }
1445  }
1446  for (int im=0; im<2; im++){
1447  for (int ic=0; ic<SIZE_ATQGC; ic++) selfDaTQGCcoupl[ic][im] = selfDaTQGCcoupl_input[ic][im];
1448  }
1449  for (int im=0; im<2; im++){
1450  for (int ic=0; ic<SIZE_AZff; ic++) selfDAZffcoupl[ic][im] = selfDAZffcoupl_input[ic][im];
1451  }
1453  prob,
1454  useConstant
1455  );
1456 }
1458  float& prob,
1459  bool useConstant
1460  ){
1461  if (myVerbosity_>=TVar::DEBUG) MELAout << "Mela: Begin computeProdDecP" << endl;
1462  reset_PAux();
1464 
1465  bool hasFailed = false;
1466  if (myME_ != TVar::MCFM){
1467  MELAout << "Mela::computeProdDecP ME is not supported for ME " << myME_ << endl;
1468  hasFailed = true;
1469  }
1470  if (
1471  !(
1481  )
1482  ){
1483  MELAout << "Mela::computeProdDecP production mode is not supported for production " << myProduction_ << endl;
1484  hasFailed = true;
1485  }
1486  if (!melaCand) hasFailed=true;
1487  if (hasFailed) prob=0;
1488  else{
1491  ZZME->computeProdXS_VVHVV(prob);
1492  if (useConstant) computeConstant(prob);
1493  }
1494 
1496  reset_CandRef();
1497  if (myVerbosity_>=TVar::DEBUG) MELAout << "Mela: End computeProdDecP" << endl;
1498 }
1499 
1500 
1502  double selfDHggcoupl_input[SIZE_HGG][2],
1503  double selfDHvvcoupl_input[nSupportedHiggses][SIZE_HVV][2],
1504  double selfDHwwcoupl_input[nSupportedHiggses][SIZE_HVV][2],
1505  float& prob,
1506  bool useConstant
1507  ){
1508  for (int im=0; im<2; im++){ for (int ic=0; ic<SIZE_HGG; ic++) selfDHggcoupl[0][ic][im] = selfDHggcoupl_input[ic][im]; }
1509  for (int jh=0; jh<(int)nSupportedHiggses; jh++){
1510  for (int im=0; im<2; im++){
1511  for (int ic=0; ic<SIZE_HVV; ic++){
1512  selfDHzzcoupl[jh][ic][im] = selfDHvvcoupl_input[jh][ic][im];
1513  selfDHwwcoupl[jh][ic][im] = selfDHwwcoupl_input[jh][ic][im]; // Just for extra protection since differentiate_HWW_HZZ is set to false.
1514  }
1515  }
1516  }
1517  computeProdP(
1518  prob,
1519  useConstant
1520  );
1521 }
1523  float& prob,
1524  bool useConstant
1525  ){
1526  if (myVerbosity_>=TVar::DEBUG) MELAout << "Mela: Begin computeProdP" << endl;
1527  if (myProduction_ == TVar::ttH || myProduction_ == TVar::bbH) computeProdP_ttH(prob, 2, 0, useConstant);
1529  else{
1530  reset_PAux();
1531 
1533  if (melaCand){
1534  TLorentzVector nullFourVector(0, 0, 0, 0);
1535  bool isJet2Fake = false;
1536  MELACandidate* candOriginal = melaCand;
1537 
1538  unsigned int firstJetIndex=0;
1539  TLorentzVector jet1, higgs;
1540  TLorentzVector jet1massless(0, 0, 0, 0);
1541  TLorentzVector jet2massless(0, 0, 0, 0);
1542  higgs=melaCand->p4;
1544  int njets=0;
1545  {
1546  int ip=0;
1547  for (MELAParticle* tmpPart:melaCand->getAssociatedJets()){
1548  if (tmpPart->passSelection){
1549  njets++;
1550  if (njets==1){
1551  firstJetIndex = ip;
1552  jet1 = tmpPart->p4;
1553  }
1554  }
1555  ip++;
1556  }
1557  }
1558  if (njets==1){
1559  TUtil::scaleMomentumToEnergy(jet1, jet1massless);
1560  TUtil::computeFakeJet(jet1massless, higgs, jet2massless);
1561  isJet2Fake=true;
1562 
1563  // Scale jet2massless pz if necessary
1564  const double threshold = 1000.*LHCsqrts/2.;
1565  TLorentzVector pTotal = higgs+jet1massless+jet2massless;
1566  double sysZ = pTotal.Z();
1567  if (fabs(sysZ)>threshold){
1568  double maxpz2 = threshold - higgs.Z() - jet1massless.Z();
1569  if (fabs(maxpz2)>0.){
1570  double ratio = jet2massless.Z()/maxpz2;
1571  double absp=sqrt(pow(jet2massless.Pt(), 2)+pow(jet2massless.Z()*ratio, 2));
1572  if (myVerbosity_>=TVar::INFO) MELAout << "Mela::computeProdP, isJet2Fake=true case: Rescaling pz of fake jet by " << ratio << " and energy = " << absp << "." << endl;
1573  jet2massless.SetXYZT(jet2massless.X(), jet2massless.Y(), jet2massless.Z()*ratio, absp);
1574  }
1575  else{
1576  if (myVerbosity_>=TVar::INFO) MELAout << "Mela::computeProdP, isJet2Fake=true case: Unable to rescaling pz of fake jet since max(|pz|)<0. Setting to 0 with appropriate energy = pT = " << jet2massless.Pt() << "." << endl;
1577  jet2massless.SetXYZT(jet2massless.X(), jet2massless.Y(), 0., jet2massless.Pt());
1578  }
1579  }
1580  }
1581  }
1582 
1583  if (isJet2Fake){ // Do the integration
1584  MELACandidate* candCopy = melaCand->shallowCopy();
1585  MELAParticle* firstJet = candCopy->getAssociatedJet(firstJetIndex);
1586  firstJet->p4.SetXYZT(jet1massless.X(), jet1massless.Y(), jet1massless.Z(), jet1massless.T()); // Re-assign momenta of the first jet. Be careful, it changes candOriginal as well!
1587  MELAParticle fakeJet(0, jet2massless); // jet2massless is the unknown jet
1588  candCopy->addAssociatedJet(&fakeJet);
1589  setCurrentCandidate(candCopy);
1590 
1592  ZZME->computeProdXS_JJH(prob); // Higgs + 2 jets: SBF or WBF main probability
1593 
1594  int nGrid=11;
1595  std::vector<double> etaArray;
1596  std::vector<double> pArray;
1597  double eta_max = 10;
1598  if (jet2massless.Pt()>0.) eta_max = max(eta_max, 1.2*fabs(jet2massless.Eta()));
1599  double eta_min = -eta_max;
1600 
1601  for (int iter=0; iter<nGrid; iter++){
1602  float prob_temp=0;
1603 
1604  double jet2temp_eta = ((double)iter)*(eta_max-eta_min) / (((double)nGrid) - 1.) + eta_min;
1605  etaArray.push_back(jet2temp_eta);
1606  double jet2temp_sinh_eta = TMath::SinH(jet2temp_eta);
1607  double jet2temp_pz = jet2massless.Pt()*jet2temp_sinh_eta;
1608  fakeJet.p4.SetZ(jet2temp_pz);
1609  fakeJet.p4.SetX(jet2massless.X()); fakeJet.p4.SetY(jet2massless.Y()); fakeJet.p4.SetT(fakeJet.p4.P());
1610 
1611  // Skip case with invalid pz
1612  const double threshold = 1000.*LHCsqrts/2.;
1613  TLorentzVector pTotal = higgs+jet1massless+fakeJet.p4;
1614  double sys = (pTotal.T()+fabs(pTotal.Z()))/2.;
1615  if (fabs(sys)<threshold){
1617  ZZME->computeProdXS_JJH(prob_temp);
1618  }
1619  pArray.push_back((double)prob_temp);
1620  }
1621 
1622  const double grid_precision = 0.15;
1623  int ctr_iter=0;
1624  for (int iG=0; iG<nGrid-1; iG++){ // For each spacing, first compare the average of end points to spline value
1625  if (pArray[iG]==pArray[iG+1]) continue;
1626  if (etaArray[iG]==etaArray[iG+1]) continue;
1627 
1628  ctr_iter++;
1629 
1630  TGraph interpolator(nGrid, etaArray.data(), pArray.data());
1631  double derivative_first = (pArray[1]-pArray[0])/(etaArray[1]-etaArray[0]);
1632  double derivative_last = (pArray[nGrid-1]-pArray[nGrid-2])/(etaArray[nGrid-1]-etaArray[nGrid-2]);
1633  TSpline3 spline("spline", &interpolator, "b1e1", derivative_first, derivative_last);
1634  double x_middle = (etaArray[iG]+etaArray[iG+1])*0.5;
1635  double y_middle = (pArray[iG]+pArray[iG+1])*0.5;
1636  double y_sp = spline.Eval(x_middle);
1637  if (y_sp<0) y_sp = 0;
1638 
1639  std::vector<double>::iterator gridIt;
1640 
1641  if (fabs(y_sp-y_middle)<grid_precision*fabs(y_middle) || fabs(etaArray[iG+1]-etaArray[iG])<1e-3){
1642  gridIt = pArray.begin()+iG+1;
1643  pArray.insert(gridIt, y_sp);
1644  gridIt = etaArray.begin()+iG+1;
1645  etaArray.insert(gridIt, x_middle);
1646  iG++; // Pass to next bin
1647  }
1648  else{
1649  float prob_temp=0;
1650 
1651  double jet2temp_eta = x_middle;
1652  gridIt = etaArray.begin()+iG+1;
1653  etaArray.insert(gridIt, x_middle);
1654  double jet2temp_sinh_eta = TMath::SinH(jet2temp_eta);
1655  double jet2temp_pz = jet2massless.Pt()*jet2temp_sinh_eta;
1656  fakeJet.p4.SetZ(jet2temp_pz);
1657  fakeJet.p4.SetX(jet2massless.X()); fakeJet.p4.SetY(jet2massless.Y()); fakeJet.p4.SetT(fakeJet.p4.P());
1658 
1659  // Skip case with invalid pz
1660  const double threshold = 1000.*LHCsqrts/2.;
1661  TLorentzVector pTotal = higgs+jet1massless+fakeJet.p4;
1662  double sys = (pTotal.T()+fabs(pTotal.Z()))/2.;
1663  if (fabs(sys)<threshold){
1665  ZZME->computeProdXS_JJH(prob_temp);
1666  }
1667  gridIt = pArray.begin()+iG+1;
1668  pArray.insert(gridIt, (double)prob_temp);
1669  iG--; // Do not pass to next bin, repeat until precision is achieved.
1670  }
1671  nGrid++;
1672  }
1673 
1674  if (myVerbosity_>=TVar::DEBUG) MELAout << "Mela::computeProdP: Number of iterations for JVBF eta integration: " << ctr_iter << endl;
1675 
1676  auxiliaryProb = 0;
1677  int iGFirst=0, iGLast=nGrid-1;
1678  for (int iG=1; iG<nGrid; iG++){
1679  if (pArray[iG]>0 && pArray[iG-1]==0){
1680  iGFirst = iG-1;
1681  break;
1682  }
1683  }
1684  for (int iG=nGrid-2; iG>=0; iG--){
1685  if (pArray[iG]>0 && pArray[iG+1]==0){
1686  iGLast = iG+1;
1687  break;
1688  }
1689  }
1690  double dEtaGrid = etaArray[iGLast] - etaArray[iGFirst];
1691  for (int iG=iGFirst; iG<iGLast-1; iG++){
1692  double dEta = etaArray[iG+1] - etaArray[iG];
1693  double sumProb = pArray[iG]+pArray[iG+1];
1694  sumProb *= 0.5;
1695  dEta = dEta/dEtaGrid;
1696  double addProb = sumProb*dEta;
1697  auxiliaryProb += (float)addProb;
1698  }
1699 
1700  firstJet->p4.SetXYZT(jet1.X(), jet1.Y(), jet1.Z(), jet1.T()); // Re-assign momenta of the first jet to original. Be careful, it changes candOriginal as well!
1701  delete candCopy; // Delete the shallow copy
1702  setCurrentCandidate(candOriginal);
1704  if (myVerbosity_>=TVar::DEBUG){
1705  if (melaCand!=candOriginal) MELAerr << "Mela::computeProdP: melaCand!=candOriginal at the end of the fake jet scenario!" << endl;
1706  }
1707 
1708  if (fabs(prob)>0) auxiliaryProb /= prob;
1709  }
1710  else{
1713  ZZME->computeProdXS_JJH(prob); // Higgs + 2 jets: SBF or WBF
1714  }
1715  else if (myProduction_ == TVar::JQCD){
1716  // No anomalous couplings are implemented in HJ
1717  ZZME->computeProdXS_JH(prob); // Higgs + 1 jet; only SM is supported for now.
1718  }
1719  }
1720  if (useConstant) computeConstant(prob);
1721  }
1722 
1724  reset_CandRef();
1725  }
1726  if (myVerbosity_>=TVar::DEBUG) MELAout << "Mela: End computeProdP" << endl;
1727 }
1728 
1729 
1731  double selfDHvvcoupl_input[nSupportedHiggses][SIZE_HVV][2],
1732  float& prob,
1733  bool includeHiggsDecay,
1734  bool useConstant
1735  ){
1736  // Dedicated function for VH ME
1737  selfDHggcoupl[0][0][0] = 1.0; // Don't set this, and you might get 0 in the future for ggVH.
1738  for (int jh=0; jh<(int)nSupportedHiggses; jh++){
1739  for (int im=0; im<2; im++){
1740  for (int ic=0; ic<SIZE_HVV; ic++){
1741  //remove this line, it's here for counting purposes. Zpffcoupl
1742  selfDHzzcoupl[jh][ic][im] = selfDHvvcoupl_input[jh][ic][im];
1743  selfDHwwcoupl[jh][ic][im] = selfDHvvcoupl_input[jh][ic][im]; // Just for extra protection since differentiate_HWW_HZZ is set to false.
1744  }
1745  }
1746  }
1747 
1749  prob,
1750  includeHiggsDecay,
1751  useConstant
1752  );
1753 }
1755  float& prob,
1756  bool includeHiggsDecay,
1757  bool useConstant
1758  ){
1759  if (myVerbosity_>=TVar::DEBUG) MELAout << "Mela: Begin computeProdP_VH" << endl;
1760  reset_PAux();
1761 
1763  if (melaCand){
1766  ZZME->computeProdXS_VH(prob, includeHiggsDecay); // VH
1767 
1768  if (useConstant) computeConstant(prob);
1769  }
1770  }
1771 
1773  reset_CandRef();
1774  if (myVerbosity_>=TVar::DEBUG) MELAout << "Mela: End computeProdP_VH" << endl;
1775 }
1776 
1777 
1779  float& prob,
1780  int topProcess,
1781  int topDecay,
1782  bool useConstant
1783  ){
1784  if (myVerbosity_>=TVar::DEBUG) MELAout << "Mela: Begin computeProdP_ttH" << endl;
1785  reset_PAux();
1786 
1788  if (melaCand){
1790  ZZME->computeProdXS_ttH(prob,topProcess, topDecay);
1791  if (useConstant) computeConstant(prob);
1792  }
1793 
1795  reset_CandRef();
1796  if (myVerbosity_>=TVar::DEBUG) MELAout << "Mela: End computeProdP_ttH" << endl;
1797 }
1798 
1800  prop=0.;
1802  if (melaCand) ZZME->get_XPropagator(scheme, prop);
1803  reset_CandRef();
1804 }
1805 
1806 
1807 void Mela::compute4FermionWeight(float& w){ // Lepton interference using JHUGen
1808  reset_PAux();
1809 
1811  if (melaCand){
1812  bool hasFailed=false;
1813  int id_original[2][2];
1814  for (int iv=0; iv<2; iv++){
1815  MELAParticle* Vi = melaCand->getSortedV(iv);
1816  int ndau=Vi->getNDaughters();
1817  if (ndau!=2 || !(PDGHelpers::isAZBoson(Vi->id) || PDGHelpers::isAPhoton(Vi->id))){ w=1; hasFailed=true; break; } // Veto WW, ZG, GG
1818  for (int ivd=0; ivd<2; ivd++) id_original[iv][ivd]=Vi->getDaughter(ivd)->id;
1819  }
1820  if (
1821  !PDGHelpers::isALepton(id_original[0][0])
1822  ||
1823  !PDGHelpers::isALepton(id_original[0][1])
1824  ||
1825  !PDGHelpers::isALepton(id_original[1][0])
1826  ||
1827  !PDGHelpers::isALepton(id_original[1][1])
1828  ){
1829  if (myVerbosity_>=TVar::ERROR) MELAerr << "Mela::computeWeight: Function is not implemented for decay states other than 4l/2l2l." << endl;
1830  w=0;
1831  hasFailed=true;
1832  }
1833  /*
1834  if (
1835  (id_original[0][0]==0 && id_original[0][1]==0)
1836  ||
1837  (id_original[1][0]==0 && id_original[1][1]==0)
1838  ){ // Return 1 if any pairs of quarks are unknown
1839  w=1;
1840  hasFailed=true;
1841  }
1842  */
1843 
1844  if (!hasFailed){
1845  float dXsec_HZZ_JHU, dXsec_HZZ_JHU_interf; // temporary prob
1846 
1847  // Calculate dXsec ratio by directly modifying the candidate
1848  computeP(dXsec_HZZ_JHU, false);
1849  for (int ivd=0; ivd<2; ivd++) melaCand->getSortedV(1)->getDaughter(ivd)->id=id_original[0][0]*(1-2*ivd);
1850  computeP(dXsec_HZZ_JHU_interf, false);
1851  for (int ivd=0; ivd<2; ivd++) melaCand->getSortedV(1)->getDaughter(ivd)->id=id_original[1][ivd];
1852 
1853  w = dXsec_HZZ_JHU_interf / dXsec_HZZ_JHU;
1854  // protect against anomalously large weights
1855  if (w>5.) w=25./w;
1856  }
1857  }
1858 
1860  reset_CandRef();
1861 }
1862 
1863 
1864 void Mela::computePM4l(TVar::SuperMelaSyst syst, float& prob){
1865  reset_PAux();
1866  prob=-99;
1867 
1869  if (melaCand){
1870  bool hasFailed=false;
1871  int id_original[2][2];
1872  for (int iv=0; iv<2; iv++){
1873  MELAParticle* Vi = melaCand->getSortedV(iv);
1874  int ndau=Vi->getNDaughters();
1875  if (ndau!=2 || !(PDGHelpers::isAZBoson(Vi->id) || PDGHelpers::isAPhoton(Vi->id))){ hasFailed=true; break; } // Veto WW, ZG, GG
1876  for (int ivd=0; ivd<2; ivd++) id_original[iv][ivd]=Vi->getDaughter(ivd)->id;
1877  }
1878 
1879  if (!hasFailed){
1880  if (abs(id_original[0][0])==11 && abs(id_original[1][0])==11 && abs(id_original[0][1])==11 && abs(id_original[1][1])==11) super->SetDecayChannel("4e");
1881  else if (abs(id_original[0][0])==13 && abs(id_original[1][0])==13 && abs(id_original[0][1])==13 && abs(id_original[1][1])==13) super->SetDecayChannel("4mu");
1882  else if (
1883  (abs(id_original[0][0])==11 && abs(id_original[0][1])==11 && abs(id_original[1][0])==13 && abs(id_original[1][1])==13)
1884  ||
1885  (abs(id_original[0][0])==13 && abs(id_original[0][1])==13 && abs(id_original[1][0])==11 && abs(id_original[1][1])==11)
1886  ) super->SetDecayChannel("2e2mu");
1887  else{ if (myVerbosity_>=TVar::ERROR) MELAerr << "Mela::computePM4l: SuperMELA is currently not implemented for decay states other than 4e. 4mu, 2e2mu." << endl; hasFailed=true; }
1888  }
1889 
1890  if (!hasFailed){
1891  double mZZ = melaCand->m();
1892  // currently only supported signal is ggH(0+), only supported background is summed paramterization
1893  if (syst == TVar::SMSyst_None){
1894  std::pair<double, double> m4lP = super->M4lProb(mZZ);
1895  if (myModel_ == TVar::HSMHiggs) prob = m4lP.first;
1896  else if (myModel_ == TVar::bkgZZ) prob = m4lP.second;
1897  }
1898  else{
1899  //systematics for p(m4l)
1900  float mZZtmp=mZZ;
1901  float meanErr=float(super->GetSigShapeSystematic("meanCB"));
1902  float sigmaErr=float(super->GetSigShapeSystematic("sigmaCB"));
1903  float sigmaCB=float(super->GetSigShapeParameter("sigmaCB"));
1904  if (syst == TVar::SMSyst_ScaleUp) mZZtmp = mZZ*(1.0+meanErr);
1905  else if (syst == TVar::SMSyst_ScaleDown) mZZtmp = mZZ*(1.0-meanErr);
1906  else if (syst == TVar::SMSyst_ResUp || syst == TVar::SMSyst_ResDown) mZZtmp=melaRandomNumber.Gaus(mZZ, sigmaErr*sigmaCB);
1907 
1908  std::pair<double, double> m4lP = super->M4lProb(mZZtmp);
1909  if (myModel_ == TVar::HSMHiggs) prob = m4lP.first;
1910  else if (myModel_ == TVar::bkgZZ) prob = m4lP.second;
1911  }
1912  }
1913  }
1914 
1916  reset_CandRef();
1917 }
1918 
1919 
1921  float bkg_VAMCFM_noscale,
1922  float ggzz_VAMCFM_noscale,
1923  float ggHZZ_prob_pure_noscale,
1924  float ggHZZ_prob_int_noscale,
1925  float widthScale,
1926  float& myDggr
1927  ){
1928  float total_sig_ME = (widthScale * ggHZZ_prob_pure_noscale + sqrt(widthScale) * ggHZZ_prob_int_noscale + ggzz_VAMCFM_noscale);
1929  float total_bkg_ME = bkg_VAMCFM_noscale;
1930  float kd_denominator = (total_sig_ME+total_bkg_ME);
1931  if (kd_denominator>0.) myDggr = total_sig_ME/(total_sig_ME+total_bkg_ME);
1932  else myDggr=-99.;
1933 }
1935  TVar::MatrixElement myME,
1936  TVar::Process myType,
1937  float& prob
1938  ){
1939  prob=-99;
1940  if (myME != TVar::MCFM || myType != TVar::D_gg10){
1941  MELAout << "Only support MCFM and D_gg10"<<endl;
1942  return;
1943  }
1944 
1946  if (melaCand){
1947  float bkg_VAMCFM, ggzz_VAMCFM_noscale, ggHZZ_prob_pure_noscale, ggHZZ_prob_int_noscale, bkgHZZ_prob_noscale;
1948  float ggScale=0;
1949  setProcess(TVar::bkgZZ, myME, TVar::ZZGG); computeP(ggzz_VAMCFM_noscale, false);
1950  setProcess(TVar::HSMHiggs, myME, TVar::ZZGG); computeP(ggHZZ_prob_pure_noscale, false);
1951  setProcess(TVar::bkgZZ_SMHiggs, myME, TVar::ZZGG); computeP(bkgHZZ_prob_noscale, false); setConstant(); getConstant(ggScale);
1952  if (ggScale>0.){
1953  bkgHZZ_prob_noscale /= ggScale;
1954  ggHZZ_prob_pure_noscale /= ggScale;
1955  ggzz_VAMCFM_noscale /= ggScale;
1956  }
1957  ggHZZ_prob_int_noscale = bkgHZZ_prob_noscale - ggHZZ_prob_pure_noscale - ggzz_VAMCFM_noscale;
1958 
1959  setProcess(TVar::bkgZZ, myME, TVar::ZZQQB); computeP(bkg_VAMCFM, true);
1960 
1961  constructDggr(bkg_VAMCFM, ggzz_VAMCFM_noscale, ggHZZ_prob_pure_noscale, ggHZZ_prob_int_noscale, 10., prob); // Use 10 for Dgg10
1962  }
1963 
1965  reset_CandRef();
1966 }
1967 
1968 
1970  //
1971  // Configure the analytical calculations
1972  //
1973  bool noPass=false;
1974  pdf=0;
1975 
1979  else if (
1985  ){
1986  pdf = (RooAbsPdf*)ggSpin0Model->getPDF();
1987  ggSpin0Model->makeParamsConst(false);
1989 
1990  // Add the hypotheses with best-guess coefficients
1991  // ZZ/WW
1992  if (
1999  ) ggSpin0Model->addHypothesis(0, 0);
2003  // ZG/ZGs
2007  // GG/GGs/GsGs
2010  // Self-defined spin-0
2012  for (int im=0; im<2; im++){
2013  ((RooRealVar*)ggSpin0Model->couplings.g1List[0][im])->setVal(selfDHzzcoupl[0][0][im]);
2014  ((RooRealVar*)ggSpin0Model->couplings.g2List[0][im])->setVal(selfDHzzcoupl[0][1][im]);
2015  ((RooRealVar*)ggSpin0Model->couplings.g3List[0][im])->setVal(selfDHzzcoupl[0][2][im]);
2016  ((RooRealVar*)ggSpin0Model->couplings.g4List[0][im])->setVal(selfDHzzcoupl[0][3][im]);
2017 
2018  ((RooRealVar*)ggSpin0Model->couplings.gzgs2List[0][im])->setVal(selfDHzzcoupl[0][4][im]);
2019  ((RooRealVar*)ggSpin0Model->couplings.gzgs3List[0][im])->setVal(selfDHzzcoupl[0][5][im]);
2020  ((RooRealVar*)ggSpin0Model->couplings.gzgs4List[0][im])->setVal(selfDHzzcoupl[0][6][im]);
2021  ((RooRealVar*)ggSpin0Model->couplings.ggsgs2List[0][im])->setVal(selfDHzzcoupl[0][7][im]);
2022  ((RooRealVar*)ggSpin0Model->couplings.ggsgs3List[0][im])->setVal(selfDHzzcoupl[0][8][im]);
2023  ((RooRealVar*)ggSpin0Model->couplings.ggsgs4List[0][im])->setVal(selfDHzzcoupl[0][9][im]);
2024 
2025  ((RooRealVar*)ggSpin0Model->couplings.g1List[1][im])->setVal(selfDHzzcoupl[0][10][im]);
2026  ((RooRealVar*)ggSpin0Model->couplings.g1List[2][im])->setVal(selfDHzzcoupl[0][11][im]);
2027  ((RooRealVar*)ggSpin0Model->couplings.g1List[3][im])->setVal(selfDHzzcoupl[0][12][im]);
2028  ((RooRealVar*)ggSpin0Model->couplings.g1List[4][im])->setVal(selfDHzzcoupl[0][13][im]);
2029  ((RooRealVar*)ggSpin0Model->couplings.g1List[5][im])->setVal(selfDHzzcoupl[0][14][im]);
2030 
2031  ((RooRealVar*)ggSpin0Model->couplings.g2List[1][im])->setVal(selfDHzzcoupl[0][15][im]);
2032  ((RooRealVar*)ggSpin0Model->couplings.g2List[2][im])->setVal(selfDHzzcoupl[0][16][im]);
2033  ((RooRealVar*)ggSpin0Model->couplings.g2List[3][im])->setVal(selfDHzzcoupl[0][17][im]);
2034  ((RooRealVar*)ggSpin0Model->couplings.g2List[4][im])->setVal(selfDHzzcoupl[0][18][im]);
2035  ((RooRealVar*)ggSpin0Model->couplings.g2List[5][im])->setVal(selfDHzzcoupl[0][19][im]);
2036 
2037  ((RooRealVar*)ggSpin0Model->couplings.g3List[1][im])->setVal(selfDHzzcoupl[0][20][im]);
2038  ((RooRealVar*)ggSpin0Model->couplings.g3List[2][im])->setVal(selfDHzzcoupl[0][21][im]);
2039  ((RooRealVar*)ggSpin0Model->couplings.g3List[3][im])->setVal(selfDHzzcoupl[0][22][im]);
2040  ((RooRealVar*)ggSpin0Model->couplings.g3List[4][im])->setVal(selfDHzzcoupl[0][23][im]);
2041  ((RooRealVar*)ggSpin0Model->couplings.g3List[5][im])->setVal(selfDHzzcoupl[0][24][im]);
2042 
2043  ((RooRealVar*)ggSpin0Model->couplings.g4List[1][im])->setVal(selfDHzzcoupl[0][25][im]);
2044  ((RooRealVar*)ggSpin0Model->couplings.g4List[2][im])->setVal(selfDHzzcoupl[0][26][im]);
2045  ((RooRealVar*)ggSpin0Model->couplings.g4List[3][im])->setVal(selfDHzzcoupl[0][27][im]);
2046  ((RooRealVar*)ggSpin0Model->couplings.g4List[4][im])->setVal(selfDHzzcoupl[0][28][im]);
2047  ((RooRealVar*)ggSpin0Model->couplings.g4List[5][im])->setVal(selfDHzzcoupl[0][29][im]);
2048 
2049  ((RooRealVar*)ggSpin0Model->couplings.gzgs1List[0][im])->setVal(selfDHzzcoupl[0][30][im]); // Zgs1_prime2
2050 
2051  ((RooRealVar*)ggSpin0Model->couplings.g1List[6][im])->setVal(selfDHzzcoupl[0][31][im]);
2052  ((RooRealVar*)ggSpin0Model->couplings.g1List[7][im])->setVal(selfDHzzcoupl[0][32][im]);
2053  ((RooRealVar*)ggSpin0Model->couplings.g2List[6][im])->setVal(selfDHzzcoupl[0][33][im]);
2054  ((RooRealVar*)ggSpin0Model->couplings.g2List[7][im])->setVal(selfDHzzcoupl[0][34][im]);
2055  ((RooRealVar*)ggSpin0Model->couplings.g3List[6][im])->setVal(selfDHzzcoupl[0][35][im]);
2056  ((RooRealVar*)ggSpin0Model->couplings.g3List[7][im])->setVal(selfDHzzcoupl[0][36][im]);
2057  ((RooRealVar*)ggSpin0Model->couplings.g4List[6][im])->setVal(selfDHzzcoupl[0][37][im]);
2058  ((RooRealVar*)ggSpin0Model->couplings.g4List[7][im])->setVal(selfDHzzcoupl[0][38][im]);
2059  }
2060  for (int qoqtqz=0; qoqtqz<SIZE_HVV_CQSQ; qoqtqz++){ // 0==q1, 1==q2, 2==q12
2061  ((RooRealVar*)ggSpin0Model->couplings.Lambda_z1qsq[qoqtqz])->setVal(selfDHzzLambda_qsq[0][0][qoqtqz]);
2062  ((RooRealVar*)ggSpin0Model->couplings.Lambda_z2qsq[qoqtqz])->setVal(selfDHzzLambda_qsq[0][1][qoqtqz]);
2063  ((RooRealVar*)ggSpin0Model->couplings.Lambda_z3qsq[qoqtqz])->setVal(selfDHzzLambda_qsq[0][2][qoqtqz]);
2064  ((RooRealVar*)ggSpin0Model->couplings.Lambda_z4qsq[qoqtqz])->setVal(selfDHzzLambda_qsq[0][3][qoqtqz]);
2065  ((RooRealVar*)ggSpin0Model->couplings.cLambda_qsq[qoqtqz])->setVal(selfDHzzCLambda_qsq[0][qoqtqz]);
2066  }
2067  }
2069  }
2070  else if (!spin1Model->configure(myModel_)){
2071  pdf = spin1Model->PDF;
2072  // Self-defined spin-1
2074  for (int i=0; i<SIZE_ZVV; i++){ if (selfDZvvcoupl[i][1]!=0){ if (myVerbosity_>=TVar::ERROR) MELAerr << "Mela::configureAnalyticalPDFs: MELA does not support complex couplings for spin-1 at the moment! " << endl; noPass=true; break; } }
2075  if (!noPass){
2076  spin1Model->g1Val->setVal(selfDZvvcoupl[0][0]);
2077  spin1Model->g2Val->setVal(selfDZvvcoupl[1][0]);
2078  }
2079  }
2080  }
2081  else if (
2083  || myModel_ == TVar::H2_g1g5
2084  || myModel_ == TVar::H2_g2
2085  || myModel_ == TVar::H2_g3
2086  || myModel_ == TVar::H2_g4
2087  || myModel_ == TVar::H2_g5
2088  || myModel_ == TVar::H2_g6
2089  || myModel_ == TVar::H2_g7
2090  || myModel_ == TVar::H2_g8
2091  || myModel_ == TVar::H2_g9
2092  || myModel_ == TVar::H2_g10
2094  ){
2095  pdf = (RooAbsPdf*)spin2Model->getPDF();
2096  spin2Model->makeParamsConst(false);
2098  // Add the hypotheses with best-guess coefficients
2099  // ZZ/WW
2100  if (
2102  || myModel_ == TVar::H2_g1g5
2103  ) spin2Model->addHypothesis(0, 1.);
2104  if (
2106  || myModel_ == TVar::H2_g5
2107  ) spin2Model->addHypothesis(4, 1.);
2108  if (myModel_ == TVar::H2_g2) spin2Model->addHypothesis(1, 1.);
2109  if (myModel_ == TVar::H2_g3) spin2Model->addHypothesis(2, 1.);
2110  if (myModel_ == TVar::H2_g4) spin2Model->addHypothesis(3, 1.);
2111  if (myModel_ == TVar::H2_g5) spin2Model->addHypothesis(4, 1.);
2112  if (myModel_ == TVar::H2_g6) spin2Model->addHypothesis(5, 1.);
2113  if (myModel_ == TVar::H2_g7) spin2Model->addHypothesis(6, 1.);
2114  if (myModel_ == TVar::H2_g8) spin2Model->addHypothesis(7, 1.);
2115  if (myModel_ == TVar::H2_g9) spin2Model->addHypothesis(8, 1.);
2116  if (myModel_ == TVar::H2_g10) spin2Model->addHypothesis(10, 1.);
2117  // Self-defined spin-2
2119  for (int i=0; i<SIZE_GVV; i++){ if (selfDGvvcoupl[i][1]!=0.){ if (myVerbosity_>=TVar::ERROR) MELAerr << "Mela::configureAnalyticalPDFs: MELA does not support complex couplings for spin-2 at the moment! " << endl; noPass=true; break; } }
2120  if (!noPass){
2121  for (int ig=0; ig<SIZE_GVV; ig++){
2122  for (int im=0; im<2; im++) ((RooRealVar*)spin2Model->couplings.bList[ig][im])->setVal(selfDGvvcoupl[ig][im]);
2123  }
2124  }
2125  }
2126  if (!noPass){
2127  if (myProduction_ == TVar::ZZQQB){
2130  }
2131  else{
2133  double c1 = 2*selfDGggcoupl[0][0] + 2.*selfDGggcoupl[1][0];
2134  double c2 = -0.5*selfDGggcoupl[0][0] + selfDGggcoupl[2][0] + 2.*selfDGggcoupl[3][0];
2135  double c5 = 0./*4*selfDGggcoupl[7][0]*/;
2136  Double_t fppReal = 1./sqrt(6.) * (c1/4.*2. + 2.*c2);
2137  Double_t fppImag = 1./sqrt(6.) * c5;
2138  Double_t fmmReal = 1./sqrt(6.) * (c1/4.*2. + 2.*c2);
2139  Double_t fmmImag = 1./sqrt(6.)* c5;
2140  Double_t fmpReal = 1./4.*c1*2.;
2141  Double_t fmpImag = 0;
2142  Double_t fpp = fppImag*fppImag + fppReal*fppReal;
2143  Double_t fmm = fmmImag*fmmImag + fmmReal*fmmReal;
2144  Double_t fmp = fmpImag*fmpImag + fmpReal*fmpReal;
2145  spin2Model->setTensorPolarization(1, 0.); // This is wrong in the strict sense of what "SelfDefine_spin2" is.
2146  spin2Model->setTensorPolarization(2, 2.*fmp/(fmm+fpp+2.*fmp));
2147  }
2148  else{
2151  }
2152  }
2153  spin2Model->makeParamsConst(true);
2154  }
2155  }
2156  else{
2157  MELAout << "Mela::configureAnalyticalPDFs -> ERROR TVar::Process not applicable!!! ME: " << myME_ << ", model: " << myModel_ << endl;
2158  noPass=true;
2159  }
2160 
2161  if (pdf==0) noPass=true;
2162  return (!noPass);
2163 }
2164 
2165 
2166 
2167 // Constants to normalize probabilities
2168 void Mela::getConstant(float& prob){ prob = getIORecord()->getMEConst(); }
2169 void Mela::computeConstant(float& prob){
2170  float pConst=1.;
2171  setConstant();
2172  getConstant(pConst);
2173  prob *= pConst;
2174 }
2176  float constant = 1;
2177  if (!melaCand){ if (myVerbosity_>=TVar::DEBUG) MELAout << "Mela::getConstant: !melaCand" << endl; }
2178  else{
2179  if ( // Undecayed Higgs MEs from JHUGen
2180  myME_ == TVar::JHUGen
2181  &&
2182  (
2184  ||
2186  ||
2188  ||
2190  ||
2192  ||
2194  )
2195  ) constant = getConstant_JHUGenUndecayed();
2196  else if ( // H->4l/2l2l
2198  &&
2200  &&
2202  &&
2204  ) constant = getConstant_4l();
2205  else if ( // H->2l2q
2207  &&
2209  &&
2210  (
2211  (
2213  &&
2215  &&
2217  )
2218  ||
2219  (
2221  &&
2223  &&
2225  )
2226  )
2227  ) constant = getConstant_2l2q();
2228  else if ( // H->4q
2230  &&
2232  &&
2233  (
2234  (
2236  &&
2238  &&
2240  &&
2242  )
2243  )
2244  ) constant = getConstant_4q();
2245  }
2246  if (std::isnan(constant) || std::isinf(constant) || constant<=0.) constant=0;
2247  else constant=1./constant;
2248  if (myVerbosity_>=TVar::DEBUG) MELAout << "Mela::getConstant: Constant is " << constant << endl;
2249  getIORecord()->setMEConst(constant);
2250 }
2252  float constant = 1;
2253  if (!melaCand) return constant;
2254 
2255  MelaPConstant* pchandle=0;
2256  unsigned int iarray=0;
2257  if (TUtil::JetMassScheme == TVar::ConserveDifermionMass) iarray=0; // First element points to the case when the difermion invariant mass is conserved in mass removal scheme
2258  else if (TUtil::JetMassScheme == TVar::MomentumToEnergy) iarray=1; // Second element points to the case when the 3-momentum vector magnitude is scaled to energy in mass removal scheme
2259  if (myProduction_ == TVar::JQCD){
2260  pchandle = pAvgSmooth_JHUGen_JQCD_HSMHiggs[iarray];
2261  }
2262  else if (myProduction_ == TVar::JJQCD){
2263  pchandle = pAvgSmooth_JHUGen_JJQCD_HSMHiggs[iarray];
2264  }
2265  else if (myProduction_ == TVar::JJVBF){
2266  pchandle = pAvgSmooth_JHUGen_JJVBF_HSMHiggs[iarray];
2267  }
2268  else if (myProduction_ == TVar::Had_ZH){
2269  pchandle = pAvgSmooth_JHUGen_Had_ZH_HSMHiggs[iarray];
2270  }
2271  else if (myProduction_ == TVar::Had_WH){
2272  pchandle = pAvgSmooth_JHUGen_Had_WH_HSMHiggs[iarray];
2273  }
2274  /*
2275  else if (myProduction_ == TVar::Lep_ZH)
2276  else if (myProduction_ == TVar::Lep_WH)
2277  else if (myProduction_ == TVar::GammaH)
2278  else if (myProduction_ == TVar::ttH)
2279  else if (myProduction_ == TVar::bbH)
2280  */
2281  else return constant;
2282 
2283  constant = pchandle->Eval(getIORecord(), myVerbosity_);
2284  return constant;
2285 }
2287  float constant = 1;
2288  if (!melaCand) return constant;
2289  int decid = abs(
2290  melaCand->getSortedV(0)->getDaughter(0)->id*
2291  melaCand->getSortedV(0)->getDaughter(1)->id*
2292  melaCand->getSortedV(1)->getDaughter(0)->id*
2294  );
2295  return getConstant_FourFermionDecay(decid);
2296 }
2298  float constant = 1;
2299  if (!melaCand) return constant;
2300  int decid = 1;
2303  decid = abs(decid);
2304  return getConstant_FourFermionDecay(decid);
2305 }
2307  float constant = 1;
2308  if (!melaCand) return constant;
2309  const int decid = 121;
2310  return getConstant_FourFermionDecay(decid);
2311 }
2312 
2313 float Mela::getConstant_FourFermionDecay(const int& decid){
2314  float constant = 1;
2315 
2316  const bool is4mu = (decid==28561);
2317  const bool is4e = (decid==14641 || decid==50625); // Use 4e for 4tau as well (I don't know why you would do this, but anyway)
2318  const bool is2mu2e = (decid==20449 || decid==27225 || decid==38025 || decid==169 || decid==121); // Use 2e2mu for 2e2tau and 2mu2tau as well
2319 
2320  const unsigned int nPossibleHandles=6;
2321  MelaPConstant* pchandle[nPossibleHandles]={ 0 };
2322 
2323  float constant_tmp=0;
2324  if (myME_ == TVar::JHUGen){
2325  if (myProduction_ == TVar::ZZGG){
2326  if (
2328  ||
2330  ||
2332  ||
2334  ||
2336  ||
2338  ||
2340  ||
2342  ||
2344  ||
2346  ){
2347  if (is2mu2e) pchandle[0] = pAvgSmooth_JHUGen_ZZGG_HSMHiggs_2mu2e;
2348  else if (is4mu) pchandle[0] = pAvgSmooth_JHUGen_ZZGG_HSMHiggs_4mu;
2349  else if (is4e) pchandle[0] = pAvgSmooth_JHUGen_ZZGG_HSMHiggs_4e;
2350  }
2351  }
2352  }
2353  else if (myME_ == TVar::MCFM){
2354  // ZZQQB
2355  if (myProduction_ == TVar::ZZQQB){
2356  if (myModel_ == TVar::bkgZZ){
2357  if (is2mu2e) pchandle[0] = pAvgSmooth_MCFM_ZZQQB_bkgZZ_2mu2e;
2358  else if (is4mu) pchandle[0] = pAvgSmooth_MCFM_ZZQQB_bkgZZ_4mu;
2359  else if (is4e) pchandle[0] = pAvgSmooth_MCFM_ZZQQB_bkgZZ_4e;
2360  }
2361  }
2362  // ZZGG
2363  else if (myProduction_ == TVar::ZZGG){
2364  if (myModel_ == TVar::bkgZZ){
2365  if (is2mu2e) pchandle[0] = pAvgSmooth_MCFM_ZZGG_bkgZZ_2mu2e;
2366  else if (is4mu) pchandle[0] = pAvgSmooth_MCFM_ZZGG_bkgZZ_4mu;
2367  else if (is4e) pchandle[0] = pAvgSmooth_MCFM_ZZGG_bkgZZ_4e;
2368  }
2369  else if (myModel_ == TVar::HSMHiggs){
2370  if (is2mu2e) pchandle[0] = pAvgSmooth_MCFM_ZZGG_HSMHiggs_2mu2e;
2371  else if (is4mu) pchandle[0] = pAvgSmooth_MCFM_ZZGG_HSMHiggs_4mu;
2372  else if (is4e) pchandle[0] = pAvgSmooth_MCFM_ZZGG_HSMHiggs_4e;
2373  }
2374  // Sum signal and bkg
2375  else if (myModel_ == TVar::bkgZZ_SMHiggs){
2376  if (is2mu2e){
2377  pchandle[0] = pAvgSmooth_MCFM_ZZGG_bkgZZ_2mu2e;
2379  }
2380  else if (is4mu){
2381  pchandle[0] = pAvgSmooth_MCFM_ZZGG_bkgZZ_4mu;
2382  pchandle[1] = pAvgSmooth_MCFM_ZZGG_HSMHiggs_4mu;
2383  }
2384  else if (is4e){
2385  pchandle[0] = pAvgSmooth_MCFM_ZZGG_bkgZZ_4e;
2386  pchandle[1] = pAvgSmooth_MCFM_ZZGG_HSMHiggs_4e;
2387  }
2388  }
2389  }
2390  // JJEW and components
2391  else if (
2393  ||
2395  ||
2397  ){
2398  MelaPConstant* hvbf=0;
2399  MelaPConstant* hwh=0;
2400  MelaPConstant* hzh=0;
2401  MelaPConstant* hvbs=0;
2402  MelaPConstant* hwzz=0;
2403  MelaPConstant* hzzz=0;
2405  bool hasVBF = isEW || (myProduction_ == TVar::JJVBF || myProduction_ == TVar::JJVBF_S || myProduction_ == TVar::JJVBF_TU);
2408  if (is2mu2e){
2415  }
2416  else if (is4mu){
2423  }
2424  else if (is4e){
2431  }
2433  if (hasVBF) pchandle[0]=hvbf;
2434  if (hasZH) pchandle[1]=hzh;
2435  if (hasWH) pchandle[2]=hwh;
2436  }
2438  if (hasVBF) pchandle[3]=hvbs;
2439  if (hasZH) pchandle[4]=hzzz;
2440  if (hasWH) pchandle[5]=hwzz;
2441  }
2442  }
2443  else if (myProduction_ == TVar::JJQCD){
2444  if (myModel_ == TVar::bkgZJets){
2445  pchandle[0] = pAvgSmooth_MCFM_JJQCD_bkgZJets_2l2q; // Only option at the moment
2446  }
2447  else if (myModel_ == TVar::bkgZZ){
2448  if (is2mu2e){
2449  pchandle[0] = pAvgSmooth_MCFM_JJQCD_bkgZZ_2mu2e;
2450  }
2451  else if (is4mu){
2452  pchandle[0] = pAvgSmooth_MCFM_JJQCD_bkgZZ_4mu;
2453  }
2454  else if (is4e){
2455  pchandle[0] = pAvgSmooth_MCFM_JJQCD_bkgZZ_4e;
2456  }
2457  }
2458  }
2459  }
2460 
2461  bool hasNullHandle=true;
2462  for (unsigned int ihandle=0; ihandle<nPossibleHandles; ihandle++){ if (pchandle[ihandle]!=0){ constant_tmp += pchandle[ihandle]->Eval(getIORecord(), myVerbosity_); hasNullHandle=false; } }
2463  if (hasNullHandle) return constant;
2464 
2465  constant = constant_tmp;
2466  return constant;
2467 }
2468 
2469 
2471  if (myVerbosity_>=TVar::DEBUG) MELAout << "Begin Mela::getPConstantHandles" << endl;
2472 
2473  // Initialize the handles to 0
2474  for (unsigned int isch=0; isch<(unsigned int)(TVar::nFermionMassRemovalSchemes-1); isch++){
2480  }
2481  //
2483  //
2487  //
2491  //
2495  //
2499  //
2503  //
2507  //
2511  //
2515  //
2519  //
2523  //
2527  //
2528 
2529  TString filename, spname;
2530 
2531  // Fill versions with difermion correction, set to ConserveDifermionMass if others don't exist.
2532  filename = "pAvgSmooth_JHUGen_JJQCD_HSMHiggs";
2533  spname = "P_ConserveDifermionMass";
2535  spname = "P_MomentumToEnergy";
2538  //
2539  filename = "pAvgSmooth_JHUGen_JQCD_HSMHiggs";
2540  spname = "P_ConserveDifermionMass";
2542  spname = "P_MomentumToEnergy";
2545  //
2546  filename = "pAvgSmooth_JHUGen_JJVBF_HSMHiggs";
2547  spname = "P_ConserveDifermionMass";
2549  spname = "P_MomentumToEnergy";
2552  //
2553  filename = "pAvgSmooth_JHUGen_Had_ZH_HSMHiggs";
2554  spname = "P_ConserveDifermionMass";
2556  spname = "P_MomentumToEnergy";
2557  //pAvgSmooth_JHUGen_Had_ZH_HSMHiggs[1] = getPConstantHandle(TVar::JHUGen, TVar::Had_ZH, TVar::HSMHiggs, filename, spname, true);
2559  //
2560  filename = "pAvgSmooth_JHUGen_Had_WH_HSMHiggs";
2561  spname = "P_ConserveDifermionMass";
2563  spname = "P_MomentumToEnergy";
2564  //pAvgSmooth_JHUGen_Had_WH_HSMHiggs[1] = getPConstantHandle(TVar::JHUGen, TVar::Had_WH, TVar::HSMHiggs, filename, spname, true);
2566  //
2567  //
2568  filename = "pAvgSmooth_MCFM_JJQCD_bkgZJets_13TeV_2l2q"; // 13 TeV is a placeholder for all energies.
2569  spname = "P_ConserveDifermionMass";
2571  //
2572  //
2573  filename = "pAvgSmooth_JHUGen_ZZGG_HSMHiggs";
2574  spname = "P_ConserveDifermionMass_4mu";
2576  spname = "P_ConserveDifermionMass_4e";
2578  spname = "P_ConserveDifermionMass_2mu2e";
2580  //
2581  filename = "pAvgSmooth_MCFM_ZZGG_HSMHiggs";
2582  spname = "P_ConserveDifermionMass_4mu";
2584  spname = "P_ConserveDifermionMass_4e";
2586  spname = "P_ConserveDifermionMass_2mu2e";
2588  //
2589  filename = "pAvgSmooth_MCFM_JJVBF_S_HSMHiggs";
2590  spname = "P_ConserveDifermionMass_4mu";
2592  spname = "P_ConserveDifermionMass_4e";
2594  spname = "P_ConserveDifermionMass_2mu2e";
2596  //
2597  filename = "pAvgSmooth_MCFM_Had_ZH_S_HSMHiggs";
2598  spname = "P_ConserveDifermionMass_4mu";
2600  spname = "P_ConserveDifermionMass_4e";
2602  spname = "P_ConserveDifermionMass_2mu2e";
2604  //
2605  filename = "pAvgSmooth_MCFM_Had_WH_S_HSMHiggs";
2606  spname = "P_ConserveDifermionMass_4mu";
2608  spname = "P_ConserveDifermionMass_4e";
2610  spname = "P_ConserveDifermionMass_2mu2e";
2612  //
2613  //
2614  filename = "pAvgSmooth_MCFM_ZZGG_bkgZZ";
2615  spname = "P_ConserveDifermionMass_4mu";
2617  spname = "P_ConserveDifermionMass_4e";
2619  spname = "P_ConserveDifermionMass_2mu2e";
2621  //
2622  filename = "pAvgSmooth_MCFM_ZZQQB_bkgZZ";
2623  spname = "P_ConserveDifermionMass_4mu";
2625  spname = "P_ConserveDifermionMass_4e";
2627  spname = "P_ConserveDifermionMass_2mu2e";
2629  //
2630  filename = "pAvgSmooth_MCFM_JJVBF_bkgZZ";
2631  spname = "P_ConserveDifermionMass_4mu";
2633  spname = "P_ConserveDifermionMass_4e";
2635  spname = "P_ConserveDifermionMass_2mu2e";
2637  //
2638  filename = "pAvgSmooth_MCFM_Had_ZH_bkgZZ";
2639  spname = "P_ConserveDifermionMass_4mu";
2641  spname = "P_ConserveDifermionMass_4e";
2643  spname = "P_ConserveDifermionMass_2mu2e";
2645  //
2646  filename = "pAvgSmooth_MCFM_Had_WH_bkgZZ";
2647  spname = "P_ConserveDifermionMass_4mu";
2649  spname = "P_ConserveDifermionMass_4e";
2651  spname = "P_ConserveDifermionMass_2mu2e";
2653  //
2654  filename = "pAvgSmooth_MCFM_JJQCD_bkgZZ";
2655  spname = "P_ConserveDifermionMass_4mu";
2657  spname = "P_ConserveDifermionMass_4e";
2659  spname = "P_ConserveDifermionMass_2mu2e";
2661  //
2662 
2663  if (myVerbosity_>=TVar::DEBUG) MELAout << "End Mela::getPConstantHandles" << endl;
2664 }
2666  TVar::MatrixElement me_,
2667  TVar::Production prod_,
2668  TVar::Process proc_,
2669  TString relpath,
2670  TString spname,
2671  const bool useSqrts
2672  ){
2673  if (myVerbosity_>=TVar::DEBUG) MELAout << "Begin Mela::getPConstantHandle" << endl;
2674 
2675  MelaPConstant* pchandle=0;
2676  string cfile_fullpath;
2677 
2678  // Get data/ path
2679  if (myVerbosity_>=TVar::DEBUG) MELAout << "Mela::getPConstantHandle: relpath and spline name: " << relpath << ", " << spname << endl;
2680  const string MELAPKGPATH = TVar::GetMELAPath();
2681  const string path = MELAPKGPATH + "data/";
2682  if (myVerbosity_>=TVar::DEBUG) MELAout << "Mela::getPConstantHandle: path and spline name: " << path << ", " << spname << endl;
2683 
2684  if (useSqrts){ // Loop over possible sqrts values to get the closest one
2685  const unsigned int npossiblesqrts=3;
2686  const double possible_sqrts[npossiblesqrts]={ 7, 8, 13 };
2687  vector<double> trysqrts;
2688  for (unsigned isq=0; isq<npossiblesqrts; isq++){
2689  double val = possible_sqrts[isq];
2690  double diff = fabs(LHCsqrts-val);
2691  bool inserted=false;
2692  for (std::vector<double>::iterator it = trysqrts.begin(); it<trysqrts.end(); it++){
2693  if (fabs((*it)-LHCsqrts)>diff){
2694  inserted=true;
2695  trysqrts.insert(it, val);
2696  break;
2697  }
2698  }
2699  if (!inserted) trysqrts.push_back(val);
2700  }
2701  for (auto& dsqrts:trysqrts){
2702  TString strsqrts = Form("%s_%.0f%s", relpath.Data(), dsqrts, "TeV");
2703  cfile_fullpath = path;
2704  cfile_fullpath.append(strsqrts.Data());
2705  cfile_fullpath.append(".root");
2706  pchandle = new MelaPConstant(me_, prod_, proc_, cfile_fullpath.c_str(), spname.Data());
2707  if (pchandle->IsValid()){
2708  if (myVerbosity_>=TVar::DEBUG) MELAout << "Mela::getPConstantHandle: Full path and spline name: " << cfile_fullpath << ", " << spname << " is valid." << endl;
2709  break;
2710  }
2711  else{
2712  if (myVerbosity_>=TVar::DEBUG) MELAout << "Mela::getPConstantHandle: Full path and spline name: " << cfile_fullpath << ", " << spname << " is invalid." << endl;
2713  deletePConstantHandle(pchandle);
2714  }
2715  }
2716  }
2717  else{
2718  cfile_fullpath = path;
2719  cfile_fullpath.append(relpath.Data());
2720  cfile_fullpath.append(".root");
2721  pchandle = new MelaPConstant(me_, prod_, proc_, cfile_fullpath.c_str(), spname.Data());
2722  if (!pchandle->IsValid()) deletePConstantHandle(pchandle);
2723  }
2724  if (myVerbosity_>=TVar::DEBUG) MELAout << "Mela::getPConstantHandle: Full path and spline name: " << cfile_fullpath << ", " << spname << endl;
2725  if (myVerbosity_>=TVar::DEBUG && pchandle==0) MELAerr << "Mela::getPConstantHandle: Handle of " << spname << " from " << cfile_fullpath << " is invalid!" << endl;
2726  if (myVerbosity_>=TVar::DEBUG) MELAout << "End Mela::getPConstantHandle" << endl;
2727  return pchandle;
2728 }
2730  for (int isch=(unsigned int)(TVar::nFermionMassRemovalSchemes-2); isch>=0; isch--){
2736  }
2737  //
2739  //
2743  //
2747  //
2751  //
2755  //
2759  //
2763  //
2767  //
2771  //
2775  //
2779  //
2783  //
2784 }
2786  if (myVerbosity_>=TVar::DEBUG) MELAout << "Mela::deletePConstantHandle: Deleting PConstant handle " << handle->GetSplineName() << " at " << handle->GetFileName() << endl;
2787  delete handle; handle=0;
2788  if (myVerbosity_>=TVar::DEBUG) MELAout << "End Mela::deletePConstantHandle." << endl;
2789 }
2790 
2791 
2792 void Mela::computeDijetConvBW(float& prob, bool useTrueBW){
2794  prob = superDijet->GetConvBW(myProduction_, melaCand, useTrueBW);
2795  reset_CandRef();
2796 }
2797 
TVar::kUseAssociated_Photons
@ kUseAssociated_Photons
Definition: TVar.hh:32
TVar::ERROR
@ ERROR
Definition: TVar.hh:49
RooSpin::modelMeasurables::h2
RooAbsReal * h2
Definition: RooSpin.h:52
Mela::pAvgSmooth_MCFM_Had_ZH_S_HSMHiggs_4e
MelaPConstant * pAvgSmooth_MCFM_Had_ZH_S_HSMHiggs_4e
Definition: Mela.h:1054
Mela::pAvgSmooth_MCFM_Had_ZH_bkgZZ_4e
MelaPConstant * pAvgSmooth_MCFM_Had_ZH_bkgZZ_4e
Definition: Mela.h:1074
RooSpinZero::modelCouplings::gzgs4List
RooAbsReal * gzgs4List[1][2]
Definition: RooSpinZero.h:19
ZZMatrixElement::reset_Width
void reset_Width(double inmass, int ipart)
Definition: ZZMatrixElement.cc:198
Mela::getConstant
void getConstant(float &prob)
This function returns a multiplicative constant to the matrix element calculation.
Definition: Mela.cc:2168
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:66
TensorPdfFactory::couplings
RooSpinTwo::modelCouplings couplings
Definition: TensorPdfFactory.h:12
Mela::computeP_selfDspin2
void computeP_selfDspin2(double selfDGggcoupl_input[SIZE_GGG][2], double selfDGqqcoupl_input[SIZE_GQQ][2], double selfDGvvcoupl_input[SIZE_GVV][2], float &prob, bool useConstant=true)
This is a function that calls Mela::computeP with preset quark, gluon, and vector boson couplings for...
Definition: Mela.cc:1146
TVar::JJVBF
@ JJVBF
Definition: TVar.hh:72
PDGHelpers::isALepton
bool isALepton(const int id)
Definition: PDGHelpers.cc:62
TVar::D_zzzg_g1prime2
@ D_zzzg_g1prime2
Definition: TVar.hh:145
Mela::getConstant_FourFermionDecay
float getConstant_FourFermionDecay(const int &decid)
Definition: Mela.cc:2313
Mela::pAvgSmooth_MCFM_ZZQQB_bkgZZ_4mu
MelaPConstant * pAvgSmooth_MCFM_ZZQQB_bkgZZ_4mu
Definition: Mela.h:1065
TVar::Had_ZH_S
@ Had_ZH_S
Definition: TVar.hh:86
TVar::D_g1g4
@ D_g1g4
Definition: TVar.hh:139
RooqqZZ_JHU.h
SpinPdfFactory::setVerbosity
void setVerbosity(TVar::VerbosityLevel verbosity)
Definition: SpinPdfFactory.cc:173
mela.daughters
string daughters
Definition: mela.py:767
MELAParticle::getDaughter
MELAParticle * getDaughter(int index) const
Definition: MELAParticle.cc:68
Mela::setAZffCouplings
void setAZffCouplings()
Definition: Mela.cc:418
MelaIO
Definition: MelaIO.h:8
Mela::pAvgSmooth_JHUGen_JQCD_HSMHiggs
MelaPConstant * pAvgSmooth_JHUGen_JQCD_HSMHiggs[TVar::nFermionMassRemovalSchemes-1]
Definition: Mela.h:1030
TVar::LeptonInterference
LeptonInterference
Definition: TVar.hh:106
SIZE_GVV
@ SIZE_GVV
Definition: raw_couplings.txt:158
Mela::pAvgSmooth_MCFM_JJQCD_bkgZZ_4e
MelaPConstant * pAvgSmooth_MCFM_JJQCD_bkgZZ_4e
Definition: Mela.h:1082
TVar::H0_Zgs_PS
@ H0_Zgs_PS
Definition: TVar.hh:132
Mela::setInputEvent
void setInputEvent(SimpleParticleCollection_t *pDaughters, SimpleParticleCollection_t *pAssociated=0, SimpleParticleCollection_t *pMothers=0, bool isGen=false)
Sets the input event for MELA. MELA cannot run without this.
Definition: Mela.cc:343
RooSpin::kVdecayType_Zll
@ kVdecayType_Zll
Definition: RooSpin.h:31
TensorPdfFactory::resetHypotheses
virtual void resetHypotheses()
Definition: TensorPdfFactory.cc:70
RooSpin::modelMeasurables::Y
RooAbsReal * Y
Definition: RooSpin.h:59
TVar::kUseAssociated_Jets
@ kUseAssociated_Jets
Definition: TVar.hh:33
Mela::selfDGqqcoupl
double selfDGqqcoupl[SIZE_GQQ][2]
Definition: Mela.h:995
Mela::selfDGvpvpcoupl
double selfDGvpvpcoupl[SIZE_GVV][2]
Definition: Mela.h:999
Mela::Y_rrv
RooRealVar * Y_rrv
Definition: Mela.h:943
TVar::VerbosityLevel
VerbosityLevel
Definition: TVar.hh:47
Mela::getPConstantHandles
void getPConstantHandles()
Definition: Mela.cc:2470
RooqqZZ_JHU_ZgammaZZ_fast
Definition: RooqqZZ_JHU_ZgammaZZ_fast.h:18
TensorPdfFactory::setTensorPolarization
virtual void setTensorPolarization(int ig, double initval)
Definition: TensorPdfFactory.cc:63
Mela::build
void build(double mh_)
This is the actual building of the tool that occurs in each instance of the Mela::Mela constructor.
Definition: Mela.cc:175
MELACandidate::addAssociatedJet
void addAssociatedJet(MELAParticle *myParticle)
Definition: MELACandidate.cc:616
ZZMatrixElement::get_XPropagator
void get_XPropagator(TVar::ResonancePropagatorScheme scheme, float &prop)
Definition: ZZMatrixElement.cc:459
Mela::resetMCFM_EWKParameters
void resetMCFM_EWKParameters(double ext_Gf, double ext_aemmz, double ext_mW, double ext_mZ, double ext_xW, int ext_ewscheme=3)
Resets the electroweak parameters back to their defaults.
Definition: Mela.cc:511
Mela::getPrimaryWidth
double getPrimaryWidth(int ipart)
A function to get the current primary EW/QCD parameters from MELA.
Definition: Mela.cc:516
Mela::getNCandidates
int getNCandidates()
Returns the size of the candidate list TEvtProb::candList.
Definition: Mela.cc:548
SIZE_HVV_CQSQ
@ SIZE_HVV_CQSQ
Definition: raw_couplings.txt:74
Mela::computeDecayAngles
void computeDecayAngles(float &qH, float &m1, float &m2, float &costheta1, float &costheta2, float &Phi, float &costhetastar, float &Phi1)
computes the decay angles for gg -> H -> ZZ as defined in Figure 1 of arXiv:1001.3396
Definition: Mela.cc:558
TVar::JJEWQCD
@ JJEWQCD
Definition: TVar.hh:74
Mela::selfDM_Zprime
double selfDM_Zprime
Definition: Mela.h:987
Mela::getPConstantHandle
MelaPConstant * getPConstantHandle(TVar::MatrixElement me_, TVar::Production prod_, TVar::Process proc_, TString relpath, TString spname, const bool useSqrts=false)
Definition: Mela.cc:2665
TVar::H0minus
@ H0minus
Definition: TVar.hh:129
Mela::computeProdP_VH
void computeProdP_VH(double selfDHvvcoupl_input[nSupportedHiggses][SIZE_HVV][2], float &prob, bool includeHiggsDecay=false, bool useConstant=true)
Definition: Mela.cc:1730
ZZMatrixElement::set_mHiggs_wHiggs
void set_mHiggs_wHiggs(double mh_, double gah_, int index)
Definition: ZZMatrixElement.cc:188
TensorPdfFactory::addHypothesis
virtual void addHypothesis(int ig, double initval, double iphase=0)
Definition: TensorPdfFactory.cc:56
Mela::pAvgSmooth_MCFM_Had_ZH_bkgZZ_2mu2e
MelaPConstant * pAvgSmooth_MCFM_Had_ZH_bkgZZ_2mu2e
Definition: Mela.h:1075
TVar::CandidateDecay_ZZ
@ CandidateDecay_ZZ
Definition: TVar.hh:41
Mela::compute4FermionWeight
void compute4FermionWeight(float &w)
Definition: Mela.cc:1807
MELAParticle::getNDaughters
int getNDaughters() const
Definition: MELAParticle.h:50
RooSpin::modelMeasurables::Phi1
RooAbsReal * Phi1
Definition: RooSpin.h:55
Mela::pAvgSmooth_MCFM_ZZGG_HSMHiggs_4e
MelaPConstant * pAvgSmooth_MCFM_ZZGG_HSMHiggs_4e
Definition: Mela.h:1046
TVar::bkgGammaGamma
@ bkgGammaGamma
Definition: TVar.hh:163
ZZMatrixElement::get_TopCandidateCollection
std::vector< MELATopCandidate_t * > * get_TopCandidateCollection()
Definition: ZZMatrixElement.cc:235
Mela::selfDHwwCLambda_qsq
int selfDHwwCLambda_qsq[nSupportedHiggses][SIZE_HVV_CQSQ]
Definition: Mela.h:979
ZZMatrixElement::reset_Mass
void reset_Mass(double inmass, int ipart)
Definition: ZZMatrixElement.cc:197
Mela::pAvgSmooth_MCFM_JJVBF_S_HSMHiggs_4mu
MelaPConstant * pAvgSmooth_MCFM_JJVBF_S_HSMHiggs_4mu
Definition: Mela.h:1049
TVar::nFermionMassRemovalSchemes
@ nFermionMassRemovalSchemes
Definition: TVar.hh:115
Mela::auxiliaryProb
float auxiliaryProb
Definition: Mela.h:1023
TVar::INFO
@ INFO
Definition: TVar.hh:50
TVar::Lep_WH_S
@ Lep_WH_S
Definition: TVar.hh:89
SIZE_GGG
@ SIZE_GGG
Definition: raw_couplings.txt:131
Mela::getIORecord
MelaIO * getIORecord()
Returns the MELAIO object, and by consequence, the entire parton-by-parton matrix element record.
Definition: Mela.cc:544
Mela::pAvgSmooth_MCFM_Had_WH_bkgZZ_4mu
MelaPConstant * pAvgSmooth_MCFM_Had_WH_bkgZZ_4mu
Definition: Mela.h:1077
SuperDijetMela
Definition: SuperDijetMela.h:8
ScalarPdfFactory_HVV
Definition: ScalarPdfFactory_HVV.h:8
Mela::pAvgSmooth_MCFM_Had_WH_S_HSMHiggs_2mu2e
MelaPConstant * pAvgSmooth_MCFM_Had_WH_S_HSMHiggs_2mu2e
Definition: Mela.h:1059
TVar::kUseAssociated_UnstableTops
@ kUseAssociated_UnstableTops
Definition: TVar.hh:34
Mela::setCurrentCandidateFromIndex
void setCurrentCandidateFromIndex(unsigned int icand)
Switches the candidate that you are working on to another candidate based off of an index.
Definition: Mela.cc:341
MELACandidate::getSortedV
MELAParticle * getSortedV(int index) const
Definition: MELACandidate.cc:152
SuperMELA
Definition: SuperMELA.h:17
TVar::ProductionName
TString ProductionName(TVar::Production temp)
Definition: TVar.cc:64
Mela::pAvgSmooth_MCFM_ZZGG_bkgZZ_4mu
MelaPConstant * pAvgSmooth_MCFM_ZZGG_bkgZZ_4mu
Definition: Mela.h:1061
Mela::z1mass_rrv
RooRealVar * z1mass_rrv
Definition: Mela.h:936
Mela::selfDHttcoupl
double selfDHttcoupl[nSupportedHiggses][SIZE_HQQ][2]
Definition: Mela.h:971
Mela::pAvgSmooth_MCFM_JJQCD_bkgZZ_2mu2e
MelaPConstant * pAvgSmooth_MCFM_JJQCD_bkgZZ_2mu2e
Definition: Mela.h:1083
Mela::setRemoveLeptonMasses
void setRemoveLeptonMasses(bool MasslessLeptonSwitch=true)
either permits or forbids massive leptons.
Definition: Mela.cc:519
Mela::getPAux
void getPAux(float &prob)
Definition: Mela.cc:554
SuperMELA::SetVerbosity
void SetVerbosity(bool verb=true)
Definition: SuperMELA.h:26
Mela::getMeasurablesRRV
RooSpin::modelMeasurables getMeasurablesRRV()
Returns a RooSpin::modelMeasureables object containing many observable quantities.
Definition: Mela.cc:528
TVar::GammaH
@ GammaH
Definition: TVar.hh:102
Mela::setVerbosity
void setVerbosity(TVar::VerbosityLevel verbosity_=TVar::ERROR)
Sets the verbosity for MELA outside of the initial constructor.
Definition: Mela.cc:325
Mela::setCurrentCandidate
void setCurrentCandidate(MELACandidate *cand)
Switches the candidate that you are working on to another candidate object specified.
Definition: Mela.cc:342
RooSpinZero::modelCouplings::g2List
RooAbsReal * g2List[8][2]
Definition: RooSpinZero.h:12
RooSpinZero::modelCouplings::gzgs3List
RooAbsReal * gzgs3List[1][2]
Definition: RooSpinZero.h:18
TVar::CandidateDecayMode
CandidateDecayMode
Definition: TVar.hh:37
Mela::resetWidth
void resetWidth(double inwidth, int ipart)
Resets the width for a particle that is an electroweak parameter according to its id.
Definition: Mela.cc:509
Mela::mzz_rrv
RooRealVar * mzz_rrv
Definition: Mela.h:935
TVar::H2_g10
@ H2_g10
Definition: TVar.hh:161
Mela::setMelaHiggsWidth
void setMelaHiggsWidth(double myHiggsWidth=-1, int index=0)
Sets the width of your chosen Higgs.
Definition: Mela.cc:337
Mela::setSpinZeroCouplings
void setSpinZeroCouplings()
Definition: Mela.cc:366
ZZMatrixElement::computeProdXS_JH
void computeProdXS_JH(float &mevalue)
Definition: ZZMatrixElement.cc:398
Mela::getTopCandidateCollection
std::vector< MELATopCandidate_t * > * getTopCandidateCollection()
Same as getNCandidates but specifically for Top Quark Candidates.
Definition: Mela.cc:549
Mela::computeD_CP
void computeD_CP(TVar::MatrixElement myME, TVar::Process myType, float &prob)
computes the value of D_CP
Definition: Mela.cc:1339
TUtil::computeTTHAngles
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)
Definition: TUtil.cc:989
RooSpin::modelMeasurables::m12
RooAbsReal * m12
Definition: RooSpin.h:58
Mela::pAvgSmooth_MCFM_Had_WH_S_HSMHiggs_4mu
MelaPConstant * pAvgSmooth_MCFM_Had_WH_S_HSMHiggs_4mu
Definition: Mela.h:1057
TVar::SelfDefine_spin2
@ SelfDefine_spin2
Definition: TVar.hh:182
Mela::pAvgSmooth_JHUGen_Had_WH_HSMHiggs
MelaPConstant * pAvgSmooth_JHUGen_Had_WH_HSMHiggs[TVar::nFermionMassRemovalSchemes-1]
Definition: Mela.h:1038
Mela::computeProdP
void computeProdP(double selfDHggcoupl_input[SIZE_HGG][2], double selfDHvvcoupl_input[nSupportedHiggses][SIZE_HVV][2], double selfDHwwcoupl_input[nSupportedHiggses][SIZE_HVV][2], float &prob, bool useConstant=true)
computes Production side probabilities while taking in coupling arrays
Definition: Mela.cc:1501
Mela::pAvgSmooth_MCFM_ZZQQB_bkgZZ_4e
MelaPConstant * pAvgSmooth_MCFM_ZZQQB_bkgZZ_4e
Definition: Mela.h:1066
Mela::selfDHzpzpcoupl
double selfDHzpzpcoupl[SIZE_HVV][2]
Definition: Mela.h:982
SIZE_ZQQ
@ SIZE_ZQQ
Definition: raw_couplings.txt:107
TVar::bkgZJets
@ bkgZJets
Definition: TVar.hh:165
Mela::setRenFacScaleMode
void setRenFacScaleMode(TVar::EventScaleScheme renormalizationSch, TVar::EventScaleScheme factorizationSch, double ren_sf, double fac_sf)
Sets the renormalization and the factorization schemes.
Definition: Mela.cc:521
TUtil::applyLeptonMassCorrection
void applyLeptonMassCorrection(bool flag=true)
Definition: TUtil.cc:35
MelaIO::getMEConst
double getMEConst() const
Definition: MelaIO.h:110
TVar::ZZINDEPENDENT
@ ZZINDEPENDENT
Definition: TVar.hh:64
VectorPdfFactory::g1Val
RooRealVar * g1Val
Definition: VectorPdfFactory.h:24
SuperDijetMela::SetVerbosity
void SetVerbosity(const TVar::VerbosityLevel verbosity_)
Definition: SuperDijetMela.h:23
TVar::Process
Process
Definition: TVar.hh:125
Mela::selfDGa_Zprime
double selfDGa_Zprime
Definition: Mela.h:988
TVar::EventScaleScheme
EventScaleScheme
Definition: TVar.hh:196
TVar::JJQCD
@ JJQCD
Definition: TVar.hh:71
Mela::selfDWpffcoupl
double selfDWpffcoupl[SIZE_Vpff][2]
Definition: Mela.h:986
RooSpin::modelMeasurables::m1
RooAbsReal * m1
Definition: RooSpin.h:56
Mela::getConstant_4l
float getConstant_4l()
Definition: Mela.cc:2286
Mela::reset_SelfDCouplings
void reset_SelfDCouplings()
Definition: Mela.cc:426
Mela::selfDZpffcoupl
double selfDZpffcoupl[SIZE_Vpff][2]
Definition: Mela.h:983
Mela::reset_CandRef
void reset_CandRef()
Definition: Mela.cc:550
Mela::selfDaTQGCcoupl
double selfDaTQGCcoupl[SIZE_ATQGC][2]
Definition: Mela.h:1001
Mela::getConstant_JHUGenUndecayed
float getConstant_JHUGenUndecayed()
Definition: Mela.cc:2251
TVar::ZZQQB
@ ZZQQB
Definition: TVar.hh:62
VectorPdfFactory
Definition: VectorPdfFactory.h:12
ZZMatrixElement::set_Verbosity
void set_Verbosity(TVar::VerbosityLevel verbosity_)
Definition: ZZMatrixElement.cc:134
ZZMatrixElement::set_SpinZeroContact
void set_SpinZeroContact(double selfDHzzpcoupl[SIZE_HVV][2], double selfDHzpzpcoupl[SIZE_HVV][2], double selfDHwwpcoupl[SIZE_HVV][2], double selfDHwpwpcoupl[SIZE_HVV][2])
Definition: ZZMatrixElement.cc:277
Mela::pAvgSmooth_JHUGen_ZZGG_HSMHiggs_2mu2e
MelaPConstant * pAvgSmooth_JHUGen_ZZGG_HSMHiggs_2mu2e
Definition: Mela.h:1043
ZZMatrixElement::set_SpinOneCouplings
void set_SpinOneCouplings(double selfDZqqcoupl[SIZE_ZQQ][2], double selfDZvvcoupl[SIZE_ZVV][2])
Definition: ZZMatrixElement.cc:290
Mela::computeVBFAngles
void computeVBFAngles(float &Q2V1, float &Q2V2, float &costheta1, float &costheta2, float &Phi, float &costhetastar, float &Phi1)
computes the decay angles for Vector Boson Fusion (VBF) -> H -> ZZ as defined in Figure 1 of arXiv:12...
Definition: Mela.cc:620
TUtil::PrintCandidateSummary
void PrintCandidateSummary(MELACandidate *cand)
Definition: TUtil.cc:8590
PDGHelpers::isAZBoson
bool isAZBoson(const int id)
Definition: PDGHelpers.cc:76
TVar::D_g1g4_pi_2
@ D_g1g4_pi_2
Definition: TVar.hh:140
Mela::setProcess
void setProcess(TVar::Process myModel, TVar::MatrixElement myME, TVar::Production myProduction)
Sets the process, matrix element, and production that MELA is to use for this event....
Definition: Mela.cc:310
SuperMELA::init
void init()
Definition: SuperMELA.cc:158
ZZMatrixElement::get_IORecord
MelaIO * get_IORecord()
Definition: ZZMatrixElement.cc:228
ZZMatrixElement::get_HiggsWidthAtPoleMass
double get_HiggsWidthAtPoleMass(double mass)
Definition: ZZMatrixElement.cc:231
TVar::D_zzzg_PS
@ D_zzzg_PS
Definition: TVar.hh:143
modmisc::isnan
logical function isnan(x)
Definition: mod_Misc.F90:380
Mela::Mela
Mela(double LHCsqrts_=13., double mh_=125., TVar::VerbosityLevel verbosity_=TVar::ERROR)
the MELA constructor
Definition: Mela.cc:94
ZZMatrixElement::Calculate4Momentum
std::vector< TLorentzVector > Calculate4Momentum(double Mx, double M1, double M2, double theta, double theta1, double theta2, double Phi1, double Phi)
Definition: ZZMatrixElement.cc:67
TVar::D_zzzg_g1prime2_pi_2
@ D_zzzg_g1prime2_pi_2
Definition: TVar.hh:146
Mela::qqZZmodel
RooqqZZ_JHU_ZgammaZZ_fast * qqZZmodel
Definition: Mela.h:950
Mela::resetQuarkMasses
void resetQuarkMasses()
Resets the masses of each quark to their original values.
Definition: Mela.cc:510
Mela::pAvgSmooth_MCFM_Had_ZH_S_HSMHiggs_4mu
MelaPConstant * pAvgSmooth_MCFM_Had_ZH_S_HSMHiggs_4mu
Definition: Mela.h:1053
Mela::selfDHqqcoupl
double selfDHqqcoupl[nSupportedHiggses][SIZE_HQQ][2]
Definition: Mela.h:969
testME_all.iline
int iline
Definition: testME_all.py:166
Mela::setConstant
void setConstant()
Definition: Mela.cc:2175
Mela::setTempCandidate
void setTempCandidate(SimpleParticleCollection_t *pDaughters, SimpleParticleCollection_t *pAssociated=0, SimpleParticleCollection_t *pMothers=0, bool isGen=false)
Sets a temporary MELA candidate, by setting melaCand in Xcal2 to a temporary candidate without pushin...
Definition: Mela.cc:357
ZZMatrixElement::set_SpinZeroCouplings
void set_SpinZeroCouplings(double selfDHggcoupl[nSupportedHiggses][SIZE_HGG][2], double selfDHg4g4coupl[nSupportedHiggses][SIZE_HGG][2], double selfDHqqcoupl[nSupportedHiggses][SIZE_HQQ][2], double selfDHbbcoupl[nSupportedHiggses][SIZE_HQQ][2], double selfDHttcoupl[nSupportedHiggses][SIZE_HQQ][2], double selfDHb4b4coupl[nSupportedHiggses][SIZE_HQQ][2], double selfDHt4t4coupl[nSupportedHiggses][SIZE_HQQ][2], double selfDHzzcoupl[nSupportedHiggses][SIZE_HVV][2], double selfDHwwcoupl[nSupportedHiggses][SIZE_HVV][2], double selfDHzzLambda_qsq[nSupportedHiggses][SIZE_HVV_LAMBDAQSQ][SIZE_HVV_CQSQ], double selfDHwwLambda_qsq[nSupportedHiggses][SIZE_HVV_LAMBDAQSQ][SIZE_HVV_CQSQ], int selfDHzzCLambda_qsq[nSupportedHiggses][SIZE_HVV_CQSQ], int selfDHwwCLambda_qsq[nSupportedHiggses][SIZE_HVV_CQSQ], bool diffHWW=false)
Definition: ZZMatrixElement.cc:238
TVar::H2_g7
@ H2_g7
Definition: TVar.hh:158
SIZE_ZVV
@ SIZE_ZVV
Definition: raw_couplings.txt:114
mela.mothers
string mothers
Definition: mela.py:777
Mela::deletePConstantHandle
void deletePConstantHandle(MelaPConstant *&handle)
Definition: Mela.cc:2785
Mela::ggSpin0Model
ScalarPdfFactory_HVV * ggSpin0Model
Definition: Mela.h:947
Mela::costheta1_rrv
RooRealVar * costheta1_rrv
Definition: Mela.h:939
Mela::pAvgSmooth_MCFM_ZZGG_bkgZZ_2mu2e
MelaPConstant * pAvgSmooth_MCFM_ZZGG_bkgZZ_2mu2e
Definition: Mela.h:1063
MelaPConstant::IsValid
bool IsValid()
Definition: MelaPConstant.h:43
TVar::SMSyst_ResUp
@ SMSyst_ResUp
Definition: TVar.hh:193
TVar::ZZGG
@ ZZGG
Definition: TVar.hh:61
Mela::deletePConstantHandles
void deletePConstantHandles()
Definition: Mela.cc:2729
ZZMatrixElement::append_TopCandidate
void append_TopCandidate(SimpleParticleCollection_t *TopDaughters)
Definition: ZZMatrixElement.cc:178
Mela::selfDGvvcoupl
double selfDGvvcoupl[SIZE_GVV][2]
Definition: Mela.h:997
TVar::MomentumToEnergy
@ MomentumToEnergy
Definition: TVar.hh:114
MELACandidate::shallowCopy
MELACandidate * shallowCopy()
Definition: MELACandidate.cc:61
PDGHelpers::isAPhoton
bool isAPhoton(const int id)
Definition: PDGHelpers.cc:72
ZZMatrixElement::set_TempCandidate
void set_TempCandidate(SimpleParticleCollection_t *pDaughters, SimpleParticleCollection_t *pAssociated=0, SimpleParticleCollection_t *pMothers=0, bool isGen=false)
Definition: ZZMatrixElement.cc:159
ZZMatrixElement::set_CandidateDecayMode
void set_CandidateDecayMode(TVar::CandidateDecayMode mode)
Definition: ZZMatrixElement.cc:141
ZZMatrixElement::get_PrimaryMass
double get_PrimaryMass(int ipart)
Definition: ZZMatrixElement.cc:229
ZZMatrixElement::set_AZffCouplings
void set_AZffCouplings(double selfDAZffcoupl[SIZE_AZff][2])
Definition: ZZMatrixElement.cc:335
ZZMatrixElement::set_SpinTwoCouplings
void set_SpinTwoCouplings(double selfDGqqcoupl[SIZE_GQQ][2], double selfDGggcoupl[SIZE_GGG][2], double selfDGvvcoupl[SIZE_GVV][2])
Definition: ZZMatrixElement.cc:297
TVar::H0_Zgsg1prime2
@ H0_Zgsg1prime2
Definition: TVar.hh:130
Mela::computeP_selfDspin0
void computeP_selfDspin0(double selfDHvvcoupl_input[nSupportedHiggses][SIZE_HVV][2], float &prob, bool useConstant=true)
This is a function that calls Mela::computeP with preset quark, gluon, and vector boson couplings for...
Definition: Mela.cc:1077
ZZMatrixElement::get_CurrentCandidateIndex
int get_CurrentCandidateIndex()
Definition: ZZMatrixElement.cc:233
ZZMatrixElement::set_Process
void set_Process(TVar::Process process_, TVar::MatrixElement me_, TVar::Production production_)
Definition: ZZMatrixElement.cc:128
ZZMatrixElement::get_CurrentCandidate
MELACandidate * get_CurrentCandidate()
Definition: ZZMatrixElement.cc:232
nSupportedHiggses
@ nSupportedHiggses
Definition: TMCFM.hh:15
MELAStreamHelpers::MELAout
MELAOutputStreamer MELAout
Mela::pAvgSmooth_MCFM_ZZQQB_bkgZZ_2mu2e
MelaPConstant * pAvgSmooth_MCFM_ZZQQB_bkgZZ_2mu2e
Definition: Mela.h:1067
TVar::bkgWW
@ bkgWW
Definition: TVar.hh:167
TVar::D_zzgg
@ D_zzgg
Definition: TVar.hh:142
TVar::kNoAssociated
@ kNoAssociated
Definition: TVar.hh:30
TVar::DefaultLeptonInterf
@ DefaultLeptonInterf
Definition: TVar.hh:107
TVar::D_zzgg_PS
@ D_zzgg_PS
Definition: TVar.hh:144
MELAParticle::m
double m() const
Definition: MELAParticle.h:66
TVar::H2_g5
@ H2_g5
Definition: TVar.hh:155
ZZMatrixElement::set_mHiggs
void set_mHiggs(double mh_, int index)
Definition: ZZMatrixElement.cc:180
Mela::pAvgSmooth_MCFM_Had_WH_bkgZZ_2mu2e
MelaPConstant * pAvgSmooth_MCFM_Had_WH_bkgZZ_2mu2e
Definition: Mela.h:1079
Mela::differentiate_HWW_HZZ
bool differentiate_HWW_HZZ
Definition: Mela.h:980
Mela::melaCand
MELACandidate * melaCand
Definition: Mela.h:1025
ZZMatrixElement::set_VprimeContactCouplings
void set_VprimeContactCouplings(double selfDZpffcoupl[SIZE_Vpff][2], double selfDWpffcoupl[SIZE_Vpff][2], double M_Zprime, double Ga_Zprime, double M_Wprime, double Ga_Wprime)
Definition: ZZMatrixElement.cc:315
SIZE_HQQ
@ SIZE_HQQ
Definition: raw_couplings.txt:5
Mela::getHiggsWidthAtPoleMass
double getHiggsWidthAtPoleMass(double mass)
Returns the width of the Higgs at a given pole mass as a calculation.
Definition: Mela.cc:517
SuperMELA::SetPathToCards
void SetPathToCards(std::string dirToCards)
Definition: SuperMELA.cc:358
ScalarPdfFactory::addHypothesis
virtual void addHypothesis(int ig, int ilam, double iphase=0, double altparam_fracval=0)
Definition: ScalarPdfFactory.cc:736
TVar::H0_g1prime2
@ H0_g1prime2
Definition: TVar.hh:127
TUtil::ConvertVectorFormat
MELACandidate * ConvertVectorFormat(SimpleParticleCollection_t *pDaughters, SimpleParticleCollection_t *pAssociated, SimpleParticleCollection_t *pMothers, bool isGen, std::vector< MELAParticle * > *particleList, std::vector< MELACandidate * > *candList)
Definition: TUtil.cc:8410
Mela::getConstant_2l2q
float getConstant_2l2q()
Definition: Mela.cc:2297
Mela::computeTTHAngles
void computeTTHAngles(int topDecay, float &mT1, float &mW1, float &mT2, float &mW2, float &costheta1, float &costheta2, float &Phi, float &costhetastar, float &Phi1, float &hbb, float &hWW, float &Phibb, float &Phi1bb, float &hWplusf, float &PhiWplusf, float &hWminusf, float &PhiWminusf)
Definition: Mela.cc:895
anonymous_namespace{TCouplingsBase.hh}::SIZE_HGG
@ SIZE_HGG
Definition: TCouplingsBase.hh:40
TVar::kUseAssociated_Leptons
@ kUseAssociated_Leptons
Definition: TVar.hh:31
Mela::getConstant_4q
float getConstant_4q()
Definition: Mela.cc:2306
Mela::pAvgSmooth_JHUGen_ZZGG_HSMHiggs_4e
MelaPConstant * pAvgSmooth_JHUGen_ZZGG_HSMHiggs_4e
Definition: Mela.h:1042
MELAParticle::p4
TLorentzVector p4
Definition: MELAParticle.h:18
Mela::myModel_
TVar::Process myModel_
Definition: Mela.h:1013
TVar::H2_g3
@ H2_g3
Definition: TVar.hh:153
Mela::cleanLinkedFiles
static void cleanLinkedFiles()
Definition: Mela.cc:162
TVar::SMSyst_None
@ SMSyst_None
Definition: TVar.hh:188
Mela::myME_
TVar::MatrixElement myME_
Definition: Mela.h:1014
SuperMELA::M4lProb
std::pair< double, double > M4lProb(double m4l)
Definition: SuperMELA.cc:552
Mela::computeVHAngles
void computeVHAngles(float &mVstar, float &mV, float &costheta1, float &costheta2, float &Phi, float &costhetastar, float &Phi1)
computes the decay angles for Vector Boson Fusion (VBF) -> H -> ZZ as defined in Figure 1 of arXiv:12...
Definition: Mela.cc:786
MelaPConstant::GetSplineName
TString GetSplineName()
Definition: MelaPConstant.h:46
modparameters::c5
complex(8), parameter, public c5
Definition: mod_Parameters.F90:993
testME_all.int
int
Definition: testME_all.py:13
TVar::H0_gsgs_PS
@ H0_gsgs_PS
Definition: TVar.hh:134
TensorPdfFactory_ppHVV
Definition: TensorPdfFactory_ppHVV.h:8
testME_all.ratio
ratio
Definition: testME_all.py:136
MelaPConstant::Eval
double Eval(const MelaIO *RcdME, TVar::VerbosityLevel verbosity) const
Definition: MELAPConstant.cc:59
Mela::getVerbosity
TVar::VerbosityLevel getVerbosity()
Gets the current verbosity level for MELA.
Definition: Mela.cc:333
RooSpinZero::modelCouplings::Lambda_z4qsq
RooAbsReal * Lambda_z4qsq[SIZE_HVV_CQSQ]
Definition: RooSpinZero.h:35
Mela::selfDHg4g4coupl
double selfDHg4g4coupl[nSupportedHiggses][SIZE_HGG][2]
Definition: Mela.h:967
Mela::computeP
void computeP(float &prob, bool useConstant=true)
Computes the probability for the probabilities on the decay side of things using the constituent daug...
Definition: Mela.cc:1183
VectorPdfFactory::configure
int configure(TVar::Process model_)
Definition: VectorPdfFactory.h:70
RooSpinZero::modelCouplings::Lambda_z1qsq
RooAbsReal * Lambda_z1qsq[SIZE_HVV_CQSQ]
Definition: RooSpinZero.h:32
TVar::HSMHiggs
@ HSMHiggs
Definition: TVar.hh:126
TVar::H2_g2
@ H2_g2
Definition: TVar.hh:152
TVar::Lep_WH_TU
@ Lep_WH_TU
Definition: TVar.hh:100
ZZMatrixElement.h
Mela::pAvgSmooth_MCFM_Had_WH_bkgZZ_4e
MelaPConstant * pAvgSmooth_MCFM_Had_WH_bkgZZ_4e
Definition: Mela.h:1078
TVar::bkgZGamma
@ bkgZGamma
Definition: TVar.hh:164
ScalarPdfFactory_HVV::getPDF
RooSpinZero * getPDF()
Definition: ScalarPdfFactory_HVV.h:22
Mela::ZZME
ZZMatrixElement * ZZME
Definition: Mela.h:1019
TVar::GetMELAPath
std::string GetMELAPath()
Definition: TVar.cc:121
TVar::H2_g9
@ H2_g9
Definition: TVar.hh:160
Mela::computePM4l
void computePM4l(TVar::SuperMelaSyst syst, float &prob)
Definition: Mela.cc:1864
ZZMatrixElement::set_InputEvent
void set_InputEvent(SimpleParticleCollection_t *pDaughters, SimpleParticleCollection_t *pAssociated=0, SimpleParticleCollection_t *pMothers=0, bool isGen=false)
Definition: ZZMatrixElement.cc:145
Mela::setCandidateDecayMode
void setCandidateDecayMode(TVar::CandidateDecayMode mode)
Sets the decay mode for your event.
Definition: Mela.cc:340
VectorPdfFactory.h
ZZMatrixElement::set_CurrentCandidateFromIndex
void set_CurrentCandidateFromIndex(unsigned int icand)
Definition: ZZMatrixElement.cc:143
Mela::pAvgSmooth_MCFM_Had_ZH_S_HSMHiggs_2mu2e
MelaPConstant * pAvgSmooth_MCFM_Had_ZH_S_HSMHiggs_2mu2e
Definition: Mela.h:1055
Mela::setMelaHiggsMass
void setMelaHiggsMass(double myHiggsMass, int index=0)
Sets the mass of your chosen Higgs.
Definition: Mela.cc:336
Mela::LHCsqrts
double LHCsqrts
Definition: Mela.h:1012
TVar::H0_gsgs
@ H0_gsgs
Definition: TVar.hh:133
Mela::spin2Model
TensorPdfFactory_ppHVV * spin2Model
Definition: Mela.h:949
Mela::getCurrentCandidateIndex
int getCurrentCandidateIndex()
Returns the index of the current MELA candidate - returns -1 if there is no candidate to be found.
Definition: Mela.cc:547
Mela::pAvgSmooth_JHUGen_ZZGG_HSMHiggs_4mu
MelaPConstant * pAvgSmooth_JHUGen_ZZGG_HSMHiggs_4mu
Definition: Mela.h:1041
ScalarPdfFactory_HVV::makeParamsConst
void makeParamsConst(bool yesNo=true)
Definition: ScalarPdfFactory_HVV.cc:149
Mela::selfDZqqcoupl
double selfDZqqcoupl[SIZE_ZQQ][2]
Definition: Mela.h:992
RooSpinZero::modelCouplings::ggsgs4List
RooAbsReal * ggsgs4List[1][2]
Definition: RooSpinZero.h:22
Mela::selfDHb4b4coupl
double selfDHb4b4coupl[nSupportedHiggses][SIZE_HQQ][2]
Definition: Mela.h:972
Mela::selfDHwpwpcoupl
double selfDHwpwpcoupl[SIZE_HVV][2]
Definition: Mela.h:985
l
double l[nf]
Definition: TMCFM.hh:274
TVar::D_gg10
@ D_gg10
Definition: TVar.hh:177
RooSpin::modelMeasurables::Phi
RooAbsReal * Phi
Definition: RooSpin.h:54
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:873
SuperMELA::GetSigShapeSystematic
double GetSigShapeSystematic(std::string parName)
Definition: SuperMELA.cc:124
Mela::pAvgSmooth_JHUGen_JJQCD_HSMHiggs
MelaPConstant * pAvgSmooth_JHUGen_JJQCD_HSMHiggs[TVar::nFermionMassRemovalSchemes-1]
Definition: Mela.h:1032
ZZMatrixElement::computeProdXS_VH
void computeProdXS_VH(float &mevalue, bool includeHiggsDecay=false)
Definition: ZZMatrixElement.cc:412
TVar::Had_ZH_TU
@ Had_ZH_TU
Definition: TVar.hh:97
RooSpinZero::modelCouplings::gzgs2List
RooAbsReal * gzgs2List[1][2]
Definition: RooSpinZero.h:17
TVar::MCFM
@ MCFM
Definition: TVar.hh:56
Mela::printLogo
void printLogo() const
Definition: Mela.cc:278
TVar::Lep_ZH_S
@ Lep_ZH_S
Definition: TVar.hh:88
TVar::D_g1g2
@ D_g1g2
Definition: TVar.hh:137
Mela::pAvgSmooth_MCFM_JJVBF_S_HSMHiggs_4e
MelaPConstant * pAvgSmooth_MCFM_JJVBF_S_HSMHiggs_4e
Definition: Mela.h:1050
SIZE_Vpff
@ SIZE_Vpff
Definition: raw_couplings.txt:100
Mela::selfDHzzLambda_qsq
double selfDHzzLambda_qsq[nSupportedHiggses][SIZE_HVV_LAMBDAQSQ][SIZE_HVV_CQSQ]
Definition: Mela.h:976
MELAParticle
Definition: MELAParticle.h:13
ZZMatrixElement::computeProdXS_JJH
void computeProdXS_JJH(float &mevalue)
Definition: ZZMatrixElement.cc:384
VectorPdfFactory::PDF
RooSpinOne_7D * PDF
Definition: VectorPdfFactory.h:22
Mela::phi_rrv
RooRealVar * phi_rrv
Definition: Mela.h:941
Mela::getXPropagator
void getXPropagator(TVar::ResonancePropagatorScheme scheme, float &prop)
Definition: Mela.cc:1799
Mela::~Mela
~Mela()
MELA destructor.
Definition: Mela.cc:122
Mela::computeProdDecP
void computeProdDecP(double selfDHvvcoupl_input[nSupportedHiggses][SIZE_HVV][2], double selfDHwwcoupl_input[nSupportedHiggses][SIZE_HVV][2], double selfDaTQGCcoupl_input[SIZE_ATQGC][2], double selfDAZffcoupl_input[SIZE_AZff][2], float &prob, bool useConstant=true)
computes the combined production and decay probability while taking in coupling arrays
Definition: Mela.cc:1430
TVar::JJEW_S
@ JJEW_S
Definition: TVar.hh:84
ScalarPdfFactory::resetHypotheses
virtual void resetHypotheses()
Definition: ScalarPdfFactory.cc:890
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:208
Mela::selfDHwwcoupl
double selfDHwwcoupl[nSupportedHiggses][SIZE_HVV][2]
Definition: Mela.h:975
TVar::SMSyst_ResDown
@ SMSyst_ResDown
Definition: TVar.hh:194
Mela::pAvgSmooth_MCFM_JJVBF_bkgZZ_4mu
MelaPConstant * pAvgSmooth_MCFM_JJVBF_bkgZZ_4mu
Definition: Mela.h:1069
TVar::ConserveDifermionMass
@ ConserveDifermionMass
Definition: TVar.hh:113
ZZMatrixElement::computeProdXS_VVHVV
void computeProdXS_VVHVV(float &mevalue)
Definition: ZZMatrixElement.cc:364
Mela::constructDggr
void constructDggr(float bkg_VAMCFM_noscale, float ggzz_VAMCFM_noscale, float ggHZZ_prob_pure_noscale, float ggHZZ_prob_int_noscale, float widthScale, float &myDggr)
Definition: Mela.cc:1920
Mela::pAvgSmooth_MCFM_ZZGG_bkgZZ_4e
MelaPConstant * pAvgSmooth_MCFM_ZZGG_bkgZZ_4e
Definition: Mela.h:1062
SuperMELA::GetSigShapeParameter
double GetSigShapeParameter(std::string parName)
Definition: SuperMELA.cc:140
Mela::setRemoveJetMasses
void setRemoveJetMasses(bool MasslessLeptonSwitch=true)
either permits or forbids massive jets.
Definition: Mela.cc:520
Mela::superDijet
SuperDijetMela * superDijet
Definition: Mela.h:1020
RooSpin::modelMeasurables::m2
RooAbsReal * m2
Definition: RooSpin.h:57
Mela::selfDGvvpcoupl
double selfDGvvpcoupl[SIZE_GVV][2]
Definition: Mela.h:998
Mela::resetMass
void resetMass(double inmass, int ipart)
Resets the mass for a particle that is an electroweak parameter according to its id.
Definition: Mela.cc:508
ZZMatrixElement::set_RenFacScaleMode
void set_RenFacScaleMode(TVar::EventScaleScheme renormalizationSch, TVar::EventScaleScheme factorizationSch, double ren_sf, double fac_sf)
Definition: ZZMatrixElement.cc:138
Mela::resetInputEvent
void resetInputEvent()
Resets the event in preparation for the next iteration of the event loop.
Definition: Mela.cc:356
TVar::MatrixElement
MatrixElement
Definition: TVar.hh:55
Mela::pdf
RooAbsPdf * pdf
Definition: Mela.h:946
SIZE_ATQGC
@ SIZE_ATQGC
Definition: raw_couplings.txt:176
TensorPdfFactory_ppHVV::getPDF
RooSpinTwo * getPDF()
Definition: TensorPdfFactory_ppHVV.h:15
Mela::selfDAZffcoupl
double selfDAZffcoupl[SIZE_AZff][2]
Definition: Mela.h:1003
Mela::setATQGCCouplings
void setATQGCCouplings()
Definition: Mela.cc:413
TVar::JJVBF_TU
@ JJVBF_TU
Definition: TVar.hh:94
Mela::selfDHzzCLambda_qsq
int selfDHzzCLambda_qsq[nSupportedHiggses][SIZE_HVV_CQSQ]
Definition: Mela.h:978
TVar::H2_g1
@ H2_g1
Definition: TVar.hh:151
Mela::configureAnalyticalPDFs
bool configureAnalyticalPDFs()
Definition: Mela.cc:1969
RooSpin::modelMeasurables::h1
RooAbsReal * h1
Definition: RooSpin.h:51
ZZMatrixElement::get_PrimaryHiggsMass
double get_PrimaryHiggsMass()
Definition: ZZMatrixElement.h:141
Mela::pAvgSmooth_MCFM_JJVBF_bkgZZ_4e
MelaPConstant * pAvgSmooth_MCFM_JJVBF_bkgZZ_4e
Definition: Mela.h:1070
Mela::setSpinOneCouplings
void setSpinOneCouplings()
Definition: Mela.cc:398
Mela::myProduction_
TVar::Production myProduction_
Definition: Mela.h:1015
Mela::setMelaHiggsMassWidth
void setMelaHiggsMassWidth(double myHiggsMass, double myHiggsWidth, int index)
a combination of setMelaHiggsMass and setMelaHiggsWidth.
Definition: Mela.cc:338
TVar::JHUGen
@ JHUGen
Definition: TVar.hh:57
MELACandidate::getAssociatedJet
MELAParticle * getAssociatedJet(int index) const
Definition: MELACandidate.cc:168
SIZE_HVV_LAMBDAQSQ
@ SIZE_HVV_LAMBDAQSQ
Definition: raw_couplings.txt:66
ZZMatrixElement::computeXS
void computeXS(float &mevalue)
Definition: ZZMatrixElement.cc:344
TVar::Had_ZH
@ Had_ZH
Definition: TVar.hh:75
Mela::selfDZvvcoupl
double selfDZvvcoupl[SIZE_ZVV][2]
Definition: Mela.h:993
TVar::H2_g1g5
@ H2_g1g5
Definition: TVar.hh:156
TVar::H2_g8
@ H2_g8
Definition: TVar.hh:159
VectorPdfFactory::g2Val
RooRealVar * g2Val
Definition: VectorPdfFactory.h:25
Mela::pAvgSmooth_JHUGen_JJVBF_HSMHiggs
MelaPConstant * pAvgSmooth_JHUGen_JJVBF_HSMHiggs[TVar::nFermionMassRemovalSchemes-1]
Definition: Mela.h:1034
Mela::computeVBFAngles_ComplexBoost
void computeVBFAngles_ComplexBoost(float &Q2V1, float &Q2V2, float &costheta1_real, float &costheta1_imag, float &costheta2_real, float &costheta2_imag, float &Phi, float &costhetastar, float &Phi1)
Definition: Mela.cc:702
SpinPdfFactory::makeParamsConst
virtual void makeParamsConst(bool yesNo)
Definition: SpinPdfFactory.cc:154
Mela
Definition: Mela.h:48
MELAStreamHelpers::MELAerr
MELAOutputStreamer MELAerr
Mela::selfDM_Wprime
double selfDM_Wprime
Definition: Mela.h:989
TVar::ResonancePropagatorScheme
ResonancePropagatorScheme
Definition: TVar.hh:117
Mela::reset_PAux
void reset_PAux()
Definition: Mela.cc:555
Mela::melaRandomNumber
TRandom3 melaRandomNumber
Definition: Mela.h:934
TVar::Had_WH_S
@ Had_WH_S
Definition: TVar.hh:87
Mela::computeProdP_ttH
void computeProdP_ttH(float &prob, int topProcess=2, int topDecay=0, bool useConstant=true)
Definition: Mela.cc:1778
TVar::JJEW
@ JJEW
Definition: TVar.hh:73
Mela::computeD_gg
void computeD_gg(TVar::MatrixElement myME, TVar::Process myType, float &prob)
Definition: Mela.cc:1934
Mela::computeConstant
void computeConstant(float &prob)
Definition: Mela.cc:2169
TVar::D_g1g1prime2
@ D_g1g1prime2
Definition: TVar.hh:136
Mela::super
SuperMELA * super
Definition: Mela.h:952
Mela::selfDGa_Wprime
double selfDGa_Wprime
Definition: Mela.h:990
MELAOutputStreamer::writeCentered
void writeCentered(const T &val, char fillch=' ', std::streamsize gapsize=0)
Definition: MELAOutputStreamer.h:131
Mela::selfDHt4t4coupl
double selfDHt4t4coupl[nSupportedHiggses][SIZE_HQQ][2]
Definition: Mela.h:973
Mela::selfDHwwLambda_qsq
double selfDHwwLambda_qsq[nSupportedHiggses][SIZE_HVV_LAMBDAQSQ][SIZE_HVV_CQSQ]
Definition: Mela.h:977
TUtilHelpers.hh
TVar::bkgZZ_SMHiggs
@ bkgZZ_SMHiggs
Definition: TVar.hh:170
Mela::setMelaPrimaryHiggsMass
void setMelaPrimaryHiggsMass(double myHiggsMass)
Sets the mass of the "primary" higgs.
Definition: Mela.cc:335
Mela::z2mass_rrv
RooRealVar * z2mass_rrv
Definition: Mela.h:937
Mela::pAvgSmooth_MCFM_ZZGG_HSMHiggs_2mu2e
MelaPConstant * pAvgSmooth_MCFM_ZZGG_HSMHiggs_2mu2e
Definition: Mela.h:1047
TUtil::computeFakeJet
void computeFakeJet(TLorentzVector const &realJet, TLorentzVector const &others, TLorentzVector &fakeJet)
Definition: TUtil.cc:156
TVar::bkgZZ
@ bkgZZ
Definition: TVar.hh:166
MelaIO::setMEConst
void setMEConst(const double &val)
Definition: MelaIO.h:108
SIZE_AZff
@ SIZE_AZff
Definition: raw_couplings.txt:194
TVar::SMSyst_ScaleDown
@ SMSyst_ScaleDown
Definition: TVar.hh:191
Mela::computeDijetConvBW
void computeDijetConvBW(float &prob, bool useTrueBW=false)
Definition: Mela.cc:2792
modparameters::c1
complex(8), parameter, public c1
Definition: mod_Parameters.F90:988
TVar::Had_WH_TU
@ Had_WH_TU
Definition: TVar.hh:98
Mela.h
This is the "MELA" object that interfaces with the Fortran code in both MCFM-JHUGen and pure JHUGen.
Mela::costhetastar_rrv
RooRealVar * costhetastar_rrv
Definition: Mela.h:938
TVar::H0_Zgs
@ H0_Zgs
Definition: TVar.hh:131
Mela::pAvgSmooth_MCFM_JJQCD_bkgZZ_4mu
MelaPConstant * pAvgSmooth_MCFM_JJQCD_bkgZZ_4mu
Definition: Mela.h:1081
MELACandidate::getAssociatedJets
std::vector< MELAParticle * > & getAssociatedJets()
Definition: MELACandidate.cc:182
TVar::SuperMelaSyst
SuperMelaSyst
Definition: TVar.hh:186
TVar::ttH
@ ttH
Definition: TVar.hh:66
Mela::costheta2_rrv
RooRealVar * costheta2_rrv
Definition: Mela.h:940
Mela::selfDHwwpcoupl
double selfDHwwpcoupl[SIZE_HVV][2]
Definition: Mela.h:984
Mela::myVerbosity_
TVar::VerbosityLevel myVerbosity_
Definition: Mela.h:1017
RooSpinZero::modelCouplings::Lambda_z3qsq
RooAbsReal * Lambda_z3qsq[SIZE_HVV_CQSQ]
Definition: RooSpinZero.h:34
TVar::SelfDefine_spin0
@ SelfDefine_spin0
Definition: TVar.hh:180
RooqqZZ_JHU_ZgammaZZ_fast.h
Mela::pAvgSmooth_MCFM_ZZGG_HSMHiggs_4mu
MelaPConstant * pAvgSmooth_MCFM_ZZGG_HSMHiggs_4mu
Definition: Mela.h:1045
RooSpinZero::modelCouplings::gzgs1List
RooAbsReal * gzgs1List[1][2]
Definition: RooSpinZero.h:16
PDGHelpers::isAGluon
bool isAGluon(const int id)
Definition: PDGHelpers.cc:58
ZZMatrixElement
Definition: ZZMatrixElement.h:9
TVar::JQCD
@ JQCD
Definition: TVar.hh:69
RooSpinZero::modelCouplings::g3List
RooAbsReal * g3List[8][2]
Definition: RooSpinZero.h:13
Mela::selfDHzzcoupl
double selfDHzzcoupl[nSupportedHiggses][SIZE_HVV][2]
Definition: Mela.h:974
Mela::calculate4Momentum
std::vector< TLorentzVector > calculate4Momentum(double Mx, double M1, double M2, double theta, double theta1, double theta2, double Phi1, double Phi)
Definition: Mela.cc:524
Mela::computeP_selfDspin1
void computeP_selfDspin1(double selfDZqqcoupl_input[SIZE_ZQQ][2], double selfDZvvcoupl_input[SIZE_ZVV][2], float &prob, bool useConstant=true)
This is a function that calls Mela::computeP with preset quark, gluon, and vector boson couplings for...
Definition: Mela.cc:1112
ZZMatrixElement::set_CurrentCandidate
void set_CurrentCandidate(MELACandidate *cand)
Definition: ZZMatrixElement.cc:144
RooSpinZero::modelCouplings::g1List
RooAbsReal * g1List[8][2]
Definition: RooSpinZero.h:11
TVar::ANALYTICAL
@ ANALYTICAL
Definition: TVar.hh:58
TUtil::JetMassScheme
TVar::FermionMassRemoval JetMassScheme
Definition: TUtil.cc:28
TVar::H2_g6
@ H2_g6
Definition: TVar.hh:157
Mela::pAvgSmooth_MCFM_JJQCD_bkgZJets_2l2q
MelaPConstant * pAvgSmooth_MCFM_JJQCD_bkgZJets_2l2q
Definition: Mela.h:1085
TVar::Lep_ZH
@ Lep_ZH
Definition: TVar.hh:77
MelaPConstant::GetFileName
TString GetFileName()
Definition: MelaPConstant.h:45
TVar::SMSyst_ScaleUp
@ SMSyst_ScaleUp
Definition: TVar.hh:190
ScalarPdfFactory::couplings
RooSpinZero::modelCouplings couplings
Definition: ScalarPdfFactory.h:12
Mela::pAvgSmooth_MCFM_Had_ZH_bkgZZ_4mu
MelaPConstant * pAvgSmooth_MCFM_Had_ZH_bkgZZ_4mu
Definition: Mela.h:1073
Mela::phi1_rrv
RooRealVar * phi1_rrv
Definition: Mela.h:942
RooSpinZero::modelCouplings::ggsgs3List
RooAbsReal * ggsgs3List[1][2]
Definition: RooSpinZero.h:21
Mela::spin1Model
VectorPdfFactory * spin1Model
Definition: Mela.h:948
Mela::selfDHzzpcoupl
double selfDHzzpcoupl[SIZE_HVV][2]
Definition: Mela.h:981
MELACandidate
Definition: MELACandidate.h:7
ZZMatrixElement::set_LeptonInterference
void set_LeptonInterference(TVar::LeptonInterference myLepInterf)
Definition: ZZMatrixElement.cc:135
SIZE_HVV
@ SIZE_HVV
Definition: raw_couplings.txt:57
Mela::pAvgSmooth_MCFM_Had_WH_S_HSMHiggs_4e
MelaPConstant * pAvgSmooth_MCFM_Had_WH_S_HSMHiggs_4e
Definition: Mela.h:1058
TVar::DEBUG
@ DEBUG
Definition: TVar.hh:51
TVar::JJEWQCD_S
@ JJEWQCD_S
Definition: TVar.hh:85
MELAStreamHelpers.hh
ZZMatrixElement::set_aTQGCCouplings
void set_aTQGCCouplings(double selfDaTQGCcoupl[SIZE_ATQGC][2])
Definition: ZZMatrixElement.cc:330
TVar::D_zzzg
@ D_zzzg
Definition: TVar.hh:141
TVar::H2_g4
@ H2_g4
Definition: TVar.hh:154
TVar::JJEWQCD_TU
@ JJEWQCD_TU
Definition: TVar.hh:96
Mela::setSpinTwoCouplings
void setSpinTwoCouplings()
Definition: Mela.cc:401
SimpleParticleCollection_t
std::vector< SimpleParticle_t > SimpleParticleCollection_t
Definition: TVar.hh:25
TVar::D_g1g2_pi_2
@ D_g1g2_pi_2
Definition: TVar.hh:138
MelaPConstant
Definition: MelaPConstant.h:9
Mela::selfDHggcoupl
double selfDHggcoupl[nSupportedHiggses][SIZE_HGG][2]
Definition: Mela.h:965
RooSpinZero::modelCouplings::Lambda_z2qsq
RooAbsReal * Lambda_z2qsq[SIZE_HVV_CQSQ]
Definition: RooSpinZero.h:33
ZZMatrixElement::reset_MCFM_EWKParameters
void reset_MCFM_EWKParameters(double ext_Gf, double ext_aemmz, double ext_mW, double ext_mZ, double ext_xW, int ext_ewscheme=3)
Definition: ZZMatrixElement.cc:200
Mela::setMelaLeptonInterference
void setMelaLeptonInterference(TVar::LeptonInterference myLepInterf=TVar::DefaultLeptonInterf)
Sets the MELA Lepton Interference.
Definition: Mela.cc:339
RooSpinZero::modelCouplings::g4List
RooAbsReal * g4List[8][2]
Definition: RooSpinZero.h:14
ZZMatrixElement::computeProdXS_ttH
void computeProdXS_ttH(float &mevalue, int topProcess, int topDecay=0)
Definition: ZZMatrixElement.cc:435
Mela::pAvgSmooth_MCFM_JJVBF_S_HSMHiggs_2mu2e
MelaPConstant * pAvgSmooth_MCFM_JJVBF_S_HSMHiggs_2mu2e
Definition: Mela.h:1051
ZZMatrixElement::reset_InputEvent
void reset_InputEvent()
Definition: ZZMatrixElement.cc:225
ZZMatrixElement::set_SpinTwoContact
void set_SpinTwoContact(double selfDGvvpcoupl[SIZE_GVV][2], double selfDGvpvpcoupl[SIZE_GVV][2])
Definition: ZZMatrixElement.cc:306
ZZMatrixElement::get_PrimaryWidth
double get_PrimaryWidth(int ipart)
Definition: ZZMatrixElement.cc:230
Mela::appendTopCandidate
void appendTopCandidate(SimpleParticleCollection_t *TopDaughters)
Adds a top quark as a MELA candidate.
Definition: Mela.cc:363
TVar::Had_WH
@ Had_WH
Definition: TVar.hh:76
RooSpin::modelMeasurables
Definition: RooSpin.h:50
TensorPdfFactory.h
RooSpinZero::modelCouplings::cLambda_qsq
RooAbsReal * cLambda_qsq[SIZE_HVV_CQSQ]
Definition: RooSpinZero.h:36
Mela::upFrac_rrv
RooRealVar * upFrac_rrv
Definition: Mela.h:944
SuperMELA::SetDecayChannel
void SetDecayChannel(std::string myChan)
Definition: SuperMELA.cc:113
TVar::JJEW_TU
@ JJEW_TU
Definition: TVar.hh:95
Mela::selfDHbbcoupl
double selfDHbbcoupl[nSupportedHiggses][SIZE_HQQ][2]
Definition: Mela.h:970
MELAParticle::id
int id
Definition: MELAParticle.h:17
Mela::myLepInterf_
TVar::LeptonInterference myLepInterf_
Definition: Mela.h:1016
TVar::Production
Production
Definition: TVar.hh:60
ZZMatrixElement::get_NCandidates
int get_NCandidates()
Definition: ZZMatrixElement.cc:234
TVar::JJVBF_S
@ JJVBF_S
Definition: TVar.hh:83
TVar::Lep_WH
@ Lep_WH
Definition: TVar.hh:78
TUtil::computeVBFAngles
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)
Definition: TUtil.cc:596
TVar::kUseAssociated_StableTops
@ kUseAssociated_StableTops
Definition: TVar.hh:35
TVar::JJQCD_TU
@ JJQCD_TU
Definition: TVar.hh:93
TVar::simple_event_record
Definition: TVar.hh:227
RooSpin::modelMeasurables::hs
RooAbsReal * hs
Definition: RooSpin.h:53
TVar::SelfDefine_spin1
@ SelfDefine_spin1
Definition: TVar.hh:181
TVar::H0hplus
@ H0hplus
Definition: TVar.hh:128
TUtil::GetBoostedParticleVectors
void GetBoostedParticleVectors(MELACandidate *melaCand, TVar::simple_event_record &mela_event, TVar::VerbosityLevel verbosity=TVar::DEBUG)
Definition: TUtil.cc:7947
RooSpinTwo::modelCouplings::bList
RooAbsReal * bList[SIZE_GVV][2]
Definition: RooSpinTwo.h:11
Mela::selfDGggcoupl
double selfDGggcoupl[SIZE_GGG][2]
Definition: Mela.h:996
TVar::bbH
@ bbH
Definition: TVar.hh:67
RooSpinZero::modelCouplings::ggsgs2List
RooAbsReal * ggsgs2List[1][2]
Definition: RooSpinZero.h:20
SuperMELA.h
Mela::pAvgSmooth_MCFM_JJVBF_bkgZZ_2mu2e
MelaPConstant * pAvgSmooth_MCFM_JJVBF_bkgZZ_2mu2e
Definition: Mela.h:1071
TVar::JJQCD_S
@ JJQCD_S
Definition: TVar.hh:82
Mela::getCurrentCandidate
MELACandidate * getCurrentCandidate()
Gets the current MELA top-level (input) candList object.
Definition: Mela.cc:546
SIZE_GQQ
@ SIZE_GQQ
Definition: raw_couplings.txt:121
PDGHelpers::isAJet
bool isAJet(const int id)
Definition: PDGHelpers.cc:18
Mela::getPrimaryMass
double getPrimaryMass(int ipart)
A function to get the current primary EW/QCD parameters from MELA.
Definition: Mela.cc:515
TVar::Lep_ZH_TU
@ Lep_ZH_TU
Definition: TVar.hh:99
TUtil::computeVBFAngles_ComplexBoost
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)
Definition: TUtil.cc:730
modparameters::c2
complex(8), parameter, public c2
Definition: mod_Parameters.F90:989
ZZMatrixElement::set_PrimaryHiggsMass
void set_PrimaryHiggsMass(double mh)
Definition: ZZMatrixElement.cc:142
ZZMatrixElement::set_wHiggs
void set_wHiggs(double gah_, int index)
Definition: ZZMatrixElement.cc:184
SuperDijetMela::GetConvBW
float GetConvBW(TVar::Production prod, MELACandidate *cand, bool useTrueBW)
Definition: SuperDijetMela.cc:64
Mela::pAvgSmooth_JHUGen_Had_ZH_HSMHiggs
MelaPConstant * pAvgSmooth_JHUGen_Had_ZH_HSMHiggs[TVar::nFermionMassRemovalSchemes-1]
Definition: Mela.h:1036
ZZMatrixElement::reset_QuarkMasses
void reset_QuarkMasses()
Definition: ZZMatrixElement.cc:199
TUtil::applyJetMassCorrection
void applyJetMassCorrection(bool flag=true)
Definition: TUtil.cc:36