ATLAS Offline Software
Public Types | Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Protected Attributes | Private Attributes | Friends | List of all members
JetCollection Class Reference

Container for Jets
More...

#include <JetCollection.h>

Inheritance diagram for JetCollection:
Collaboration diagram for JetCollection:

Public Types

enum  OrderedVar {
  ByEtDown = 0, ByEtUp = 1, ByPtDown = 2, ByPtUp = 3,
  ByEDown = 4, ByEUp = 5, ByEtaUp = 6, ByEtaDown = 7,
  ByAbsEtaUp = 8, ByAbsEtaDown = 9, ByPhiDown = 10, ByPhiUp = 11,
  InEtaPhiDown = 12, InEtaPhiUp = 13, Random = 14
}
 
typedef DataVector< Jet >::iterator iterator
 
typedef BASE DataVector_BASE
 
typedef BASE DVL_BASE
 
typedef BASE::PtrVector PtrVector
 This is the type of the underlying std::vector (what stdcont returns). More...
 
typedef BASE::PtrVector BaseContainer
 
typedef Jet *& reference
 
typedef Jet *constconst_reference
 
typedef BASE::size_type size_type
 
typedef BASE::difference_type difference_type
 
typedef Jetvalue_type
 
typedef BASE::allocator_type allocator_type
 
typedef Jet ** pointer
 
typedef Jet *constconst_pointer
 
typedef const Jetconst_value_type
 
typedef Jet base_value_type
 The T value used as the template parameter. More...
 
typedef std::unique_ptr< base_value_typeunique_type
 Type of a unique_ptr that can be used to insert elements into this container. More...
 
typedef DataModel_detail::ElementProxy< DataVectorElementProxy
 This type is used to proxy lvalue accesses to DataVector elements, in order to handle ownership. More...
 
typedef DataModel_detail::const_iterator< DataVectorconst_iterator
 Standard const_iterator. More...
 
typedef std::reverse_iterator< const_iteratorconst_reverse_iterator
 Standard const_reverse_iterator. More...
 
typedef std::reverse_iterator< iteratorreverse_iterator
 Standard reverse_iterator. More...
 
typedef DataVector base_data_vector
 
using Deleter = typename BASE::Deleter
 
typedef DataVector< Jet, BASE > self
 A helper typedef. More...
 

Public Member Functions

 JetCollection (SG::OwnershipPolicy own=SG::OWN_ELEMENTS)
 
virtual ~JetCollection ()
 
bool isOrdered (JetCollection::OrderedVar ordering=JetCollection::ByEtDown) const
 
void setOrdered (JetCollection::OrderedVar ordered)
 
JetCollection::OrderedVar ordered () const
 
void push_back (Jet *j)
 
iterator insert (iterator position, Jet *j)
 
template<class InputIterator >
void insert (iterator position, InputIterator first, InputIterator last)
 
void clear ()
 
void clear (SG::OwnershipPolicy ownPolicy)
 
void setAuthor (const std::string &author)
 
std::string author () const
 
const JetMomentMapgetMomentMap () const
 
std::string getMomentMapName () const
 
JetKeyDescriptorInstancekeyDesc () const
 
const fastjet::ClusterSequence * fastjetClustSeq () const
 Access to the internal fastjet object. CAN RETURN NULL, see the description of m_pseudoJet. More...
 
void setFastjetClustSeq (const fastjet::ClusterSequence *cs)
 
Size and capacity.
size_type size () const noexcept
 Returns the number of elements in the collection. More...
 
void resize (size_type sz)
 Resizes the collection to the specified number of elements. More...
 
void reserve (size_type n)
 Attempt to preallocate enough memory for a specified number of elements. More...
 
Element access.

Change the vector capacity to match the current size.

Note: this does not affect auxiliary data.

const Jetoperator[] (size_type n) const
 Access an element, as an rvalue. More...
 
ElementProxy operator[] (size_type n)
 Access an element, as an lvalue. More...
 
const Jetget (size_type n) const
 Access an element, as an rvalue. More...
 
const Jetat (size_type n) const
 Access an element, as an rvalue. More...
 
ElementProxy at (size_type n)
 Access an element, as an lvalue. More...
 
const Jetfront () const
 Access the first element in the collection as an rvalue. More...
 
ElementProxy front ()
 Access the first element in the collection as an lvalue. More...
 
const Jetback () const
 Access the last element in the collection as an rvalue. More...
 
ElementProxy back ()
 Access the last element in the collection as an lvalue. More...
 
Iterator creation.
const_iterator begin () const noexcept
 Return a const_iterator pointing at the beginning of the collection. More...
 
iterator begin () noexcept
 Return an iterator pointing at the beginning of the collection. More...
 
const_iterator end () const noexcept
 Return a const_iterator pointing past the end of the collection. More...
 
iterator end () noexcept
 Return an iterator pointing past the end of the collection. More...
 
const_reverse_iterator rbegin () const noexcept
 Return a const_reverse_iterator pointing past the end of the collection. More...
 
reverse_iterator rbegin () noexcept
 Return a reverse_iterator pointing past the end of the collection. More...
 
const_reverse_iterator rend () const noexcept
 Return a const_reverse_iterator pointing at the beginning of the collection. More...
 
reverse_iterator rend () noexcept
 Return a reverse_iterator pointing at the beginning of the collection. More...
 
const_iterator cbegin () const noexcept
 Return a const_iterator pointing at the beginning of the collection. More...
 
const_iterator cend () const noexcept
 Return a const_iterator pointing past the end of the collection. More...
 
const_reverse_iterator crbegin () const noexcept
 Return a const_reverse_iterator pointing past the end of the collection. More...
 
const_reverse_iterator crend () const noexcept
 Return a const_reverse_iterator pointing at the beginning of the collection. More...
 
Constructors, destructors, assignment.
void assign (InputIterator first, InputIterator last)
 Assign from iterators. More...
 
void assign (std::initializer_list< value_type > l)
 
Size and capacity.
size_type size () const noexcept
 Returns the number of elements in the collection. More...
 
void resize (size_type sz)
 Resizes the collection to the specified number of elements. More...
 
void reserve (size_type n)
 Attempt to preallocate enough memory for a specified number of elements. More...
 
Element access.

Change the vector capacity to match the current size.

Note: this does not affect auxiliary data.

const Jetoperator[] (size_type n) const
 Access an element, as an rvalue. More...
 
ElementProxy operator[] (size_type n)
 Access an element, as an lvalue. More...
 
const Jetget (size_type n) const
 Access an element, as an rvalue. More...
 
const Jetat (size_type n) const
 Access an element, as an rvalue. More...
 
ElementProxy at (size_type n)
 Access an element, as an lvalue. More...
 
const Jetfront () const
 Access the first element in the collection as an rvalue. More...
 
ElementProxy front ()
 Access the first element in the collection as an lvalue. More...
 
const Jetback () const
 Access the last element in the collection as an rvalue. More...
 
ElementProxy back ()
 Access the last element in the collection as an lvalue. More...
 
Iterator creation.
const_iterator begin () const noexcept
 Return a const_iterator pointing at the beginning of the collection. More...
 
iterator begin () noexcept
 Return an iterator pointing at the beginning of the collection. More...
 
const_iterator end () const noexcept
 Return a const_iterator pointing past the end of the collection. More...
 
iterator end () noexcept
 Return an iterator pointing past the end of the collection. More...
 
const_reverse_iterator rbegin () const noexcept
 Return a const_reverse_iterator pointing past the end of the collection. More...
 
reverse_iterator rbegin () noexcept
 Return a reverse_iterator pointing past the end of the collection. More...
 
const_reverse_iterator rend () const noexcept
 Return a const_reverse_iterator pointing at the beginning of the collection. More...
 
reverse_iterator rend () noexcept
 Return a reverse_iterator pointing at the beginning of the collection. More...
 
const_iterator cbegin () const noexcept
 Return a const_iterator pointing at the beginning of the collection. More...
 
const_iterator cend () const noexcept
 Return a const_iterator pointing past the end of the collection. More...
 
const_reverse_iterator crbegin () const noexcept
 Return a const_reverse_iterator pointing past the end of the collection. More...
 
const_reverse_iterator crend () const noexcept
 Return a const_reverse_iterator pointing at the beginning of the collection. More...
 
Insertion operations.
value_type push_back (value_type pElem)
 Add an element to the end of the collection. More...
 
value_type push_back (std::unique_ptr< base_value_type > pElem)
 Add an element to the end of the collection. More...
 
value_type emplace_back (value_type pElem)
 Add an element to the end of the collection. More...
 
iterator insert (iterator position, value_type pElem)
 Add a new element to the collection. More...
 
iterator insert (iterator position, std::unique_ptr< base_value_type > pElem)
 Add a new element to the collection. More...
 
void insert (iterator position, InputIterator first, InputIterator last)
 Add a group of new elements to the collection. More...
 
void insert (iterator position, std::initializer_list< value_type > l)
 Add a group of new elements to the collection. More...
 
iterator emplace (iterator position, value_type pElem)
 Add a new element to the collection. More...
 
void insertMove (iterator position, DataVector &other)
 Insert the contents of another DataVector, with auxiliary data copied via move semantics. More...
 
Erasure operations.
iterator erase (iterator position)
 Remove element at a given position. More...
 
iterator erase (iterator first, iterator last)
 Remove a range of elements. More...
 
void pop_back ()
 Remove the last element from the collection. More...
 

Public Attributes

DataLink< JetKeyDescriptorm_keyStore
 link to the JetKeyDescriptor is mandatory for persistency. Access done through the JetKeyDescriptorInstance More...
 
ROOT_SELECTION_NS::MemberAttributes< kTransient > m_isMostDerived
 Automatically generate dictionary for contained vector. More...
 
ROOT_SELECTION_NS::MemberAttributes< kTransient > m_deleter
 
ROOT_SELECTION_NS::MemberAttributes< kTransient > m_ownPolicy
 We do not want to save this. More...
 

Static Public Attributes

static const bool has_virtual
 This is true for any DataVector class if we need to use virtual derivation to get to the base DataVector class. More...
 
static constexpr bool must_own
 If true, then this type must own its contents. More...
 

Protected Member Functions

size_t getNextId ()
 
void acquireJet (Jet *j)
 
void recordedInSG (std::string key)
 
void resetJetId (std::size_t)
 

Protected Attributes

DataLink< JetMomentMapm_momentMapLink
 
size_t m_jetAuthor
 the author of this jetcollection. More...
 
size_t m_nextId
 the next free identifier for jets inside this collection More...
 
JetKeyDescriptorInstance m_keyDescInstance
 This JetKeyDescriptorInstance points by default to the global JetKeyDescriptorInstance's store. It is redirected to the key store from the input file when read out. This allows 2 events to be read at the same time. More...
 
bool m_ownMap
 false if the map is recorded in SG More...
 
const fastjet::ClusterSequence * m_fastjetClustSeq
 Pointer to the fastjet object this jet is build from. More...
 

Private Attributes

OrderedVar m_ordered
 

Friends

class JetCollectionCnv_p6
 

Swap and sort.

void swap (DataVector &rhs)
 Swap this collection with another. More...
 
void sort ()
 Sort the container. More...
 
void sort (COMPARE comp)
 Sort the container with a user-specified comparison operator. More...
 
static void iter_swap (iterator a, iterator b)
 Swap the referents of two DataVector iterators. More...
 

Non-standard operations.

void resize (size_type sz)
 
void pop_back ()
 
void clear (SG::OwnershipPolicy ownPolicy, SG::IndexTrackingPolicy trackIndices)
 
void clear (std::unique_ptr< Deleter > deleter)
 Erase all the elements in the collection, and change how elements are to be deleted. More...
 
void swapElement (size_type index, value_type newElem, reference oldElem)
 Swap one element out of the container. More...
 
void swapElement (iterator pos, value_type newElem, reference oldElem)
 Swap one element out of the container. More...
 
void swapElement (size_type index, std::unique_ptr< base_value_type > newElem, std::unique_ptr< base_value_type > &oldElem)
 Swap one element out of the container. More...
 
void swapElement (iterator pos, std::unique_ptr< base_value_type > newElem, std::unique_ptr< base_value_type > &oldElem)
 Swap one element out of the container. More...
 
virtual const DataModel_detail::DVLInfoBasedvlinfo_v () const
 Return the DV/DL info struct for this class. More...
 
const SG::AuxVectorBaseauxbase () const
 Convert to AuxVectorBase. More...
 
size_type max_size () const noexcept
 Returns the size() of the largest possible collection. More...
 
size_type capacity () const noexcept
 Returns the total number of elements that the collection can hold before needing to allocate more memory. More...
 
bool empty () const noexcept
 Returns true if the collection is empty. More...
 
void shrink_to_fit ()
 
const PtrVectorstdcont () const
 Return the underlying std::vector of the container. More...
 
SG::OwnershipPolicy ownPolicy () const
 Return the ownership policy setting for this container. More...
 
static const DataModel_detail::DVLInfoBasedvlinfo ()
 Return the DV/DL info struct for this class. More...
 
static int baseOffset (const std::type_info &ti)
 Return the offset of a base DataVector class. More...
 

Internal operations.

SG::IsMostDerivedFlag m_isMostDerived
 This flag is true if this DV instance is the most-derived one. More...
 
void resortAux (iterator beg, iterator end)
 Reset indices / reorder aux data after elements have been permuted. More...
 
void testInsert (const char *op)
 Test if we can insert; raise an exception if not. More...
 
void testInsertOol (const char *op)
 Test if we can insert; raise an exception if not. More...
 
void clearMostDerived ()
 Clear m_isMostDerived for this instance and for all bases. More...
 
virtual void setMostDerived ()
 Set m_isMostDerived for this instance and clear it for all bases. More...
 
typedef ROOT_SELECTION_NS::DataVector< Jet, DataVector_BASE >::self self
 
static int baseOffset1 (const char *p, const DataVector &dv, const std::type_info &ti)
 Helper for baseOffset. More...
 
static const Jetdo_cast (const typename PtrVector::value_type p)
 Helper to shorten calls to DataModel_detail::DVLCast. More...
 
static Jetdo_cast_nc (typename PtrVector::value_type p)
 Helper to shorten calls to DataModel_detail::DVLCast. More...
 
void assignElement (typename BaseContainer::iterator pos, value_type newElem)
 Handle element assignment. More...
 
void assignElement (typename BaseContainer::iterator pos, std::unique_ptr< base_value_type > newElem)
 Handle element assignment. More...
 
void assignBaseElement (typename BaseContainer::iterator pos, typename BaseContainer::value_type newElem)
 Handle element assignment from a base pointer. More...
 
void shift (size_t pos, ptrdiff_t offs)
 Shift the auxiliary elements of the container. More...
 
virtual const std::type_info & dv_typeid () const
 Find the most-derived DataVector class in the hierarchy. More...
 

Detailed Description

Container for Jets


JetCollection is a DataVector of Jets. It is the main data object and acts as a central point for all jet related software.
It holds a JetMomentMap and JetKeyDescriptorInstance which it serves to the jets it holds.

It redefines the push_back and insert method in order to

It also defines an order enum (OrderedVar), and holds the order status
of the collection (ByEtDown, ByEtUp,etc..)

IMPORTANT* : one should not record this object by using StoreGate::record(), but rather use the JetCollectionHelper::record(). The reason is this function performs all the necessary operations needed to deal with the JetMomentMap.

Definition at line 29 of file JetCollection.h.

Member Typedef Documentation

◆ allocator_type

typedef BASE::allocator_type DataVector< Jet , BASE >::allocator_type
inherited

Definition at line 816 of file DataVector.h.

◆ base_data_vector

typedef DataVector DataVector< Jet , BASE >::base_data_vector
inherited

Definition at line 853 of file DataVector.h.

◆ base_value_type

typedef Jet DataVector< Jet , BASE >::base_value_type
inherited

The T value used as the template parameter.

Note that this is different from value_type (that's T*).

Definition at line 824 of file DataVector.h.

◆ BaseContainer

typedef BASE::PtrVector DataVector< Jet , BASE >::BaseContainer
inherited

Definition at line 806 of file DataVector.h.

◆ const_iterator

Standard const_iterator.

Definition at line 837 of file DataVector.h.

◆ const_pointer

typedef Jet * const* DataVector< Jet , BASE >::const_pointer
inherited

Definition at line 818 of file DataVector.h.

◆ const_reference

typedef Jet * const& DataVector< Jet , BASE >::const_reference
inherited

Definition at line 812 of file DataVector.h.

◆ const_reverse_iterator

typedef std::reverse_iterator<const_iterator> DataVector< Jet , BASE >::const_reverse_iterator
inherited

Standard const_reverse_iterator.

Definition at line 846 of file DataVector.h.

◆ const_value_type

typedef const Jet * DataVector< Jet , BASE >::const_value_type
inherited

Definition at line 820 of file DataVector.h.

◆ DataVector_BASE

typedef BASE DataVector< Jet , BASE >::DataVector_BASE
inherited

Definition at line 796 of file DataVector.h.

◆ Deleter

using DataVector< Jet , BASE >::Deleter = typename BASE::Deleter
inherited

Definition at line 856 of file DataVector.h.

◆ difference_type

typedef BASE::difference_type DataVector< Jet , BASE >::difference_type
inherited

Definition at line 814 of file DataVector.h.

◆ DVL_BASE

typedef BASE DataVector< Jet , BASE >::DVL_BASE
inherited

Definition at line 797 of file DataVector.h.

◆ ElementProxy

This type is used to proxy lvalue accesses to DataVector elements, in order to handle ownership.

Definition at line 832 of file DataVector.h.

◆ iterator

Definition at line 34 of file JetCollection.h.

◆ pointer

typedef Jet ** DataVector< Jet , BASE >::pointer
inherited

Definition at line 817 of file DataVector.h.

◆ PtrVector

typedef BASE::PtrVector DataVector< Jet , BASE >::PtrVector
inherited

This is the type of the underlying std::vector (what stdcont returns).

Definition at line 805 of file DataVector.h.

◆ reference

typedef Jet *& DataVector< Jet , BASE >::reference
inherited

Definition at line 811 of file DataVector.h.

◆ reverse_iterator

typedef std::reverse_iterator<iterator> DataVector< Jet , BASE >::reverse_iterator
inherited

Standard reverse_iterator.

Note that lvalue references here will yield an ElementProxy, not a reference.

Definition at line 851 of file DataVector.h.

◆ self [1/2]

typedef ROOT_SELECTION_NS::DataVector<Jet , DataVector_BASE>::self DataVector< Jet , BASE >::self
privateinherited

Definition at line 2042 of file DataVector.h.

◆ self [2/2]

typedef DataVector< Jet , BASE > DataVector< Jet , BASE >::self
inherited

A helper typedef.

Definition at line 3428 of file DataVector.h.

◆ size_type

typedef BASE::size_type DataVector< Jet , BASE >::size_type
inherited

Definition at line 813 of file DataVector.h.

◆ unique_type

typedef std::unique_ptr<base_value_type> DataVector< Jet , BASE >::unique_type
inherited

Type of a unique_ptr that can be used to insert elements into this container.

Definition at line 828 of file DataVector.h.

◆ value_type

typedef Jet * DataVector< Jet , BASE >::value_type
inherited

Definition at line 815 of file DataVector.h.

Member Enumeration Documentation

◆ OrderedVar

Enumerator
ByEtDown 
ByEtUp 
ByPtDown 
ByPtUp 
ByEDown 
ByEUp 
ByEtaUp 
ByEtaDown 
ByAbsEtaUp 
ByAbsEtaDown 
ByPhiDown 
ByPhiUp 
InEtaPhiDown 
InEtaPhiUp 
Random 

Definition at line 35 of file JetCollection.h.

35  { ByEtDown = 0,
36  ByEtUp = 1,
37  ByPtDown = 2,
38  ByPtUp = 3,
39  ByEDown = 4,
40  ByEUp = 5,
41  ByEtaUp = 6,
42  ByEtaDown = 7,
43  ByAbsEtaUp = 8,
44  ByAbsEtaDown = 9,
45  ByPhiDown = 10,
46  ByPhiUp = 11,
47  InEtaPhiDown = 12,
48  InEtaPhiUp = 13,
49  Random = 14 };

Constructor & Destructor Documentation

◆ JetCollection()

JetCollection::JetCollection ( SG::OwnershipPolicy  own = SG::OWN_ELEMENTS)

Definition at line 9 of file JetCollection.cxx.

9  :
10  DataVector<Jet>(own),
14  m_keyDescInstance(false),
15  m_ownMap(false),
16  m_fastjetClustSeq(nullptr)
17 {
18  // by default the keyDescInstance points to the global s_instance's stores .
19  // The JetCollection cnv replaces that by the store read from file.
20  if( ! JetKeyDescriptorInstance::instance()->m_ConstStores ) JetKeyDescriptorInstance::instance()->createKeyStore(); // this may happen inside Trigger navigation system
23 }

◆ ~JetCollection()

JetCollection::~JetCollection ( )
virtual

Definition at line 24 of file JetCollection.cxx.

24  {
25 
26  //std::cout << " JetCollection deleting " << m_jetAuthor <<std::endl;
28  // remove myself from my jets. Otherwise, they might invoke me
29  // in their destructors.
30  iterator it = begin();
31  iterator itE = end();
32  for(;it != itE; ++it){
33  (*it)->m_collection = nullptr;
34  }
35  }
36 
37  if( (m_ownMap) && m_momentMapLink.isValid() ) {
38  delete m_momentMapLink.cptr();
39  }
40 
41 }

Member Function Documentation

◆ acquireJet()

void JetCollection::acquireJet ( Jet j)
protected

Definition at line 105 of file JetCollection.cxx.

105  {
106  // If the jet is orphan, adopt it
107  // this means : acquire its moments if they exist and give it an Id
108  // otherwise, we do nothing.
109 
110  if ( j->parentCollection() && (m_ownPolicy == SG::OWN_ELEMENTS )) return ; // this case is very bad anyway, there will be problems, we can't do anything.
111 
112  // In the case this collection has no author, simply acquire those from the jet.
114  std::string viewS = "";
115  if( m_ownPolicy == SG::VIEW_ELEMENTS ) viewS ="View"; // We want to distinguish the name from the jet's original collection.
116  m_jetAuthor = keyDesc()->getIndex(JetKeyConstants::InfoCat,j->jetAuthor()+viewS,true); // use the real jetAuthor() (m_jetAuthor index
117  }
118  // std::cout << " acquireJet jid="<<j->id() <<" "<<author()<<std::endl;
119 
120  size_t oldId = j->id();
122  if( oldId != Jet::s_defaultJetId ){
123  // jet might have moments to be tranfered
124  const JetMomentMap *jmap = j->getMomentMap();
125  // The moment map associated to this collection has the same m_ownPolicy,
126  // so the call knows how to deal the moments (i.e. copy or move)
127  if( jmap ){ getMomentMap()->transferRecord( jmap, oldId, j->id() ); }
128 
129  }
130  // set myself as this jet parent now (not before !) if needed
131  if( m_ownPolicy == SG::OWN_ELEMENTS ) j->m_collection = this;
132 
133 }

◆ assign() [1/2]

void DataVector< Jet , BASE >::assign ( InputIterator  first,
InputIterator  last 
)
inherited

Assign from iterators.

Parameters
firstThe start of the range to put in the container.
lastThe end of the range to put in the container.

Any existing owned elements will be released. The DataVector's ownership policy determines whether it will take ownership of the new elements.

◆ assign() [2/2]

void DataVector< Jet , BASE >::assign ( std::initializer_list< value_type l)
inherited
Parameters
lAn initializer list.

Any existing owned elements will be released. The DataVector's ownership policy determines whether it will take ownership of the new elements.

◆ assignBaseElement()

void DataVector< Jet , BASE >::assignBaseElement ( typename BaseContainer::iterator  pos,
typename BaseContainer::value_type  newElem 
)
privateinherited

Handle element assignment from a base pointer.

Parameters
posPosition in the container to assign.
newElemThe new element to assign.

The old element is freed if this container owns elements. Auxiliary data are copied if appropriate.

◆ assignElement() [1/2]

void DataVector< Jet , BASE >::assignElement ( typename BaseContainer::iterator  pos,
std::unique_ptr< base_value_type newElem 
)
privateinherited

Handle element assignment.

Parameters
posPosition in the container to assign.
newElemThe new element to assign.

The container must own its elements. Auxiliary data are copied if appropriate.

◆ assignElement() [2/2]

void DataVector< Jet , BASE >::assignElement ( typename BaseContainer::iterator  pos,
value_type  newElem 
)
privateinherited

Handle element assignment.

Parameters
posPosition in the container to assign.
newElemThe new element to assign.

The old element is freed if this container owns elements. Auxiliary data are copied if appropriate.

◆ at() [1/2]

ElementProxy DataVector< Jet , BASE >::at ( size_type  n)
inherited

Access an element, as an lvalue.

Parameters
nArray index to access.
Returns
Proxy to the element at n.

Will raise std::out_of_range if the index is out-of-bounds. Note that we return a proxy object rather than a reference; the proxy will handle deleting an owned element if it's assigned to.

◆ at() [2/2]

const Jet * DataVector< Jet , BASE >::at ( size_type  n) const
inherited

Access an element, as an rvalue.

Parameters
nArray index to access.
Returns
The element at n.

Will raise std::out_of_range if the index is out-of-bounds. Note that we return a const T* rather than a reference.

◆ author()

std::string JetCollection::author ( ) const

Definition at line 136 of file JetCollection.cxx.

137 {
139 }

◆ auxbase()

const SG::AuxVectorBase& DataVector< Jet , BASE >::auxbase
inherited

Convert to AuxVectorBase.

Needed to get AuxVectorBase from a ConstDataVector. Present in DataVector as well for consistency. We only really need it in the base class; however, root6 fails constructing a TMethodCall for this if there is virtual derivation. A workaround is to redeclare this in the derived classes too.

◆ back() [1/2]

ElementProxy DataVector< Jet , BASE >::back
inherited

Access the last element in the collection as an lvalue.

Returns
Proxy to the last element in the collection.

No checking is done to ensure that the container is not empty. Note that we return a proxy object rather than a reference; the proxy will handle deleting an owned element if it's assigned to.

◆ back() [2/2]

const Jet * DataVector< Jet , BASE >::back
inherited

Access the last element in the collection as an rvalue.

Returns
The last element in the collection.

No checking is done to ensure that the container is not empty. Note that we return a const T* rather than a reference.

◆ baseOffset()

static int DataVector< Jet , BASE >::baseOffset ( const std::type_info &  ti)
staticinherited

Return the offset of a base DataVector class.

Parameters
tistd::type_info of the desired class.

If ti represents a DataVector base class of this one, then return the offset of that base class. Otherwise, return -1.

This function is here due to limitations of root 6, which can't calculate these offsets correctly from the dictionary if virtual derivation is used.

◆ baseOffset1()

static int DataVector< Jet , BASE >::baseOffset1 ( const char *  p,
const DataVector< Jet > &  dv,
const std::type_info &  ti 
)
staticinherited

Helper for baseOffset.

Parameters
pPointer to the start of the top-level object.
dvReference to the DataVector object.
tistd::type_info of the desired class.

If ti represents a DataVector base class of this one, then return the offset of that base class. Otherwise, return -1.

◆ begin() [1/2]

const_iterator DataVector< Jet , BASE >::begin
noexceptinherited

Return a const_iterator pointing at the beginning of the collection.

Returns
A const_iterator.

Note that dereferencing the iterator will yield a const T* rather than a reference.

◆ begin() [2/2]

iterator DataVector< Jet , BASE >::begin
noexceptinherited

Return an iterator pointing at the beginning of the collection.

Returns
An iterator.

Note that dereferencing the iterator will yield a proxy rather than a reference; the proxy will handle deleting an owned element if it's assigned to.

◆ capacity()

size_type DataVector< Jet , BASE >::capacity
noexceptinherited

Returns the total number of elements that the collection can hold before needing to allocate more memory.

◆ cbegin()

const_iterator DataVector< Jet , BASE >::cbegin
noexceptinherited

Return a const_iterator pointing at the beginning of the collection.

Returns
A const_iterator.

Note that dereferencing the iterator will yield a const T* rather than a reference.

◆ cend()

const_iterator DataVector< Jet , BASE >::cend
noexceptinherited

Return a const_iterator pointing past the end of the collection.

Returns
A const_iterator.

Note that dereferencing the iterator will yield a const T* rather than a reference.

◆ clear() [1/4]

void JetCollection::clear ( )

Definition at line 93 of file JetCollection.cxx.

94 {
97 }

◆ clear() [2/4]

void JetCollection::clear ( SG::OwnershipPolicy  ownPolicy)

Definition at line 99 of file JetCollection.cxx.

◆ clear() [3/4]

void DataVector< Jet , BASE >::clear ( SG::OwnershipPolicy  ownPolicy,
SG::IndexTrackingPolicy  trackIndices 
)
inherited

◆ clear() [4/4]

void DataVector< Jet , BASE >::clear ( std::unique_ptr< Deleter deleter)
inherited

Erase all the elements in the collection, and change how elements are to be deleted.

Parameters
deleterObject to be used to delete object. Passing nullptr will change back to the default.

If the container owns its elements, then the removed elements will be deleted. Any duplicates will be removed in this process, but don't rely on this. After the current elements are deleted, the Deleter object is changed.

◆ clearMostDerived()

void DataVector< Jet , BASE >::clearMostDerived
protectedinherited

Clear m_isMostDerived for this instance and for all bases.

Called from the constructor after setting m_isMostDerived.

◆ crbegin()

const_reverse_iterator DataVector< Jet , BASE >::crbegin
noexceptinherited

Return a const_reverse_iterator pointing past the end of the collection.

Returns
A const_reverse_iterator.

Note that dereferencing the iterator will yield a const T* rather than a reference.

◆ crend()

const_reverse_iterator DataVector< Jet , BASE >::crend
noexceptinherited

Return a const_reverse_iterator pointing at the beginning of the collection.

Returns
A const_reverse_iterator.

Note that dereferencing the iterator will yield a const T* rather than a reference.

◆ do_cast()

static const Jet * DataVector< Jet , BASE >::do_cast ( const typename PtrVector::value_type  p)
staticinherited

Helper to shorten calls to DataModel_detail::DVLCast.

Parameters
pThe value to convert.
Returns
The value as a const T*.

The conversion will be done with static_cast if possible, with dynamic_cast otherwise.

◆ do_cast_nc()

static Jet * DataVector< Jet , BASE >::do_cast_nc ( typename PtrVector::value_type  p)
staticinherited

Helper to shorten calls to DataModel_detail::DVLCast.

Parameters
pThe value to convert.
Returns
The value as a T*.

The conversion will be done with static_cast if possible, with dynamic_cast otherwise.

◆ dv_typeid()

virtual const std::type_info& DataVector< Jet , BASE >::dv_typeid
privatevirtualinherited

Find the most-derived DataVector class in the hierarchy.

Returns
The type_info for the class for which this method gets run.

This is used to generate a nice error message when the most-derived check for insertions fails. Every DataVector defines this virtual method, so when it's called, the one corresponding to the most-derived DataVector gets run.

◆ dvlinfo()

static const DataModel_detail::DVLInfoBase& DataVector< Jet , BASE >::dvlinfo
staticinherited

Return the DV/DL info struct for this class.

This can be used to make sure that it's instantiated.

◆ dvlinfo_v()

virtual const DataModel_detail::DVLInfoBase& DataVector< Jet , BASE >::dvlinfo_v
virtualinherited

Return the DV/DL info struct for this class.

This can be used to make sure that it's instantiated.

◆ emplace()

iterator DataVector< Jet , BASE >::emplace ( iterator  position,
value_type  pElem 
)
inherited

Add a new element to the collection.

Parameters
positionIterator before which the element will be added.
pElemThe element to add to the collection.
Returns
An iterator that points to the inserted data.

The container's ownership policy will determine if it takes ownership of the new element.

Note: this method may only be called using the most derived DataVector in the hierarchy.

For DataVector, this is just the same as insert. It's included just for interface compatibility with std::vector.

◆ emplace_back()

value_type DataVector< Jet , BASE >::emplace_back ( value_type  pElem)
inherited

Add an element to the end of the collection.

Parameters
pElemThe element to add to the collection.

The container's ownership policy will determine if it takes ownership of the new element.

Note: this method may only be called using the most derived DataVector in the hierarchy.

For DataVector, this is like the same as push_back, and it returns the pushed element. It's included just for interface compatibility with std::vector.

◆ empty()

bool DataVector< Jet , BASE >::empty
noexceptinherited

Returns true if the collection is empty.

◆ end() [1/2]

const_iterator DataVector< Jet , BASE >::end
noexceptinherited

Return a const_iterator pointing past the end of the collection.

Returns
A const_iterator.

Note that dereferencing the iterator will yield a const T* rather than a reference.

◆ end() [2/2]

iterator DataVector< Jet , BASE >::end
noexceptinherited

Return an iterator pointing past the end of the collection.

Returns
An iterator.

Note that dereferencing the iterator will yield a proxy rather than a reference; the proxy will handle deleting an owned element if it's assigned to.

◆ erase() [1/2]

iterator DataVector< Jet , BASE >::erase ( iterator  first,
iterator  last 
)
inherited

Remove a range of elements.

Parameters
firstIterator pointing to the first element to be removed.
lastIterator pointing one past the last element to be removed.
Returns
An iterator pointing to the element pointed to by last prior to erasing (or end()).

If the container owns its elements, then the removed elements will be deleted. Any duplicates will be removed in this process, but don't rely on this.

◆ erase() [2/2]

iterator DataVector< Jet , BASE >::erase ( iterator  position)
inherited

Remove element at a given position.

Parameters
positionIterator pointing to the element to be removed.
Returns
An iterator pointing to the next element (or end()).

If the container owns its elements, then the pointed-to element will be deleted.

◆ fastjetClustSeq()

const fastjet::ClusterSequence* JetCollection::fastjetClustSeq ( ) const
inline

Access to the internal fastjet object. CAN RETURN NULL, see the description of m_pseudoJet.

Definition at line 143 of file JetCollection.h.

143 {return m_fastjetClustSeq;}

◆ front() [1/2]

ElementProxy DataVector< Jet , BASE >::front
inherited

Access the first element in the collection as an lvalue.

Returns
Proxy to the first element in the collection.

No checking is done to ensure that the container is not empty. Note that we return a proxy object rather than a reference; the proxy will handle deleting an owned element if it's assigned to.

◆ front() [2/2]

const Jet * DataVector< Jet , BASE >::front
inherited

Access the first element in the collection as an rvalue.

Returns
The first element in the collection.

No checking is done to ensure that the container is not empty. Note that we return a const T* rather than a reference.

◆ get()

const Jet * DataVector< Jet , BASE >::get ( size_type  n) const
inherited

Access an element, as an rvalue.

Parameters
nArray index to access.
Returns
The element at n.

This is a synonym for operator[] const, to be used when calling from root (where we can't readily call just the const version of a method).

◆ getMomentMap()

const JetMomentMap * JetCollection::getMomentMap ( ) const

Definition at line 53 of file JetCollection.cxx.

53  {
54 
55  //std::cout << "asking map in "<< author() << std::endl;
56  if ( !m_momentMapLink.isValid() ) {
57  // we first try to retrieve it :
58  std::string mapname = getMomentMapName();
59  m_momentMapLink.toIdentifiedObject ( mapname); // by name, because we don't use DataLink_p2 class yet
60 
61  //m_momentMapLink->access(); // this hsould work whe we use DataLink_p2 P class.
62 
63  //std::cout << "Datalink invalid set "<< mapname << std::endl;
64  if ( !m_momentMapLink.isValid() ) {
65  //std::cout << "Datalink invalid create map "<< mapname << std::endl;
66  // Nothing available from SG/disk. We create the map
67  JetMomentMap* map = new JetMomentMap();
68  map->m_ownPolicy = m_ownPolicy;
70  // This means we own it !
71  m_ownMap = true;
72  }
73  }
74 
75  return m_momentMapLink.cptr();
76 }

◆ getMomentMapName()

std::string JetCollection::getMomentMapName ( ) const

Definition at line 47 of file JetCollection.cxx.

47  {
48  std::string mapname = author();
49  mapname +="MomentMap";
50  return mapname;
51 }

◆ getNextId()

size_t JetCollection::getNextId ( )
protected

Definition at line 78 of file JetCollection.cxx.

78  {
79  return m_nextId++; // this returns m_nextId *then* increments it
80 }

◆ insert() [1/6]

template<class InputIterator >
void JetCollection::insert ( iterator  position,
InputIterator  first,
InputIterator  last 
)

Definition at line 158 of file JetCollection.h.

158  {
159  InputIterator it = first;
160  for(; it != last; ++it) acquireJet(*it);
161  DataVector<Jet>::insert(position,first,last);
162 }

◆ insert() [2/6]

void DataVector< Jet , BASE >::insert ( iterator  position,
InputIterator  first,
InputIterator  last 
)
inherited

Add a group of new elements to the collection.

Parameters
positionIterator before which the element will be added.
firstThe start of the range to put in the container.
lastThe end of the range to put in the container.

The container's ownership policy will determine if it takes ownership of the new element.

Note: this method may only be called using the most derived DataVector in the hierarchy.

This overload is for the case where the iterator value type is convertible to T*.

◆ insert() [3/6]

JetCollection::iterator JetCollection::insert ( JetCollection::iterator  position,
Jet j 
)

Definition at line 88 of file JetCollection.cxx.

88  {
89  acquireJet(j);
90  return DataVector<Jet>::insert(position,j);
91 }

◆ insert() [4/6]

void DataVector< Jet , BASE >::insert ( iterator  position,
std::initializer_list< value_type l 
)
inherited

Add a group of new elements to the collection.

Parameters
positionIterator before which the element will be added.
lAn initializer list.

The container's ownership policy will determine if it takes ownership of the new element.

Note: this method may only be called using the most derived DataVector in the hierarchy.

◆ insert() [5/6]

iterator DataVector< Jet , BASE >::insert ( iterator  position,
std::unique_ptr< base_value_type pElem 
)
inherited

Add a new element to the collection.

Parameters
positionIterator before which the element will be added.
pElemThe element to add to the collection.
Returns
An iterator that points to the inserted data.

The container must be an owning container.

Note: this method may only be called using the most derived DataVector in the hierarchy.

◆ insert() [6/6]

iterator DataVector< Jet , BASE >::insert ( iterator  position,
value_type  pElem 
)
inherited

Add a new element to the collection.

Parameters
positionIterator before which the element will be added.
pElemThe element to add to the collection.
Returns
An iterator that points to the inserted data.

The container's ownership policy will determine if it takes ownership of the new element.

Note: this method may only be called using the most derived DataVector in the hierarchy.

◆ insertMove()

void DataVector< Jet , BASE >::insertMove ( iterator  position,
DataVector< Jet > &  other 
)
inherited

Insert the contents of another DataVector, with auxiliary data copied via move semantics.

Parameters
positionIterator before which the new elements will be added.
otherThe vector to add.

The ownership mode of this vector must be the same as other; otherwise, an exception will be thrown.

If both vectors are view vectors, then this is the same as insert (position, other.begin(), other.end()) .

Otherwise, the elements from other will be inserted into this vector. This vector will take ownership of the elements, and the ownership mode of other will be changed to VIEW_ELEMENTS. Auxiliary data for these elements will be transferred, using move semantics if possible. (Thus, the auxiliary store for other may be modified and must not be locked.) Finally, the auxiliary store pointer for other will be cleared (but the store itself will not be deleted since it's not owned by the vector).

Note: this method may only be called using the most derived DataVector in the hierarchy.

◆ isOrdered()

bool JetCollection::isOrdered ( JetCollection::OrderedVar  ordering = JetCollection::ByEtDown) const
inline

Definition at line 62 of file JetCollection.h.

63  { return ordering == m_ordered; };

◆ iter_swap()

static void DataVector< Jet , BASE >::iter_swap ( iterator  a,
iterator  b 
)
staticinherited

Swap the referents of two DataVector iterators.

Parameters
aThe first iterator for the swap.
bThe second iterator for the swap.

◆ keyDesc()

JetKeyDescriptorInstance * JetCollection::keyDesc ( ) const

Definition at line 43 of file JetCollection.cxx.

43  {
44  return &m_keyDescInstance;
45 }

◆ max_size()

size_type DataVector< Jet , BASE >::max_size
noexceptinherited

Returns the size() of the largest possible collection.

◆ operator[]() [1/2]

ElementProxy DataVector< Jet , BASE >::operator[] ( size_type  n)
inherited

Access an element, as an lvalue.

Parameters
nArray index to access.
Returns
Proxy to the element at n.

No bounds checking is done. Note that we return a proxy object rather than a reference; the proxy will handle deleting an owned element if it's assigned to.

◆ operator[]() [2/2]

const Jet * DataVector< Jet , BASE >::operator[] ( size_type  n) const
inherited

Access an element, as an rvalue.

Parameters
nArray index to access.
Returns
The element at n.

No bounds checking is done. Note that we return a const T* rather than a reference.

◆ ordered()

JetCollection::OrderedVar JetCollection::ordered ( ) const
inline

Definition at line 68 of file JetCollection.h.

69  { return m_ordered; };

◆ ownPolicy()

SG::OwnershipPolicy DataVector< Jet , BASE >::ownPolicy
inherited

Return the ownership policy setting for this container.

◆ pop_back() [1/2]

void DataVector< Jet , BASE >::pop_back
inherited

Remove the last element from the collection.

If the container owns its elements, then the removed element will be deleted.

◆ pop_back() [2/2]

void DataVector< Jet , BASE >::pop_back
inherited

◆ push_back() [1/3]

void JetCollection::push_back ( Jet j)

Definition at line 82 of file JetCollection.cxx.

82  {
83  acquireJet(j);
85 }

◆ push_back() [2/3]

value_type DataVector< Jet , BASE >::push_back ( std::unique_ptr< base_value_type pElem)
inherited

Add an element to the end of the collection.

Parameters
pElemThe element to add to the collection.

The container must be an owning container.

Note: this method may only be called using the most derived DataVector in the hierarchy.

Returns the pushed pointer.

◆ push_back() [3/3]

value_type DataVector< Jet , BASE >::push_back ( value_type  pElem)
inherited

Add an element to the end of the collection.

Parameters
pElemThe element to add to the collection.

The container's ownership policy will determine if it takes ownership of the new element.

Note: this method may only be called using the most derived DataVector in the hierarchy.

Returns the pushed pointer.

◆ rbegin() [1/2]

const_reverse_iterator DataVector< Jet , BASE >::rbegin
noexceptinherited

Return a const_reverse_iterator pointing past the end of the collection.

Returns
A const_reverse_iterator.

Note that dereferencing the iterator will yield a const T* rather than a reference.

◆ rbegin() [2/2]

reverse_iterator DataVector< Jet , BASE >::rbegin
noexceptinherited

Return a reverse_iterator pointing past the end of the collection.

Returns
A reverse_iterator.

Note that dereferencing the iterator will yield a proxy rather than a reference; the proxy will handle deleting an owned element if it's assigned to.

◆ recordedInSG()

void JetCollection::recordedInSG ( std::string  key)
protected

Definition at line 144 of file JetCollection.cxx.

144  {
145  //std::cout << "JetCollection Recorded "<< m_momentMapLink.cptr() << std::endl;
146  m_ownMap = false;
147  if( key == author() ){
148  key = getMomentMapName();
150  }else {
151  // this should never happen, so I let the raw std::cout
152  std::cout << " JetCollection ERROR attempt to record in SG with key ="<< key << " while author ="<< author() << " both should be the same."<< std::endl;
153  }
154 
155 
156  //
157 
158 }

◆ rend() [1/2]

const_reverse_iterator DataVector< Jet , BASE >::rend
noexceptinherited

Return a const_reverse_iterator pointing at the beginning of the collection.

Returns
A const_reverse_iterator.

Note that dereferencing the iterator will yield a const T* rather than a reference.

◆ rend() [2/2]

reverse_iterator DataVector< Jet , BASE >::rend
noexceptinherited

Return a reverse_iterator pointing at the beginning of the collection.

Returns
A reverse_iterator.

Note that dereferencing the iterator will yield a proxy rather than a reference; the proxy will handle deleting an owned element if it's assigned to.

◆ reserve()

void DataVector< Jet , BASE >::reserve ( size_type  n)
inherited

Attempt to preallocate enough memory for a specified number of elements.

Parameters
nNumber of elements required.

◆ resetJetId()

void JetCollection::resetJetId ( std::size_t  id_)
protected

Definition at line 160 of file JetCollection.cxx.

160  {
161 
162  //make sure the jet belongs to us
163  if (m_ownPolicy == SG::OWN_ELEMENTS) {
164  if ( this->at(id_)->m_collection != this) return;
165  }
166 
167  //this allows changing the jet id of a view collection...not ideal
168 
169  this->at(id_)->setJetId(id_+1);
170 
171 }

◆ resize() [1/2]

void DataVector< Jet , BASE >::resize ( size_type  sz)
inherited

Resizes the collection to the specified number of elements.

Parameters
szThe new size of the collection.

Note that this function differs from the standard in that it does not allow specifying the value of any inserted elements. They will always be 0.

If the container is shrunk, elements will be deleted as with erase().

◆ resize() [2/2]

void DataVector< Jet , BASE >::resize ( size_type  sz)
inherited

◆ resortAux()

void DataVector< Jet , BASE >::resortAux ( iterator  beg,
iterator  end 
)
inherited

Reset indices / reorder aux data after elements have been permuted.

Parameters
begStart of the range of elements to process.
endEnd of the range of elements to process.

Call this after some operation that has permuted the elements in the container (such as sort). The index information in the elements will be used to permute all auxiliary data in the same way. Finally, all the indices will be reset in the correct order.

◆ setAuthor()

void JetCollection::setAuthor ( const std::string &  author)

Definition at line 140 of file JetCollection.cxx.

140  {
142 }

◆ setFastjetClustSeq()

void JetCollection::setFastjetClustSeq ( const fastjet::ClusterSequence *  cs)
inline

Definition at line 144 of file JetCollection.h.

144 { m_fastjetClustSeq = cs;}

◆ setMostDerived()

virtual void DataVector< Jet , BASE >::setMostDerived
protectedvirtualinherited

Set m_isMostDerived for this instance and clear it for all bases.

Called from testInsert if the test fails. The flag may not have been set if this container was made via copy construction, so set it appropriately now so we can test again.

◆ setOrdered()

void JetCollection::setOrdered ( JetCollection::OrderedVar  ordered)
inline

Definition at line 65 of file JetCollection.h.

66  { m_ordered = ordered; return; };

◆ shift()

void DataVector< Jet , BASE >::shift ( size_t  pos,
ptrdiff_t  offs 
)
privateinherited

Shift the auxiliary elements of the container.

Parameters
posThe starting index for the shift.
offsThe (signed) amount of the shift.

The elements in the container should have already been shifted; this operation will then adjust the element indices and also shift the elements in the vectors for all aux data items. offs may be either positive or negative.

If offs is positive, then the container is growing. The container size should be increased by offs, the element at pos moved to pos + offs, and similarly for following elements. The elements between pos and pos + offs should be default-initialized.

If offs is negative, then the container is shrinking. The element at pos should be moved to pos + offs, and similarly for following elements. The container should then be shrunk by -offs elements (running destructors as appropriate).

◆ shrink_to_fit()

void DataVector< Jet , BASE >::shrink_to_fit
inherited

◆ size()

size_type DataVector< Jet , BASE >::size
noexceptinherited

Returns the number of elements in the collection.

Could in principle be inherited from the base class, but redeclared in the derived class to avoid root6 bugs.

◆ sort() [1/2]

void DataVector< Jet , BASE >::sort
inherited

Sort the container.

This just sorts by pointer value, so it's probably not very useful.

◆ sort() [2/2]

void DataVector< Jet , BASE >::sort ( COMPARE  comp)
inherited

Sort the container with a user-specified comparison operator.

Parameters
compFunctional to compare two values.

◆ stdcont()

const PtrVector & DataVector< Jet , BASE >::stdcont
inherited

Return the underlying std::vector of the container.

Returns
Reference to the std::vector actually holding the collection.

Note that DataVector<T>::stdcont does not necessarily return a std::vector<T*> if DataVector inheritance is being used.

◆ swap()

void DataVector< Jet , BASE >::swap ( DataVector< Jet > &  rhs)
inherited

Swap this collection with another.

Parameters
rhsThe collection with which to swap.

Ownership is swapped along with the collection content.

Note: this method may only be called using the most-derived DataVector in the hierarchy. The rhs must also be referenced using the most-derived DataVector.

◆ swapElement() [1/4]

void DataVector< Jet , BASE >::swapElement ( iterator  pos,
std::unique_ptr< base_value_type newElem,
std::unique_ptr< base_value_type > &  oldElem 
)
inherited

Swap one element out of the container.

Parameters
posThe element in the container to swap.
newElemNew element to put in the container. May be 0.
oldElemReference to receive the element removed from the container.

Reference oldElem is initialized with element pos of the collection (no bounds checking). Then element index is set to newElem.

The collection must own its elements to use its interface. The collection will take ownership of newElem and will return ownership of oldElem.

Note: this method may only be called using the most derived DataList in the hierarchy.

◆ swapElement() [2/4]

void DataVector< Jet , BASE >::swapElement ( iterator  pos,
value_type  newElem,
reference  oldElem 
)
inherited

Swap one element out of the container.

Parameters
posThe element in the container to swap.
newElemNew element to put in the container. May be 0.
oldElemReference to receive the element removed from the container.

Reference oldElem is initialized with element pos of the collection (no bounds checking). Then element index is set to newElem. If the collection owns its elements, then it will take ownership of newElem and release (without deleting) the element returned through oldElem.

Note: this method may only be called using the most derived DataList in the hierarchy.

◆ swapElement() [3/4]

void DataVector< Jet , BASE >::swapElement ( size_type  index,
std::unique_ptr< base_value_type newElem,
std::unique_ptr< base_value_type > &  oldElem 
)
inherited

Swap one element out of the container.

Parameters
indexIndex of the element in the container to swap.
newElemNew element to put in the container. May be 0.
oldElemReference to receive the element removed from the container.

Reference oldElem is initialized with element index of the collection (no bounds checking). Then element index is set to newElem.

The collection must own its elements to use its interface. The collection will take ownership of newElem and will return ownership of oldElem.

Note: this method may only be called using the most derived DataVector in the hierarchy.

◆ swapElement() [4/4]

void DataVector< Jet , BASE >::swapElement ( size_type  index,
value_type  newElem,
reference  oldElem 
)
inherited

Swap one element out of the container.

Parameters
indexIndex of the element in the container to swap.
newElemNew element to put in the container. May be 0.
oldElemReference to receive the element removed from the container.

Reference oldElem is initialized with element index of the collection (no bounds checking). Then element index is set to newElem. If the collection owns its elements, then it will take ownership of newElem and release (without deleting) the element returned through oldElem.

Note: this method may only be called using the most derived DataVector in the hierarchy.

◆ testInsert()

void DataVector< Jet , BASE >::testInsert ( const char *  op)
inherited

Test if we can insert; raise an exception if not.

Parameters
opDescription of the attempted operation.

In order to maintain type-safety, we can only allow insertions using the most-derived instance of DataVector. This checks this by testing the m_isMostDerived, which is set by the constructors to true only for the most-derived instance. If the test fails, we call to potentially out-of-line code to continue.

◆ testInsertOol()

void DataVector< Jet , BASE >::testInsertOol ( const char *  op)
inherited

Test if we can insert; raise an exception if not.

Parameters
opDescription of the attempted operation.

This continues the test of testInsert. There is one case where m_isMostDerived may not be set correctly. If this container was made via copy construction, then all the m_isMostDerived flags will be false. So we call setMostDerived to set the flags correctly and test again. If the test fails again, then we raise an exception.

Friends And Related Function Documentation

◆ JetCollectionCnv_p6

friend class JetCollectionCnv_p6
friend

Definition at line 105 of file JetCollection.h.

Member Data Documentation

◆ has_virtual

const bool DataVector< Jet , BASE >::has_virtual
staticinherited

This is true for any DataVector class if we need to use virtual derivation to get to the base DataVector class.

Definition at line 801 of file DataVector.h.

◆ m_deleter

ROOT_SELECTION_NS::MemberAttributes< kTransient > DataVector< Jet , BASE >::m_deleter
inherited

Definition at line 3436 of file DataVector.h.

◆ m_fastjetClustSeq

const fastjet::ClusterSequence* JetCollection::m_fastjetClustSeq
protected

Pointer to the fastjet object this jet is build from.

WARNING : this pointer is meant to be used in reco flow only. It is transient only, provided only to ease calculation of some jet quantities, and will be invalid for jets read from files.

Definition at line 140 of file JetCollection.h.

◆ m_isMostDerived [1/2]

SG::IsMostDerivedFlag DataVector< Jet , BASE >::m_isMostDerived
privateinherited

This flag is true if this DV instance is the most-derived one.

We set this to true in the top-level constructor; the constructor then calls clearMostDerived on the base classes.

Definition at line 2038 of file DataVector.h.

◆ m_isMostDerived [2/2]

ROOT_SELECTION_NS::MemberAttributes< kTransient > DataVector< Jet , BASE >::m_isMostDerived
inherited

Automatically generate dictionary for contained vector.

Declare the automatically created variable transient

Definition at line 3435 of file DataVector.h.

◆ m_jetAuthor

size_t JetCollection::m_jetAuthor
protected

the author of this jetcollection.

We don't forbid it to be different from the m_jetAuthor of individual Jet

Definition at line 114 of file JetCollection.h.

◆ m_keyDescInstance

JetKeyDescriptorInstance JetCollection::m_keyDescInstance
mutableprotected

This JetKeyDescriptorInstance points by default to the global JetKeyDescriptorInstance's store. It is redirected to the key store from the input file when read out. This allows 2 events to be read at the same time.

Definition at line 126 of file JetCollection.h.

◆ m_keyStore

DataLink<JetKeyDescriptor> JetCollection::m_keyStore

link to the JetKeyDescriptor is mandatory for persistency. Access done through the JetKeyDescriptorInstance

Definition at line 94 of file JetCollection.h.

◆ m_momentMapLink

DataLink<JetMomentMap> JetCollection::m_momentMapLink
mutableprotected

Definition at line 108 of file JetCollection.h.

◆ m_nextId

size_t JetCollection::m_nextId
protected

the next free identifier for jets inside this collection

Definition at line 120 of file JetCollection.h.

◆ m_ordered

OrderedVar JetCollection::m_ordered
private

Definition at line 89 of file JetCollection.h.

◆ m_ownMap

bool JetCollection::m_ownMap
mutableprotected

false if the map is recorded in SG

Definition at line 130 of file JetCollection.h.

◆ m_ownPolicy

ROOT_SELECTION_NS::MemberAttributes< kTransient > DataVector< Jet , BASE >::m_ownPolicy
inherited

We do not want to save this.

The P->T converter should decide the ownership mode.

Definition at line 3440 of file DataVector.h.

◆ must_own

constexpr bool DataVector< Jet , BASE >::must_own
staticconstexprinherited

If true, then this type must own its contents.

Definition at line 859 of file DataVector.h.


The documentation for this class was generated from the following files:
JetMomentMap
Definition: JetMomentMap.h:21
Jet::s_defaultJetAuthor
static const size_t s_defaultJetAuthor
Definition: Reconstruction/Jet/JetEvent/JetEvent/Jet.h:723
JetCollection::ByAbsEtaUp
@ ByAbsEtaUp
Definition: JetCollection.h:43
JetKeyDescriptorInstance::m_Stores
JetKeyDescriptor * m_Stores
Definition: JetKeyDescriptor.h:155
Jet::setJetId
void setJetId(size_t id)
Definition: Reconstruction/Jet/JetEvent/src/Jet.cxx:1200
Jet::getMomentMap
const shape_map_t * getMomentMap(bool addIfMissing) const
Definition: Reconstruction/Jet/JetEvent/src/Jet.cxx:1164
DataVector< Jet >::m_ownPolicy
ROOT_SELECTION_NS::MemberAttributes< kTransient > m_ownPolicy
We do not want to save this.
Definition: DataVector.h:3440
JetCollection::keyDesc
JetKeyDescriptorInstance * keyDesc() const
Definition: JetCollection.cxx:43
JetCollection::ByAbsEtaDown
@ ByAbsEtaDown
Definition: JetCollection.h:44
SG::VIEW_ELEMENTS
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts
Definition: OwnershipPolicy.h:18
skel.it
it
Definition: skel.GENtoEVGEN.py:423
JetCollection::acquireJet
void acquireJet(Jet *j)
Definition: JetCollection.cxx:105
JetCollection::ByPhiUp
@ ByPhiUp
Definition: JetCollection.h:46
JetCollection::m_fastjetClustSeq
const fastjet::ClusterSequence * m_fastjetClustSeq
Pointer to the fastjet object this jet is build from.
Definition: JetCollection.h:140
TruthTest.itE
itE
Definition: TruthTest.py:25
JetKeyDescriptorInstance::instance
static JetKeyDescriptorInstance * instance()
Definition: JetKeyDescriptor.h:123
Jet::id
size_t id() const
returns this jet unique identifier in its collection
Definition: Reconstruction/Jet/JetEvent/src/Jet.cxx:1194
JetMapBase::transferRecord
virtual void transferRecord(const JetMapBase< P > *fromMap, size_t oldIndex, size_t newIndex) const
transfer a record from an other map
JetCollection::ByEDown
@ ByEDown
Definition: JetCollection.h:39
JetCollection::m_ordered
OrderedVar m_ordered
Definition: JetCollection.h:89
JetCollection::getMomentMapName
std::string getMomentMapName() const
Definition: JetCollection.cxx:47
JetKeyDescriptorInstance::createKeyStore
void createKeyStore() const
Definition: JetKeyDescriptor.cxx:34
Jet::parentCollection
const JetCollection * parentCollection() const
a pointer to the collection this jet belongs to (can be NULL)
Definition: Reconstruction/Jet/JetEvent/src/Jet.cxx:1196
Random
Definition: TrigAnalysis/TrigInDetAnalysisUser/Resplot/src/Random.h:26
JetMomentMap
Athena::TPCnvVers::Old Athena::TPCnvVers::Old Athena::TPCnvVers::Old Athena::TPCnvVers::Old Athena::TPCnvVers::Current JetMomentMap
Definition: JetEventTPCnv.cxx:103
SG::OWN_ELEMENTS
@ OWN_ELEMENTS
this data object owns its elements
Definition: OwnershipPolicy.h:17
JetCollection::m_keyDescInstance
JetKeyDescriptorInstance m_keyDescInstance
This JetKeyDescriptorInstance points by default to the global JetKeyDescriptorInstance's store....
Definition: JetCollection.h:126
JetCollection::m_nextId
size_t m_nextId
the next free identifier for jets inside this collection
Definition: JetCollection.h:120
JetCollection::m_jetAuthor
size_t m_jetAuthor
the author of this jetcollection.
Definition: JetCollection.h:114
JetCollection::ordered
JetCollection::OrderedVar ordered() const
Definition: JetCollection.h:68
JetCollection::ByPtDown
@ ByPtDown
Definition: JetCollection.h:37
JetCollection::ByEtUp
@ ByEtUp
Definition: JetCollection.h:36
DataVector::insert
iterator insert(iterator position, value_type pElem)
Add a new element to the collection.
Jet::jetAuthor
std::string jetAuthor() const
Author and calibration history are encoded in a simple way inside the jet object.
Definition: Reconstruction/Jet/JetEvent/src/Jet.cxx:1108
JetKeyDescriptorInstance::getKey
const key_t & getKey(const category_t &cat, size_t index) const
Definition: JetKeyDescriptor.cxx:161
Jet::m_collection
const JetCollection * m_collection
Shape store link.
Definition: Reconstruction/Jet/JetEvent/JetEvent/Jet.h:676
DataVector< Jet >
DataVector::clear
void clear()
Erase all the elements in the collection.
JetCollection::m_momentMapLink
DataLink< JetMomentMap > m_momentMapLink
Definition: JetCollection.h:108
JetKeyConstants::InfoCat
static const key_t InfoCat
Index category for general jet info.
Definition: JetKeyDescriptor.h:94
JetCollection::ByEtaUp
@ ByEtaUp
Definition: JetCollection.h:41
Jet::m_jetAuthor
size_t m_jetAuthor
Jet author store.
Definition: Reconstruction/Jet/JetEvent/JetEvent/Jet.h:725
JetCollection::author
std::string author() const
Definition: JetCollection.cxx:136
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
JetCollection::ByEtDown
@ ByEtDown
Definition: JetCollection.h:35
JetCollection::m_ownMap
bool m_ownMap
false if the map is recorded in SG
Definition: JetCollection.h:130
JetCollection::ByEtaDown
@ ByEtaDown
Definition: JetCollection.h:42
JetCollection::ByEUp
@ ByEUp
Definition: JetCollection.h:40
DataVector< Jet >::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
JetCollection::getMomentMap
const JetMomentMap * getMomentMap() const
Definition: JetCollection.cxx:53
JetCollection::InEtaPhiUp
@ InEtaPhiUp
Definition: JetCollection.h:48
JetCollection::getNextId
size_t getNextId()
Definition: JetCollection.cxx:78
JetCollection::ByPhiDown
@ ByPhiDown
Definition: JetCollection.h:45
DeMoScan.first
bool first
Definition: DeMoScan.py:534
Jet::s_defaultJetId
static const size_t s_defaultJetId
Definition: Reconstruction/Jet/JetEvent/JetEvent/Jet.h:670
JetCollection::ByPtUp
@ ByPtUp
Definition: JetCollection.h:38
DataVector< Jet >::ownPolicy
SG::OwnershipPolicy ownPolicy() const
Return the ownership policy setting for this container.
JetKeyDescriptorInstance::getIndex
size_t getIndex(const category_t &cat, const key_t &key, bool createIfMissing=true)
Definition: JetKeyDescriptor.cxx:47
DataVector< Jet >::at
const Jet * at(size_type n) const
Access an element, as an rvalue.
JetMapBase::m_ownPolicy
SG::OwnershipPolicy m_ownPolicy
Definition: JetMapBase.h:168
JetCollection::iterator
DataVector< Jet >::iterator iterator
Definition: JetCollection.h:34
hist_file_dump.ordering
ordering
Definition: hist_file_dump.py:80
DataVector< Jet >::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
JetCollection::InEtaPhiDown
@ InEtaPhiDown
Definition: JetCollection.h:47
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37
JetKeyDescriptorInstance::m_ConstStores
const JetKeyDescriptor * m_ConstStores
Definition: JetKeyDescriptor.h:156