CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes | Friends
hitfit::Objpair Class Reference

Represent a pair of objects in Pair_Table. More...

#include <Objpair.h>

Public Member Functions

int for_constraint (std::vector< signed char >::size_type k) const
 Retrieve the value set for a constraint. More...
 
void has_constraint (std::vector< signed char >::size_type k, int val)
 Set the value for a constraint to a value. More...
 
int i () const
 Return the index of the first object. More...
 
int j () const
 Return the index of the second object. More...
 
 Objpair (int i, int j, int nconstraints)
 Constructor. More...
 

Private Attributes

std::vector< signed char > _for_constraint
 
int _i
 
int _j
 

Friends

std::ostream & operator<< (std::ostream &s, const Objpair &o)
 Output stream operator, print the content of this Objpair to an output stream. More...
 

Detailed Description

Represent a pair of objects in Pair_Table.

An Objpair consists of two object indices in a Fourvec_Event, plua a value for each constraint. This value is defined as:

Definition at line 58 of file Objpair.h.

Constructor & Destructor Documentation

◆ Objpair()

hitfit::Objpair::Objpair ( int  i,
int  j,
int  nconstraints 
)

Constructor.

Parameters
iIndex of the first object.
jIndex of the second object.
nconstraintsThe number of constraints in the problem.

Definition at line 42 of file Objpair.cc.

51  : _i(i), _j(j), _for_constraint(nconstraints) {}

Member Function Documentation

◆ for_constraint()

int hitfit::Objpair::for_constraint ( std::vector< signed char >::size_type  k) const

Retrieve the value set for a constraint.

Parameters
kThe index of the constraint, index starts from 0.

◆ has_constraint()

void hitfit::Objpair::has_constraint ( std::vector< signed char >::size_type  k,
int  val 
)

Set the value for a constraint to a value.

Parameters
kThe index of the constraint, index starts from 0.
valThe value to set for this constraint.

Definition at line 53 of file Objpair.cc.

61  {
62  assert(k < _for_constraint.size());
63  _for_constraint[k] = static_cast<signed char>(val);
64  }

References _for_constraint, cms::cuda::assert(), dqmdumpme::k, and heppy_batch::val.

◆ i()

int hitfit::Objpair::i ( ) const

Return the index of the first object.

◆ j()

int hitfit::Objpair::j ( ) const

Return the index of the second object.

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  s,
const Objpair o 
)
friend

Output stream operator, print the content of this Objpair to an output stream.

Parameters
sThe stream to which to write.
oThe instance of Objpair to be printed.

Definition at line 74 of file Objpair.cc.

85  {
86  s << o._i << " " << o._j;
87  for (unsigned k = 0; k < o._for_constraint.size(); ++k)
88  s << " " << static_cast<int>(o._for_constraint[k]);
89  return s;
90  }

Member Data Documentation

◆ _for_constraint

std::vector<signed char> hitfit::Objpair::_for_constraint
private

The list of values for each constraint.

Definition at line 127 of file Objpair.h.

Referenced by has_constraint().

◆ _i

int hitfit::Objpair::_i
private

Index of the first object.

Definition at line 116 of file Objpair.h.

◆ _j

int hitfit::Objpair::_j
private

Index of the second object.

Definition at line 121 of file Objpair.h.

cms::cuda::assert
assert(be >=bs)
EcalTangentSkim_cfg.o
o
Definition: EcalTangentSkim_cfg.py:42
alignCSCRings.s
s
Definition: alignCSCRings.py:92
dqmdumpme.k
k
Definition: dqmdumpme.py:60
hitfit::Objpair::j
int j() const
Return the index of the second object.
hitfit::Objpair::_for_constraint
std::vector< signed char > _for_constraint
Definition: Objpair.h:127
hitfit::Objpair::_j
int _j
Definition: Objpair.h:121
hitfit::Objpair::_i
int _i
Definition: Objpair.h:116
heppy_batch.val
val
Definition: heppy_batch.py:351
hitfit::Objpair::i
int i() const
Return the index of the first object.