gambit is hosted by Hepforge, IPPP Durham
GAMBIT  v1.5.0-2191-ga4742ac
a Global And Modular Bsm Inference Tool

Simple class for holding a sorted pair of particle ID (PID) codes. More...

#include <PID_pair.hpp>

Public Types

typedef std::pair< int, intiipair
 

Public Member Functions

 PID_pair ()
 Constructors. More...
 
 PID_pair (int pid1_in, int pid2_in)
 
 PID_pair (const iipair &PIDs_in)
 
virtual ~PID_pair ()
 Detstructor. More...
 
void set_pids (int pid1_in, int pid2_in)
 Set PIDs, with sorting. More...
 
void set_pids (const iipair &PIDs_in)
 
const iipairPIDs () const
 Get PIDs. More...
 
int pid1 () const
 
int pid2 () const
 
PID_pair cc_pid_pair () const
 Get the charge-conjugated PID pair. More...
 
bool is_antiparticle_pair () const
 Check if |pid1| == |pid2|. More...
 
bool operator== (const PID_pair &rhs) const
 Relational operators, simply using the relational operators for the underlying pair<int,int> More...
 
bool operator!= (const PID_pair &rhs) const
 
bool operator< (const PID_pair &rhs) const
 
bool operator<= (const PID_pair &rhs) const
 
bool operator> (const PID_pair &rhs) const
 
bool operator>= (const PID_pair &rhs) const
 
void reset ()
 Reset the PIDs. More...
 
std::string str () const
 Get the PID pair as a string: "<pid1>_<pid2>". More...
 

Private Attributes

iipair _pids
 

Detailed Description

Simple class for holding a sorted pair of particle ID (PID) codes.

This is essentially just a wrapper around a std::pair<int,int>, with forced ordering (first element <= second element) and some extra bells and whistles.

Definition at line 31 of file PID_pair.hpp.

Member Typedef Documentation

◆ iipair

typedef std::pair<int,int> Gambit::PID_pair::iipair

Definition at line 36 of file PID_pair.hpp.

Constructor & Destructor Documentation

◆ PID_pair() [1/3]

Gambit::PID_pair::PID_pair ( )
inline

Constructors.

Definition at line 39 of file PID_pair.hpp.

Referenced by cc_pid_pair().

39  :
40  _pids(iipair({0, 0}))
41  {}
std::pair< int, int > iipair
Definition: PID_pair.hpp:36
Here is the caller graph for this function:

◆ PID_pair() [2/3]

Gambit::PID_pair::PID_pair ( int  pid1_in,
int  pid2_in 
)
inline

Definition at line 43 of file PID_pair.hpp.

References set_pids().

44  {
45  // Use this function to ensure correct sorting
46  set_pids(pid1_in, pid2_in);
47  }
void set_pids(int pid1_in, int pid2_in)
Set PIDs, with sorting.
Definition: PID_pair.hpp:60
Here is the call graph for this function:

◆ PID_pair() [3/3]

Gambit::PID_pair::PID_pair ( const iipair PIDs_in)
inline

Definition at line 49 of file PID_pair.hpp.

References set_pids().

50  {
51  // Use this function to ensure correct sorting
52  set_pids(PIDs_in);
53  }
void set_pids(int pid1_in, int pid2_in)
Set PIDs, with sorting.
Definition: PID_pair.hpp:60
Here is the call graph for this function:

◆ ~PID_pair()

virtual Gambit::PID_pair::~PID_pair ( )
inlinevirtual

Detstructor.

Definition at line 56 of file PID_pair.hpp.

56 { }

Member Function Documentation

◆ cc_pid_pair()

PID_pair Gambit::PID_pair::cc_pid_pair ( ) const
inline

Get the charge-conjugated PID pair.

Definition at line 95 of file PID_pair.hpp.

References _pids, and PID_pair().

96  {
97  return PID_pair(-_pids.second, -_pids.first);
98  }
PID_pair()
Constructors.
Definition: PID_pair.hpp:39
Here is the call graph for this function:

◆ is_antiparticle_pair()

bool Gambit::PID_pair::is_antiparticle_pair ( ) const
inline

Check if |pid1| == |pid2|.

Definition at line 101 of file PID_pair.hpp.

References _pids.

102  {
103  return (_pids.first == -_pids.second);
104  }

◆ operator!=()

bool Gambit::PID_pair::operator!= ( const PID_pair rhs) const
inline

Definition at line 111 of file PID_pair.hpp.

112  { return !(*this == rhs); }

◆ operator<()

bool Gambit::PID_pair::operator< ( const PID_pair rhs) const
inline

Definition at line 114 of file PID_pair.hpp.

References _pids.

115  { return this->_pids.first < rhs._pids.first || (!(rhs._pids.first < this->_pids.first) && this->_pids.second < rhs._pids.second); }

◆ operator<=()

bool Gambit::PID_pair::operator<= ( const PID_pair rhs) const
inline

Definition at line 117 of file PID_pair.hpp.

118  { return !(rhs < *this); }

◆ operator==()

bool Gambit::PID_pair::operator== ( const PID_pair rhs) const
inline

Relational operators, simply using the relational operators for the underlying pair<int,int>

Definition at line 108 of file PID_pair.hpp.

References _pids.

109  { return this->_pids.first == rhs._pids.first && this->_pids.second == rhs._pids.second; }

◆ operator>()

bool Gambit::PID_pair::operator> ( const PID_pair rhs) const
inline

Definition at line 120 of file PID_pair.hpp.

121  { return rhs < *this; }

◆ operator>=()

bool Gambit::PID_pair::operator>= ( const PID_pair rhs) const
inline

Definition at line 123 of file PID_pair.hpp.

124  { return !(*this < rhs); }

◆ pid1()

int Gambit::PID_pair::pid1 ( ) const
inline

Definition at line 84 of file PID_pair.hpp.

References _pids.

Referenced by Gambit::ColliderBit::PID_pair_xsec_container::average_xsec(), Gambit::ColliderBit::getProcessCrossSectionsMap(), and Gambit::ColliderBit::PID_pair_xsec_container::sum_xsecs().

85  {
86  return _pids.first;
87  }
Here is the caller graph for this function:

◆ pid2()

int Gambit::PID_pair::pid2 ( ) const
inline

Definition at line 89 of file PID_pair.hpp.

References _pids.

Referenced by Gambit::ColliderBit::PID_pair_xsec_container::average_xsec(), Gambit::ColliderBit::getProcessCrossSectionsMap(), and Gambit::ColliderBit::PID_pair_xsec_container::sum_xsecs().

90  {
91  return _pids.second;
92  }
Here is the caller graph for this function:

◆ PIDs()

const iipair& Gambit::PID_pair::PIDs ( ) const
inline

Get PIDs.

Definition at line 79 of file PID_pair.hpp.

References _pids.

80  {
81  return _pids;
82  }

◆ reset()

void Gambit::PID_pair::reset ( )
inline

Reset the PIDs.

Definition at line 128 of file PID_pair.hpp.

References _pids.

129  {
130  _pids = iipair({0,0});
131  }
std::pair< int, int > iipair
Definition: PID_pair.hpp:36

◆ set_pids() [1/2]

void Gambit::PID_pair::set_pids ( int  pid1_in,
int  pid2_in 
)
inline

Set PIDs, with sorting.

Definition at line 60 of file PID_pair.hpp.

References _pids.

Referenced by PID_pair(), and set_pids().

61  {
62  if (pid1_in <= pid2_in)
63  {
64  _pids = iipair({pid1_in, pid2_in});
65  }
66  else
67  {
68  _pids = iipair({pid2_in, pid1_in});
69  }
70  }
std::pair< int, int > iipair
Definition: PID_pair.hpp:36
Here is the caller graph for this function:

◆ set_pids() [2/2]

void Gambit::PID_pair::set_pids ( const iipair PIDs_in)
inline

Definition at line 72 of file PID_pair.hpp.

References set_pids().

73  {
74  set_pids(PIDs_in.first, PIDs_in.second);
75  }
void set_pids(int pid1_in, int pid2_in)
Set PIDs, with sorting.
Definition: PID_pair.hpp:60
Here is the call graph for this function:

◆ str()

std::string Gambit::PID_pair::str ( ) const
inline

Get the PID pair as a string: "<pid1>_<pid2>".

Definition at line 135 of file PID_pair.hpp.

References _pids.

Referenced by Gambit::ColliderBit::getPIDPairCrossSectionsInfo().

136  {
137  std::string pids_str = std::to_string(_pids.first) + "_" + std::to_string(_pids.second);
138  return pids_str;
139  }
Here is the caller graph for this function:

Member Data Documentation

◆ _pids

iipair Gambit::PID_pair::_pids
private

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