CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_0/src/TopQuarkAnalysis/TopHitFit/interface/Pair_Table.h

Go to the documentation of this file.
00001 //
00002 // $Id: Pair_Table.h,v 1.1 2011/05/26 09:46:53 mseidel Exp $
00003 //
00004 // File: hitfit/private/Pair_Table.h
00005 // Purpose: Helper for Fourvec_Constrainer.
00006 // Created: Jul, 2000, sss, based on run 1 mass analysis code.
00007 //
00008 // Build a lookup table to speed up constraint evaluation.
00009 //
00010 // We have a set of constraints, which reference labels, like
00011 //
00012 //    (1 2) = 80
00013 //    (1 2) = (3 4)
00014 //
00015 // We also have a Fourvec_Event, which has a set of objects, each of which
00016 // has a label.  A label may correspond to multiple objects.
00017 //
00018 // We'll be evaluating the mass constraints by considering each
00019 // pair of objects o_1 o_2 and finding its contribution to each
00020 // constraint.  (We get pairs because the constraints are quadratic
00021 // in the objects.)
00022 //
00023 // We build a Pair_Table by calling the constructor, giving it the event
00024 // and the set of constraints.  We can then get back from it a list
00025 // of Objpair's, each representing a pair of objects that are
00026 // used in some constraint.  The Objpair will be able to tell us
00027 // in which constraints the pair is used (and on which side of the
00028 // equation).
00029 //
00030 // CMSSW File      : interface/Pair_Table.h
00031 // Original Author : Scott Stuart Snyder <snyder@bnl.gov> for D0
00032 // Imported to CMSSW by Haryo Sumowidagdo <Suharyo.Sumowidagdo@cern.ch>
00033 //
00034 
00035 
00057 #ifndef HITFIT_PAIR_TABLE_H
00058 #define HITFIT_PAIR_TABLE_H
00059 
00060 #include <vector>
00061 #include <iosfwd>
00062 #include "TopQuarkAnalysis/TopHitFit/interface/Constraint.h"
00063 #include "TopQuarkAnalysis/TopHitFit/interface/Objpair.h"
00064 
00065 
00066 namespace hitfit {
00067 
00068 
00069 class Fourvec_Event;
00070 
00071 
00100 class Pair_Table
00101 //
00102 // Purpose: Helper for Fourvec_Constrainer.
00103 //
00104 {
00105 public:
00106   // Constructor.  Give it the event and the list of constraints.
00114   Pair_Table (const std::vector<Constraint>& cv,
00115               const Fourvec_Event& ev);
00116 
00117   // The number of pairs in the table.
00118 
00122   int npairs () const;
00123 
00124   // Get one of the pairs from the table.
00130   const Objpair& get_pair (std::vector<Objpair>::size_type pairno) const;
00131 
00132 
00133 private:
00134   //The table of pairs.
00138   std::vector<Objpair> _pairs;
00139 };
00140 
00141 
00142 // Dump out the table.
00143 std::ostream& operator<< (std::ostream& s, const Pair_Table& p);
00144 
00145 
00146 } // namespace hitfit
00147 
00148 
00149 #endif // not PAIR_TABLE_H