CMS 3D CMS Logo

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 
25  enum HiggsProdMode { UNKNOWN = 0, GGF = 1, VBF = 2, WH = 3, QQ2ZH = 4, GG2ZH = 5, TTH = 6, BBH = 7, TH = 8 };
26 
28  enum tH_type { noTH = 0, THQB = 1, TWH = 2 };
29 
33 
35  namespace Stage0 {
37  enum Category {
38  UNKNOWN = 0,
39  GG2H_FWDH = 10,
40  GG2H = 11,
41  VBF_FWDH = 20,
42  VBF = 21,
44  VH2HQQ = 23,
46  QQ2HLNU = 31,
48  QQ2HLL = 41,
50  GG2HLL = 51,
51  TTH_FWDH = 60,
52  TTH = 61,
53  BBH_FWDH = 70,
54  BBH = 71,
55  TH_FWDH = 80,
56  TH = 81
57  };
58  } // namespace Stage0
59 
64  namespace Stage1 {
65  enum Category {
66  UNKNOWN = 0,
67  // Gluon fusion
68  GG2H_FWDH = 100,
71  GG2H_0J = 103,
80  // "VBF"
81  QQ2HQQ_FWDH = 200,
85  QQ2HQQ_REST = 204,
87  // qq -> WH
88  QQ2HLNU_FWDH = 300,
93  // qq -> ZH
94  QQ2HLL_FWDH = 400,
99  // gg -> ZH
100  GG2HLL_FWDH = 500,
104  // ttH
105  TTH_FWDH = 600,
106  TTH = 601,
107  // bbH
108  BBH_FWDH = 700,
109  BBH = 701,
110  // tH
111  TH_FWDH = 800,
112  TH = 801
113  };
114  } // namespace Stage1
115 
116  namespace Stage1_1 {
117  enum Category {
118  UNKNOWN = 0,
119  // Gluon fusion
120  GG2H_FWDH = 100,
134  // "VBF"
135  QQ2HQQ_FWDH = 200,
136  QQ2HQQ_0J = 201,
137  QQ2HQQ_1J = 202,
146  // qq -> WH
153  // qq -> ZH
154  QQ2HLL_FWDH = 400,
160  // gg -> ZH
161  GG2HLL_FWDH = 500,
167  // ttH
168  TTH_FWDH = 600,
169  TTH = 601,
170  // bbH
171  BBH_FWDH = 700,
172  BBH = 701,
173  // tH
174  TH_FWDH = 800,
175  TH = 801
176  };
177  } // namespace Stage1_1
178 
179  namespace Stage1_1_Fine {
180  enum Category {
181  UNKNOWN = 0,
182  // Gluon fusion
183  GG2H_FWDH = 100,
204  // "VBF"
205  QQ2HQQ_FWDH = 200,
206  QQ2HQQ_0J = 201,
207  QQ2HQQ_1J = 202,
230  // qq -> WH
247  // qq -> ZH
248  QQ2HLL_FWDH = 400,
264  // gg -> ZH
265  GG2HLL_FWDH = 500,
281  // ttH
282  TTH_FWDH = 600,
283  TTH = 601,
284  // bbH
285  BBH_FWDH = 700,
286  BBH = 701,
287  // tH
288  TH_FWDH = 800,
289  TH = 801
290  };
291  } // namespace Stage1_1_Fine
292 
297  namespace Stage1_2 {
298  enum Category {
299  UNKNOWN = 0,
300  // Gluon fusion
301  GG2H_FWDH = 100,
318  // "VBF"
319  QQ2HQQ_FWDH = 200,
320  QQ2HQQ_0J = 201,
321  QQ2HQQ_1J = 202,
330  // qq -> WH
337  // qq -> ZH
338  QQ2HLL_FWDH = 400,
344  // gg -> ZH
345  GG2HLL_FWDH = 500,
351  // ttH
352  TTH_FWDH = 600,
358  // bbH
359  BBH_FWDH = 700,
360  BBH = 701,
361  // tH
362  TH_FWDH = 800,
363  TH = 801
364  };
365  } // namespace Stage1_2
366 
367  namespace Stage1_2_Fine {
368  enum Category {
369  UNKNOWN = 0,
370  // Gluon fusion
371  GG2H_FWDH = 100,
399  // "VBF"
400  QQ2HQQ_FWDH = 200,
401  QQ2HQQ_0J = 201,
402  QQ2HQQ_1J = 202,
425  // qq -> WH
442  // qq -> ZH
443  QQ2HLL_FWDH = 400,
459  // gg -> ZH
460  GG2HLL_FWDH = 500,
476  // ttH
477  TTH_FWDH = 600,
484  // bbH
485  BBH_FWDH = 700,
486  BBH = 701,
487  // tH
488  TH_FWDH = 800,
489  TH = 801
490  };
491  } // namespace Stage1_2_Fine
492 
493  //#ifdef ROOT_TLorentzVector
494  //typedef TLorentzVector TLV;
496  typedef std::vector<TLV> TLVs;
497 
498  template <class vec4>
499  TLV MakeTLV(vec4 const p) {
500  return TLV(p.px(), p.py(), p.pz(), p.E());
501  }
502 
503  template <class Vvec4>
504  inline TLVs MakeTLVs(Vvec4 const &rivet_jets) {
505  TLVs jets;
506  for (const auto &jet : rivet_jets)
507  jets.push_back(MakeTLV(jet));
508  return jets;
509  }
510 
511  // Structure holding information about the current event:
512  // Four-momenta and event classification according to the
513  // Higgs Template Cross Section
515  // Higgs production mode
517  // The Higgs boson
519  // The Higgs boson decay products
521  // Associated vector bosons
523  // The V-boson decay products
525  // Jets are built ignoring Higgs decay products and leptons from V decays
526  // jets with pT > 25 GeV and 30 GeV
528  // Event categorization according to YR4 wrtietup
529  // https://cds.cern.ch/record/2138079
541  // Flag for Z->vv decay mode (needed to split QQ2ZH and GG2ZH)
542  bool isZ2vvDecay = false;
543  // Temporary fix: add variables to perform STXS 1.3 classification with nanoAOD on-the-fly
544  double V_pt;
545  double Mjj;
546  double ptHjj;
547  double dPhijj;
548  // Error code :: classification was succesful or some error occured
550  };
551 
552  template <class category>
553  inline HTXS::HiggsClassification Rivet2Root(category const &htxs_cat_rivet) {
555  cat.prodMode = htxs_cat_rivet.prodMode;
556  cat.errorCode = htxs_cat_rivet.errorCode;
557  cat.higgs = MakeTLV(htxs_cat_rivet.higgs);
558  cat.V = MakeTLV(htxs_cat_rivet.V);
559  cat.p4decay_higgs = MakeTLV(htxs_cat_rivet.p4decay_higgs);
560  cat.p4decay_V = MakeTLV(htxs_cat_rivet.p4decay_V);
561  cat.jets25 = MakeTLVs(htxs_cat_rivet.jets25);
562  cat.jets30 = MakeTLVs(htxs_cat_rivet.jets30);
563  cat.stage0_cat = htxs_cat_rivet.stage0_cat;
564  cat.stage1_cat_pTjet25GeV = htxs_cat_rivet.stage1_cat_pTjet25GeV;
565  cat.stage1_cat_pTjet30GeV = htxs_cat_rivet.stage1_cat_pTjet30GeV;
566  cat.stage1_1_cat_pTjet25GeV = htxs_cat_rivet.stage1_1_cat_pTjet25GeV;
567  cat.stage1_1_cat_pTjet30GeV = htxs_cat_rivet.stage1_1_cat_pTjet30GeV;
568  cat.stage1_1_fine_cat_pTjet25GeV = htxs_cat_rivet.stage1_1_fine_cat_pTjet25GeV;
569  cat.stage1_1_fine_cat_pTjet30GeV = htxs_cat_rivet.stage1_1_fine_cat_pTjet30GeV;
570  cat.stage1_2_cat_pTjet25GeV = htxs_cat_rivet.stage1_2_cat_pTjet25GeV;
571  cat.stage1_2_cat_pTjet30GeV = htxs_cat_rivet.stage1_2_cat_pTjet30GeV;
572  cat.stage1_2_fine_cat_pTjet25GeV = htxs_cat_rivet.stage1_2_fine_cat_pTjet25GeV;
573  cat.stage1_2_fine_cat_pTjet30GeV = htxs_cat_rivet.stage1_2_fine_cat_pTjet30GeV;
574  cat.isZ2vvDecay = htxs_cat_rivet.isZ2vvDecay;
575  // Temporary fix: add variables to perform STXS 1.3 classification with nanoAOD on-the-fly
576  cat.V_pt = htxs_cat_rivet.V_pt;
577  cat.Mjj = htxs_cat_rivet.Mjj;
578  cat.ptHjj = htxs_cat_rivet.ptHjj;
579  cat.dPhijj = htxs_cat_rivet.dPhijj;
580  return cat;
581  }
582 
584  if (stage1 == HTXS::Stage1::Category::UNKNOWN)
585  return 0;
586  int P = (int)(stage1 / 100);
587  int F = (int)(stage1 % 100);
588  // 1.a spit tH categories
589  if (prodMode == HiggsProdMode::TH) {
590  // check that tH splitting is valid for Stage-1 FineIndex
591  // else return unknown category
592  if (tH == tH_type::noTH)
593  return 0;
594  // check if forward tH
595  int fwdH = F == 0 ? 0 : 1;
596  return (49 + 2 * (tH - 1) + fwdH);
597  }
598  // 1.b QQ2HQQ --> split into VBF, WH, ZH -> HQQ
599  // offset vector 1: input is the Higgs prodMode
600  // first two indicies are dummies, given that this is only called for prodMode=2,3,4
601  std::vector<int> pMode_offset = {0, 0, 13, 19, 25};
602  if (P == 2)
603  return (F + pMode_offset[prodMode]);
604  // 1.c remaining categories
605  // offset vector 2: input is the Stage-1 category P
606  // third index is dummy, given that this is called for category P=0,1,3,4,5,6,7
607  std::vector<int> catP_offset = {0, 1, 0, 31, 36, 41, 45, 47};
608  return (F + catP_offset[P]);
609  }
610 
612  tH_type tH = noTH,
613  bool jets_pT25 = false) {
614  HTXS::Stage1::Category stage1 = jets_pT25 == false ? stxs.stage1_cat_pTjet30GeV : stxs.stage1_cat_pTjet25GeV;
615  return HTXSstage1_to_HTXSstage1FineIndex(stage1, stxs.prodMode, tH);
616  }
617 
619  // the Stage-1 categories
620  int P = (int)(stage1 / 100);
621  int F = (int)(stage1 % 100);
622  std::vector<int> offset{0, 1, 13, 19, 24, 29, 33, 35, 37, 39};
623  // convert to linear values
624  return (F + offset[P]);
625  }
626 
628  HiggsProdMode prodMode,
629  tH_type tH) {
630  if (stage1_2 == HTXS::Stage1_2::Category::UNKNOWN)
631  return 0;
632  int P = (int)(stage1_2 / 100);
633  int F = (int)(stage1_2 % 100);
634  // 1.a spit tH categories
635  if (prodMode == HiggsProdMode::TH) {
636  // check that tH splitting is valid for Stage-1 FineIndex
637  // else return unknown category
638  if (tH == tH_type::noTH)
639  return 0;
640  // check if forward tH
641  int fwdH = F == 0 ? 0 : 1;
642  return (94 + 2 * (tH - 1) + fwdH);
643  }
644  // 1.b QQ2HQQ --> split into VBF, WH, ZH -> HQQ
645  // offset vector 1: input is the Higgs prodMode
646  // first two indicies are dummies, given that this is only called for prodMode=2,3,4
647  std::vector<int> pMode_offset = {0, 0, 35, 46, 57};
648  if (P == 2)
649  return (F + pMode_offset[prodMode]);
650  // 1.c GG2ZH split into gg->ZH-had and gg->ZH-lep
651  if (prodMode == HiggsProdMode::GG2ZH && P == 1)
652  return F + 18;
653  // 1.d remaining categories
654  // offset vector 2: input is the Stage-1 category P
655  // third index is dummy, given that this is called for category P=0,1,3,4,5,6,7
656  std::vector<int> catP_offset = {0, 1, 0, 68, 74, 80, 86, 92};
657  return (F + catP_offset[P]);
658  }
659 
661  tH_type tH = noTH,
662  bool jets_pT25 = false) {
663  HTXS::Stage1_2::Category stage1_2 =
664  jets_pT25 == false ? stxs.stage1_2_cat_pTjet30GeV : stxs.stage1_2_cat_pTjet25GeV;
665  return HTXSstage1_2_to_HTXSstage1_2_FineIndex(stage1_2, stxs.prodMode, tH);
666  }
667 
669  // the Stage-1 categories
670  int P = (int)(stage1_2 / 100);
671  int F = (int)(stage1_2 % 100);
672  //std::vector<int> offset{0,1,13,19,24,29,33,35,37,39};
673  std::vector<int> offset{0, 1, 18, 29, 35, 41, 47, 53, 55, 57};
674  // convert to linear values
675  return (F + offset[P]);
676  }
677 
678  //Same for Stage1_2_Fine categories
680  HiggsProdMode prodMode,
681  tH_type tH) {
682  if (Stage1_2_Fine == HTXS::Stage1_2_Fine::Category::UNKNOWN)
683  return 0;
684  int P = (int)(Stage1_2_Fine / 100);
685  int F = (int)(Stage1_2_Fine % 100);
686  // 1.a spit tH categories
687  if (prodMode == HiggsProdMode::TH) {
688  // check that tH splitting is valid for Stage-1 FineIndex
689  // else return unknown category
690  if (tH == tH_type::noTH)
691  return 0;
692  // check if forward tH
693  int fwdH = F == 0 ? 0 : 1;
694  return (189 + 2 * (tH - 1) + fwdH);
695  }
696  // 1.b QQ2HQQ --> split into VBF, WH, ZH -> HQQ
697  // offset vector 1: input is the Higgs prodMode
698  // first two indicies are dummies, given that this is only called for prodMode=2,3,4
699  std::vector<int> pMode_offset = {0, 0, 57, 82, 107};
700  if (P == 2)
701  return (F + pMode_offset[prodMode]);
702  // 1.c GG2ZH split into gg->ZH-had and gg->ZH-lep
703  if (prodMode == HiggsProdMode::GG2ZH && P == 1)
704  return F + 29;
705  // 1.d remaining categories
706  // offset vector 2: input is the Stage-1 category P
707  // third index is dummy, given that this is called for category P=0,1,3,4,5,6,7
708  std::vector<int> catP_offset = {0, 1, 0, 132, 148, 164, 180, 187};
709  return (F + catP_offset[P]);
710  }
711 
713  tH_type tH = noTH,
714  bool jets_pT25 = false) {
715  HTXS::Stage1_2_Fine::Category Stage1_2_Fine =
716  jets_pT25 == false ? stxs.stage1_2_fine_cat_pTjet30GeV : stxs.stage1_2_fine_cat_pTjet25GeV;
717  return HTXSstage1_2_Fine_to_HTXSstage1_2_Fine_FineIndex(Stage1_2_Fine, stxs.prodMode, tH);
718  }
719 
721  // the Stage-1_2_Fine categories
722  int P = (int)(Stage1_2_Fine / 100);
723  int F = (int)(Stage1_2_Fine % 100);
724  std::vector<int> offset{0, 1, 29, 54, 70, 86, 102, 109, 111, 113};
725  // convert to linear values
726  return (F + offset[P]);
727  }
728 
729  // #endif
730 
731 } // namespace HTXS
732 
733 #ifdef RIVET_Particle_HH
734 //#ifdef HIGGSTRUTHCLASSIFIER_HIGGSTRUTHCLASSIFIER_CC
735 //#include "Rivet/Particle.hh"
736 namespace Rivet {
737 
742  struct HiggsClassification {
744  HTXS::HiggsProdMode prodMode;
746  Rivet::Particle higgs;
748  Rivet::Particle V;
750  Rivet::FourMomentum p4decay_higgs;
752  Rivet::FourMomentum p4decay_V;
754  Rivet::Jets jets25, jets30;
756  HTXS::Stage0::Category stage0_cat;
758  HTXS::Stage1::Category stage1_cat_pTjet25GeV;
760  HTXS::Stage1::Category stage1_cat_pTjet30GeV;
778  bool isZ2vvDecay = false;
779  // Temporary fix: add variables to perform STXS 1.3 classification with nanoAOD on-the-fly
780  double V_pt;
781  double Mjj;
782  double ptHjj;
783  double dPhijj;
785  HTXS::ErrorCode errorCode;
786  };
787 } // namespace Rivet
788 #endif
789 
790 #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:401
HTXS::Stage1_1_Fine::Category stage1_1_fine_cat_pTjet25GeV
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t V
failed momentum conservation
int HTXSstage1_to_HTXSstage1FineIndex(HTXS::Stage1::Category stage1, HiggsProdMode prodMode, tH_type tH)
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:163
TLVs MakeTLVs(Vvec4 const &rivet_jets)
production mode not defined
failed to identify top decay