ATLAS Offline Software
Loading...
Searching...
No Matches
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

Public Attributes

T1 first_type
 STL member.
T2 second_type
 STL member.

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 }
bool first
Definition DeMoScan.py:534
void reverse(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of reverse for DataVector/List.

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)));}
size_t ndigits() const
Definition AtlasPID.h:31
DecodedPID(const int &p)
Definition AtlasPID.h:18

Member Data Documentation

◆ first_type

T1 std::pair< T1, T2 >::first_type
inherited

STL member.

◆ second_type

T2 std::pair< T1, T2 >::second_type
inherited

STL member.


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