ATLAS Offline Software
CaloClusterMomentStore.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 
7 
8 // constructor
10 { }
11 
13  rMomStore)
14  : m_store (rMomStore.m_store)
15 {
16 }
17 
19  pMomStore)
20  : m_store (pMomStore->m_store)
21 {
22 }
23 
26 {
27  if (this != &rMomStore)
28  m_store = rMomStore.m_store;
29  return *this;
30 }
31 
32 // destructor
34 { }
35 
36 // retrieve moment value
38  moment_value& rMomData) const
39 {
40  moment_iterator fIter = this->find(rMomType);
41  return this->retrieve(fIter,rMomData);
42 }
44  moment_value& rMomData) const
45 {
46  if ( rMomIter != this->end() )
47  {
48  rMomData = rMomIter.getMoment();
49  return true;
50  }
51  else
52  {
53  return false;
54  }
55 }
56 
57 // retrieve all stored moment types
59  rMomList) const
60 {
61  size_t oldSize = rMomList.size();
62  moment_store_const_iter fMom = m_store.begin();
63  moment_store_const_iter lMom = m_store.end();
64  for ( ; fMom != lMom; ++fMom )
65  {
66  rMomList.push_back((moment_type)(*fMom).first);
67  }
68  return oldSize < rMomList.size();
69 }
70 
71 
72 #ifdef __clang__
73 CaloClusterMomentStore::CaloClusterMomentIterator::~CaloClusterMomentIterator() {}
74 #endif
CaloClusterMoment::MomentType
MomentType
enums to identify different moments
Definition: CaloClusterMoment.h:38
CaloClusterMomentStore::operator=
CaloClusterMomentStore & operator=(const CaloClusterMomentStore &rMomStore)
Assignment.
Definition: CaloClusterMomentStore.cxx:25
CaloClusterMomentStore::moment_store_const_iter
moment_store::const_iterator moment_store_const_iter
Internal moment store const iterator type.
Definition: CaloClusterMomentStore.h:37
CaloClusterMomentStore::CaloClusterMomentIterator
Internally used iterator.
Definition: CaloClusterMomentStore.h:54
CaloClusterMomentStore::retrieveMomentTypes
virtual bool retrieveMomentTypes(moment_type_list &rMomTypeList) const
Retrieve list of moment types in store.
Definition: CaloClusterMomentStore.cxx:58
CaloClusterMomentStore
Stores CaloClusterMoment in a keyed map.
Definition: CaloClusterMomentStore.h:15
CaloClusterMomentStore::~CaloClusterMomentStore
virtual ~CaloClusterMomentStore()
Default destructor.
Definition: CaloClusterMomentStore.cxx:33
CaloClusterMomentStore.h
CaloClusterMomentStore::find
virtual moment_iterator find(const moment_type &rMomType) const
}
Definition: CaloClusterMomentStore.h:232
CaloClusterMomentStore::moment_type_list
std::vector< moment_type > moment_type_list
List of moment types.
Definition: CaloClusterMomentStore.h:41
CaloClusterMomentStore::m_store
moment_store m_store
Definition: CaloClusterMomentStore.h:210
CaloClusterMomentStore::retrieve
virtual bool retrieve(const moment_type &rMomType, moment_value &rMomData) const
Retrieve cluster moment for a given key.
Definition: CaloClusterMomentStore.cxx:37
CaloClusterMomentStore::end
virtual moment_iterator end() const
iterator loop terminator
Definition: CaloClusterMomentStore.h:226
CaloClusterMoment
defines enums and data types for different moments of CaloCluster
Definition: CaloClusterMoment.h:29
CaloClusterMomentStore::CaloClusterMomentStore
CaloClusterMomentStore()
Default constructor.
Definition: CaloClusterMomentStore.cxx:9