CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_9_patch3/src/TopQuarkAnalysis/TopHitFit/interface/Objpair.h

Go to the documentation of this file.
00001 //
00002 // $Id: Objpair.h,v 1.1 2011/05/26 09:46:53 mseidel Exp $
00003 //
00004 // File: hitfit/private/Objpair.h
00005 // Purpose: Helper class for Pair_Table.
00006 // Created: Jul, 2000, sss, based on run 1 mass analysis code.
00007 //
00008 // An `Objpair' consists of two object indices in a Fourvec_Event,
00009 // plus a value for each constraint.  This value is +1 if these two objects
00010 // are used on the lhs of that constraint, -1 if they are used on the rhs
00011 // of that constraint, and 0 if they are not used by that constraint.
00012 //
00013 // CMSSW File      : interface/Objpair.h
00014 // Original Author : Scott Stuart Snyder <snyder@bnl.gov> for D0
00015 // Imported to CMSSW by Haryo Sumowidagdo <Suharyo.Sumowidagdo@cern.ch>
00016 //
00017 
00018 
00041 #ifndef HITFIT_OBJPAIR_H
00042 #define HITFIT_OBJPAIR_H
00043 
00044 
00045 #include <vector>
00046 #include <iosfwd>
00047 
00048 
00049 namespace hitfit {
00050 
00063 class Objpair
00064 //
00065 // Purpose: Helper class for Pair_Table.
00066 //
00067 {
00068 public:
00069   // Constructor.  I and J are the two object indices, and NCONSTRAINTS
00070   // is the number of constraints in the problem.
00080   Objpair (int i, int j, int nconstraints);
00081 
00082   // Set the value for constraint K (0-based) to VAL.
00090   void has_constraint (std::vector<signed char>::size_type k, int val);
00091 
00092   // Get back the indices in this pair.
00096   int i () const;
00097 
00101   int j () const;
00102 
00103   // Retrieve the value set for constraint K.
00109   int for_constraint (std::vector<signed char>::size_type k) const;
00110 
00111   // Print this object.
00112 
00113   friend std::ostream& operator<< (std::ostream& s, const Objpair& o);
00114 
00115 
00116 private:
00117   // The object indices for this pair.
00118 
00122   int _i;
00123 
00127   int _j;
00128 
00129   // The list of values for each constraint.
00133   std::vector<signed char> _for_constraint;
00134 };
00135 
00136 
00137 } // namespace hitfit
00138 
00139 
00140 #include "TopQuarkAnalysis/TopHitFit/interface/Objpair.i"
00141 
00142 
00143 #endif // not HITFIT_OBJPAIR_H