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 // $Id: Objpair.h,v 1.1 2011/05/26 09:46:53 mseidel Exp $
3 //
4 // File: hitfit/private/Objpair.h
5 // Purpose: Helper class for Pair_Table.
6 // Created: Jul, 2000, sss, based on run 1 mass analysis code.
7 //
8 // An `Objpair' consists of two object indices in a Fourvec_Event,
9 // plus a value for each constraint. This value is +1 if these two objects
10 // are used on the lhs of that constraint, -1 if they are used on the rhs
11 // of that constraint, and 0 if they are not used by that constraint.
12 //
13 // CMSSW File : interface/Objpair.h
14 // Original Author : Scott Stuart Snyder <snyder@bnl.gov> for D0
15 // Imported to CMSSW by Haryo Sumowidagdo <Suharyo.Sumowidagdo@cern.ch>
16 //
17 
18 
41 #ifndef HITFIT_OBJPAIR_H
42 #define HITFIT_OBJPAIR_H
43 
44 
45 #include <vector>
46 #include <iosfwd>
47 
48 
49 namespace hitfit {
50 
63 class Objpair
64 //
65 // Purpose: Helper class for Pair_Table.
66 //
67 {
68 public:
69  // Constructor. I and J are the two object indices, and NCONSTRAINTS
70  // is the number of constraints in the problem.
80  Objpair (int i, int j, int nconstraints);
81 
82  // Set the value for constraint K (0-based) to VAL.
91 
92  // Get back the indices in this pair.
96  int i () const;
97 
101  int j () const;
102 
103  // Retrieve the value set for constraint K.
110 
111  // Print this object.
112 
113  friend std::ostream& operator<< (std::ostream& s, const Objpair& o);
114 
115 
116 private:
117  // The object indices for this pair.
118 
122  int _i;
123 
127  int _j;
128 
129  // The list of values for each constraint.
133  std::vector<signed char> _for_constraint;
134 };
135 
136 
137 } // namespace hitfit
138 
139 
140 #include "TopQuarkAnalysis/TopHitFit/interface/Objpair.i"
141 
142 
143 #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:86
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:64
Objpair(int i, int j, int nconstraints)
Constructor.
Definition: Objpair.cc:48
int k[5][pyjets_maxn]
std::vector< signed char > _for_constraint
Definition: Objpair.h:133
Represent a pair of objects in Pair_Table.
Definition: Objpair.h:63
int i() const
Return the index of the first object.