ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
Analysis::TrackGradePartition Class Reference

#include <GradedTrack.h>

Collaboration diagram for Analysis::TrackGradePartition:

Public Member Functions

 TrackGradePartition ()
 
 TrackGradePartition (const std::string &, const ITrackGradeFactory &)
 
 ~TrackGradePartition ()
 
void add (const TrackGrade &)
 
const std::vector< TrackGrade > & grades () const
 
const std::string suffix () const
 
int size () const
 

Private Attributes

std::vector< TrackGradem_grades
 

Detailed Description

Definition at line 43 of file GradedTrack.h.

Constructor & Destructor Documentation

◆ TrackGradePartition() [1/2]

Analysis::TrackGradePartition::TrackGradePartition ( )

Definition at line 23 of file GradedTrack.cxx.

23  {
24  }

◆ TrackGradePartition() [2/2]

Analysis::TrackGradePartition::TrackGradePartition ( const std::string &  definition,
const ITrackGradeFactory trackGradeFactory 
)

Definition at line 26 of file GradedTrack.cxx.

27  {
28 
29  const TrackGradesDefinition & myTrackGradesDefinition = trackGradeFactory.getTrackGradesDefinition();
30 
31  // parse definition to extract grades separated by + sign:
32  const std::string delim("+");
33  std::string::size_type sPos, sEnd, sLen;
34  sPos = definition.find_first_not_of(delim);
35  while ( sPos != std::string::npos ) {
36  sEnd = definition.find_first_of(delim, sPos);
37  if(sEnd==std::string::npos) sEnd = definition.length();
38  sLen = sEnd - sPos;
39  std::string grade = definition.substr(sPos,sLen);
40  // add new grade to this partition:
41  const TrackGrade* tgrade(myTrackGradesDefinition.getGrade(grade));
42  if (tgrade==0)
43  {
44  throw std::string("#BTAG# Error: the following grade ") + grade + std::string(" could not be found in the list from TrackGradeFactory ");
45  }
46  m_grades.push_back(TrackGrade(*tgrade));
47  sPos = definition.find_first_not_of(delim, sEnd);
48  }
49  }

◆ ~TrackGradePartition()

Analysis::TrackGradePartition::~TrackGradePartition ( )

Definition at line 51 of file GradedTrack.cxx.

51  {
52  }

Member Function Documentation

◆ add()

void Analysis::TrackGradePartition::add ( const TrackGrade grade)

Definition at line 54 of file GradedTrack.cxx.

54  {
55  m_grades.push_back(grade);
56  }

◆ grades()

const std::vector< TrackGrade > & Analysis::TrackGradePartition::grades ( ) const

Definition at line 58 of file GradedTrack.cxx.

58  {
59  return m_grades;
60  }

◆ size()

int Analysis::TrackGradePartition::size ( ) const

Definition at line 74 of file GradedTrack.cxx.

74  {
75  return m_grades.size();
76  }

◆ suffix()

const std::string Analysis::TrackGradePartition::suffix ( ) const

Definition at line 62 of file GradedTrack.cxx.

62  {
63  std::string suf("");
64  for(uint i=0;i<m_grades.size();i++) {
65  if(0==i) {
66  suf += m_grades[i].gradeString();
67  } else {
68  suf += ("_" + m_grades[i].gradeString());
69  }
70  }
71  return suf;
72  }

Member Data Documentation

◆ m_grades

std::vector<TrackGrade> Analysis::TrackGradePartition::m_grades
private

Definition at line 53 of file GradedTrack.h.


The documentation for this class was generated from the following files:
uint
unsigned int uint
Definition: LArOFPhaseFill.cxx:20
lumiFormat.i
int i
Definition: lumiFormat.py:85
Analysis::TrackGradePartition::m_grades
std::vector< TrackGrade > m_grades
Definition: GradedTrack.h:53