ATLAS Offline Software
JetContainerInfo.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 #include <string>
7 #include <map>
8 
9 namespace xAOD {
10 
11  namespace JetAlgorithmType {
12 
13  static const std::string c_unknownAlg = "UnknownAlg";
14 
20  static const std::map<std::string, ID> nameToIDmap = {
21  // Names in the ATLAS convention
30  // Names as FastJet understands them (in lower case)
35  { "cambridge_for_passive", JetAlgorithmType::cambridge_for_passive_algorithm },
36  { "genkt_for_passive", JetAlgorithmType::genkt_for_passive_algorithm },
39  // Technical entries
40  { "FastJetPlugin", JetAlgorithmType::plugin_algorithm },
42  };
43 
54  static const std::map<ID, std::string> idToNamemap = {
63  { JetAlgorithmType::plugin_algorithm, "FastJetPlugin" },
65  };
66 
67  const std::string& algName( ID id ) {
68 
69  auto itr = idToNamemap.find( id );
70  if( itr != idToNamemap.end() ) {
71  return itr->second;
72  }
73  return c_unknownAlg;
74  }
75 
76  ID algId( const std::string& n ) {
77 
78  auto itr = nameToIDmap.find( n );
79  if( itr != nameToIDmap.end() ) {
80  return itr->second;
81  }
83  }
84 
85  }// JetAlgorithmType namespace
86 
87  namespace JetInput {
88 
89  static const std::string c_unCategorized = "Uncategorized";
90 
96  static const std::map<std::string, Type> nameToTypemap = {
97  { "LCTopo", LCTopo },
98  { "EMTopo", EMTopo },
99  { "LCTopoOrigin", LCTopoOrigin },
100  { "EMTopoOrigin", EMTopoOrigin },
101  { "TopoTower", TopoTower },
102  { "Tower", Tower },
103  { "Jet", Jet },
104  { "Truth", Truth },
105  { "TruthWZ", TruthWZ },
106  { "TruthDressedWZ", TruthDressedWZ },
107  { "TruthCharged", TruthCharged },
108  { "Track", Track },
109  { "PFlow", PFlow },
110  { "LCPFlow", LCPFlow },
111  { "EMPFlow", EMPFlow },
112  { "EMCPFlow", EMCPFlow },
113  { "EMPFlowByVertex", EMPFlowByVertex },
114  { "TrackCaloCluster", TrackCaloCluster },
115  { "EMTopoOriginSK", EMTopoOriginSK },
116  { "EMTopoOriginCS", EMTopoOriginCS },
117  { "EMTopoOriginCSSK", EMTopoOriginCSSK },
118  { "EMTopoOriginVorSK", EMTopoOriginVorSK },
119  { "EMTopoOriginTime", EMTopoOriginTime },
120  { "EMTopoOriginSKTime", EMTopoOriginSKTime },
121  { "EMTopoOriginCSSKTime", EMTopoOriginCSSKTime },
122  { "EMTopoOriginVorSKTime", EMTopoOriginVorSKTime },
123  { "LCTopoOriginSK", LCTopoOriginSK },
124  { "LCTopoOriginCS", LCTopoOriginCS },
125  { "LCTopoOriginCSSK", LCTopoOriginCSSK },
126  { "LCTopoOriginVorSK", LCTopoOriginVorSK },
127  { "EMPFlowSK", EMPFlowSK },
128  { "EMPFlowCS", EMPFlowCS },
129  { "EMPFlowCSSK", EMPFlowCSSK },
130  { "EMPFlowVorSK", EMPFlowVorSK },
131  { "EMPFlowTime", EMPFlowTime },
132  { "EMPFlowSKTime", EMPFlowSKTime },
133  { "EMPFlowCSSKTime", EMPFlowCSSKTime },
134  { "EMPFlowVorSKTime", EMPFlowVorSKTime },
135  { "HI", HI },
136  { "HIClusters", HIClusters },
137  { "PFlowCustomVtx", PFlowCustomVtx},
138  { c_unCategorized, Uncategorized }
139  };
140 
148  static const std::map<Type, std::string> typeToNamemap {
149  { LCTopo, "LCTopo" },
150  { EMTopo, "EMTopo" },
151  { LCTopoOrigin, "LCTopoOrigin" },
152  { EMTopoOrigin, "EMTopoOrigin" },
153  { TopoTower, "TopoTower" },
154  { Tower, "Tower" },
155  { Jet, "Jet" },
156  { Truth, "Truth" },
157  { TruthWZ, "TruthWZ" },
158  { TruthDressedWZ, "TruthDressedWZ" },
159  { TruthCharged, "TruthCharged" },
160  { Track, "Track" },
161  { PFlow, "PFlow" },
162  { LCPFlow, "LCPFlow" },
163  { EMPFlow, "EMPFlow" },
164  { EMCPFlow, "EMCPFlow" },
165  { EMPFlowByVertex, "EMPFlowByVertex" },
166  { TrackCaloCluster, "TrackCaloCluster" },
167  { EMTopoOriginSK, "EMTopoOriginSK" },
168  { EMTopoOriginCS, "EMTopoOriginCS" },
169  { EMTopoOriginCSSK, "EMTopoOriginCSSK" },
170  { EMTopoOriginVorSK, "EMTopoOriginVorSK" },
171  { EMTopoOriginTime, "EMTopoOriginTime" },
172  { EMTopoOriginSKTime, "EMTopoOriginSKTime" },
173  { EMTopoOriginCSSKTime, "EMTopoOriginCSSKTime" },
174  { EMTopoOriginVorSKTime, "EMTopoOriginVorSKTime" },
175  { LCTopoOriginSK, "LCTopoOriginSK" },
176  { LCTopoOriginCS, "LCTopoOriginCS" },
177  { LCTopoOriginCSSK, "LCTopoOriginCSSK" },
178  { LCTopoOriginVorSK, "LCTopoOriginVorSK" },
179  { EMPFlowSK, "EMPFlowSK" },
180  { EMPFlowCS, "EMPFlowCS" },
181  { EMPFlowCSSK, "EMPFlowCSSK" },
182  { EMPFlowVorSK, "EMPFlowVorSK" },
183  { EMPFlowTime, "EMPFlowTime" },
184  { EMPFlowSKTime, "EMPFlowSKTime" },
185  { EMPFlowCSSKTime, "EMPFlowCSSKTime" },
186  { EMPFlowVorSKTime, "EMPFlowVorSKTime" },
187  { HI, "HI" },
188  { HIClusters, "HIClusters" },
189  { PFlowCustomVtx, "PFlowCustomVtx"},
190  { Uncategorized, c_unCategorized }
191  };
192 
194 
195  auto itr = typeToNamemap.find( t );
196  return ( ( itr != typeToNamemap.end() ) && ( t != Uncategorized ) );
197  }
198 
199  const std::string& typeName( Type id ) {
200 
201  auto itr = typeToNamemap.find( id );
202  if( itr != typeToNamemap.end() ) {
203  return itr->second;
204  }
205  return c_unCategorized;
206  }
207 
208  Type inputType( const std::string& n ) {
209 
210  auto itr = nameToTypemap.find( n );
211  if( itr != nameToTypemap.end() ) {
212  return itr->second;
213  }
214  return Uncategorized;
215  }
216 
217  } // namespace JetInput
218 
219  namespace JetTransform {
220 
221  std::string name(Type type) {
222  switch(type) {
223  case UnknownTransform: return "UnknownTransform";
224  case NoTransform: return "NoTransform";
225  case Trim: return "Trim";
226  case Prune: return "Prune";
227  case MassDrop: return "MassDrop";
228  case KtRecluster: return "KtRecluster";
229  case CamKtRecluster: return "CamKtRecluster";
230  case AntiKtRecluster: return "AntiKtRecluster";
231  }
232  return "UnknownTransform";
233  }
234 
235  Type type(const std::string& name) {
236  if ( name == "UnknownTransform" ) return NoTransform;
237  if ( name == "NoTransform" ) return NoTransform;
238  if ( name == "Trim" ) return Trim;
239  if ( name == "Prune" ) return Prune;
240  if ( name == "MassDrop" ) return MassDrop;
241  if ( name == "KtRecluster" ) return KtRecluster;
242  if ( name == "CamKtRecluster" ) return CamKtRecluster;
243  if ( name == "AntiKtRecluster" ) return AntiKtRecluster;
244  return UnknownTransform;
245  }
246 
247  } // end namespace JetTransform
248 
249 }
xAOD::JetInput::PFlowCustomVtx
@ PFlowCustomVtx
Definition: JetContainerInfo.h:97
xAOD::JetInput::LCTopoOrigin
@ LCTopoOrigin
Definition: JetContainerInfo.h:67
xAOD::JetInput::EMPFlowVorSKTime
@ EMPFlowVorSKTime
Definition: JetContainerInfo.h:94
xAOD::JetInput::LCTopoOriginCSSK
@ LCTopoOriginCSSK
Definition: JetContainerInfo.h:79
xAOD::JetInput::HIClusters
@ HIClusters
Definition: JetContainerInfo.h:96
JetContainerInfo.h
xAOD::JetInput::PFlow
@ PFlow
Definition: JetContainerInfo.h:62
xAOD::JetAlgorithmType::ee_genkt_algorithm
@ ee_genkt_algorithm
Definition: JetContainerInfo.h:38
xAOD::JetAlgorithmType::kt_algorithm
@ kt_algorithm
Definition: JetContainerInfo.h:31
xAOD::JetInput::LCTopoOriginCS
@ LCTopoOriginCS
Definition: JetContainerInfo.h:77
xAOD::JetInput::EMTopoOriginVorSK
@ EMTopoOriginVorSK
Definition: JetContainerInfo.h:75
xAOD::JetAlgorithmType::algName
const std::string & algName(ID id)
Converts a JetAlgorithmType::ID into a string.
Definition: JetContainerInfo.cxx:67
xAOD::TrackCaloCluster_v1
Class describing a TrackCaloCluster.
Definition: TrackCaloCluster_v1.h:25
xAOD::JetInput::EMTopoOriginSK
@ EMTopoOriginSK
Definition: JetContainerInfo.h:71
xAOD::JetInput::EMTopoOriginCSSK
@ EMTopoOriginCSSK
Definition: JetContainerInfo.h:74
xAOD::JetInput::Track
@ Track
Definition: JetContainerInfo.h:61
xAOD::JetInput::EMTopoOriginCSSKTime
@ EMTopoOriginCSSKTime
Definition: JetContainerInfo.h:89
xAOD::JetInput::EMTopoOriginTime
@ EMTopoOriginTime
Definition: JetContainerInfo.h:87
xAOD
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Definition: ICaloAffectedTool.h:24
xAOD::JetInput::LCTopoOriginVorSK
@ LCTopoOriginVorSK
Definition: JetContainerInfo.h:80
xAOD::JetAlgorithmType::ee_kt_algorithm
@ ee_kt_algorithm
Definition: JetContainerInfo.h:37
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
xAOD::JetInput::typeName
const std::string & typeName(Type id)
Definition: JetContainerInfo.cxx:199
xAOD::JetInput::isValidConstitType
bool isValidConstitType(Type t)
Definition: JetContainerInfo.cxx:193
xAOD::JetInput::LCTopo
@ LCTopo
Definition: JetContainerInfo.h:55
xAOD::JetInput::EMPFlowByVertex
@ EMPFlowByVertex
Definition: JetContainerInfo.h:98
xAOD::JetInput::inputType
Type inputType(const std::string &n)
Definition: JetContainerInfo.cxx:208
xAOD::JetInput::TruthDressedWZ
@ TruthDressedWZ
Definition: JetContainerInfo.h:70
xAOD::JetInput::EMPFlowCSSKTime
@ EMPFlowCSSKTime
Definition: JetContainerInfo.h:93
xAOD::JetAlgorithmType::cambridge_for_passive_algorithm
@ cambridge_for_passive_algorithm
Definition: JetContainerInfo.h:35
xAOD::JetInput::EMTopoOrigin
@ EMTopoOrigin
Definition: JetContainerInfo.h:68
Truth
Definition: ITruthClassificationTool.h:16
xAOD::JetAlgorithmType::plugin_algorithm
@ plugin_algorithm
Definition: JetContainerInfo.h:39
xAOD::JetAlgorithmType::genkt_algorithm
@ genkt_algorithm
Definition: JetContainerInfo.h:34
xAOD::JetInput::LCPFlow
@ LCPFlow
Definition: JetContainerInfo.h:63
xAOD::JetTransform::NoTransform
@ NoTransform
Definition: JetContainerInfo.h:114
xAOD::JetInput::TruthWZ
@ TruthWZ
Definition: JetContainerInfo.h:60
xAOD::JetInput::EMTopoOriginCS
@ EMTopoOriginCS
Definition: JetContainerInfo.h:72
xAOD::JetInput::EMPFlowCSSK
@ EMPFlowCSSK
Definition: JetContainerInfo.h:84
xAOD::JetInput::TruthCharged
@ TruthCharged
Definition: JetContainerInfo.h:86
xAOD::JetTransform::AntiKtRecluster
@ AntiKtRecluster
Definition: JetContainerInfo.h:120
beamspotman.n
n
Definition: beamspotman.py:731
PFlow
Definition: PFlow.py:1
xAOD::JetInput::TrackCaloCluster
@ TrackCaloCluster
Definition: JetContainerInfo.h:69
xAOD::JetInput::Truth
@ Truth
Definition: JetContainerInfo.h:59
xAOD::JetAlgorithmType::ID
ID
//////////////////////////////////////// JetAlgorithmType::ID defines most common physics jet finding...
Definition: JetContainerInfo.h:29
xAOD::JetAlgorithmType::undefined_jet_algorithm
@ undefined_jet_algorithm
Definition: JetContainerInfo.h:40
xAODType
Definition: ObjectType.h:13
xAOD::JetInput::EMPFlow
@ EMPFlow
Definition: JetContainerInfo.h:64
xAOD::JetTransform::MassDrop
@ MassDrop
Definition: JetContainerInfo.h:117
xAOD::JetInput::HI
@ HI
Definition: JetContainerInfo.h:95
xAOD::JetTransform::type
Type type(const std::string &name)
Convert string to jet transformation enum.
Definition: JetContainerInfo.cxx:235
HI
Definition: HIEventDefs.h:14
xAOD::JetTransform::KtRecluster
@ KtRecluster
Definition: JetContainerInfo.h:118
xAOD::JetAlgorithmType::genkt_for_passive_algorithm
@ genkt_for_passive_algorithm
Definition: JetContainerInfo.h:36
xAOD::JetInput::EMTopoOriginSKTime
@ EMTopoOriginSKTime
Definition: JetContainerInfo.h:88
xAOD::JetInput::EMPFlowCS
@ EMPFlowCS
Definition: JetContainerInfo.h:82
xAOD::JetInput::EMPFlowTime
@ EMPFlowTime
Definition: JetContainerInfo.h:91
xAOD::JetAlgorithmType::cambridge_algorithm
@ cambridge_algorithm
Definition: JetContainerInfo.h:32
xAOD::JetInput::EMPFlowSKTime
@ EMPFlowSKTime
Definition: JetContainerInfo.h:92
xAOD::JetAlgorithmType::antikt_algorithm
@ antikt_algorithm
Definition: JetContainerInfo.h:33
xAOD::JetInput::EMTopo
@ EMTopo
Definition: JetContainerInfo.h:56
xAOD::JetTransform::Trim
@ Trim
Definition: JetContainerInfo.h:115
xAOD::Jet_v1
Class describing a jet.
Definition: Jet_v1.h:57
xAOD::JetTransform::Prune
@ Prune
Definition: JetContainerInfo.h:116
xAOD::JetTransform::name
std::string name(Type type)
Convert jet transformation enum to string.
Definition: JetContainerInfo.cxx:221
xAOD::JetInput::LCTopoOriginSK
@ LCTopoOriginSK
Definition: JetContainerInfo.h:76
xAOD::JetAlgorithmType::algId
ID algId(const std::string &n)
Converts a string into a JetAlgorithmType::ID.
Definition: JetContainerInfo.cxx:76
xAOD::JetInput::EMTopoOriginVorSKTime
@ EMTopoOriginVorSKTime
Definition: JetContainerInfo.h:90
Track
Definition: TriggerChamberClusterOnTrackCreator.h:21
xAOD::JetInput::EMPFlowSK
@ EMPFlowSK
Definition: JetContainerInfo.h:81
xAOD::JetInput::EMCPFlow
@ EMCPFlow
Definition: JetContainerInfo.h:65
xAOD::JetInput::TopoTower
@ TopoTower
Definition: JetContainerInfo.h:57
xAOD::JetInput::EMPFlowVorSK
@ EMPFlowVorSK
Definition: JetContainerInfo.h:85
xAOD::JetTransform::UnknownTransform
@ UnknownTransform
Definition: JetContainerInfo.h:113
xAOD::JetTransform::CamKtRecluster
@ CamKtRecluster
Definition: JetContainerInfo.h:119
xAOD::JetInput::Tower
@ Tower
Definition: JetContainerInfo.h:58
xAOD::JetInput::Jet
@ Jet
Definition: JetContainerInfo.h:66
xAOD::JetInput::Uncategorized
@ Uncategorized
Definition: JetContainerInfo.h:100