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 
293  //#ifdef ROOT_TLorentzVector
294  //typedef TLorentzVector TLV;
296  typedef std::vector<TLV> TLVs;
297 
298  template <class vec4>
299  TLV MakeTLV(vec4 const p) {
300  return TLV(p.px(), p.py(), p.pz(), p.E());
301  }
302 
303  template <class Vvec4>
304  inline TLVs MakeTLVs(Vvec4 const &rivet_jets) {
305  TLVs jets;
306  for (auto jet : rivet_jets)
307  jets.push_back(MakeTLV(jet));
308  return jets;
309  }
310 
311  // Structure holding information about the current event:
312  // Four-momenta and event classification according to the
313  // Higgs Template Cross Section
315  // Higgs production mode
317  // The Higgs boson
318  TLV higgs;
319  // The Higgs boson decay products
321  // Associated vector bosons
322  TLV V;
323  // The V-boson decay products
325  // Jets are built ignoring Higgs decay products and leptons from V decays
326  // jets with pT > 25 GeV and 30 GeV
327  TLVs jets25, jets30;
328  // Event categorization according to YR4 wrtietup
329  // https://cds.cern.ch/record/2138079
337  // Error code :: classification was succesful or some error occured
339  };
340 
341  template <class category>
342  inline HTXS::HiggsClassification Rivet2Root(category const &htxs_cat_rivet) {
344  cat.prodMode = htxs_cat_rivet.prodMode;
345  cat.errorCode = htxs_cat_rivet.errorCode;
346  cat.higgs = MakeTLV(htxs_cat_rivet.higgs);
347  cat.V = MakeTLV(htxs_cat_rivet.V);
348  cat.p4decay_higgs = MakeTLV(htxs_cat_rivet.p4decay_higgs);
349  cat.p4decay_V = MakeTLV(htxs_cat_rivet.p4decay_V);
350  cat.jets25 = MakeTLVs(htxs_cat_rivet.jets25);
351  cat.jets30 = MakeTLVs(htxs_cat_rivet.jets30);
352  cat.stage0_cat = htxs_cat_rivet.stage0_cat;
353  cat.stage1_cat_pTjet25GeV = htxs_cat_rivet.stage1_cat_pTjet25GeV;
354  cat.stage1_cat_pTjet30GeV = htxs_cat_rivet.stage1_cat_pTjet30GeV;
355  cat.stage1_1_cat_pTjet25GeV = htxs_cat_rivet.stage1_1_cat_pTjet25GeV;
356  cat.stage1_1_cat_pTjet30GeV = htxs_cat_rivet.stage1_1_cat_pTjet30GeV;
357  cat.stage1_1_fine_cat_pTjet25GeV = htxs_cat_rivet.stage1_1_fine_cat_pTjet25GeV;
358  cat.stage1_1_fine_cat_pTjet30GeV = htxs_cat_rivet.stage1_1_fine_cat_pTjet30GeV;
359  return cat;
360  }
361 
363  if (stage1 == HTXS::Stage1::Category::UNKNOWN)
364  return 0;
365  int P = (int)(stage1 / 100);
366  int F = (int)(stage1 % 100);
367  // 1.a spit tH categories
368  if (prodMode == HiggsProdMode::TH) {
369  // check that tH splitting is valid for Stage-1 FineIndex
370  // else return unknown category
371  if (tH == tH_type::noTH)
372  return 0;
373  // check if forward tH
374  int fwdH = F == 0 ? 0 : 1;
375  return (49 + 2 * (tH - 1) + fwdH);
376  }
377  // 1.b QQ2HQQ --> split into VBF, WH, ZH -> HQQ
378  // offset vector 1: input is the Higgs prodMode
379  // first two indicies are dummies, given that this is only called for prodMode=2,3,4
380  std::vector<int> pMode_offset = {0, 0, 13, 19, 25};
381  if (P == 2)
382  return (F + pMode_offset[prodMode]);
383  // 1.c remaining categories
384  // offset vector 2: input is the Stage-1 category P
385  // third index is dummy, given that this is called for category P=0,1,3,4,5,6,7
386  std::vector<int> catP_offset = {0, 1, 0, 31, 36, 41, 45, 47};
387  return (F + catP_offset[P]);
388  }
389 
391  tH_type tH = noTH,
392  bool jets_pT25 = false) {
393  HTXS::Stage1::Category stage1 = jets_pT25 == false ? stxs.stage1_cat_pTjet30GeV : stxs.stage1_cat_pTjet25GeV;
394  return HTXSstage1_to_HTXSstage1FineIndex(stage1, stxs.prodMode, tH);
395  }
396 
398  // the Stage-1 categories
399  int P = (int)(stage1 / 100);
400  int F = (int)(stage1 % 100);
401  std::vector<int> offset{0, 1, 13, 19, 24, 29, 33, 35, 37, 39};
402  // convert to linear values
403  return (F + offset[P]);
404  }
405 
406  // #endif
407 
408 } // namespace HTXS
409 
410 #ifdef RIVET_Particle_HH
411 //#ifdef HIGGSTRUTHCLASSIFIER_HIGGSTRUTHCLASSIFIER_CC
412 //#include "Rivet/Particle.hh"
413 namespace Rivet {
414 
419  struct HiggsClassification {
421  HTXS::HiggsProdMode prodMode;
423  Rivet::Particle higgs;
425  Rivet::Particle V;
427  Rivet::FourMomentum p4decay_higgs;
429  Rivet::FourMomentum p4decay_V;
431  Rivet::Jets jets25, jets30;
433  HTXS::Stage0::Category stage0_cat;
435  HTXS::Stage1::Category stage1_cat_pTjet25GeV;
437  HTXS::Stage1::Category stage1_cat_pTjet30GeV;
447  HTXS::ErrorCode errorCode;
448  };
449 } // namespace Rivet
450 #endif
451 
452 #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
failed to identify Higgs boson decay products
HTXS::Stage1::Category stage1_cat_pTjet25GeV
HiggsProdMode
Higgs production modes, corresponding to input sample.
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)
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
failed to identify hard scatter vertex
std::pair< OmniClusterRef, TrackingParticleRef > P
HTXS::Stage1_1::Category stage1_1_cat_pTjet30GeV
HTXS::HiggsClassification Rivet2Root(category const &htxs_cat_rivet)
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