CMS 3D CMS Logo

Pair_Table.h
Go to the documentation of this file.
1 //
2 //
3 // File: hitfit/private/Pair_Table.h
4 // Purpose: Helper for Fourvec_Constrainer.
5 // Created: Jul, 2000, sss, based on run 1 mass analysis code.
6 //
7 // Build a lookup table to speed up constraint evaluation.
8 //
9 // We have a set of constraints, which reference labels, like
10 //
11 // (1 2) = 80
12 // (1 2) = (3 4)
13 //
14 // We also have a Fourvec_Event, which has a set of objects, each of which
15 // has a label. A label may correspond to multiple objects.
16 //
17 // We'll be evaluating the mass constraints by considering each
18 // pair of objects o_1 o_2 and finding its contribution to each
19 // constraint. (We get pairs because the constraints are quadratic
20 // in the objects.)
21 //
22 // We build a Pair_Table by calling the constructor, giving it the event
23 // and the set of constraints. We can then get back from it a list
24 // of Objpair's, each representing a pair of objects that are
25 // used in some constraint. The Objpair will be able to tell us
26 // in which constraints the pair is used (and on which side of the
27 // equation).
28 //
29 // CMSSW File : interface/Pair_Table.h
30 // Original Author : Scott Stuart Snyder <snyder@bnl.gov> for D0
31 // Imported to CMSSW by Haryo Sumowidagdo <Suharyo.Sumowidagdo@cern.ch>
32 //
33 
34 
56 #ifndef HITFIT_PAIR_TABLE_H
57 #define HITFIT_PAIR_TABLE_H
58 
59 #include <vector>
60 #include <iosfwd>
63 
64 
65 namespace hitfit {
66 
67 
68 class Fourvec_Event;
69 
70 
100 //
101 // Purpose: Helper for Fourvec_Constrainer.
102 //
103 {
104 public:
105  // Constructor. Give it the event and the list of constraints.
113  Pair_Table (const std::vector<Constraint>& cv,
114  const Fourvec_Event& ev);
115 
116  // The number of pairs in the table.
117 
121  int npairs () const;
122 
123  // Get one of the pairs from the table.
129  const Objpair& get_pair (std::vector<Objpair>::size_type pairno) const;
130 
131 
132 private:
133  //The table of pairs.
137  std::vector<Objpair> _pairs;
138 };
139 
140 
141 // Dump out the table.
142 std::ostream& operator<< (std::ostream& s, const Pair_Table& p);
143 
144 
145 } // namespace hitfit
146 
147 
148 #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:100
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:88
bool ev
cv
Definition: cuy.py:363
uint16_t size_type
std::vector< Objpair > _pairs
Definition: Pair_Table.h:137
std::ostream & operator<<(std::ostream &s, const Constraint_Intermed &ci)
Output stream operator, print the content of this Constraint_Intermed to an output stream...
Represent a mass constraint equation.
A lookup table to speed up constraint evaluation using Fourvec_Constrainer.
Definition: Pair_Table.h:99
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:48
Represent a pair of objects in Pair_Table.
Definition: Objpair.h:62