ATLAS Offline Software
CaloClusterMomentContainerCnv_p1.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 //#include "CaloTPCnv/CaloClusterMomentContainer_p1.h"
9 
11 {
12 }
13 
16 {
20  for(;it!=it_e;++it) {
21  mom.key=it.getMomentType();
22  mom.value=it.getMoment().getValue();
23  pers->m_store.push_back(mom);
24  }
25 }
26 
29  CaloClusterMomentContainer_p1::const_iterator& momentStoreIterator) const
30 {
31  typedef CaloClusterMomentStore::moment_store moment_store;
32  typedef moment_store::value_type value_type;
33  moment_store transStore;
34 
35  for (unsigned short i=0;i<pers->m_nMoments;++i) {
36  //trans->insert((CaloClusterMoment::MomentType)momentStoreIterator->key,
37  // CaloClusterMoment(momentStoreIterator->value));
38  //Insert with 'hint', should be faster
39  transStore.insert(transStore.end(),
40  value_type(momentStoreIterator->key,
41  momentStoreIterator->value));
42  ++momentStoreIterator;
43  }
44  trans->setMomentStore (std::move (transStore));
45 }
46 
48  unsigned int ncluster,
49  CaloClusterMomentContainer_p1::const_iterator& momentStoreIterator) const
50 {
51  momentStoreIterator=pers->m_store.begin();
52 
53  if (pers->m_nMoments * ncluster != pers->m_store.size()) {
54  REPORT_MESSAGE_WITH_CONTEXT(MSG::WARNING, "CaloClusterMomentContainerCnv_p1")
55  << "Corrupted persistent data seen: "
56  << ncluster << " clusters * "
57  << pers->m_nMoments << " moments != "
58  << pers->m_store.size() << " stored values.";
59  return false;
60  }
61 
62  return true;
63 }
64 
65 
CaloClusterMomentContainer_p1::m_nMoments
unsigned short m_nMoments
Definition: CaloClusterMomentContainer_p1.h:19
CaloClusterMomentContainer_p1::const_iterator
std::vector< ClusterMoment_p >::const_iterator const_iterator
Definition: CaloClusterMomentContainer_p1.h:20
CaloClusterMomentStore::setMomentStore
virtual void setMomentStore(const moment_store &rMomStore)
Set internal store.
Definition: CaloClusterMomentStore.h:253
skel.it
it
Definition: skel.GENtoEVGEN.py:396
CaloClusterMomentStore::CaloClusterMomentIterator
Internally used iterator.
Definition: CaloClusterMomentStore.h:54
CaloClusterMomentStore
Stores CaloClusterMoment in a keyed map.
Definition: CaloClusterMomentStore.h:15
CaloClusterMomentStore::begin
virtual moment_iterator begin() const
{
Definition: CaloClusterMomentStore.h:220
ParticleGun_EoverP_Config.mom
mom
Definition: ParticleGun_EoverP_Config.py:63
CaloClusterMomentContainer_p1
Definition: CaloClusterMomentContainer_p1.h:10
lumiFormat.i
int i
Definition: lumiFormat.py:85
CaloClusterMomentContainerCnv_p1::CaloClusterMomentContainerCnv_p1
CaloClusterMomentContainerCnv_p1()
Definition: CaloClusterMomentContainerCnv_p1.cxx:10
CaloClusterMomentStore.h
CaloClusterMomentContainerCnv_p1::persToTrans
void persToTrans(const CaloClusterMomentContainer_p1 *pers, CaloClusterMomentStore *trans, CaloClusterMomentContainer_p1::const_iterator &momentStoreIterator) const
Definition: CaloClusterMomentContainerCnv_p1.cxx:27
CaloClusterMomentContainerCnv_p1.h
REPORT_MESSAGE_WITH_CONTEXT
#define REPORT_MESSAGE_WITH_CONTEXT(LVL, CONTEXT_NAME)
Report a message, with an explicitly specified context name.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:345
errorcheck.h
Helpers for checking error return status codes and reporting errors.
CaloClusterMomentContainerCnv_p1::transToPers
void transToPers(const CaloClusterMomentStore *trans, CaloClusterMomentContainer_p1 *pers) const
Definition: CaloClusterMomentContainerCnv_p1.cxx:14
CaloClusterMomentContainerCnv_p1::setIterator
bool setIterator(const CaloClusterMomentContainer_p1 *pers, unsigned int ncluster, CaloClusterMomentContainer_p1::const_iterator &momentStoreIterator) const
Definition: CaloClusterMomentContainerCnv_p1.cxx:47
CaloClusterMomentStore::moment_store
std::map< moment_key, moment_value > moment_store
Internal moment store type.
Definition: CaloClusterMomentStore.h:35
CaloClusterMomentStore::end
virtual moment_iterator end() const
iterator loop terminator
Definition: CaloClusterMomentStore.h:226
CaloClusterMomentContainer_p1::ClusterMoment_p
Definition: CaloClusterMomentContainer_p1.h:14
value_type
Definition: EDM_MasterSearch.h:11
CaloClusterMomentContainer_p1::m_store
std::vector< ClusterMoment_p > m_store
Definition: CaloClusterMomentContainer_p1.h:18