Belle II Software  release-08-01-10
BeamBGTypes Class Reference

Class to define BG types and to convert between BG types and tags or v.v. More...

#include <BeamBGTypes.h>

Collaboration diagram for BeamBGTypes:

Public Member Functions

 BeamBGTypes ()
 Constructor.
 
BackgroundMetaData::BG_TAG getTag (const std::string &bgType)
 Return BG tag for a given BG type. More...
 
std::string getType (BackgroundMetaData::BG_TAG bgTag) const
 Return BG type for a given BG tag. More...
 
std::string getType (unsigned int bgTag) const
 Return BG type for a given number. More...
 
std::string getBGTypes () const
 Return all defined BG types as a string. More...
 

Private Attributes

std::map< std::string, BackgroundMetaData::BG_TAGm_tags
 a map of BG tags
 

Detailed Description

Class to define BG types and to convert between BG types and tags or v.v.

Designed primarely for BeamBkgTagSetter and BeamBkgMixer modules Suitable also to convert backgroundTag in SimHit classes to name (BG type)

Definition at line 27 of file BeamBGTypes.h.

Member Function Documentation

◆ getBGTypes()

std::string getBGTypes ( ) const
inline

Return all defined BG types as a string.

Returns
BG type names separated by comma

Definition at line 111 of file BeamBGTypes.h.

112  {
113  std::string types;
114  for (auto tag : m_tags) {
115  if (tag.first != "other" && tag.second != 0) types += tag.first + ", ";
116  }
117  types += "other";
118  return types;
119  }
std::map< std::string, BackgroundMetaData::BG_TAG > m_tags
a map of BG tags
Definition: BeamBGTypes.h:123

◆ getTag()

BackgroundMetaData::BG_TAG getTag ( const std::string &  bgType)
inline

Return BG tag for a given BG type.

Parameters
bgTypeBG type name
Returns
BG tag value

Definition at line 74 of file BeamBGTypes.h.

◆ getType() [1/2]

std::string getType ( BackgroundMetaData::BG_TAG  bgTag) const
inline

Return BG type for a given BG tag.

Parameters
bgTagBG tag value
Returns
BG type name or empty string

Definition at line 84 of file BeamBGTypes.h.

◆ getType() [2/2]

std::string getType ( unsigned int  bgTag) const
inline

Return BG type for a given number.

Parameters
bgTagBG tag value
Returns
BG type name or empty string

Definition at line 98 of file BeamBGTypes.h.


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