Jpp  pmt_effective_area_update_2
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Friends | List of all members
JFIT::JEvt Class Reference

Data structure for set of track fit results. More...

#include <JEvt.hh>

Inheritance diagram for JFIT::JEvt:
TObject std::vector< JFit >

Public Member Functions

 JEvt ()
 Default constructor. More...
 
template<class JSelector_t >
void select (const JSelector_t &selector)
 Select fits. More...
 
template<class JComparator_t >
void select (const size_t number_of_fits, const JComparator_t &comparator)
 Select fits. More...
 
 ClassDef (JEvt, 4)
 

Friends

std::ostream & operator<< (std::ostream &out, const JEvt &event)
 Write event to output. More...
 

Detailed Description

Data structure for set of track fit results.

Definition at line 363 of file JReconstruction/JEvt.hh.

Constructor & Destructor Documentation

JFIT::JEvt::JEvt ( )
inline

Default constructor.

Definition at line 371 of file JReconstruction/JEvt.hh.

372  {}

Member Function Documentation

template<class JSelector_t >
void JFIT::JEvt::select ( const JSelector_t &  selector)
inline

Select fits.

Parameters
selectorfit selector

Definition at line 381 of file JReconstruction/JEvt.hh.

382  {
383  using namespace std;
384 
385  if (!empty()) {
386 
387  iterator __end = partition(this->begin(), this->end(), selector);
388 
389  this->erase(__end, this->end());
390  }
391  }
template<class JComparator_t >
void JFIT::JEvt::select ( const size_t  number_of_fits,
const JComparator_t &  comparator 
)
inline

Select fits.

Parameters
number_of_fitsmaximal number of best fits to select
comparatorquality comparator

Definition at line 401 of file JReconstruction/JEvt.hh.

403  {
404  using namespace std;
405 
406  if (!empty()) {
407 
408  iterator __end = this->end();
409 
410  if (number_of_fits > 0 && number_of_fits < this->size()) {
411 
412  advance(__end = this->begin(), number_of_fits);
413 
414  partial_sort(this->begin(), __end, this->end(), comparator);
415 
416  } else {
417 
418  sort(this->begin(), __end, comparator);
419  }
420 
421  this->erase(__end, this->end());
422  }
423  }
counter_type advance(counter_type &counter, const counter_type value, const counter_type limit=std::numeric_limits< counter_type >::max())
Advance counter.
JFIT::JEvt::ClassDef ( JEvt  ,
 
)

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  out,
const JEvt event 
)
friend

Write event to output.

Parameters
outoutput stream
eventevent
Returns
output stream

Definition at line 433 of file JReconstruction/JEvt.hh.

434  {
435  using namespace std;
436 
437  out << "Event: " << endl;
438 
439  for (JEvt::const_iterator fit = event.begin(); fit != event.end(); ++fit) {
440  out << *fit;
441  }
442 
443  return out;
444  }

The documentation for this class was generated from the following file: