CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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 
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  // Error code :: classification was succesful or some error occured
545  };
546 
547  template <class category>
548  inline HTXS::HiggsClassification Rivet2Root(category const &htxs_cat_rivet) {
550  cat.prodMode = htxs_cat_rivet.prodMode;
551  cat.errorCode = htxs_cat_rivet.errorCode;
552  cat.higgs = MakeTLV(htxs_cat_rivet.higgs);
553  cat.V = MakeTLV(htxs_cat_rivet.V);
554  cat.p4decay_higgs = MakeTLV(htxs_cat_rivet.p4decay_higgs);
555  cat.p4decay_V = MakeTLV(htxs_cat_rivet.p4decay_V);
556  cat.jets25 = MakeTLVs(htxs_cat_rivet.jets25);
557  cat.jets30 = MakeTLVs(htxs_cat_rivet.jets30);
558  cat.stage0_cat = htxs_cat_rivet.stage0_cat;
559  cat.stage1_cat_pTjet25GeV = htxs_cat_rivet.stage1_cat_pTjet25GeV;
560  cat.stage1_cat_pTjet30GeV = htxs_cat_rivet.stage1_cat_pTjet30GeV;
561  cat.stage1_1_cat_pTjet25GeV = htxs_cat_rivet.stage1_1_cat_pTjet25GeV;
562  cat.stage1_1_cat_pTjet30GeV = htxs_cat_rivet.stage1_1_cat_pTjet30GeV;
563  cat.stage1_1_fine_cat_pTjet25GeV = htxs_cat_rivet.stage1_1_fine_cat_pTjet25GeV;
564  cat.stage1_1_fine_cat_pTjet30GeV = htxs_cat_rivet.stage1_1_fine_cat_pTjet30GeV;
565  cat.stage1_2_cat_pTjet25GeV = htxs_cat_rivet.stage1_2_cat_pTjet25GeV;
566  cat.stage1_2_cat_pTjet30GeV = htxs_cat_rivet.stage1_2_cat_pTjet30GeV;
567  cat.stage1_2_fine_cat_pTjet25GeV = htxs_cat_rivet.stage1_2_fine_cat_pTjet25GeV;
568  cat.stage1_2_fine_cat_pTjet30GeV = htxs_cat_rivet.stage1_2_fine_cat_pTjet30GeV;
569  cat.isZ2vvDecay = htxs_cat_rivet.isZ2vvDecay;
570  return cat;
571  }
572 
574  if (stage1 == HTXS::Stage1::Category::UNKNOWN)
575  return 0;
576  int P = (int)(stage1 / 100);
577  int F = (int)(stage1 % 100);
578  // 1.a spit tH categories
579  if (prodMode == HiggsProdMode::TH) {
580  // check that tH splitting is valid for Stage-1 FineIndex
581  // else return unknown category
582  if (tH == tH_type::noTH)
583  return 0;
584  // check if forward tH
585  int fwdH = F == 0 ? 0 : 1;
586  return (49 + 2 * (tH - 1) + fwdH);
587  }
588  // 1.b QQ2HQQ --> split into VBF, WH, ZH -> HQQ
589  // offset vector 1: input is the Higgs prodMode
590  // first two indicies are dummies, given that this is only called for prodMode=2,3,4
591  std::vector<int> pMode_offset = {0, 0, 13, 19, 25};
592  if (P == 2)
593  return (F + pMode_offset[prodMode]);
594  // 1.c remaining categories
595  // offset vector 2: input is the Stage-1 category P
596  // third index is dummy, given that this is called for category P=0,1,3,4,5,6,7
597  std::vector<int> catP_offset = {0, 1, 0, 31, 36, 41, 45, 47};
598  return (F + catP_offset[P]);
599  }
600 
602  tH_type tH = noTH,
603  bool jets_pT25 = false) {
604  HTXS::Stage1::Category stage1 = jets_pT25 == false ? stxs.stage1_cat_pTjet30GeV : stxs.stage1_cat_pTjet25GeV;
605  return HTXSstage1_to_HTXSstage1FineIndex(stage1, stxs.prodMode, tH);
606  }
607 
609  // the Stage-1 categories
610  int P = (int)(stage1 / 100);
611  int F = (int)(stage1 % 100);
612  std::vector<int> offset{0, 1, 13, 19, 24, 29, 33, 35, 37, 39};
613  // convert to linear values
614  return (F + offset[P]);
615  }
616 
618  HiggsProdMode prodMode,
619  tH_type tH) {
620  if (stage1_2 == HTXS::Stage1_2::Category::UNKNOWN)
621  return 0;
622  int P = (int)(stage1_2 / 100);
623  int F = (int)(stage1_2 % 100);
624  // 1.a spit tH categories
625  if (prodMode == HiggsProdMode::TH) {
626  // check that tH splitting is valid for Stage-1 FineIndex
627  // else return unknown category
628  if (tH == tH_type::noTH)
629  return 0;
630  // check if forward tH
631  int fwdH = F == 0 ? 0 : 1;
632  return (94 + 2 * (tH - 1) + fwdH);
633  }
634  // 1.b QQ2HQQ --> split into VBF, WH, ZH -> HQQ
635  // offset vector 1: input is the Higgs prodMode
636  // first two indicies are dummies, given that this is only called for prodMode=2,3,4
637  std::vector<int> pMode_offset = {0, 0, 35, 46, 57};
638  if (P == 2)
639  return (F + pMode_offset[prodMode]);
640  // 1.c GG2ZH split into gg->ZH-had and gg->ZH-lep
641  if (prodMode == HiggsProdMode::GG2ZH && P == 1)
642  return F + 18;
643  // 1.d remaining categories
644  // offset vector 2: input is the Stage-1 category P
645  // third index is dummy, given that this is called for category P=0,1,3,4,5,6,7
646  std::vector<int> catP_offset = {0, 1, 0, 68, 74, 80, 86, 92};
647  return (F + catP_offset[P]);
648  }
649 
651  tH_type tH = noTH,
652  bool jets_pT25 = false) {
653  HTXS::Stage1_2::Category stage1_2 =
654  jets_pT25 == false ? stxs.stage1_2_cat_pTjet30GeV : stxs.stage1_2_cat_pTjet25GeV;
655  return HTXSstage1_2_to_HTXSstage1_2_FineIndex(stage1_2, stxs.prodMode, tH);
656  }
657 
659  // the Stage-1 categories
660  int P = (int)(stage1_2 / 100);
661  int F = (int)(stage1_2 % 100);
662  //std::vector<int> offset{0,1,13,19,24,29,33,35,37,39};
663  std::vector<int> offset{0, 1, 18, 29, 35, 41, 47, 53, 55, 57};
664  // convert to linear values
665  return (F + offset[P]);
666  }
667 
668  //Same for Stage1_2_Fine categories
670  HiggsProdMode prodMode,
671  tH_type tH) {
672  if (Stage1_2_Fine == HTXS::Stage1_2_Fine::Category::UNKNOWN)
673  return 0;
674  int P = (int)(Stage1_2_Fine / 100);
675  int F = (int)(Stage1_2_Fine % 100);
676  // 1.a spit tH categories
677  if (prodMode == HiggsProdMode::TH) {
678  // check that tH splitting is valid for Stage-1 FineIndex
679  // else return unknown category
680  if (tH == tH_type::noTH)
681  return 0;
682  // check if forward tH
683  int fwdH = F == 0 ? 0 : 1;
684  return (189 + 2 * (tH - 1) + fwdH);
685  }
686  // 1.b QQ2HQQ --> split into VBF, WH, ZH -> HQQ
687  // offset vector 1: input is the Higgs prodMode
688  // first two indicies are dummies, given that this is only called for prodMode=2,3,4
689  std::vector<int> pMode_offset = {0, 0, 57, 82, 107};
690  if (P == 2)
691  return (F + pMode_offset[prodMode]);
692  // 1.c GG2ZH split into gg->ZH-had and gg->ZH-lep
693  if (prodMode == HiggsProdMode::GG2ZH && P == 1)
694  return F + 29;
695  // 1.d remaining categories
696  // offset vector 2: input is the Stage-1 category P
697  // third index is dummy, given that this is called for category P=0,1,3,4,5,6,7
698  std::vector<int> catP_offset = {0, 1, 0, 132, 148, 164, 180, 187};
699  return (F + catP_offset[P]);
700  }
701 
703  tH_type tH = noTH,
704  bool jets_pT25 = false) {
705  HTXS::Stage1_2_Fine::Category Stage1_2_Fine =
706  jets_pT25 == false ? stxs.stage1_2_fine_cat_pTjet30GeV : stxs.stage1_2_fine_cat_pTjet25GeV;
707  return HTXSstage1_2_Fine_to_HTXSstage1_2_Fine_FineIndex(Stage1_2_Fine, stxs.prodMode, tH);
708  }
709 
711  // the Stage-1_2_Fine categories
712  int P = (int)(Stage1_2_Fine / 100);
713  int F = (int)(Stage1_2_Fine % 100);
714  std::vector<int> offset{0, 1, 29, 54, 70, 86, 102, 109, 111, 113};
715  // convert to linear values
716  return (F + offset[P]);
717  }
718 
719  // #endif
720 
721 } // namespace HTXS
722 
723 #ifdef RIVET_Particle_HH
724 //#ifdef HIGGSTRUTHCLASSIFIER_HIGGSTRUTHCLASSIFIER_CC
725 //#include "Rivet/Particle.hh"
726 namespace Rivet {
727 
732  struct HiggsClassification {
734  HTXS::HiggsProdMode prodMode;
736  Rivet::Particle higgs;
738  Rivet::Particle V;
740  Rivet::FourMomentum p4decay_higgs;
742  Rivet::FourMomentum p4decay_V;
744  Rivet::Jets jets25, jets30;
746  HTXS::Stage0::Category stage0_cat;
748  HTXS::Stage1::Category stage1_cat_pTjet25GeV;
750  HTXS::Stage1::Category stage1_cat_pTjet30GeV;
752  HTXS::Stage1_1::Category stage1_1_cat_pTjet25GeV;
754  HTXS::Stage1_1::Category stage1_1_cat_pTjet30GeV;
756  HTXS::Stage1_1_Fine::Category stage1_1_fine_cat_pTjet25GeV;
758  HTXS::Stage1_1_Fine::Category stage1_1_fine_cat_pTjet30GeV;
760  HTXS::Stage1_2::Category stage1_2_cat_pTjet25GeV;
762  HTXS::Stage1_2::Category stage1_2_cat_pTjet30GeV;
764  HTXS::Stage1_2_Fine::Category stage1_2_fine_cat_pTjet25GeV;
766  HTXS::Stage1_2_Fine::Category stage1_2_fine_cat_pTjet30GeV;
768  bool isZ2vvDecay = false;
770  HTXS::ErrorCode errorCode;
771  };
772 } // namespace Rivet
773 #endif
774 
775 #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
static const char category[]
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
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)
def cat
Definition: eostools.py:401
vector< PseudoJet > jets
tH_type
Additional identifier flag for TH production modes.
tuple Jets
Definition: METSkim_cff.py:17
int HTXSstage1_to_index(HTXS::Stage1::Category stage1)
std::vector< vec3 > vec4
Definition: HCALResponse.h:18
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