ATLAS Offline Software
Loading...
Searching...
No Matches
LabelIndex.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
5// LabelIndex.h
6
7#ifndef jet__LabelIndex
8#define jet__LabelIndex
9
10// David Adams
11// January 13, 2014
12//
13// Bi-directional map assigning indices to string labels.
14
15#include <vector>
16#include <string>
17#include "xAODCore/CLASS_DEF.h"
18#include "xAODJet/JetTypes.h"
19
20namespace jet {
21
23
24public:
25
26 typedef std::string Label;
27 typedef unsigned int Index;
28
30 explicit LabelIndex(Label nam);
31
35 Index addLabel(const Label& lab);
36
38 const Label& name() const;
39
42 Label label(Index idx) const;
43
46 Index index(const Label& lab) const;
47
50
52 Index size() const ;
53
54private:
55
56 // Hide ctors and copy.
57 explicit LabelIndex(const LabelIndex& nam);
58 LabelIndex& operator=(const Label& nam);
59
60 // Data.
62 std::vector<Label> m_labs;
63 std::vector<xAOD::JetConstitScale> m_constitScales;
64
65};
66
67} // end namespace jet
68
69CLASS_DEF( jet::LabelIndex , 94979360 , 1 )
70
71#endif
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
File providing the different SG_BASE macros.
Index addLabel(const Label &lab)
Add a label and get its index.
std::vector< xAOD::JetConstitScale > m_constitScales
Definition LabelIndex.h:63
const Label & name() const
Return the name of this map.
Index size() const
Number of label stored in this map. WARNING the index starts at 1, so range is [1....
std::string Label
Definition LabelIndex.h:26
unsigned int Index
Definition LabelIndex.h:27
LabelIndex(Label nam)
Ctor.
Label label(Index idx) const
Fetch the label for an index.
LabelIndex & operator=(const Label &nam)
xAOD::JetConstitScale constitScale(Index idx) const
Fetch the constit scale corresponding to the index.
std::vector< Label > m_labs
Definition LabelIndex.h:62
Definition index.py:1
JetConstitScale
Definition JetTypes.h:20