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

Implementation of classification functions according to PDG2022. More...

#include <AtlasPID.h>

Inheritance diagram for DecodedPID:
Collaboration diagram for DecodedPID:

Public Member Functions

 DecodedPID (const int &p)
 
DecodedPID shift (const size_t n) const
 
const int & operator() (const size_t n) const
 
const int & last () const
 
const int & pid () const
 
int max_digit (const int m, const int n) const
 
int min_digit (const int m, const int n) const
 
size_t ndigits () const
 

Detailed Description

Implementation of classification functions according to PDG2022.

https://pdg.lbl.gov/2023/reviews/rpp2022-rev-monte-carlo-numbering.pdf This code is also available at https://gitlab.cern.ch/averbyts/atlaspid

Definition at line 16 of file AtlasPID.h.

Constructor & Destructor Documentation

◆ DecodedPID()

DecodedPID::DecodedPID ( const int &  p)
inline

Definition at line 18 of file AtlasPID.h.

18  {
19  this->first=p;
20  this->second.reserve(10);
21  int ap = std::abs(p);
22  for(; ap; ap/=10) this->second.push_back( ap%10 );
23  std::reverse(this->second.begin(), this->second.end());
24  }

Member Function Documentation

◆ last()

const int& DecodedPID::last ( ) const
inline

Definition at line 27 of file AtlasPID.h.

27 { return this->second.back();}

◆ max_digit()

int DecodedPID::max_digit ( const int  m,
const int  n 
) const
inline

Definition at line 29 of file AtlasPID.h.

29 { return *std::max_element(second.rbegin() + m, second.rbegin() + n);}

◆ min_digit()

int DecodedPID::min_digit ( const int  m,
const int  n 
) const
inline

Definition at line 30 of file AtlasPID.h.

30 { return *std::min_element(second.rbegin() + m, second.rbegin() + n);}

◆ ndigits()

size_t DecodedPID::ndigits ( ) const
inline

Definition at line 31 of file AtlasPID.h.

31 { return this->second.size();}

◆ operator()()

const int& DecodedPID::operator() ( const size_t  n) const
inline

Definition at line 26 of file AtlasPID.h.

26 { return this->second.at(n);}

◆ pid()

const int& DecodedPID::pid ( ) const
inline

Definition at line 28 of file AtlasPID.h.

28 { return this->first;}

◆ shift()

DecodedPID DecodedPID::shift ( const size_t  n) const
inline

Definition at line 25 of file AtlasPID.h.

25 { return DecodedPID(this->first%int(std::pow(10,ndigits()-n)));}

The documentation for this class was generated from the following file:
python.SystemOfUnits.second
int second
Definition: SystemOfUnits.py:120
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
conifer::pow
constexpr int pow(int x)
Definition: conifer.h:20
python.AtlRunQueryParser.ap
ap
Definition: AtlRunQueryParser.py:826
DeMoUpdate.reverse
reverse
Definition: DeMoUpdate.py:563
beamspotman.n
n
Definition: beamspotman.py:731
DecodedPID::DecodedPID
DecodedPID(const int &p)
Definition: AtlasPID.h:18
DecodedPID::ndigits
size_t ndigits() const
Definition: AtlasPID.h:31
DeMoScan.first
bool first
Definition: DeMoScan.py:536