ATLAS Offline Software
Classes | Public Types | Public Member Functions | Protected Attributes | List of all members
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. More...
 
bool empty () const
 true if vector is empty() More...
 
size_t size () const
 number of constituents More...
 
iterator begin () const
 iterator on the first constituent More...
 
iterator end () const
 iterator after the last constituent More...
 
iterator begin (JetConstitScale s) const
 iterator at scale More...
 
iterator end (JetConstitScale s) const
 iterator at scale More...
 
JetConstituent operator[] (size_t i) const
 Constituent proxy at position i. More...
 
JetConstituent at (size_t i) const
 Constituent proxy at position i. More...
 
JetConstituent front () const
 first constituent proxy More...
 
JetConstituent back () const
 last constituent proxy More...
 
std::vector< const IParticle * > asIParticleVector () const
 vector of pointer to the underlying IParticles. More...
 
std::vector< JetConstituentasSTLVector ()
 Returns this vector as a std::vector Provided for convenience when dealing with the JetConstituentVector::iterator is not possible. More...
 

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

Definition at line 156 of file JetConstituentVector.h.

◆ 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) {}

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  }

◆ 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);}

◆ 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) ; }

◆ 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:
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
xAOD::JetConstituentVector::at
JetConstituent at(size_t i) const
Constituent proxy at position i.
Definition: JetConstituentVector.cxx:111
xAOD::JetConstituentVector::size
size_t size() const
number of constituents
Definition: JetConstituentVector.cxx:102
JetTiledMap::N
@ N
Definition: TiledEtaPhiMap.h:44
vec
std::vector< size_t > vec
Definition: CombinationsGeneratorTest.cxx:12
xAOD::JetConstituentVector::m_elVector
const std::vector< ElementLink< IParticleContainer > > * m_elVector
Definition: JetConstituentVector.h:201
CxxUtils::vec
typename vecDetail::vec_typedef< T, N >::type vec
Define a nice alias for the vectorized type.
Definition: vec.h:207
lumiFormat.i
int i
Definition: lumiFormat.py:92
plotIsoValidation.el
el
Definition: plotIsoValidation.py:197
xAOD::JetConstituentVector::m_sigState
JetConstitScale m_sigState
Definition: JetConstituentVector.h:202
python.PyAthena.v
v
Definition: PyAthena.py:157
python.compressB64.c
def c
Definition: compressB64.py:93
xAOD::fillJetConstituent
void fillJetConstituent(const IParticle *part, JetConstituent &constit, JetConstitScale sigState)
Definition: JetConstituentVector.cxx:37