ATLAS Offline Software
LargeRJetLabelEnum.h
Go to the documentation of this file.
1 // Dear emacs, this is -*- c++ -*-
2 /*
3  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
4 */
5 #ifndef PARTICLEJETTOOLS_LARGERJETLABELENUM_H
6 #define PARTICLEJETTOOLS_LARGERJETLABELENUM_H
7 
8 // ROOT include(s).
9 #include <TString.h>
10 
12 {
13  enum TypeEnum
14  {
15  UNKNOWN=0, // Not tagged yet
16  tqqb, // fully-contained top->qqb
17  Wqq, // fully-contained W->qq
18  Zbb, // fully-contained Z->bb
19  Zcc, // fully-contained Z->cc
20  Zqq, // fully-contained Z->qq
21  Wqq_From_t, // fully-contained W->qq (also matched to top)
22  other_From_t, // matched to top
23  other_From_V, // matched to W/Z
24  notruth, // failed to truth-jet matching (pileup)
25  qcd, // not matched to top or W/Z (background jet)
26  Hbb, // fully-contained H->bb
27  Hcc, // fully-contained H->cc
28  other_From_H, // matched to H
29  HtautauEl, // fully-contained H->tautau, el
30  HtautauMu, // fully-contained H->tautau, mu
31  HtautauHad, // fully-contained H->tautau, had
32  ZtautauEl, // fully-contained Z->tautau, el
33  ZtautauMu, // fully-contained Z->tautau, mu
34  ZtautauHad, // fully-contained Z->tautau, had
35  };
36 
37  inline int enumToInt(const TypeEnum type)
38  {
39  switch (type) {
40  case tqqb: return 1;
41  case Wqq: return 2;
42  case Zbb: return 3;
43  case Zcc: return 4;
44  case Zqq: return 5;
45  case Wqq_From_t: return 6;
46  case other_From_t: return 7;
47  case other_From_V: return 8;
48  case notruth: return 9;
49  case qcd: return 10;
50  case Hbb: return 11;
51  case Hcc: return 12;
52  case other_From_H: return 13;
53  case HtautauEl: return 14;
54  case HtautauMu: return 15;
55  case HtautauHad: return 16;
56  case ZtautauEl: return 17;
57  case ZtautauMu: return 18;
58  case ZtautauHad: return 19;
59  default: return 0;
60  }
61  }
62 
63  inline TypeEnum intToEnum(const int type)
64  {
65  switch (type) {
66  case 1: return tqqb;
67  case 2: return Wqq;
68  case 3: return Zbb;
69  case 4: return Zcc;
70  case 5: return Zqq;
71  case 6: return Wqq_From_t;
72  case 7: return other_From_t;
73  case 8: return other_From_V;
74  case 9: return notruth;
75  case 10: return qcd;
76  case 11: return Hbb;
77  case 12: return Hcc;
78  case 13: return other_From_H;
79  case 14: return HtautauEl;
80  case 15: return HtautauMu;
81  case 16: return HtautauHad;
82  case 17: return ZtautauEl;
83  case 18: return ZtautauMu;
84  case 19: return ZtautauHad;
85  default: return UNKNOWN;
86  }
87 
88  }
89 
90  inline TypeEnum stringToEnum(const TString& name)
91  {
92 #define TRY(STRING) if (name.EqualTo(#STRING, TString::kIgnoreCase)) return STRING
93  TRY(tqqb);
94  TRY(Wqq);
95  TRY(Zbb);
96  TRY(Zcc);
97  TRY(Zqq);
98  TRY(Wqq_From_t);
100  TRY(other_From_V);
101  TRY(notruth);
102  TRY(qcd);
103  TRY(Hbb);
104  TRY(Hcc);
105  TRY(other_From_H);
106  TRY(HtautauEl);
107  TRY(HtautauMu);
108  TRY(HtautauHad);
109  TRY(ZtautauEl);
110  TRY(ZtautauMu);
111  TRY(ZtautauHad);
112 #undef TRY
113  return UNKNOWN;
114  }
115 }
116 
117 #endif
LargeRJetTruthLabel::TypeEnum
TypeEnum
Definition: LargeRJetLabelEnum.h:14
LargeRJetTruthLabel::UNKNOWN
@ UNKNOWN
Definition: LargeRJetLabelEnum.h:15
TRY
#define TRY(STRING)
LargeRJetTruthLabel::stringToEnum
TypeEnum stringToEnum(const TString &name)
Definition: LargeRJetLabelEnum.h:90
LargeRJetTruthLabel::other_From_t
@ other_From_t
Definition: LargeRJetLabelEnum.h:22
LargeRJetTruthLabel
Definition: LargeRJetLabelEnum.h:12
LargeRJetTruthLabel::Zqq
@ Zqq
Definition: LargeRJetLabelEnum.h:20
LargeRJetTruthLabel::qcd
@ qcd
Definition: LargeRJetLabelEnum.h:25
LargeRJetTruthLabel::ZtautauMu
@ ZtautauMu
Definition: LargeRJetLabelEnum.h:33
LargeRJetTruthLabel::Hbb
@ Hbb
Definition: LargeRJetLabelEnum.h:26
python.CaloAddPedShiftConfig.type
type
Definition: CaloAddPedShiftConfig.py:42
LargeRJetTruthLabel::notruth
@ notruth
Definition: LargeRJetLabelEnum.h:24
LargeRJetTruthLabel::HtautauMu
@ HtautauMu
Definition: LargeRJetLabelEnum.h:30
LargeRJetTruthLabel::Wqq
@ Wqq
Definition: LargeRJetLabelEnum.h:17
LargeRJetTruthLabel::HtautauEl
@ HtautauEl
Definition: LargeRJetLabelEnum.h:29
LargeRJetTruthLabel::Hcc
@ Hcc
Definition: LargeRJetLabelEnum.h:27
LargeRJetTruthLabel::Zbb
@ Zbb
Definition: LargeRJetLabelEnum.h:18
LargeRJetTruthLabel::HtautauHad
@ HtautauHad
Definition: LargeRJetLabelEnum.h:31
LargeRJetTruthLabel::Wqq_From_t
@ Wqq_From_t
Definition: LargeRJetLabelEnum.h:21
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
LargeRJetTruthLabel::other_From_V
@ other_From_V
Definition: LargeRJetLabelEnum.h:23
LargeRJetTruthLabel::ZtautauEl
@ ZtautauEl
Definition: LargeRJetLabelEnum.h:32
LargeRJetTruthLabel::intToEnum
TypeEnum intToEnum(const int type)
Definition: LargeRJetLabelEnum.h:63
LargeRJetTruthLabel::other_From_H
@ other_From_H
Definition: LargeRJetLabelEnum.h:28
LargeRJetTruthLabel::Zcc
@ Zcc
Definition: LargeRJetLabelEnum.h:19
LargeRJetTruthLabel::tqqb
@ tqqb
Definition: LargeRJetLabelEnum.h:16
LargeRJetTruthLabel::enumToInt
int enumToInt(const TypeEnum type)
Definition: LargeRJetLabelEnum.h:37
LargeRJetTruthLabel::ZtautauHad
@ ZtautauHad
Definition: LargeRJetLabelEnum.h:34