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 
55 #ifndef HITFIT_PAIR_TABLE_H
56 #define HITFIT_PAIR_TABLE_H
57 
58 #include <vector>
59 #include <iosfwd>
62 
63 namespace hitfit {
64 
65  class Fourvec_Event;
66 
95  class Pair_Table
96  //
97  // Purpose: Helper for Fourvec_Constrainer.
98  //
99  {
100  public:
101  // Constructor. Give it the event and the list of constraints.
109  Pair_Table(const std::vector<Constraint>& cv, const Fourvec_Event& ev);
110 
111  // The number of pairs in the table.
112 
116  int npairs() const;
117 
118  // Get one of the pairs from the table.
124  const Objpair& get_pair(std::vector<Objpair>::size_type pairno) const;
125 
126  private:
127  //The table of pairs.
131  std::vector<Objpair> _pairs;
132  };
133 
134  // Dump out the table.
135  std::ostream& operator<<(std::ostream& s, const Pair_Table& p);
136 
137 } // namespace hitfit
138 
139 #endif // not PAIR_TABLE_H
hitfit
Definition: Base_Constrainer.h:43
cuy.cv
cv
Definition: cuy.py:364
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
Constraint.h
Represent a mass constraint equation.
hitfit::Fourvec_Event
Represent an event for kinematic fitting as a collection of four-momenta. Each object is represented ...
Definition: Fourvec_Event.h:193
hitfit::Pair_Table::get_pair
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:92
alignCSCRings.s
s
Definition: alignCSCRings.py:92
hitfit::Pair_Table::npairs
int npairs() const
Return the number of pairs in the table.
Definition: Pair_Table.cc:81
trigger::size_type
uint16_t size_type
Definition: TriggerTypeDefs.h:18
Objpair.h
Represent a pair of objects in Pair_Table.
hitfit::operator<<
std::ostream & operator<<(std::ostream &s, const Constraint_Intermed &ci)
Output stream operator, print the content of this Constraint_Intermed to an output stream.
Definition: Constraint_Intermed.cc:268
hitfit::Objpair
Represent a pair of objects in Pair_Table.
Definition: Objpair.h:58
hitfit::Pair_Table::_pairs
std::vector< Objpair > _pairs
Definition: Pair_Table.h:131
hitfit::Pair_Table::Pair_Table
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:43
hitfit::Pair_Table
A lookup table to speed up constraint evaluation using Fourvec_Constrainer.
Definition: Pair_Table.h:95
ev
bool ev
Definition: Hydjet2Hadronizer.cc:95