CMS 3D CMS Logo

GlobalObject.cc
Go to the documentation of this file.
1 
15 // this class header
17 
18 // system include files
19 #include <cstring>
20 
21 // user include files
23 
24 using namespace l1t;
25 
27  static const l1t::L1TGtObjectStringToEnum l1TGtObjectStringToEnumMap[] = {{"Mu", gtMu},
28  {"EG", gtEG},
29  {"Tau", gtTau},
30  {"Jet", gtJet},
31  {"ETM", gtETM},
32  {"ETT", gtETT},
33  {"HTT", gtHTT},
34  {"HTM", gtHTM},
35  {"ETMHF", gtETMHF},
36  {"TowerCount", gtTowerCount},
37  {"MinBiasHFP0", gtMinBiasHFP0},
38  {"MinBiasHFM0", gtMinBiasHFM0},
39  {"MinBiasHFP1", gtMinBiasHFP1},
40  {"MinBiasHFM1", gtMinBiasHFM1},
41  {"ETTem", gtETTem},
42  {"AsymEt", gtAsymmetryEt},
43  {"AsymHt", gtAsymmetryHt},
44  {"AsymEtHF", gtAsymmetryEtHF},
45  {"AsymEtHF", gtAsymmetryHtHF},
46  {"CENT0", gtCentrality0},
47  {"CENT1", gtCentrality1},
48  {"CENT2", gtCentrality2},
49  {"CENT3", gtCentrality3},
50  {"CENT4", gtCentrality4},
51  {"CENT5", gtCentrality5},
52  {"CENT6", gtCentrality6},
53  {"CENT7", gtCentrality7},
54  {"External", gtExternal},
55  {"ObjNull", ObjNull},
56  {nullptr, (GlobalObject)-1}};
57 
59 
60  bool found = false;
61  for (int i = 0; l1TGtObjectStringToEnumMap[i].label && (!found); ++i)
62  if (!std::strcmp(label.c_str(), l1TGtObjectStringToEnumMap[i].label)) {
63  found = true;
64  value = l1TGtObjectStringToEnumMap[i].value;
65  }
66 
67  // in case of unrecognized GlobalObject, returns Mu
68  // and write a warning (to not throw an exception)
69  if (!found) {
70  edm::LogInfo("L1TGlobal") << "\n '" << label << "' is not a recognized GlobalObject. \n Return ObjNull.";
71 
72  value = ObjNull;
73  }
74 
75  if (value == ObjNull) {
76  edm::LogInfo("L1TGlobal") << "\n ObjNull means no valid GlobalObject defined!";
77  }
78 
79  return value;
80 }
81 
83  std::string gtObjectString;
84 
85  switch (gtObject) {
86  case gtMu: {
87  gtObjectString = "Mu";
88  } break;
89 
90  case gtEG: {
91  gtObjectString = "EG";
92  } break;
93 
94  case gtTau: {
95  gtObjectString = "Tau";
96  } break;
97 
98  case gtJet: {
99  gtObjectString = "Jet";
100  } break;
101 
102  case gtETM: {
103  gtObjectString = "ETM";
104  } break;
105 
106  case gtETT: {
107  gtObjectString = "ETT";
108  } break;
109 
110  case gtHTT: {
111  gtObjectString = "HTT";
112  } break;
113 
114  case gtHTM: {
115  gtObjectString = "HTM";
116  } break;
117 
118  case gtETMHF: {
119  gtObjectString = "ETMHF";
120  } break;
121 
122  case gtTowerCount: {
123  gtObjectString = "TowerCount";
124  } break;
125 
126  case gtMinBiasHFP0: {
127  gtObjectString = "MinBiasHFP0";
128  } break;
129 
130  case gtMinBiasHFM0: {
131  gtObjectString = "MinBiasHFM0";
132  } break;
133 
134  case gtMinBiasHFP1: {
135  gtObjectString = "MinBiasHFP1";
136  } break;
137 
138  case gtMinBiasHFM1: {
139  gtObjectString = "MinBiasHFM1";
140  } break;
141 
142  case gtETTem: {
143  gtObjectString = "ETTem";
144  } break;
145 
146  case gtAsymmetryEt: {
147  gtObjectString = "AsymEt";
148  } break;
149 
150  case gtAsymmetryHt: {
151  gtObjectString = "AsymHt";
152  } break;
153 
154  case gtAsymmetryEtHF: {
155  gtObjectString = "AsymEtHF";
156  } break;
157 
158  case gtAsymmetryHtHF: {
159  gtObjectString = "AsymHtHF";
160  } break;
161 
162  case gtCentrality0: {
163  gtObjectString = "CENT0";
164  } break;
165 
166  case gtCentrality1: {
167  gtObjectString = "CENT1";
168  } break;
169 
170  case gtCentrality2: {
171  gtObjectString = "CENT2";
172  } break;
173 
174  case gtCentrality3: {
175  gtObjectString = "CENT3";
176  } break;
177 
178  case gtCentrality4: {
179  gtObjectString = "CENT4";
180  } break;
181 
182  case gtCentrality5: {
183  gtObjectString = "CENT5";
184  } break;
185 
186  case gtCentrality6: {
187  gtObjectString = "CENT6";
188  } break;
189 
190  case gtCentrality7: {
191  gtObjectString = "CENT7";
192  } break;
193 
194  case gtExternal: {
195  gtObjectString = "External";
196  } break;
197 
198  case ObjNull: {
199  gtObjectString = "ObjNull";
200  edm::LogInfo("L1TGlobal") << "\n ObjNull means no valid GlobalObject defined!";
201  } break;
202 
203  default: {
204  edm::LogInfo("L1TGlobal") << "\n '" << gtObject << "' is not a recognized GlobalObject. "
205  << "\n Return ObjNull, which means no valid GlobalObject defined!";
206 
207  gtObjectString = "ObjNull";
208 
209  } break;
210  }
211 
212  return gtObjectString;
213 }
l1t::gtHTM
Definition: GlobalObject.h:24
l1t::l1TGtObjectEnumToString
std::string l1TGtObjectEnumToString(const GlobalObject &)
Definition: GlobalObject.cc:82
l1t::gtCentrality0
Definition: GlobalObject.h:36
l1t::gtExternal
Definition: GlobalObject.h:44
mps_fire.i
i
Definition: mps_fire.py:428
MessageLogger.h
l1t::gtEG
Definition: GlobalObject.h:18
l1t::L1TGtObjectStringToEnum
the string to enum and enum to string conversions for GlobalObject
Definition: GlobalObject.h:50
l1t::gtETTem
Definition: GlobalObject.h:31
GlobalObject.h
l1t::gtMinBiasHFP1
Definition: GlobalObject.h:29
l1t::gtMinBiasHFM1
Definition: GlobalObject.h:30
l1t::gtAsymmetryEt
Definition: GlobalObject.h:32
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
l1t::ObjNull
Definition: GlobalObject.h:45
newFWLiteAna.found
found
Definition: newFWLiteAna.py:118
l1t::gtCentrality5
Definition: GlobalObject.h:41
l1t::gtCentrality7
Definition: GlobalObject.h:43
l1t::gtAsymmetryHt
Definition: GlobalObject.h:33
l1t::gtCentrality4
Definition: GlobalObject.h:40
l1t::gtJet
Definition: GlobalObject.h:19
l1t::gtTowerCount
Definition: GlobalObject.h:26
GlobalObject
l1t::l1TGtObjectStringToEnum
l1t::GlobalObject l1TGtObjectStringToEnum(const std::string &)
Definition: GlobalObject.cc:26
l1t::gtETMHF
Definition: GlobalObject.h:25
l1t::gtHTT
Definition: GlobalObject.h:23
l1t::gtCentrality1
Definition: GlobalObject.h:37
l1t::gtETM
Definition: GlobalObject.h:21
l1t::gtMu
Definition: GlobalObject.h:17
l1t::L1TGtObjectStringToEnum::value
GlobalObject value
Definition: GlobalObject.h:52
l1t
delete x;
Definition: CaloConfig.h:22
l1t::gtAsymmetryEtHF
Definition: GlobalObject.h:34
l1t::gtCentrality6
Definition: GlobalObject.h:42
l1t::gtMinBiasHFP0
Definition: GlobalObject.h:27
value
Definition: value.py:1
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
l1t::GlobalObject
GlobalObject
Definition: GlobalObject.h:16
l1t::gtETT
Definition: GlobalObject.h:22
l1t::gtCentrality3
Definition: GlobalObject.h:39
relativeConstraints.value
value
Definition: relativeConstraints.py:53
l1t::gtTau
Definition: GlobalObject.h:20
l1t::gtMinBiasHFM0
Definition: GlobalObject.h:28
l1t::gtCentrality2
Definition: GlobalObject.h:38
label
const char * label
Definition: PFTauDecayModeTools.cc:11
l1t::L1TGtObjectStringToEnum::label
const char * label
Definition: GlobalObject.h:51
l1t::gtAsymmetryHtHF
Definition: GlobalObject.h:35