45 using std::unique_ptr;
48 using std::stable_sort;
72 : _c2 (constant * constant / 2)
145 return unique_ptr<Constraint_Intermed>
164 stable_sort (_labels.begin(), _labels.end());
194 swap (ilabel, jlabel);
196 unsigned sz = _labels.size();
198 for (i=0; i < sz; i++) {
199 if (_labels[i] == ilabel)
206 for (; i < sz; i++) {
207 if (_labels[i] == jlabel)
231 int nobjs =
ev.nobjs();
233 for (
int i = 0;
i < nobjs;
i++) {
235 if (has_label (o.
label))
252 for (
unsigned i = 0;
i < _labels.size();
i++) {
272 return find (_labels.begin(), _labels.end(),
label) != _labels.end();
284 return unique_ptr<Constraint_Intermed>
347 while (i < s.size() && s[
i] ==
' ')
351 while (i < s.size() && s[
i] ==
' ')
353 if (i < s.size() && s[
i] ==
'<') {
355 if (i == string::npos)
356 return unique_ptr<Constraint_Intermed> ();
359 while (i < s.size() && s[
i] ==
' ')
364 return unique_ptr<Constraint_Intermed> ();
371 while (i < s.size()) {
372 while (i < s.size() && s[
i] ==
' ')
374 if (i < s.size() && s[
i] ==
')')
377 labels.push_back (atoi (s.c_str() +
i));
378 while (i < s.size() && s[
i] !=
' ' && s[
i] !=
')')
381 return unique_ptr<Constraint_Intermed>
386 return unique_ptr<Constraint_Intermed>
bool has_label(int label) const
std::unique_ptr< Constraint_Intermed > clone() const override
Concrete class for one side of mass constraint equation of the type: .
std::unique_ptr< Constraint_Intermed > make_constraint_intermed(std::string s)
Represent an event for kinematic fitting as a collection of four-momenta. Each object is represented ...
Concrete class for one side of mass constraint equation of the type: .
virtual void print(std::ostream &s) const =0
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
std::unique_ptr< Constraint_Intermed > clone() const override
void swap(Association< C > &lhs, Association< C > &rhs)
bool has_labels(int ilabel, int jlabel) const override
Constraint_Intermed_Constant(double constant)
Constraint_Intermed_Labels(const std::vector< int > &labels)
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
void print(std::ostream &s) const override
void print(std::ostream &s) const override
std::ostream & operator<<(std::ostream &s, const Constraint_Intermed &ci)
Output stream operator, print the content of this Constraint_Intermed to an output stream...
double sum_mass_terms(const Fourvec_Event &ev) const override
bool has_labels(int ilabel, int jlabel) const override
std::vector< int > _labels
Abstract base classes for describing one side of a mass constraint.
Represent a single object in a Fourvec_Event, this is just a dumb data container. Each object in a Fo...
double sum_mass_terms(const Fourvec_Event &ev) const override
Represent one side of a mass constraint equation. Contains the abstract base class Constraint_Interme...
Represent an event for kinematic fitting as a collection of four-momenta.