CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HiggsTemplateCrossSections.h
Go to the documentation of this file.
1 #ifndef SimDataFormats_GeneratorProducts_HiggsTemplateCrossSections_h
2 #define SimDataFormats_GeneratorProducts_HiggsTemplateCrossSections_h
3 
5 #include <vector>
6 
8 namespace HTXS {
9 
11  enum ErrorCode {
12  UNDEFINED=-99,
13  SUCCESS = 0,
22  };
23 
26  UNKNOWN = 0,
27  GGF = 1, VBF = 2, WH = 3, QQ2ZH = 4, GG2ZH = 5,
28  TTH = 6, BBH = 7, TH = 8
29  };
30 
32  enum tH_type { noTH=0, THQB=1, TWH=2 };
33 
37 
39  namespace Stage0 {
41  enum Category {
42  UNKNOWN = 0, GG2H_FWDH = 10, GG2H = 11, VBF_FWDH = 20, VBF = 21, VH2HQQ_FWDH = 22, VH2HQQ = 23,
43  QQ2HLNU_FWDH = 30, QQ2HLNU = 31, QQ2HLL_FWDH = 40, QQ2HLL = 41, GG2HLL_FWDH = 50, GG2HLL = 51,
44  TTH_FWDH = 60, TTH = 61, BBH_FWDH = 70, BBH = 71, TH_FWDH = 80, TH = 81 };
45  }
46 
51  namespace Stage1 {
52  enum Category {
53  UNKNOWN = 0,
54  // Gluon fusion
55  GG2H_FWDH = 100,
57  GG2H_0J = 103,
62  // "VBF"
63  QQ2HQQ_FWDH = 200,
66  // qq -> WH
67  QQ2HLNU_FWDH = 300,
72  // qq -> ZH
73  QQ2HLL_FWDH = 400,
78  // gg -> ZH
79  GG2HLL_FWDH = 500,
83  // ttH
84  TTH_FWDH = 600, TTH = 601,
85  // bbH
86  BBH_FWDH = 700, BBH = 701,
87  // tH
88  TH_FWDH = 800, TH = 801
89  };
90  } // namespace Stage1
91 
92 namespace Stage1_1 {
93  enum Category {
94  UNKNOWN = 0,
95  // Gluon fusion
96  GG2H_FWDH = 100,
110  // "VBF"
111  QQ2HQQ_FWDH = 200,
112  QQ2HQQ_0J = 201,
113  QQ2HQQ_1J = 202,
122  // qq -> WH
129  // qq -> ZH
130  QQ2HLL_FWDH = 400,
136  // gg -> ZH
137  GG2HLL_FWDH = 500,
143  // ttH
144  TTH_FWDH = 600, TTH = 601,
145  // bbH
146  BBH_FWDH = 700, BBH = 701,
147  // tH
148  TH_FWDH = 800, TH = 801
149  };
150  } // namespace Stage1_1
151 
152  namespace Stage1_1_Fine {
153  enum Category {
154  UNKNOWN = 0,
155  // Gluon fusion
156  GG2H_FWDH = 100,
177  // "VBF"
178  QQ2HQQ_FWDH = 200,
179  QQ2HQQ_0J = 201,
180  QQ2HQQ_1J = 202,
203  // qq -> WH
220  // qq -> ZH
221  QQ2HLL_FWDH = 400,
237  // gg -> ZH
238  GG2HLL_FWDH = 500,
254  // ttH
255  TTH_FWDH = 600, TTH = 601,
256  // bbH
257  BBH_FWDH = 700, BBH = 701,
258  // tH
259  TH_FWDH = 800, TH = 801
260  };
261  } // namespace Stage1_1_Fine
262 
267  namespace Stage1_2 {
268  enum Category {
269  UNKNOWN = 0,
270  // Gluon fusion
271  GG2H_FWDH = 100,
288  // "VBF"
289  QQ2HQQ_FWDH = 200,
290  QQ2HQQ_0J = 201,
291  QQ2HQQ_1J = 202,
300  // qq -> WH
307  // qq -> ZH
308  QQ2HLL_FWDH = 400,
314  // gg -> ZH
315  GG2HLL_FWDH = 500,
321  // ttH
322  TTH_FWDH = 600,
328  // bbH
329  BBH_FWDH = 700,
330  BBH = 701,
331  // tH
332  TH_FWDH = 800,
333  TH = 801
334  };
335  } // namespace Stage1_2
336 
337  namespace Stage1_2_Fine {
338  enum Category {
339  UNKNOWN = 0,
340  // Gluon fusion
341  GG2H_FWDH = 100,
369  // "VBF"
370  QQ2HQQ_FWDH = 200,
371  QQ2HQQ_0J = 201,
372  QQ2HQQ_1J = 202,
395  // qq -> WH
412  // qq -> ZH
413  QQ2HLL_FWDH = 400,
429  // gg -> ZH
430  GG2HLL_FWDH = 500,
446  // ttH
447  TTH_FWDH = 600,
454  // bbH
455  BBH_FWDH = 700,
456  BBH = 701,
457  // tH
458  TH_FWDH = 800,
459  TH = 801
460  };
461  } // namespace Stage1_2_Fine
462 
463  //#ifdef ROOT_TLorentzVector
464  //typedef TLorentzVector TLV;
466  typedef std::vector<TLV> TLVs;
467 
468  template <class vec4>
469  TLV MakeTLV(vec4 const p) {
470  return TLV(p.px(), p.py(), p.pz(), p.E());
471  }
472 
473  template <class Vvec4>
474  inline TLVs MakeTLVs(Vvec4 const &rivet_jets) {
475  TLVs jets;
476  for (auto jet : rivet_jets)
477  jets.push_back(MakeTLV(jet));
478  return jets;
479  }
480 
481  // Structure holding information about the current event:
482  // Four-momenta and event classification according to the
483  // Higgs Template Cross Section
485  // Higgs production mode
487  // The Higgs boson
488  TLV higgs;
489  // The Higgs boson decay products
491  // Associated vector bosons
492  TLV V;
493  // The V-boson decay products
495  // Jets are built ignoring Higgs decay products and leptons from V decays
496  // jets with pT > 25 GeV and 30 GeV
497  TLVs jets25, jets30;
498  // Event categorization according to YR4 wrtietup
499  // https://cds.cern.ch/record/2138079
511  // Flag for Z->vv decay mode (needed to split QQ2ZH and GG2ZH)
513  // Error code :: classification was succesful or some error occured
515  };
516 
517  template <class category>
518  inline HTXS::HiggsClassification Rivet2Root(category const &htxs_cat_rivet) {
520  cat.prodMode = htxs_cat_rivet.prodMode;
521  cat.errorCode = htxs_cat_rivet.errorCode;
522  cat.higgs = MakeTLV(htxs_cat_rivet.higgs);
523  cat.V = MakeTLV(htxs_cat_rivet.V);
524  cat.p4decay_higgs = MakeTLV(htxs_cat_rivet.p4decay_higgs);
525  cat.p4decay_V = MakeTLV(htxs_cat_rivet.p4decay_V);
526  cat.jets25 = MakeTLVs(htxs_cat_rivet.jets25);
527  cat.jets30 = MakeTLVs(htxs_cat_rivet.jets30);
528  cat.stage0_cat = htxs_cat_rivet.stage0_cat;
529  cat.stage1_cat_pTjet25GeV = htxs_cat_rivet.stage1_cat_pTjet25GeV;
530  cat.stage1_cat_pTjet30GeV = htxs_cat_rivet.stage1_cat_pTjet30GeV;
531  cat.stage1_1_cat_pTjet25GeV = htxs_cat_rivet.stage1_1_cat_pTjet25GeV;
532  cat.stage1_1_cat_pTjet30GeV = htxs_cat_rivet.stage1_1_cat_pTjet30GeV;
533  cat.stage1_1_fine_cat_pTjet25GeV = htxs_cat_rivet.stage1_1_fine_cat_pTjet25GeV;
534  cat.stage1_1_fine_cat_pTjet30GeV = htxs_cat_rivet.stage1_1_fine_cat_pTjet30GeV;
535  cat.stage1_2_cat_pTjet25GeV = htxs_cat_rivet.stage1_2_cat_pTjet25GeV;
536  cat.stage1_2_cat_pTjet30GeV = htxs_cat_rivet.stage1_2_cat_pTjet30GeV;
537  cat.stage1_2_fine_cat_pTjet25GeV = htxs_cat_rivet.stage1_2_fine_cat_pTjet25GeV;
538  cat.stage1_2_fine_cat_pTjet30GeV = htxs_cat_rivet.stage1_2_fine_cat_pTjet30GeV;
539  cat.isZ2vvDecay = htxs_cat_rivet.isZ2vvDecay;
540  return cat;
541  }
542 
544  HiggsProdMode prodMode, tH_type tH) {
545  if(stage1==HTXS::Stage1::Category::UNKNOWN) return 0;
546  int P = (int)(stage1 / 100);
547  int F = (int)(stage1 % 100);
548  // 1.a spit tH categories
549  if (prodMode==HiggsProdMode::TH) {
550  // check that tH splitting is valid for Stage-1 FineIndex
551  // else return unknown category
552  if(tH==tH_type::noTH) return 0;
553  // check if forward tH
554  int fwdH = F==0?0:1;
555  return (49 + 2*(tH-1) +fwdH);
556  }
557  // 1.b QQ2HQQ --> split into VBF, WH, ZH -> HQQ
558  // offset vector 1: input is the Higgs prodMode
559  // first two indicies are dummies, given that this is only called for prodMode=2,3,4
560  std::vector<int> pMode_offset = {0,0,13,19,25};
561  if (P==2) return (F + pMode_offset[prodMode]);
562  // 1.c remaining categories
563  // offset vector 2: input is the Stage-1 category P
564  // third index is dummy, given that this is called for category P=0,1,3,4,5,6,7
565  std::vector<int> catP_offset = {0,1,0,31,36,41,45,47};
566  return (F + catP_offset[P]);
567  }
568 
570  tH_type tH=noTH, bool jets_pT25 = false) {
571  HTXS::Stage1::Category stage1 =
572  jets_pT25==false?stxs.stage1_cat_pTjet30GeV:
574  return HTXSstage1_to_HTXSstage1FineIndex(stage1,stxs.prodMode,tH);
575  }
576 
578  // the Stage-1 categories
579  int P = (int)(stage1 / 100);
580  int F = (int)(stage1 % 100);
581  std::vector<int> offset{0,1,13,19,24,29,33,35,37,39};
582  // convert to linear values
583  return ( F + offset[P] );
584  }
585 
586 
587 // #endif
588 
590  HiggsProdMode prodMode,
591  tH_type tH) {
592  if (stage1_2 == HTXS::Stage1_2::Category::UNKNOWN)
593  return 0;
594  int P = (int)(stage1_2 / 100);
595  int F = (int)(stage1_2 % 100);
596  // 1.a spit tH categories
597  if (prodMode == HiggsProdMode::TH) {
598  // check that tH splitting is valid for Stage-1 FineIndex
599  // else return unknown category
600  if (tH == tH_type::noTH)
601  return 0;
602  // check if forward tH
603  int fwdH = F == 0 ? 0 : 1;
604  return (94 + 2 * (tH - 1) + fwdH);
605  }
606  // 1.b QQ2HQQ --> split into VBF, WH, ZH -> HQQ
607  // offset vector 1: input is the Higgs prodMode
608  // first two indicies are dummies, given that this is only called for prodMode=2,3,4
609  std::vector<int> pMode_offset = {0, 0, 35, 46, 57};
610  if (P == 2)
611  return (F + pMode_offset[prodMode]);
612  // 1.c GG2ZH split into gg->ZH-had and gg->ZH-lep
613  if (prodMode == HiggsProdMode::GG2ZH && P == 1)
614  return F + 18;
615  // 1.d remaining categories
616  // offset vector 2: input is the Stage-1 category P
617  // third index is dummy, given that this is called for category P=0,1,3,4,5,6,7
618  std::vector<int> catP_offset = {0, 1, 0, 68, 74, 80, 86, 92};
619  return (F + catP_offset[P]);
620  }
621 
623  tH_type tH = noTH,
624  bool jets_pT25 = false) {
625  HTXS::Stage1_2::Category stage1_2 =
626  jets_pT25 == false ? stxs.stage1_2_cat_pTjet30GeV : stxs.stage1_2_cat_pTjet25GeV;
627  return HTXSstage1_2_to_HTXSstage1_2_FineIndex(stage1_2, stxs.prodMode, tH);
628  }
629 
631  // the Stage-1 categories
632  int P = (int)(stage1_2 / 100);
633  int F = (int)(stage1_2 % 100);
634  //std::vector<int> offset{0,1,13,19,24,29,33,35,37,39};
635  std::vector<int> offset{0, 1, 18, 29, 35, 41, 47, 53, 55, 57};
636  // convert to linear values
637  return (F + offset[P]);
638  }
639 
640  //Same for Stage1_2_Fine categories
642  HiggsProdMode prodMode,
643  tH_type tH) {
644  if (Stage1_2_Fine == HTXS::Stage1_2_Fine::Category::UNKNOWN)
645  return 0;
646  int P = (int)(Stage1_2_Fine / 100);
647  int F = (int)(Stage1_2_Fine % 100);
648  // 1.a spit tH categories
649  if (prodMode == HiggsProdMode::TH) {
650  // check that tH splitting is valid for Stage-1 FineIndex
651  // else return unknown category
652  if (tH == tH_type::noTH)
653  return 0;
654  // check if forward tH
655  int fwdH = F == 0 ? 0 : 1;
656  return (189 + 2 * (tH - 1) + fwdH);
657  }
658  // 1.b QQ2HQQ --> split into VBF, WH, ZH -> HQQ
659  // offset vector 1: input is the Higgs prodMode
660  // first two indicies are dummies, given that this is only called for prodMode=2,3,4
661  std::vector<int> pMode_offset = {0, 0, 57, 82, 107};
662  if (P == 2)
663  return (F + pMode_offset[prodMode]);
664  // 1.c GG2ZH split into gg->ZH-had and gg->ZH-lep
665  if (prodMode == HiggsProdMode::GG2ZH && P == 1)
666  return F + 29;
667  // 1.d remaining categories
668  // offset vector 2: input is the Stage-1 category P
669  // third index is dummy, given that this is called for category P=0,1,3,4,5,6,7
670  std::vector<int> catP_offset = {0, 1, 0, 132, 148, 164, 180, 187};
671  return (F + catP_offset[P]);
672  }
673 
675  tH_type tH = noTH,
676  bool jets_pT25 = false) {
677  HTXS::Stage1_2_Fine::Category Stage1_2_Fine =
678  jets_pT25 == false ? stxs.stage1_2_fine_cat_pTjet30GeV : stxs.stage1_2_fine_cat_pTjet25GeV;
679  return HTXSstage1_2_Fine_to_HTXSstage1_2_Fine_FineIndex(Stage1_2_Fine, stxs.prodMode, tH);
680  }
681 
683  // the Stage-1_2_Fine categories
684  int P = (int)(Stage1_2_Fine / 100);
685  int F = (int)(Stage1_2_Fine % 100);
686  std::vector<int> offset{0, 1, 29, 54, 70, 86, 102, 109, 111, 113};
687  // convert to linear values
688  return (F + offset[P]);
689  }
690 
691  // #endif
692 
693 } // namespace HTXS
694 
695 #ifdef RIVET_Particle_HH
696 //#ifdef HIGGSTRUTHCLASSIFIER_HIGGSTRUTHCLASSIFIER_CC
697 //#include "Rivet/Particle.hh"
698 namespace Rivet {
699 
704  struct HiggsClassification {
706  HTXS::HiggsProdMode prodMode;
708  Rivet::Particle higgs;
710  Rivet::Particle V;
712  Rivet::FourMomentum p4decay_higgs;
714  Rivet::FourMomentum p4decay_V;
716  Rivet::Jets jets25, jets30;
718  HTXS::Stage0::Category stage0_cat;
720  HTXS::Stage1::Category stage1_cat_pTjet25GeV;
722  HTXS::Stage1::Category stage1_cat_pTjet30GeV;
740  bool isZ2vvDecay;
742  HTXS::ErrorCode errorCode;
743  };
744 } // namespace Rivet
745 #endif
746 
747 
748 
749 #endif
failed to identify associated vector boson
std::vector< TLV > TLVs
ErrorCode
Error code: whether the classification was successful or failed.
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< double > > XYZTLorentzVectorD
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:14
successful classification
HTXS::Stage1_2_Fine::Category stage1_2_fine_cat_pTjet25GeV
int HTXSstage1_2_Fine_to_HTXSstage1_2_Fine_FineIndex(HTXS::Stage1_2_Fine::Category Stage1_2_Fine, HiggsProdMode prodMode, tH_type tH)
failed to identify Higgs boson decay products
HTXS::Stage1::Category stage1_cat_pTjet25GeV
HiggsProdMode
Higgs production modes, corresponding to input sample.
HTXS::Stage1_2::Category stage1_2_cat_pTjet30GeV
HTXS::Stage1_1_Fine::Category stage1_1_fine_cat_pTjet30GeV
Definition: VBF.py:1
def cat(path)
Definition: eostools.py:400
HTXS::Stage1_1_Fine::Category stage1_1_fine_cat_pTjet25GeV
failed momentum conservation
int HTXSstage1_to_HTXSstage1FineIndex(HTXS::Stage1::Category stage1, HiggsProdMode prodMode, tH_type tH)
vector< PseudoJet > jets
tH_type
Additional identifier flag for TH production modes.
int HTXSstage1_to_index(HTXS::Stage1::Category stage1)
std::vector< vec3 > vec4
Definition: HCALResponse.h:18
Higgs Template Cross Section namespace.
failed to identify associated vector boson decay products
TLV MakeTLV(vec4 const p)
math::XYZTLorentzVectorD TLV
HTXS::Stage1::Category stage1_cat_pTjet30GeV
HTXS::Stage1_1::Category stage1_1_cat_pTjet25GeV
failed to identify Higgs boson
int HTXSstage1_2_to_HTXSstage1_2_FineIndex(HTXS::Stage1_2::Category stage1_2, HiggsProdMode prodMode, tH_type tH)
HTXS::Stage1_2::Category stage1_2_cat_pTjet25GeV
failed to identify hard scatter vertex
std::pair< OmniClusterRef, TrackingParticleRef > P
int HTXSstage1_2_Fine_to_index(HTXS::Stage1_2_Fine::Category Stage1_2_Fine)
HTXS::Stage1_1::Category stage1_1_cat_pTjet30GeV
HTXS::Stage1_2_Fine::Category stage1_2_fine_cat_pTjet30GeV
HTXS::HiggsClassification Rivet2Root(category const &htxs_cat_rivet)
int HTXSstage1_2_to_index(HTXS::Stage1_2::Category stage1_2)
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
Definition: blowfish.cc:281
TLVs MakeTLVs(Vvec4 const &rivet_jets)
production mode not defined
failed to identify top decay