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 (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
518  TLV higgs;
519  // The Higgs boson decay products
521  // Associated vector bosons
522  TLV V;
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
527  TLVs jets25, jets30;
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)
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 
617  // #endif
618 
620  HiggsProdMode prodMode,
621  tH_type tH) {
622  if (stage1_2 == HTXS::Stage1_2::Category::UNKNOWN)
623  return 0;
624  int P = (int)(stage1_2 / 100);
625  int F = (int)(stage1_2 % 100);
626  // 1.a spit tH categories
627  if (prodMode == HiggsProdMode::TH) {
628  // check that tH splitting is valid for Stage-1 FineIndex
629  // else return unknown category
630  if (tH == tH_type::noTH)
631  return 0;
632  // check if forward tH
633  int fwdH = F == 0 ? 0 : 1;
634  return (94 + 2 * (tH - 1) + fwdH);
635  }
636  // 1.b QQ2HQQ --> split into VBF, WH, ZH -> HQQ
637  // offset vector 1: input is the Higgs prodMode
638  // first two indicies are dummies, given that this is only called for prodMode=2,3,4
639  std::vector<int> pMode_offset = {0, 0, 35, 46, 57};
640  if (P == 2)
641  return (F + pMode_offset[prodMode]);
642  // 1.c GG2ZH split into gg->ZH-had and gg->ZH-lep
643  if (prodMode == HiggsProdMode::GG2ZH && P == 1)
644  return F + 18;
645  // 1.d remaining categories
646  // offset vector 2: input is the Stage-1 category P
647  // third index is dummy, given that this is called for category P=0,1,3,4,5,6,7
648  std::vector<int> catP_offset = {0, 1, 0, 68, 74, 80, 86, 92};
649  return (F + catP_offset[P]);
650  }
651 
653  tH_type tH = noTH,
654  bool jets_pT25 = false) {
655  HTXS::Stage1_2::Category stage1_2 =
656  jets_pT25 == false ? stxs.stage1_2_cat_pTjet30GeV : stxs.stage1_2_cat_pTjet25GeV;
657  return HTXSstage1_2_to_HTXSstage1_2_FineIndex(stage1_2, stxs.prodMode, tH);
658  }
659 
661  // the Stage-1 categories
662  int P = (int)(stage1_2 / 100);
663  int F = (int)(stage1_2 % 100);
664  //std::vector<int> offset{0,1,13,19,24,29,33,35,37,39};
665  std::vector<int> offset{0, 1, 18, 29, 35, 41, 47, 53, 55, 57};
666  // convert to linear values
667  return (F + offset[P]);
668  }
669 
670  //Same for Stage1_2_Fine categories
672  HiggsProdMode prodMode,
673  tH_type tH) {
674  if (Stage1_2_Fine == HTXS::Stage1_2_Fine::Category::UNKNOWN)
675  return 0;
676  int P = (int)(Stage1_2_Fine / 100);
677  int F = (int)(Stage1_2_Fine % 100);
678  // 1.a spit tH categories
679  if (prodMode == HiggsProdMode::TH) {
680  // check that tH splitting is valid for Stage-1 FineIndex
681  // else return unknown category
682  if (tH == tH_type::noTH)
683  return 0;
684  // check if forward tH
685  int fwdH = F == 0 ? 0 : 1;
686  return (189 + 2 * (tH - 1) + fwdH);
687  }
688  // 1.b QQ2HQQ --> split into VBF, WH, ZH -> HQQ
689  // offset vector 1: input is the Higgs prodMode
690  // first two indicies are dummies, given that this is only called for prodMode=2,3,4
691  std::vector<int> pMode_offset = {0, 0, 57, 82, 107};
692  if (P == 2)
693  return (F + pMode_offset[prodMode]);
694  // 1.c GG2ZH split into gg->ZH-had and gg->ZH-lep
695  if (prodMode == HiggsProdMode::GG2ZH && P == 1)
696  return F + 29;
697  // 1.d remaining categories
698  // offset vector 2: input is the Stage-1 category P
699  // third index is dummy, given that this is called for category P=0,1,3,4,5,6,7
700  std::vector<int> catP_offset = {0, 1, 0, 132, 148, 164, 180, 187};
701  return (F + catP_offset[P]);
702  }
703 
705  tH_type tH = noTH,
706  bool jets_pT25 = false) {
707  HTXS::Stage1_2_Fine::Category Stage1_2_Fine =
708  jets_pT25 == false ? stxs.stage1_2_fine_cat_pTjet30GeV : stxs.stage1_2_fine_cat_pTjet25GeV;
709  return HTXSstage1_2_Fine_to_HTXSstage1_2_Fine_FineIndex(Stage1_2_Fine, stxs.prodMode, tH);
710  }
711 
713  // the Stage-1_2_Fine categories
714  int P = (int)(Stage1_2_Fine / 100);
715  int F = (int)(Stage1_2_Fine % 100);
716  std::vector<int> offset{0, 1, 29, 54, 70, 86, 102, 109, 111, 113};
717  // convert to linear values
718  return (F + offset[P]);
719  }
720 
721  // #endif
722 
723 } // namespace HTXS
724 
725 #ifdef RIVET_Particle_HH
726 //#ifdef HIGGSTRUTHCLASSIFIER_HIGGSTRUTHCLASSIFIER_CC
727 //#include "Rivet/Particle.hh"
728 namespace Rivet {
729 
734  struct HiggsClassification {
736  HTXS::HiggsProdMode prodMode;
738  Rivet::Particle higgs;
740  Rivet::Particle V;
742  Rivet::FourMomentum p4decay_higgs;
744  Rivet::FourMomentum p4decay_V;
746  Rivet::Jets jets25, jets30;
748  HTXS::Stage0::Category stage0_cat;
750  HTXS::Stage1::Category stage1_cat_pTjet25GeV;
752  HTXS::Stage1::Category stage1_cat_pTjet30GeV;
770  bool isZ2vvDecay;
772  HTXS::ErrorCode errorCode;
773  };
774 } // namespace Rivet
775 #endif
776 
777 #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
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