Jpp test-rotations-old
the software that should make you happy
Loading...
Searching...
No Matches
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 > JRECONSTRUCTION::JMultiThreadedReconstruction< JFit_t >::output_type

Public Member Functions

 JEvt ()
 Default constructor.
 
JEvtoperator+= (const JEvt &evt)
 Add event.
 
template<class JSelector_t >
void select (const JSelector_t &selector)
 Select fits.
 
template<class JComparator_t >
void select (const size_t number_of_fits, const JComparator_t &comparator)
 Select fits.
 
 ClassDef (JEvt, 5)
 

Friends

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

Detailed Description

Data structure for set of track fit results.

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

Constructor & Destructor Documentation

◆ JEvt()

JFIT::JEvt::JEvt ( )
inline

Default constructor.

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

384 {}

Member Function Documentation

◆ operator+=()

JEvt & JFIT::JEvt::operator+= ( const JEvt & evt)
inline

Add event.

Parameters
evtevent
Returns
this event

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

394 {
395 for (const auto& fit : evt) {
396 push_back(fit);
397 }
398
399 return *this;
400 }

◆ select() [1/2]

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

Select fits.

Parameters
selectorfit selector

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

410 {
411 using namespace std;
412
413 if (!empty()) {
414
415 iterator __end = partition(this->begin(), this->end(), selector);
416
417 this->erase(__end, this->end());
418 }
419 }

◆ select() [2/2]

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 429 of file JReconstruction/JEvt.hh.

431 {
432 using namespace std;
433
434 if (!empty()) {
435
436 iterator __end = this->end();
437
438 if (number_of_fits > 0 && number_of_fits < this->size()) {
439
440 advance(__end = this->begin(), number_of_fits);
441
442 partial_sort(this->begin(), __end, this->end(), comparator);
443
444 } else {
445
446 sort(this->begin(), __end, comparator);
447 }
448
449 this->erase(__end, this->end());
450 }
451 }
counter_type advance(counter_type &counter, const counter_type value, const counter_type limit=std::numeric_limits< counter_type >::max())
Advance counter.

◆ ClassDef()

JFIT::JEvt::ClassDef ( JEvt ,
5  )

Friends And Related Symbol Documentation

◆ operator<<

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

Write event to output.

Parameters
outoutput stream
eventevent
Returns
output stream

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

462 {
463 using namespace std;
464
465 out << "Event: " << endl;
466
467 for (JEvt::const_iterator fit = event.begin(); fit != event.end(); ++fit) {
468 out << *fit;
469 }
470
471 return out;
472 }

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