ATLAS Offline Software
TrackGradesDefinition.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 #include "GaudiKernel/MsgStream.h"
7 #include <utility>
8 #include <iostream>
9 
10 namespace Analysis {
11 
13 
14  TrackGradesDefinition::TrackGradesDefinition(std::vector<TrackGrade> & trackGradeList)
15  : m_gradeList(trackGradeList)
16  {}
17 
19 
21  : m_gradeList(rhs.m_gradeList)
22  {}
23 
25  {
26  if (this!=&rhs)
27  {
29  }
30  return *this;
31  }
32 
33  int TrackGradesDefinition::grade(const std::string & myString) const {
34 
35  for (const TrackGrade& grade : m_gradeList) {
36  const std::string & gradeString=grade.gradeString();
37 
38  if (gradeString==myString) {
39  return grade.gradeNumber();
40  }
41  }
42  return -1;
43  }
44 
45 
46  std::string TrackGradesDefinition::grade(int myNumber) const {
47 
48  for (const TrackGrade& grade : m_gradeList) {
49  int gradeNumber=grade.gradeNumber();
50 
51  if (gradeNumber==myNumber) {
52  return grade.gradeString();
53  }
54  }
55  return std::string("Undefined");
56  }
57 
58 
59  const TrackGrade * TrackGradesDefinition::getGrade(const std::string & myString) const
60  {
61 
62  for (const TrackGrade& grade : m_gradeList) {
63  const std::string & gradeString=grade.gradeString();
64 
65  if (gradeString==myString) {
66  return &grade;
67  }
68  }
69  return 0;
70  }
71 
72 
73  const TrackGrade * TrackGradesDefinition::getGrade(const int & myNumber) const
74  {
75 
76  for (const TrackGrade& grade : m_gradeList) {
77  int gradeNumber=grade.gradeNumber();
78 
79  if (gradeNumber==myNumber) {
80  return &grade;
81  }
82  }
83  return 0;
84  }
85 
86 }
87 
Analysis::TrackGrade
Definition: TrackGrade.h:11
Analysis::TrackGradesDefinition::getGrade
const TrackGrade * getGrade(const std::string &) const
Definition: TrackGradesDefinition.cxx:59
Analysis::TrackGradesDefinition
Definition: TrackGradesDefinition.h:15
Analysis::TrackGradesDefinition::TrackGradesDefinition
TrackGradesDefinition()
Definition: TrackGradesDefinition.cxx:12
TrackGradesDefinition.h
Analysis
The namespace of all packages in PhysicsAnalysis/JetTagging.
Definition: BTaggingCnvAlg.h:20
Analysis::TrackGradesDefinition::m_gradeList
std::vector< TrackGrade > m_gradeList
Definition: TrackGradesDefinition.h:43
Analysis::TrackGradesDefinition::operator=
TrackGradesDefinition & operator=(const TrackGradesDefinition &rhs)
assigenment operator
Definition: TrackGradesDefinition.cxx:24
Analysis::TrackGradesDefinition::~TrackGradesDefinition
virtual ~TrackGradesDefinition()
Definition: TrackGradesDefinition.cxx:18
Analysis::TrackGradesDefinition::grade
int grade(const std::string &) const
Definition: TrackGradesDefinition.cxx:33