00001 // 00002 // $Id: Fit_Result_Vec.h,v 1.1 2011/05/26 09:46:53 mseidel Exp $ 00003 // 00004 // File: hitfit/Fit_Result_Vec.h 00005 // Purpose: Hold a set of Fit_Result structures. 00006 // Created: Jul, 2000, sss, based on run 1 mass analysis code. 00007 // 00008 // This class holds pointers to a set of Fit_Result's, resulting from 00009 // different jet permutation with some consistent selection. 00010 // The results are ordered by increasing chisq values. A maximum 00011 // length for the vector may be specified; when new results are added, 00012 // those with the largest chisq fall off the end. 00013 // 00014 // The Fit_Result objects are reference counted, in order to allow them 00015 // to be entered in multiple vectors. 00016 // 00017 // CMSSW File : interface/Fit_Result_Vec.h 00018 // Original Author : Scott Stuart Snyder <snyder@bnl.gov> for D0 00019 // Imported to CMSSW by Haryo Sumowidagdo <Suharyo.Sumowidagdo@cern.ch> 00020 // 00021 00045 #ifndef HITFIT_FIT_RESULT_VEC_H 00046 #define HITFIT_FIT_RESULT_VEC_H 00047 00048 00049 #include <vector> 00050 #include <iosfwd> 00051 00052 00053 namespace hitfit { 00054 00055 00056 class Fit_Result; 00057 00058 00071 class Fit_Result_Vec 00072 // 00073 // Purpose: Hold a set of Fit_Result structures. 00074 // 00075 { 00076 public: 00077 // Constructor, destructor. The maximum length of the vector 00078 // is specified here. 00079 00085 Fit_Result_Vec (std::vector<Fit_Result*>::size_type max_len); 00086 00090 ~Fit_Result_Vec (); 00091 00092 // Copy constructor. 00097 Fit_Result_Vec (const Fit_Result_Vec& vec); 00098 00099 // Assignment. 00104 Fit_Result_Vec& operator= (const Fit_Result_Vec& vec); 00105 00106 // Get back the number of results in the vector. 00110 std::vector<Fit_Result*>::size_type size () const; 00111 00112 // Get back the Ith result in the vector. 00118 const Fit_Result& operator[] (std::vector<Fit_Result*>::size_type i) const; 00119 00120 // Add a new result to the list. 00126 void push (Fit_Result* res); 00127 00128 // Dump out the vector. 00129 friend std::ostream& operator<< (std::ostream& s, 00130 const Fit_Result_Vec& resvec); 00131 00132 private: 00133 // The object state. 00134 00138 std::vector<Fit_Result*> _v; 00139 00143 std::vector<Fit_Result*>::size_type _max_len; 00144 }; 00145 00146 00147 } // namespace hitfit 00148 00149 00150 #endif // not HITFIT_FIT_RESULT_H