CMS 3D CMS Logo

Fit_Result_Vec.h
Go to the documentation of this file.
1 //
2 //
3 // File: hitfit/Fit_Result_Vec.h
4 // Purpose: Hold a set of Fit_Result structures.
5 // Created: Jul, 2000, sss, based on run 1 mass analysis code.
6 //
7 // This class holds pointers to a set of Fit_Result's, resulting from
8 // different jet permutation with some consistent selection.
9 // The results are ordered by increasing chisq values. A maximum
10 // length for the vector may be specified; when new results are added,
11 // those with the largest chisq fall off the end.
12 //
13 // The Fit_Result objects are reference counted, in order to allow them
14 // to be entered in multiple vectors.
15 //
16 // CMSSW File : interface/Fit_Result_Vec.h
17 // Original Author : Scott Stuart Snyder <snyder@bnl.gov> for D0
18 // Imported to CMSSW by Haryo Sumowidagdo <Suharyo.Sumowidagdo@cern.ch>
19 //
20 
44 #ifndef HITFIT_FIT_RESULT_VEC_H
45 #define HITFIT_FIT_RESULT_VEC_H
46 
47 #include <vector>
48 #include <iosfwd>
49 #include <memory>
50 
51 namespace hitfit {
52 
53  class Fit_Result;
54 
68  //
69  // Purpose: Hold a set of Fit_Result structures.
70  //
71  {
72  public:
73  // Constructor, destructor. The maximum length of the vector
74  // is specified here.
75 
81  Fit_Result_Vec(std::vector<std::shared_ptr<Fit_Result>>::size_type max_len);
82 
87 
88  // Copy constructor.
93  Fit_Result_Vec(const Fit_Result_Vec& vec);
94 
95  // Assignment.
101 
102  // Get back the number of results in the vector.
106  std::vector<std::shared_ptr<Fit_Result>>::size_type size() const;
107 
108  // Get back the Ith result in the vector.
114  const Fit_Result& operator[](std::vector<std::shared_ptr<Fit_Result>>::size_type i) const;
115 
116  // Add a new result to the list.
122  void push(std::shared_ptr<Fit_Result> res);
123 
124  // Dump out the vector.
125  friend std::ostream& operator<<(std::ostream& s, const Fit_Result_Vec& resvec);
126 
127  private:
128  // The object state.
129 
133  std::vector<std::shared_ptr<Fit_Result>> _v;
134 
138  std::vector<std::shared_ptr<Fit_Result>>::size_type _max_len;
139  };
140 
141 } // namespace hitfit
142 
143 #endif // not HITFIT_FIT_RESULT_H
mps_fire.i
i
Definition: mps_fire.py:355
hitfit
Definition: Base_Constrainer.h:43
hitfit::Fit_Result
Hold the result of one kinematic fit.
Definition: Fit_Result.h:50
hitfit::Fit_Result_Vec::~Fit_Result_Vec
~Fit_Result_Vec()
Destructor.
Definition: Fit_Result_Vec.cc:69
hitfit::Fit_Result_Vec
Holds pointers to a set of Fit_Result objects, resulting from different jet permutation with some con...
Definition: Fit_Result_Vec.h:67
hitfit::Fit_Result_Vec::operator[]
const Fit_Result & operator[](std::vector< std::shared_ptr< Fit_Result >>::size_type i) const
Return the i-th element of the Fit_Result objects in the vector.
Definition: Fit_Result_Vec.cc:102
alignCSCRings.s
s
Definition: alignCSCRings.py:92
hitfit::Fit_Result_Vec::Fit_Result_Vec
Fit_Result_Vec(std::vector< std::shared_ptr< Fit_Result >>::size_type max_len)
Constructor.
Definition: Fit_Result_Vec.cc:48
trigger::size_type
uint16_t size_type
Definition: TriggerTypeDefs.h:18
hitfit::Fit_Result_Vec::push
void push(std::shared_ptr< Fit_Result > res)
Add a new Fit_Result to the list.
Definition: Fit_Result_Vec.cc:131
hitfit::Fit_Result_Vec::_v
std::vector< std::shared_ptr< Fit_Result > > _v
Definition: Fit_Result_Vec.h:133
res
Definition: Electron.h:6
hitfit::Fit_Result_Vec::size
std::vector< std::shared_ptr< Fit_Result > >::size_type size() const
Return the number of Fit_Result objects in the list.
Definition: Fit_Result_Vec.cc:91
hitfit::Fit_Result_Vec::operator=
Fit_Result_Vec & operator=(const Fit_Result_Vec &vec)
Assignment operator.
Definition: Fit_Result_Vec.cc:75
hitfit::Fit_Result_Vec::_max_len
std::vector< std::shared_ptr< Fit_Result > >::size_type _max_len
Definition: Fit_Result_Vec.h:138
hitfit::Fit_Result_Vec::operator<<
friend std::ostream & operator<<(std::ostream &s, const Fit_Result_Vec &resvec)
Output stream operator, print the content of this Fit_Result_Vec to an output stream.
Definition: Fit_Result_Vec.cc:159