test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Objpair.h
Go to the documentation of this file.
1 //
2 //
3 // File: hitfit/private/Objpair.h
4 // Purpose: Helper class for Pair_Table.
5 // Created: Jul, 2000, sss, based on run 1 mass analysis code.
6 //
7 // An `Objpair' consists of two object indices in a Fourvec_Event,
8 // plus a value for each constraint. This value is +1 if these two objects
9 // are used on the lhs of that constraint, -1 if they are used on the rhs
10 // of that constraint, and 0 if they are not used by that constraint.
11 //
12 // CMSSW File : interface/Objpair.h
13 // Original Author : Scott Stuart Snyder <snyder@bnl.gov> for D0
14 // Imported to CMSSW by Haryo Sumowidagdo <Suharyo.Sumowidagdo@cern.ch>
15 //
16 
17 
40 #ifndef HITFIT_OBJPAIR_H
41 #define HITFIT_OBJPAIR_H
42 
43 
44 #include <vector>
45 #include <iosfwd>
46 
47 
48 namespace hitfit {
49 
62 class Objpair
63 //
64 // Purpose: Helper class for Pair_Table.
65 //
66 {
67 public:
68  // Constructor. I and J are the two object indices, and NCONSTRAINTS
69  // is the number of constraints in the problem.
79  Objpair (int i, int j, int nconstraints);
80 
81  // Set the value for constraint K (0-based) to VAL.
90 
91  // Get back the indices in this pair.
95  int i () const;
96 
100  int j () const;
101 
102  // Retrieve the value set for constraint K.
109 
110  // Print this object.
111 
112  friend std::ostream& operator<< (std::ostream& s, const Objpair& o);
113 
114 
115 private:
116  // The object indices for this pair.
117 
121  int _i;
122 
126  int _j;
127 
128  // The list of values for each constraint.
132  std::vector<signed char> _for_constraint;
133 };
134 
135 
136 } // namespace hitfit
137 
138 
139 #include "TopQuarkAnalysis/TopHitFit/interface/Objpair.i"
140 
141 
142 #endif // not HITFIT_OBJPAIR_H
int for_constraint(std::vector< signed char >::size_type k) const
Retrieve the value set for a constraint.
uint16_t size_type
friend std::ostream & operator<<(std::ostream &s, const Objpair &o)
Output stream operator, print the content of this Objpair to an output stream.
Definition: Objpair.cc:85
int j() const
Return the index of the second object.
void has_constraint(std::vector< signed char >::size_type k, int val)
Set the value for a constraint to a value.
Definition: Objpair.cc:63
Objpair(int i, int j, int nconstraints)
Constructor.
Definition: Objpair.cc:47
std::vector< signed char > _for_constraint
Definition: Objpair.h:132
Represent a pair of objects in Pair_Table.
Definition: Objpair.h:62
int i() const
Return the index of the first object.