ATLAS Offline Software
Loading...
Searching...
No Matches
SmallRJetPileupLabelEnum.h
Go to the documentation of this file.
1// Dear emacs, this is -*- c++ -*-
2/*
3 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
4*/
5#ifndef PARTICLEJETTOOLS_SMALLRJETPILEUPLABELENUM_H
6#define PARTICLEJETTOOLS_SMALLRJETPILEUPLABELENUM_H
7
8// ROOT include(s).
9#include <TString.h>
10
12{
13 enum TypeEnum : int
14 {
15 HS = 0, // HS match
16 MixHS, // multiple HS matches
17 HSPU, // HS and PU matches
18 ITPU, // In time PU match
19 MixPU, // Multiple PU matches
20 OOTPU, // Out of time PU match
21 Unknown, // Other
22 };
23
24 inline int enumToInt(const TypeEnum type)
25 {
26 return static_cast<std::underlying_type_t< TypeEnum >>(type);
27 }
28
29 inline TypeEnum stringToEnum(const TString& name)
30 {
31#define TRY(STRING) if (name.EqualTo(#STRING, TString::kIgnoreCase)) return STRING
32 TRY(HS);
33 TRY(MixHS);
34 TRY(HSPU);
35 TRY(ITPU);
36 TRY(MixPU);
37 TRY(OOTPU);
38 TRY(Unknown);
39#undef TRY
40 return Unknown;
41 }
42}
43
44#endif
#define TRY(STRING)
TypeEnum stringToEnum(const TString &name)
int enumToInt(const TypeEnum type)