ATLAS Offline Software
Loading...
Searching...
No Matches
xAOD::JetConstituentVector Class Reference

A vector of jet constituents at the scale used during jet finding. More...

#include <JetConstituentVector.h>

Collaboration diagram for xAOD::JetConstituentVector:

Classes

class  iterator

Public Types

typedef iterator const_iterator
typedef std::vector< ElementLink< IParticleContainer > > ELvector

Public Member Functions

 JetConstituentVector (const ELvector *elv, JetConstitScale s)
bool isValid () const
 Check if element links are valid.
bool empty () const
 true if vector is empty()
size_t size () const
 number of constituents
iterator begin () const
 iterator on the first constituent
iterator end () const
 iterator after the last constituent
iterator begin (JetConstitScale s) const
 iterator at scale
iterator end (JetConstitScale s) const
 iterator at scale
JetConstituent operator[] (size_t i) const
 Constituent proxy at position i.
JetConstituent at (size_t i) const
 Constituent proxy at position i.
JetConstituent front () const
 first constituent proxy
JetConstituent back () const
 last constituent proxy
std::vector< const IParticle * > asIParticleVector () const
 vector of pointer to the underlying IParticles.
std::vector< JetConstituentasSTLVector ()
 Returns this vector as a std::vector Provided for convenience when dealing with the JetConstituentVector::iterator is not possible.

Protected Attributes

const std::vector< ElementLink< IParticleContainer > > * m_elVector
JetConstitScale m_sigState

Detailed Description

A vector of jet constituents at the scale used during jet finding.

This class can be used as a vector<const IParticle*>. It provides iterators and the usual function of vector<>

Definition at line 117 of file JetConstituentVector.h.

Member Typedef Documentation

◆ const_iterator

◆ ELvector

Definition at line 157 of file JetConstituentVector.h.

Constructor & Destructor Documentation

◆ JetConstituentVector()

xAOD::JetConstituentVector::JetConstituentVector ( const ELvector * elv,
JetConstitScale s )
inline

Definition at line 159 of file JetConstituentVector.h.

159: m_elVector(elv) , m_sigState(s) {}
const std::vector< ElementLink< IParticleContainer > > * m_elVector

Member Function Documentation

◆ asIParticleVector()

std::vector< const IParticle * > xAOD::JetConstituentVector::asIParticleVector ( ) const

vector of pointer to the underlying IParticles.

WARNING !! these raw IParticle constituents might have a scale incompatible with the jet they're coming from.

Definition at line 122 of file JetConstituentVector.cxx.

122 {
123 std::vector<const IParticle*> v( m_elVector->size() );
124 for(size_t i=0;i<v.size(); i++) v[i] = *(m_elVector->at(i));
125 return v;
126 }

◆ asSTLVector()

std::vector< JetConstituent > xAOD::JetConstituentVector::asSTLVector ( )

Returns this vector as a std::vector Provided for convenience when dealing with the JetConstituentVector::iterator is not possible.

This method is slighly under-performant since it will create and fill a new std::vector.

Definition at line 128 of file JetConstituentVector.cxx.

128 {
129 size_t N = size();
130 std::vector<JetConstituent> vec(N);
131 for ( size_t i=0;i<N;i++ ) {
132 fillJetConstituent( *(m_elVector->at(i)) , vec[i], m_sigState );
133 vec[i].m_part = *(m_elVector->at(i));
134 }
135 return vec;
136 }
std::vector< size_t > vec
size_t size() const
number of constituents
void fillJetConstituent(const IParticle *part, JetConstituent &constit, JetConstitScale sigState)

◆ at()

JetConstituent xAOD::JetConstituentVector::at ( size_t i) const

Constituent proxy at position i.

Definition at line 111 of file JetConstituentVector.cxx.

111 {
112 JetConstituent c;
114 c.m_part = *(m_elVector->at(i));
115 return c;
116 }

◆ back()

JetConstituent xAOD::JetConstituentVector::back ( ) const

last constituent proxy

Definition at line 120 of file JetConstituentVector.cxx.

120{return at(size()-1);}
JetConstituent at(size_t i) const
Constituent proxy at position i.

◆ begin() [1/2]

iterator xAOD::JetConstituentVector::begin ( ) const

iterator on the first constituent

Definition at line 103 of file JetConstituentVector.cxx.

103{ return iterator(m_elVector->begin(), m_sigState) ; }
JetConstituentVector::iterator iterator

◆ begin() [2/2]

iterator xAOD::JetConstituentVector::begin ( JetConstitScale s) const

iterator at scale

Parameters
son the first constituent

Definition at line 106 of file JetConstituentVector.cxx.

106{ return iterator(m_elVector->begin(), s) ; }

◆ empty()

bool xAOD::JetConstituentVector::empty ( ) const

true if vector is empty()

Definition at line 101 of file JetConstituentVector.cxx.

101{ return m_elVector->empty() ; }

◆ end() [1/2]

iterator xAOD::JetConstituentVector::end ( ) const

iterator after the last constituent

Definition at line 104 of file JetConstituentVector.cxx.

104{ return iterator(m_elVector->end(), m_sigState) ; }

◆ end() [2/2]

iterator xAOD::JetConstituentVector::end ( JetConstitScale s) const

iterator at scale

Parameters
safter the last constituent

Definition at line 107 of file JetConstituentVector.cxx.

107{ return iterator(m_elVector->end(), s) ; }

◆ front()

JetConstituent xAOD::JetConstituentVector::front ( ) const

first constituent proxy

Definition at line 118 of file JetConstituentVector.cxx.

118{return at(0);}

◆ isValid()

bool xAOD::JetConstituentVector::isValid ( ) const

Check if element links are valid.

Definition at line 92 of file JetConstituentVector.cxx.

92 {
93 using ELVector = std::vector<ElementLink<IParticleContainer> >;
94 for ( ELVector::const_iterator icon=m_elVector->begin(); icon!=m_elVector->end(); ++icon ) {
95 const ElementLink<IParticleContainer>& el = *icon;
96 if ( ! el.isValid() ) return false;
97 }
98 return true;
99 }

◆ operator[]()

JetConstituent xAOD::JetConstituentVector::operator[] ( size_t i) const

Constituent proxy at position i.

Definition at line 109 of file JetConstituentVector.cxx.

109{ return at(i); }

◆ size()

size_t xAOD::JetConstituentVector::size ( ) const

number of constituents

Definition at line 102 of file JetConstituentVector.cxx.

102{ return m_elVector->size() ; }

Member Data Documentation

◆ m_elVector

const std::vector< ElementLink< IParticleContainer > >* xAOD::JetConstituentVector::m_elVector
protected

Definition at line 201 of file JetConstituentVector.h.

◆ m_sigState

JetConstitScale xAOD::JetConstituentVector::m_sigState
protected

Definition at line 202 of file JetConstituentVector.h.


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