Belle II Software development
PXDClusterShapeIndexPar Class Reference

The class for PXD cluster shape index payload. More...

#include <PXDClusterShapeIndexPar.h>

Inheritance diagram for PXDClusterShapeIndexPar:

Public Member Functions

 PXDClusterShapeIndexPar ()
 Default constructor.
 
 ~PXDClusterShapeIndexPar ()
 Destructor.
 
void addShape (const std::string &name, int index)
 Add shape with name and index

 
int getShapeIndex (const std::string &name) const
 Returns shape index from name.
 
const std::string & getShapeName (int index) const
 Returns shape name from index.
 
const std::map< int, std::string > & getIndexMap () const
 Returns shape index from shape string.
 

Private Member Functions

 ClassDef (PXDClusterShapeIndexPar, 1)
 ClassDef, must be the last term before the closing {}.
 

Private Attributes

std::map< int, std::string > m_shapeIndexMap
 Map of shape names and indexes.
 

Detailed Description

The class for PXD cluster shape index payload.

Definition at line 24 of file PXDClusterShapeIndexPar.h.

Constructor & Destructor Documentation

◆ PXDClusterShapeIndexPar()

Default constructor.

Definition at line 27 of file PXDClusterShapeIndexPar.h.

27{}

◆ ~PXDClusterShapeIndexPar()

Destructor.

Definition at line 29 of file PXDClusterShapeIndexPar.h.

29{}

Member Function Documentation

◆ addShape()

void addShape ( const std::string &  name,
int  index 
)
inline

Add shape with name and index

Definition at line 32 of file PXDClusterShapeIndexPar.h.

33 {
34 m_shapeIndexMap[index] = name;
35 }
std::map< int, std::string > m_shapeIndexMap
Map of shape names and indexes.

◆ getIndexMap()

const std::map< int, std::string > & getIndexMap ( ) const
inline

Returns shape index from shape string.

Definition at line 53 of file PXDClusterShapeIndexPar.h.

54 {
55 return m_shapeIndexMap;
56 }

◆ getShapeIndex()

int getShapeIndex ( const std::string &  name) const
inline

Returns shape index from name.

Returns -1 for invalid name.

Definition at line 38 of file PXDClusterShapeIndexPar.h.

39 {
40 for (auto it = m_shapeIndexMap.begin(); it != m_shapeIndexMap.end(); ++it)
41 if (it->second == name)
42 return it->first;
43 return -1;
44 }

◆ getShapeName()

const std::string & getShapeName ( int  index) const
inline

Returns shape name from index.

Return 'None' for invalid index

Definition at line 47 of file PXDClusterShapeIndexPar.h.

48 {
49 return m_shapeIndexMap.at(index);
50 }

Member Data Documentation

◆ m_shapeIndexMap

std::map<int, std::string> m_shapeIndexMap
private

Map of shape names and indexes.

Definition at line 60 of file PXDClusterShapeIndexPar.h.


The documentation for this class was generated from the following file: