ATLAS Offline Software
Static Public Member Functions | List of all members
HadronClass Class Reference

#include <HadronUtils.h>

Collaboration diagram for HadronClass:

Static Public Member Functions

static std::pair< short, short > type (int)
 
static bool HeavyHadron (int)
 

Detailed Description

Definition at line 10 of file HadronUtils.h.

Member Function Documentation

◆ HeavyHadron()

bool HadronClass::HeavyHadron ( int  pdg)
static

Definition at line 32 of file HadronUtils.cxx.

32  {
33  short typ = type(pdg).second;
34  short typh = type(pdg).first;
35  return (typh < 2 && (typ == 4 || typ == 5));
36 }

◆ type()

std::pair< short, short > HadronClass::type ( int  pdg)
static

Definition at line 10 of file HadronUtils.cxx.

10  {
11  short typeP = 0; // Flavor
12  short typeH = 2; // 0 : meson ; 1 : baryon ; 2 : other
13  std::ostringstream o; o << abs(pdg);
14  std::string s = o.str();
15  int ns = s.size();
16  if (ns >= 4) {
17  if (s.at(ns-4) != '0') {
18  typeH = 1;
19  typeP = atoi(s.substr(ns-4,1).c_str());
20  } else {
21  typeH = 0;
22  typeP = atoi(s.substr(ns-3,1).c_str());
23  }
24  } else if ( ns == 3 ) {
25  typeH = 0;
26  typeP = atoi(s.substr(0,1).c_str());
27  }
28 
29  return std::make_pair(typeH,typeP);
30 }

The documentation for this class was generated from the following files:
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
HadronClass::type
static std::pair< short, short > type(int)
Definition: HadronUtils.cxx:10
python.SystemOfUnits.ns
int ns
Definition: SystemOfUnits.py:130
CxxUtils::atoi
int atoi(std::string_view str)
Helper functions to unpack numbers decoded in string into integers and doubles The strings are requir...
Definition: Control/CxxUtils/Root/StringUtils.cxx:85