ATLAS Offline Software
Loading...
Searching...
No Matches
DecodedPID Class Reference

#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 apid () 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

Definition at line 24 of file AtlasPID.h.

Constructor & Destructor Documentation

◆ DecodedPID()

DecodedPID::DecodedPID ( const int & p)
inline

Definition at line 26 of file AtlasPID.h.

26 {
27 this->first=p;
28 this->second.reserve(10);
29 int ap = std::abs(p);
30 for(; ap; ap/=10) this->second.push_back( ap%10 );
31 std::reverse(this->second.begin(), this->second.end());
32 }
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

◆ apid()

int DecodedPID::apid ( ) const
inline

Definition at line 37 of file AtlasPID.h.

37{ return std::abs(this->first);}

◆ last()

const int & DecodedPID::last ( ) const
inline

Definition at line 35 of file AtlasPID.h.

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

◆ max_digit()

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

Definition at line 38 of file AtlasPID.h.

38{ 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 39 of file AtlasPID.h.

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

◆ ndigits()

size_t DecodedPID::ndigits ( ) const
inline

Definition at line 40 of file AtlasPID.h.

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

◆ operator()()

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

Definition at line 34 of file AtlasPID.h.

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

◆ pid()

const int & DecodedPID::pid ( ) const
inline

Definition at line 36 of file AtlasPID.h.

36{ return this->first;}

◆ shift()

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

Definition at line 33 of file AtlasPID.h.

33{ return DecodedPID(this->first%int(std::pow(10,ndigits()-n)));}
size_t ndigits() const
Definition AtlasPID.h:40
DecodedPID(const int &p)
Definition AtlasPID.h:26

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: