CMS 3D CMS Logo

Objpair.cc
Go to the documentation of this file.
1 //
2 //
3 // File: src/Objpair.cc
4 // Purpose: Helper class for Pair_Table.
5 // Created: Jul, 2000, sss, based on run 1 mass analysis code.
6 //
7 // CMSSW File : src/Objpair.cc
8 // Original Author : Scott Stuart Snyder <snyder@bnl.gov> for D0
9 // Imported to CMSSW by Haryo Sumowidagdo <Suharyo.Sumowidagdo@cern.ch>
10 //
11 
35 #include <ostream>
36 #include <cassert>
37 
38 using std::ostream;
39 
40 namespace hitfit {
41 
42  Objpair::Objpair(int i, int j, int nconstraints)
43  //
44  // Purpose: Constructor.
45  //
46  // Inputs:
47  // i - The first object index.
48  // j - The second object index.
49  // nconstraints- The number of constraints in the problem.
50  //
51  : _i(i), _j(j), _for_constraint(nconstraints) {}
52 
54  //
55  // Purpose: Set the value for constraint K (0-based) to VAL.
56  //
57  // Inputs:
58  // k - The constraint number (0-based).
59  // val - The value to set for this constraint.
60  //
61  {
62  assert(k < _for_constraint.size());
63  _for_constraint[k] = static_cast<signed char>(val);
64  }
65 
74  std::ostream& operator<<(std::ostream& s, const Objpair& o)
75  //
76  // Purpose: Print the object to S.
77  //
78  // Inputs:
79  // s - The stream to which to write.
80  // o - The object to write.
81  //
82  // Returns:
83  // The stream S.
84  //
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  }
91 
92 } // namespace hitfit
mps_fire.i
i
Definition: mps_fire.py:355
hitfit
Definition: Base_Constrainer.h:43
cms::cuda::assert
assert(be >=bs)
EcalTangentSkim_cfg.o
o
Definition: EcalTangentSkim_cfg.py:36
alignCSCRings.s
s
Definition: alignCSCRings.py:92
trigger::size_type
uint16_t size_type
Definition: TriggerTypeDefs.h:18
Objpair.h
Represent a pair of objects in Pair_Table.
dqmdumpme.k
k
Definition: dqmdumpme.py:60
hitfit::operator<<
std::ostream & operator<<(std::ostream &s, const Constraint_Intermed &ci)
Output stream operator, print the content of this Constraint_Intermed to an output stream.
Definition: Constraint_Intermed.cc:268
hitfit::Objpair::Objpair
Objpair(int i, int j, int nconstraints)
Constructor.
Definition: Objpair.cc:42
hitfit::Objpair::_for_constraint
std::vector< signed char > _for_constraint
Definition: Objpair.h:127
hitfit::Objpair
Represent a pair of objects in Pair_Table.
Definition: Objpair.h:58
heppy_batch.val
val
Definition: heppy_batch.py:351
hitfit::Objpair::has_constraint
void has_constraint(std::vector< signed char >::size_type k, int val)
Set the value for a constraint to a value.
Definition: Objpair.cc:53
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66