ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
DerivationFramework::JpsiXPlusDisplaced::MesonCandidateVector Class Reference

#include <JpsiXPlusDisplaced.h>

Collaboration diagram for DerivationFramework::JpsiXPlusDisplaced::MesonCandidateVector:

Public Member Functions

 MesonCandidateVector (size_t num, bool orderByPt)
 
void push_back (const MesonCandidate &etac)
 
const std::vector< MesonCandidate > & vector () const
 

Private Attributes

size_t m_num {0}
 
bool m_orderByPt {true}
 
std::vector< MesonCandidatem_vector
 

Detailed Description

Definition at line 65 of file JpsiXPlusDisplaced.h.

Constructor & Destructor Documentation

◆ MesonCandidateVector()

DerivationFramework::JpsiXPlusDisplaced::MesonCandidateVector::MesonCandidateVector ( size_t  num,
bool  orderByPt = true 
)

Definition at line 29 of file JpsiXPlusDisplaced.cxx.

29  {
30  m_num = num;
31  m_orderByPt = orderByPt;
32  }

Member Function Documentation

◆ push_back()

void DerivationFramework::JpsiXPlusDisplaced::MesonCandidateVector::push_back ( const MesonCandidate etac)

Definition at line 34 of file JpsiXPlusDisplaced.cxx.

34  {
35  if(m_num>0 && m_vector.size()>=m_num) {
36  if(m_orderByPt && etac.pt<=m_vector.back().pt) return;
37  else if(!m_orderByPt && etac.chi2NDF>=m_vector.back().chi2NDF) return;
38  }
39  auto pos = m_vector.cend();
40  for(auto iter=m_vector.cbegin(); iter!=m_vector.cend(); iter++) {
41  if(m_orderByPt) {
42  if(etac.pt>iter->pt) { pos = iter; break; }
43  }
44  else {
45  if(etac.chi2NDF<iter->chi2NDF) { pos = iter; break; }
46  }
47  }
48  m_vector.insert(pos, etac);
49  if(m_num>0 && m_vector.size()>m_num) m_vector.pop_back();
50  }

◆ vector()

const std::vector< JpsiXPlusDisplaced::MesonCandidate > & DerivationFramework::JpsiXPlusDisplaced::MesonCandidateVector::vector ( ) const

Definition at line 52 of file JpsiXPlusDisplaced.cxx.

52  {
53  return m_vector;
54  }

Member Data Documentation

◆ m_num

size_t DerivationFramework::JpsiXPlusDisplaced::MesonCandidateVector::m_num {0}
private

Definition at line 72 of file JpsiXPlusDisplaced.h.

◆ m_orderByPt

bool DerivationFramework::JpsiXPlusDisplaced::MesonCandidateVector::m_orderByPt {true}
private

Definition at line 73 of file JpsiXPlusDisplaced.h.

◆ m_vector

std::vector<MesonCandidate> DerivationFramework::JpsiXPlusDisplaced::MesonCandidateVector::m_vector
private

Definition at line 74 of file JpsiXPlusDisplaced.h.


The documentation for this class was generated from the following files:
DerivationFramework::JpsiXPlusDisplaced::MesonCandidateVector::m_orderByPt
bool m_orderByPt
Definition: JpsiXPlusDisplaced.h:73
DerivationFramework::JpsiXPlusDisplaced::MesonCandidateVector::m_vector
std::vector< MesonCandidate > m_vector
Definition: JpsiXPlusDisplaced.h:74
trigbs_pickEvents.num
num
Definition: trigbs_pickEvents.py:76
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
DerivationFramework::JpsiXPlusDisplaced::MesonCandidateVector::m_num
size_t m_num
Definition: JpsiXPlusDisplaced.h:72