CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Pair_Table.h
Go to the documentation of this file.
1 //
2 // $Id: Pair_Table.h,v 1.1 2011/05/26 09:46:53 mseidel Exp $
3 //
4 // File: hitfit/private/Pair_Table.h
5 // Purpose: Helper for Fourvec_Constrainer.
6 // Created: Jul, 2000, sss, based on run 1 mass analysis code.
7 //
8 // Build a lookup table to speed up constraint evaluation.
9 //
10 // We have a set of constraints, which reference labels, like
11 //
12 // (1 2) = 80
13 // (1 2) = (3 4)
14 //
15 // We also have a Fourvec_Event, which has a set of objects, each of which
16 // has a label. A label may correspond to multiple objects.
17 //
18 // We'll be evaluating the mass constraints by considering each
19 // pair of objects o_1 o_2 and finding its contribution to each
20 // constraint. (We get pairs because the constraints are quadratic
21 // in the objects.)
22 //
23 // We build a Pair_Table by calling the constructor, giving it the event
24 // and the set of constraints. We can then get back from it a list
25 // of Objpair's, each representing a pair of objects that are
26 // used in some constraint. The Objpair will be able to tell us
27 // in which constraints the pair is used (and on which side of the
28 // equation).
29 //
30 // CMSSW File : interface/Pair_Table.h
31 // Original Author : Scott Stuart Snyder <snyder@bnl.gov> for D0
32 // Imported to CMSSW by Haryo Sumowidagdo <Suharyo.Sumowidagdo@cern.ch>
33 //
34 
35 
57 #ifndef HITFIT_PAIR_TABLE_H
58 #define HITFIT_PAIR_TABLE_H
59 
60 #include <vector>
61 #include <iosfwd>
64 
65 
66 namespace hitfit {
67 
68 
69 class Fourvec_Event;
70 
71 
101 //
102 // Purpose: Helper for Fourvec_Constrainer.
103 //
104 {
105 public:
106  // Constructor. Give it the event and the list of constraints.
114  Pair_Table (const std::vector<Constraint>& cv,
115  const Fourvec_Event& ev);
116 
117  // The number of pairs in the table.
118 
122  int npairs () const;
123 
124  // Get one of the pairs from the table.
130  const Objpair& get_pair (std::vector<Objpair>::size_type pairno) const;
131 
132 
133 private:
134  //The table of pairs.
138  std::vector<Objpair> _pairs;
139 };
140 
141 
142 // Dump out the table.
143 std::ostream& operator<< (std::ostream& s, const Pair_Table& p);
144 
145 
146 } // namespace hitfit
147 
148 
149 #endif // not PAIR_TABLE_H
const Objpair & get_pair(std::vector< Objpair >::size_type pairno) const
Get one of the pairs from the table, index starts from 0.
Definition: Pair_Table.cc:101
Represent a pair of objects in Pair_Table.
Represent an event for kinematic fitting as a collection of four-momenta. Each object is represented ...
int npairs() const
Return the number of pairs in the table.
Definition: Pair_Table.cc:89
uint16_t size_type
std::vector< Objpair > _pairs
Definition: Pair_Table.h:138
Represent a mass constraint equation.
A lookup table to speed up constraint evaluation using Fourvec_Constrainer.
Definition: Pair_Table.h:100
std::ostream & operator<<(std::ostream &s, const Constraint_Intermed &ci)
Output stream operator, print the content of this Constraint_Intermed to an output stream...
Pair_Table(const std::vector< Constraint > &cv, const Fourvec_Event &ev)
Constructor, give it the event and the list of constraints.
Definition: Pair_Table.cc:49
Represent a pair of objects in Pair_Table.
Definition: Objpair.h:63