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

#include <JetMomentMap.h>

Inheritance diagram for JetMomentMap:
Collaboration diagram for JetMomentMap:

Public Types

typedef JetMoment::float_t float_t
 
typedef JetMoment::tag_t tag_t
 
typedef JetMoment::MomentData data_t
 
typedef JetMapBase< data_tbase_t
 
typedef base_t::map_t map_t
 
typedef base_t::record_t record_t
 
typedef size_t key_t
 Publish key type. More...
 

Public Member Functions

 JetMomentMap ()
 
virtual ~JetMomentMap ()
 
virtual bool setMoment (size_t jetIndex, size_t keyIndex, float_t moment)
 
virtual bool setMoment (size_t jetIndex, size_t keyIndex, float_t moment) const
 
virtual bool getMoment (size_t jetIndex, size_t keyIndex, float_t &moment) const
 
virtual float_t getMoment (size_t jetIndex, size_t keyIndex) const
 
void access () const
 
virtual bool addRecord (size_t jetIndex) const
 Add a record. More...
 
virtual const record_tgetRecord (size_t jetIndex) const
 get the full record for a given jet More...
 
virtual void assignRecord (size_t jetIndex, record_t *rec) const
 assign a given record to a given jet More...
 
virtual void addData (size_t jetIndex, size_t keyIndex, const data_t &data) const
 Add data. More...
 
virtual bool retrieveData (size_t jetIndex, size_t keyIndex, data_t &data) const
 Retrieve data. More...
 
virtual const data_taccessData (size_t jetIndex, size_t keyIndex) const
 
virtual size_t numberOfMoments (size_t jetIndex) const
 
virtual void clear ()
 
virtual void clear (SG::OwnershipPolicy)
 
SG::OwnershipPolicy ownPolicy ()
 

Protected Member Functions

virtual void removeRecord (size_t jetIndex) const
 remove a record More...
 
virtual void transferRecord (const JetMapBase< JetMoment::MomentData > *fromMap, size_t oldIndex, size_t newIndex) const
 transfer a record from an other map More...
 
map_tmap ()
 
const map_tmap () const
 

Protected Attributes

map_t m_store
 Store last valid record index ‍/ mutable size_t m_lastIndex; not used so remove it for simplicity /! More...
 
map_t::iterator m_end
 
SG::OwnershipPolicy m_ownPolicy
 

Static Protected Attributes

static const data_t m_nullData
 Null data reference. More...
 

Friends

class JetCollection
 

Detailed Description

Author
Peter Loch loch@.nosp@m.phys.nosp@m.ics.a.nosp@m.rizo.nosp@m.na.ed.nosp@m.u
Rolf Seuster Rolf..nosp@m.Seus.nosp@m.ter@c.nosp@m.ern..nosp@m.ch
Michel Lefebvre lefeb.nosp@m.vre@.nosp@m.uvic..nosp@m.ca
Date
June 29, 2006

DEPRECIATED. Jets now store moment internally

Keyed store for jet moments. The key is the pointer to the Jet, and the data is a JetMomentStore.

Definition at line 20 of file JetMomentMap.h.

Member Typedef Documentation

◆ base_t

Definition at line 30 of file JetMomentMap.h.

◆ data_t

Definition at line 29 of file JetMomentMap.h.

◆ float_t

Definition at line 27 of file JetMomentMap.h.

◆ key_t

typedef size_t JetMapBase< JetMoment::MomentData >::key_t
inherited

Publish key type.

Definition at line 50 of file JetMapBase.h.

◆ map_t

Definition at line 31 of file JetMomentMap.h.

◆ record_t

Definition at line 32 of file JetMomentMap.h.

◆ tag_t

Definition at line 28 of file JetMomentMap.h.

Constructor & Destructor Documentation

◆ JetMomentMap()

JetMomentMap::JetMomentMap ( )

Definition at line 9 of file JetMomentMap.cxx.

9  : base_t()
10 {
11 }

◆ ~JetMomentMap()

JetMomentMap::~JetMomentMap ( )
virtualdefault

Member Function Documentation

◆ access()

void JetMomentMap::access ( ) const
inline

Definition at line 45 of file JetMomentMap.h.

45 { };

◆ accessData()

virtual const data_t& JetMapBase< JetMoment::MomentData >::accessData ( size_t  jetIndex,
size_t  keyIndex 
) const
virtualinherited

◆ addData()

virtual void JetMapBase< JetMoment::MomentData >::addData ( size_t  jetIndex,
size_t  keyIndex,
const data_t data 
) const
virtualinherited

Add data.

This method adds data to an existing record.

Parameters
jetIndexindex of the record in the store
keyIndexindex of the data in the record
datareference to non-mdoifiable data to be stored in record

Note that this method will overwrite any previously stored data at the (jetIndex,keyIndex) position.

◆ addRecord()

virtual bool JetMapBase< JetMoment::MomentData >::addRecord ( size_t  jetIndex) const
virtualinherited

Add a record.

This method adds a record to the store and returns the index of this record to the client. The returned value is false if the record already existed

Parameters
JetIndexreference to modifiable index, will contain the last index in the store.

◆ assignRecord()

virtual void JetMapBase< JetMoment::MomentData >::assignRecord ( size_t  jetIndex,
record_t rec 
) const
virtualinherited

assign a given record to a given jet

The map will 'own' the given record : it will delete it when destructed. If a record already exist at jetIndex, it will be deleted.

Parameters
jetIndexindex of the record in the store
recpointer to the record to store.

◆ clear() [1/2]

virtual void JetMapBase< JetMoment::MomentData >::clear
virtualinherited

◆ clear() [2/2]

virtual void JetMapBase< JetMoment::MomentData >::clear ( SG::OwnershipPolicy  )
inlinevirtualinherited

Definition at line 125 of file JetMapBase.h.

125 {clear();}

◆ getMoment() [1/2]

JetMomentMap::float_t JetMomentMap::getMoment ( size_t  jetIndex,
size_t  keyIndex 
) const
virtual

Definition at line 44 of file JetMomentMap.cxx.

45 {
47  return this->retrieveData(jetIndex,keyIndex,ds) && ds.tag()
48  ? ds.moment() : JetMoment::invalidMoment();
49 }

◆ getMoment() [2/2]

bool JetMomentMap::getMoment ( size_t  jetIndex,
size_t  keyIndex,
float_t moment 
) const
virtual

Definition at line 34 of file JetMomentMap.cxx.

35 {
37  if ( !this->retrieveData(jetIndex,keyIndex,ds) ) return false;
38  // successfully retrieved
39  moment = ds.moment();
40  return ds.tag();
41 }

◆ getRecord()

virtual const record_t* JetMapBase< JetMoment::MomentData >::getRecord ( size_t  jetIndex) const
virtualinherited

get the full record for a given jet

◆ map() [1/2]

map_t& JetMapBase< JetMoment::MomentData >::map
protectedinherited

◆ map() [2/2]

const map_t& JetMapBase< JetMoment::MomentData >::map
protectedinherited

◆ numberOfMoments()

virtual size_t JetMapBase< JetMoment::MomentData >::numberOfMoments ( size_t  jetIndex) const
virtualinherited

◆ ownPolicy()

SG::OwnershipPolicy JetMapBase< JetMoment::MomentData >::ownPolicy
inlineinherited

Definition at line 127 of file JetMapBase.h.

127 {return m_ownPolicy;};

◆ removeRecord()

virtual void JetMapBase< JetMoment::MomentData >::removeRecord ( size_t  jetIndex) const
protectedvirtualinherited

remove a record

Destroy the record associated to an entry.

Parameters
jetIndexidentifier of the record to remove

◆ retrieveData()

virtual bool JetMapBase< JetMoment::MomentData >::retrieveData ( size_t  jetIndex,
size_t  keyIndex,
data_t data 
) const
virtualinherited

Retrieve data.

Retrieves data by index pair and stores result in client supplied variable. Returns false if index pair (jetIndex,keyIndex) refers to non-existing entry, i.e. at least one of (jetIndex,keyIndex) is out of range.

Parameters
jetIndexindex of record in store
keyIndexindex of data in record
datareference to modifiable variable storing retrieved data

Note that in case of an invalid index pair the original value of data is not changed.

◆ setMoment() [1/2]

bool JetMomentMap::setMoment ( size_t  jetIndex,
size_t  keyIndex,
float_t  moment 
)
virtual

Definition at line 18 of file JetMomentMap.cxx.

19 {
20  data_t ds(moment,true);
21  this->addData(jetIndex,keyIndex,ds);
22  return true;
23 }

◆ setMoment() [2/2]

bool JetMomentMap::setMoment ( size_t  jetIndex,
size_t  keyIndex,
float_t  moment 
) const
virtual

Definition at line 26 of file JetMomentMap.cxx.

27 {
28  data_t ds(moment,true);
29  this->addData(jetIndex,keyIndex,ds);
30  return true;
31 }

◆ transferRecord()

virtual void JetMapBase< JetMoment::MomentData >::transferRecord ( const JetMapBase< JetMoment::MomentData > *  fromMap,
size_t  oldIndex,
size_t  newIndex 
) const
protectedvirtualinherited

transfer a record from an other map

Parameters
fromMappointer to the other map
oldIndexidentifier of the record in the other map
newIndexthe identifier in this map

Friends And Related Function Documentation

◆ JetCollection

friend class JetCollection
friend

Definition at line 25 of file JetMomentMap.h.

Member Data Documentation

◆ m_end

map_t::iterator JetMapBase< JetMoment::MomentData >::m_end
protectedinherited

Definition at line 164 of file JetMapBase.h.

◆ m_nullData

const data_t JetMapBase< JetMoment::MomentData >::m_nullData
staticprotectedinherited

Null data reference.

Definition at line 162 of file JetMapBase.h.

◆ m_ownPolicy

SG::OwnershipPolicy JetMapBase< JetMoment::MomentData >::m_ownPolicy
protectedinherited

Definition at line 168 of file JetMapBase.h.

◆ m_store

map_t JetMapBase< JetMoment::MomentData >::m_store
mutableprotectedinherited

Store last valid record index ‍/ mutable size_t m_lastIndex; not used so remove it for simplicity /!

Data store

Definition at line 160 of file JetMapBase.h.


The documentation for this class was generated from the following files:
checkxAOD.ds
ds
Definition: Tools/PyUtils/bin/checkxAOD.py:257
JetMapBase< JetMoment::MomentData >::retrieveData
virtual bool retrieveData(size_t jetIndex, size_t keyIndex, data_t &data) const
Retrieve data.
JetMomentMap::data_t
JetMoment::MomentData data_t
Definition: JetMomentMap.h:29
JetMomentMap::base_t
JetMapBase< data_t > base_t
Definition: JetMomentMap.h:30
JetMoment::invalidMoment
static float_t invalidMoment()
Definition: JetMoment.h:17
JetMapBase< JetMoment::MomentData >::addData
virtual void addData(size_t jetIndex, size_t keyIndex, const data_t &data) const
Add data.
JetMapBase< JetMoment::MomentData >::m_ownPolicy
SG::OwnershipPolicy m_ownPolicy
Definition: JetMapBase.h:168
JetMapBase< JetMoment::MomentData >::clear
virtual void clear()